diff --git a/.generated_docs b/.generated_docs index 0622264cd62..8d5233ff08a 100644 --- a/.generated_docs +++ b/.generated_docs @@ -44,6 +44,9 @@ docs/man/man1/kubectl-proxy.1 docs/man/man1/kubectl-replace.1 docs/man/man1/kubectl-rolling-update.1 docs/man/man1/kubectl-rollout-history.1 +docs/man/man1/kubectl-rollout-pause.1 +docs/man/man1/kubectl-rollout-resume.1 +docs/man/man1/kubectl-rollout-undo.1 docs/man/man1/kubectl-rollout.1 docs/man/man1/kubectl-run.1 docs/man/man1/kubectl-scale.1 @@ -92,6 +95,9 @@ docs/user-guide/kubectl/kubectl_replace.md docs/user-guide/kubectl/kubectl_rolling-update.md docs/user-guide/kubectl/kubectl_rollout.md docs/user-guide/kubectl/kubectl_rollout_history.md +docs/user-guide/kubectl/kubectl_rollout_pause.md +docs/user-guide/kubectl/kubectl_rollout_resume.md +docs/user-guide/kubectl/kubectl_rollout_undo.md docs/user-guide/kubectl/kubectl_run.md docs/user-guide/kubectl/kubectl_scale.md docs/user-guide/kubectl/kubectl_uncordon.md diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index f93395b03ac..ef9c747995c 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -132,12 +132,8 @@ }, { "ImportPath": "github.com/boltdb/bolt", - "Comment": "v1.0-119-g90fef38", - "Rev": "90fef389f98027ca55594edd7dbd6e7f3926fdad" - }, - { - "ImportPath": "github.com/bradfitz/http2", - "Rev": "3e36af6d3af0e56fa3da71099f864933dea3d9fb" + "Comment": "v1.1.0-65-gee4a088", + "Rev": "ee4a0888a9abe7eefe5a0992ca4cb06864839873" }, { "ImportPath": "github.com/camlistore/go4/errorutil", @@ -150,123 +146,123 @@ }, { "ImportPath": "github.com/coreos/etcd/client", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/discovery", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/error", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/etcdserver", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/crc", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/fileutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/httputil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/idutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/ioutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/netutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/pathutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/pbutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/runtime", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/timeutil", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/transport", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/types", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/pkg/wait", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/raft", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/rafthttp", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/snap", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/storage", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/store", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/version", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/etcd/wal", - "Comment": "v2.2.2-4-ge0c7768", - "Rev": "e0c7768f94cdc268b2fce31ada1dea823f11f505" + "Comment": "v2.2.5", + "Rev": "bc9ddf260115d2680191c46977ae72b837785472" }, { "ImportPath": "github.com/coreos/go-etcd/etcd", @@ -340,8 +336,8 @@ }, { "ImportPath": "github.com/coreos/rkt/api/v1alpha", - "Comment": "v0.15.0-22-g8ac03ac", - "Rev": "8ac03ace42034b4d6b31af9e3ef574b9e71ccc1a" + "Comment": "v1.0.0", + "Rev": "1ddc36601c8688ff207210bc9ecbf973d09573fa" }, { "ImportPath": "github.com/cpuguy83/go-md2man/md2man", @@ -403,7 +399,7 @@ }, { "ImportPath": "github.com/docker/spdystream", - "Rev": "c33989bcb56748d2473194d11f8ac3fc563688eb" + "Rev": "106e140db2cb50923efe088bf2906b2ee5a45fec" }, { "ImportPath": "github.com/elazarl/go-bindata-assetfs", @@ -425,8 +421,7 @@ }, { "ImportPath": "github.com/fsouza/go-dockerclient", - "Comment": "0.2.1-728-g1399676", - "Rev": "299d728486342c894e7fafd68e3a4b89623bef1d" + "Rev": "0099401a7342ad77e71ca9f9a57c5e72fb80f6b2" }, { "ImportPath": "github.com/garyburd/redigo/internal", @@ -452,118 +447,118 @@ }, { "ImportPath": "github.com/gogo/protobuf/gogoproto", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/description", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/equal", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/face", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/gostring", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/grpc", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/marshalto", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/populate", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/size", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/stringer", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/testgen", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/union", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/proto", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/gogo/protobuf/vanity", - "Comment": "v0.1-108-g9dc5109", - "Rev": "9dc510915846dd5a05607d3b5bf41f5ca5cce972" + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, { "ImportPath": "github.com/golang/glog", @@ -575,7 +570,7 @@ }, { "ImportPath": "github.com/golang/protobuf/proto", - "Rev": "7f07925444bb51fa4cf9dfe6f7661876f8852275" + "Rev": "b982704f8bb716bb608144408cff30e15fbde841" }, { "ImportPath": "github.com/google/btree", @@ -583,93 +578,93 @@ }, { "ImportPath": "github.com/google/cadvisor/api", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/cache/memory", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/collector", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/container", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/events", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/fs", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/healthz", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/http", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/info/v1", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/info/v2", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/manager", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/metrics", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/pages", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/storage", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/summary", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/utils", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/validate", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/cadvisor/version", - "Comment": "v0.20.5", - "Rev": "9aa348ff5e191fcf3eccd59e5a434022aca77b87" + "Comment": "v0.21.1", + "Rev": "49a08d5139ae0111757a110ea3b55fe9a607873d" }, { "ImportPath": "github.com/google/gofuzz", @@ -824,8 +819,8 @@ }, { "ImportPath": "github.com/onsi/ginkgo", - "Comment": "v1.2.0-6-gd981d36", - "Rev": "d981d36e9884231afa909627b9c275e4ba678f90" + "Comment": "v1.2.0-42-g07d85e6", + "Rev": "07d85e6b10c4289c7d612f9b13f45ba36f66d55b" }, { "ImportPath": "github.com/onsi/gomega", @@ -931,7 +926,7 @@ }, { "ImportPath": "github.com/ugorji/go/codec", - "Rev": "f1f1a805ed361a0e078bb537e4ea78cd37dcf065" + "Rev": "4a79e5b7b21e51ae8d61641bca20399b79735a32" }, { "ImportPath": "github.com/vishvananda/netlink", @@ -970,6 +965,10 @@ "ImportPath": "golang.org/x/net/html", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, + { + "ImportPath": "golang.org/x/net/http2", + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" + }, { "ImportPath": "golang.org/x/net/internal/timeseries", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" @@ -1028,7 +1027,7 @@ }, { "ImportPath": "google.golang.org/grpc", - "Rev": "4bd040ce23a624ff9a1d07b0e729ee189bddd51c" + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" }, { "ImportPath": "gopkg.in/natefinch/lumberjack.v2", @@ -1041,7 +1040,7 @@ }, { "ImportPath": "k8s.io/heapster/api/v1/types", - "Comment": "v0.19.1", + "Comment": "v0.19.1-44-g0991ac5", "Rev": "0991ac528ea24aae194e45d6dcf01896cb42cbea" }, { diff --git a/Godeps/LICENSES.md b/Godeps/LICENSES.md index ce6220319e0..448927f8de5 100644 --- a/Godeps/LICENSES.md +++ b/Godeps/LICENSES.md @@ -13,7 +13,6 @@ github.com/aws/aws-sdk-go | Apache-2 github.com/beorn7/perks/quantile | MIT? github.com/blang/semver | MITname github.com/boltdb/bolt | MITname -github.com/bradfitz/http2 | BSDlikeRef github.com/camlistore/go4 | Apache-2 github.com/ClusterHQ/flocker-go | UNKNOWN github.com/codegangsta/negroni | MITname @@ -23,7 +22,7 @@ github.com/coreos/go-oidc | Apache-2 github.com/coreos/go-semver | Apache-2 github.com/coreos/go-systemd | Apache-2 github.com/coreos/pkg | Apache-2 -github.com/coreos/rkt | Apache-2 +github.com/coreos/rkt | MITname github.com/cpuguy83/go-md2man | MITname github.com/davecgh/go-spew | MIToldwithoutSellandNoDocumentationRequi github.com/daviddengcn/go-colortext | BSD? diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/Makefile b/Godeps/_workspace/src/github.com/boltdb/bolt/Makefile index cfbed514bbb..e035e63adcd 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/Makefile +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/Makefile @@ -1,54 +1,18 @@ -TEST=. -BENCH=. -COVERPROFILE=/tmp/c.out BRANCH=`git rev-parse --abbrev-ref HEAD` COMMIT=`git rev-parse --short HEAD` GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)" default: build -bench: - go test -v -test.run=NOTHINCONTAINSTHIS -test.bench=$(BENCH) - -# http://cloc.sourceforge.net/ -cloc: - @cloc --not-match-f='Makefile|_test.go' . - -cover: fmt - go test -coverprofile=$(COVERPROFILE) -test.run=$(TEST) $(COVERFLAG) . - go tool cover -html=$(COVERPROFILE) - rm $(COVERPROFILE) - -cpuprofile: fmt - @go test -c - @./bolt.test -test.v -test.run=$(TEST) -test.cpuprofile cpu.prof +race: + @go test -v -race -test.run="TestSimulate_(100op|1000op)" # go get github.com/kisielk/errcheck errcheck: - @echo "=== errcheck ===" - @errcheck github.com/boltdb/bolt + @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt -fmt: - @go fmt ./... +test: + @go test -v -cover . + @go test -v ./cmd/bolt -get: - @go get -d ./... - -build: get - @mkdir -p bin - @go build -ldflags=$(GOLDFLAGS) -a -o bin/bolt ./cmd/bolt - -test: fmt - @go get github.com/stretchr/testify/assert - @echo "=== TESTS ===" - @go test -v -cover -test.run=$(TEST) - @echo "" - @echo "" - @echo "=== CLI ===" - @go test -v -test.run=$(TEST) ./cmd/bolt - @echo "" - @echo "" - @echo "=== RACE DETECTOR ===" - @go test -v -race -test.run="TestSimulate_(100op|1000op)" - -.PHONY: bench cloc cover cpuprofile fmt memprofile test +.PHONY: fmt test diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/README.md b/Godeps/_workspace/src/github.com/boltdb/bolt/README.md index 00fad6afb8b..82e85742c04 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/README.md +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/README.md @@ -1,8 +1,8 @@ -Bolt [![Build Status](https://drone.io/github.com/boltdb/bolt/status.png)](https://drone.io/github.com/boltdb/bolt/latest) [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.png?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.png)](https://godoc.org/github.com/boltdb/bolt) ![Version](http://img.shields.io/badge/version-1.0-green.png) +Bolt [![Build Status](https://drone.io/github.com/boltdb/bolt/status.png)](https://drone.io/github.com/boltdb/bolt/latest) [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](https://godoc.org/github.com/boltdb/bolt) ![Version](https://img.shields.io/badge/version-1.0-green.svg) ==== -Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas] and -the [LMDB project][lmdb]. The goal of the project is to provide a simple, +Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas] +[LMDB project][lmdb]. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL. @@ -13,7 +13,6 @@ and setting values. That's it. [hyc_symas]: https://twitter.com/hyc_symas [lmdb]: http://symas.com/mdb/ - ## Project Status Bolt is stable and the API is fixed. Full unit test coverage and randomized @@ -22,6 +21,36 @@ Bolt is currently in high-load production environments serving databases as large as 1TB. Many companies such as Shopify and Heroku use Bolt-backed services every day. +## Table of Contents + +- [Getting Started](#getting-started) + - [Installing](#installing) + - [Opening a database](#opening-a-database) + - [Transactions](#transactions) + - [Read-write transactions](#read-write-transactions) + - [Read-only transactions](#read-only-transactions) + - [Batch read-write transactions](#batch-read-write-transactions) + - [Managing transactions manually](#managing-transactions-manually) + - [Using buckets](#using-buckets) + - [Using key/value pairs](#using-keyvalue-pairs) + - [Autoincrementing integer for the bucket](#autoincrementing-integer-for-the-bucket) + - [Iterating over keys](#iterating-over-keys) + - [Prefix scans](#prefix-scans) + - [Range scans](#range-scans) + - [ForEach()](#foreach) + - [Nested buckets](#nested-buckets) + - [Database backups](#database-backups) + - [Statistics](#statistics) + - [Read-Only Mode](#read-only-mode) + - [Mobile Use (iOS/Android)](#mobile-use-iosandroid) +- [Resources](#resources) +- [Comparison with other databases](#comparison-with-other-databases) + - [Postgres, MySQL, & other relational databases](#postgres-mysql--other-relational-databases) + - [LevelDB, RocksDB](#leveldb-rocksdb) + - [LMDB](#lmdb) +- [Caveats & Limitations](#caveats--limitations) +- [Reading the Source](#reading-the-source) +- [Other Projects Using Bolt](#other-projects-using-bolt) ## Getting Started @@ -180,8 +209,8 @@ and then safely close your transaction if an error is returned. This is the recommended way to use Bolt transactions. However, sometimes you may want to manually start and end your transactions. -You can use the `Tx.Begin()` function directly but _please_ be sure to close the -transaction. +You can use the `Tx.Begin()` function directly but **please** be sure to close +the transaction. ```go // Start a writable transaction. @@ -256,7 +285,7 @@ db.View(func(tx *bolt.Tx) error { ``` The `Get()` function does not return an error because its operation is -guarenteed to work (unless there is some kind of system failure). If the key +guaranteed to work (unless there is some kind of system failure). If the key exists then it will return its byte slice value. If it doesn't exist then it will return `nil`. It's important to note that you can have a zero-length value set to a key which is different than the key not existing. @@ -268,6 +297,49 @@ transaction is open. If you need to use a value outside of the transaction then you must use `copy()` to copy it to another byte slice. +### Autoincrementing integer for the bucket +By using the `NextSequence()` function, you can let Bolt determine a sequence +which can be used as the unique identifier for your key/value pairs. See the +example below. + +```go +// CreateUser saves u to the store. The new user ID is set on u once the data is persisted. +func (s *Store) CreateUser(u *User) error { + return s.db.Update(func(tx *bolt.Tx) error { + // Retrieve the users bucket. + // This should be created when the DB is first opened. + b := tx.Bucket([]byte("users")) + + // Generate ID for the user. + // This returns an error only if the Tx is closed or not writeable. + // That can't happen in an Update() call so I ignore the error check. + id, _ = b.NextSequence() + u.ID = int(id) + + // Marshal user data into bytes. + buf, err := json.Marshal(u) + if err != nil { + return err + } + + // Persist bytes to users bucket. + return b.Put(itob(u.ID), buf) + }) +} + +// itob returns an 8-byte big endian representation of v. +func itob(v int) []byte { + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, uint64(v)) + return b +} + +type User struct { + ID int + ... +} +``` + ### Iterating over keys Bolt stores its keys in byte-sorted order within a bucket. This makes sequential @@ -276,7 +348,9 @@ iteration over these keys extremely fast. To iterate over keys we'll use a ```go db.View(func(tx *bolt.Tx) error { + // Assume bucket exists and has keys b := tx.Bucket([]byte("MyBucket")) + c := b.Cursor() for k, v := c.First(); k != nil; k, v = c.Next() { @@ -300,10 +374,15 @@ Next() Move to the next key. Prev() Move to the previous key. ``` -When you have iterated to the end of the cursor then `Next()` will return `nil`. -You must seek to a position using `First()`, `Last()`, or `Seek()` before -calling `Next()` or `Prev()`. If you do not seek to a position then these -functions will return `nil`. +Each of those functions has a return signature of `(key []byte, value []byte)`. +When you have iterated to the end of the cursor then `Next()` will return a +`nil` key. You must seek to a position using `First()`, `Last()`, or `Seek()` +before calling `Next()` or `Prev()`. If you do not seek to a position then +these functions will return a `nil` key. + +During iteration, if the key is non-`nil` but the value is `nil`, that means +the key refers to a bucket rather than a value. Use `Bucket.Bucket()` to +access the sub-bucket. #### Prefix scans @@ -312,6 +391,7 @@ To iterate over a key prefix, you can combine `Seek()` and `bytes.HasPrefix()`: ```go db.View(func(tx *bolt.Tx) error { + // Assume bucket exists and has keys c := tx.Bucket([]byte("MyBucket")).Cursor() prefix := []byte("1234") @@ -331,7 +411,7 @@ date range like this: ```go db.View(func(tx *bolt.Tx) error { - // Assume our events bucket has RFC3339 encoded time keys. + // Assume our events bucket exists and has RFC3339 encoded time keys. c := tx.Bucket([]byte("Events")).Cursor() // Our time range spans the 90's decade. @@ -355,7 +435,9 @@ all the keys in a bucket: ```go db.View(func(tx *bolt.Tx) error { + // Assume bucket exists and has keys b := tx.Bucket([]byte("MyBucket")) + b.ForEach(func(k, v []byte) error { fmt.Printf("key=%s, value=%s\n", k, v) return nil @@ -382,8 +464,11 @@ func (*Bucket) DeleteBucket(key []byte) error Bolt is a single file so it's easy to backup. You can use the `Tx.WriteTo()` function to write a consistent view of the database to a writer. If you call this from a read-only transaction, it will perform a hot backup and not block -your other database reads and writes. It will also use `O_DIRECT` when available -to prevent page cache trashing. +your other database reads and writes. + +By default, it will use a regular file handle which will utilize the operating +system's page cache. See the [`Tx`](https://godoc.org/github.com/boltdb/bolt#Tx) +documentation for information about optimizing for larger-than-RAM datasets. One common use case is to backup over HTTP so you can use tools like `cURL` to do database backups: @@ -465,6 +550,84 @@ if err != nil { } ``` +### Mobile Use (iOS/Android) + +Bolt is able to run on mobile devices by leveraging the binding feature of the +[gomobile](https://github.com/golang/mobile) tool. Create a struct that will +contain your database logic and a reference to a `*bolt.DB` with a initializing +contstructor that takes in a filepath where the database file will be stored. +Neither Android nor iOS require extra permissions or cleanup from using this method. + +```go +func NewBoltDB(filepath string) *BoltDB { + db, err := bolt.Open(filepath+"/demo.db", 0600, nil) + if err != nil { + log.Fatal(err) + } + + return &BoltDB{db} +} + +type BoltDB struct { + db *bolt.DB + ... +} + +func (b *BoltDB) Path() string { + return b.db.Path() +} + +func (b *BoltDB) Close() { + b.db.Close() +} +``` + +Database logic should be defined as methods on this wrapper struct. + +To initialize this struct from the native language (both platforms now sync +their local storage to the cloud. These snippets disable that functionality for the +database file): + +#### Android + +```java +String path; +if (android.os.Build.VERSION.SDK_INT >=android.os.Build.VERSION_CODES.LOLLIPOP){ + path = getNoBackupFilesDir().getAbsolutePath(); +} else{ + path = getFilesDir().getAbsolutePath(); +} +Boltmobiledemo.BoltDB boltDB = Boltmobiledemo.NewBoltDB(path) +``` + +#### iOS + +```objc +- (void)demo { + NSString* path = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, + NSUserDomainMask, + YES) objectAtIndex:0]; + GoBoltmobiledemoBoltDB * demo = GoBoltmobiledemoNewBoltDB(path); + [self addSkipBackupAttributeToItemAtPath:demo.path]; + //Some DB Logic would go here + [demo close]; +} + +- (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString +{ + NSURL* URL= [NSURL fileURLWithPath: filePathString]; + assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]); + + NSError *error = nil; + BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES] + forKey: NSURLIsExcludedFromBackupKey error: &error]; + if(!success){ + NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); + } + return success; +} + +``` ## Resources @@ -500,7 +663,7 @@ they are libraries bundled into the application, however, their underlying structure is a log-structured merge-tree (LSM tree). An LSM tree optimizes random writes by using a write ahead log and multi-tiered, sorted files called SSTables. Bolt uses a B+tree internally and only a single file. Both approaches -have trade offs. +have trade-offs. If you require a high random write throughput (>10,000 w/sec) or you need to use spinning disks then LevelDB could be a good choice. If your application is @@ -536,9 +699,8 @@ It's important to pick the right tool for the job and Bolt is no exception. Here are a few things to note when evaluating and using Bolt: * Bolt is good for read intensive workloads. Sequential write performance is - also fast but random writes can be slow. You can add a write-ahead log or - [transaction coalescer](https://github.com/boltdb/coalescer) in front of Bolt - to mitigate this issue. + also fast but random writes can be slow. You can use `DB.Batch()` or add a + write-ahead log to help mitigate this issue. * Bolt uses a B+tree internally so there can be a lot of random page access. SSDs provide a significant performance boost over spinning disks. @@ -568,11 +730,13 @@ Here are a few things to note when evaluating and using Bolt: can in memory and will release memory as needed to other processes. This means that Bolt can show very high memory usage when working with large databases. However, this is expected and the OS will release memory as needed. Bolt can - handle databases much larger than the available physical RAM. + handle databases much larger than the available physical RAM, provided its + memory-map fits in the process virtual address space. It may be problematic + on 32-bits systems. * The data structures in the Bolt database are memory mapped so the data file will be endian specific. This means that you cannot copy a Bolt file from a - little endian machine to a big endian machine and have it work. For most + little endian machine to a big endian machine and have it work. For most users this is not a concern since most modern CPUs are little endian. * Because of the way pages are laid out on disk, Bolt cannot truncate data files @@ -587,6 +751,56 @@ Here are a few things to note when evaluating and using Bolt: [page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638 +## Reading the Source + +Bolt is a relatively small code base (<3KLOC) for an embedded, serializable, +transactional key/value database so it can be a good starting point for people +interested in how databases work. + +The best places to start are the main entry points into Bolt: + +- `Open()` - Initializes the reference to the database. It's responsible for + creating the database if it doesn't exist, obtaining an exclusive lock on the + file, reading the meta pages, & memory-mapping the file. + +- `DB.Begin()` - Starts a read-only or read-write transaction depending on the + value of the `writable` argument. This requires briefly obtaining the "meta" + lock to keep track of open transactions. Only one read-write transaction can + exist at a time so the "rwlock" is acquired during the life of a read-write + transaction. + +- `Bucket.Put()` - Writes a key/value pair into a bucket. After validating the + arguments, a cursor is used to traverse the B+tree to the page and position + where they key & value will be written. Once the position is found, the bucket + materializes the underlying page and the page's parent pages into memory as + "nodes". These nodes are where mutations occur during read-write transactions. + These changes get flushed to disk during commit. + +- `Bucket.Get()` - Retrieves a key/value pair from a bucket. This uses a cursor + to move to the page & position of a key/value pair. During a read-only + transaction, the key and value data is returned as a direct reference to the + underlying mmap file so there's no allocation overhead. For read-write + transactions, this data may reference the mmap file or one of the in-memory + node values. + +- `Cursor` - This object is simply for traversing the B+tree of on-disk pages + or in-memory nodes. It can seek to a specific key, move to the first or last + value, or it can move forward or backward. The cursor handles the movement up + and down the B+tree transparently to the end user. + +- `Tx.Commit()` - Converts the in-memory dirty nodes and the list of free pages + into pages to be written to disk. Writing to disk then occurs in two phases. + First, the dirty pages are written to disk and an `fsync()` occurs. Second, a + new meta page with an incremented transaction ID is written and another + `fsync()` occurs. This two phase write ensures that partially written data + pages are ignored in the event of a crash since the meta page pointing to them + is never written. Partially written meta pages are invalidated because they + are written with a checksum. + +If you have additional notes that could be helpful for others, please submit +them via pull request. + + ## Other Projects Using Bolt Below is a list of public, open source projects that use Bolt: @@ -597,25 +811,30 @@ Below is a list of public, open source projects that use Bolt: * [Skybox Analytics](https://github.com/skybox/skybox) - A standalone funnel analysis tool for web analytics. * [Scuttlebutt](https://github.com/benbjohnson/scuttlebutt) - Uses Bolt to store and process all Twitter mentions of GitHub projects. * [Wiki](https://github.com/peterhellberg/wiki) - A tiny wiki using Goji, BoltDB and Blackfriday. -* [ChainStore](https://github.com/nulayer/chainstore) - Simple key-value interface to a variety of storage engines organized as a chain of operations. +* [ChainStore](https://github.com/pressly/chainstore) - Simple key-value interface to a variety of storage engines organized as a chain of operations. * [MetricBase](https://github.com/msiebuhr/MetricBase) - Single-binary version of Graphite. * [Gitchain](https://github.com/gitchain/gitchain) - Decentralized, peer-to-peer Git repositories aka "Git meets Bitcoin". * [event-shuttle](https://github.com/sclasen/event-shuttle) - A Unix system service to collect and reliably deliver messages to Kafka. * [ipxed](https://github.com/kelseyhightower/ipxed) - Web interface and api for ipxed. * [BoltStore](https://github.com/yosssi/boltstore) - Session store using Bolt. -* [photosite/session](http://godoc.org/bitbucket.org/kardianos/photosite/session) - Sessions for a photo viewing site. +* [photosite/session](https://godoc.org/bitbucket.org/kardianos/photosite/session) - Sessions for a photo viewing site. * [LedisDB](https://github.com/siddontang/ledisdb) - A high performance NoSQL, using Bolt as optional storage. * [ipLocator](https://github.com/AndreasBriese/ipLocator) - A fast ip-geo-location-server using bolt with bloom filters. * [cayley](https://github.com/google/cayley) - Cayley is an open-source graph database using Bolt as optional backend. * [bleve](http://www.blevesearch.com/) - A pure Go search engine similar to ElasticSearch that uses Bolt as the default storage backend. * [tentacool](https://github.com/optiflows/tentacool) - REST api server to manage system stuff (IP, DNS, Gateway...) on a linux server. * [SkyDB](https://github.com/skydb/sky) - Behavioral analytics database. -* [Seaweed File System](https://github.com/chrislusf/weed-fs) - Highly scalable distributed key~file system with O(1) disk read. -* [InfluxDB](http://influxdb.com) - Scalable datastore for metrics, events, and real-time analytics. +* [Seaweed File System](https://github.com/chrislusf/seaweedfs) - Highly scalable distributed key~file system with O(1) disk read. +* [InfluxDB](https://influxdata.com) - Scalable datastore for metrics, events, and real-time analytics. * [Freehold](http://tshannon.bitbucket.org/freehold/) - An open, secure, and lightweight platform for your files and data. * [Prometheus Annotation Server](https://github.com/oliver006/prom_annotation_server) - Annotation server for PromDash & Prometheus service monitoring system. * [Consul](https://github.com/hashicorp/consul) - Consul is service discovery and configuration made easy. Distributed, highly available, and datacenter-aware. -* [Kala](https://github.com/ajvb/kala) - Kala is a modern job scheduler optimized to run on a single node. It is persistant, JSON over HTTP API, ISO 8601 duration notation, and dependent jobs. +* [Kala](https://github.com/ajvb/kala) - Kala is a modern job scheduler optimized to run on a single node. It is persistent, JSON over HTTP API, ISO 8601 duration notation, and dependent jobs. * [drive](https://github.com/odeke-em/drive) - drive is an unofficial Google Drive command line client for \*NIX operating systems. +* [stow](https://github.com/djherbis/stow) - a persistence manager for objects + backed by boltdb. +* [buckets](https://github.com/joyrexus/buckets) - a bolt wrapper streamlining + simple tx and key scans. +* [Request Baskets](https://github.com/darklynx/request-baskets) - A web service to collect arbitrary HTTP requests and inspect them via REST API or simple web UI, similar to [RequestBin](http://requestb.in/) service If you are using Bolt in a project please send a pull request to add it to the list. diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/batch.go b/Godeps/_workspace/src/github.com/boltdb/bolt/batch.go deleted file mode 100644 index 84acae6bbf0..00000000000 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/batch.go +++ /dev/null @@ -1,138 +0,0 @@ -package bolt - -import ( - "errors" - "fmt" - "sync" - "time" -) - -// Batch calls fn as part of a batch. It behaves similar to Update, -// except: -// -// 1. concurrent Batch calls can be combined into a single Bolt -// transaction. -// -// 2. the function passed to Batch may be called multiple times, -// regardless of whether it returns error or not. -// -// This means that Batch function side effects must be idempotent and -// take permanent effect only after a successful return is seen in -// caller. -// -// The maximum batch size and delay can be adjusted with DB.MaxBatchSize -// and DB.MaxBatchDelay, respectively. -// -// Batch is only useful when there are multiple goroutines calling it. -func (db *DB) Batch(fn func(*Tx) error) error { - errCh := make(chan error, 1) - - db.batchMu.Lock() - if (db.batch == nil) || (db.batch != nil && len(db.batch.calls) >= db.MaxBatchSize) { - // There is no existing batch, or the existing batch is full; start a new one. - db.batch = &batch{ - db: db, - } - db.batch.timer = time.AfterFunc(db.MaxBatchDelay, db.batch.trigger) - } - db.batch.calls = append(db.batch.calls, call{fn: fn, err: errCh}) - if len(db.batch.calls) >= db.MaxBatchSize { - // wake up batch, it's ready to run - go db.batch.trigger() - } - db.batchMu.Unlock() - - err := <-errCh - if err == trySolo { - err = db.Update(fn) - } - return err -} - -type call struct { - fn func(*Tx) error - err chan<- error -} - -type batch struct { - db *DB - timer *time.Timer - start sync.Once - calls []call -} - -// trigger runs the batch if it hasn't already been run. -func (b *batch) trigger() { - b.start.Do(b.run) -} - -// run performs the transactions in the batch and communicates results -// back to DB.Batch. -func (b *batch) run() { - b.db.batchMu.Lock() - b.timer.Stop() - // Make sure no new work is added to this batch, but don't break - // other batches. - if b.db.batch == b { - b.db.batch = nil - } - b.db.batchMu.Unlock() - -retry: - for len(b.calls) > 0 { - var failIdx = -1 - err := b.db.Update(func(tx *Tx) error { - for i, c := range b.calls { - if err := safelyCall(c.fn, tx); err != nil { - failIdx = i - return err - } - } - return nil - }) - - if failIdx >= 0 { - // take the failing transaction out of the batch. it's - // safe to shorten b.calls here because db.batch no longer - // points to us, and we hold the mutex anyway. - c := b.calls[failIdx] - b.calls[failIdx], b.calls = b.calls[len(b.calls)-1], b.calls[:len(b.calls)-1] - // tell the submitter re-run it solo, continue with the rest of the batch - c.err <- trySolo - continue retry - } - - // pass success, or bolt internal errors, to all callers - for _, c := range b.calls { - if c.err != nil { - c.err <- err - } - } - break retry - } -} - -// trySolo is a special sentinel error value used for signaling that a -// transaction function should be re-run. It should never be seen by -// callers. -var trySolo = errors.New("batch function returned an error and should be re-run solo") - -type panicked struct { - reason interface{} -} - -func (p panicked) Error() string { - if err, ok := p.reason.(error); ok { - return err.Error() - } - return fmt.Sprintf("panic: %v", p.reason) -} - -func safelyCall(fn func(*Tx) error, tx *Tx) (err error) { - defer func() { - if p := recover(); p != nil { - err = panicked{p} - } - }() - return fn(tx) -} diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_arm64.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_arm64.go new file mode 100644 index 00000000000..6d2309352e0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_arm64.go @@ -0,0 +1,9 @@ +// +build arm64 + +package bolt + +// maxMapSize represents the largest mmap size supported by Bolt. +const maxMapSize = 0xFFFFFFFFFFFF // 256TB + +// maxAllocSize is the size used when creating array pointers. +const maxAllocSize = 0x7FFFFFFF diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_linux.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_linux.go index e9d1c907b63..2b676661409 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_linux.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_linux.go @@ -4,8 +4,6 @@ import ( "syscall" ) -var odirect = syscall.O_DIRECT - // fdatasync flushes written data to a file descriptor. func fdatasync(db *DB) error { return syscall.Fdatasync(int(db.file.Fd())) diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_openbsd.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_openbsd.go index 7c1bef1a4f4..7058c3d734e 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_openbsd.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_openbsd.go @@ -11,8 +11,6 @@ const ( msInvalidate // invalidate cached data ) -var odirect int - func msync(db *DB) error { _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) if errno != 0 { diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_ppc64le.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_ppc64le.go new file mode 100644 index 00000000000..8351e129f6a --- /dev/null +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_ppc64le.go @@ -0,0 +1,9 @@ +// +build ppc64le + +package bolt + +// maxMapSize represents the largest mmap size supported by Bolt. +const maxMapSize = 0xFFFFFFFFFFFF // 256TB + +// maxAllocSize is the size used when creating array pointers. +const maxAllocSize = 0x7FFFFFFF diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_s390x.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_s390x.go new file mode 100644 index 00000000000..f4dd26bbba7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_s390x.go @@ -0,0 +1,9 @@ +// +build s390x + +package bolt + +// maxMapSize represents the largest mmap size supported by Bolt. +const maxMapSize = 0xFFFFFFFFFFFF // 256TB + +// maxAllocSize is the size used when creating array pointers. +const maxAllocSize = 0x7FFFFFFF diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix.go index 6eef6b22035..4b0723aac23 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix.go @@ -46,19 +46,8 @@ func funlock(f *os.File) error { // mmap memory maps a DB's data file. func mmap(db *DB, sz int) error { - // Truncate and fsync to ensure file size metadata is flushed. - // https://github.com/boltdb/bolt/issues/284 - if !db.NoGrowSync && !db.readOnly { - if err := db.file.Truncate(int64(sz)); err != nil { - return fmt.Errorf("file resize error: %s", err) - } - if err := db.file.Sync(); err != nil { - return fmt.Errorf("file sync error: %s", err) - } - } - // Map the data file to memory. - b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED) + b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) if err != nil { return err } diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix_solaris.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix_solaris.go index f480ee76d1f..1c4e48d63a0 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix_solaris.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_unix_solaris.go @@ -1,4 +1,3 @@ - package bolt import ( @@ -7,6 +6,7 @@ import ( "syscall" "time" "unsafe" + "golang.org/x/sys/unix" ) @@ -56,19 +56,8 @@ func funlock(f *os.File) error { // mmap memory maps a DB's data file. func mmap(db *DB, sz int) error { - // Truncate and fsync to ensure file size metadata is flushed. - // https://github.com/boltdb/bolt/issues/284 - if !db.NoGrowSync && !db.readOnly { - if err := db.file.Truncate(int64(sz)); err != nil { - return fmt.Errorf("file resize error: %s", err) - } - if err := db.file.Sync(); err != nil { - return fmt.Errorf("file sync error: %s", err) - } - } - // Map the data file to memory. - b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED) + b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) if err != nil { return err } diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_windows.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_windows.go index 8b782be5f9e..91c4968f6a1 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_windows.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bolt_windows.go @@ -8,7 +8,37 @@ import ( "unsafe" ) -var odirect int +// LockFileEx code derived from golang build filemutex_windows.go @ v1.5.1 +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + procLockFileEx = modkernel32.NewProc("LockFileEx") + procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") +) + +const ( + // see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx + flagLockExclusive = 2 + flagLockFailImmediately = 1 + + // see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx + errLockViolation syscall.Errno = 0x21 +) + +func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { + r, _, err := procLockFileEx.Call(uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) + if r == 0 { + return err + } + return nil +} + +func unlockFileEx(h syscall.Handle, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { + r, _, err := procUnlockFileEx.Call(uintptr(h), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol)), 0) + if r == 0 { + return err + } + return nil +} // fdatasync flushes written data to a file descriptor. func fdatasync(db *DB) error { @@ -16,13 +46,37 @@ func fdatasync(db *DB) error { } // flock acquires an advisory lock on a file descriptor. -func flock(f *os.File, _ bool, _ time.Duration) error { - return nil +func flock(f *os.File, exclusive bool, timeout time.Duration) error { + var t time.Time + for { + // If we're beyond our timeout then return an error. + // This can only occur after we've attempted a flock once. + if t.IsZero() { + t = time.Now() + } else if timeout > 0 && time.Since(t) > timeout { + return ErrTimeout + } + + var flag uint32 = flagLockFailImmediately + if exclusive { + flag |= flagLockExclusive + } + + err := lockFileEx(syscall.Handle(f.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}) + if err == nil { + return nil + } else if err != errLockViolation { + return err + } + + // Wait for a bit and try again. + time.Sleep(50 * time.Millisecond) + } } // funlock releases an advisory lock on a file descriptor. func funlock(f *os.File) error { - return nil + return unlockFileEx(syscall.Handle(f.Fd()), 0, 1, 0, &syscall.Overlapped{}) } // mmap memory maps a DB's data file. diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/boltsync_unix.go b/Godeps/_workspace/src/github.com/boltdb/bolt/boltsync_unix.go index 8db89776fe6..f50442523c3 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/boltsync_unix.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/boltsync_unix.go @@ -2,8 +2,6 @@ package bolt -var odirect int - // fdatasync flushes written data to a file descriptor. func fdatasync(db *DB) error { return db.file.Sync() diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/bucket.go b/Godeps/_workspace/src/github.com/boltdb/bolt/bucket.go index 6766992100f..d2f8c524e42 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/bucket.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/bucket.go @@ -11,7 +11,7 @@ const ( MaxKeySize = 32768 // MaxValueSize is the maximum length of a value, in bytes. - MaxValueSize = 4294967295 + MaxValueSize = (1 << 31) - 2 ) const ( @@ -99,6 +99,7 @@ func (b *Bucket) Cursor() *Cursor { // Bucket retrieves a nested bucket by name. // Returns nil if the bucket does not exist. +// The bucket instance is only valid for the lifetime of the transaction. func (b *Bucket) Bucket(name []byte) *Bucket { if b.buckets != nil { if child := b.buckets[string(name)]; child != nil { @@ -148,6 +149,7 @@ func (b *Bucket) openBucket(value []byte) *Bucket { // CreateBucket creates a new bucket at the given key and returns the new bucket. // Returns an error if the key already exists, if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) { if b.tx.db == nil { return nil, ErrTxClosed @@ -192,6 +194,7 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) { // CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it. // Returns an error if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (b *Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error) { child, err := b.CreateBucket(key) if err == ErrBucketExists { @@ -270,6 +273,7 @@ func (b *Bucket) Get(key []byte) []byte { // Put sets the value for a key in the bucket. // If the key exist then its previous value will be overwritten. +// Supplied value must remain valid for the life of the transaction. // Returns an error if the bucket was created from a read-only transaction, if the key is blank, if the key is too large, or if the value is too large. func (b *Bucket) Put(key []byte, value []byte) error { if b.tx.db == nil { @@ -346,7 +350,8 @@ func (b *Bucket) NextSequence() (uint64, error) { // ForEach executes a function for each key/value pair in a bucket. // If the provided function returns an error then the iteration is stopped and -// the error is returned to the caller. +// the error is returned to the caller. The provided function must not modify +// the bucket; this will result in undefined behavior. func (b *Bucket) ForEach(fn func(k, v []byte) error) error { if b.tx.db == nil { return ErrTxClosed diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/cmd/bolt/main.go b/Godeps/_workspace/src/github.com/boltdb/bolt/cmd/bolt/main.go index c41ebe404d9..b96e6f73511 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/cmd/bolt/main.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/cmd/bolt/main.go @@ -825,7 +825,10 @@ func (cmd *StatsCommand) Run(args ...string) error { fmt.Fprintln(cmd.Stdout, "Bucket statistics") fmt.Fprintf(cmd.Stdout, "\tTotal number of buckets: %d\n", s.BucketN) - percentage = int(float32(s.InlineBucketN) * 100.0 / float32(s.BucketN)) + percentage = 0 + if s.BucketN != 0 { + percentage = int(float32(s.InlineBucketN) * 100.0 / float32(s.BucketN)) + } fmt.Fprintf(cmd.Stdout, "\tTotal number on inlined buckets: %d (%d%%)\n", s.InlineBucketN, percentage) percentage = 0 if s.LeafInuse != 0 { diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/cursor.go b/Godeps/_workspace/src/github.com/boltdb/bolt/cursor.go index 006c54889e8..1be9f35e3ef 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/cursor.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/cursor.go @@ -34,6 +34,13 @@ func (c *Cursor) First() (key []byte, value []byte) { p, n := c.bucket.pageNode(c.bucket.root) c.stack = append(c.stack, elemRef{page: p, node: n, index: 0}) c.first() + + // If we land on an empty page then move to the next value. + // https://github.com/boltdb/bolt/issues/450 + if c.stack[len(c.stack)-1].count() == 0 { + c.next() + } + k, v, flags := c.keyValue() if (flags & uint32(bucketLeafFlag)) != 0 { return k, nil @@ -209,28 +216,37 @@ func (c *Cursor) last() { // next moves to the next leaf element and returns the key and value. // If the cursor is at the last leaf element then it stays there and returns nil. func (c *Cursor) next() (key []byte, value []byte, flags uint32) { - // Attempt to move over one element until we're successful. - // Move up the stack as we hit the end of each page in our stack. - var i int - for i = len(c.stack) - 1; i >= 0; i-- { - elem := &c.stack[i] - if elem.index < elem.count()-1 { - elem.index++ - break + for { + // Attempt to move over one element until we're successful. + // Move up the stack as we hit the end of each page in our stack. + var i int + for i = len(c.stack) - 1; i >= 0; i-- { + elem := &c.stack[i] + if elem.index < elem.count()-1 { + elem.index++ + break + } } - } - // If we've hit the root page then stop and return. This will leave the - // cursor on the last element of the last page. - if i == -1 { - return nil, nil, 0 - } + // If we've hit the root page then stop and return. This will leave the + // cursor on the last element of the last page. + if i == -1 { + return nil, nil, 0 + } - // Otherwise start from where we left off in the stack and find the - // first element of the first leaf page. - c.stack = c.stack[:i+1] - c.first() - return c.keyValue() + // Otherwise start from where we left off in the stack and find the + // first element of the first leaf page. + c.stack = c.stack[:i+1] + c.first() + + // If this is an empty page then restart and move back up the stack. + // https://github.com/boltdb/bolt/issues/450 + if c.stack[len(c.stack)-1].count() == 0 { + continue + } + + return c.keyValue() + } } // search recursively performs a binary search against a given page/node until it finds a given key. diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/db.go b/Godeps/_workspace/src/github.com/boltdb/bolt/db.go index d39c4aa9cce..0f1e1bc3d74 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/db.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/db.go @@ -1,8 +1,10 @@ package bolt import ( + "errors" "fmt" "hash/fnv" + "log" "os" "runtime" "runtime/debug" @@ -24,13 +26,14 @@ const magic uint32 = 0xED0CDAED // IgnoreNoSync specifies whether the NoSync field of a DB is ignored when // syncing changes to a file. This is required as some operating systems, // such as OpenBSD, do not have a unified buffer cache (UBC) and writes -// must be synchronzied using the msync(2) syscall. +// must be synchronized using the msync(2) syscall. const IgnoreNoSync = runtime.GOOS == "openbsd" // Default values if not set in a DB instance. const ( DefaultMaxBatchSize int = 1000 DefaultMaxBatchDelay = 10 * time.Millisecond + DefaultAllocSize = 16 * 1024 * 1024 ) // DB represents a collection of buckets persisted to a file on disk. @@ -63,6 +66,10 @@ type DB struct { // https://github.com/boltdb/bolt/issues/284 NoGrowSync bool + // If you want to read the entire database fast, you can set MmapFlag to + // syscall.MAP_POPULATE on Linux 2.6.23+ for sequential read-ahead. + MmapFlags int + // MaxBatchSize is the maximum size of a batch. Default value is // copied from DefaultMaxBatchSize in Open. // @@ -79,11 +86,17 @@ type DB struct { // Do not change concurrently with calls to Batch. MaxBatchDelay time.Duration + // AllocSize is the amount of space allocated when the database + // needs to create new pages. This is done to amortize the cost + // of truncate() and fsync() when growing the data file. + AllocSize int + path string file *os.File dataref []byte // mmap'ed readonly, write throws SEGV data *[maxMapSize]byte datasz int + filesz int // current on disk file size meta0 *meta meta1 *meta pageSize int @@ -136,10 +149,12 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { options = DefaultOptions } db.NoGrowSync = options.NoGrowSync + db.MmapFlags = options.MmapFlags // Set default values for later DB operations. db.MaxBatchSize = DefaultMaxBatchSize db.MaxBatchDelay = DefaultMaxBatchDelay + db.AllocSize = DefaultAllocSize flag := os.O_RDWR if options.ReadOnly { @@ -172,7 +187,7 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { // Initialize the database if it doesn't exist. if info, err := db.file.Stat(); err != nil { - return nil, fmt.Errorf("stat error: %s", err) + return nil, err } else if info.Size() == 0 { // Initialize new files with meta pages. if err := db.init(); err != nil { @@ -184,14 +199,14 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { if _, err := db.file.ReadAt(buf[:], 0); err == nil { m := db.pageInBuffer(buf[:], 0).meta() if err := m.validate(); err != nil { - return nil, fmt.Errorf("meta0 error: %s", err) + return nil, err } db.pageSize = int(m.pageSize) } } // Memory map the data file. - if err := db.mmap(0); err != nil { + if err := db.mmap(options.InitialMmapSize); err != nil { _ = db.close() return nil, err } @@ -248,10 +263,10 @@ func (db *DB) mmap(minsz int) error { // Validate the meta pages. if err := db.meta0.validate(); err != nil { - return fmt.Errorf("meta0 error: %s", err) + return err } if err := db.meta1.validate(); err != nil { - return fmt.Errorf("meta1 error: %s", err) + return err } return nil @@ -266,7 +281,7 @@ func (db *DB) munmap() error { } // mmapSize determines the appropriate size for the mmap given the current size -// of the database. The minimum size is 1MB and doubles until it reaches 1GB. +// of the database. The minimum size is 32KB and doubles until it reaches 1GB. // Returns an error if the new mmap size is greater than the max allowed. func (db *DB) mmapSize(size int) (int, error) { // Double the size from 32KB until 1GB. @@ -382,7 +397,9 @@ func (db *DB) close() error { // No need to unlock read-only file. if !db.readOnly { // Unlock the file. - _ = funlock(db.file) + if err := funlock(db.file); err != nil { + log.Printf("bolt.Close(): funlock error: %s", err) + } } // Close the file descriptor. @@ -401,11 +418,15 @@ func (db *DB) close() error { // will cause the calls to block and be serialized until the current write // transaction finishes. // -// Transactions should not be depedent on one another. Opening a read +// Transactions should not be dependent on one another. Opening a read // transaction and a write transaction in the same goroutine can cause the // writer to deadlock because the database periodically needs to re-mmap itself // as it grows and it cannot do that while a read transaction is open. // +// If a long running read transaction (for example, a snapshot transaction) is +// needed, you might want to set DB.InitialMmapSize to a large enough value +// to avoid potential blocking of write transaction. +// // IMPORTANT: You must close read-only transactions after you are finished or // else the database will not reclaim old pages. func (db *DB) Begin(writable bool) (*Tx, error) { @@ -589,6 +610,136 @@ func (db *DB) View(fn func(*Tx) error) error { return nil } +// Batch calls fn as part of a batch. It behaves similar to Update, +// except: +// +// 1. concurrent Batch calls can be combined into a single Bolt +// transaction. +// +// 2. the function passed to Batch may be called multiple times, +// regardless of whether it returns error or not. +// +// This means that Batch function side effects must be idempotent and +// take permanent effect only after a successful return is seen in +// caller. +// +// The maximum batch size and delay can be adjusted with DB.MaxBatchSize +// and DB.MaxBatchDelay, respectively. +// +// Batch is only useful when there are multiple goroutines calling it. +func (db *DB) Batch(fn func(*Tx) error) error { + errCh := make(chan error, 1) + + db.batchMu.Lock() + if (db.batch == nil) || (db.batch != nil && len(db.batch.calls) >= db.MaxBatchSize) { + // There is no existing batch, or the existing batch is full; start a new one. + db.batch = &batch{ + db: db, + } + db.batch.timer = time.AfterFunc(db.MaxBatchDelay, db.batch.trigger) + } + db.batch.calls = append(db.batch.calls, call{fn: fn, err: errCh}) + if len(db.batch.calls) >= db.MaxBatchSize { + // wake up batch, it's ready to run + go db.batch.trigger() + } + db.batchMu.Unlock() + + err := <-errCh + if err == trySolo { + err = db.Update(fn) + } + return err +} + +type call struct { + fn func(*Tx) error + err chan<- error +} + +type batch struct { + db *DB + timer *time.Timer + start sync.Once + calls []call +} + +// trigger runs the batch if it hasn't already been run. +func (b *batch) trigger() { + b.start.Do(b.run) +} + +// run performs the transactions in the batch and communicates results +// back to DB.Batch. +func (b *batch) run() { + b.db.batchMu.Lock() + b.timer.Stop() + // Make sure no new work is added to this batch, but don't break + // other batches. + if b.db.batch == b { + b.db.batch = nil + } + b.db.batchMu.Unlock() + +retry: + for len(b.calls) > 0 { + var failIdx = -1 + err := b.db.Update(func(tx *Tx) error { + for i, c := range b.calls { + if err := safelyCall(c.fn, tx); err != nil { + failIdx = i + return err + } + } + return nil + }) + + if failIdx >= 0 { + // take the failing transaction out of the batch. it's + // safe to shorten b.calls here because db.batch no longer + // points to us, and we hold the mutex anyway. + c := b.calls[failIdx] + b.calls[failIdx], b.calls = b.calls[len(b.calls)-1], b.calls[:len(b.calls)-1] + // tell the submitter re-run it solo, continue with the rest of the batch + c.err <- trySolo + continue retry + } + + // pass success, or bolt internal errors, to all callers + for _, c := range b.calls { + if c.err != nil { + c.err <- err + } + } + break retry + } +} + +// trySolo is a special sentinel error value used for signaling that a +// transaction function should be re-run. It should never be seen by +// callers. +var trySolo = errors.New("batch function returned an error and should be re-run solo") + +type panicked struct { + reason interface{} +} + +func (p panicked) Error() string { + if err, ok := p.reason.(error); ok { + return err.Error() + } + return fmt.Sprintf("panic: %v", p.reason) +} + +func safelyCall(fn func(*Tx) error, tx *Tx) (err error) { + defer func() { + if p := recover(); p != nil { + err = panicked{p} + } + }() + return fn(tx) +} + // Sync executes fdatasync() against the database file handle. // // This is not necessary under normal operation, however, if you use NoSync @@ -655,6 +806,36 @@ func (db *DB) allocate(count int) (*page, error) { return p, nil } +// grow grows the size of the database to the given sz. +func (db *DB) grow(sz int) error { + // Ignore if the new size is less than available file size. + if sz <= db.filesz { + return nil + } + + // If the data is smaller than the alloc size then only allocate what's needed. + // Once it goes over the allocation size then allocate in chunks. + if db.datasz < db.AllocSize { + sz = db.datasz + } else { + sz += db.AllocSize + } + + // Truncate and fsync to ensure file size metadata is flushed. + // https://github.com/boltdb/bolt/issues/284 + if !db.NoGrowSync && !db.readOnly { + if err := db.file.Truncate(int64(sz)); err != nil { + return fmt.Errorf("file resize error: %s", err) + } + if err := db.file.Sync(); err != nil { + return fmt.Errorf("file sync error: %s", err) + } + } + + db.filesz = sz + return nil +} + func (db *DB) IsReadOnly() bool { return db.readOnly } @@ -672,6 +853,19 @@ type Options struct { // Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to // grab a shared lock (UNIX). ReadOnly bool + + // Sets the DB.MmapFlags flag before memory mapping the file. + MmapFlags int + + // InitialMmapSize is the initial mmap size of the database + // in bytes. Read transactions won't block write transaction + // if the InitialMmapSize is large enough to hold database mmap + // size. (See DB.Begin for more information) + // + // If <=0, the initial map size is 0. + // If initialMmapSize is smaller than the previous database size, + // it takes no effect. + InitialMmapSize int } // DefaultOptions represent the options used if nil options are passed into Open(). diff --git a/Godeps/_workspace/src/github.com/boltdb/bolt/tx.go b/Godeps/_workspace/src/github.com/boltdb/bolt/tx.go index 6b52b2c8964..e74d2cae760 100644 --- a/Godeps/_workspace/src/github.com/boltdb/bolt/tx.go +++ b/Godeps/_workspace/src/github.com/boltdb/bolt/tx.go @@ -29,6 +29,14 @@ type Tx struct { pages map[pgid]*page stats TxStats commitHandlers []func() + + // WriteFlag specifies the flag for write-related methods like WriteTo(). + // Tx opens the database file with the specified flag to copy the data. + // + // By default, the flag is unset, which works well for mostly in-memory + // workloads. For databases that are much larger than available RAM, + // set the flag to syscall.O_DIRECT to avoid trashing the page cache. + WriteFlag int } // init initializes the transaction. @@ -87,18 +95,21 @@ func (tx *Tx) Stats() TxStats { // Bucket retrieves a bucket by name. // Returns nil if the bucket does not exist. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) Bucket(name []byte) *Bucket { return tx.root.Bucket(name) } // CreateBucket creates a new bucket. // Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) { return tx.root.CreateBucket(name) } // CreateBucketIfNotExists creates a new bucket if it doesn't already exist. // Returns an error if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) { return tx.root.CreateBucketIfNotExists(name) } @@ -157,6 +168,8 @@ func (tx *Tx) Commit() error { // Free the old root bucket. tx.meta.root.root = tx.root.root + opgid := tx.meta.pgid + // Free the freelist and allocate new pages for it. This will overestimate // the size of the freelist but not underestimate the size (which would be bad). tx.db.freelist.free(tx.meta.txid, tx.db.page(tx.meta.freelist)) @@ -171,6 +184,14 @@ func (tx *Tx) Commit() error { } tx.meta.freelist = p.id + // If the high water mark has moved up then attempt to grow the database. + if tx.meta.pgid > opgid { + if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil { + tx.rollback() + return err + } + } + // Write dirty pages to disk. startTime = time.Now() if err := tx.write(); err != nil { @@ -236,7 +257,8 @@ func (tx *Tx) close() { var freelistPendingN = tx.db.freelist.pending_count() var freelistAlloc = tx.db.freelist.size() - // Remove writer lock. + // Remove transaction ref & writer lock. + tx.db.rwtx = nil tx.db.rwlock.Unlock() // Merge statistics. @@ -250,11 +272,16 @@ func (tx *Tx) close() { } else { tx.db.removeTx(tx) } + + // Clear all references. tx.db = nil + tx.meta = nil + tx.root = Bucket{tx: tx} + tx.pages = nil } // Copy writes the entire database to a writer. -// This function exists for backwards compatibility. Use WriteTo() in +// This function exists for backwards compatibility. Use WriteTo() instead. func (tx *Tx) Copy(w io.Writer) error { _, err := tx.WriteTo(w) return err @@ -263,21 +290,18 @@ func (tx *Tx) Copy(w io.Writer) error { // WriteTo writes the entire database to a writer. // If err == nil then exactly tx.Size() bytes will be written into the writer. func (tx *Tx) WriteTo(w io.Writer) (n int64, err error) { - // Attempt to open reader directly. - var f *os.File - if f, err = os.OpenFile(tx.db.path, os.O_RDONLY|odirect, 0); err != nil { - // Fallback to a regular open if that doesn't work. - if f, err = os.OpenFile(tx.db.path, os.O_RDONLY, 0); err != nil { - return 0, err - } + // Attempt to open reader with WriteFlag + f, err := os.OpenFile(tx.db.path, os.O_RDONLY|tx.WriteFlag, 0) + if err != nil { + return 0, err } + defer func() { _ = f.Close() }() // Copy the meta pages. tx.db.metalock.Lock() n, err = io.CopyN(w, f, int64(tx.db.pageSize*2)) tx.db.metalock.Unlock() if err != nil { - _ = f.Close() return n, fmt.Errorf("meta copy: %s", err) } @@ -285,7 +309,6 @@ func (tx *Tx) WriteTo(w io.Writer) (n int64, err error) { wn, err := io.CopyN(w, f, tx.Size()-int64(tx.db.pageSize*2)) n += wn if err != nil { - _ = f.Close() return n, err } @@ -492,7 +515,7 @@ func (tx *Tx) writeMeta() error { } // page returns a reference to the page with a given id. -// If page has been written to then a temporary bufferred page is returned. +// If page has been written to then a temporary buffered page is returned. func (tx *Tx) page(id pgid) *page { // Check the dirty pages first. if tx.pages != nil { diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore b/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore deleted file mode 100644 index b25c15b81fa..00000000000 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*~ diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS b/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS deleted file mode 100644 index dab9dbe7514..00000000000 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS +++ /dev/null @@ -1,19 +0,0 @@ -# This file is like Go's AUTHORS file: it lists Copyright holders. -# The list of humans who have contributd is in the CONTRIBUTORS file. -# -# To contribute to this project, because it will eventually be folded -# back in to Go itself, you need to submit a CLA: -# -# http://golang.org/doc/contribute.html#copyright -# -# Then you get added to CONTRIBUTORS and you or your company get added -# to the AUTHORS file. - -Blake Mizerany github=bmizerany -Daniel Morsing github=DanielMorsing -Gabriel Aszalos github=gbbr -Google, Inc. -Keith Rarick github=kr -Matthew Keenan github=mattkeenan -Matt Layher github=mdlayher -Tatsuhiro Tsujikawa github=tatsuhiro-t diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS b/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS deleted file mode 100644 index 22e8c8c544f..00000000000 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS +++ /dev/null @@ -1,19 +0,0 @@ -# This file is like Go's CONTRIBUTORS file: it lists humans. -# The list of copyright holders (which may be companies) are in the AUTHORS file. -# -# To contribute to this project, because it will eventually be folded -# back in to Go itself, you need to submit a CLA: -# -# http://golang.org/doc/contribute.html#copyright -# -# Then you get added to CONTRIBUTORS and you or your company get added -# to the AUTHORS file. - -Blake Mizerany github=bmizerany -Brad Fitzpatrick github=bradfitz -Daniel Morsing github=DanielMorsing -Gabriel Aszalos github=gbbr -Keith Rarick github=kr -Matthew Keenan github=mattkeenan -Matt Layher github=mdlayher -Tatsuhiro Tsujikawa github=tatsuhiro-t diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING b/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING deleted file mode 100644 index 69aafe4d170..00000000000 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING +++ /dev/null @@ -1,5 +0,0 @@ -We only accept contributions from users who have gone through Go's -contribution process (signed a CLA). - -Please acknowledge whether you have (and use the same email) if -sending a pull request. diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE b/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE deleted file mode 100644 index 2dc6853cae2..00000000000 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2014 Google & the Go AUTHORS - -Go AUTHORS are: -See https://code.google.com/p/go/source/browse/AUTHORS - -Licensed under the terms of Go itself: -https://code.google.com/p/go/source/browse/LICENSE diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/client/client.go b/Godeps/_workspace/src/github.com/coreos/etcd/client/client.go index e484032c1aa..cf8aea8775b 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/client/client.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/client/client.go @@ -24,6 +24,7 @@ import ( "net/url" "reflect" "sort" + "strconv" "sync" "time" @@ -99,6 +100,8 @@ type Config struct { // watch start. But if server is behind some kind of proxy, the response // header may be cached at proxy, and Client cannot rely on this behavior. // + // Especially, wait request will ignore this timeout. + // // One API call may send multiple requests to different etcd servers until it // succeeds. Use context of the API to specify the overall timeout. // @@ -162,6 +165,11 @@ type Client interface { // this may differ from the initial Endpoints provided in the Config. Endpoints() []string + // SetEndpoints sets the set of API endpoints used by Client to resolve + // HTTP requests. If the given endpoints are not valid, an error will be + // returned + SetEndpoints(eps []string) error + httpClient } @@ -176,7 +184,7 @@ func New(cfg Config) (Client, error) { password: cfg.Password, } } - if err := c.reset(cfg.Endpoints); err != nil { + if err := c.SetEndpoints(cfg.Endpoints); err != nil { return nil, err } return c, nil @@ -219,7 +227,7 @@ type httpClusterClient struct { rand *rand.Rand } -func (c *httpClusterClient) reset(eps []string) error { +func (c *httpClusterClient) SetEndpoints(eps []string) error { if len(eps) == 0 { return ErrNoEndpoints } @@ -341,7 +349,7 @@ func (c *httpClusterClient) Sync(ctx context.Context) error { return nil } - return c.reset(eps) + return c.SetEndpoints(eps) } func (c *httpClusterClient) AutoSync(ctx context.Context, interval time.Duration) error { @@ -378,9 +386,21 @@ func (c *simpleHTTPClient) Do(ctx context.Context, act httpAction) (*http.Respon return nil, nil, err } + isWait := false + if req != nil && req.URL != nil { + ws := req.URL.Query().Get("wait") + if len(ws) != 0 { + var err error + isWait, err = strconv.ParseBool(ws) + if err != nil { + return nil, nil, fmt.Errorf("wrong wait value %s (%v for %+v)", ws, err, req) + } + } + } + var hctx context.Context var hcancel context.CancelFunc - if c.headerTimeout > 0 { + if !isWait && c.headerTimeout > 0 { hctx, hcancel = context.WithTimeout(ctx, c.headerTimeout) } else { hctx, hcancel = context.WithCancel(ctx) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth.go index 9e7dd4e79fd..2a6b17333f9 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth.go @@ -95,8 +95,7 @@ type store struct { timeout time.Duration ensuredOnce bool - mu sync.Mutex // protect enabled - enabled *bool + mu sync.Mutex } type User struct { @@ -409,8 +408,6 @@ func (s *store) EnableAuth() error { } err = s.enableAuth() if err == nil { - b := true - s.enabled = &b plog.Noticef("auth: enabled auth") } else { plog.Errorf("error enabling auth (%v)", err) @@ -428,8 +425,6 @@ func (s *store) DisableAuth() error { err := s.disableAuth() if err == nil { - b := false - s.enabled = &b plog.Noticef("auth: disabled auth") } else { plog.Errorf("error disabling auth (%v)", err) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth_requests.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth_requests.go index ca30060ce6e..0761121d747 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth_requests.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/auth/auth_requests.go @@ -85,15 +85,10 @@ func (s *store) detectAuth() bool { if s.server == nil { return false } - if s.enabled != nil { - return *s.enabled - } value, err := s.requestResource("/enabled", false) if err != nil { if e, ok := err.(*etcderr.Error); ok { if e.ErrorCode == etcderr.EcodeKeyNotFound { - b := false - s.enabled = &b return false } } @@ -107,7 +102,6 @@ func (s *store) detectAuth() bool { plog.Errorf("internal bookkeeping value for enabled isn't valid JSON (%v)", err) return false } - s.enabled = &u return u } diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go index 447fda41cb8..6f46c2fe9cf 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go @@ -13,38 +13,56 @@ It has these top-level messages: Request Metadata + InternalRaftRequest + ResponseHeader + RangeRequest + RangeResponse + PutRequest + PutResponse + DeleteRangeRequest + DeleteRangeResponse + RequestUnion + ResponseUnion + Compare + TxnRequest + TxnResponse + CompactionRequest + CompactionResponse */ package etcdserverpb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" + + proto "github.com/gogo/protobuf/proto" +) + import math "math" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" - import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Request struct { - ID uint64 `protobuf:"varint,1,opt" json:"ID"` - Method string `protobuf:"bytes,2,opt" json:"Method"` - Path string `protobuf:"bytes,3,opt" json:"Path"` - Val string `protobuf:"bytes,4,opt" json:"Val"` - Dir bool `protobuf:"varint,5,opt" json:"Dir"` - PrevValue string `protobuf:"bytes,6,opt" json:"PrevValue"` - PrevIndex uint64 `protobuf:"varint,7,opt" json:"PrevIndex"` - PrevExist *bool `protobuf:"varint,8,opt" json:"PrevExist,omitempty"` - Expiration int64 `protobuf:"varint,9,opt" json:"Expiration"` - Wait bool `protobuf:"varint,10,opt" json:"Wait"` - Since uint64 `protobuf:"varint,11,opt" json:"Since"` - Recursive bool `protobuf:"varint,12,opt" json:"Recursive"` - Sorted bool `protobuf:"varint,13,opt" json:"Sorted"` - Quorum bool `protobuf:"varint,14,opt" json:"Quorum"` - Time int64 `protobuf:"varint,15,opt" json:"Time"` - Stream bool `protobuf:"varint,16,opt" json:"Stream"` + ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` + Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"` + Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"` + Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"` + Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"` + PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"` + PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"` + PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"` + Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"` + Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"` + Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"` + Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"` + Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"` + Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"` + Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"` + Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"` XXX_unrecognized []byte `json:"-"` } @@ -53,8 +71,8 @@ func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} type Metadata struct { - NodeID uint64 `protobuf:"varint,1,opt" json:"NodeID"` - ClusterID uint64 `protobuf:"varint,2,opt" json:"ClusterID"` + NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` + ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` XXX_unrecognized []byte `json:"-"` } @@ -62,6 +80,10 @@ func (m *Metadata) Reset() { *m = Metadata{} } func (m *Metadata) String() string { return proto.CompactTextString(m) } func (*Metadata) ProtoMessage() {} +func init() { + proto.RegisterType((*Request)(nil), "etcdserverpb.Request") + proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata") +} func (m *Request) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -287,8 +309,12 @@ func (m *Request) 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 ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -301,6 +327,12 @@ func (m *Request) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -308,6 +340,9 @@ func (m *Request) Unmarshal(data []byte) error { } m.ID = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -324,6 +359,9 @@ func (m *Request) Unmarshal(data []byte) error { } var stringLen uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -350,6 +388,9 @@ func (m *Request) Unmarshal(data []byte) error { } var stringLen uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -376,6 +417,9 @@ func (m *Request) Unmarshal(data []byte) error { } var stringLen uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -402,6 +446,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -419,6 +466,9 @@ func (m *Request) Unmarshal(data []byte) error { } var stringLen uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -445,6 +495,9 @@ func (m *Request) Unmarshal(data []byte) error { } m.PrevIndex = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -461,6 +514,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -479,6 +535,9 @@ func (m *Request) Unmarshal(data []byte) error { } m.Expiration = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -495,6 +554,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -512,6 +574,9 @@ func (m *Request) Unmarshal(data []byte) error { } m.Since = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -528,6 +593,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -545,6 +613,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -562,6 +633,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -579,6 +653,9 @@ func (m *Request) Unmarshal(data []byte) error { } m.Time = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -595,6 +672,9 @@ func (m *Request) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -607,15 +687,7 @@ func (m *Request) Unmarshal(data []byte) error { } m.Stream = bool(v != 0) default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipEtcdserver(data[iNdEx:]) if err != nil { return err @@ -631,14 +703,21 @@ func (m *Request) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Metadata) 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 ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -651,6 +730,12 @@ func (m *Metadata) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -658,6 +743,9 @@ func (m *Metadata) Unmarshal(data []byte) error { } m.NodeID = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -674,6 +762,9 @@ func (m *Metadata) Unmarshal(data []byte) error { } m.ClusterID = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEtcdserver + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -685,15 +776,7 @@ func (m *Metadata) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipEtcdserver(data[iNdEx:]) if err != nil { return err @@ -709,6 +792,9 @@ func (m *Metadata) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipEtcdserver(data []byte) (n int, err error) { @@ -717,6 +803,9 @@ func skipEtcdserver(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEtcdserver + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -730,7 +819,10 @@ func skipEtcdserver(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEtcdserver + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -746,6 +838,9 @@ func skipEtcdserver(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEtcdserver + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -766,6 +861,9 @@ func skipEtcdserver(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEtcdserver + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -801,4 +899,5 @@ func skipEtcdserver(data []byte) (n int, err error) { var ( ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go index 8d6fb22cd31..47402aebf72 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go @@ -4,15 +4,20 @@ package etcdserverpb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" + proto "github.com/gogo/protobuf/proto" +) + +import math "math" import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // An InternalRaftRequest is the union of all requests which can be // sent via raft. @@ -28,6 +33,9 @@ func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } func (*InternalRaftRequest) ProtoMessage() {} +func init() { + proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest") +} func (m *InternalRaftRequest) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -162,48 +170,16 @@ func sovRaftInternal(x uint64) (n int) { func sozRaftInternal(x uint64) (n int) { return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (this *InternalRaftRequest) GetValue() interface{} { - if this.V2 != nil { - return this.V2 - } - if this.Range != nil { - return this.Range - } - if this.Put != nil { - return this.Put - } - if this.DeleteRange != nil { - return this.DeleteRange - } - if this.Txn != nil { - return this.Txn - } - return nil -} - -func (this *InternalRaftRequest) SetValue(value interface{}) bool { - switch vt := value.(type) { - case *Request: - this.V2 = vt - case *RangeRequest: - this.Range = vt - case *PutRequest: - this.Put = vt - case *DeleteRangeRequest: - this.DeleteRange = vt - case *TxnRequest: - this.Txn = vt - default: - return false - } - return true -} func (m *InternalRaftRequest) 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 ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -216,6 +192,12 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -223,6 +205,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -253,6 +238,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -283,6 +271,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -313,6 +304,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -343,6 +337,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -368,15 +365,7 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaftInternal(data[iNdEx:]) if err != nil { return err @@ -391,6 +380,9 @@ func (m *InternalRaftRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipRaftInternal(data []byte) (n int, err error) { @@ -399,6 +391,9 @@ func skipRaftInternal(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftInternal + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -412,7 +407,10 @@ func skipRaftInternal(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftInternal + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -428,6 +426,9 @@ func skipRaftInternal(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftInternal + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -448,6 +449,9 @@ func skipRaftInternal(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftInternal + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -483,4 +487,5 @@ func skipRaftInternal(data []byte) (n int, err error) { var ( ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.proto b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.proto index 7cf7b67d03a..32efcdafc9d 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.proto +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.proto @@ -13,12 +13,9 @@ option (gogoproto.goproto_getters_all) = false; // An InternalRaftRequest is the union of all requests which can be // sent via raft. message InternalRaftRequest { - option (gogoproto.onlyone) = true; - oneof value { Request v2 = 1; RangeRequest range = 2; PutRequest put = 3; DeleteRangeRequest delete_range = 4; TxnRequest txn = 5; - } } diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go index 462b0610b92..9dd30fb02f7 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go @@ -4,9 +4,14 @@ package etcdserverpb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" + + proto "github.com/gogo/protobuf/proto" +) + +import math "math" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" import storagepb "github.com/coreos/etcd/storage/storagepb" import ( @@ -15,10 +20,11 @@ import ( ) import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf type Compare_CompareResult int32 @@ -178,86 +184,404 @@ func (m *DeleteRangeResponse) GetHeader() *ResponseHeader { } type RequestUnion struct { - RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"` - RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"` - RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"` + // Types that are valid to be assigned to Request: + // *RequestUnion_RequestRange + // *RequestUnion_RequestPut + // *RequestUnion_RequestDeleteRange + Request isRequestUnion_Request `protobuf_oneof:"request"` } func (m *RequestUnion) Reset() { *m = RequestUnion{} } func (m *RequestUnion) String() string { return proto.CompactTextString(m) } func (*RequestUnion) ProtoMessage() {} -func (m *RequestUnion) GetRequestRange() *RangeRequest { +type isRequestUnion_Request interface { + isRequestUnion_Request() + MarshalTo([]byte) (int, error) + Size() int +} + +type RequestUnion_RequestRange struct { + RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,oneof"` +} +type RequestUnion_RequestPut struct { + RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,oneof"` +} +type RequestUnion_RequestDeleteRange struct { + RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,oneof"` +} + +func (*RequestUnion_RequestRange) isRequestUnion_Request() {} +func (*RequestUnion_RequestPut) isRequestUnion_Request() {} +func (*RequestUnion_RequestDeleteRange) isRequestUnion_Request() {} + +func (m *RequestUnion) GetRequest() isRequestUnion_Request { if m != nil { - return m.RequestRange + return m.Request + } + return nil +} + +func (m *RequestUnion) GetRequestRange() *RangeRequest { + if x, ok := m.GetRequest().(*RequestUnion_RequestRange); ok { + return x.RequestRange } return nil } func (m *RequestUnion) GetRequestPut() *PutRequest { - if m != nil { - return m.RequestPut + if x, ok := m.GetRequest().(*RequestUnion_RequestPut); ok { + return x.RequestPut } return nil } func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest { - if m != nil { - return m.RequestDeleteRange + if x, ok := m.GetRequest().(*RequestUnion_RequestDeleteRange); ok { + return x.RequestDeleteRange } return nil } +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RequestUnion) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), []interface{}) { + return _RequestUnion_OneofMarshaler, _RequestUnion_OneofUnmarshaler, []interface{}{ + (*RequestUnion_RequestRange)(nil), + (*RequestUnion_RequestPut)(nil), + (*RequestUnion_RequestDeleteRange)(nil), + } +} + +func _RequestUnion_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RequestUnion) + // request + switch x := m.Request.(type) { + case *RequestUnion_RequestRange: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RequestRange); err != nil { + return err + } + case *RequestUnion_RequestPut: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RequestPut); err != nil { + return err + } + case *RequestUnion_RequestDeleteRange: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RequestDeleteRange); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RequestUnion.Request has unexpected type %T", x) + } + return nil +} + +func _RequestUnion_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RequestUnion) + switch tag { + case 1: // request.request_range + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RangeRequest) + err := b.DecodeMessage(msg) + m.Request = &RequestUnion_RequestRange{msg} + return true, err + case 2: // request.request_put + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PutRequest) + err := b.DecodeMessage(msg) + m.Request = &RequestUnion_RequestPut{msg} + return true, err + case 3: // request.request_delete_range + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DeleteRangeRequest) + err := b.DecodeMessage(msg) + m.Request = &RequestUnion_RequestDeleteRange{msg} + return true, err + default: + return false, nil + } +} + type ResponseUnion struct { - ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"` - ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"` - ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"` + // Types that are valid to be assigned to Response: + // *ResponseUnion_ResponseRange + // *ResponseUnion_ResponsePut + // *ResponseUnion_ResponseDeleteRange + Response isResponseUnion_Response `protobuf_oneof:"response"` } func (m *ResponseUnion) Reset() { *m = ResponseUnion{} } func (m *ResponseUnion) String() string { return proto.CompactTextString(m) } func (*ResponseUnion) ProtoMessage() {} -func (m *ResponseUnion) GetResponseRange() *RangeResponse { +type isResponseUnion_Response interface { + isResponseUnion_Response() + MarshalTo([]byte) (int, error) + Size() int +} + +type ResponseUnion_ResponseRange struct { + ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,oneof"` +} +type ResponseUnion_ResponsePut struct { + ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,oneof"` +} +type ResponseUnion_ResponseDeleteRange struct { + ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,oneof"` +} + +func (*ResponseUnion_ResponseRange) isResponseUnion_Response() {} +func (*ResponseUnion_ResponsePut) isResponseUnion_Response() {} +func (*ResponseUnion_ResponseDeleteRange) isResponseUnion_Response() {} + +func (m *ResponseUnion) GetResponse() isResponseUnion_Response { if m != nil { - return m.ResponseRange + return m.Response + } + return nil +} + +func (m *ResponseUnion) GetResponseRange() *RangeResponse { + if x, ok := m.GetResponse().(*ResponseUnion_ResponseRange); ok { + return x.ResponseRange } return nil } func (m *ResponseUnion) GetResponsePut() *PutResponse { - if m != nil { - return m.ResponsePut + if x, ok := m.GetResponse().(*ResponseUnion_ResponsePut); ok { + return x.ResponsePut } return nil } func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse { - if m != nil { - return m.ResponseDeleteRange + if x, ok := m.GetResponse().(*ResponseUnion_ResponseDeleteRange); ok { + return x.ResponseDeleteRange } return nil } +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ResponseUnion) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), []interface{}) { + return _ResponseUnion_OneofMarshaler, _ResponseUnion_OneofUnmarshaler, []interface{}{ + (*ResponseUnion_ResponseRange)(nil), + (*ResponseUnion_ResponsePut)(nil), + (*ResponseUnion_ResponseDeleteRange)(nil), + } +} + +func _ResponseUnion_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ResponseUnion) + // response + switch x := m.Response.(type) { + case *ResponseUnion_ResponseRange: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ResponseRange); err != nil { + return err + } + case *ResponseUnion_ResponsePut: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ResponsePut); err != nil { + return err + } + case *ResponseUnion_ResponseDeleteRange: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ResponseDeleteRange); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ResponseUnion.Response has unexpected type %T", x) + } + return nil +} + +func _ResponseUnion_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ResponseUnion) + switch tag { + case 1: // response.response_range + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RangeResponse) + err := b.DecodeMessage(msg) + m.Response = &ResponseUnion_ResponseRange{msg} + return true, err + case 2: // response.response_put + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PutResponse) + err := b.DecodeMessage(msg) + m.Response = &ResponseUnion_ResponsePut{msg} + return true, err + case 3: // response.response_delete_range + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DeleteRangeResponse) + err := b.DecodeMessage(msg) + m.Response = &ResponseUnion_ResponseDeleteRange{msg} + return true, err + default: + return false, nil + } +} + type Compare struct { Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"` // key path Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // version of the given key - Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` - // create revision of the given key - CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"` - // last modified revision of the given key - ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"` - // value of the given key - Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + // Types that are valid to be assigned to TargetUnion: + // *Compare_Version + // *Compare_CreateRevision + // *Compare_ModRevision + // *Compare_Value + TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"` } func (m *Compare) Reset() { *m = Compare{} } func (m *Compare) String() string { return proto.CompactTextString(m) } func (*Compare) ProtoMessage() {} +type isCompare_TargetUnion interface { + isCompare_TargetUnion() + MarshalTo([]byte) (int, error) + Size() int +} + +type Compare_Version struct { + Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"` +} +type Compare_CreateRevision struct { + CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3,oneof"` +} +type Compare_ModRevision struct { + ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3,oneof"` +} +type Compare_Value struct { + Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"` +} + +func (*Compare_Version) isCompare_TargetUnion() {} +func (*Compare_CreateRevision) isCompare_TargetUnion() {} +func (*Compare_ModRevision) isCompare_TargetUnion() {} +func (*Compare_Value) isCompare_TargetUnion() {} + +func (m *Compare) GetTargetUnion() isCompare_TargetUnion { + if m != nil { + return m.TargetUnion + } + return nil +} + +func (m *Compare) GetVersion() int64 { + if x, ok := m.GetTargetUnion().(*Compare_Version); ok { + return x.Version + } + return 0 +} + +func (m *Compare) GetCreateRevision() int64 { + if x, ok := m.GetTargetUnion().(*Compare_CreateRevision); ok { + return x.CreateRevision + } + return 0 +} + +func (m *Compare) GetModRevision() int64 { + if x, ok := m.GetTargetUnion().(*Compare_ModRevision); ok { + return x.ModRevision + } + return 0 +} + +func (m *Compare) GetValue() []byte { + if x, ok := m.GetTargetUnion().(*Compare_Value); ok { + return x.Value + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), []interface{}) { + return _Compare_OneofMarshaler, _Compare_OneofUnmarshaler, []interface{}{ + (*Compare_Version)(nil), + (*Compare_CreateRevision)(nil), + (*Compare_ModRevision)(nil), + (*Compare_Value)(nil), + } +} + +func _Compare_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Compare) + // target_union + switch x := m.TargetUnion.(type) { + case *Compare_Version: + _ = b.EncodeVarint(4<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Version)) + case *Compare_CreateRevision: + _ = b.EncodeVarint(5<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.CreateRevision)) + case *Compare_ModRevision: + _ = b.EncodeVarint(6<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.ModRevision)) + case *Compare_Value: + _ = b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeRawBytes(x.Value) + case nil: + default: + return fmt.Errorf("Compare.TargetUnion has unexpected type %T", x) + } + return nil +} + +func _Compare_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Compare) + switch tag { + case 4: // target_union.version + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TargetUnion = &Compare_Version{int64(x)} + return true, err + case 5: // target_union.create_revision + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TargetUnion = &Compare_CreateRevision{int64(x)} + return true, err + case 6: // target_union.mod_revision + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TargetUnion = &Compare_ModRevision{int64(x)} + return true, err + case 7: // target_union.value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.TargetUnion = &Compare_Value{x} + return true, err + default: + return false, nil + } +} + // From google paxosdb paper: // Our implementation hinges around a powerful primitive which we call MultiOp. All other database // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically @@ -356,6 +680,20 @@ func (m *CompactionResponse) GetHeader() *ResponseHeader { } func init() { + proto.RegisterType((*ResponseHeader)(nil), "etcdserverpb.ResponseHeader") + proto.RegisterType((*RangeRequest)(nil), "etcdserverpb.RangeRequest") + proto.RegisterType((*RangeResponse)(nil), "etcdserverpb.RangeResponse") + proto.RegisterType((*PutRequest)(nil), "etcdserverpb.PutRequest") + proto.RegisterType((*PutResponse)(nil), "etcdserverpb.PutResponse") + proto.RegisterType((*DeleteRangeRequest)(nil), "etcdserverpb.DeleteRangeRequest") + proto.RegisterType((*DeleteRangeResponse)(nil), "etcdserverpb.DeleteRangeResponse") + proto.RegisterType((*RequestUnion)(nil), "etcdserverpb.RequestUnion") + proto.RegisterType((*ResponseUnion)(nil), "etcdserverpb.ResponseUnion") + proto.RegisterType((*Compare)(nil), "etcdserverpb.Compare") + proto.RegisterType((*TxnRequest)(nil), "etcdserverpb.TxnRequest") + proto.RegisterType((*TxnResponse)(nil), "etcdserverpb.TxnResponse") + proto.RegisterType((*CompactionRequest)(nil), "etcdserverpb.CompactionRequest") + proto.RegisterType((*CompactionResponse)(nil), "etcdserverpb.CompactionResponse") proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) } @@ -465,9 +803,9 @@ func RegisterEtcdServer(s *grpc.Server, srv EtcdServer) { s.RegisterService(&_Etcd_serviceDesc, srv) } -func _Etcd_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Etcd_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(RangeRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(EtcdServer).Range(ctx, in) @@ -477,9 +815,9 @@ func _Etcd_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, return out, nil } -func _Etcd_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Etcd_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(PutRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(EtcdServer).Put(ctx, in) @@ -489,9 +827,9 @@ func _Etcd_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, b return out, nil } -func _Etcd_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Etcd_DeleteRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(DeleteRangeRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(EtcdServer).DeleteRange(ctx, in) @@ -501,9 +839,9 @@ func _Etcd_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc. return out, nil } -func _Etcd_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Etcd_Txn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(TxnRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(EtcdServer).Txn(ctx, in) @@ -513,9 +851,9 @@ func _Etcd_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, b return out, nil } -func _Etcd_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Etcd_Compact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(CompactionRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(EtcdServer).Compact(ctx, in) @@ -830,31 +1168,37 @@ func (m *RequestUnion) MarshalTo(data []byte) (int, error) { _ = i var l int _ = l + if m.Request != nil { + nn4, err := m.Request.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += nn4 + } + return i, nil +} + +func (m *RequestUnion_RequestRange) MarshalTo(data []byte) (int, error) { + i := 0 if m.RequestRange != nil { data[i] = 0xa i++ i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size())) - n4, err := m.RequestRange.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.RequestPut != nil { - data[i] = 0x12 - i++ - i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size())) - n5, err := m.RequestPut.MarshalTo(data[i:]) + n5, err := m.RequestRange.MarshalTo(data[i:]) if err != nil { return 0, err } i += n5 } - if m.RequestDeleteRange != nil { - data[i] = 0x1a + return i, nil +} +func (m *RequestUnion_RequestPut) MarshalTo(data []byte) (int, error) { + i := 0 + if m.RequestPut != nil { + data[i] = 0x12 i++ - i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size())) - n6, err := m.RequestDeleteRange.MarshalTo(data[i:]) + i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size())) + n6, err := m.RequestPut.MarshalTo(data[i:]) if err != nil { return 0, err } @@ -862,7 +1206,20 @@ func (m *RequestUnion) MarshalTo(data []byte) (int, error) { } return i, nil } - +func (m *RequestUnion_RequestDeleteRange) MarshalTo(data []byte) (int, error) { + i := 0 + if m.RequestDeleteRange != nil { + data[i] = 0x1a + i++ + i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size())) + n7, err := m.RequestDeleteRange.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n7 + } + return i, nil +} func (m *ResponseUnion) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -878,31 +1235,23 @@ func (m *ResponseUnion) MarshalTo(data []byte) (int, error) { _ = i var l int _ = l + if m.Response != nil { + nn8, err := m.Response.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += nn8 + } + return i, nil +} + +func (m *ResponseUnion_ResponseRange) MarshalTo(data []byte) (int, error) { + i := 0 if m.ResponseRange != nil { data[i] = 0xa i++ i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size())) - n7, err := m.ResponseRange.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.ResponsePut != nil { - data[i] = 0x12 - i++ - i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size())) - n8, err := m.ResponsePut.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.ResponseDeleteRange != nil { - data[i] = 0x1a - i++ - i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size())) - n9, err := m.ResponseDeleteRange.MarshalTo(data[i:]) + n9, err := m.ResponseRange.MarshalTo(data[i:]) if err != nil { return 0, err } @@ -910,7 +1259,34 @@ func (m *ResponseUnion) MarshalTo(data []byte) (int, error) { } return i, nil } - +func (m *ResponseUnion_ResponsePut) MarshalTo(data []byte) (int, error) { + i := 0 + if m.ResponsePut != nil { + data[i] = 0x12 + i++ + i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size())) + n10, err := m.ResponsePut.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n10 + } + return i, nil +} +func (m *ResponseUnion_ResponseDeleteRange) MarshalTo(data []byte) (int, error) { + i := 0 + if m.ResponseDeleteRange != nil { + data[i] = 0x1a + i++ + i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size())) + n11, err := m.ResponseDeleteRange.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n11 + } + return i, nil +} func (m *Compare) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -944,32 +1320,47 @@ func (m *Compare) MarshalTo(data []byte) (int, error) { i += copy(data[i:], m.Key) } } - if m.Version != 0 { - data[i] = 0x20 - i++ - i = encodeVarintRpc(data, i, uint64(m.Version)) - } - if m.CreateRevision != 0 { - data[i] = 0x28 - i++ - i = encodeVarintRpc(data, i, uint64(m.CreateRevision)) - } - if m.ModRevision != 0 { - data[i] = 0x30 - i++ - i = encodeVarintRpc(data, i, uint64(m.ModRevision)) - } - if m.Value != nil { - if len(m.Value) > 0 { - data[i] = 0x3a - i++ - i = encodeVarintRpc(data, i, uint64(len(m.Value))) - i += copy(data[i:], m.Value) + if m.TargetUnion != nil { + nn12, err := m.TargetUnion.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += nn12 } return i, nil } +func (m *Compare_Version) MarshalTo(data []byte) (int, error) { + i := 0 + data[i] = 0x20 + i++ + i = encodeVarintRpc(data, i, uint64(m.Version)) + return i, nil +} +func (m *Compare_CreateRevision) MarshalTo(data []byte) (int, error) { + i := 0 + data[i] = 0x28 + i++ + i = encodeVarintRpc(data, i, uint64(m.CreateRevision)) + return i, nil +} +func (m *Compare_ModRevision) MarshalTo(data []byte) (int, error) { + i := 0 + data[i] = 0x30 + i++ + i = encodeVarintRpc(data, i, uint64(m.ModRevision)) + return i, nil +} +func (m *Compare_Value) MarshalTo(data []byte) (int, error) { + i := 0 + if m.Value != nil { + data[i] = 0x3a + i++ + i = encodeVarintRpc(data, i, uint64(len(m.Value))) + i += copy(data[i:], m.Value) + } + return i, nil +} func (m *TxnRequest) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -1043,11 +1434,11 @@ func (m *TxnResponse) MarshalTo(data []byte) (int, error) { data[i] = 0xa i++ i = encodeVarintRpc(data, i, uint64(m.Header.Size())) - n10, err := m.Header.MarshalTo(data[i:]) + n13, err := m.Header.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n10 + i += n13 } if m.Succeeded { data[i] = 0x10 @@ -1116,11 +1507,11 @@ func (m *CompactionResponse) MarshalTo(data []byte) (int, error) { data[i] = 0xa i++ i = encodeVarintRpc(data, i, uint64(m.Header.Size())) - n11, err := m.Header.MarshalTo(data[i:]) + n14, err := m.Header.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n11 + i += n14 } return i, nil } @@ -1274,41 +1665,77 @@ func (m *DeleteRangeResponse) Size() (n int) { } func (m *RequestUnion) Size() (n int) { + var l int + _ = l + if m.Request != nil { + n += m.Request.Size() + } + return n +} + +func (m *RequestUnion_RequestRange) Size() (n int) { var l int _ = l if m.RequestRange != nil { l = m.RequestRange.Size() n += 1 + l + sovRpc(uint64(l)) } + return n +} +func (m *RequestUnion_RequestPut) Size() (n int) { + var l int + _ = l if m.RequestPut != nil { l = m.RequestPut.Size() n += 1 + l + sovRpc(uint64(l)) } + return n +} +func (m *RequestUnion_RequestDeleteRange) Size() (n int) { + var l int + _ = l if m.RequestDeleteRange != nil { l = m.RequestDeleteRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } - func (m *ResponseUnion) Size() (n int) { + var l int + _ = l + if m.Response != nil { + n += m.Response.Size() + } + return n +} + +func (m *ResponseUnion_ResponseRange) Size() (n int) { var l int _ = l if m.ResponseRange != nil { l = m.ResponseRange.Size() n += 1 + l + sovRpc(uint64(l)) } + return n +} +func (m *ResponseUnion_ResponsePut) Size() (n int) { + var l int + _ = l if m.ResponsePut != nil { l = m.ResponsePut.Size() n += 1 + l + sovRpc(uint64(l)) } + return n +} +func (m *ResponseUnion_ResponseDeleteRange) Size() (n int) { + var l int + _ = l if m.ResponseDeleteRange != nil { l = m.ResponseDeleteRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } - func (m *Compare) Size() (n int) { var l int _ = l @@ -1324,24 +1751,39 @@ func (m *Compare) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } - if m.Version != 0 { - n += 1 + sovRpc(uint64(m.Version)) - } - if m.CreateRevision != 0 { - n += 1 + sovRpc(uint64(m.CreateRevision)) - } - if m.ModRevision != 0 { - n += 1 + sovRpc(uint64(m.ModRevision)) - } - if m.Value != nil { - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } + if m.TargetUnion != nil { + n += m.TargetUnion.Size() } return n } +func (m *Compare_Version) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.Version)) + return n +} +func (m *Compare_CreateRevision) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.CreateRevision)) + return n +} +func (m *Compare_ModRevision) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.ModRevision)) + return n +} +func (m *Compare_Value) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovRpc(uint64(l)) + } + return n +} func (m *TxnRequest) Size() (n int) { var l int _ = l @@ -1421,8 +1863,12 @@ func (m *ResponseHeader) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1435,6 +1881,12 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1442,6 +1894,9 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } var stringLen uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1468,6 +1923,9 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } m.ClusterId = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1484,6 +1942,9 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } m.MemberId = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1500,6 +1961,9 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } m.Revision = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1516,6 +1980,9 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } m.RaftTerm = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1527,15 +1994,7 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -1550,14 +2009,21 @@ func (m *ResponseHeader) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *RangeRequest) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1570,6 +2036,12 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1577,6 +2049,9 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1594,7 +2069,10 @@ func (m *RangeRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append([]byte{}, data[iNdEx:postIndex]...) + m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { @@ -1602,6 +2080,9 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1619,7 +2100,10 @@ func (m *RangeRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...) + m.RangeEnd = append(m.RangeEnd[:0], data[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } iNdEx = postIndex case 3: if wireType != 0 { @@ -1627,6 +2111,9 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } m.Limit = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1643,6 +2130,9 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } m.Revision = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1654,15 +2144,7 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -1677,14 +2159,21 @@ func (m *RangeRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *RangeResponse) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1697,6 +2186,12 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1704,6 +2199,9 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1734,6 +2232,9 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1762,6 +2263,9 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1774,15 +2278,7 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } m.More = bool(v != 0) default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -1797,14 +2293,21 @@ func (m *RangeResponse) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *PutRequest) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1817,6 +2320,12 @@ func (m *PutRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1824,6 +2333,9 @@ func (m *PutRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1841,7 +2353,10 @@ func (m *PutRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append([]byte{}, data[iNdEx:postIndex]...) + m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { @@ -1849,6 +2364,9 @@ func (m *PutRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1866,18 +2384,13 @@ func (m *PutRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append([]byte{}, data[iNdEx:postIndex]...) + m.Value = append(m.Value[:0], data[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -1892,14 +2405,21 @@ func (m *PutRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *PutResponse) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1912,6 +2432,12 @@ func (m *PutResponse) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1919,6 +2445,9 @@ func (m *PutResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1944,15 +2473,7 @@ func (m *PutResponse) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -1967,14 +2488,21 @@ func (m *PutResponse) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *DeleteRangeRequest) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1987,6 +2515,12 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -1994,6 +2528,9 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2011,7 +2548,10 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append([]byte{}, data[iNdEx:postIndex]...) + m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { @@ -2019,6 +2559,9 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2036,18 +2579,13 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...) + m.RangeEnd = append(m.RangeEnd[:0], data[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2062,14 +2600,21 @@ func (m *DeleteRangeRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *DeleteRangeResponse) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2082,6 +2627,12 @@ func (m *DeleteRangeResponse) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2089,6 +2640,9 @@ func (m *DeleteRangeResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2114,15 +2668,7 @@ func (m *DeleteRangeResponse) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2137,14 +2683,21 @@ func (m *DeleteRangeResponse) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *RequestUnion) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2157,6 +2710,12 @@ func (m *RequestUnion) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestUnion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestUnion: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2164,6 +2723,9 @@ func (m *RequestUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2181,12 +2743,11 @@ func (m *RequestUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RequestRange == nil { - m.RequestRange = &RangeRequest{} - } - if err := m.RequestRange.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &RangeRequest{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Request = &RequestUnion_RequestRange{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -2194,6 +2755,9 @@ func (m *RequestUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2211,12 +2775,11 @@ func (m *RequestUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RequestPut == nil { - m.RequestPut = &PutRequest{} - } - if err := m.RequestPut.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &PutRequest{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Request = &RequestUnion_RequestPut{v} iNdEx = postIndex case 3: if wireType != 2 { @@ -2224,6 +2787,9 @@ func (m *RequestUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2241,23 +2807,14 @@ func (m *RequestUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RequestDeleteRange == nil { - m.RequestDeleteRange = &DeleteRangeRequest{} - } - if err := m.RequestDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &DeleteRangeRequest{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Request = &RequestUnion_RequestDeleteRange{v} iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2272,14 +2829,21 @@ func (m *RequestUnion) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *ResponseUnion) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2292,6 +2856,12 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseUnion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseUnion: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2299,6 +2869,9 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2316,12 +2889,11 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ResponseRange == nil { - m.ResponseRange = &RangeResponse{} - } - if err := m.ResponseRange.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &RangeResponse{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Response = &ResponseUnion_ResponseRange{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -2329,6 +2901,9 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2346,12 +2921,11 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ResponsePut == nil { - m.ResponsePut = &PutResponse{} - } - if err := m.ResponsePut.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &PutResponse{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Response = &ResponseUnion_ResponsePut{v} iNdEx = postIndex case 3: if wireType != 2 { @@ -2359,6 +2933,9 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2376,23 +2953,14 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ResponseDeleteRange == nil { - m.ResponseDeleteRange = &DeleteRangeResponse{} - } - if err := m.ResponseDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil { + v := &DeleteRangeResponse{} + if err := v.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } + m.Response = &ResponseUnion_ResponseDeleteRange{v} iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2407,14 +2975,21 @@ func (m *ResponseUnion) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Compare) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2427,6 +3002,12 @@ func (m *Compare) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Compare: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Compare: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -2434,6 +3015,9 @@ func (m *Compare) Unmarshal(data []byte) error { } m.Result = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2450,6 +3034,9 @@ func (m *Compare) Unmarshal(data []byte) error { } m.Target = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2466,6 +3053,9 @@ func (m *Compare) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2483,62 +3073,80 @@ func (m *Compare) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append([]byte{}, data[iNdEx:postIndex]...) + m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Version = 0 + var v int64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ - m.Version |= (int64(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } + m.TargetUnion = &Compare_Version{v} case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) } - m.CreateRevision = 0 + var v int64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ - m.CreateRevision |= (int64(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } + m.TargetUnion = &Compare_CreateRevision{v} case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) } - m.ModRevision = 0 + var v int64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ - m.ModRevision |= (int64(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } + m.TargetUnion = &Compare_ModRevision{v} case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2556,18 +3164,12 @@ func (m *Compare) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append([]byte{}, data[iNdEx:postIndex]...) + v := make([]byte, postIndex-iNdEx) + copy(v, data[iNdEx:postIndex]) + m.TargetUnion = &Compare_Value{v} iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2582,14 +3184,21 @@ func (m *Compare) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *TxnRequest) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2602,6 +3211,12 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TxnRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxnRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2609,6 +3224,9 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2637,6 +3255,9 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2665,6 +3286,9 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2688,15 +3312,7 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2711,14 +3327,21 @@ func (m *TxnRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *TxnResponse) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2731,6 +3354,12 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TxnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2738,6 +3367,9 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2768,6 +3400,9 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2785,6 +3420,9 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2808,15 +3446,7 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2831,14 +3461,21 @@ func (m *TxnResponse) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *CompactionRequest) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2851,6 +3488,12 @@ func (m *CompactionRequest) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -2858,6 +3501,9 @@ func (m *CompactionRequest) Unmarshal(data []byte) error { } m.Revision = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2869,15 +3515,7 @@ func (m *CompactionRequest) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2892,14 +3530,21 @@ func (m *CompactionRequest) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *CompactionResponse) 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 ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2912,6 +3557,12 @@ func (m *CompactionResponse) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -2919,6 +3570,9 @@ func (m *CompactionResponse) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -2944,15 +3598,7 @@ func (m *CompactionResponse) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) if err != nil { return err @@ -2967,6 +3613,9 @@ func (m *CompactionResponse) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipRpc(data []byte) (n int, err error) { @@ -2975,6 +3624,9 @@ func skipRpc(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -2988,7 +3640,10 @@ func skipRpc(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -3004,6 +3659,9 @@ func skipRpc(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -3024,6 +3682,9 @@ func skipRpc(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -3059,4 +3720,5 @@ func skipRpc(data []byte) (n int, err error) { var ( ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/server.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/server.go index 42282bea3d6..170c61cd4bf 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/server.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/server.go @@ -174,12 +174,17 @@ type EtcdServer struct { // configuration is considered static for the lifetime of the EtcdServer. func NewServer(cfg *ServerConfig) (*EtcdServer, error) { st := store.New(StoreClusterPrefix, StoreKeysPrefix) + var w *wal.WAL var n raft.Node var s *raft.MemoryStorage var id types.ID var cl *cluster + if terr := fileutil.TouchDirAll(cfg.DataDir); terr != nil { + return nil, fmt.Errorf("cannot access data directory: %v", terr) + } + // Run the migrations. dataVer, err := version.DetectDataDir(cfg.DataDir) if err != nil { @@ -189,11 +194,6 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) { return nil, err } - err = os.MkdirAll(cfg.MemberDir(), privateDirMode) - if err != nil && err != os.ErrExist { - return nil, err - } - haveWAL := wal.Exist(cfg.WALDir()) ss := snap.New(cfg.SnapDir()) @@ -255,10 +255,6 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) { cfg.PrintWithInitial() id, n, s, w = startNode(cfg, cl, cl.MemberIDs()) case haveWAL: - if err := fileutil.IsDirWriteable(cfg.DataDir); err != nil { - return nil, fmt.Errorf("cannot write to data directory: %v", err) - } - if err := fileutil.IsDirWriteable(cfg.MemberDir()); err != nil { return nil, fmt.Errorf("cannot write to member directory: %v", err) } @@ -295,6 +291,10 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) { return nil, fmt.Errorf("unsupported bootstrap config") } + if terr := fileutil.TouchDirAll(cfg.MemberDir()); terr != nil { + return nil, fmt.Errorf("cannot access member directory: %v", terr) + } + sstats := &stats.ServerStats{ Name: cfg.Name, ID: id.String(), diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/v3demo_server.go b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/v3demo_server.go index 06cb68140a5..9d2972518bb 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/v3demo_server.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/v3demo_server.go @@ -19,6 +19,7 @@ import ( pb "github.com/coreos/etcd/etcdserver/etcdserverpb" dstorage "github.com/coreos/etcd/storage" + "github.com/coreos/etcd/storage/storagepb" "github.com/gogo/protobuf/proto" "golang.org/x/net/context" ) @@ -106,17 +107,24 @@ func doTxn(kv dstorage.KV, rt *pb.TxnRequest) *pb.TxnResponse { } func doUnion(kv dstorage.KV, union *pb.RequestUnion) *pb.ResponseUnion { - switch { - case union.RequestRange != nil: - return &pb.ResponseUnion{ResponseRange: doRange(kv, union.RequestRange)} - case union.RequestPut != nil: - return &pb.ResponseUnion{ResponsePut: doPut(kv, union.RequestPut)} - case union.RequestDeleteRange != nil: - return &pb.ResponseUnion{ResponseDeleteRange: doDeleteRange(kv, union.RequestDeleteRange)} + switch tv := union.Request.(type) { + case *pb.RequestUnion_RequestRange: + if tv.RequestRange != nil { + return &pb.ResponseUnion{Response: &pb.ResponseUnion_ResponseRange{ResponseRange: doRange(kv, tv.RequestRange)}} + } + case *pb.RequestUnion_RequestPut: + if tv.RequestPut != nil { + return &pb.ResponseUnion{Response: &pb.ResponseUnion_ResponsePut{ResponsePut: doPut(kv, tv.RequestPut)}} + } + case *pb.RequestUnion_RequestDeleteRange: + if tv.RequestDeleteRange != nil { + return &pb.ResponseUnion{Response: &pb.ResponseUnion_ResponseDeleteRange{ResponseDeleteRange: doDeleteRange(kv, tv.RequestDeleteRange)}} + } default: // empty union return nil } + return nil } func doCompare(kv dstorage.KV, c *pb.Compare) (int64, bool) { @@ -124,20 +132,35 @@ func doCompare(kv dstorage.KV, c *pb.Compare) (int64, bool) { if err != nil { return rev, false } - - ckv := ckvs[0] + var ckv storagepb.KeyValue + if len(ckvs) != 0 { + ckv = ckvs[0] + } // -1 is less, 0 is equal, 1 is greater var result int switch c.Target { case pb.Compare_VALUE: - result = bytes.Compare(ckv.Value, c.Value) + tv, _ := c.TargetUnion.(*pb.Compare_Value) + if tv != nil { + result = bytes.Compare(ckv.Value, tv.Value) + } case pb.Compare_CREATE: - result = compareInt64(ckv.CreateRevision, c.CreateRevision) + tv, _ := c.TargetUnion.(*pb.Compare_CreateRevision) + if tv != nil { + result = compareInt64(ckv.CreateRevision, tv.CreateRevision) + } + case pb.Compare_MOD: - result = compareInt64(ckv.ModRevision, c.ModRevision) + tv, _ := c.TargetUnion.(*pb.Compare_ModRevision) + if tv != nil { + result = compareInt64(ckv.ModRevision, tv.ModRevision) + } case pb.Compare_VERSION: - result = compareInt64(ckv.Version, c.Version) + tv, _ := c.TargetUnion.(*pb.Compare_Version) + if tv != nil { + result = compareInt64(ckv.Version, tv.Version) + } } switch c.Result { diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/fileutil/fileutil.go b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/fileutil/fileutil.go index b052553c11d..60552a77038 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/fileutil/fileutil.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/fileutil/fileutil.go @@ -25,6 +25,8 @@ import ( const ( privateFileMode = 0600 + // owner can make/remove files inside the directory + privateDirMode = 0700 ) var ( @@ -55,3 +57,13 @@ func ReadDir(dirpath string) ([]string, error) { sort.Strings(names) return names, nil } + +// TouchDirAll is simliar to os.MkdirAll. It creates directories with 0700 permission if any directory +// does not exists. TouchDirAll also ensures the given directory is writable. +func TouchDirAll(dir string) error { + err := os.MkdirAll(dir, privateDirMode) + if err != nil && err != os.ErrExist { + return err + } + return IsDirWriteable(dir) +} diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/ioutil/util.go b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/ioutil/util.go new file mode 100644 index 00000000000..d7ed18b4540 --- /dev/null +++ b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/ioutil/util.go @@ -0,0 +1,41 @@ +// Copyright 2015 CoreOS, 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 +// +// 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 ioutil + +import ( + "io" + "os" +) + +// WriteAndSyncFile behaviors just like ioutil.WriteFile in standard library +// but calls Sync before closing the file. WriteAndSyncFile guarantees the data +// is synced if there is no error returned. +func WriteAndSyncFile(filename string, data []byte, perm os.FileMode) error { + f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + if err != nil { + return err + } + n, err := f.Write(data) + if err == nil && n < len(data) { + err = io.ErrShortWrite + } + if err == nil { + err = f.Sync() + } + if err1 := f.Close(); err == nil { + err = err1 + } + return err +} diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/keepalive_listener.go b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/keepalive_listener.go index 6f580619ab0..1fe1ba80dd4 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/keepalive_listener.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/keepalive_listener.go @@ -21,17 +21,19 @@ import ( "time" ) -// NewKeepAliveListener returns a listener that listens on the given address. -// http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html -func NewKeepAliveListener(addr string, scheme string, info TLSInfo) (net.Listener, error) { - l, err := net.Listen("tcp", addr) - if err != nil { - return nil, err - } +type keepAliveConn interface { + SetKeepAlive(bool) error + SetKeepAlivePeriod(d time.Duration) error +} +// NewKeepAliveListener returns a listener that listens on the given address. +// Be careful when wrap around KeepAliveListener with another Listener if TLSInfo is not nil. +// Some pkgs (like go/http) might expect Listener to return TLSConn type to start TLS handshake. +// http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html +func NewKeepAliveListener(l net.Listener, scheme string, info TLSInfo) (net.Listener, error) { if scheme == "https" { if info.Empty() { - return nil, fmt.Errorf("cannot listen on TLS for %s: KeyFile and CertFile are not presented", scheme+"://"+addr) + return nil, fmt.Errorf("cannot listen on TLS for given listener: KeyFile and CertFile are not presented") } cfg, err := info.ServerConfig() if err != nil { @@ -53,13 +55,13 @@ func (kln *keepaliveListener) Accept() (net.Conn, error) { if err != nil { return nil, err } - tcpc := c.(*net.TCPConn) + kac := c.(keepAliveConn) // detection time: tcp_keepalive_time + tcp_keepalive_probes + tcp_keepalive_intvl // default on linux: 30 + 8 * 30 // default on osx: 30 + 8 * 75 - tcpc.SetKeepAlive(true) - tcpc.SetKeepAlivePeriod(30 * time.Second) - return tcpc, nil + kac.SetKeepAlive(true) + kac.SetKeepAlivePeriod(30 * time.Second) + return c, nil } // A tlsKeepaliveListener implements a network listener (net.Listener) for TLS connections. @@ -75,12 +77,12 @@ func (l *tlsKeepaliveListener) Accept() (c net.Conn, err error) { if err != nil { return } - tcpc := c.(*net.TCPConn) + kac := c.(keepAliveConn) // detection time: tcp_keepalive_time + tcp_keepalive_probes + tcp_keepalive_intvl // default on linux: 30 + 8 * 30 // default on osx: 30 + 8 * 75 - tcpc.SetKeepAlive(true) - tcpc.SetKeepAlivePeriod(30 * time.Second) + kac.SetKeepAlive(true) + kac.SetKeepAlivePeriod(30 * time.Second) c = tls.Server(c, l.config) return } diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/limit_listen.go b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/limit_listen.go new file mode 100644 index 00000000000..8a81a6b93f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport/limit_listen.go @@ -0,0 +1,70 @@ +// 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 netutil provides network utility functions, complementing the more +// common ones in the net package. +package transport + +import ( + "errors" + "net" + "sync" + "time" +) + +var ( + ErrNotTCP = errors.New("only tcp connections have keepalive") +) + +// LimitListener returns a Listener that accepts at most n simultaneous +// connections from the provided Listener. +func LimitListener(l net.Listener, n int) net.Listener { + return &limitListener{l, make(chan struct{}, n)} +} + +type limitListener struct { + net.Listener + sem chan struct{} +} + +func (l *limitListener) acquire() { l.sem <- struct{}{} } +func (l *limitListener) release() { <-l.sem } + +func (l *limitListener) Accept() (net.Conn, error) { + l.acquire() + c, err := l.Listener.Accept() + if err != nil { + l.release() + return nil, err + } + return &limitListenerConn{Conn: c, release: l.release}, nil +} + +type limitListenerConn struct { + net.Conn + releaseOnce sync.Once + release func() +} + +func (l *limitListenerConn) Close() error { + err := l.Conn.Close() + l.releaseOnce.Do(l.release) + return err +} + +func (l *limitListenerConn) SetKeepAlive(doKeepAlive bool) error { + tcpc, ok := l.Conn.(*net.TCPConn) + if !ok { + return ErrNotTCP + } + return tcpc.SetKeepAlive(doKeepAlive) +} + +func (l *limitListenerConn) SetKeepAlivePeriod(d time.Duration) error { + tcpc, ok := l.Conn.(*net.TCPConn) + if !ok { + return ErrNotTCP + } + return tcpc.SetKeepAlivePeriod(d) +} diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/raft/raftpb/raft.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/raft/raftpb/raft.pb.go index 60cb517ad8d..6c3bd480172 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/raft/raftpb/raft.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/raft/raftpb/raft.pb.go @@ -19,16 +19,19 @@ */ package raftpb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" + + proto "github.com/gogo/protobuf/proto" +) + import math "math" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" - import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type EntryType int32 @@ -164,10 +167,10 @@ func (x *ConfChangeType) UnmarshalJSON(data []byte) error { } type Entry struct { - Type EntryType `protobuf:"varint,1,opt,enum=raftpb.EntryType" json:"Type"` - Term uint64 `protobuf:"varint,2,opt" json:"Term"` - Index uint64 `protobuf:"varint,3,opt" json:"Index"` - Data []byte `protobuf:"bytes,4,opt" json:"Data,omitempty"` + Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"` + Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"` + Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"` + Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -236,10 +239,10 @@ func (m *ConfState) String() string { return proto.CompactTextString(m) } func (*ConfState) ProtoMessage() {} type ConfChange struct { - ID uint64 `protobuf:"varint,1,opt" json:"ID"` - Type ConfChangeType `protobuf:"varint,2,opt,enum=raftpb.ConfChangeType" json:"Type"` - NodeID uint64 `protobuf:"varint,3,opt" json:"NodeID"` - Context []byte `protobuf:"bytes,4,opt" json:"Context,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` + Type ConfChangeType `protobuf:"varint,2,opt,name=Type,enum=raftpb.ConfChangeType" json:"Type"` + NodeID uint64 `protobuf:"varint,3,opt,name=NodeID" json:"NodeID"` + Context []byte `protobuf:"bytes,4,opt,name=Context" json:"Context,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -248,6 +251,13 @@ func (m *ConfChange) String() string { return proto.CompactTextString(m) } func (*ConfChange) ProtoMessage() {} func init() { + proto.RegisterType((*Entry)(nil), "raftpb.Entry") + proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata") + proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot") + proto.RegisterType((*Message)(nil), "raftpb.Message") + proto.RegisterType((*HardState)(nil), "raftpb.HardState") + proto.RegisterType((*ConfState)(nil), "raftpb.ConfState") + proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange") proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value) proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value) proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value) @@ -681,8 +691,12 @@ func (m *Entry) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -695,6 +709,12 @@ func (m *Entry) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -702,6 +722,9 @@ func (m *Entry) Unmarshal(data []byte) error { } m.Type = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -718,6 +741,9 @@ func (m *Entry) Unmarshal(data []byte) error { } m.Term = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -734,6 +760,9 @@ func (m *Entry) Unmarshal(data []byte) error { } m.Index = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -750,6 +779,9 @@ func (m *Entry) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -767,18 +799,13 @@ func (m *Entry) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) + m.Data = append(m.Data[:0], data[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -794,14 +821,21 @@ func (m *Entry) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *SnapshotMetadata) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -814,6 +848,12 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -821,6 +861,9 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -848,6 +891,9 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } m.Index = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -864,6 +910,9 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } m.Term = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -875,15 +924,7 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -899,14 +940,21 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Snapshot) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -919,6 +967,12 @@ func (m *Snapshot) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Snapshot: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -926,6 +980,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -943,7 +1000,10 @@ func (m *Snapshot) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) + m.Data = append(m.Data[:0], data[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { @@ -951,6 +1011,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -973,15 +1036,7 @@ func (m *Snapshot) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -997,14 +1052,21 @@ func (m *Snapshot) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Message) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1017,6 +1079,12 @@ func (m *Message) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Message: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -1024,6 +1092,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.Type = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1040,6 +1111,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.To = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1056,6 +1130,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.From = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1072,6 +1149,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.Term = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1088,6 +1168,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.LogTerm = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1104,6 +1187,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.Index = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1120,6 +1206,9 @@ func (m *Message) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1148,6 +1237,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.Commit = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1164,6 +1256,9 @@ func (m *Message) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1191,6 +1286,9 @@ func (m *Message) Unmarshal(data []byte) error { } var v int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1208,6 +1306,9 @@ func (m *Message) Unmarshal(data []byte) error { } m.RejectHint = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1219,15 +1320,7 @@ func (m *Message) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -1243,14 +1336,21 @@ func (m *Message) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *HardState) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1263,6 +1363,12 @@ func (m *HardState) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HardState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -1270,6 +1376,9 @@ func (m *HardState) Unmarshal(data []byte) error { } m.Term = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1286,6 +1395,9 @@ func (m *HardState) Unmarshal(data []byte) error { } m.Vote = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1302,6 +1414,9 @@ func (m *HardState) Unmarshal(data []byte) error { } m.Commit = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1313,15 +1428,7 @@ func (m *HardState) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -1337,14 +1444,21 @@ func (m *HardState) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *ConfState) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1357,6 +1471,12 @@ func (m *ConfState) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -1364,6 +1484,9 @@ func (m *ConfState) Unmarshal(data []byte) error { } var v uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1376,15 +1499,7 @@ func (m *ConfState) Unmarshal(data []byte) error { } m.Nodes = append(m.Nodes, v) default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -1400,14 +1515,21 @@ func (m *ConfState) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *ConfChange) 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 ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1420,6 +1542,12 @@ func (m *ConfChange) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfChange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -1427,6 +1555,9 @@ func (m *ConfChange) Unmarshal(data []byte) error { } m.ID = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1443,6 +1574,9 @@ func (m *ConfChange) Unmarshal(data []byte) error { } m.Type = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1459,6 +1593,9 @@ func (m *ConfChange) Unmarshal(data []byte) error { } m.NodeID = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1475,6 +1612,9 @@ func (m *ConfChange) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaft + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1492,18 +1632,13 @@ func (m *ConfChange) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Context = append([]byte{}, data[iNdEx:postIndex]...) + m.Context = append(m.Context[:0], data[iNdEx:postIndex]...) + if m.Context == nil { + m.Context = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRaft(data[iNdEx:]) if err != nil { return err @@ -1519,6 +1654,9 @@ func (m *ConfChange) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipRaft(data []byte) (n int, err error) { @@ -1527,6 +1665,9 @@ func skipRaft(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaft + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -1540,7 +1681,10 @@ func skipRaft(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaft + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -1556,6 +1700,9 @@ func skipRaft(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaft + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -1576,6 +1723,9 @@ func skipRaft(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaft + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -1611,4 +1761,5 @@ func skipRaft(data []byte) (n int, err error) { var ( ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/snap/snappb/snap.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/snap/snappb/snap.pb.go index 1013dbbfc87..5d1d21ab31d 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/snap/snappb/snap.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/snap/snappb/snap.pb.go @@ -13,16 +13,19 @@ */ package snappb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" + + proto "github.com/gogo/protobuf/proto" +) + import math "math" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" - import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Snapshot struct { @@ -35,6 +38,9 @@ func (m *Snapshot) Reset() { *m = Snapshot{} } func (m *Snapshot) String() string { return proto.CompactTextString(m) } func (*Snapshot) ProtoMessage() {} +func init() { + proto.RegisterType((*Snapshot)(nil), "snappb.snapshot") +} func (m *Snapshot) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -123,8 +129,12 @@ func (m *Snapshot) 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 ErrIntOverflowSnap + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -137,6 +147,12 @@ func (m *Snapshot) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: snapshot: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: snapshot: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -144,6 +160,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } m.Crc = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnap + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -160,6 +179,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnap + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -177,18 +199,13 @@ func (m *Snapshot) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) + m.Data = append(m.Data[:0], data[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipSnap(data[iNdEx:]) if err != nil { return err @@ -204,6 +221,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipSnap(data []byte) (n int, err error) { @@ -212,6 +232,9 @@ func skipSnap(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnap + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -225,7 +248,10 @@ func skipSnap(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnap + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -241,6 +267,9 @@ func skipSnap(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnap + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -261,6 +290,9 @@ func skipSnap(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnap + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -296,4 +328,5 @@ func skipSnap(data []byte) (n int, err error) { var ( ErrInvalidLengthSnap = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSnap = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/storage/storagepb/kv.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/storage/storagepb/kv.pb.go index 03f6fe98ed5..2ac835a1ae2 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/storage/storagepb/kv.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/storage/storagepb/kv.pb.go @@ -14,15 +14,20 @@ */ package storagepb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" + proto "github.com/gogo/protobuf/proto" +) + +import math "math" import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf type Event_EventType int32 @@ -76,6 +81,8 @@ func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} func init() { + proto.RegisterType((*KeyValue)(nil), "storagepb.KeyValue") + proto.RegisterType((*Event)(nil), "storagepb.Event") proto.RegisterEnum("storagepb.Event_EventType", Event_EventType_name, Event_EventType_value) } func (m *KeyValue) Marshal() (data []byte, err error) { @@ -244,8 +251,12 @@ func (m *KeyValue) 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 ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -258,6 +269,12 @@ func (m *KeyValue) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 2 { @@ -265,6 +282,9 @@ func (m *KeyValue) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -282,7 +302,10 @@ func (m *KeyValue) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append([]byte{}, data[iNdEx:postIndex]...) + m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 2: if wireType != 0 { @@ -290,6 +313,9 @@ func (m *KeyValue) Unmarshal(data []byte) error { } m.CreateRevision = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -306,6 +332,9 @@ func (m *KeyValue) Unmarshal(data []byte) error { } m.ModRevision = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -322,6 +351,9 @@ func (m *KeyValue) Unmarshal(data []byte) error { } m.Version = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -338,6 +370,9 @@ func (m *KeyValue) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -355,18 +390,13 @@ func (m *KeyValue) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append([]byte{}, data[iNdEx:postIndex]...) + m.Value = append(m.Value[:0], data[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipKv(data[iNdEx:]) if err != nil { return err @@ -381,14 +411,21 @@ func (m *KeyValue) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Event) 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 ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -401,6 +438,12 @@ func (m *Event) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -408,6 +451,9 @@ func (m *Event) Unmarshal(data []byte) error { } m.Type = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -424,6 +470,9 @@ func (m *Event) Unmarshal(data []byte) error { } var msglen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -449,15 +498,7 @@ func (m *Event) Unmarshal(data []byte) error { } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipKv(data[iNdEx:]) if err != nil { return err @@ -472,6 +513,9 @@ func (m *Event) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipKv(data []byte) (n int, err error) { @@ -480,6 +524,9 @@ func skipKv(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKv + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -493,7 +540,10 @@ func skipKv(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKv + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -509,6 +559,9 @@ func skipKv(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKv + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -529,6 +582,9 @@ func skipKv(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKv + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -564,4 +620,5 @@ func skipKv(data []byte) (n int, err error) { var ( ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/version/version.go b/Godeps/_workspace/src/github.com/coreos/etcd/version/version.go index a2436553e6b..5e2b778547a 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/version/version.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/version/version.go @@ -27,7 +27,7 @@ import ( var ( // MinClusterVersion is the min cluster version this etcd binary is compatible with. MinClusterVersion = "2.1.0" - Version = "2.2.2+git" + Version = "2.2.5" // Git SHA Value will be set during build GitSHA = "Not provided (use ./build instead of go build)" diff --git a/Godeps/_workspace/src/github.com/coreos/etcd/wal/walpb/record.pb.go b/Godeps/_workspace/src/github.com/coreos/etcd/wal/walpb/record.pb.go index a9b38a47ef9..638bdc3b69f 100644 --- a/Godeps/_workspace/src/github.com/coreos/etcd/wal/walpb/record.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/etcd/wal/walpb/record.pb.go @@ -14,16 +14,19 @@ */ package walpb -import proto "github.com/gogo/protobuf/proto" +import ( + "fmt" + + proto "github.com/gogo/protobuf/proto" +) + import math "math" -// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto" - import io "io" -import fmt "fmt" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Record struct { @@ -47,6 +50,10 @@ func (m *Snapshot) Reset() { *m = Snapshot{} } func (m *Snapshot) String() string { return proto.CompactTextString(m) } func (*Snapshot) ProtoMessage() {} +func init() { + proto.RegisterType((*Record)(nil), "walpb.Record") + proto.RegisterType((*Snapshot)(nil), "walpb.Snapshot") +} func (m *Record) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -177,8 +184,12 @@ func (m *Record) 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 ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -191,6 +202,12 @@ func (m *Record) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Record: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -198,6 +215,9 @@ func (m *Record) Unmarshal(data []byte) error { } m.Type = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -214,6 +234,9 @@ func (m *Record) Unmarshal(data []byte) error { } m.Crc = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -230,6 +253,9 @@ func (m *Record) Unmarshal(data []byte) error { } var byteLen int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -247,18 +273,13 @@ func (m *Record) Unmarshal(data []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) + m.Data = append(m.Data[:0], data[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } iNdEx = postIndex default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRecord(data[iNdEx:]) if err != nil { return err @@ -274,14 +295,21 @@ func (m *Record) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func (m *Snapshot) 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 ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -294,6 +322,12 @@ func (m *Snapshot) Unmarshal(data []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Snapshot: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) + } switch fieldNum { case 1: if wireType != 0 { @@ -301,6 +335,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } m.Index = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -317,6 +354,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } m.Term = 0 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -328,15 +368,7 @@ func (m *Snapshot) Unmarshal(data []byte) error { } } default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire + iNdEx = preIndex skippy, err := skipRecord(data[iNdEx:]) if err != nil { return err @@ -352,6 +384,9 @@ func (m *Snapshot) Unmarshal(data []byte) error { } } + if iNdEx > l { + return io.ErrUnexpectedEOF + } return nil } func skipRecord(data []byte) (n int, err error) { @@ -360,6 +395,9 @@ func skipRecord(data []byte) (n int, err error) { for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecord + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -373,7 +411,10 @@ func skipRecord(data []byte) (n int, err error) { wireType := int(wire & 0x7) switch wireType { case 0: - for { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecord + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -389,6 +430,9 @@ func skipRecord(data []byte) (n int, err error) { case 2: var length int for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecord + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -409,6 +453,9 @@ func skipRecord(data []byte) (n int, err error) { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecord + } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } @@ -444,4 +491,5 @@ func skipRecord(data []byte) (n int, err error) { var ( ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow") ) diff --git a/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE b/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE index e06d2081865..f152ee101ed 100644 --- a/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE +++ b/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE @@ -200,3 +200,28 @@ Apache License See the License for the specific language governing permissions and limitations under the License. + +Third Party Sources Bundled + +This project includes code derived from the MIT licensed naegelejd/go-acl +project. Here's a copy of its license: + + Copyright (c) 2015 Joseph Naegele + + 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/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/README.md b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/README.md index d4428e1df32..738ae2e7617 100644 --- a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/README.md +++ b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/README.md @@ -2,8 +2,6 @@ The API defined here is proposed, experimental, and (for now) subject to change at any time. -**Do not use it.** - If you think you want to use it, or for any other queries, contact or file an [issue](https://github.com/coreos/rkt/issues/new) For more information, see: diff --git a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.pb.go b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.pb.go index 4195b024298..1b64bb03a33 100644 --- a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.pb.go +++ b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.pb.go @@ -51,6 +51,10 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 + // ImageType defines the supported image type. type ImageType int32 @@ -77,6 +81,7 @@ var ImageType_value = map[string]int32{ func (x ImageType) String() string { return proto.EnumName(ImageType_name, int32(x)) } +func (ImageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // AppState defines the possible states of the app. type AppState int32 @@ -101,6 +106,7 @@ var AppState_value = map[string]int32{ func (x AppState) String() string { return proto.EnumName(AppState_name, int32(x)) } +func (AppState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } // PodState defines the possible states of the pod. // See https://github.com/coreos/rkt/blob/master/Documentation/devel/pod-lifecycle.md for a detailed @@ -148,6 +154,7 @@ var PodState_value = map[string]int32{ func (x PodState) String() string { return proto.EnumName(PodState_name, int32(x)) } +func (PodState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } // EventType defines the type of the events that will be received via ListenEvents(). type EventType int32 @@ -196,6 +203,7 @@ var EventType_value = map[string]int32{ func (x EventType) String() string { return proto.EnumName(EventType_name, int32(x)) } +func (EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } // ImageFormat defines the format of the image. type ImageFormat struct { @@ -205,9 +213,10 @@ type ImageFormat struct { Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` } -func (m *ImageFormat) Reset() { *m = ImageFormat{} } -func (m *ImageFormat) String() string { return proto.CompactTextString(m) } -func (*ImageFormat) ProtoMessage() {} +func (m *ImageFormat) Reset() { *m = ImageFormat{} } +func (m *ImageFormat) String() string { return proto.CompactTextString(m) } +func (*ImageFormat) ProtoMessage() {} +func (*ImageFormat) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // Image describes the image's information. type Image struct { @@ -232,9 +241,10 @@ type Image struct { Annotations []*KeyValue `protobuf:"bytes,8,rep,name=annotations" json:"annotations,omitempty"` } -func (m *Image) Reset() { *m = Image{} } -func (m *Image) String() string { return proto.CompactTextString(m) } -func (*Image) ProtoMessage() {} +func (m *Image) Reset() { *m = Image{} } +func (m *Image) String() string { return proto.CompactTextString(m) } +func (*Image) ProtoMessage() {} +func (*Image) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Image) GetBaseFormat() *ImageFormat { if m != nil { @@ -260,9 +270,10 @@ type Network struct { Ipv6 string `protobuf:"bytes,3,opt,name=ipv6" json:"ipv6,omitempty"` } -func (m *Network) Reset() { *m = Network{} } -func (m *Network) String() string { return proto.CompactTextString(m) } -func (*Network) ProtoMessage() {} +func (m *Network) Reset() { *m = Network{} } +func (m *Network) String() string { return proto.CompactTextString(m) } +func (*Network) ProtoMessage() {} +func (*Network) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } // App describes the information of an app that's running in a pod. type App struct { @@ -280,9 +291,10 @@ type App struct { Annotations []*KeyValue `protobuf:"bytes,5,rep,name=annotations" json:"annotations,omitempty"` } -func (m *App) Reset() { *m = App{} } -func (m *App) String() string { return proto.CompactTextString(m) } -func (*App) ProtoMessage() {} +func (m *App) Reset() { *m = App{} } +func (m *App) String() string { return proto.CompactTextString(m) } +func (*App) ProtoMessage() {} +func (*App) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *App) GetImage() *Image { if m != nil { @@ -327,9 +339,10 @@ type Pod struct { Annotations []*KeyValue `protobuf:"bytes,7,rep,name=annotations" json:"annotations,omitempty"` } -func (m *Pod) Reset() { *m = Pod{} } -func (m *Pod) String() string { return proto.CompactTextString(m) } -func (*Pod) ProtoMessage() {} +func (m *Pod) Reset() { *m = Pod{} } +func (m *Pod) String() string { return proto.CompactTextString(m) } +func (*Pod) ProtoMessage() {} +func (*Pod) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *Pod) GetApps() []*App { if m != nil { @@ -354,14 +367,15 @@ func (m *Pod) GetAnnotations() []*KeyValue { type KeyValue struct { // Key part of the key-value pair. - Key string `protobuf:"bytes,1,opt" json:"Key,omitempty"` + Key string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"` // Value part of the key-value pair. Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} +func (m *KeyValue) Reset() { *m = KeyValue{} } +func (m *KeyValue) String() string { return proto.CompactTextString(m) } +func (*KeyValue) ProtoMessage() {} +func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } // PodFilter defines the condition that the returned pods need to satisfy in ListPods(). // The conditions are combined by 'AND', and different filters are combined by 'OR'. @@ -380,9 +394,10 @@ type PodFilter struct { Annotations []*KeyValue `protobuf:"bytes,6,rep,name=annotations" json:"annotations,omitempty"` } -func (m *PodFilter) Reset() { *m = PodFilter{} } -func (m *PodFilter) String() string { return proto.CompactTextString(m) } -func (*PodFilter) ProtoMessage() {} +func (m *PodFilter) Reset() { *m = PodFilter{} } +func (m *PodFilter) String() string { return proto.CompactTextString(m) } +func (*PodFilter) ProtoMessage() {} +func (*PodFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *PodFilter) GetAnnotations() []*KeyValue { if m != nil { @@ -413,11 +428,14 @@ type ImageFilter struct { ImportedBefore int64 `protobuf:"varint,7,opt,name=imported_before" json:"imported_before,omitempty"` // If not empty, the images that have all of the annotations will be returned. Annotations []*KeyValue `protobuf:"bytes,8,rep,name=annotations" json:"annotations,omitempty"` + // If not empty, the images that have any of the exact full names will be returned. + FullNames []string `protobuf:"bytes,9,rep,name=full_names" json:"full_names,omitempty"` } -func (m *ImageFilter) Reset() { *m = ImageFilter{} } -func (m *ImageFilter) String() string { return proto.CompactTextString(m) } -func (*ImageFilter) ProtoMessage() {} +func (m *ImageFilter) Reset() { *m = ImageFilter{} } +func (m *ImageFilter) String() string { return proto.CompactTextString(m) } +func (*ImageFilter) ProtoMessage() {} +func (*ImageFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *ImageFilter) GetLabels() []*KeyValue { if m != nil { @@ -443,9 +461,10 @@ type Info struct { ApiVersion string `protobuf:"bytes,3,opt,name=api_version" json:"api_version,omitempty"` } -func (m *Info) Reset() { *m = Info{} } -func (m *Info) String() string { return proto.CompactTextString(m) } -func (*Info) ProtoMessage() {} +func (m *Info) Reset() { *m = Info{} } +func (m *Info) String() string { return proto.CompactTextString(m) } +func (*Info) ProtoMessage() {} +func (*Info) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } // Event describes the events that will be received via ListenEvents(). type Event struct { @@ -466,9 +485,10 @@ type Event struct { Data []*KeyValue `protobuf:"bytes,5,rep,name=data" json:"data,omitempty"` } -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} +func (m *Event) Reset() { *m = Event{} } +func (m *Event) String() string { return proto.CompactTextString(m) } +func (*Event) ProtoMessage() {} +func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *Event) GetData() []*KeyValue { if m != nil { @@ -495,26 +515,29 @@ type EventFilter struct { UntilTime int64 `protobuf:"varint,5,opt,name=until_time" json:"until_time,omitempty"` } -func (m *EventFilter) Reset() { *m = EventFilter{} } -func (m *EventFilter) String() string { return proto.CompactTextString(m) } -func (*EventFilter) ProtoMessage() {} +func (m *EventFilter) Reset() { *m = EventFilter{} } +func (m *EventFilter) String() string { return proto.CompactTextString(m) } +func (*EventFilter) ProtoMessage() {} +func (*EventFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } // Request for GetInfo(). type GetInfoRequest struct { } -func (m *GetInfoRequest) Reset() { *m = GetInfoRequest{} } -func (m *GetInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetInfoRequest) ProtoMessage() {} +func (m *GetInfoRequest) Reset() { *m = GetInfoRequest{} } +func (m *GetInfoRequest) String() string { return proto.CompactTextString(m) } +func (*GetInfoRequest) ProtoMessage() {} +func (*GetInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } // Response for GetInfo(). type GetInfoResponse struct { Info *Info `protobuf:"bytes,1,opt,name=info" json:"info,omitempty"` } -func (m *GetInfoResponse) Reset() { *m = GetInfoResponse{} } -func (m *GetInfoResponse) String() string { return proto.CompactTextString(m) } -func (*GetInfoResponse) ProtoMessage() {} +func (m *GetInfoResponse) Reset() { *m = GetInfoResponse{} } +func (m *GetInfoResponse) String() string { return proto.CompactTextString(m) } +func (*GetInfoResponse) ProtoMessage() {} +func (*GetInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *GetInfoResponse) GetInfo() *Info { if m != nil { @@ -529,9 +552,10 @@ type ListPodsRequest struct { Detail bool `protobuf:"varint,2,opt,name=detail" json:"detail,omitempty"` } -func (m *ListPodsRequest) Reset() { *m = ListPodsRequest{} } -func (m *ListPodsRequest) String() string { return proto.CompactTextString(m) } -func (*ListPodsRequest) ProtoMessage() {} +func (m *ListPodsRequest) Reset() { *m = ListPodsRequest{} } +func (m *ListPodsRequest) String() string { return proto.CompactTextString(m) } +func (*ListPodsRequest) ProtoMessage() {} +func (*ListPodsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *ListPodsRequest) GetFilters() []*PodFilter { if m != nil { @@ -545,9 +569,10 @@ type ListPodsResponse struct { Pods []*Pod `protobuf:"bytes,1,rep,name=pods" json:"pods,omitempty"` } -func (m *ListPodsResponse) Reset() { *m = ListPodsResponse{} } -func (m *ListPodsResponse) String() string { return proto.CompactTextString(m) } -func (*ListPodsResponse) ProtoMessage() {} +func (m *ListPodsResponse) Reset() { *m = ListPodsResponse{} } +func (m *ListPodsResponse) String() string { return proto.CompactTextString(m) } +func (*ListPodsResponse) ProtoMessage() {} +func (*ListPodsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *ListPodsResponse) GetPods() []*Pod { if m != nil { @@ -562,18 +587,20 @@ type InspectPodRequest struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` } -func (m *InspectPodRequest) Reset() { *m = InspectPodRequest{} } -func (m *InspectPodRequest) String() string { return proto.CompactTextString(m) } -func (*InspectPodRequest) ProtoMessage() {} +func (m *InspectPodRequest) Reset() { *m = InspectPodRequest{} } +func (m *InspectPodRequest) String() string { return proto.CompactTextString(m) } +func (*InspectPodRequest) ProtoMessage() {} +func (*InspectPodRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } // Response for InspectPod(). type InspectPodResponse struct { Pod *Pod `protobuf:"bytes,1,opt,name=pod" json:"pod,omitempty"` } -func (m *InspectPodResponse) Reset() { *m = InspectPodResponse{} } -func (m *InspectPodResponse) String() string { return proto.CompactTextString(m) } -func (*InspectPodResponse) ProtoMessage() {} +func (m *InspectPodResponse) Reset() { *m = InspectPodResponse{} } +func (m *InspectPodResponse) String() string { return proto.CompactTextString(m) } +func (*InspectPodResponse) ProtoMessage() {} +func (*InspectPodResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } func (m *InspectPodResponse) GetPod() *Pod { if m != nil { @@ -588,9 +615,10 @@ type ListImagesRequest struct { Detail bool `protobuf:"varint,2,opt,name=detail" json:"detail,omitempty"` } -func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } -func (m *ListImagesRequest) String() string { return proto.CompactTextString(m) } -func (*ListImagesRequest) ProtoMessage() {} +func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } +func (m *ListImagesRequest) String() string { return proto.CompactTextString(m) } +func (*ListImagesRequest) ProtoMessage() {} +func (*ListImagesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } func (m *ListImagesRequest) GetFilters() []*ImageFilter { if m != nil { @@ -604,9 +632,10 @@ type ListImagesResponse struct { Images []*Image `protobuf:"bytes,1,rep,name=images" json:"images,omitempty"` } -func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } -func (m *ListImagesResponse) String() string { return proto.CompactTextString(m) } -func (*ListImagesResponse) ProtoMessage() {} +func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } +func (m *ListImagesResponse) String() string { return proto.CompactTextString(m) } +func (*ListImagesResponse) ProtoMessage() {} +func (*ListImagesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } func (m *ListImagesResponse) GetImages() []*Image { if m != nil { @@ -620,18 +649,20 @@ type InspectImageRequest struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` } -func (m *InspectImageRequest) Reset() { *m = InspectImageRequest{} } -func (m *InspectImageRequest) String() string { return proto.CompactTextString(m) } -func (*InspectImageRequest) ProtoMessage() {} +func (m *InspectImageRequest) Reset() { *m = InspectImageRequest{} } +func (m *InspectImageRequest) String() string { return proto.CompactTextString(m) } +func (*InspectImageRequest) ProtoMessage() {} +func (*InspectImageRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } // Response for InspectImage(). type InspectImageResponse struct { Image *Image `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` } -func (m *InspectImageResponse) Reset() { *m = InspectImageResponse{} } -func (m *InspectImageResponse) String() string { return proto.CompactTextString(m) } -func (*InspectImageResponse) ProtoMessage() {} +func (m *InspectImageResponse) Reset() { *m = InspectImageResponse{} } +func (m *InspectImageResponse) String() string { return proto.CompactTextString(m) } +func (*InspectImageResponse) ProtoMessage() {} +func (*InspectImageResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } func (m *InspectImageResponse) GetImage() *Image { if m != nil { @@ -645,9 +676,10 @@ type ListenEventsRequest struct { Filter *EventFilter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } -func (m *ListenEventsRequest) Reset() { *m = ListenEventsRequest{} } -func (m *ListenEventsRequest) String() string { return proto.CompactTextString(m) } -func (*ListenEventsRequest) ProtoMessage() {} +func (m *ListenEventsRequest) Reset() { *m = ListenEventsRequest{} } +func (m *ListenEventsRequest) String() string { return proto.CompactTextString(m) } +func (*ListenEventsRequest) ProtoMessage() {} +func (*ListenEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } func (m *ListenEventsRequest) GetFilter() *EventFilter { if m != nil { @@ -662,9 +694,10 @@ type ListenEventsResponse struct { Events []*Event `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"` } -func (m *ListenEventsResponse) Reset() { *m = ListenEventsResponse{} } -func (m *ListenEventsResponse) String() string { return proto.CompactTextString(m) } -func (*ListenEventsResponse) ProtoMessage() {} +func (m *ListenEventsResponse) Reset() { *m = ListenEventsResponse{} } +func (m *ListenEventsResponse) String() string { return proto.CompactTextString(m) } +func (*ListenEventsResponse) ProtoMessage() {} +func (*ListenEventsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } func (m *ListenEventsResponse) GetEvents() []*Event { if m != nil { @@ -694,9 +727,10 @@ type GetLogsRequest struct { UntilTime int64 `protobuf:"varint,6,opt,name=until_time" json:"until_time,omitempty"` } -func (m *GetLogsRequest) Reset() { *m = GetLogsRequest{} } -func (m *GetLogsRequest) String() string { return proto.CompactTextString(m) } -func (*GetLogsRequest) ProtoMessage() {} +func (m *GetLogsRequest) Reset() { *m = GetLogsRequest{} } +func (m *GetLogsRequest) String() string { return proto.CompactTextString(m) } +func (*GetLogsRequest) ProtoMessage() {} +func (*GetLogsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } // Response for GetLogs(). type GetLogsResponse struct { @@ -704,11 +738,37 @@ type GetLogsResponse struct { Lines []string `protobuf:"bytes,1,rep,name=lines" json:"lines,omitempty"` } -func (m *GetLogsResponse) Reset() { *m = GetLogsResponse{} } -func (m *GetLogsResponse) String() string { return proto.CompactTextString(m) } -func (*GetLogsResponse) ProtoMessage() {} +func (m *GetLogsResponse) Reset() { *m = GetLogsResponse{} } +func (m *GetLogsResponse) String() string { return proto.CompactTextString(m) } +func (*GetLogsResponse) ProtoMessage() {} +func (*GetLogsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } func init() { + proto.RegisterType((*ImageFormat)(nil), "v1alpha.ImageFormat") + proto.RegisterType((*Image)(nil), "v1alpha.Image") + proto.RegisterType((*Network)(nil), "v1alpha.Network") + proto.RegisterType((*App)(nil), "v1alpha.App") + proto.RegisterType((*Pod)(nil), "v1alpha.Pod") + proto.RegisterType((*KeyValue)(nil), "v1alpha.KeyValue") + proto.RegisterType((*PodFilter)(nil), "v1alpha.PodFilter") + proto.RegisterType((*ImageFilter)(nil), "v1alpha.ImageFilter") + proto.RegisterType((*Info)(nil), "v1alpha.Info") + proto.RegisterType((*Event)(nil), "v1alpha.Event") + proto.RegisterType((*EventFilter)(nil), "v1alpha.EventFilter") + proto.RegisterType((*GetInfoRequest)(nil), "v1alpha.GetInfoRequest") + proto.RegisterType((*GetInfoResponse)(nil), "v1alpha.GetInfoResponse") + proto.RegisterType((*ListPodsRequest)(nil), "v1alpha.ListPodsRequest") + proto.RegisterType((*ListPodsResponse)(nil), "v1alpha.ListPodsResponse") + proto.RegisterType((*InspectPodRequest)(nil), "v1alpha.InspectPodRequest") + proto.RegisterType((*InspectPodResponse)(nil), "v1alpha.InspectPodResponse") + proto.RegisterType((*ListImagesRequest)(nil), "v1alpha.ListImagesRequest") + proto.RegisterType((*ListImagesResponse)(nil), "v1alpha.ListImagesResponse") + proto.RegisterType((*InspectImageRequest)(nil), "v1alpha.InspectImageRequest") + proto.RegisterType((*InspectImageResponse)(nil), "v1alpha.InspectImageResponse") + proto.RegisterType((*ListenEventsRequest)(nil), "v1alpha.ListenEventsRequest") + proto.RegisterType((*ListenEventsResponse)(nil), "v1alpha.ListenEventsResponse") + proto.RegisterType((*GetLogsRequest)(nil), "v1alpha.GetLogsRequest") + proto.RegisterType((*GetLogsResponse)(nil), "v1alpha.GetLogsResponse") proto.RegisterEnum("v1alpha.ImageType", ImageType_name, ImageType_value) proto.RegisterEnum("v1alpha.AppState", AppState_name, AppState_value) proto.RegisterEnum("v1alpha.PodState", PodState_name, PodState_value) @@ -890,9 +950,9 @@ func RegisterPublicAPIServer(s *grpc.Server, srv PublicAPIServer) { s.RegisterService(&_PublicAPI_serviceDesc, srv) } -func _PublicAPI_GetInfo_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _PublicAPI_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(GetInfoRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(PublicAPIServer).GetInfo(ctx, in) @@ -902,9 +962,9 @@ func _PublicAPI_GetInfo_Handler(srv interface{}, ctx context.Context, codec grpc return out, nil } -func _PublicAPI_ListPods_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _PublicAPI_ListPods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(ListPodsRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(PublicAPIServer).ListPods(ctx, in) @@ -914,9 +974,9 @@ func _PublicAPI_ListPods_Handler(srv interface{}, ctx context.Context, codec grp return out, nil } -func _PublicAPI_InspectPod_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _PublicAPI_InspectPod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(InspectPodRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(PublicAPIServer).InspectPod(ctx, in) @@ -926,9 +986,9 @@ func _PublicAPI_InspectPod_Handler(srv interface{}, ctx context.Context, codec g return out, nil } -func _PublicAPI_ListImages_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _PublicAPI_ListImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(ListImagesRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(PublicAPIServer).ListImages(ctx, in) @@ -938,9 +998,9 @@ func _PublicAPI_ListImages_Handler(srv interface{}, ctx context.Context, codec g return out, nil } -func _PublicAPI_InspectImage_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _PublicAPI_InspectImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(InspectImageRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(PublicAPIServer).InspectImage(ctx, in) @@ -1030,3 +1090,90 @@ var _PublicAPI_serviceDesc = grpc.ServiceDesc{ }, }, } + +var fileDescriptor0 = []byte{ + // 1318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x57, 0x4d, 0x72, 0xdb, 0x46, + 0x13, 0x35, 0x08, 0x82, 0x3f, 0x4d, 0x9a, 0x02, 0x47, 0xb2, 0x45, 0xd3, 0x7f, 0x32, 0xbe, 0x2f, + 0x2e, 0x47, 0x0b, 0x25, 0x91, 0x1d, 0x6f, 0x52, 0x95, 0x32, 0x25, 0x41, 0x2a, 0xc6, 0x12, 0xc9, + 0xa2, 0x69, 0x55, 0xbc, 0x42, 0x41, 0xe2, 0xd0, 0x41, 0x89, 0x04, 0x10, 0x02, 0x92, 0xad, 0x2c, + 0x73, 0x81, 0x5c, 0x21, 0xb7, 0x48, 0x55, 0x36, 0xb9, 0x41, 0x6e, 0x91, 0x7b, 0xa4, 0x67, 0x30, + 0x00, 0x06, 0x20, 0xb8, 0xc8, 0x8e, 0xe8, 0xee, 0x79, 0xfd, 0xba, 0x7b, 0xfa, 0x01, 0x84, 0xba, + 0xed, 0x3b, 0x7b, 0xfe, 0xd2, 0x0b, 0x3d, 0x52, 0xbd, 0xf9, 0xc6, 0x9e, 0xfb, 0x3f, 0xd9, 0xc6, + 0x1b, 0x68, 0xf4, 0x17, 0xf6, 0x47, 0x7a, 0xec, 0x2d, 0x17, 0x76, 0x48, 0x76, 0xa0, 0x1c, 0xde, + 0xfa, 0xb4, 0xa3, 0xec, 0x28, 0x2f, 0x5a, 0xfb, 0x64, 0x4f, 0x84, 0xed, 0xf1, 0x98, 0x09, 0x7a, + 0xc8, 0x06, 0x54, 0x6f, 0xe8, 0x32, 0x70, 0x3c, 0xb7, 0x53, 0xc2, 0xa0, 0xba, 0xf1, 0x97, 0x02, + 0x1a, 0x77, 0x93, 0x2f, 0xa1, 0x71, 0x61, 0x07, 0xd4, 0x9a, 0x71, 0x2c, 0x8e, 0xd1, 0xd8, 0xdf, + 0xca, 0x62, 0x88, 0x3c, 0x00, 0x25, 0x67, 0x1a, 0x01, 0x90, 0x26, 0x94, 0x5d, 0x7b, 0x41, 0x3b, + 0x2a, 0x7f, 0x92, 0xf0, 0xcb, 0xdc, 0xd0, 0x01, 0xdd, 0x59, 0xf8, 0xde, 0x32, 0xb4, 0x42, 0x67, + 0x41, 0x83, 0xd0, 0x5e, 0xf8, 0x1d, 0x0d, 0x3d, 0x2a, 0xd1, 0xa1, 0xb6, 0xb0, 0x5d, 0x67, 0x86, + 0xc6, 0x4e, 0x05, 0x2d, 0x4d, 0x06, 0x15, 0x38, 0xbf, 0xd0, 0x4e, 0x95, 0xfb, 0x9f, 0x43, 0xc3, + 0x76, 0x5d, 0x2f, 0xb4, 0x43, 0x44, 0x0b, 0x3a, 0xb5, 0x1d, 0x15, 0xf9, 0xb4, 0x13, 0x3e, 0x6f, + 0xe9, 0xed, 0xb9, 0x3d, 0xbf, 0xa6, 0xc6, 0x4b, 0xa8, 0x0e, 0x68, 0xf8, 0xc9, 0x5b, 0x5e, 0x25, + 0x5c, 0x94, 0x98, 0x99, 0xe3, 0xdf, 0xbc, 0x4a, 0x79, 0xe2, 0xd3, 0xeb, 0x88, 0xa7, 0xf1, 0x9b, + 0x02, 0x6a, 0xcf, 0xf7, 0x73, 0x27, 0x1e, 0x83, 0xe6, 0xb0, 0x32, 0xf9, 0x91, 0xc6, 0x7e, 0x2b, + 0x5b, 0x3c, 0xb6, 0x57, 0xc3, 0x02, 0xc2, 0xa8, 0xd6, 0x96, 0xc4, 0x05, 0x91, 0xde, 0x31, 0x07, + 0x69, 0x43, 0x9d, 0x7e, 0x76, 0x42, 0xeb, 0xd2, 0x9b, 0x52, 0xde, 0x80, 0x76, 0xbe, 0x0c, 0x6d, + 0x5d, 0x19, 0x7f, 0x22, 0xa3, 0x91, 0x37, 0x15, 0xbd, 0x8d, 0xf8, 0x34, 0x40, 0xf5, 0x45, 0xa3, + 0xdb, 0xeb, 0xb3, 0xe3, 0xa9, 0x28, 0x7b, 0x17, 0xca, 0xb6, 0xef, 0x07, 0x98, 0x98, 0xe5, 0x68, + 0xca, 0xf4, 0x88, 0x01, 0x35, 0x37, 0xea, 0x52, 0xcc, 0x41, 0x4f, 0xfc, 0x71, 0xfb, 0x56, 0x27, + 0x92, 0x23, 0x5f, 0x5d, 0x47, 0xfe, 0x39, 0xd4, 0xe2, 0xdf, 0x8c, 0x34, 0xfe, 0x16, 0x15, 0xdc, + 0x05, 0xed, 0x86, 0x59, 0xc5, 0x6d, 0xfb, 0x5d, 0x81, 0x3a, 0xd2, 0x3d, 0x76, 0xe6, 0x21, 0x5d, + 0xb2, 0x48, 0x67, 0x1a, 0x60, 0xa4, 0x8a, 0x91, 0xcf, 0xa0, 0xc2, 0xcb, 0x0b, 0x30, 0x54, 0x2d, + 0xae, 0xaf, 0xcd, 0x76, 0xc0, 0xb7, 0xd8, 0xc0, 0x02, 0xec, 0x02, 0x3b, 0x85, 0x26, 0x3e, 0x31, + 0x8b, 0x01, 0x95, 0xb9, 0xe9, 0x1e, 0xdc, 0x15, 0x95, 0x8a, 0x48, 0x8d, 0x9b, 0x73, 0xa5, 0x54, + 0xd6, 0x95, 0xf2, 0xb7, 0x12, 0xef, 0x54, 0x01, 0x49, 0xec, 0x90, 0xbf, 0xa4, 0x33, 0xe7, 0xb3, + 0xa0, 0x59, 0x27, 0x38, 0x2f, 0xbe, 0x35, 0x32, 0x29, 0x8c, 0xba, 0xa2, 0xb7, 0xc8, 0x20, 0xe1, + 0x84, 0xc5, 0xcd, 0xed, 0x0b, 0x3a, 0x5f, 0x3f, 0x7f, 0x72, 0x1f, 0x5a, 0xd1, 0xa2, 0xd0, 0xa9, + 0x65, 0xcf, 0x30, 0x33, 0x1f, 0x81, 0x4a, 0xb6, 0x61, 0x23, 0xb1, 0x5f, 0x50, 0x5c, 0xce, 0xff, + 0xba, 0x1f, 0xc7, 0x50, 0xee, 0xbb, 0x33, 0x8f, 0x6c, 0x42, 0x63, 0x79, 0x15, 0x5a, 0xf1, 0x7a, + 0x46, 0xf3, 0xd9, 0x82, 0x26, 0xb6, 0xf4, 0xd2, 0xca, 0x88, 0x02, 0x0b, 0x45, 0xb1, 0x49, 0x8c, + 0xd1, 0xca, 0x2c, 0x41, 0x33, 0x6f, 0xa8, 0xbb, 0x5e, 0x65, 0xb8, 0x97, 0xab, 0x4c, 0x4e, 0x1f, + 0x66, 0x4b, 0x6f, 0x21, 0xf4, 0x01, 0x9f, 0x98, 0x0e, 0xf0, 0xdd, 0x50, 0xc9, 0x53, 0x28, 0x4f, + 0xed, 0xd0, 0x5e, 0xbf, 0x14, 0x21, 0x34, 0x38, 0xaa, 0x98, 0xc5, 0x33, 0xd0, 0x58, 0xe6, 0x68, + 0x1a, 0xc5, 0xa9, 0xc5, 0xb8, 0xa2, 0xe1, 0xe0, 0xed, 0x93, 0xe7, 0x82, 0xbc, 0x02, 0xc7, 0xbd, + 0xa4, 0x96, 0x44, 0x01, 0x6d, 0xd7, 0x6e, 0xe8, 0xcc, 0x23, 0x1b, 0x57, 0x26, 0x43, 0x87, 0xd6, + 0x09, 0x0d, 0x59, 0xd3, 0xc6, 0xf4, 0xe7, 0x6b, 0xdc, 0x06, 0x63, 0x0f, 0x36, 0x12, 0x4b, 0xe0, + 0x63, 0xbb, 0x29, 0x79, 0x88, 0x7a, 0x82, 0xcf, 0x42, 0x27, 0xef, 0xa6, 0x52, 0x81, 0x46, 0xec, + 0xf9, 0xc6, 0xa9, 0x13, 0x84, 0x78, 0x73, 0x03, 0x01, 0x41, 0xfe, 0x07, 0xd5, 0x19, 0xaf, 0x22, + 0x62, 0xdf, 0x90, 0xd8, 0xa7, 0x1b, 0xd1, 0x82, 0xca, 0x94, 0x86, 0xb6, 0x33, 0xe7, 0xcd, 0xab, + 0x61, 0x5e, 0x3d, 0xc5, 0x11, 0x89, 0x71, 0xcb, 0x7d, 0x6f, 0x1a, 0xa3, 0x34, 0x65, 0x14, 0xe3, + 0x29, 0xb4, 0xfb, 0x6e, 0xe0, 0xd3, 0x4b, 0x76, 0x24, 0xce, 0x2c, 0x29, 0x8a, 0xf1, 0x15, 0x10, + 0x39, 0x40, 0x40, 0x3e, 0x40, 0x9d, 0xf1, 0xa6, 0xa2, 0x94, 0x2c, 0xe2, 0x0f, 0xd0, 0x66, 0x0c, + 0xf8, 0x46, 0x24, 0xb5, 0x7c, 0x91, 0xaf, 0x25, 0xff, 0x9a, 0x28, 0xae, 0xe6, 0x15, 0x10, 0x19, + 0x4b, 0x24, 0x7f, 0x02, 0x15, 0xbe, 0xc2, 0x31, 0x56, 0x4e, 0x75, 0x8d, 0x67, 0xb0, 0x29, 0x28, + 0xf3, 0xe7, 0xa2, 0xaa, 0xbe, 0x85, 0xad, 0x6c, 0x88, 0x80, 0x4e, 0xf4, 0x5c, 0x29, 0xd2, 0x73, + 0xe3, 0x3b, 0xd8, 0x64, 0x7c, 0xa8, 0xcb, 0xaf, 0x4f, 0x52, 0xdd, 0xff, 0xa1, 0x12, 0x55, 0xb7, + 0xf2, 0x0e, 0x94, 0xee, 0xa2, 0xf1, 0x1a, 0xb6, 0xb2, 0x87, 0xd3, 0x72, 0x28, 0xb7, 0xac, 0x94, + 0xc3, 0x03, 0x8d, 0x5b, 0x7e, 0xb9, 0x4e, 0xbd, 0x8f, 0x49, 0x3e, 0x6c, 0x13, 0x76, 0xdf, 0x4a, + 0x54, 0x1f, 0xe5, 0x23, 0x96, 0x39, 0xb1, 0x43, 0x78, 0x8f, 0xe7, 0x8e, 0xcb, 0xef, 0xb1, 0xf2, + 0x42, 0x63, 0x07, 0x66, 0xde, 0x7c, 0xee, 0x7d, 0xe2, 0x77, 0xb8, 0x96, 0xbb, 0xd7, 0x5a, 0xc1, + 0xbd, 0xe6, 0x52, 0x62, 0xec, 0xf0, 0x5b, 0x1c, 0xa5, 0x16, 0x6c, 0x13, 0x64, 0xae, 0x6f, 0xbb, + 0x14, 0xea, 0xe9, 0xb7, 0x42, 0x07, 0xbb, 0x7a, 0xd6, 0x3b, 0x31, 0xad, 0xc9, 0x87, 0x91, 0x69, + 0xbd, 0x1f, 0x1c, 0x99, 0xc7, 0xfd, 0x81, 0x79, 0xa4, 0xdf, 0x41, 0x7d, 0xd8, 0x90, 0x3c, 0xbd, + 0xd1, 0xe8, 0x50, 0x57, 0x50, 0x77, 0xdb, 0x92, 0xf1, 0x68, 0x78, 0xf8, 0xd6, 0x1c, 0xeb, 0x25, + 0x24, 0xd2, 0x92, 0xcc, 0xc3, 0xc3, 0xbe, 0xae, 0xee, 0x8e, 0xa0, 0x96, 0xbc, 0x32, 0xb7, 0x61, + 0x13, 0x01, 0xac, 0x77, 0x93, 0xde, 0x24, 0x9b, 0x04, 0xf1, 0x52, 0xc7, 0xf8, 0xfd, 0x60, 0xd0, + 0x1f, 0x9c, 0x60, 0x9a, 0x2d, 0xd0, 0x53, 0xb3, 0xf9, 0x63, 0x7f, 0x82, 0xc1, 0xa5, 0xdd, 0x7f, + 0x14, 0xa8, 0x25, 0xef, 0x09, 0x84, 0x1c, 0x0d, 0x8f, 0x0a, 0x20, 0xf1, 0x6c, 0xea, 0x30, 0xcf, + 0x0e, 0xc6, 0x1f, 0x86, 0x88, 0x98, 0x09, 0x1f, 0x8d, 0xcd, 0x51, 0x6f, 0xcc, 0x52, 0x95, 0x50, + 0x92, 0x49, 0xde, 0x81, 0x30, 0x2a, 0x63, 0x96, 0xda, 0x63, 0x66, 0x65, 0xbc, 0x6d, 0x0f, 0x52, + 0x73, 0xef, 0x60, 0x38, 0x46, 0x6a, 0xf1, 0x31, 0x5d, 0xcb, 0x25, 0x8f, 0x88, 0x57, 0xb2, 0x39, + 0x8e, 0xcc, 0x53, 0x73, 0xc2, 0xc0, 0xaa, 0xd9, 0x1c, 0x27, 0xbd, 0xf1, 0x01, 0xb6, 0x50, 0xaf, + 0xed, 0xfe, 0x51, 0x82, 0x7a, 0x2a, 0x76, 0x38, 0x21, 0xf3, 0xdc, 0x1c, 0x4c, 0x56, 0x27, 0xf4, + 0x10, 0xb6, 0x25, 0x0f, 0x43, 0x4a, 0xf8, 0x2b, 0xf8, 0x2d, 0xf0, 0xa4, 0xd8, 0x19, 0xb3, 0xc6, + 0xda, 0xbb, 0x70, 0x3f, 0x17, 0x83, 0x54, 0xb8, 0x4f, 0x45, 0xb9, 0xb8, 0x97, 0xf3, 0x89, 0x72, + 0xca, 0xb8, 0x3b, 0x3b, 0x39, 0x97, 0xe0, 0x6e, 0x1d, 0x0e, 0x4f, 0x4f, 0xcd, 0x43, 0x16, 0xa5, + 0xe5, 0xc0, 0xc5, 0x38, 0xc7, 0x51, 0x43, 0xb2, 0xe0, 0xcc, 0x27, 0xc0, 0xab, 0xac, 0xc1, 0x92, + 0x2b, 0xba, 0x55, 0xfd, 0xb3, 0x51, 0x44, 0xb9, 0x46, 0x1e, 0x41, 0x67, 0xc5, 0x3d, 0x36, 0xcf, + 0x86, 0xe7, 0xe8, 0xad, 0xef, 0xff, 0x5a, 0xc6, 0x4f, 0x8f, 0xeb, 0x8b, 0xb9, 0x73, 0xd9, 0x1b, + 0xf5, 0xc9, 0xf7, 0x50, 0x15, 0x82, 0x4e, 0xb6, 0x93, 0x05, 0xcd, 0x8a, 0x7e, 0xb7, 0xb3, 0xea, + 0x88, 0xb6, 0xc6, 0xb8, 0x43, 0x7a, 0x50, 0x8b, 0x85, 0x99, 0xa4, 0x71, 0x39, 0xcd, 0xef, 0x3e, + 0x28, 0xf0, 0x24, 0x10, 0x27, 0x00, 0xa9, 0x14, 0x93, 0xae, 0xf4, 0x02, 0xc9, 0x09, 0x78, 0xf7, + 0x61, 0xa1, 0x4f, 0x06, 0x4a, 0x65, 0x55, 0x02, 0x5a, 0xd1, 0x6d, 0x09, 0x68, 0x55, 0x87, 0x11, + 0xe8, 0x0c, 0x9a, 0xb2, 0x8c, 0x92, 0x47, 0xf9, 0xbc, 0xb2, 0x00, 0x77, 0x1f, 0xaf, 0xf1, 0x26, + 0x70, 0x43, 0x68, 0xca, 0x0a, 0x29, 0xc1, 0x15, 0xa8, 0xae, 0x04, 0x57, 0x24, 0xab, 0xc6, 0x9d, + 0xaf, 0x15, 0xf2, 0x86, 0x0f, 0x8d, 0xe9, 0x57, 0x76, 0x68, 0x92, 0x98, 0x66, 0x87, 0x26, 0x4b, + 0x1d, 0x43, 0xb8, 0xa8, 0xf0, 0xff, 0x4f, 0x2f, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x84, 0xa0, + 0x2b, 0xe3, 0x4c, 0x0d, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.proto b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.proto index 8112c42f5fe..73b453d47aa 100644 --- a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.proto +++ b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/api.proto @@ -21,8 +21,6 @@ // The API defined here is proposed, experimental, // // and (for now) subject to change at any time. // // // -// Do not use it. // -// // // If you think you want to use it, or for any other // // queries, contact // // or file an issue on github.com/coreos/rkt // @@ -234,6 +232,9 @@ message ImageFilter { // If not empty, the images that have all of the annotations will be returned. repeated KeyValue annotations = 8; + + // If not empty, the images that have any of the exact full names will be returned. + repeated string full_names = 9; } // Info describes the information of rkt on the machine. diff --git a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/client_example.go b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/client_example.go index 7c715408969..ec807d9ee31 100644 --- a/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/client_example.go +++ b/Godeps/_workspace/src/github.com/coreos/rkt/api/v1alpha/client_example.go @@ -20,8 +20,6 @@ import ( "fmt" "os" - // Note that if your project uses Godep to manage dependencies, then - // you need to change following the import paths. "github.com/coreos/rkt/api/v1alpha" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/Godeps/_workspace/src/github.com/docker/spdystream/connection.go b/Godeps/_workspace/src/github.com/docker/spdystream/connection.go index aa6c75202e3..6031a0db1ab 100644 --- a/Godeps/_workspace/src/github.com/docker/spdystream/connection.go +++ b/Godeps/_workspace/src/github.com/docker/spdystream/connection.go @@ -320,6 +320,7 @@ func (s *Connection) Serve(newHandler StreamHandler) { partitionRoundRobin int goAwayFrame *spdy.GoAwayFrame ) +Loop: for { readFrame, err := s.framer.ReadFrame() if err != nil { @@ -362,7 +363,7 @@ func (s *Connection) Serve(newHandler StreamHandler) { case *spdy.GoAwayFrame: // hold on to the go away frame and exit the loop goAwayFrame = frame - break + break Loop default: priority = 7 partition = partitionRoundRobin diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml index 597b849d4c3..4a6a01fb7bf 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml @@ -3,8 +3,8 @@ sudo: required go: - 1.3.3 - 1.4.2 - - 1.5.2 - - 1.6beta1 + - 1.5.3 + - 1.6rc2 - tip env: - GOARCH=amd64 DOCKER_VERSION=1.7.1 @@ -13,6 +13,8 @@ env: - GOARCH=386 DOCKER_VERSION=1.8.3 - GOARCH=amd64 DOCKER_VERSION=1.9.1 - GOARCH=386 DOCKER_VERSION=1.9.1 + - GOARCH=amd64 DOCKER_VERSION=1.10.0 + - GOARCH=386 DOCKER_VERSION=1.10.0 install: - make prepare_docker script: diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS index 3359e7288c3..0c42ae3444a 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS @@ -12,6 +12,7 @@ Antonio Murdaca Artem Sidorenko Ben Marini Ben McCann +Ben Parees Benno van den Berg Brendan Fosberry Brian Lalor @@ -37,6 +38,7 @@ Dave Choi David Huie Dawn Chen Dinesh Subhraveti +Drew Wells Ed Elias G. Schneevoigt Erez Horev @@ -48,6 +50,7 @@ Flavia Missi Francisco Souza Grégoire Delattre Guillermo Álvarez Fernández +Harry Zhang He Simei Ivan Mikushin James Bardin @@ -109,6 +112,7 @@ Summer Mousa Sunjin Lee Tarsis Azevedo Tim Schindler +Timothy St. Clair Tobi Knaup Tom Wilkie Tonic diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile index 205d8f3c22d..7a94eaa1e0b 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile @@ -41,7 +41,7 @@ prepare_docker: sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-get update - sudo apt-get install docker-engine=$(DOCKER_VERSION)-0~$(shell lsb_release -cs) -y --force-yes + sudo apt-get install docker-engine=$(DOCKER_VERSION)-0~$(shell lsb_release -cs) -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" pretest: lint vet fmtcheck diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go index 3a7d755f5ad..114fb87b704 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go @@ -60,7 +60,8 @@ func NewAPIVersion(input string) (APIVersion, error) { if !strings.Contains(input, ".") { return nil, fmt.Errorf("Unable to parse version %q", input) } - arr := strings.Split(input, ".") + raw := strings.Split(input, "-") + arr := strings.Split(raw[0], ".") ret := make(APIVersion, len(arr)) var err error for i, val := range arr { @@ -586,7 +587,7 @@ func (c *Client) hijack(method, path string, hijackOptions hijackOptions) (Close if err != nil { return nil, err } - req.Header.Set("Content-Type", "plain/text") + req.Header.Set("Content-Type", "application/json") req.Header.Set("Connection", "Upgrade") req.Header.Set("Upgrade", "tcp") protocol := c.endpointURL.Scheme diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go index 0baf01f9703..317814b90bf 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go @@ -510,6 +510,7 @@ type HostConfig struct { BlkioWeight int64 `json:"BlkioWeight,omitempty" yaml:"BlkioWeight"` Ulimits []ULimit `json:"Ulimits,omitempty" yaml:"Ulimits,omitempty"` VolumeDriver string `json:"VolumeDriver,omitempty" yaml:"VolumeDriver,omitempty"` + OomScoreAdj int `json:"OomScoreAdj,omitempty" yaml:"OomScoreAdj,omitempty"` } // StartContainer starts a container, returning an error in case of failure. @@ -638,6 +639,7 @@ func (c *Client) TopContainer(id string, psArgs string) (TopResult, error) { // See https://goo.gl/GNmLHb for more details. type Stats struct { Read time.Time `json:"read,omitempty" yaml:"read,omitempty"` + Network NetworkStats `json:"network,omitempty" yaml:"network,omitempty"` Networks map[string]NetworkStats `json:"networks,omitempty" yaml:"networks,omitempty"` MemoryStats struct { Stats struct { @@ -670,6 +672,8 @@ type Stats struct { Pgfault uint64 `json:"pgfault,omitempty" yaml:"pgfault,omitempty"` InactiveFile uint64 `json:"inactive_file,omitempty" yaml:"inactive_file,omitempty"` TotalPgpgin uint64 `json:"total_pgpgin,omitempty" yaml:"total_pgpgin,omitempty"` + HierarchicalMemswLimit uint64 `json:"hierarchical_memsw_limit,omitempty" yaml:"hierarchical_memsw_limit,omitempty"` + Swap uint64 `json:"swap,omitempty" yaml:"swap,omitempty"` } `json:"stats,omitempty" yaml:"stats,omitempty"` MaxUsage uint64 `json:"max_usage,omitempty" yaml:"max_usage,omitempty"` Usage uint64 `json:"usage,omitempty" yaml:"usage,omitempty"` diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go index fd13bc23f22..47da77dbeb3 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go @@ -410,6 +410,8 @@ type BuildImageOptions struct { Memory int64 `qs:"memory"` Memswap int64 `qs:"memswap"` CPUShares int64 `qs:"cpushares"` + CPUQuota int64 `qs:"cpuquota"` + CPUPeriod int64 `qs:"cpuperiod"` CPUSetCPUs string `qs:"cpusetcpus"` InputStream io.Reader `qs:"-"` OutputStream io.Writer `qs:"-"` diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go index 38b3432461c..30d54230a43 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go @@ -17,19 +17,20 @@ var ErrNetworkAlreadyExists = errors.New("network already exists") // Network represents a network. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type Network struct { Name string ID string `json:"Id"` Scope string Driver string + IPAM IPAMOptions Containers map[string]Endpoint Options map[string]string } // Endpoint contains network resources allocated and used for a container in a network // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type Endpoint struct { Name string ID string `json:"EndpointID"` @@ -40,7 +41,7 @@ type Endpoint struct { // ListNetworks returns all networks. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) ListNetworks() ([]Network, error) { resp, err := c.do("GET", "/networks", doOptions{}) if err != nil { @@ -56,7 +57,7 @@ func (c *Client) ListNetworks() ([]Network, error) { // NetworkInfo returns information about a network by its ID. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) NetworkInfo(id string) (*Network, error) { path := "/networks/" + id resp, err := c.do("GET", path, doOptions{}) @@ -77,7 +78,7 @@ func (c *Client) NetworkInfo(id string) (*Network, error) { // CreateNetworkOptions specify parameters to the CreateNetwork function and // (for now) is the expected body of the "create network" http request message // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type CreateNetworkOptions struct { Name string `json:"Name"` CheckDuplicate bool `json:"CheckDuplicate"` @@ -107,7 +108,7 @@ type IPAMConfig struct { // CreateNetwork creates a new network, returning the network instance, // or an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) { resp, err := c.do( "POST", @@ -144,7 +145,7 @@ func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) { // RemoveNetwork removes a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) RemoveNetwork(id string) error { resp, err := c.do("DELETE", "/networks/"+id, doOptions{}) if err != nil { @@ -159,14 +160,14 @@ func (c *Client) RemoveNetwork(id string) error { // NetworkConnectionOptions specify parameters to the ConnectNetwork and DisconnectNetwork function. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type NetworkConnectionOptions struct { Container string } // ConnectNetwork adds a container to a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error { resp, err := c.do("POST", "/networks/"+id+"/connect", doOptions{data: opts}) if err != nil { @@ -181,7 +182,7 @@ func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error // DisconnectNetwork removes a container from a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) DisconnectNetwork(id string, opts NetworkConnectionOptions) error { resp, err := c.do("POST", "/networks/"+id+"/disconnect", doOptions{data: opts}) if err != nil { diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go index 2c09f21c292..b16e713676e 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go @@ -38,6 +38,7 @@ var nameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]+$`) // For more details on the remote API, check http://goo.gl/G3plxW. type DockerServer struct { containers []*docker.Container + uploadedFiles map[string]string execs []*docker.ExecInspect execMut sync.RWMutex cMut sync.RWMutex @@ -89,6 +90,7 @@ func NewServer(bind string, containerChan chan<- *docker.Container, hook func(*h execCallbacks: make(map[string]func()), statsCallbacks: make(map[string]func(string) docker.Stats), customHandlers: make(map[string]http.Handler), + uploadedFiles: make(map[string]string), cChan: containerChan, } server.buildMuxer() @@ -120,6 +122,7 @@ func (s *DockerServer) buildMuxer() { s.mux.Path("/containers/{id:.*}").Methods("DELETE").HandlerFunc(s.handlerWrapper(s.removeContainer)) s.mux.Path("/containers/{id:.*}/exec").Methods("POST").HandlerFunc(s.handlerWrapper(s.createExecContainer)) s.mux.Path("/containers/{id:.*}/stats").Methods("GET").HandlerFunc(s.handlerWrapper(s.statsContainer)) + s.mux.Path("/containers/{id:.*}/archive").Methods("PUT").HandlerFunc(s.handlerWrapper(s.uploadToContainer)) s.mux.Path("/exec/{id:.*}/resize").Methods("POST").HandlerFunc(s.handlerWrapper(s.resizeExecContainer)) s.mux.Path("/exec/{id:.*}/start").Methods("POST").HandlerFunc(s.handlerWrapper(s.startExecContainer)) s.mux.Path("/exec/{id:.*}/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectExecContainer)) @@ -440,8 +443,8 @@ func (s *DockerServer) createContainer(w http.ResponseWriter, r *http.Request) { s.cMut.Unlock() w.WriteHeader(http.StatusCreated) s.notify(&container) - var c = struct{ ID string }{ID: container.ID} - json.NewEncoder(w).Encode(c) + + json.NewEncoder(w).Encode(container) } func (s *DockerServer) generateID() string { @@ -503,6 +506,23 @@ func (s *DockerServer) statsContainer(w http.ResponseWriter, r *http.Request) { } } +func (s *DockerServer) uploadToContainer(w http.ResponseWriter, r *http.Request) { + id := mux.Vars(r)["id"] + container, _, err := s.findContainer(id) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + if !container.State.Running { + w.WriteHeader(http.StatusInternalServerError) + fmt.Fprintf(w, "Container %s is not running", id) + return + } + path := r.URL.Query().Get("path") + s.uploadedFiles[id] = path + w.WriteHeader(http.StatusOK) +} + func (s *DockerServer) topContainer(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] container, _, err := s.findContainer(id) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.pb.go b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.pb.go index 9f1f5312cca..760e4e61d86 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.pb.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.pb.go @@ -230,6 +230,14 @@ var E_GogoprotoImport = &proto.ExtensionDesc{ Tag: "varint,63027,opt,name=gogoproto_import", } +var E_ProtosizerAll = &proto.ExtensionDesc{ + ExtendedType: (*google_protobuf.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63028, + Name: "gogoproto.protosizer_all", + Tag: "varint,63028,opt,name=protosizer_all", +} + var E_GoprotoGetters = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), @@ -382,6 +390,14 @@ var E_GoprotoUnrecognized = &proto.ExtensionDesc{ Tag: "varint,64026,opt,name=goproto_unrecognized", } +var E_Protosizer = &proto.ExtensionDesc{ + ExtendedType: (*google_protobuf.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64028, + Name: "gogoproto.protosizer", + Tag: "varint,64028,opt,name=protosizer", +} + var E_Nullable = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*bool)(nil), @@ -481,6 +497,7 @@ func init() { proto.RegisterExtension(E_GoprotoExtensionsMapAll) proto.RegisterExtension(E_GoprotoUnrecognizedAll) proto.RegisterExtension(E_GogoprotoImport) + proto.RegisterExtension(E_ProtosizerAll) proto.RegisterExtension(E_GoprotoGetters) proto.RegisterExtension(E_GoprotoStringer) proto.RegisterExtension(E_VerboseEqual) @@ -500,6 +517,7 @@ func init() { proto.RegisterExtension(E_UnsafeUnmarshaler) proto.RegisterExtension(E_GoprotoExtensionsMap) proto.RegisterExtension(E_GoprotoUnrecognized) + proto.RegisterExtension(E_Protosizer) proto.RegisterExtension(E_Nullable) proto.RegisterExtension(E_Embed) proto.RegisterExtension(E_Customtype) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.proto b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.proto index 84310e8fdbb..3373faf3197 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.proto +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/gogo.proto @@ -67,6 +67,8 @@ extend google.protobuf.FileOptions { optional bool goproto_extensions_map_all = 63025; optional bool goproto_unrecognized_all = 63026; optional bool gogoproto_import = 63027; + + optional bool protosizer_all = 63028; } extend google.protobuf.MessageOptions { @@ -93,6 +95,8 @@ extend google.protobuf.MessageOptions { optional bool goproto_extensions_map = 64025; optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; } extend google.protobuf.FieldOptions { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/helper.go b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/helper.go index b1889f258ca..b5a18538447 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/helper.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/gogoproto/helper.go @@ -213,6 +213,10 @@ func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf return proto.GetBoolExtension(message.Options, E_Sizer, proto.GetBoolExtension(file.Options, E_SizerAll, false)) } +func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { + return proto.GetBoolExtension(message.Options, E_Protosizer, proto.GetBoolExtension(file.Options, E_ProtosizerAll, false)) +} + func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { return proto.GetBoolExtension(enum.Options, E_GoprotoEnumStringer, proto.GetBoolExtension(file.Options, E_GoprotoEnumStringerAll, true)) } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go index 460dc77523e..af8fd96811b 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go @@ -80,7 +80,8 @@ var overwriters []map[string]gogoproto.EnableFunc = []map[string]gogoproto.Enabl "verboseequal": gogoproto.HasVerboseEqual, }, { - "size": gogoproto.IsSizer, + "size": gogoproto.IsSizer, + "protosizer": gogoproto.IsProtoSizer, }, { "unmarshaler": gogoproto.IsUnmarshaler, diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/marshalto/marshalto.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/marshalto/marshalto.go index 60362c5eeb6..52d36098fe0 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/marshalto/marshalto.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/marshalto/marshalto.go @@ -303,12 +303,12 @@ func wireToType(wire string) int { panic("unreachable") } -func (p *marshalto) mapField(numGen NumGen, fieldTyp descriptor.FieldDescriptorProto_Type, varName string) { +func (p *marshalto) mapField(numGen NumGen, fieldTyp descriptor.FieldDescriptorProto_Type, varName string, protoSizer bool) { switch fieldTyp { case descriptor.FieldDescriptorProto_TYPE_DOUBLE: - p.callFixed64(p.mathPkg.Use(), `.Float64bits(`, varName, `)`) + p.callFixed64(p.mathPkg.Use(), `.Float64bits(float64(`, varName, `))`) case descriptor.FieldDescriptorProto_TYPE_FLOAT: - p.callFixed32(p.mathPkg.Use(), `.Float32bits(`, varName, `)`) + p.callFixed32(p.mathPkg.Use(), `.Float32bits(float32(`, varName, `))`) case descriptor.FieldDescriptorProto_TYPE_INT64, descriptor.FieldDescriptorProto_TYPE_UINT64, descriptor.FieldDescriptorProto_TYPE_INT32, @@ -341,7 +341,11 @@ func (p *marshalto) mapField(numGen NumGen, fieldTyp descriptor.FieldDescriptorP case descriptor.FieldDescriptorProto_TYPE_SINT64: p.callVarint(`(uint64(`, varName, `) << 1) ^ uint64((`, varName, ` >> 63))`) case descriptor.FieldDescriptorProto_TYPE_MESSAGE: - p.callVarint(varName, `.Size()`) + if protoSizer { + p.callVarint(varName, `.ProtoSize()`) + } else { + p.callVarint(varName, `.Size()`) + } p.P(`n`, numGen.Next(), `, err := `, varName, `.MarshalTo(data[i:])`) p.P(`if err != nil {`) p.In() @@ -371,6 +375,8 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi nullable := gogoproto.IsNullable(field) repeated := field.IsRepeated() required := field.IsRequired() + + protoSizer := gogoproto.IsProtoSizer(file.FileDescriptorProto, message.DescriptorProto) if required && nullable { p.P(`if m.`, fieldname, `== nil {`) p.In() @@ -397,13 +403,13 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi } switch *field.Type { case descriptor.FieldDescriptorProto_TYPE_DOUBLE: - if !p.unsafe { + if !p.unsafe || gogoproto.IsCastType(field) { if packed { p.encodeKey(fieldNumber, wireType) p.callVarint(`len(m.`, fieldname, `) * 8`) p.P(`for _, num := range m.`, fieldname, ` {`) p.In() - p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float64bits(num)`) + p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float64bits(float64(num))`) p.encodeFixed64("f" + numGen.Current()) p.Out() p.P(`}`) @@ -411,7 +417,7 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`for _, num := range m.`, fieldname, ` {`) p.In() p.encodeKey(fieldNumber, wireType) - p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float64bits(num)`) + p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float64bits(float64(num))`) p.encodeFixed64("f" + numGen.Current()) p.Out() p.P(`}`) @@ -419,15 +425,15 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`if m.`, fieldname, ` != 0 {`) p.In() p.encodeKey(fieldNumber, wireType) - p.callFixed64(p.mathPkg.Use(), `.Float64bits(m.`+fieldname, `)`) + p.callFixed64(p.mathPkg.Use(), `.Float64bits(float64(m.`+fieldname, `))`) p.Out() p.P(`}`) } else if !nullable { p.encodeKey(fieldNumber, wireType) - p.callFixed64(p.mathPkg.Use(), `.Float64bits(m.`+fieldname, `)`) + p.callFixed64(p.mathPkg.Use(), `.Float64bits(float64(m.`+fieldname, `))`) } else { p.encodeKey(fieldNumber, wireType) - p.callFixed64(p.mathPkg.Use(), `.Float64bits(*m.`+fieldname, `)`) + p.callFixed64(p.mathPkg.Use(), `.Float64bits(float64(*m.`+fieldname, `))`) } } else { if packed { @@ -461,13 +467,13 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi } } case descriptor.FieldDescriptorProto_TYPE_FLOAT: - if !p.unsafe { + if !p.unsafe || gogoproto.IsCastType(field) { if packed { p.encodeKey(fieldNumber, wireType) p.callVarint(`len(m.`, fieldname, `) * 4`) p.P(`for _, num := range m.`, fieldname, ` {`) p.In() - p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float32bits(num)`) + p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float32bits(float32(num))`) p.encodeFixed32("f" + numGen.Current()) p.Out() p.P(`}`) @@ -475,7 +481,7 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`for _, num := range m.`, fieldname, ` {`) p.In() p.encodeKey(fieldNumber, wireType) - p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float32bits(num)`) + p.P(`f`, numGen.Next(), ` := `, p.mathPkg.Use(), `.Float32bits(float32(num))`) p.encodeFixed32("f" + numGen.Current()) p.Out() p.P(`}`) @@ -483,15 +489,15 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`if m.`, fieldname, ` != 0 {`) p.In() p.encodeKey(fieldNumber, wireType) - p.callFixed32(p.mathPkg.Use(), `.Float32bits(m.`+fieldname, `)`) + p.callFixed32(p.mathPkg.Use(), `.Float32bits(float32(m.`+fieldname, `))`) p.Out() p.P(`}`) } else if !nullable { p.encodeKey(fieldNumber, wireType) - p.callFixed32(p.mathPkg.Use(), `.Float32bits(m.`+fieldname, `)`) + p.callFixed32(p.mathPkg.Use(), `.Float32bits(float32(m.`+fieldname, `))`) } else { p.encodeKey(fieldNumber, wireType) - p.callFixed32(p.mathPkg.Use(), `.Float32bits(*m.`+fieldname, `)`) + p.callFixed32(p.mathPkg.Use(), `.Float32bits(float32(*m.`+fieldname, `))`) } } else { if packed { @@ -896,22 +902,30 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi } else if !nullable { accessor = `(&v)` } - p.P(`msgSize := `, accessor, `.Size()`) + if protoSizer { + p.P(`msgSize := `, accessor, `.ProtoSize()`) + } else { + p.P(`msgSize := `, accessor, `.Size()`) + } sum = append(sum, `msgSize + sov`+p.localName+`(uint64(msgSize))`) } p.P(`mapSize := `, strings.Join(sum, " + ")) p.callVarint("mapSize") p.encodeKey(1, wireToType(keywire)) - p.mapField(numGen, m.KeyField.GetType(), "k") + p.mapField(numGen, m.KeyField.GetType(), "k", protoSizer) p.encodeKey(2, wireToType(valuewire)) - p.mapField(numGen, m.ValueField.GetType(), accessor) + p.mapField(numGen, m.ValueField.GetType(), accessor, protoSizer) p.Out() p.P(`}`) } else if repeated { p.P(`for _, msg := range m.`, fieldname, ` {`) p.In() p.encodeKey(fieldNumber, wireType) - p.callVarint("msg.Size()") + if protoSizer { + p.callVarint("msg.ProtoSize()") + } else { + p.callVarint("msg.Size()") + } p.P(`n, err := msg.MarshalTo(data[i:])`) p.P(`if err != nil {`) p.In() @@ -923,7 +937,11 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`}`) } else { p.encodeKey(fieldNumber, wireType) - p.callVarint(`m.`, fieldname, `.Size()`) + if protoSizer { + p.callVarint(`m.`, fieldname, `.ProtoSize()`) + } else { + p.callVarint(`m.`, fieldname, `.Size()`) + } p.P(`n`, numGen.Next(), `, err := m.`, fieldname, `.MarshalTo(data[i:])`) p.P(`if err != nil {`) p.In() @@ -960,7 +978,11 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`for _, msg := range m.`, fieldname, ` {`) p.In() p.encodeKey(fieldNumber, wireType) - p.callVarint(`msg.Size()`) + if protoSizer { + p.callVarint(`msg.ProtoSize()`) + } else { + p.callVarint(`msg.Size()`) + } p.P(`n, err := msg.MarshalTo(data[i:])`) p.P(`if err != nil {`) p.In() @@ -972,7 +994,11 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi p.P(`}`) } else { p.encodeKey(fieldNumber, wireType) - p.callVarint(`m.`, fieldname, `.Size()`) + if protoSizer { + p.callVarint(`m.`, fieldname, `.ProtoSize()`) + } else { + p.callVarint(`m.`, fieldname, `.Size()`) + } p.P(`n`, numGen.Next(), `, err := m.`, fieldname, `.MarshalTo(data[i:])`) p.P(`if err != nil {`) p.In() @@ -1126,7 +1152,11 @@ func (p *marshalto) Generate(file *generator.FileDescriptor) { p.P(`func (m *`, ccTypeName, `) Marshal() (data []byte, err error) {`) p.In() - p.P(`size := m.Size()`) + if gogoproto.IsProtoSizer(file.FileDescriptorProto, message.DescriptorProto) { + p.P(`size := m.ProtoSize()`) + } else { + p.P(`size := m.Size()`) + } p.P(`data = make([]byte, size)`) p.P(`n, err := m.MarshalTo(data)`) p.P(`if err != nil {`) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/populate/populate.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/populate/populate.go index 70597db3aa8..6594096f7f7 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/populate/populate.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/populate/populate.go @@ -290,7 +290,7 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato } else if field.IsMessage() || p.IsGroup(field) { funcCall := getFuncCall(goTypName) if field.IsRepeated() { - p.P(p.varGen.Next(), ` := r.Intn(10)`) + p.P(p.varGen.Next(), ` := r.Intn(5)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() @@ -346,7 +346,7 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato } } else if field.IsBytes() { if field.IsRepeated() { - p.P(p.varGen.Next(), ` := r.Intn(100)`) + p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() @@ -387,7 +387,7 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato } else { typName := generator.GoTypeToName(goTyp) if field.IsRepeated() { - p.P(p.varGen.Next(), ` := r.Intn(100)`) + p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/size.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/size.go index b657611b3dd..49b1f962cd3 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/size.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/size.go @@ -25,7 +25,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* -The size plugin generates a Size method for each message. +The size plugin generates a Size or ProtoSize method for each message. This is useful with the MarshalTo method generated by the marshalto plugin and the gogoproto.marshaler and gogoproto.marshaler_all extensions. @@ -33,6 +33,8 @@ It is enabled by the following extensions: - sizer - sizer_all + - protosizer + - protosizer_all The size plugin also generates a test given it is enabled using one of the following extensions: @@ -195,7 +197,7 @@ func (p *size) sizeZigZag() { }`) } -func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, message *generator.Descriptor, field *descriptor.FieldDescriptorProto) { +func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, message *generator.Descriptor, field *descriptor.FieldDescriptorProto, sizeName string) { fieldname := p.GetOneOfFieldName(message, field) nullable := gogoproto.IsNullable(field) repeated := field.IsRepeated() @@ -393,17 +395,17 @@ func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, messag p.P(`if v != nil {`) p.In() if valuegoTyp != valuegoAliasTyp { - p.P(`l = ((`, valuegoTyp, `)(v)).Size()`) + p.P(`l = ((`, valuegoTyp, `)(v)).`, sizeName, `()`) } else { - p.P(`l = v.Size()`) + p.P(`l = v.`, sizeName, `()`) } p.Out() p.P(`}`) } else { if valuegoTyp != valuegoAliasTyp { - p.P(`l = ((*`, valuegoTyp, `)(&v)).Size()`) + p.P(`l = ((*`, valuegoTyp, `)(&v)).`, sizeName, `()`) } else { - p.P(`l = v.Size()`) + p.P(`l = v.`, sizeName, `()`) } } sum = append(sum, `l+sov`+p.localName+`(uint64(l))`) @@ -415,12 +417,12 @@ func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, messag } else if repeated { p.P(`for _, e := range m.`, fieldname, ` { `) p.In() - p.P(`l=e.Size()`) + p.P(`l=e.`, sizeName, `()`) p.P(`n+=`, strconv.Itoa(key), `+l+sov`, p.localName, `(uint64(l))`) p.Out() p.P(`}`) } else { - p.P(`l=m.`, fieldname, `.Size()`) + p.P(`l=m.`, fieldname, `.`, sizeName, `()`) p.P(`n+=`, strconv.Itoa(key), `+l+sov`, p.localName, `(uint64(l))`) } case descriptor.FieldDescriptorProto_TYPE_BYTES: @@ -447,12 +449,12 @@ func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, messag if repeated { p.P(`for _, e := range m.`, fieldname, ` { `) p.In() - p.P(`l=e.Size()`) + p.P(`l=e.`, sizeName, `()`) p.P(`n+=`, strconv.Itoa(key), `+l+sov`, p.localName, `(uint64(l))`) p.Out() p.P(`}`) } else { - p.P(`l=m.`, fieldname, `.Size()`) + p.P(`l=m.`, fieldname, `.`, sizeName, `()`) p.P(`n+=`, strconv.Itoa(key), `+l+sov`, p.localName, `(uint64(l))`) } } @@ -501,7 +503,12 @@ func (p *size) Generate(file *generator.FileDescriptor) { protoPkg = p.NewImport("github.com/golang/protobuf/proto") } for _, message := range file.Messages() { - if !gogoproto.IsSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName := "" + if gogoproto.IsSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName = "Size" + } else if gogoproto.IsProtoSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName = "ProtoSize" + } else { continue } if message.DescriptorProto.GetOptions().GetMapEntry() { @@ -509,7 +516,7 @@ func (p *size) Generate(file *generator.FileDescriptor) { } p.atleastOne = true ccTypeName := generator.CamelCaseSlice(message.TypeName()) - p.P(`func (m *`, ccTypeName, `) Size() (n int) {`) + p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`) p.In() p.P(`var l int`) p.P(`_ = l`) @@ -518,7 +525,7 @@ func (p *size) Generate(file *generator.FileDescriptor) { oneof := field.OneofIndex != nil if !oneof { proto3 := gogoproto.IsProto3(file.FileDescriptorProto) - p.generateField(proto3, file, message, field) + p.generateField(proto3, file, message, field, sizeName) } else { fieldname := p.GetFieldName(message, field) if _, ok := oneofs[fieldname]; ok { @@ -528,7 +535,7 @@ func (p *size) Generate(file *generator.FileDescriptor) { } p.P(`if m.`, fieldname, ` != nil {`) p.In() - p.P(`n+=m.`, fieldname, `.Size()`) + p.P(`n+=m.`, fieldname, `.`, sizeName, `()`) p.Out() p.P(`}`) } @@ -564,12 +571,12 @@ func (p *size) Generate(file *generator.FileDescriptor) { continue } ccTypeName := p.OneOfTypeName(message, f) - p.P(`func (m *`, ccTypeName, `) Size() (n int) {`) + p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`) p.In() p.P(`var l int`) p.P(`_ = l`) vanity.TurnOffNullableForNativeTypesWithoutDefaultsOnly(f) - p.generateField(false, file, message, f) + p.generateField(false, file, message, f, sizeName) p.P(`return n`) p.Out() p.P(`}`) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/sizetest.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/sizetest.go index 0851a29a475..4fa946e57e8 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/sizetest.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/size/sizetest.go @@ -51,7 +51,12 @@ func (p *test) Generate(imports generator.PluginImports, file *generator.FileDes } for _, message := range file.Messages() { ccTypeName := generator.CamelCaseSlice(message.TypeName()) - if !gogoproto.IsSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName := "" + if gogoproto.IsSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName = "Size" + } else if gogoproto.IsProtoSizer(file.FileDescriptorProto, message.DescriptorProto) { + sizeName = "ProtoSize" + } else { continue } if message.DescriptorProto.GetOptions().GetMapEntry() { @@ -60,7 +65,7 @@ func (p *test) Generate(imports generator.PluginImports, file *generator.FileDes if gogoproto.HasTestGen(file.FileDescriptorProto, message.DescriptorProto) { used = true - p.P(`func Test`, ccTypeName, `Size(t *`, testingPkg.Use(), `.T) {`) + p.P(`func Test`, ccTypeName, sizeName, `(t *`, testingPkg.Use(), `.T) {`) p.In() p.P(`seed := `, timePkg.Use(), `.Now().UnixNano()`) p.P(`popr := `, randPkg.Use(), `.New(`, randPkg.Use(), `.NewSource(seed))`) @@ -72,7 +77,7 @@ func (p *test) Generate(imports generator.PluginImports, file *generator.FileDes p.P(`t.Fatalf("seed = %d, err = %v", seed, err)`) p.Out() p.P(`}`) - p.P(`size := p.Size()`) + p.P(`size := p.`, sizeName, `()`) p.P(`if len(data) != size {`) p.In() p.P(`t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data))`) @@ -96,7 +101,7 @@ func (p *test) Generate(imports generator.PluginImports, file *generator.FileDes if gogoproto.HasBenchGen(file.FileDescriptorProto, message.DescriptorProto) { used = true - p.P(`func Benchmark`, ccTypeName, `Size(b *`, testingPkg.Use(), `.B) {`) + p.P(`func Benchmark`, ccTypeName, sizeName, `(b *`, testingPkg.Use(), `.B) {`) p.In() p.P(`popr := `, randPkg.Use(), `.New(`, randPkg.Use(), `.NewSource(616))`) p.P(`total := 0`) @@ -109,7 +114,7 @@ func (p *test) Generate(imports generator.PluginImports, file *generator.FileDes p.P(`b.ResetTimer()`) p.P(`for i := 0; i < b.N; i++ {`) p.In() - p.P(`total += pops[i%1000].Size()`) + p.P(`total += pops[i%1000].`, sizeName, `()`) p.Out() p.P(`}`) p.P(`b.SetBytes(int64(total / b.N))`) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/testgen/testgen.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/testgen/testgen.go index de6c7217db0..a48a1c2ccbc 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/testgen/testgen.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/testgen/testgen.go @@ -341,7 +341,11 @@ func (p *testProto) Generate(imports generator.PluginImports, file *generator.Fi p.P(`seed := `, timePkg.Use(), `.Now().UnixNano()`) p.P(`popr := `, randPkg.Use(), `.New(`, randPkg.Use(), `.NewSource(seed))`) p.P(`p := NewPopulated`, ccTypeName, `(popr, false)`) - p.P(`size := p.Size()`) + if gogoproto.IsProtoSizer(file.FileDescriptorProto, message.DescriptorProto) { + p.P(`size := p.ProtoSize()`) + } else { + p.P(`size := p.Size()`) + } p.P(`data := make([]byte, size)`) p.P(`for i := range data {`) p.In() diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go index acb32d9db07..13285960988 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go @@ -419,7 +419,7 @@ func (p *unmarshal) noStarOrSliceType(msg *generator.Descriptor, field *descript return typ } -func (p *unmarshal) field(file *descriptor.FileDescriptorProto, msg *generator.Descriptor, field *descriptor.FieldDescriptorProto, fieldname string, proto3 bool) { +func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descriptor, field *descriptor.FieldDescriptorProto, fieldname string, proto3 bool) { repeated := field.IsRepeated() nullable := gogoproto.IsNullable(field) typ := p.noStarOrSliceType(msg, field) @@ -676,7 +676,7 @@ func (p *unmarshal) field(file *descriptor.FileDescriptorProto, msg *generator.D p.Out() p.P(`}`) p.P(`m.`, fieldname, ` = &`, p.OneOfTypeName(msg, field), `{v}`) - } else if generator.IsMap(file, field) { + } else if generator.IsMap(file.FileDescriptorProto, field) { m := p.GoMapType(nil, field) keygoTyp, _ := p.GoType(nil, m.KeyField) @@ -773,7 +773,12 @@ func (p *unmarshal) field(file *descriptor.FileDescriptorProto, msg *generator.D p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, make([]byte, postIndex-iNdEx))`) p.P(`copy(m.`, fieldname, `[len(m.`, fieldname, `)-1], data[iNdEx:postIndex])`) } else { - p.P(`m.`, fieldname, ` = append([]byte{}`, `, data[iNdEx:postIndex]...)`) + p.P(`m.`, fieldname, ` = append(m.`, fieldname, `[:0] , data[iNdEx:postIndex]...)`) + p.P(`if m.`, fieldname, ` == nil {`) + p.In() + p.P(`m.`, fieldname, ` = []byte{}`) + p.Out() + p.P(`}`) } } else { _, ctyp, err := generator.GetCustomType(field) @@ -1061,13 +1066,13 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) { p.P(`}`) p.P(`for iNdEx < postIndex {`) p.In() - p.field(file.FileDescriptorProto, message, field, fieldname, false) + p.field(file, message, field, fieldname, false) p.Out() p.P(`}`) p.Out() p.P(`} else if wireType == `, strconv.Itoa(wireType), `{`) p.In() - p.field(file.FileDescriptorProto, message, field, fieldname, false) + p.field(file, message, field, fieldname, false) p.Out() p.P(`} else {`) p.In() @@ -1080,7 +1085,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) { p.P(`return ` + fmtPkg.Use() + `.Errorf("proto: wrong wireType = %d for field ` + errFieldname + `", wireType)`) p.Out() p.P(`}`) - p.field(file.FileDescriptorProto, message, field, fieldname, proto3) + p.field(file, message, field, fieldname, proto3) } if field.IsRequired() { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go b/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go index f3a690a6b66..33c501b3e42 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go @@ -601,7 +601,7 @@ func (g *Generator) CommandLineParameters(parameter string) { if pluginList == "none" { pluginList = "" } - gogoPluginNames := []string{"unmarshal", "unsafeunmarshaler", "union", "stringer", "size", "populate", "marshalto", "unsafemarshaler", "gostring", "face", "equal", "enumstringer", "embedcheck", "description", "defaultcheck", "oneofcheck"} + gogoPluginNames := []string{"unmarshal", "unsafeunmarshaler", "union", "stringer", "size", "protosizer", "populate", "marshalto", "unsafemarshaler", "gostring", "face", "equal", "enumstringer", "embedcheck", "description", "defaultcheck", "oneofcheck"} pluginList = strings.Join(append(gogoPluginNames, pluginList), "+") if pluginList != "" { // Amend the set of plugins. @@ -1857,11 +1857,11 @@ var methodNames = [...]string{ "ExtensionRangeArray", "ExtensionMap", "Descriptor", - "Size", "MarshalTo", "Equal", "VerboseEqual", "GoString", + "ProtoSize", } // Generate the type and default constant definitions for this Descriptor. @@ -1875,6 +1875,9 @@ func (g *Generator) generateMessage(message *Descriptor) { for _, n := range methodNames { usedNames[n] = true } + if !gogoproto.IsProtoSizer(message.file, message.DescriptorProto) { + usedNames["Size"] = true + } fieldNames := make(map[*descriptor.FieldDescriptorProto]string) fieldGetterNames := make(map[*descriptor.FieldDescriptorProto]string) fieldTypes := make(map[*descriptor.FieldDescriptorProto]string) @@ -2210,6 +2213,9 @@ func (g *Generator) generateMessage(message *Descriptor) { if gogoproto.IsSizer(g.file.FileDescriptorProto, message.DescriptorProto) { g.P(`Size() int`) } + if gogoproto.IsProtoSizer(g.file.FileDescriptorProto, message.DescriptorProto) { + g.P(`ProtoSize() int`) + } g.Out() g.P("}") } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go b/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go index 048cd9b3694..258d6a9b6af 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go @@ -181,6 +181,11 @@ func (g *Generator) GetFieldName(message *Descriptor, field *descriptor.FieldDes return fieldname + "_" } } + if !gogoproto.IsProtoSizer(message.file, message.DescriptorProto) { + if fieldname == "Size" { + return fieldname + "_" + } + } return fieldname } @@ -198,6 +203,11 @@ func (g *Generator) GetOneOfFieldName(message *Descriptor, field *descriptor.Fie return fieldname + "_" } } + if !gogoproto.IsProtoSizer(message.file, message.DescriptorProto) { + if fieldname == "Size" { + return fieldname + "_" + } + } return fieldname } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile index fb838ed2d75..f1f06564a15 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile @@ -39,5 +39,5 @@ test: install generate-test-pbs generate-test-pbs: make install make -C testdata - make -C proto3_proto + protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata:. proto3_proto/proto3.proto make diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go index ae276fd77c0..e98ddec9815 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go @@ -29,8 +29,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Protocol buffer deep copy. -// TODO: MessageSet and RawMessage. +// Protocol buffer deep copy and merge. +// TODO: RawMessage. package proto @@ -75,12 +75,13 @@ func Merge(dst, src Message) { } func mergeStruct(out, in reflect.Value) { + sprop := GetProperties(in.Type()) for i := 0; i < in.NumField(); i++ { f := in.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } - mergeAny(out.Field(i), in.Field(i)) + mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i]) } if emIn, ok := in.Addr().Interface().(extendableProto); ok { @@ -98,7 +99,10 @@ func mergeStruct(out, in reflect.Value) { } } -func mergeAny(out, in reflect.Value) { +// mergeAny performs a merge between two values of the same type. +// viaPtr indicates whether the values were indirected through a pointer (implying proto2). +// prop is set if this is a struct field (it may be nil). +func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { if in.Type() == protoMessageType { if !in.IsNil() { if out.IsNil() { @@ -112,7 +116,21 @@ func mergeAny(out, in reflect.Value) { switch in.Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: + if !viaPtr && isProto3Zero(in) { + return + } out.Set(in) + case reflect.Interface: + // Probably a oneof field; copy non-nil values. + if in.IsNil() { + return + } + // Allocate destination if it is not set, or set to a different type. + // Otherwise we will merge as normal. + if out.IsNil() || out.Elem().Type() != in.Elem().Type() { + out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T) + } + mergeAny(out.Elem(), in.Elem(), false, nil) case reflect.Map: if in.Len() == 0 { return @@ -127,7 +145,7 @@ func mergeAny(out, in reflect.Value) { switch elemKind { case reflect.Ptr: val = reflect.New(in.Type().Elem().Elem()) - mergeAny(val, in.MapIndex(key)) + mergeAny(val, in.MapIndex(key), false, nil) case reflect.Slice: val = in.MapIndex(key) val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) @@ -143,13 +161,21 @@ func mergeAny(out, in reflect.Value) { if out.IsNil() { out.Set(reflect.New(in.Elem().Type())) } - mergeAny(out.Elem(), in.Elem()) + mergeAny(out.Elem(), in.Elem(), true, nil) case reflect.Slice: if in.IsNil() { return } if in.Type().Elem().Kind() == reflect.Uint8 { // []byte is a scalar bytes field, not a repeated field. + + // Edge case: if this is in a proto3 message, a zero length + // bytes field is considered the zero value, and should not + // be merged. + if prop != nil && prop.proto3 && in.Len() == 0 { + return + } + // Make a deep copy. // Append to []byte{} instead of []byte(nil) so that we never end up // with a nil result. @@ -167,7 +193,7 @@ func mergeAny(out, in reflect.Value) { default: for i := 0; i < n; i++ { x := reflect.Indirect(reflect.New(in.Type().Elem())) - mergeAny(x, in.Index(i)) + mergeAny(x, in.Index(i), false, nil) out.Set(reflect.Append(out, x)) } } @@ -184,7 +210,7 @@ func mergeExtension(out, in map[int32]Extension) { eOut := Extension{desc: eIn.desc} if eIn.value != nil { v := reflect.New(reflect.TypeOf(eIn.value)).Elem() - mergeAny(v, reflect.ValueOf(eIn.value)) + mergeAny(v, reflect.ValueOf(eIn.value), false, nil) eOut.value = v.Interface() } if eIn.enc != nil { diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go index 88622c305a3..5810782fd84 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go @@ -46,6 +46,10 @@ import ( // errOverflow is returned when an integer is too large to be represented. var errOverflow = errors.New("proto: integer overflow") +// ErrInternalBadWireType is returned by generated code when an incorrect +// wire type is encountered. It does not get returned to user code. +var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") + // The fundamental decoders that interpret bytes on the wire. // Those that take integer types all return uint64 and are // therefore of type valueDecoder. @@ -314,6 +318,24 @@ func UnmarshalMerge(buf []byte, pb Message) error { return NewBuffer(buf).Unmarshal(pb) } +// DecodeMessage reads a count-delimited message from the Buffer. +func (p *Buffer) DecodeMessage(pb Message) error { + enc, err := p.DecodeRawBytes(false) + if err != nil { + return err + } + return NewBuffer(enc).Unmarshal(pb) +} + +// DecodeGroup reads a tag-delimited group from the Buffer. +func (p *Buffer) DecodeGroup(pb Message) error { + typ, base, err := getbase(pb) + if err != nil { + return err + } + return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base) +} + // Unmarshal parses the protocol buffer representation in the // Buffer and places the decoded result in pb. If the struct // underlying pb does not match the data in the buffer, the results can be @@ -377,6 +399,20 @@ func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group continue } } + // Maybe it's a oneof? + if prop.oneofUnmarshaler != nil { + m := structPointer_Interface(base, st).(Message) + // First return value indicates whether tag is a oneof field. + ok, err = prop.oneofUnmarshaler(m, tag, wire, o) + if err == ErrInternalBadWireType { + // Map the error to something more descriptive. + // Do the formatting here to save generated code space. + err = fmt.Errorf("bad wiretype for oneof field in %T", m) + } + if ok { + continue + } + } err = o.skipAndSave(st, tag, wire, base, prop.unrecField) continue } @@ -518,9 +554,7 @@ func (o *Buffer) dec_string(p *Properties, base structPointer) error { if err != nil { return err } - sp := new(string) - *sp = s - *structPointer_String(base, p.field) = sp + *structPointer_String(base, p.field) = &s return nil } @@ -563,9 +597,13 @@ func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error return err } nb := int(nn) // number of bytes of encoded bools + fin := o.index + nb + if fin < o.index { + return errOverflow + } y := *v - for i := 0; i < nb; i++ { + for o.index < fin { u, err := p.valDec(o) if err != nil { return err @@ -677,7 +715,7 @@ func (o *Buffer) dec_new_map(p *Properties, base structPointer) error { oi := o.index // index at the end of this map entry o.index -= len(raw) // move buffer back to start of map entry - mptr := structPointer_Map(base, p.field, p.mtype) // *map[K]V + mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V if mptr.Elem().IsNil() { mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem())) } @@ -729,8 +767,14 @@ func (o *Buffer) dec_new_map(p *Properties, base structPointer) error { return fmt.Errorf("proto: bad map data tag %d", raw[0]) } } + keyelem, valelem := keyptr.Elem(), valptr.Elem() + if !keyelem.IsValid() || !valelem.IsValid() { + // We did not decode the key or the value in the map entry. + // Either way, it's an invalid map entry. + return fmt.Errorf("proto: bad map data: missing key/val") + } - v.SetMapIndex(keyptr.Elem(), valptr.Elem()) + v.SetMapIndex(keyelem, valelem) return nil } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go index 1512d605b2d..231b07401a3 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go @@ -60,9 +60,9 @@ func (e *RequiredNotSetError) Error() string { } var ( - // ErrRepeatedHasNil is the error returned if Marshal is called with + // errRepeatedHasNil is the error returned if Marshal is called with // a struct with a repeated field containing a nil element. - ErrRepeatedHasNil = errors.New("proto: repeated field has nil element") + errRepeatedHasNil = errors.New("proto: repeated field has nil element") // ErrNil is the error returned if Marshal is called with nil. ErrNil = errors.New("proto: Marshal called with nil") @@ -105,6 +105,11 @@ func (p *Buffer) EncodeVarint(x uint64) error { return nil } +// SizeVarint returns the varint encoding size of an integer. +func SizeVarint(x uint64) int { + return sizeVarint(x) +} + func sizeVarint(x uint64) (n int) { for { n++ @@ -228,6 +233,20 @@ func Marshal(pb Message) ([]byte, error) { return p.buf, err } +// EncodeMessage writes the protocol buffer to the Buffer, +// prefixed by a varint-encoded length. +func (p *Buffer) EncodeMessage(pb Message) error { + t, base, err := getbase(pb) + if structPointer_IsNil(base) { + return ErrNil + } + if err == nil { + var state errorState + err = p.enc_len_struct(GetProperties(t.Elem()), base, &state) + } + return err +} + // Marshal takes the protocol buffer // and encodes it into the wire format, writing the result to the // Buffer. @@ -318,7 +337,7 @@ func size_bool(p *Properties, base structPointer) int { func size_proto3_bool(p *Properties, base structPointer) int { v := *structPointer_BoolVal(base, p.field) - if !v { + if !v && !p.oneof { return 0 } return len(p.tagcode) + 1 // each bool takes exactly one byte @@ -361,7 +380,7 @@ func size_int32(p *Properties, base structPointer) (n int) { func size_proto3_int32(p *Properties, base structPointer) (n int) { v := structPointer_Word32Val(base, p.field) x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -407,7 +426,7 @@ func size_uint32(p *Properties, base structPointer) (n int) { func size_proto3_uint32(p *Properties, base structPointer) (n int) { v := structPointer_Word32Val(base, p.field) x := word32Val_Get(v) - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -452,7 +471,7 @@ func size_int64(p *Properties, base structPointer) (n int) { func size_proto3_int64(p *Properties, base structPointer) (n int) { v := structPointer_Word64Val(base, p.field) x := word64Val_Get(v) - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -495,7 +514,7 @@ func size_string(p *Properties, base structPointer) (n int) { func size_proto3_string(p *Properties, base structPointer) (n int) { v := *structPointer_StringVal(base, p.field) - if v == "" { + if v == "" && !p.oneof { return 0 } n += len(p.tagcode) @@ -529,7 +548,7 @@ func (o *Buffer) enc_struct_message(p *Properties, base structPointer) error { } o.buf = append(o.buf, p.tagcode...) o.EncodeRawBytes(data) - return nil + return state.err } o.buf = append(o.buf, p.tagcode...) @@ -667,7 +686,7 @@ func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error func size_slice_byte(p *Properties, base structPointer) (n int) { s := *structPointer_Bytes(base, p.field) - if s == nil { + if s == nil && !p.oneof { return 0 } n += len(p.tagcode) @@ -677,7 +696,7 @@ func size_slice_byte(p *Properties, base structPointer) (n int) { func size_proto3_slice_byte(p *Properties, base structPointer) (n int) { s := *structPointer_Bytes(base, p.field) - if len(s) == 0 { + if len(s) == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -939,7 +958,7 @@ func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) err for i := 0; i < l; i++ { structp := s.Index(i) if structPointer_IsNil(structp) { - return ErrRepeatedHasNil + return errRepeatedHasNil } // Can the object marshal itself? @@ -958,7 +977,7 @@ func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) err err := o.enc_len_struct(p.sprop, structp, &state) if err != nil && !state.shouldContinue(err, nil) { if err == ErrNil { - return ErrRepeatedHasNil + return errRepeatedHasNil } return err } @@ -1001,7 +1020,7 @@ func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error for i := 0; i < l; i++ { b := s.Index(i) if structPointer_IsNil(b) { - return ErrRepeatedHasNil + return errRepeatedHasNil } o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup)) @@ -1010,7 +1029,7 @@ func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error if err != nil && !state.shouldContinue(err, nil) { if err == ErrNil { - return ErrRepeatedHasNil + return errRepeatedHasNil } return err } @@ -1084,7 +1103,7 @@ func (o *Buffer) enc_new_map(p *Properties, base structPointer) error { repeated MapFieldEntry map_field = N; */ - v := structPointer_Map(base, p.field, p.mtype).Elem() // map[K]V + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V if v.Len() == 0 { return nil } @@ -1101,11 +1120,15 @@ func (o *Buffer) enc_new_map(p *Properties, base structPointer) error { return nil } - keys := v.MapKeys() - sort.Sort(mapKeys(keys)) - for _, key := range keys { + // Don't sort map keys. It is not required by the spec, and C++ doesn't do it. + for _, key := range v.MapKeys() { val := v.MapIndex(key) + // The only illegal map entry values are nil message pointers. + if val.Kind() == reflect.Ptr && val.IsNil() { + return errors.New("proto: map has nil element") + } + keycopy.Set(key) valcopy.Set(val) @@ -1118,7 +1141,7 @@ func (o *Buffer) enc_new_map(p *Properties, base structPointer) error { } func size_new_map(p *Properties, base structPointer) int { - v := structPointer_Map(base, p.field, p.mtype).Elem() // map[K]V + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype) @@ -1128,10 +1151,12 @@ func size_new_map(p *Properties, base structPointer) int { keycopy.Set(key) valcopy.Set(val) - // Tag codes are two bytes per map entry. - n += 2 - n += p.mkeyprop.size(p.mkeyprop, keybase) - n += p.mvalprop.size(p.mvalprop, valbase) + // Tag codes for key and val are the responsibility of the sub-sizer. + keysize := p.mkeyprop.size(p.mkeyprop, keybase) + valsize := p.mvalprop.size(p.mvalprop, valbase) + entry := keysize + valsize + // Add on tag code and length of map entry itself. + n += len(p.tagcode) + sizeVarint(uint64(entry)) + entry } return n } @@ -1184,6 +1209,9 @@ func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { if p.Required && state.err == nil { state.err = &RequiredNotSetError{p.Name} } + } else if err == errRepeatedHasNil { + // Give more context to nil values in repeated fields. + return errors.New("repeated field " + p.OrigName + " has nil element") } else if !state.shouldContinue(err, p) { return err } @@ -1191,6 +1219,14 @@ func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { } } + // Do oneof fields. + if prop.oneofMarshaler != nil { + m := structPointer_Interface(base, prop.stype).(Message) + if err := prop.oneofMarshaler(m, o); err != nil { + return err + } + } + // Add unrecognized fields at the end. if prop.unrecField.IsValid() { v := *structPointer_Bytes(base, prop.unrecField) @@ -1216,6 +1252,12 @@ func size_struct(prop *StructProperties, base structPointer) (n int) { n += len(v) } + // Factor in any oneof fields. + if prop.oneofSizer != nil { + m := structPointer_Interface(base, prop.stype).(Message) + n += prop.oneofSizer(m) + } + return } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go index d8673a3e97a..f5db1def3c2 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go @@ -30,7 +30,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Protocol buffer comparison. -// TODO: MessageSet. package proto @@ -51,7 +50,9 @@ Equality is defined in this way: are equal, and extensions sets are equal. - Two set scalar fields are equal iff their values are equal. If the fields are of a floating-point type, remember that - NaN != x for all x, including NaN. + NaN != x for all x, including NaN. If the message is defined + in a proto3 .proto file, fields are not "set"; specifically, + zero length proto3 "bytes" fields are equal (nil == {}). - Two repeated fields are equal iff their lengths are the same, and their corresponding elements are equal (a "bytes" field, although represented by []byte, is not a repeated field) @@ -89,6 +90,7 @@ func Equal(a, b Message) bool { // v1 and v2 are known to have the same type. func equalStruct(v1, v2 reflect.Value) bool { + sprop := GetProperties(v1.Type()) for i := 0; i < v1.NumField(); i++ { f := v1.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { @@ -114,7 +116,7 @@ func equalStruct(v1, v2 reflect.Value) bool { } f1, f2 = f1.Elem(), f2.Elem() } - if !equalAny(f1, f2) { + if !equalAny(f1, f2, sprop.Prop[i]) { return false } } @@ -141,7 +143,8 @@ func equalStruct(v1, v2 reflect.Value) bool { } // v1 and v2 are known to have the same type. -func equalAny(v1, v2 reflect.Value) bool { +// prop may be nil. +func equalAny(v1, v2 reflect.Value, prop *Properties) bool { if v1.Type() == protoMessageType { m1, _ := v1.Interface().(Message) m2, _ := v2.Interface().(Message) @@ -154,6 +157,17 @@ func equalAny(v1, v2 reflect.Value) bool { return v1.Float() == v2.Float() case reflect.Int32, reflect.Int64: return v1.Int() == v2.Int() + case reflect.Interface: + // Probably a oneof field; compare the inner values. + n1, n2 := v1.IsNil(), v2.IsNil() + if n1 || n2 { + return n1 == n2 + } + e1, e2 := v1.Elem(), v2.Elem() + if e1.Type() != e2.Type() { + return false + } + return equalAny(e1, e2, nil) case reflect.Map: if v1.Len() != v2.Len() { return false @@ -164,16 +178,22 @@ func equalAny(v1, v2 reflect.Value) bool { // This key was not found in the second map. return false } - if !equalAny(v1.MapIndex(key), val2) { + if !equalAny(v1.MapIndex(key), val2, nil) { return false } } return true case reflect.Ptr: - return equalAny(v1.Elem(), v2.Elem()) + return equalAny(v1.Elem(), v2.Elem(), prop) case reflect.Slice: if v1.Type().Elem().Kind() == reflect.Uint8 { // short circuit: []byte + + // Edge case: if this is in a proto3 message, a zero length + // bytes field is considered the zero value. + if prop != nil && prop.proto3 && v1.Len() == 0 && v2.Len() == 0 { + return true + } if v1.IsNil() != v2.IsNil() { return false } @@ -184,7 +204,7 @@ func equalAny(v1, v2 reflect.Value) bool { return false } for i := 0; i < v1.Len(); i++ { - if !equalAny(v1.Index(i), v2.Index(i)) { + if !equalAny(v1.Index(i), v2.Index(i), prop) { return false } } @@ -219,7 +239,7 @@ func equalExtensions(base reflect.Type, em1, em2 map[int32]Extension) bool { if m1 != nil && m2 != nil { // Both are unencoded. - if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2)) { + if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } continue @@ -247,7 +267,7 @@ func equalExtensions(base reflect.Type, em1, em2 map[int32]Extension) bool { log.Printf("proto: badly encoded extension %d of %v: %v", extNum, base, err) return false } - if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2)) { + if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go index f7667fab48c..054f4f1df78 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go @@ -37,6 +37,7 @@ package proto import ( "errors" + "fmt" "reflect" "strconv" "sync" @@ -221,7 +222,7 @@ func ClearExtension(pb extendableProto, extension *ExtensionDesc) { } // GetExtension parses and returns the given extension of pb. -// If the extension is not present it returns ErrMissingExtension. +// If the extension is not present and has no default value it returns ErrMissingExtension. func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, error) { if err := checkExtensionTypes(pb, extension); err != nil { return nil, err @@ -230,8 +231,11 @@ func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, er emap := pb.ExtensionMap() e, ok := emap[extension.Field] if !ok { - return nil, ErrMissingExtension + // defaultExtensionValue returns the default value or + // ErrMissingExtension if there is no default. + return defaultExtensionValue(extension) } + if e.value != nil { // Already decoded. Check the descriptor, though. if e.desc != extension { @@ -257,12 +261,46 @@ func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, er return e.value, nil } +// defaultExtensionValue returns the default value for extension. +// If no default for an extension is defined ErrMissingExtension is returned. +func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) { + t := reflect.TypeOf(extension.ExtensionType) + props := extensionProperties(extension) + + sf, _, err := fieldDefault(t, props) + if err != nil { + return nil, err + } + + if sf == nil || sf.value == nil { + // There is no default value. + return nil, ErrMissingExtension + } + + if t.Kind() != reflect.Ptr { + // We do not need to return a Ptr, we can directly return sf.value. + return sf.value, nil + } + + // We need to return an interface{} that is a pointer to sf.value. + value := reflect.New(t).Elem() + value.Set(reflect.New(value.Type().Elem())) + if sf.kind == reflect.Int32 { + // We may have an int32 or an enum, but the underlying data is int32. + // Since we can't set an int32 into a non int32 reflect.value directly + // set it as a int32. + value.Elem().SetInt(int64(sf.value.(int32))) + } else { + value.Elem().Set(reflect.ValueOf(sf.value)) + } + return value.Interface(), nil +} + // decodeExtension decodes an extension encoded in b. func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { o := NewBuffer(b) t := reflect.TypeOf(extension.ExtensionType) - rep := extension.repeated() props := extensionProperties(extension) @@ -284,7 +322,7 @@ func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { return nil, err } - if !rep || o.index >= len(o.buf) { + if o.index >= len(o.buf) { break } } @@ -321,6 +359,14 @@ func SetExtension(pb extendableProto, extension *ExtensionDesc, value interface{ if typ != reflect.TypeOf(value) { return errors.New("proto: bad extension value type") } + // nil extension values need to be caught early, because the + // encoder can't distinguish an ErrNil due to a nil extension + // from an ErrNil due to a missing field. Extensions are + // always optional, so the encoder would just swallow the error + // and drop all the extensions from the encoded message. + if reflect.ValueOf(value).IsNil() { + return fmt.Errorf("proto: SetExtension called with nil value of type %T", value) + } pb.ExtensionMap()[extension.Field] = Extension{desc: extension, value: value} return nil diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go index 87c6b9d1acf..0de8f8dffd0 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go @@ -30,171 +30,237 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* - Package proto converts data structures to and from the wire format of - protocol buffers. It works in concert with the Go source code generated - for .proto files by the protocol compiler. +Package proto converts data structures to and from the wire format of +protocol buffers. It works in concert with the Go source code generated +for .proto files by the protocol compiler. - A summary of the properties of the protocol buffer interface - for a protocol buffer variable v: +A summary of the properties of the protocol buffer interface +for a protocol buffer variable v: - - Names are turned from camel_case to CamelCase for export. - - There are no methods on v to set fields; just treat - them as structure fields. - - There are getters that return a field's value if set, - and return the field's default value if unset. - The getters work even if the receiver is a nil message. - - The zero value for a struct is its correct initialization state. - All desired fields must be set before marshaling. - - A Reset() method will restore a protobuf struct to its zero state. - - Non-repeated fields are pointers to the values; nil means unset. - That is, optional or required field int32 f becomes F *int32. - - Repeated fields are slices. - - Helper functions are available to aid the setting of fields. - Helpers for getting values are superseded by the - GetFoo methods and their use is deprecated. - msg.Foo = proto.String("hello") // set field - - Constants are defined to hold the default values of all fields that - have them. They have the form Default_StructName_FieldName. - Because the getter methods handle defaulted values, - direct use of these constants should be rare. - - Enums are given type names and maps from names to values. - Enum values are prefixed with the enum's type name. Enum types have - a String method, and a Enum method to assist in message construction. - - Nested groups and enums have type names prefixed with the name of - the surrounding message type. - - Extensions are given descriptor names that start with E_, - followed by an underscore-delimited list of the nested messages - that contain it (if any) followed by the CamelCased name of the - extension field itself. HasExtension, ClearExtension, GetExtension - and SetExtension are functions for manipulating extensions. - - Marshal and Unmarshal are functions to encode and decode the wire format. + - Names are turned from camel_case to CamelCase for export. + - There are no methods on v to set fields; just treat + them as structure fields. + - There are getters that return a field's value if set, + and return the field's default value if unset. + The getters work even if the receiver is a nil message. + - The zero value for a struct is its correct initialization state. + All desired fields must be set before marshaling. + - A Reset() method will restore a protobuf struct to its zero state. + - Non-repeated fields are pointers to the values; nil means unset. + That is, optional or required field int32 f becomes F *int32. + - Repeated fields are slices. + - Helper functions are available to aid the setting of fields. + msg.Foo = proto.String("hello") // set field + - Constants are defined to hold the default values of all fields that + have them. They have the form Default_StructName_FieldName. + Because the getter methods handle defaulted values, + direct use of these constants should be rare. + - Enums are given type names and maps from names to values. + Enum values are prefixed by the enclosing message's name, or by the + enum's type name if it is a top-level enum. Enum types have a String + method, and a Enum method to assist in message construction. + - Nested messages, groups and enums have type names prefixed with the name of + the surrounding message type. + - Extensions are given descriptor names that start with E_, + followed by an underscore-delimited list of the nested messages + that contain it (if any) followed by the CamelCased name of the + extension field itself. HasExtension, ClearExtension, GetExtension + and SetExtension are functions for manipulating extensions. + - Oneof field sets are given a single field in their message, + with distinguished wrapper types for each possible field value. + - Marshal and Unmarshal are functions to encode and decode the wire format. - The simplest way to describe this is to see an example. - Given file test.proto, containing +When the .proto file specifies `syntax="proto3"`, there are some differences: - package example; + - Non-repeated fields of non-message type are values instead of pointers. + - Getters are only generated for message and oneof fields. + - Enum types do not get an Enum method. - enum FOO { X = 17; }; +The simplest way to describe this is to see an example. +Given file test.proto, containing - message Test { - required string label = 1; - optional int32 type = 2 [default=77]; - repeated int64 reps = 3; - optional group OptionalGroup = 4 { - required string RequiredField = 5; - } + package example; + + enum FOO { X = 17; } + + message Test { + required string label = 1; + optional int32 type = 2 [default=77]; + repeated int64 reps = 3; + optional group OptionalGroup = 4 { + required string RequiredField = 5; + } + oneof union { + int32 number = 6; + string name = 7; + } + } + +The resulting file, test.pb.go, is: + + package example + + import proto "github.com/golang/protobuf/proto" + import math "math" + + type FOO int32 + const ( + FOO_X FOO = 17 + ) + var FOO_name = map[int32]string{ + 17: "X", + } + var FOO_value = map[string]int32{ + "X": 17, + } + + func (x FOO) Enum() *FOO { + p := new(FOO) + *p = x + return p + } + func (x FOO) String() string { + return proto.EnumName(FOO_name, int32(x)) + } + func (x *FOO) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FOO_value, data) + if err != nil { + return err } + *x = FOO(value) + return nil + } - The resulting file, test.pb.go, is: + type Test struct { + Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` + Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` + Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` + Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + // Types that are valid to be assigned to Union: + // *Test_Number + // *Test_Name + Union isTest_Union `protobuf_oneof:"union"` + XXX_unrecognized []byte `json:"-"` + } + func (m *Test) Reset() { *m = Test{} } + func (m *Test) String() string { return proto.CompactTextString(m) } + func (*Test) ProtoMessage() {} - package example + type isTest_Union interface { + isTest_Union() + } - import "github.com/golang/protobuf/proto" + type Test_Number struct { + Number int32 `protobuf:"varint,6,opt,name=number"` + } + type Test_Name struct { + Name string `protobuf:"bytes,7,opt,name=name"` + } - type FOO int32 - const ( - FOO_X FOO = 17 - ) - var FOO_name = map[int32]string{ - 17: "X", + func (*Test_Number) isTest_Union() {} + func (*Test_Name) isTest_Union() {} + + func (m *Test) GetUnion() isTest_Union { + if m != nil { + return m.Union } - var FOO_value = map[string]int32{ - "X": 17, + return nil + } + const Default_Test_Type int32 = 77 + + func (m *Test) GetLabel() string { + if m != nil && m.Label != nil { + return *m.Label } + return "" + } - func (x FOO) Enum() *FOO { - p := new(FOO) - *p = x - return p + func (m *Test) GetType() int32 { + if m != nil && m.Type != nil { + return *m.Type } - func (x FOO) String() string { - return proto.EnumName(FOO_name, int32(x)) + return Default_Test_Type + } + + func (m *Test) GetOptionalgroup() *Test_OptionalGroup { + if m != nil { + return m.Optionalgroup } + return nil + } - type Test struct { - Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` - Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` - Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` - Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` - XXX_unrecognized []byte `json:"-"` + type Test_OptionalGroup struct { + RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` + } + func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } + func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } + + func (m *Test_OptionalGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField } - func (this *Test) Reset() { *this = Test{} } - func (this *Test) String() string { return proto.CompactTextString(this) } - const Default_Test_Type int32 = 77 + return "" + } - func (this *Test) GetLabel() string { - if this != nil && this.Label != nil { - return *this.Label - } - return "" + func (m *Test) GetNumber() int32 { + if x, ok := m.GetUnion().(*Test_Number); ok { + return x.Number } + return 0 + } - func (this *Test) GetType() int32 { - if this != nil && this.Type != nil { - return *this.Type - } - return Default_Test_Type + func (m *Test) GetName() string { + if x, ok := m.GetUnion().(*Test_Name); ok { + return x.Name } + return "" + } - func (this *Test) GetOptionalgroup() *Test_OptionalGroup { - if this != nil { - return this.Optionalgroup - } - return nil + func init() { + proto.RegisterEnum("example.FOO", FOO_name, FOO_value) + } + +To create and play with a Test object: + + package main + + import ( + "log" + + "github.com/golang/protobuf/proto" + pb "./example.pb" + ) + + func main() { + test := &pb.Test{ + Label: proto.String("hello"), + Type: proto.Int32(17), + Reps: []int64{1, 2, 3}, + Optionalgroup: &pb.Test_OptionalGroup{ + RequiredField: proto.String("good bye"), + }, + Union: &pb.Test_Name{"fred"}, } - - type Test_OptionalGroup struct { - RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` - XXX_unrecognized []byte `json:"-"` + data, err := proto.Marshal(test) + if err != nil { + log.Fatal("marshaling error: ", err) } - func (this *Test_OptionalGroup) Reset() { *this = Test_OptionalGroup{} } - func (this *Test_OptionalGroup) String() string { return proto.CompactTextString(this) } - - func (this *Test_OptionalGroup) GetRequiredField() string { - if this != nil && this.RequiredField != nil { - return *this.RequiredField - } - return "" + newTest := &pb.Test{} + err = proto.Unmarshal(data, newTest) + if err != nil { + log.Fatal("unmarshaling error: ", err) } - - func init() { - proto.RegisterEnum("example.FOO", FOO_name, FOO_value) + // Now test and newTest contain the same data. + if test.GetLabel() != newTest.GetLabel() { + log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) } - - To create and play with a Test object: - - package main - - import ( - "log" - - "github.com/golang/protobuf/proto" - "./example.pb" - ) - - func main() { - test := &example.Test{ - Label: proto.String("hello"), - Type: proto.Int32(17), - Optionalgroup: &example.Test_OptionalGroup{ - RequiredField: proto.String("good bye"), - }, - } - data, err := proto.Marshal(test) - if err != nil { - log.Fatal("marshaling error: ", err) - } - newTest := new(example.Test) - err = proto.Unmarshal(data, newTest) - if err != nil { - log.Fatal("unmarshaling error: ", err) - } - // Now test and newTest contain the same data. - if test.GetLabel() != newTest.GetLabel() { - log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) - } - // etc. + // Use a type switch to determine which oneof was set. + switch u := test.Union.(type) { + case *pb.Test_Number: // u.Number contains the number. + case *pb.Test_Name: // u.Name contains the string. } + // etc. + } */ package proto @@ -203,6 +269,7 @@ import ( "fmt" "log" "reflect" + "sort" "strconv" "sync" ) @@ -377,13 +444,13 @@ func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, // DebugPrint dumps the encoded data in b in a debugging format with a header // including the string s. Used in testing but made available for general debugging. -func (o *Buffer) DebugPrint(s string, b []byte) { +func (p *Buffer) DebugPrint(s string, b []byte) { var u uint64 - obuf := o.buf - index := o.index - o.buf = b - o.index = 0 + obuf := p.buf + index := p.index + p.buf = b + p.index = 0 depth := 0 fmt.Printf("\n--- %s ---\n", s) @@ -394,12 +461,12 @@ out: fmt.Print(" ") } - index := o.index - if index == len(o.buf) { + index := p.index + if index == len(p.buf) { break } - op, err := o.DecodeVarint() + op, err := p.DecodeVarint() if err != nil { fmt.Printf("%3d: fetching op err %v\n", index, err) break out @@ -416,7 +483,7 @@ out: case WireBytes: var r []byte - r, err = o.DecodeRawBytes(false) + r, err = p.DecodeRawBytes(false) if err != nil { break out } @@ -437,7 +504,7 @@ out: fmt.Printf("\n") case WireFixed32: - u, err = o.DecodeFixed32() + u, err = p.DecodeFixed32() if err != nil { fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) break out @@ -445,16 +512,15 @@ out: fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) case WireFixed64: - u, err = o.DecodeFixed64() + u, err = p.DecodeFixed64() if err != nil { fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) - break case WireVarint: - u, err = o.DecodeVarint() + u, err = p.DecodeVarint() if err != nil { fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) break out @@ -462,30 +528,22 @@ out: fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: - if err != nil { - fmt.Printf("%3d: t=%3d start err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- - if err != nil { - fmt.Printf("%3d: t=%3d end err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d end\n", index, tag) } } if depth != 0 { - fmt.Printf("%3d: start-end not balanced %d\n", o.index, depth) + fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) } fmt.Printf("\n") - o.buf = obuf - o.index = index + p.buf = obuf + p.index = index } // SetDefaults sets unset protocol buffer fields to their default values. @@ -599,13 +657,15 @@ func setDefaults(v reflect.Value, recur, zeros bool) { for _, ni := range dm.nested { f := v.Field(ni) - if f.IsNil() { - continue - } - // f is *T or []*T - if f.Kind() == reflect.Ptr { + // f is *T or []*T or map[T]*T + switch f.Kind() { + case reflect.Ptr: + if f.IsNil() { + continue + } setDefaults(f, recur, zeros) - } else { + + case reflect.Slice: for i := 0; i < f.Len(); i++ { e := f.Index(i) if e.IsNil() { @@ -613,6 +673,15 @@ func setDefaults(v reflect.Value, recur, zeros bool) { } setDefaults(e, recur, zeros) } + + case reflect.Map: + for _, k := range f.MapKeys() { + e := f.MapIndex(k) + if e.IsNil() { + continue + } + setDefaults(e, recur, zeros) + } } } } @@ -638,10 +707,6 @@ type scalarField struct { value interface{} // the proto-declared default value, or nil } -func ptrToStruct(t reflect.Type) bool { - return t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct -} - // t is a struct type. func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { sprop := GetProperties(t) @@ -653,99 +718,177 @@ func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { } ft := t.Field(fi).Type - // nested messages - if ptrToStruct(ft) || (ft.Kind() == reflect.Slice && ptrToStruct(ft.Elem())) { + sf, nested, err := fieldDefault(ft, prop) + switch { + case err != nil: + log.Print(err) + case nested: dm.nested = append(dm.nested, fi) - continue + case sf != nil: + sf.index = fi + dm.scalars = append(dm.scalars, *sf) } - - sf := scalarField{ - index: fi, - kind: ft.Elem().Kind(), - } - - // scalar fields without defaults - if !prop.HasDefault { - dm.scalars = append(dm.scalars, sf) - continue - } - - // a scalar field: either *T or []byte - switch ft.Elem().Kind() { - case reflect.Bool: - x, err := strconv.ParseBool(prop.Default) - if err != nil { - log.Printf("proto: bad default bool %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.Float32: - x, err := strconv.ParseFloat(prop.Default, 32) - if err != nil { - log.Printf("proto: bad default float32 %q: %v", prop.Default, err) - continue - } - sf.value = float32(x) - case reflect.Float64: - x, err := strconv.ParseFloat(prop.Default, 64) - if err != nil { - log.Printf("proto: bad default float64 %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.Int32: - x, err := strconv.ParseInt(prop.Default, 10, 32) - if err != nil { - log.Printf("proto: bad default int32 %q: %v", prop.Default, err) - continue - } - sf.value = int32(x) - case reflect.Int64: - x, err := strconv.ParseInt(prop.Default, 10, 64) - if err != nil { - log.Printf("proto: bad default int64 %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.String: - sf.value = prop.Default - case reflect.Uint8: - // []byte (not *uint8) - sf.value = []byte(prop.Default) - case reflect.Uint32: - x, err := strconv.ParseUint(prop.Default, 10, 32) - if err != nil { - log.Printf("proto: bad default uint32 %q: %v", prop.Default, err) - continue - } - sf.value = uint32(x) - case reflect.Uint64: - x, err := strconv.ParseUint(prop.Default, 10, 64) - if err != nil { - log.Printf("proto: bad default uint64 %q: %v", prop.Default, err) - continue - } - sf.value = x - default: - log.Printf("proto: unhandled def kind %v", ft.Elem().Kind()) - continue - } - - dm.scalars = append(dm.scalars, sf) } return dm } +// fieldDefault returns the scalarField for field type ft. +// sf will be nil if the field can not have a default. +// nestedMessage will be true if this is a nested message. +// Note that sf.index is not set on return. +func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { + var canHaveDefault bool + switch ft.Kind() { + case reflect.Ptr: + if ft.Elem().Kind() == reflect.Struct { + nestedMessage = true + } else { + canHaveDefault = true // proto2 scalar field + } + + case reflect.Slice: + switch ft.Elem().Kind() { + case reflect.Ptr: + nestedMessage = true // repeated message + case reflect.Uint8: + canHaveDefault = true // bytes field + } + + case reflect.Map: + if ft.Elem().Kind() == reflect.Ptr { + nestedMessage = true // map with message values + } + } + + if !canHaveDefault { + if nestedMessage { + return nil, true, nil + } + return nil, false, nil + } + + // We now know that ft is a pointer or slice. + sf = &scalarField{kind: ft.Elem().Kind()} + + // scalar fields without defaults + if !prop.HasDefault { + return sf, false, nil + } + + // a scalar field: either *T or []byte + switch ft.Elem().Kind() { + case reflect.Bool: + x, err := strconv.ParseBool(prop.Default) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Float32: + x, err := strconv.ParseFloat(prop.Default, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) + } + sf.value = float32(x) + case reflect.Float64: + x, err := strconv.ParseFloat(prop.Default, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Int32: + x, err := strconv.ParseInt(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) + } + sf.value = int32(x) + case reflect.Int64: + x, err := strconv.ParseInt(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.String: + sf.value = prop.Default + case reflect.Uint8: + // []byte (not *uint8) + sf.value = []byte(prop.Default) + case reflect.Uint32: + x, err := strconv.ParseUint(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) + } + sf.value = uint32(x) + case reflect.Uint64: + x, err := strconv.ParseUint(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) + } + sf.value = x + default: + return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) + } + + return sf, false, nil +} + // Map fields may have key types of non-float scalars, strings and enums. // The easiest way to sort them in some deterministic order is to use fmt. // If this turns out to be inefficient we can always consider other options, // such as doing a Schwartzian transform. -type mapKeys []reflect.Value +func mapKeys(vs []reflect.Value) sort.Interface { + s := mapKeySorter{ + vs: vs, + // default Less function: textual comparison + less: func(a, b reflect.Value) bool { + return fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface()) + }, + } -func (s mapKeys) Len() int { return len(s) } -func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s mapKeys) Less(i, j int) bool { - return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) + // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps; + // numeric keys are sorted numerically. + if len(vs) == 0 { + return s + } + switch vs[0].Kind() { + case reflect.Int32, reflect.Int64: + s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() } + case reflect.Uint32, reflect.Uint64: + s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() } + } + + return s } + +type mapKeySorter struct { + vs []reflect.Value + less func(a, b reflect.Value) bool +} + +func (s mapKeySorter) Len() int { return len(s.vs) } +func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] } +func (s mapKeySorter) Less(i, j int) bool { + return s.less(s.vs[i], s.vs[j]) +} + +// isProto3Zero reports whether v is a zero proto3 value. +func isProto3Zero(v reflect.Value) bool { + switch v.Kind() { + case reflect.Bool: + return !v.Bool() + case reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint32, reflect.Uint64: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.String: + return v.String() == "" + } + return false +} + +// ProtoPackageIsVersion1 is referenced from generated protocol buffer files +// to assert that that code is compatible with this version of the proto package. +const ProtoPackageIsVersion1 = true diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go index 9d912bce19b..e25e01e6374 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go @@ -44,11 +44,11 @@ import ( "sort" ) -// ErrNoMessageTypeId occurs when a protocol buffer does not have a message type ID. +// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID. // A message type ID is required for storing a protocol buffer in a message set. -var ErrNoMessageTypeId = errors.New("proto does not have a message type ID") +var errNoMessageTypeID = errors.New("proto does not have a message type ID") -// The first two types (_MessageSet_Item and MessageSet) +// The first two types (_MessageSet_Item and messageSet) // model what the protocol compiler produces for the following protocol message: // message MessageSet { // repeated group Item = 1 { @@ -58,27 +58,20 @@ var ErrNoMessageTypeId = errors.New("proto does not have a message type ID") // } // That is the MessageSet wire format. We can't use a proto to generate these // because that would introduce a circular dependency between it and this package. -// -// When a proto1 proto has a field that looks like: -// optional message info = 3; -// the protocol compiler produces a field in the generated struct that looks like: -// Info *_proto_.MessageSet `protobuf:"bytes,3,opt,name=info"` -// The package is automatically inserted so there is no need for that proto file to -// import this package. type _MessageSet_Item struct { TypeId *int32 `protobuf:"varint,2,req,name=type_id"` Message []byte `protobuf:"bytes,3,req,name=message"` } -type MessageSet struct { +type messageSet struct { Item []*_MessageSet_Item `protobuf:"group,1,rep"` XXX_unrecognized []byte // TODO: caching? } -// Make sure MessageSet is a Message. -var _ Message = (*MessageSet)(nil) +// Make sure messageSet is a Message. +var _ Message = (*messageSet)(nil) // messageTypeIder is an interface satisfied by a protocol buffer type // that may be stored in a MessageSet. @@ -86,7 +79,7 @@ type messageTypeIder interface { MessageTypeId() int32 } -func (ms *MessageSet) find(pb Message) *_MessageSet_Item { +func (ms *messageSet) find(pb Message) *_MessageSet_Item { mti, ok := pb.(messageTypeIder) if !ok { return nil @@ -100,24 +93,24 @@ func (ms *MessageSet) find(pb Message) *_MessageSet_Item { return nil } -func (ms *MessageSet) Has(pb Message) bool { +func (ms *messageSet) Has(pb Message) bool { if ms.find(pb) != nil { return true } return false } -func (ms *MessageSet) Unmarshal(pb Message) error { +func (ms *messageSet) Unmarshal(pb Message) error { if item := ms.find(pb); item != nil { return Unmarshal(item.Message, pb) } if _, ok := pb.(messageTypeIder); !ok { - return ErrNoMessageTypeId + return errNoMessageTypeID } return nil // TODO: return error instead? } -func (ms *MessageSet) Marshal(pb Message) error { +func (ms *messageSet) Marshal(pb Message) error { msg, err := Marshal(pb) if err != nil { return err @@ -130,7 +123,7 @@ func (ms *MessageSet) Marshal(pb Message) error { mti, ok := pb.(messageTypeIder) if !ok { - return ErrNoMessageTypeId + return errNoMessageTypeID } mtid := mti.MessageTypeId() @@ -141,9 +134,9 @@ func (ms *MessageSet) Marshal(pb Message) error { return nil } -func (ms *MessageSet) Reset() { *ms = MessageSet{} } -func (ms *MessageSet) String() string { return CompactTextString(ms) } -func (*MessageSet) ProtoMessage() {} +func (ms *messageSet) Reset() { *ms = messageSet{} } +func (ms *messageSet) String() string { return CompactTextString(ms) } +func (*messageSet) ProtoMessage() {} // Support for the message_set_wire_format message option. @@ -169,7 +162,7 @@ func MarshalMessageSet(m map[int32]Extension) ([]byte, error) { } sort.Ints(ids) - ms := &MessageSet{Item: make([]*_MessageSet_Item, 0, len(m))} + ms := &messageSet{Item: make([]*_MessageSet_Item, 0, len(m))} for _, id := range ids { e := m[int32(id)] // Remove the wire type and field number varint, as well as the length varint. @@ -186,7 +179,7 @@ func MarshalMessageSet(m map[int32]Extension) ([]byte, error) { // UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. // It is called by generated Unmarshal methods on protocol buffer messages with the message_set_wire_format option. func UnmarshalMessageSet(buf []byte, m map[int32]Extension) error { - ms := new(MessageSet) + ms := new(messageSet) if err := Unmarshal(buf, ms); err != nil { return err } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go index 93259a3d657..749919d250a 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go @@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build appengine,!appenginevm +// +build appengine // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can @@ -144,8 +144,8 @@ func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { return structPointer_ifield(p, f).(*map[int32]Extension) } -// Map returns the reflect.Value for the address of a map field in the struct. -func structPointer_Map(p structPointer, f field, typ reflect.Type) reflect.Value { +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { return structPointer_field(p, f).Addr() } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go index c52db1ca5ec..e9be0fe92ee 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go @@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build !appengine appenginevm +// +build !appengine // This file contains the implementation of the proto field accesses using package unsafe. @@ -130,8 +130,8 @@ func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f))) } -// Map returns the reflect.Value for the address of a map field in the struct. -func structPointer_Map(p structPointer, f field, typ reflect.Type) reflect.Value { +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f))) } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go index 730a5957973..d4531c05638 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go @@ -37,6 +37,7 @@ package proto import ( "fmt" + "log" "os" "reflect" "sort" @@ -84,6 +85,15 @@ type decoder func(p *Buffer, prop *Properties, base structPointer) error // A valueDecoder decodes a single integer in a particular encoding. type valueDecoder func(o *Buffer) (x uint64, err error) +// A oneofMarshaler does the marshaling for all oneof fields in a message. +type oneofMarshaler func(Message, *Buffer) error + +// A oneofUnmarshaler does the unmarshaling for a oneof field in a message. +type oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error) + +// A oneofSizer does the sizing for all oneof fields in a message. +type oneofSizer func(Message) int + // tagMap is an optimization over map[int]int for typical protocol buffer // use-cases. Encoded protocol buffers are often in tag order with small tag // numbers. @@ -132,6 +142,22 @@ type StructProperties struct { order []int // list of struct field numbers in tag order unrecField field // field id of the XXX_unrecognized []byte field extendable bool // is this an extendable proto + + oneofMarshaler oneofMarshaler + oneofUnmarshaler oneofUnmarshaler + oneofSizer oneofSizer + stype reflect.Type + + // OneofTypes contains information about the oneof fields in this message. + // It is keyed by the original name of a field. + OneofTypes map[string]*OneofProperties +} + +// OneofProperties represents information about a specific field in a oneof. +type OneofProperties struct { + Type reflect.Type // pointer to generated struct type for this oneof field + Field int // struct field number of the containing oneof in the message + Prop *Properties } // Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. @@ -156,6 +182,7 @@ type Properties struct { Packed bool // relevant for repeated primitives only Enum string // set for enum types only proto3 bool // whether this is known to be a proto3 field; set for []byte only + oneof bool // whether this is a oneof field Default string // default value HasDefault bool // whether an explicit default was provided @@ -208,6 +235,9 @@ func (p *Properties) String() string { if p.proto3 { s += ",proto3" } + if p.oneof { + s += ",oneof" + } if len(p.Enum) > 0 { s += ",enum=" + p.Enum } @@ -284,6 +314,8 @@ func (p *Properties) Parse(s string) { p.Enum = f[5:] case f == "proto3": p.proto3 = true + case f == "oneof": + p.oneof = true case strings.HasPrefix(f, "def="): p.HasDefault = true p.Default = f[4:] // rest of string @@ -440,7 +472,12 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock p.enc = (*Buffer).enc_slice_byte p.dec = (*Buffer).dec_slice_byte p.size = size_slice_byte - if p.proto3 { + // This is a []byte, which is either a bytes field, + // or the value of a map field. In the latter case, + // we always encode an empty []byte, so we should not + // use the proto3 enc/size funcs. + // f == nil iff this is the key/value of a map field. + if p.proto3 && f != nil { p.enc = (*Buffer).enc_proto3_slice_byte p.size = size_proto3_slice_byte } @@ -595,7 +632,7 @@ func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructF } var ( - mutex sync.Mutex + propertiesMu sync.RWMutex propertiesMap = make(map[reflect.Type]*StructProperties) ) @@ -605,13 +642,26 @@ func GetProperties(t reflect.Type) *StructProperties { if t.Kind() != reflect.Struct { panic("proto: type must have kind struct") } - mutex.Lock() - sprop := getPropertiesLocked(t) - mutex.Unlock() + + // Most calls to GetProperties in a long-running program will be + // retrieving details for types we have seen before. + propertiesMu.RLock() + sprop, ok := propertiesMap[t] + propertiesMu.RUnlock() + if ok { + if collectStats { + stats.Chit++ + } + return sprop + } + + propertiesMu.Lock() + sprop = getPropertiesLocked(t) + propertiesMu.Unlock() return sprop } -// getPropertiesLocked requires that mutex is held. +// getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { if collectStats { @@ -647,6 +697,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { if f.Name == "XXX_unrecognized" { // special case prop.unrecField = toField(&f) } + oneof := f.Tag.Get("protobuf_oneof") != "" // special case prop.Prop[i] = p prop.order[i] = i if debug { @@ -656,7 +707,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { } print("\n") } - if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") { + if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") && !oneof { fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]") } } @@ -664,6 +715,41 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) + type oneofMessage interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + } + if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { + var oots []interface{} + prop.oneofMarshaler, prop.oneofUnmarshaler, prop.oneofSizer, oots = om.XXX_OneofFuncs() + prop.stype = t + + // Interpret oneof metadata. + prop.OneofTypes = make(map[string]*OneofProperties) + for _, oot := range oots { + oop := &OneofProperties{ + Type: reflect.ValueOf(oot).Type(), // *T + Prop: new(Properties), + } + sft := oop.Type.Elem().Field(0) + oop.Prop.Name = sft.Name + oop.Prop.Parse(sft.Tag.Get("protobuf")) + // There will be exactly one interface field that + // this new value is assignable to. + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if f.Type.Kind() != reflect.Interface { + continue + } + if !oop.Type.AssignableTo(f.Type) { + continue + } + oop.Field = i + break + } + prop.OneofTypes[oop.Prop.OrigName] = oop + } + } + // build required counts // build tags reqCount := 0 @@ -722,3 +808,35 @@ func RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[ } enumValueMaps[typeName] = valueMap } + +// EnumValueMap returns the mapping from names to integers of the +// enum type enumType, or a nil if not found. +func EnumValueMap(enumType string) map[string]int32 { + return enumValueMaps[enumType] +} + +// A registry of all linked message types. +// The string is a fully-qualified proto name ("pkg.Message"). +var ( + protoTypes = make(map[string]reflect.Type) + revProtoTypes = make(map[reflect.Type]string) +) + +// RegisterType is called from generated code and maps from the fully qualified +// proto name to the type (pointer to struct) of the protocol buffer. +func RegisterType(x Message, name string) { + if _, ok := protoTypes[name]; ok { + // TODO: Some day, make this a panic. + log.Printf("proto: duplicate proto type registered: %s", name) + return + } + t := reflect.TypeOf(x) + protoTypes[name] = t + revProtoTypes[t] = name +} + +// MessageName returns the fully-qualified proto name for the given message type. +func MessageName(x Message) string { return revProtoTypes[reflect.TypeOf(x)] } + +// MessageType returns the message type (pointer to struct) for a named message. +func MessageType(name string) reflect.Type { return protoTypes[name] } diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/Makefile deleted file mode 100644 index 75144b582e6..00000000000 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# Go support for Protocol Buffers - Google's data interchange format -# -# Copyright 2014 The Go Authors. All rights reserved. -# https://github.com/golang/protobuf -# -# 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. - - -include ../../Make.protobuf - -all: regenerate - -regenerate: - rm -f proto3.pb.go - make proto3.pb.go - -# The following rules are just aids to development. Not needed for typical testing. - -diff: regenerate - git diff proto3.pb.go diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go new file mode 100644 index 00000000000..37c77820921 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go @@ -0,0 +1,122 @@ +// Code generated by protoc-gen-go. +// source: proto3_proto/proto3.proto +// DO NOT EDIT! + +/* +Package proto3_proto is a generated protocol buffer package. + +It is generated from these files: + proto3_proto/proto3.proto + +It has these top-level messages: + Message + Nested + MessageWithMap +*/ +package proto3_proto + +import proto "github.com/golang/protobuf/proto" +import testdata "github.com/golang/protobuf/proto/testdata" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal + +type Message_Humour int32 + +const ( + Message_UNKNOWN Message_Humour = 0 + Message_PUNS Message_Humour = 1 + Message_SLAPSTICK Message_Humour = 2 + Message_BILL_BAILEY Message_Humour = 3 +) + +var Message_Humour_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PUNS", + 2: "SLAPSTICK", + 3: "BILL_BAILEY", +} +var Message_Humour_value = map[string]int32{ + "UNKNOWN": 0, + "PUNS": 1, + "SLAPSTICK": 2, + "BILL_BAILEY": 3, +} + +func (x Message_Humour) String() string { + return proto.EnumName(Message_Humour_name, int32(x)) +} + +type Message struct { + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` + HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm" json:"height_in_cm,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + ResultCount int64 `protobuf:"varint,7,opt,name=result_count" json:"result_count,omitempty"` + TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman" json:"true_scotsman,omitempty"` + Score float32 `protobuf:"fixed32,9,opt,name=score" json:"score,omitempty"` + Key []uint64 `protobuf:"varint,5,rep,name=key" json:"key,omitempty"` + Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"` + Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Proto2Field *testdata.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field" json:"proto2_field,omitempty"` + Proto2Value map[string]*testdata.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} + +func (m *Message) GetNested() *Nested { + if m != nil { + return m.Nested + } + return nil +} + +func (m *Message) GetTerrain() map[string]*Nested { + if m != nil { + return m.Terrain + } + return nil +} + +func (m *Message) GetProto2Field() *testdata.SubDefaults { + if m != nil { + return m.Proto2Field + } + return nil +} + +func (m *Message) GetProto2Value() map[string]*testdata.SubDefaults { + if m != nil { + return m.Proto2Value + } + return nil +} + +type Nested struct { + Bunny string `protobuf:"bytes,1,opt,name=bunny" json:"bunny,omitempty"` +} + +func (m *Nested) Reset() { *m = Nested{} } +func (m *Nested) String() string { return proto.CompactTextString(m) } +func (*Nested) ProtoMessage() {} + +type MessageWithMap struct { + ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } +func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } +func (*MessageWithMap) ProtoMessage() {} + +func (m *MessageWithMap) GetByteMapping() map[bool][]byte { + if m != nil { + return m.ByteMapping + } + return nil +} + +func init() { + proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto index 3e327ded1d2..e2311d9294d 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto @@ -31,6 +31,8 @@ syntax = "proto3"; +import "testdata/test.proto"; + package proto3_proto; message Message { @@ -51,8 +53,16 @@ message Message { repeated uint64 key = 5; Nested nested = 6; + + map terrain = 10; + testdata.SubDefaults proto2_field = 11; + map proto2_value = 13; } message Nested { string bunny = 1; } + +message MessageWithMap { + map byte_mapping = 1; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go index 720eac47050..2336b144c12 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go @@ -37,11 +37,11 @@ import ( "bufio" "bytes" "encoding" + "errors" "fmt" "io" "log" "math" - "os" "reflect" "sort" "strings" @@ -170,20 +170,12 @@ func writeName(w *textWriter, props *Properties) error { return nil } -var ( - messageSetType = reflect.TypeOf((*MessageSet)(nil)).Elem() -) - // raw is the interface satisfied by RawMessage. type raw interface { Bytes() []byte } func writeStruct(w *textWriter, sv reflect.Value) error { - if sv.Type() == messageSetType { - return writeMessageSet(w, sv.Addr().Interface().(*MessageSet)) - } - st := sv.Type() sprops := GetProperties(st) for i := 0; i < sv.NumField(); i++ { @@ -246,7 +238,7 @@ func writeStruct(w *textWriter, sv reflect.Value) error { } if fv.Kind() == reflect.Map { // Map fields are rendered as a repeated struct with key/value fields. - keys := fv.MapKeys() // TODO: should we sort these for deterministic output? + keys := fv.MapKeys() sort.Sort(mapKeys(keys)) for _, key := range keys { val := fv.MapIndex(key) @@ -283,20 +275,23 @@ func writeStruct(w *textWriter, sv reflect.Value) error { if err := w.WriteByte('\n'); err != nil { return err } - // value - if _, err := w.WriteString("value:"); err != nil { - return err - } - if !w.compact { - if err := w.WriteByte(' '); err != nil { + // nil values aren't legal, but we can avoid panicking because of them. + if val.Kind() != reflect.Ptr || !val.IsNil() { + // value + if _, err := w.WriteString("value:"); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, val, props.mvalprop); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { return err } - } - if err := writeAny(w, val, props.mvalprop); err != nil { - return err - } - if err := w.WriteByte('\n'); err != nil { - return err } // close struct w.unindent() @@ -315,26 +310,34 @@ func writeStruct(w *textWriter, sv reflect.Value) error { } if fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice { // proto3 non-repeated scalar field; skip if zero value - switch fv.Kind() { - case reflect.Bool: - if !fv.Bool() { + if isProto3Zero(fv) { + continue + } + } + + if fv.Kind() == reflect.Interface { + // Check if it is a oneof. + if st.Field(i).Tag.Get("protobuf_oneof") != "" { + // fv is nil, or holds a pointer to generated struct. + // That generated struct has exactly one field, + // which has a protobuf struct tag. + if fv.IsNil() { continue } - case reflect.Int32, reflect.Int64: - if fv.Int() == 0 { - continue - } - case reflect.Uint32, reflect.Uint64: - if fv.Uint() == 0 { - continue - } - case reflect.Float32, reflect.Float64: - if fv.Float() == 0 { - continue - } - case reflect.String: - if fv.String() == "" { - continue + inner := fv.Elem().Elem() // interface -> *T -> T + tag := inner.Type().Field(0).Tag.Get("protobuf") + props = new(Properties) // Overwrite the outer props var, but not its pointee. + props.Parse(tag) + // Write the value in the oneof, not the oneof itself. + fv = inner.Field(0) + + // Special case to cope with malformed messages gracefully: + // If the value in the oneof is a nil pointer, don't panic + // in writeAny. + if fv.Kind() == reflect.Ptr && fv.IsNil() { + // Use errors.New so writeAny won't render quotes. + msg := errors.New("/* nil */") + fv = reflect.ValueOf(&msg).Elem() } } } @@ -514,44 +517,6 @@ func writeString(w *textWriter, s string) error { return w.WriteByte('"') } -func writeMessageSet(w *textWriter, ms *MessageSet) error { - for _, item := range ms.Item { - id := *item.TypeId - if msd, ok := messageSetMap[id]; ok { - // Known message set type. - if _, err := fmt.Fprintf(w, "[%s]: <\n", msd.name); err != nil { - return err - } - w.indent() - - pb := reflect.New(msd.t.Elem()) - if err := Unmarshal(item.Message, pb.Interface().(Message)); err != nil { - if _, err := fmt.Fprintf(w, "/* bad message: %v */\n", err); err != nil { - return err - } - } else { - if err := writeStruct(w, pb.Elem()); err != nil { - return err - } - } - } else { - // Unknown type. - if _, err := fmt.Fprintf(w, "[%d]: <\n", id); err != nil { - return err - } - w.indent() - if err := writeUnknownStruct(w, item.Message); err != nil { - return err - } - } - w.unindent() - if _, err := w.Write(gtNewline); err != nil { - return err - } - } - return nil -} - func writeUnknownStruct(w *textWriter, data []byte) (err error) { if !w.compact { if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil { @@ -666,10 +631,7 @@ func writeExtensions(w *textWriter, pv reflect.Value) error { pb, err := GetExtension(ep, desc) if err != nil { - if _, err := fmt.Fprintln(os.Stderr, "proto: failed getting extension: ", err); err != nil { - return err - } - continue + return fmt.Errorf("failed getting extension: %v", err) } // Repeated extensions will appear as a slice. diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go index ddd9579cdf4..451323262cf 100644 --- a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go @@ -119,6 +119,14 @@ func isWhitespace(c byte) bool { return false } +func isQuote(c byte) bool { + switch c { + case '"', '\'': + return true + } + return false +} + func (p *textParser) skipWhitespace() { i := 0 for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { @@ -174,7 +182,7 @@ func (p *textParser) advance() { } unq, err := unquoteC(p.s[1:i], rune(p.s[0])) if err != nil { - p.errorf("invalid quoted string %v", p.s[0:i+1]) + p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) return } p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] @@ -333,13 +341,13 @@ func (p *textParser) next() *token { p.advance() if p.done { p.cur.value = "" - } else if len(p.cur.value) > 0 && p.cur.value[0] == '"' { + } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) { // Look for multiple quoted strings separated by whitespace, // and concatenate them. cat := p.cur for { p.skipWhitespace() - if p.done || p.s[0] != '"' { + if p.done || !isQuote(p.s[0]) { break } p.advance() @@ -385,8 +393,7 @@ func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSet } // Returns the index in the struct for the named field, as well as the parsed tag properties. -func structFieldByName(st reflect.Type, name string) (int, *Properties, bool) { - sprops := GetProperties(st) +func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) { i, ok := sprops.decoderOrigNames[name] if ok { return i, sprops.Prop[i], true @@ -438,7 +445,8 @@ func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseEr func (p *textParser) readStruct(sv reflect.Value, terminator string) error { st := sv.Type() - reqCount := GetProperties(st).reqCount + sprops := GetProperties(st) + reqCount := sprops.reqCount var reqFieldErr error fieldSet := make(map[string]bool) // A struct is a sequence of "name: value", terminated by one of @@ -520,99 +528,113 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error { sl = reflect.Append(sl, ext) SetExtension(ep, desc, sl.Interface()) } - } else { - // This is a normal, non-extension field. - name := tok.value - fi, props, ok := structFieldByName(st, name) - if !ok { - return p.errorf("unknown field name %q in %v", name, st) + if err := p.consumeOptionalSeparator(); err != nil { + return err } + continue + } - dst := sv.Field(fi) + // This is a normal, non-extension field. + name := tok.value + var dst reflect.Value + fi, props, ok := structFieldByName(sprops, name) + if ok { + dst = sv.Field(fi) + } else if oop, ok := sprops.OneofTypes[name]; ok { + // It is a oneof. + props = oop.Prop + nv := reflect.New(oop.Type.Elem()) + dst = nv.Elem().Field(0) + sv.Field(oop.Field).Set(nv) + } + if !dst.IsValid() { + return p.errorf("unknown field name %q in %v", name, st) + } - if dst.Kind() == reflect.Map { - // Consume any colon. - if err := p.checkForColon(props, dst.Type()); err != nil { - return err - } - - // Construct the map if it doesn't already exist. - if dst.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) - } - key := reflect.New(dst.Type().Key()).Elem() - val := reflect.New(dst.Type().Elem()).Elem() - - // The map entry should be this sequence of tokens: - // < key : KEY value : VALUE > - // Technically the "key" and "value" could come in any order, - // but in practice they won't. - - tok := p.next() - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return p.errorf("expected '{' or '<', found %q", tok.value) - } - if err := p.consumeToken("key"); err != nil { - return err - } - if err := p.consumeToken(":"); err != nil { - return err - } - if err := p.readAny(key, props.mkeyprop); err != nil { - return err - } - if err := p.consumeToken("value"); err != nil { - return err - } - if err := p.consumeToken(":"); err != nil { - return err - } - if err := p.readAny(val, props.mvalprop); err != nil { - return err - } - if err := p.consumeToken(terminator); err != nil { - return err - } - - dst.SetMapIndex(key, val) - continue - } - - // Check that it's not already set if it's not a repeated field. - if !props.Repeated && fieldSet[name] { - return p.errorf("non-repeated field %q was repeated", name) - } - - if err := p.checkForColon(props, st.Field(fi).Type); err != nil { + if dst.Kind() == reflect.Map { + // Consume any colon. + if err := p.checkForColon(props, dst.Type()); err != nil { return err } - // Parse into the field. - fieldSet[name] = true - if err := p.readAny(dst, props); err != nil { - if _, ok := err.(*RequiredNotSetError); !ok { - return err - } - reqFieldErr = err - } else if props.Required { - reqCount-- + // Construct the map if it doesn't already exist. + if dst.IsNil() { + dst.Set(reflect.MakeMap(dst.Type())) } + key := reflect.New(dst.Type().Key()).Elem() + val := reflect.New(dst.Type().Elem()).Elem() + + // The map entry should be this sequence of tokens: + // < key : KEY value : VALUE > + // Technically the "key" and "value" could come in any order, + // but in practice they won't. + + tok := p.next() + var terminator string + switch tok.value { + case "<": + terminator = ">" + case "{": + terminator = "}" + default: + return p.errorf("expected '{' or '<', found %q", tok.value) + } + if err := p.consumeToken("key"); err != nil { + return err + } + if err := p.consumeToken(":"); err != nil { + return err + } + if err := p.readAny(key, props.mkeyprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken("value"); err != nil { + return err + } + if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil { + return err + } + if err := p.readAny(val, props.mvalprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken(terminator); err != nil { + return err + } + + dst.SetMapIndex(key, val) + continue } - // For backward compatibility, permit a semicolon or comma after a field. - tok = p.next() - if tok.err != nil { - return tok.err + // Check that it's not already set if it's not a repeated field. + if !props.Repeated && fieldSet[name] { + return p.errorf("non-repeated field %q was repeated", name) } - if tok.value != ";" && tok.value != "," { - p.back() + + if err := p.checkForColon(props, dst.Type()); err != nil { + return err } + + // Parse into the field. + fieldSet[name] = true + if err := p.readAny(dst, props); err != nil { + if _, ok := err.(*RequiredNotSetError); !ok { + return err + } + reqFieldErr = err + } else if props.Required { + reqCount-- + } + + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + } if reqCount > 0 { @@ -621,6 +643,19 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error { return reqFieldErr } +// consumeOptionalSeparator consumes an optional semicolon or comma. +// It is used in readStruct to provide backward compatibility. +func (p *textParser) consumeOptionalSeparator() error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != ";" && tok.value != "," { + p.back() + } + return nil +} + func (p *textParser) readAny(v reflect.Value, props *Properties) error { tok := p.next() if tok.err != nil { @@ -645,18 +680,32 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error { fv.Set(reflect.ValueOf(bytes)) return nil } - // Repeated field. May already exist. - flen := fv.Len() - if flen == fv.Cap() { - nav := reflect.MakeSlice(at, flen, 2*flen+1) - reflect.Copy(nav, fv) - fv.Set(nav) + // Repeated field. + if tok.value == "[" { + // Repeated field with list notation, like [1,2,3]. + for { + fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) + err := p.readAny(fv.Index(fv.Len()-1), props) + if err != nil { + return err + } + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value == "]" { + break + } + if tok.value != "," { + return p.errorf("Expected ']' or ',' found %q", tok.value) + } + } + return nil } - fv.SetLen(flen + 1) - - // Read one. + // One value of the repeated field. p.back() - return p.readAny(fv.Index(flen), props) + fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) + return p.readAny(fv.Index(fv.Len()-1), props) case reflect.Bool: // Either "true", "false", 1 or 0. switch tok.value { diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/api/versions.go b/Godeps/_workspace/src/github.com/google/cadvisor/api/versions.go index b567861e137..a4b39cdadab 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/api/versions.go +++ b/Godeps/_workspace/src/github.com/google/cadvisor/api/versions.go @@ -467,7 +467,7 @@ func (self *version2_1) Version() string { } func (self *version2_1) SupportedRequestTypes() []string { - return self.baseVersion.SupportedRequestTypes() + return append([]string{machineStatsApi}, self.baseVersion.SupportedRequestTypes()...) } func (self *version2_1) HandleRequest(requestType string, request []string, m manager.Manager, w http.ResponseWriter, r *http.Request) error { @@ -492,9 +492,16 @@ func (self *version2_1) HandleRequest(requestType string, request []string, m ma if err != nil { return err } - contStats := make(map[string][]*v2.ContainerStats, len(conts)) + contStats := make(map[string]v2.ContainerInfo, len(conts)) for name, cont := range conts { - contStats[name] = v2.ContainerStatsFromV1(&cont.Spec, cont.Stats) + if name == "/" { + // Root cgroup stats should be exposed as machine stats + continue + } + contStats[name] = v2.ContainerInfo{ + Spec: v2.ContainerSpecFromV1(&cont.Spec, cont.Aliases, cont.Namespace), + Stats: v2.ContainerStatsFromV1(&cont.Spec, cont.Stats), + } } return writeResult(contStats, w) default: diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/factory.go b/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/factory.go index de73365dd1f..1518d0e3eac 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/factory.go +++ b/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/factory.go @@ -40,6 +40,7 @@ var ArgDockerEndpoint = flag.String("docker", "unix:///var/run/docker.sock", "do var DockerNamespace = "docker" // Basepath to all container specific information that libcontainer stores. +// TODO: Deprecate this flag var dockerRootDir = flag.String("docker_root", "/var/lib/docker", "Absolute path to the Docker state root directory (default: /var/lib/docker)") var dockerRunDir = flag.String("docker_run", "/var/run/docker", "Absolute path to the Docker run directory (default: /var/run/docker)") @@ -61,6 +62,10 @@ func DockerStateDir() string { var useSystemd = false var check = sync.Once{} +const ( + dockerRootDirKey = "Root Dir" +) + func UseSystemd() bool { check.Do(func() { if *noSystemd { @@ -101,6 +106,7 @@ type dockerFactory struct { machineInfoFactory info.MachineInfoFactory storageDriver storageDriver + storageDir string client *docker.Client @@ -109,6 +115,8 @@ type dockerFactory struct { // Information about mounted filesystems. fsInfo fs.FsInfo + + dockerVersion []int } func (self *dockerFactory) String() string { @@ -129,9 +137,11 @@ func (self *dockerFactory) NewContainerHandler(name string, inHostNamespace bool self.machineInfoFactory, self.fsInfo, self.storageDriver, + self.storageDir, &self.cgroupSubsystems, inHostNamespace, metadataEnvs, + self.dockerVersion, ) return } @@ -214,36 +224,45 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo) error { if err != nil { return fmt.Errorf("unable to communicate with docker daemon: %v", err) } + var dockerVersion []int if version, err := client.Version(); err != nil { return fmt.Errorf("unable to communicate with docker daemon: %v", err) } else { expected_version := []int{1, 0, 0} version_string := version.Get("Version") - version, err := parseDockerVersion(version_string) + dockerVersion, err = parseDockerVersion(version_string) if err != nil { return fmt.Errorf("couldn't parse docker version: %v", err) } - for index, number := range version { + for index, number := range dockerVersion { if number > expected_version[index] { break } else if number < expected_version[index] { - return fmt.Errorf("cAdvisor requires docker version %v or above but we have found version %v reported as \"%v\"", expected_version, version, version_string) + return fmt.Errorf("cAdvisor requires docker version %v or above but we have found version %v reported as \"%v\"", expected_version, dockerVersion, version_string) } } } - // Check that the libcontainer execdriver is used. - information, err := DockerInfo() + information, err := client.Info() if err != nil { return fmt.Errorf("failed to detect Docker info: %v", err) } - execDriver, ok := information["ExecutionDriver"] - if !ok || !strings.HasPrefix(execDriver, "native") { + + // Check that the libcontainer execdriver is used. + execDriver := information.Get("ExecutionDriver") + if !strings.HasPrefix(execDriver, "native") { return fmt.Errorf("docker found, but not using native exec driver") } - sd, _ := information["Driver"] + sd := information.Get("Driver") + if sd == "" { + return fmt.Errorf("failed to find docker storage driver") + } + storageDir := information.Get("DockerRootDir") + if storageDir == "" { + storageDir = *dockerRootDir + } cgroupSubsystems, err := libcontainer.GetCgroupSubsystems() if err != nil { return fmt.Errorf("failed to get cgroup subsystems: %v", err) @@ -251,11 +270,13 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo) error { glog.Infof("Registering Docker factory") f := &dockerFactory{ - machineInfoFactory: factory, - client: client, - storageDriver: storageDriver(sd), cgroupSubsystems: cgroupSubsystems, + client: client, + dockerVersion: dockerVersion, fsInfo: fsInfo, + machineInfoFactory: factory, + storageDriver: storageDriver(sd), + storageDir: storageDir, } container.RegisterContainerHandlerFactory(f) return nil diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/handler.go b/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/handler.go index 9222d8df46a..36c4907897a 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/handler.go +++ b/Godeps/_workspace/src/github.com/google/cadvisor/container/docker/handler.go @@ -17,6 +17,7 @@ package docker import ( "fmt" + "io/ioutil" "math" "path" "strings" @@ -35,14 +36,10 @@ import ( ) const ( - // Path to aufs dir where all the files exist. - // aufs/layers is ignored here since it does not hold a lot of data. - // aufs/mnt contains the mount points used to compose the rootfs. Hence it is also ignored. - pathToAufsDir = "aufs/diff" + // The read write layers exist here. + aufsRWLayer = "diff" // Path to the directory where docker stores log files if the json logging driver is enabled. pathToContainersDir = "containers" - // Path to the overlayfs storage driver directory. - pathToOverlayDir = "overlay" ) type dockerContainerHandler struct { @@ -86,15 +83,34 @@ type dockerContainerHandler struct { fsHandler fsHandler } +func getRwLayerID(containerID, storageDir string, sd storageDriver, dockerVersion []int) (string, error) { + const ( + // Docker version >=1.10.0 have a randomized ID for the root fs of a container. + randomizedRWLayerMinorVersion = 10 + rwLayerIDFile = "mount-id" + ) + if (dockerVersion[0] <= 1) && (dockerVersion[1] < randomizedRWLayerMinorVersion) { + return containerID, nil + } + + bytes, err := ioutil.ReadFile(path.Join(storageDir, "image", string(sd), "layerdb", "mounts", containerID, rwLayerIDFile)) + if err != nil { + return "", fmt.Errorf("failed to identify the read-write layer ID for container %q. - %v", containerID, err) + } + return string(bytes), err +} + func newDockerContainerHandler( client *docker.Client, name string, machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo, storageDriver storageDriver, + storageDir string, cgroupSubsystems *containerlibcontainer.CgroupSubsystems, inHostNamespace bool, metadataEnvs []string, + dockerVersion []int, ) (container.ContainerHandler, error) { // Create the cgroup paths. cgroupPaths := make(map[string]string, len(cgroupSubsystems.MountPoints)) @@ -118,13 +134,18 @@ func newDockerContainerHandler( id := ContainerNameToDockerId(name) // Add the Containers dir where the log files are stored. - otherStorageDir := path.Join(*dockerRootDir, pathToContainersDir, id) + otherStorageDir := path.Join(storageDir, pathToContainersDir, id) + + rwLayerID, err := getRwLayerID(id, storageDir, storageDriver, dockerVersion) + if err != nil { + return nil, err + } var rootfsStorageDir string switch storageDriver { case aufsStorageDriver: - rootfsStorageDir = path.Join(*dockerRootDir, pathToAufsDir, id) + rootfsStorageDir = path.Join(storageDir, string(aufsStorageDriver), aufsRWLayer, rwLayerID) case overlayStorageDriver: - rootfsStorageDir = path.Join(*dockerRootDir, pathToOverlayDir, id) + rootfsStorageDir = path.Join(storageDir, string(overlayStorageDriver), rwLayerID) } handler := &dockerContainerHandler{ @@ -180,9 +201,11 @@ func (self *dockerContainerHandler) Cleanup() { func (self *dockerContainerHandler) ContainerReference() (info.ContainerReference, error) { return info.ContainerReference{ + Id: self.id, Name: self.name, Aliases: self.aliases, Namespace: DockerNamespace, + Labels: self.labels, }, nil } diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go b/Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go index 6b7f40de1fc..bb4fc322e23 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go +++ b/Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go @@ -70,6 +70,9 @@ type ContainerSpec struct { // Container reference contains enough information to uniquely identify a container type ContainerReference struct { + // The container id + Id string `json:"id,omitempty"` + // The absolute name of the container. This is unique on the machine. Name string `json:"name"` @@ -80,6 +83,8 @@ type ContainerReference struct { // Namespace under which the aliases of a container are unique. // An example of a namespace is "docker" for Docker containers. Namespace string `json:"namespace,omitempty"` + + Labels map[string]string `json:"labels,omitempty"` } // Sorts by container name. diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/info/v2/conversion.go b/Godeps/_workspace/src/github.com/google/cadvisor/info/v2/conversion.go index fe241733158..56aef777caf 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/info/v2/conversion.go +++ b/Godeps/_workspace/src/github.com/google/cadvisor/info/v2/conversion.go @@ -123,7 +123,7 @@ func ContainerStatsFromV1(spec *v1.ContainerSpec, stats []*v1.ContainerStats) [] } } else if len(val.Filesystem) > 1 { // Cannot handle multiple devices per container. - glog.Errorf("failed to handle multiple devices for container. Skipping Filesystem stats") + glog.V(2).Infof("failed to handle multiple devices for container. Skipping Filesystem stats") } } if spec.HasDiskIo { diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/storage/kafka/kafka.go b/Godeps/_workspace/src/github.com/google/cadvisor/storage/kafka/kafka.go new file mode 100644 index 00000000000..e43a374c81d --- /dev/null +++ b/Godeps/_workspace/src/github.com/google/cadvisor/storage/kafka/kafka.go @@ -0,0 +1,114 @@ +// Copyright 2016 Google Inc. 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. + +package kafka + +import ( + "encoding/json" + "flag" + "os" + "strings" + "time" + + info "github.com/google/cadvisor/info/v1" + "github.com/google/cadvisor/storage" + "github.com/google/cadvisor/utils/container" + + kafka "github.com/Shopify/sarama" + "github.com/golang/glog" +) + +func init() { + storage.RegisterStorageDriver("kafka", new) +} + +var ( + brokers = flag.String("storage_driver_kafka_broker_list", "localhost:9092", "kafka broker(s) csv") + topic = flag.String("storage_driver_kafka_topic", "stats", "kafka topic") +) + +type kafkaStorage struct { + producer kafka.AsyncProducer + topic string + machineName string +} + +type detailSpec struct { + Timestamp time.Time `json:"timestamp"` + MachineName string `json:"machine_name,omitempty"` + ContainerName string `json:"container_Name,omitempty"` + ContainerID string `json:"container_Id,omitempty"` + ContainerLabels map[string]string `json:"container_labels,omitempty"` + ContainerStats *info.ContainerStats `json:"container_stats,omitempty"` +} + +func (driver *kafkaStorage) infoToDetailSpec(ref info.ContainerReference, stats *info.ContainerStats) *detailSpec { + timestamp := time.Now() + containerID := ref.Id + containerLabels := ref.Labels + containerName := container.GetPreferredName(ref) + + detail := &detailSpec{ + Timestamp: timestamp, + MachineName: driver.machineName, + ContainerName: containerName, + ContainerID: containerID, + ContainerLabels: containerLabels, + ContainerStats: stats, + } + return detail +} + +func (driver *kafkaStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { + detail := driver.infoToDetailSpec(ref, stats) + b, err := json.Marshal(detail) + + driver.producer.Input() <- &kafka.ProducerMessage{ + Topic: driver.topic, + Value: kafka.StringEncoder(b), + } + + return err +} + +func (self *kafkaStorage) Close() error { + return self.producer.Close() +} + +func new() (storage.StorageDriver, error) { + machineName, err := os.Hostname() + if err != nil { + return nil, err + } + return newStorage(machineName) +} + +func newStorage(machineName string) (storage.StorageDriver, error) { + config := kafka.NewConfig() + config.Producer.RequiredAcks = kafka.WaitForAll + + brokerList := strings.Split(*brokers, ",") + glog.V(4).Infof("Kafka brokers:%q", brokers) + + producer, err := kafka.NewAsyncProducer(brokerList, config) + if err != nil { + return nil, err + } + ret := &kafkaStorage{ + producer: producer, + topic: *topic, + machineName: machineName, + } + return ret, nil +} diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/utils/container/container.go b/Godeps/_workspace/src/github.com/google/cadvisor/utils/container/container.go new file mode 100644 index 00000000000..ea956a5c6e9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/google/cadvisor/utils/container/container.go @@ -0,0 +1,31 @@ +// Copyright 2016 Google Inc. 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. + +package container + +import ( + info "github.com/google/cadvisor/info/v1" +) + +// Returns the alias a container is known by within a certain namespace, +// if available. Otherwise returns the absolute name of the container. +func GetPreferredName(ref info.ContainerReference) string { + var containerName string + if len(ref.Aliases) > 0 { + containerName = ref.Aliases[0] + } else { + containerName = ref.Name + } + return containerName +} diff --git a/Godeps/_workspace/src/github.com/google/cadvisor/version/VERSION b/Godeps/_workspace/src/github.com/google/cadvisor/version/VERSION index 58d8f8d4a98..b9f8e558df4 100644 --- a/Godeps/_workspace/src/github.com/google/cadvisor/version/VERSION +++ b/Godeps/_workspace/src/github.com/google/cadvisor/version/VERSION @@ -1 +1 @@ -0.20.5 \ No newline at end of file +0.21.1 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml b/Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml index 44018acc059..f0e67b84abe 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml @@ -2,13 +2,14 @@ language: go go: - 1.3 - 1.4 + - 1.5 - tip install: - - go get -v ./... + - go get -v -t ./... - go get golang.org/x/tools/cmd/cover - go get github.com/onsi/gomega - go install github.com/onsi/ginkgo/ginkgo - export PATH=$PATH:$HOME/gopath/bin -script: $HOME/gopath/bin/ginkgo -r --randomizeAllSpecs --failOnPending --randomizeSuites --race +script: $HOME/gopath/bin/ginkgo -r --randomizeAllSpecs --randomizeSuites --race --trace diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md b/Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md index ccba8abe7cc..438c8c1ec46 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md @@ -3,6 +3,7 @@ Improvements: - `Skip(message)` can be used to skip the current test. +- Added `extensions/table` - a Ginkgo DSL for [Table Driven Tests](http://onsi.github.io/ginkgo/#table-driven-tests) Bug Fixes: diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/config/config.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/config/config.go index 46ce16aa68d..7b22e34ad97 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/config/config.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/config/config.go @@ -79,7 +79,7 @@ func Flags(flagSet *flag.FlagSet, prefix string, includeParallelFlags bool) { } flagSet.BoolVar(&(DefaultReporterConfig.NoColor), prefix+"noColor", false, "If set, suppress color output in default reporter.") - flagSet.Float64Var(&(DefaultReporterConfig.SlowSpecThreshold), prefix+"slowSpecThreshold", 5.0, "(in seconds) Specs that take longer to run than this threshold are flagged as slow by the default reporter (default: 5 seconds).") + flagSet.Float64Var(&(DefaultReporterConfig.SlowSpecThreshold), prefix+"slowSpecThreshold", 5.0, "(in seconds) Specs that take longer to run than this threshold are flagged as slow by the default reporter.") flagSet.BoolVar(&(DefaultReporterConfig.NoisyPendings), prefix+"noisyPendings", true, "If set, default reporter will shout about pending tests.") flagSet.BoolVar(&(DefaultReporterConfig.Verbose), prefix+"v", false, "If set, default reporter print out all specs as they begin.") flagSet.BoolVar(&(DefaultReporterConfig.Succinct), prefix+"succinct", false, "If set, default reporter prints out a very succinct report") diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table.go new file mode 100644 index 00000000000..ae8ab7d248f --- /dev/null +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table.go @@ -0,0 +1,98 @@ +/* + +Table provides a simple DSL for Ginkgo-native Table-Driven Tests + +The godoc documentation describes Table's API. More comprehensive documentation (with examples!) is available at http://onsi.github.io/ginkgo#table-driven-tests + +*/ + +package table + +import ( + "fmt" + "reflect" + + "github.com/onsi/ginkgo" +) + +/* +DescribeTable describes a table-driven test. + +For example: + + DescribeTable("a simple table", + func(x int, y int, expected bool) { + Ω(x > y).Should(Equal(expected)) + }, + Entry("x > y", 1, 0, true), + Entry("x == y", 0, 0, false), + Entry("x < y", 0, 1, false), + ) + +The first argument to `DescribeTable` is a string description. +The second argument is a function that will be run for each table entry. Your assertions go here - the function is equivalent to a Ginkgo It. +The subsequent arguments must be of type `TableEntry`. We recommend using the `Entry` convenience constructors. + +The `Entry` constructor takes a string description followed by an arbitrary set of parameters. These parameters are passed into your function. + +Under the hood, `DescribeTable` simply generates a new Ginkgo `Describe`. Each `Entry` is turned into an `It` within the `Describe`. + +It's important to understand that the `Describe`s and `It`s are generated at evaluation time (i.e. when Ginkgo constructs the tree of tests and before the tests run). + +Individual Entries can be focused (with FEntry) or marked pending (with PEntry or XEntry). In addition, the entire table can be focused or marked pending with FDescribeTable and PDescribeTable/XDescribeTable. +*/ +func DescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { + describeTable(description, itBody, entries, false, false) + return true +} + +/* +You can focus a table with `FDescribeTable`. This is equivalent to `FDescribe`. +*/ +func FDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { + describeTable(description, itBody, entries, false, true) + return true +} + +/* +You can mark a table as pending with `PDescribeTable`. This is equivalent to `PDescribe`. +*/ +func PDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { + describeTable(description, itBody, entries, true, false) + return true +} + +/* +You can mark a table as pending with `XDescribeTable`. This is equivalent to `XDescribe`. +*/ +func XDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { + describeTable(description, itBody, entries, true, false) + return true +} + +func describeTable(description string, itBody interface{}, entries []TableEntry, pending bool, focused bool) { + itBodyValue := reflect.ValueOf(itBody) + if itBodyValue.Kind() != reflect.Func { + panic(fmt.Sprintf("DescribeTable expects a function, got %#v", itBody)) + } + + if pending { + ginkgo.PDescribe(description, func() { + for _, entry := range entries { + entry.generateIt(itBodyValue) + } + }) + } else if focused { + ginkgo.FDescribe(description, func() { + for _, entry := range entries { + entry.generateIt(itBodyValue) + } + }) + } else { + ginkgo.Describe(description, func() { + for _, entry := range entries { + entry.generateIt(itBodyValue) + } + }) + } +} diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table_entry.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table_entry.go new file mode 100644 index 00000000000..5fa645bceee --- /dev/null +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/extensions/table/table_entry.go @@ -0,0 +1,81 @@ +package table + +import ( + "reflect" + + "github.com/onsi/ginkgo" +) + +/* +TableEntry represents an entry in a table test. You generally use the `Entry` constructor. +*/ +type TableEntry struct { + Description string + Parameters []interface{} + Pending bool + Focused bool +} + +func (t TableEntry) generateIt(itBody reflect.Value) { + if t.Pending { + ginkgo.PIt(t.Description) + return + } + + values := []reflect.Value{} + for i, param := range t.Parameters { + var value reflect.Value + + if param == nil { + inType := itBody.Type().In(i) + value = reflect.Zero(inType) + } else { + value = reflect.ValueOf(param) + } + + values = append(values, value) + } + + body := func() { + itBody.Call(values) + } + + if t.Focused { + ginkgo.FIt(t.Description, body) + } else { + ginkgo.It(t.Description, body) + } +} + +/* +Entry constructs a TableEntry. + +The first argument is a required description (this becomes the content of the generated Ginkgo `It`). +Subsequent parameters are saved off and sent to the callback passed in to `DescribeTable`. + +Each Entry ends up generating an individual Ginkgo It. +*/ +func Entry(description string, parameters ...interface{}) TableEntry { + return TableEntry{description, parameters, false, false} +} + +/* +You can focus a particular entry with FEntry. This is equivalent to FIt. +*/ +func FEntry(description string, parameters ...interface{}) TableEntry { + return TableEntry{description, parameters, false, true} +} + +/* +You can mark a particular entry as pending with PEntry. This is equivalent to PIt. +*/ +func PEntry(description string, parameters ...interface{}) TableEntry { + return TableEntry{description, parameters, true, false} +} + +/* +You can mark a particular entry as pending with XEntry. This is equivalent to XIt. +*/ +func XEntry(description string, parameters ...interface{}) TableEntry { + return TableEntry{description, parameters, true, false} +} diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/nodot_command.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/nodot_command.go index e1a2e13099a..212235bae0a 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/nodot_command.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/nodot_command.go @@ -63,6 +63,8 @@ func findSuiteFile() (string, os.FileMode) { if err != nil { complainAndQuit("Could not find suite file for nodot: " + err.Error()) } + defer f.Close() + if re.MatchReader(bufio.NewReader(f)) { return path, file.Mode() } diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go index 1135c334d6f..a1e47ba18b3 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go @@ -101,13 +101,18 @@ func (t *TestRunner) CompileTo(path string) error { } if fileExists(path) == false { - compiledFile := filepath.Join(t.Suite.Path, t.Suite. PackageName+".test") + compiledFile := filepath.Join(t.Suite.Path, t.Suite.PackageName+".test") if fileExists(compiledFile) { // seems like we are on an old go version that does not support the -o flag on go test // move the compiled test file to the desired location by hand err = os.Rename(compiledFile, path) if err != nil { - return fmt.Errorf("Failed to move compiled file: %s", err) + // We cannot move the file, perhaps because the source and destination + // are on different partitions. We can copy the file, however. + err = copyFile(compiledFile, path) + if err != nil { + return fmt.Errorf("Failed to copy compiled file: %s", err) + } } } else { return fmt.Errorf("Failed to compile %s: output file %q could not be found", t.Suite.PackageName, path) @@ -124,6 +129,49 @@ func fileExists(path string) bool { return err == nil || os.IsNotExist(err) == false } +// copyFile copies the contents of the file named src to the file named +// by dst. The file will be created if it does not already exist. If the +// destination file exists, all it's contents will be replaced by the contents +// of the source file. +func copyFile(src, dst string) error { + srcInfo, err := os.Stat(src) + if err != nil { + return err + } + mode := srcInfo.Mode() + + in, err := os.Open(src) + if err != nil { + return err + } + + defer in.Close() + + out, err := os.Create(dst) + if err != nil { + return err + } + + defer func() { + closeErr := out.Close() + if err == nil { + err = closeErr + } + }() + + _, err = io.Copy(out, in) + if err != nil { + return err + } + + err = out.Sync() + if err != nil { + return err + } + + return out.Chmod(mode) +} + /* go test -c -i spits package.test out into the cwd. there's no way to change this. diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go index cc7d2f45393..4ef3bc44ff1 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go @@ -4,6 +4,7 @@ import ( "errors" "io/ioutil" "os" + "path" "path/filepath" "regexp" "strings" @@ -47,6 +48,15 @@ func PrecompiledTestSuite(path string) (TestSuite, error) { func SuitesInDir(dir string, recurse bool) []TestSuite { suites := []TestSuite{} + + // "This change will only be enabled if the go command is run with + // GO15VENDOREXPERIMENT=1 in its environment." + // c.f. the vendor-experiment proposal https://goo.gl/2ucMeC + vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") + if (vendorExperiment == "1") && path.Base(dir) == "vendor" { + return suites + } + files, _ := ioutil.ReadDir(dir) re := regexp.MustCompile(`_test\.go$`) for _, file := range files { diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/unfocus_command.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/unfocus_command.go index 16f3c3b72e3..683c3a9982d 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/unfocus_command.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/unfocus_command.go @@ -24,6 +24,8 @@ func unfocusSpecs([]string, []string) { unfocus("Context") unfocus("It") unfocus("Measure") + unfocus("DescribeTable") + unfocus("Entry") } func unfocus(component string) { diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/watch_command.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/watch_command.go index 97361224833..03ea0125877 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/watch_command.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/watch_command.go @@ -80,7 +80,7 @@ func (w *SpecWatcher) WatchSuites(args []string, additionalArgs []string) { } for suite, err := range errors { - fmt.Printf("Failed to watch %s: %s\n"+suite.PackageName, err) + fmt.Printf("Failed to watch %s: %s\n", suite.PackageName, err) } if len(suites) == 1 { diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go index 36f6d8e773f..1d8e593052a 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go @@ -347,6 +347,28 @@ func XIt(text string, _ ...interface{}) bool { return true } +//Specify blocks are aliases for It blocks and allow for more natural wording in situations +//which "It" does not fit into a natural sentence flow. All the same protocols apply for Specify blocks +//which apply to It blocks. +func Specify(text string, body interface{}, timeout ...float64) bool { + return It(text, body, timeout...) +} + +//You can focus individual Specifys using FSpecify +func FSpecify(text string, body interface{}, timeout ...float64) bool { + return FIt(text, body, timeout...) +} + +//You can mark Specifys as pending using PSpecify +func PSpecify(text string, is ...interface{}) bool { + return PIt(text, is...) +} + +//You can mark Specifys as pending using XSpecify +func XSpecify(text string, is ...interface{}) bool { + return XIt(text, is...) +} + //By allows you to better document large Its. // //Generally you should try to keep your Its short and to the point. This is not always possible, however, diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go index 003f8516099..870ad826da0 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go @@ -68,7 +68,7 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure) done := make(chan interface{}, 1) go func() { - finished := false + finished := false defer func() { if e := recover(); e != nil || !finished { @@ -83,7 +83,7 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure) }() r.asyncFunc(done) - finished = true + finished = true }() select { @@ -96,7 +96,7 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure) return } func (r *runner) runSync() (outcome types.SpecState, failure types.SpecFailure) { - finished := false + finished := false defer func() { if e := recover(); e != nil || !finished { @@ -107,7 +107,7 @@ func (r *runner) runSync() (outcome types.SpecState, failure types.SpecFailure) }() r.syncFunc() - finished = true + finished = true return } diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go index 181b227e62e..1235ad00cbb 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go @@ -6,7 +6,6 @@ import ( "errors" "io/ioutil" "os" - "syscall" ) func NewOutputInterceptor() OutputInterceptor { @@ -31,8 +30,12 @@ func (interceptor *outputInterceptor) StartInterceptingOutput() error { return err } - syscall.Dup2(int(interceptor.redirectFile.Fd()), 1) - syscall.Dup2(int(interceptor.redirectFile.Fd()), 2) + // Call a function in ./syscall_dup_*.go + // If building for everything other than linux_arm64, + // use a "normal" syscall.Dup2(oldfd, newfd) call. If building for linux_arm64 (which doesn't have syscall.Dup2) + // call syscall.Dup3(oldfd, newfd, 0). They are nearly identical, see: http://linux.die.net/man/2/dup3 + syscallDup(int(interceptor.redirectFile.Fd()), 1) + syscallDup(int(interceptor.redirectFile.Fd()), 2) return nil } diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go new file mode 100644 index 00000000000..9550d37b36b --- /dev/null +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go @@ -0,0 +1,11 @@ +// +build linux,arm64 + +package remote + +import "syscall" + +// linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so +// use the nearly identical syscall.Dup3 instead +func syscallDup(oldfd int, newfd int) (err error) { + return syscall.Dup3(oldfd, newfd, 0) +} diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go new file mode 100644 index 00000000000..e7fad5bbb03 --- /dev/null +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go @@ -0,0 +1,10 @@ +// +build !linux !arm64 +// +build !windows + +package remote + +import "syscall" + +func syscallDup(oldfd int, newfd int) (err error) { + return syscall.Dup2(oldfd, newfd) +} diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go index 8d1a438df7f..5b5d905da16 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go @@ -8,6 +8,7 @@ package stenographer import ( "fmt" + "runtime" "strings" "github.com/onsi/ginkgo/types" @@ -59,14 +60,20 @@ type Stenographer interface { } func New(color bool) Stenographer { + denoter := "•" + if runtime.GOOS == "windows" { + denoter = "+" + } return &consoleStenographer{ color: color, + denoter: denoter, cursorState: cursorStateTop, } } type consoleStenographer struct { color bool + denoter string cursorState cursorStateType } @@ -197,7 +204,7 @@ func (s *consoleStenographer) announceSetupFailure(name string, summary *types.S s.println(0, s.colorize(redColor+boldStyle, "%s [%.3f seconds]", message, summary.RunTime.Seconds())) - indentation := s.printCodeLocationBlock([]string{name}, []types.CodeLocation{summary.CodeLocation}, summary.ComponentType, 0, true, true) + indentation := s.printCodeLocationBlock([]string{name}, []types.CodeLocation{summary.CodeLocation}, summary.ComponentType, 0, summary.State, true) s.printNewLine() s.printFailure(indentation, summary.State, summary.Failure, fullTrace) @@ -216,13 +223,13 @@ func (s *consoleStenographer) AnnounceCapturedOutput(output string) { } func (s *consoleStenographer) AnnounceSuccesfulSpec(spec *types.SpecSummary) { - s.print(0, s.colorize(greenColor, "•")) + s.print(0, s.colorize(greenColor, s.denoter)) s.stream() } func (s *consoleStenographer) AnnounceSuccesfulSlowSpec(spec *types.SpecSummary, succinct bool) { s.printBlockWithMessage( - s.colorize(greenColor, "• [SLOW TEST:%.3f seconds]", spec.RunTime.Seconds()), + s.colorize(greenColor, "%s [SLOW TEST:%.3f seconds]", s.denoter, spec.RunTime.Seconds()), "", spec, succinct, @@ -231,7 +238,7 @@ func (s *consoleStenographer) AnnounceSuccesfulSlowSpec(spec *types.SpecSummary, func (s *consoleStenographer) AnnounceSuccesfulMeasurement(spec *types.SpecSummary, succinct bool) { s.printBlockWithMessage( - s.colorize(greenColor, "• [MEASUREMENT]"), + s.colorize(greenColor, "%s [MEASUREMENT]", s.denoter), s.measurementReport(spec, succinct), spec, succinct, @@ -261,24 +268,24 @@ func (s *consoleStenographer) AnnounceSkippedSpec(spec *types.SpecSummary, succi s.startBlock() s.println(0, s.colorize(cyanColor+boldStyle, "S [SKIPPING]%s [%.3f seconds]", s.failureContext(spec.Failure.ComponentType), spec.RunTime.Seconds())) - indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, spec.Failure.ComponentType, spec.Failure.ComponentIndex, true, succinct) + indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, spec.Failure.ComponentType, spec.Failure.ComponentIndex, spec.State, succinct) s.printNewLine() - s.printFailure(indentation, spec.State, spec.Failure, fullTrace) + s.printSkip(indentation, spec.Failure) s.endBlock() } } func (s *consoleStenographer) AnnounceSpecTimedOut(spec *types.SpecSummary, succinct bool, fullTrace bool) { - s.printSpecFailure("•... Timeout", spec, succinct, fullTrace) + s.printSpecFailure(fmt.Sprintf("%s... Timeout", s.denoter), spec, succinct, fullTrace) } func (s *consoleStenographer) AnnounceSpecPanicked(spec *types.SpecSummary, succinct bool, fullTrace bool) { - s.printSpecFailure("•! Panic", spec, succinct, fullTrace) + s.printSpecFailure(fmt.Sprintf("%s! Panic", s.denoter), spec, succinct, fullTrace) } func (s *consoleStenographer) AnnounceSpecFailed(spec *types.SpecSummary, succinct bool, fullTrace bool) { - s.printSpecFailure("• Failure", spec, succinct, fullTrace) + s.printSpecFailure(fmt.Sprintf("%s Failure", s.denoter), spec, succinct, fullTrace) } func (s *consoleStenographer) SummarizeFailures(summaries []*types.SpecSummary) { @@ -311,7 +318,7 @@ func (s *consoleStenographer) SummarizeFailures(summaries []*types.SpecSummary) } else if summary.Failed() { s.print(0, s.colorize(redColor+boldStyle, "[Fail] ")) } - s.printSpecContext(summary.ComponentTexts, summary.ComponentCodeLocations, summary.Failure.ComponentType, summary.Failure.ComponentIndex, true, true) + s.printSpecContext(summary.ComponentTexts, summary.ComponentCodeLocations, summary.Failure.ComponentType, summary.Failure.ComponentIndex, summary.State, true) s.printNewLine() s.println(0, s.colorize(lightGrayColor, summary.Failure.Location.String())) } @@ -344,7 +351,7 @@ func (s *consoleStenographer) printBlockWithMessage(header string, message strin s.startBlock() s.println(0, header) - indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, types.SpecComponentTypeInvalid, 0, false, succinct) + indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, types.SpecComponentTypeInvalid, 0, spec.State, succinct) if message != "" { s.printNewLine() @@ -358,7 +365,7 @@ func (s *consoleStenographer) printSpecFailure(message string, spec *types.SpecS s.startBlock() s.println(0, s.colorize(redColor+boldStyle, "%s%s [%.3f seconds]", message, s.failureContext(spec.Failure.ComponentType), spec.RunTime.Seconds())) - indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, spec.Failure.ComponentType, spec.Failure.ComponentIndex, true, succinct) + indentation := s.printCodeLocationBlock(spec.ComponentTexts, spec.ComponentCodeLocations, spec.Failure.ComponentType, spec.Failure.ComponentIndex, spec.State, succinct) s.printNewLine() s.printFailure(indentation, spec.State, spec.Failure, fullTrace) @@ -382,6 +389,12 @@ func (s *consoleStenographer) failureContext(failedComponentType types.SpecCompo return "" } +func (s *consoleStenographer) printSkip(indentation int, spec types.SpecFailure) { + s.println(indentation, s.colorize(cyanColor, spec.Message)) + s.printNewLine() + s.println(indentation, spec.Location.String()) +} + func (s *consoleStenographer) printFailure(indentation int, state types.SpecState, failure types.SpecFailure, fullTrace bool) { if state == types.SpecStatePanicked { s.println(indentation, s.colorize(redColor+boldStyle, failure.Message)) @@ -402,7 +415,7 @@ func (s *consoleStenographer) printFailure(indentation int, state types.SpecStat } } -func (s *consoleStenographer) printSpecContext(componentTexts []string, componentCodeLocations []types.CodeLocation, failedComponentType types.SpecComponentType, failedComponentIndex int, failure bool, succinct bool) int { +func (s *consoleStenographer) printSpecContext(componentTexts []string, componentCodeLocations []types.CodeLocation, failedComponentType types.SpecComponentType, failedComponentIndex int, state types.SpecState, succinct bool) int { startIndex := 1 indentation := 0 @@ -411,7 +424,11 @@ func (s *consoleStenographer) printSpecContext(componentTexts []string, componen } for i := startIndex; i < len(componentTexts); i++ { - if failure && i == failedComponentIndex { + if (state.IsFailure() || state == types.SpecStateSkipped) && i == failedComponentIndex { + color := redColor + if state == types.SpecStateSkipped { + color = cyanColor + } blockType := "" switch failedComponentType { case types.SpecComponentTypeBeforeSuite: @@ -430,9 +447,9 @@ func (s *consoleStenographer) printSpecContext(componentTexts []string, componen blockType = "Measurement" } if succinct { - s.print(0, s.colorize(redColor+boldStyle, "[%s] %s ", blockType, componentTexts[i])) + s.print(0, s.colorize(color+boldStyle, "[%s] %s ", blockType, componentTexts[i])) } else { - s.println(indentation, s.colorize(redColor+boldStyle, "%s [%s]", componentTexts[i], blockType)) + s.println(indentation, s.colorize(color+boldStyle, "%s [%s]", componentTexts[i], blockType)) s.println(indentation, s.colorize(grayColor, "%s", componentCodeLocations[i])) } } else { @@ -449,8 +466,8 @@ func (s *consoleStenographer) printSpecContext(componentTexts []string, componen return indentation } -func (s *consoleStenographer) printCodeLocationBlock(componentTexts []string, componentCodeLocations []types.CodeLocation, failedComponentType types.SpecComponentType, failedComponentIndex int, failure bool, succinct bool) int { - indentation := s.printSpecContext(componentTexts, componentCodeLocations, failedComponentType, failedComponentIndex, failure, succinct) +func (s *consoleStenographer) printCodeLocationBlock(componentTexts []string, componentCodeLocations []types.CodeLocation, failedComponentType types.SpecComponentType, failedComponentIndex int, state types.SpecState, succinct bool) int { + indentation := s.printSpecContext(componentTexts, componentCodeLocations, failedComponentType, failedComponentIndex, state, succinct) if succinct { if len(componentTexts) > 0 { diff --git a/Godeps/_workspace/src/github.com/onsi/ginkgo/types/types.go b/Godeps/_workspace/src/github.com/onsi/ginkgo/types/types.go index 583b3473959..889612e0a72 100644 --- a/Godeps/_workspace/src/github.com/onsi/ginkgo/types/types.go +++ b/Godeps/_workspace/src/github.com/onsi/ginkgo/types/types.go @@ -35,7 +35,7 @@ type SpecSummary struct { } func (s SpecSummary) HasFailureState() bool { - return s.State == SpecStateTimedOut || s.State == SpecStatePanicked || s.State == SpecStateFailed + return s.State.IsFailure() } func (s SpecSummary) TimedOut() bool { @@ -115,6 +115,10 @@ const ( SpecStateTimedOut ) +func (state SpecState) IsFailure() bool { + return state == SpecStateTimedOut || state == SpecStatePanicked || state == SpecStateFailed +} + type SpecComponentType uint const ( diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go index caa7e0a3b50..7f71f0ecbfe 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go @@ -64,6 +64,7 @@ Rich Feature Set includes: - Never silently skip data when decoding. User decides whether to return an error or silently skip data when keys or indexes in the data stream do not map to fields in the struct. + - Detect and error when encoding a cyclic reference (instead of stack overflow shutdown) - Encode/Decode from/to chan types (for iterative streaming support) - Drop-in replacement for encoding/json. `json:` key in struct tag supported. - Provides a RPC Server and Client Codec for net/rpc communication protocol. @@ -171,6 +172,8 @@ package codec // TODO: // +// - optimization for codecgen: +// if len of entity is <= 3 words, then support a value receiver for encode. // - (En|De)coder should store an error when it occurs. // Until reset, subsequent calls return that error that was stored. // This means that free panics must go away. @@ -190,4 +193,7 @@ package codec // - Consider making Handle used AS-IS within the encoding/decoding session. // This means that we don't cache Handle information within the (En|De)coder, // except we really need it at Reset(...) -// - Handle recursive types during encoding/decoding? +// - Consider adding math/big support +// - Consider reducing the size of the generated functions: +// Maybe use one loop, and put the conditionals in the loop. +// for ... { if cLen > 0 { if j == cLen { break } } else if dd.CheckBreak() { break } } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go index c884d14dce5..766d26cf6d7 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go @@ -908,10 +908,14 @@ func (h *BincHandle) newDecDriver(d *Decoder) decDriver { func (e *bincEncDriver) reset() { e.w = e.e.w + e.s = 0 + e.m = nil } func (d *bincDecDriver) reset() { d.r = d.d.r + d.s = nil + d.bd, d.bdRead, d.vd, d.vs = 0, false, 0, 0 } var _ decDriver = (*bincDecDriver)(nil) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go index 0e5d32b2ea9..cfd89b7a434 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go @@ -578,6 +578,7 @@ func (e *cborEncDriver) reset() { func (d *cborDecDriver) reset() { d.r = d.d.r + d.bd, d.bdRead = 0, false } var _ decDriver = (*cborDecDriver)(nil) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go index b3b99f03670..d842a24ba88 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go @@ -1862,6 +1862,7 @@ func (d *Decoder) intern(s string) { } } +// nextValueBytes returns the next value in the stream as a set of bytes. func (d *Decoder) nextValueBytes() []byte { d.d.uncacheRead() d.r.track() diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go index 99af6fa555a..d7ad330201c 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go @@ -110,6 +110,15 @@ type EncodeOptions struct { // Canonical bool + // CheckCircularRef controls whether we check for circular references + // and error fast during an encode. + // + // If enabled, an error is received if a pointer to a struct + // references itself either directly or through one of its fields (iteratively). + // + // This is opt-in, as there may be a performance hit to checking circular references. + CheckCircularRef bool + // AsSymbols defines what should be encoded as symbols. // // Encoding as symbols can reduce the encoded size significantly. @@ -503,7 +512,7 @@ func (f *encFnInfo) kStruct(rv reflect.Value) { newlen := len(fti.sfi) // Use sync.Pool to reduce allocating slices unnecessarily. - // The cost of the occasional locking is less than the cost of new allocation. + // The cost of sync.Pool is less than the cost of new allocation. pool, poolv, fkvs := encStructPoolGet(newlen) // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) @@ -514,11 +523,6 @@ func (f *encFnInfo) kStruct(rv reflect.Value) { var kv stringRv for _, si := range tisfi { kv.r = si.field(rv, false) - // if si.i != -1 { - // rvals[newlen] = rv.Field(int(si.i)) - // } else { - // rvals[newlen] = rv.FieldByIndex(si.is) - // } if toMap { if si.omitEmpty && isEmptyValue(kv.r) { continue @@ -596,13 +600,15 @@ func (f *encFnInfo) kStruct(rv reflect.Value) { // f.e.encodeValue(rv.Elem()) // } -func (f *encFnInfo) kInterface(rv reflect.Value) { - if rv.IsNil() { - f.e.e.EncodeNil() - return - } - f.e.encodeValue(rv.Elem(), nil) -} +// func (f *encFnInfo) kInterface(rv reflect.Value) { +// println("kInterface called") +// debug.PrintStack() +// if rv.IsNil() { +// f.e.e.EncodeNil() +// return +// } +// f.e.encodeValue(rv.Elem(), nil) +// } func (f *encFnInfo) kMap(rv reflect.Value) { ee := f.e.e @@ -877,6 +883,7 @@ type Encoder struct { // as the handler MAY need to do some coordination. w encWriter s []encRtidFn + ci set be bool // is binary encoding js bool // is json handle @@ -1133,20 +1140,23 @@ func (e *Encoder) encode(iv interface{}) { } } -func (e *Encoder) encodeI(iv interface{}, checkFastpath, checkCodecSelfer bool) { - if rv, proceed := e.preEncodeValue(reflect.ValueOf(iv)); proceed { - rt := rv.Type() - rtid := reflect.ValueOf(rt).Pointer() - fn := e.getEncFn(rtid, rt, checkFastpath, checkCodecSelfer) - fn.f(&fn.i, rv) - } -} - -func (e *Encoder) preEncodeValue(rv reflect.Value) (rv2 reflect.Value, proceed bool) { +func (e *Encoder) preEncodeValue(rv reflect.Value) (rv2 reflect.Value, sptr uintptr, proceed bool) { // use a goto statement instead of a recursive function for ptr/interface. TOP: switch rv.Kind() { - case reflect.Ptr, reflect.Interface: + case reflect.Ptr: + if rv.IsNil() { + e.e.EncodeNil() + return + } + rv = rv.Elem() + if e.h.CheckCircularRef && rv.Kind() == reflect.Struct { + // TODO: Movable pointers will be an issue here. Future problem. + sptr = rv.UnsafeAddr() + break TOP + } + goto TOP + case reflect.Interface: if rv.IsNil() { e.e.EncodeNil() return @@ -1163,18 +1173,39 @@ TOP: return } - return rv, true + proceed = true + rv2 = rv + return +} + +func (e *Encoder) doEncodeValue(rv reflect.Value, fn *encFn, sptr uintptr, + checkFastpath, checkCodecSelfer bool) { + if sptr != 0 { + if (&e.ci).add(sptr) { + e.errorf("circular reference found: # %d", sptr) + } + } + if fn == nil { + rt := rv.Type() + rtid := reflect.ValueOf(rt).Pointer() + fn = e.getEncFn(rtid, rt, true, true) + } + fn.f(&fn.i, rv) + if sptr != 0 { + (&e.ci).remove(sptr) + } +} + +func (e *Encoder) encodeI(iv interface{}, checkFastpath, checkCodecSelfer bool) { + if rv, sptr, proceed := e.preEncodeValue(reflect.ValueOf(iv)); proceed { + e.doEncodeValue(rv, nil, sptr, checkFastpath, checkCodecSelfer) + } } func (e *Encoder) encodeValue(rv reflect.Value, fn *encFn) { // if a valid fn is passed, it MUST BE for the dereferenced type of rv - if rv, proceed := e.preEncodeValue(rv); proceed { - if fn == nil { - rt := rv.Type() - rtid := reflect.ValueOf(rt).Pointer() - fn = e.getEncFn(rtid, rt, true, true) - } - fn.f(&fn.i, rv) + if rv, sptr, proceed := e.preEncodeValue(rv); proceed { + e.doEncodeValue(rv, fn, sptr, true, true) } } @@ -1284,10 +1315,11 @@ func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCo fn.f = (*encFnInfo).kSlice case reflect.Struct: fn.f = (*encFnInfo).kStruct + // reflect.Ptr and reflect.Interface are handled already by preEncodeValue // case reflect.Ptr: // fn.f = (*encFnInfo).kPtr - case reflect.Interface: - fn.f = (*encFnInfo).kInterface + // case reflect.Interface: + // fn.f = (*encFnInfo).kInterface case reflect.Map: fn.f = (*encFnInfo).kMap default: @@ -1353,25 +1385,6 @@ func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []stringRv) { // panic(errors.New("encStructPoolLen must be equal to 4")) // defensive, in case it is changed // } // idxpool := newlen / 8 - - // if pool == nil { - // fkvs = make([]stringRv, newlen) - // } else { - // poolv = pool.Get() - // switch vv := poolv.(type) { - // case *[8]stringRv: - // fkvs = vv[:newlen] - // case *[16]stringRv: - // fkvs = vv[:newlen] - // case *[32]stringRv: - // fkvs = vv[:newlen] - // case *[64]stringRv: - // fkvs = vv[:newlen] - // case *[128]stringRv: - // fkvs = vv[:newlen] - // } - // } - if newlen <= 8 { p = &encStructPool[0] v = p.Get() diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go index d968a500fde..5cac047aff2 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go @@ -17712,7 +17712,7 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -17771,7 +17771,7 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]interface{}, 1, 4) @@ -17846,7 +17846,7 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -17905,7 +17905,7 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]string, 1, 4) @@ -17979,7 +17979,7 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18038,7 +18038,7 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]float32, 1, 4) @@ -18112,7 +18112,7 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18171,7 +18171,7 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]float64, 1, 4) @@ -18245,7 +18245,7 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18304,7 +18304,7 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]uint, 1, 4) @@ -18378,7 +18378,7 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18437,7 +18437,7 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]uint16, 1, 4) @@ -18511,7 +18511,7 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18570,7 +18570,7 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]uint32, 1, 4) @@ -18644,7 +18644,7 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18703,7 +18703,7 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]uint64, 1, 4) @@ -18777,7 +18777,7 @@ func (_ fastpathT) DecSliceUintptrV(v []uintptr, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18836,7 +18836,7 @@ func (_ fastpathT) DecSliceUintptrV(v []uintptr, checkNil bool, canChange bool, changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]uintptr, 1, 4) @@ -18910,7 +18910,7 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d *Decod changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -18969,7 +18969,7 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d *Decod changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]int, 1, 4) @@ -19043,7 +19043,7 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -19102,7 +19102,7 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]int8, 1, 4) @@ -19176,7 +19176,7 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -19235,7 +19235,7 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]int16, 1, 4) @@ -19309,7 +19309,7 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -19368,7 +19368,7 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]int32, 1, 4) @@ -19442,7 +19442,7 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -19501,7 +19501,7 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d *D changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]int64, 1, 4) @@ -19575,7 +19575,7 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -19634,7 +19634,7 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d *Dec changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]bool, 1, 4) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl index 58cc6df4c54..3f43dc68780 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl @@ -328,7 +328,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil b changed = true } slh.End() - return + return v, changed } if containerLenS > 0 { @@ -391,7 +391,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil b changed = true } slh.End() - return + return v, changed } if cap(v) == 0 { v = make([]{{ .Elem }}, 1, 4) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go index 560014ae393..40065a01c8b 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go @@ -155,8 +155,10 @@ const ( resetSliceElemToZeroValue bool = false ) -var oneByteArr = [1]byte{0} -var zeroByteSlice = oneByteArr[:0:0] +var ( + oneByteArr = [1]byte{0} + zeroByteSlice = oneByteArr[:0:0] +) type charEncoding uint8 @@ -215,6 +217,24 @@ const ( containerArrayEnd ) +type rgetPoolT struct { + encNames [8]string + fNames [8]string + etypes [8]uintptr + sfis [8]*structFieldInfo +} + +var rgetPool = sync.Pool{ + New: func() interface{} { return new(rgetPoolT) }, +} + +type rgetT struct { + fNames []string + encNames []string + etypes []uintptr + sfis []*structFieldInfo +} + type containerStateRecv interface { sendContainerState(containerState) } @@ -833,14 +853,17 @@ func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { siInfo = parseStructFieldInfo(structInfoFieldName, x.structTag(f.Tag)) ti.toArray = siInfo.toArray } - sfip := make([]*structFieldInfo, 0, rt.NumField()) - x.rget(rt, nil, make(map[string]bool, 16), &sfip, siInfo) - - ti.sfip = make([]*structFieldInfo, len(sfip)) - ti.sfi = make([]*structFieldInfo, len(sfip)) - copy(ti.sfip, sfip) - sort.Sort(sfiSortedByEncName(sfip)) - copy(ti.sfi, sfip) + pi := rgetPool.Get() + pv := pi.(*rgetPoolT) + pv.etypes[0] = ti.baseId + vv := rgetT{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]} + x.rget(rt, rtid, nil, &vv, siInfo) + ti.sfip = make([]*structFieldInfo, len(vv.sfis)) + ti.sfi = make([]*structFieldInfo, len(vv.sfis)) + copy(ti.sfip, vv.sfis) + sort.Sort(sfiSortedByEncName(vv.sfis)) + copy(ti.sfi, vv.sfis) + rgetPool.Put(pi) } // sfi = sfip @@ -853,16 +876,37 @@ func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { return } -func (x *TypeInfos) rget(rt reflect.Type, indexstack []int, fnameToHastag map[string]bool, - sfi *[]*structFieldInfo, siInfo *structFieldInfo, +func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, + indexstack []int, pv *rgetT, siInfo *structFieldInfo, ) { - for j := 0; j < rt.NumField(); j++ { + // This will read up the fields and store how to access the value. + // It uses the go language's rules for embedding, as below: + // - if a field has been seen while traversing, skip it + // - if an encName has been seen while traversing, skip it + // - if an embedded type has been seen, skip it + // + // Also, per Go's rules, embedded fields must be analyzed AFTER all top-level fields. + // + // Note: we consciously use slices, not a map, to simulate a set. + // Typically, types have < 16 fields, and iteration using equals is faster than maps there + + type anonField struct { + ft reflect.Type + idx int + } + + var anonFields []anonField + +LOOP: + for j, jlen := 0, rt.NumField(); j < jlen; j++ { f := rt.Field(j) fkind := f.Type.Kind() // skip if a func type, or is unexported, or structTag value == "-" - if fkind == reflect.Func { - continue + switch fkind { + case reflect.Func, reflect.Complex64, reflect.Complex128, reflect.UnsafePointer: + continue LOOP } + // if r1, _ := utf8.DecodeRuneInString(f.Name); r1 == utf8.RuneError || !unicode.IsUpper(r1) { if f.PkgPath != "" && !f.Anonymous { // unexported, not embedded continue @@ -886,11 +930,8 @@ func (x *TypeInfos) rget(rt reflect.Type, indexstack []int, fnameToHastag map[st ft = ft.Elem() } if ft.Kind() == reflect.Struct { - indexstack2 := make([]int, len(indexstack)+1, len(indexstack)+4) - copy(indexstack2, indexstack) - indexstack2[len(indexstack)] = j - // indexstack2 := append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) - x.rget(ft, indexstack2, fnameToHastag, sfi, siInfo) + // handle anonymous fields after handling all the non-anon fields + anonFields = append(anonFields, anonField{ft, j}) continue } } @@ -901,26 +942,39 @@ func (x *TypeInfos) rget(rt reflect.Type, indexstack []int, fnameToHastag map[st continue } - // do not let fields with same name in embedded structs override field at higher level. - // this must be done after anonymous check, to allow anonymous field - // still include their child fields - if _, ok := fnameToHastag[f.Name]; ok { - continue - } if f.Name == "" { panic(noFieldNameToStructFieldInfoErr) } + + for _, k := range pv.fNames { + if k == f.Name { + continue LOOP + } + } + pv.fNames = append(pv.fNames, f.Name) + if si == nil { si = parseStructFieldInfo(f.Name, stag) } else if si.encName == "" { si.encName = f.Name } + + for _, k := range pv.encNames { + if k == si.encName { + continue LOOP + } + } + pv.encNames = append(pv.encNames, si.encName) + // si.ikind = int(f.Type.Kind()) if len(indexstack) == 0 { si.i = int16(j) } else { si.i = -1 - si.is = append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) + si.is = make([]int, len(indexstack)+1) + copy(si.is, indexstack) + si.is[len(indexstack)] = j + // si.is = append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) } if siInfo != nil { @@ -928,8 +982,26 @@ func (x *TypeInfos) rget(rt reflect.Type, indexstack []int, fnameToHastag map[st si.omitEmpty = true } } - *sfi = append(*sfi, si) - fnameToHastag[f.Name] = stag != "" + pv.sfis = append(pv.sfis, si) + } + + // now handle anonymous fields +LOOP2: + for _, af := range anonFields { + // if etypes contains this, then do not call rget again (as the fields are already seen here) + ftid := reflect.ValueOf(af.ft).Pointer() + for _, k := range pv.etypes { + if k == ftid { + continue LOOP2 + } + } + pv.etypes = append(pv.etypes, ftid) + + indexstack2 := make([]int, len(indexstack)+1) + copy(indexstack2, indexstack) + indexstack2[len(indexstack)] = af.idx + // indexstack2 := append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) + x.rget(af.ft, ftid, indexstack2, pv, siInfo) } } @@ -1127,3 +1199,73 @@ type bytesISlice []bytesI func (p bytesISlice) Len() int { return len(p) } func (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 } func (p bytesISlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// ----------------- + +type set []uintptr + +func (s *set) add(v uintptr) (exists bool) { + // e.ci is always nil, or len >= 1 + // defer func() { fmt.Printf("$$$$$$$$$$$ cirRef Add: %v, exists: %v\n", v, exists) }() + x := *s + if x == nil { + x = make([]uintptr, 1, 8) + x[0] = v + *s = x + return + } + // typically, length will be 1. make this perform. + if len(x) == 1 { + if j := x[0]; j == 0 { + x[0] = v + } else if j == v { + exists = true + } else { + x = append(x, v) + *s = x + } + return + } + // check if it exists + for _, j := range x { + if j == v { + exists = true + return + } + } + // try to replace a "deleted" slot + for i, j := range x { + if j == 0 { + x[i] = v + return + } + } + // if unable to replace deleted slot, just append it. + x = append(x, v) + *s = x + return +} + +func (s *set) remove(v uintptr) (exists bool) { + // defer func() { fmt.Printf("$$$$$$$$$$$ cirRef Rm: %v, exists: %v\n", v, exists) }() + x := *s + if len(x) == 0 { + return + } + if len(x) == 1 { + if x[0] == v { + x[0] = 0 + } + return + } + for i, j := range x { + if j == v { + exists = true + x[i] = 0 // set it to 0, as way to delete it. + // copy(x[i:], x[i+1:]) + // x = x[:len(x)-1] + return + } + } + return +} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go index a18a5f7063e..142d5b52a85 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go @@ -43,18 +43,23 @@ import ( //-------------------------------- -var jsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'} +var ( + jsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'} -var jsonFloat64Pow10 = [...]float64{ - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22, -} + jsonFloat64Pow10 = [...]float64{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22, + } -var jsonUint64Pow10 = [...]uint64{ - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, -} + jsonUint64Pow10 = [...]uint64{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + } + + // jsonTabs and jsonSpaces are used as caches for indents + jsonTabs, jsonSpaces string +) const ( // jsonUnreadAfterDecNum controls whether we unread after decoding a number. @@ -85,8 +90,23 @@ const ( jsonNumUintMaxVal = 1< 0 { + e.d = true + e.ds = jsonSpaces[:e.h.Indent] + } else if e.h.Indent < 0 { + e.d = true + e.dt = true + e.ds = jsonTabs[:-(e.h.Indent)] + } } func (d *jsonDecDriver) reset() { d.r = d.d.r + d.se.i = d.h.RawBytesExt + if d.bs != nil { + d.bs = d.bs[:0] + } + d.c, d.tok = 0, 0 + d.n.reset() } var jsonEncodeTerminate = []byte{' '} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go index 5eb4c96368c..f9f87236277 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go @@ -374,7 +374,7 @@ func (d *msgpackDecDriver) DecodeNaked() { } if n.v == valueTypeUint && d.h.SignedInteger { n.v = valueTypeInt - n.i = int64(n.v) + n.i = int64(n.u) } return } @@ -729,6 +729,7 @@ func (e *msgpackEncDriver) reset() { func (d *msgpackDecDriver) reset() { d.r = d.d.r + d.bd, d.bdRead = 0, false } //-------------------------------------------------- diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/simple.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/simple.go index c1504965095..7c0ba7affc7 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/simple.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/simple.go @@ -512,6 +512,7 @@ func (e *simpleEncDriver) reset() { func (d *simpleDecDriver) reset() { d.r = d.d.r + d.bd, d.bdRead = 0, false } var _ decDriver = (*simpleDecDriver)(nil) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/tests.sh b/Godeps/_workspace/src/github.com/ugorji/go/codec/tests.sh index b1602ea7e75..00857b6209a 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/tests.sh +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/tests.sh @@ -6,6 +6,7 @@ _run() { # 1. VARIATIONS: regular (t), canonical (c), IO R/W (i), # binc-nosymbols (n), struct2array (s), intern string (e), + # json-indent (d), circular (l) # 2. MODE: reflection (r), external (x), codecgen (g), unsafe (u), notfastpath (f) # 3. OPTIONS: verbose (v), reset (z), must (m), # @@ -16,7 +17,7 @@ _run() { zargs="" local OPTIND OPTIND=1 - while getopts "xurtcinsvgzmef" flag + while getopts "_xurtcinsvgzmefdl" flag do case "x$flag" in 'xr') ;; @@ -27,6 +28,7 @@ _run() { 'xv') zargs="$zargs -tv" ;; 'xz') zargs="$zargs -tr" ;; 'xm') zargs="$zargs -tm" ;; + 'xl') zargs="$zargs -tl" ;; *) ;; esac done @@ -35,15 +37,19 @@ _run() { # echo ">>>>>>> TAGS: $ztags" OPTIND=1 - while getopts "xurtcinsvgzmef" flag + while getopts "_xurtcinsvgzmefdl" flag do case "x$flag" in 'xt') printf ">>>>>>> REGULAR : "; go test "-tags=$ztags" $zargs ; sleep 2 ;; 'xc') printf ">>>>>>> CANONICAL : "; go test "-tags=$ztags" $zargs -tc; sleep 2 ;; 'xi') printf ">>>>>>> I/O : "; go test "-tags=$ztags" $zargs -ti; sleep 2 ;; - 'xn') printf ">>>>>>> NO_SYMBOLS : "; go test "-tags=$ztags" $zargs -tn; sleep 2 ;; + 'xn') printf ">>>>>>> NO_SYMBOLS : "; go test "-tags=$ztags" -run=Binc $zargs -tn; sleep 2 ;; 'xs') printf ">>>>>>> TO_ARRAY : "; go test "-tags=$ztags" $zargs -ts; sleep 2 ;; 'xe') printf ">>>>>>> INTERN : "; go test "-tags=$ztags" $zargs -te; sleep 2 ;; + 'xd') printf ">>>>>>> INDENT : "; + go test "-tags=$ztags" -run=JsonCodecsTable -td=-1 $zargs; + go test "-tags=$ztags" -run=JsonCodecsTable -td=8 $zargs; + sleep 2 ;; *) ;; esac done @@ -55,20 +61,20 @@ _run() { # echo ">>>>>>> RUNNING VARIATIONS OF TESTS" if [[ "x$@" = "x" ]]; then # All: r, x, g, gu - _run "-rtcinsm" # regular - _run "-rtcinsmz" # regular with reset - _run "-rtcinsmf" # regular with no fastpath (notfastpath) - _run "-xtcinsm" # external - _run "-gxtcinsm" # codecgen: requires external - _run "-gxutcinsm" # codecgen + unsafe + _run "-_tcinsed_ml" # regular + _run "-_tcinsed_ml_z" # regular with reset + _run "-_tcinsed_ml_f" # regular with no fastpath (notfastpath) + _run "-x_tcinsed_ml" # external + _run "-gx_tcinsed_ml" # codecgen: requires external + _run "-gxu_tcinsed_ml" # codecgen + unsafe elif [[ "x$@" = "x-Z" ]]; then # Regular - _run "-rtcinsm" # regular - _run "-rtcinsmz" # regular with reset + _run "-_tcinsed_ml" # regular + _run "-_tcinsed_ml_z" # regular with reset elif [[ "x$@" = "x-F" ]]; then # regular with notfastpath - _run "-rtcinsmf" # regular - _run "-rtcinsmzf" # regular with reset + _run "-_tcinsed_ml_f" # regular + _run "-_tcinsed_ml_zf" # regular with reset else _run "$@" fi diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go index fc4c63e1def..718b731ec58 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go @@ -5,11 +5,22 @@ package codec import ( "fmt" + "reflect" "time" ) var ( - timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} + timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} + timeExtEncFn = func(rv reflect.Value) (bs []byte, err error) { + defer panicToErr(&err) + bs = timeExt{}.WriteExt(rv.Interface()) + return + } + timeExtDecFn = func(rv reflect.Value, bs []byte) (err error) { + defer panicToErr(&err) + timeExt{}.ReadExt(rv.Interface(), bs) + return + } ) type timeExt struct{} diff --git a/Godeps/_workspace/src/golang.org/x/net/http2/.gitignore b/Godeps/_workspace/src/golang.org/x/net/http2/.gitignore new file mode 100644 index 00000000000..190f12234ad --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/http2/.gitignore @@ -0,0 +1,2 @@ +*~ +h2i/h2i diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile b/Godeps/_workspace/src/golang.org/x/net/http2/Dockerfile similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile rename to Godeps/_workspace/src/golang.org/x/net/http2/Dockerfile diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/Makefile b/Godeps/_workspace/src/golang.org/x/net/http2/Makefile similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/Makefile rename to Godeps/_workspace/src/golang.org/x/net/http2/Makefile diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/README b/Godeps/_workspace/src/golang.org/x/net/http2/README similarity index 67% rename from Godeps/_workspace/src/github.com/bradfitz/http2/README rename to Godeps/_workspace/src/golang.org/x/net/http2/README index 16cb516a69a..aba8ae5ef66 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/README +++ b/Godeps/_workspace/src/golang.org/x/net/http2/README @@ -10,8 +10,11 @@ Status: * The client work has just started but shares a lot of code is coming along much quicker. -Docs are at https://godoc.org/github.com/bradfitz/http2 +Docs are at https://godoc.org/golang.org/x/net/http2 Demo test server at https://http2.golang.org/ -Help & bug reports welcome. +Help & bug reports welcome! + +Contributing: https://golang.org/doc/contribute.html +Bugs: https://github.com/golang/go/issues/new?title=x/net/http2:+ diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go b/Godeps/_workspace/src/golang.org/x/net/http2/buffer.go similarity index 89% rename from Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go rename to Godeps/_workspace/src/golang.org/x/net/http2/buffer.go index 48d7561ecfd..c43954cf04d 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/buffer.go @@ -19,8 +19,9 @@ type buffer struct { } var ( - errReadEmpty = errors.New("read from empty buffer") - errWriteFull = errors.New("write on full buffer") + errReadEmpty = errors.New("read from empty buffer") + errWriteClosed = errors.New("write on closed buffer") + errWriteFull = errors.New("write on full buffer") ) // Read copies bytes from the buffer into p. @@ -45,7 +46,7 @@ func (b *buffer) Len() int { // It is an error to write more data than the buffer can hold. func (b *buffer) Write(p []byte) (n int, err error) { if b.closed { - return 0, errors.New("closed") + return 0, errWriteClosed } // Slide existing data to beginning. diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/errors.go b/Godeps/_workspace/src/golang.org/x/net/http2/errors.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/errors.go rename to Godeps/_workspace/src/golang.org/x/net/http2/errors.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/flow.go b/Godeps/_workspace/src/golang.org/x/net/http2/flow.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/flow.go rename to Godeps/_workspace/src/golang.org/x/net/http2/flow.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/frame.go b/Godeps/_workspace/src/golang.org/x/net/http2/frame.go similarity index 99% rename from Godeps/_workspace/src/github.com/bradfitz/http2/frame.go rename to Godeps/_workspace/src/golang.org/x/net/http2/frame.go index 94c5e44ae5b..e8b872a19ba 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/frame.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/frame.go @@ -85,8 +85,8 @@ const ( // Continuation Frame FlagContinuationEndHeaders Flags = 0x4 - FlagPushPromiseEndHeaders = 0x4 - FlagPushPromisePadded = 0x8 + FlagPushPromiseEndHeaders Flags = 0x4 + FlagPushPromisePadded Flags = 0x8 ) var flagName = map[FrameType]map[Flags]string{ diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go b/Godeps/_workspace/src/golang.org/x/net/http2/gotrack.go similarity index 96% rename from Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go rename to Godeps/_workspace/src/golang.org/x/net/http2/gotrack.go index 6e1a3823cac..7dc2ef90dba 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/gotrack.go @@ -14,16 +14,20 @@ import ( "bytes" "errors" "fmt" + "os" "runtime" "strconv" "sync" ) -var DebugGoroutines = false +var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" type goroutineLock uint64 func newGoroutineLock() goroutineLock { + if !DebugGoroutines { + return 0 + } return goroutineLock(curGoroutineID()) } diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/.gitignore similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/.gitignore diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/Makefile similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/Makefile diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/README similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/README diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/h2demo.go similarity index 93% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/h2demo.go index de6caaa7491..9429a725458 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/h2demo.go @@ -31,7 +31,7 @@ import ( "camlistore.org/pkg/googlestorage" "camlistore.org/pkg/singleflight" - "github.com/bradfitz/http2" + "golang.org/x/net/http2" ) var ( @@ -51,7 +51,7 @@ func homeOldHTTP(w http.ResponseWriter, r *http.Request) {
  • Use Firefox Nightly or go to about:config and enable "network.http.spdy.enabled.http2draft"
  • Use Google Chrome Canary and/or go to chrome://flags/#enable-spdy4 to Enable SPDY/4 (Chrome's name for HTTP/2)
  • -

    See code & instructions for connecting at https://github.com/bradfitz/http2.

    +

    See code & instructions for connecting at https://github.com/golang/net/tree/master/http2.

    `) } @@ -73,12 +73,12 @@ href="https://http2.github.io/">HTTP/2 demo & interop server.

    This server exists for others in the HTTP/2 community to test their HTTP/2 client implementations and point out flaws in our server.

    The code is currently at github.com/bradfitz/http2 +href="https://golang.org/x/net/http2">github.com/bradfitz/http2 but will move to the Go standard library at some point in the future (enabled by default, without users needing to change their code).

    Contact info: bradfitz@golang.org, or file a bug.

    +href="https://golang.org/x/net/http2/issues">file a bug.

    Handlers for testing

      @@ -287,7 +287,7 @@ func newGopherTilesHandler() http.Handler { return } } - io.WriteString(w, "") + io.WriteString(w, "") fmt.Fprintf(w, "A grid of %d tiled images is below. Compare:

      ", xt*yt) for _, ms := range []int{0, 30, 200, 1000} { d := time.Duration(ms) * nanosPerMilli @@ -305,7 +305,16 @@ func newGopherTilesHandler() http.Handler { } io.WriteString(w, "
      \n") } - io.WriteString(w, "


      << Back to Go HTTP/2 demo server") + io.WriteString(w, `

      + +
      << Back to Go HTTP/2 demo server`) }) } diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/launch.go similarity index 86% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/launch.go index 2eb709bdd34..746661543ea 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/launch.go @@ -20,8 +20,9 @@ import ( "strings" "time" - "code.google.com/p/goauth2/oauth" - compute "code.google.com/p/google-api-go-client/compute/v1" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + compute "google.golang.org/api/compute/v1" ) var ( @@ -44,19 +45,18 @@ func readFile(v string) string { return strings.TrimSpace(string(slurp)) } -var config = &oauth.Config{ +var config = &oauth2.Config{ // The client-id and secret should be for an "Installed Application" when using // the CLI. Later we'll use a web application with a callback. - ClientId: readFile("client-id.dat"), + ClientID: readFile("client-id.dat"), ClientSecret: readFile("client-secret.dat"), - Scope: strings.Join([]string{ + Endpoint: google.Endpoint, + Scopes: []string{ compute.DevstorageFull_controlScope, compute.ComputeScope, "https://www.googleapis.com/auth/sqlservice", "https://www.googleapis.com/auth/sqlservice.admin", - }, " "), - AuthURL: "https://accounts.google.com/o/oauth2/auth", - TokenURL: "https://accounts.google.com/o/oauth2/token", + }, RedirectURL: "urn:ietf:wg:oauth:2.0:oob", } @@ -88,31 +88,32 @@ func main() { prefix := "https://www.googleapis.com/compute/v1/projects/" + *proj machType := prefix + "/zones/" + *zone + "/machineTypes/" + *mach - tr := &oauth.Transport{ - Config: config, - } - - tokenCache := oauth.CacheFile("token.dat") - token, err := tokenCache.Token() + const tokenFileName = "token.dat" + tokenFile := tokenCacheFile(tokenFileName) + tokenSource := oauth2.ReuseTokenSource(nil, tokenFile) + token, err := tokenSource.Token() if err != nil { if *writeObject != "" { log.Fatalf("Can't use --write_object without a valid token.dat file already cached.") } - log.Printf("Error getting token from %s: %v", string(tokenCache), err) + log.Printf("Error getting token from %s: %v", tokenFileName, err) log.Printf("Get auth code from %v", config.AuthCodeURL("my-state")) fmt.Print("\nEnter auth code: ") sc := bufio.NewScanner(os.Stdin) sc.Scan() authCode := strings.TrimSpace(sc.Text()) - token, err = tr.Exchange(authCode) + token, err = config.Exchange(oauth2.NoContext, authCode) if err != nil { log.Fatalf("Error exchanging auth code for a token: %v", err) } - tokenCache.PutToken(token) + if err := tokenFile.WriteToken(token); err != nil { + log.Fatalf("Error writing to %s: %v", tokenFileName, err) + } + tokenSource = oauth2.ReuseTokenSource(token, nil) } - tr.Token = token - oauthClient := &http.Client{Transport: tr} + oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource) + if *writeObject != "" { writeCloudStorageObject(oauthClient) return @@ -277,3 +278,25 @@ func writeCloudStorageObject(httpClient *http.Client) { log.Printf("Success.") os.Exit(0) } + +type tokenCacheFile string + +func (f tokenCacheFile) Token() (*oauth2.Token, error) { + slurp, err := ioutil.ReadFile(string(f)) + if err != nil { + return nil, err + } + t := new(oauth2.Token) + if err := json.Unmarshal(slurp, t); err != nil { + return nil, err + } + return t, nil +} + +func (f tokenCacheFile) WriteToken(t *oauth2.Token) error { + jt, err := json.Marshal(t) + if err != nil { + return err + } + return ioutil.WriteFile(string(f), jt, 0600) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.key similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.key diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.pem b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.pem similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.pem rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.pem diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.srl similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/rootCA.srl diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/server.crt similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/server.crt diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key b/Godeps/_workspace/src/golang.org/x/net/http2/h2demo/server.key similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key rename to Godeps/_workspace/src/golang.org/x/net/http2/h2demo/server.key diff --git a/Godeps/_workspace/src/golang.org/x/net/http2/h2i/README.md b/Godeps/_workspace/src/golang.org/x/net/http2/h2i/README.md new file mode 100644 index 00000000000..fb5c5efb0f0 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/http2/h2i/README.md @@ -0,0 +1,97 @@ +# h2i + +**h2i** is an interactive HTTP/2 ("h2") console debugger. Miss the good ol' +days of telnetting to your HTTP/1.n servers? We're bringing you +back. + +Features: +- send raw HTTP/2 frames + - PING + - SETTINGS + - HEADERS + - etc +- type in HTTP/1.n and have it auto-HPACK/frame-ify it for HTTP/2 +- pretty print all received HTTP/2 frames from the peer (including HPACK decoding) +- tab completion of commands, options + +Not yet features, but soon: +- unnecessary CONTINUATION frames on short boundaries, to test peer implementations +- request bodies (DATA frames) +- send invalid frames for testing server implementations (supported by underlying Framer) + +Later: +- act like a server + +## Installation + +``` +$ go get golang.org/x/net/http2/h2i +$ h2i +``` + +## Demo + +``` +$ h2i +Usage: h2i + + -insecure + Whether to skip TLS cert validation + -nextproto string + Comma-separated list of NPN/ALPN protocol names to negotiate. (default "h2,h2-14") + +$ h2i google.com +Connecting to google.com:443 ... +Connected to 74.125.224.41:443 +Negotiated protocol "h2-14" +[FrameHeader SETTINGS len=18] + [MAX_CONCURRENT_STREAMS = 100] + [INITIAL_WINDOW_SIZE = 1048576] + [MAX_FRAME_SIZE = 16384] +[FrameHeader WINDOW_UPDATE len=4] + Window-Increment = 983041 + +h2i> PING h2iSayHI +[FrameHeader PING flags=ACK len=8] + Data = "h2iSayHI" +h2i> headers +(as HTTP/1.1)> GET / HTTP/1.1 +(as HTTP/1.1)> Host: ip.appspot.com +(as HTTP/1.1)> User-Agent: h2i/brad-n-blake +(as HTTP/1.1)> +Opening Stream-ID 1: + :authority = ip.appspot.com + :method = GET + :path = / + :scheme = https + user-agent = h2i/brad-n-blake +[FrameHeader HEADERS flags=END_HEADERS stream=1 len=77] + :status = "200" + alternate-protocol = "443:quic,p=1" + content-length = "15" + content-type = "text/html" + date = "Fri, 01 May 2015 23:06:56 GMT" + server = "Google Frontend" +[FrameHeader DATA flags=END_STREAM stream=1 len=15] + "173.164.155.78\n" +[FrameHeader PING len=8] + Data = "\x00\x00\x00\x00\x00\x00\x00\x00" +h2i> ping +[FrameHeader PING flags=ACK len=8] + Data = "h2i_ping" +h2i> ping +[FrameHeader PING flags=ACK len=8] + Data = "h2i_ping" +h2i> ping +[FrameHeader GOAWAY len=22] + Last-Stream-ID = 1; Error-Code = PROTOCOL_ERROR (1) + +ReadFrame: EOF +``` + +## Status + +Quick few hour hack. So much yet to do. Feel free to file issues for +bugs or wishlist items, but [@bmizerany](https://github.com/bmizerany/) +and I aren't yet accepting pull requests until things settle down. + diff --git a/Godeps/_workspace/src/golang.org/x/net/http2/h2i/h2i.go b/Godeps/_workspace/src/golang.org/x/net/http2/h2i/h2i.go new file mode 100644 index 00000000000..73efe86011b --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/http2/h2i/h2i.go @@ -0,0 +1,489 @@ +// Copyright 2015 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +/* +The h2i command is an interactive HTTP/2 console. + +Usage: + $ h2i [flags] + +Interactive commands in the console: (all parts case-insensitive) + + ping [data] + settings ack + settings FOO=n BAR=z + headers (open a new stream by typing HTTP/1.1) +*/ +package main + +import ( + "bufio" + "bytes" + "crypto/tls" + "errors" + "flag" + "fmt" + "io" + "log" + "net" + "net/http" + "os" + "regexp" + "strconv" + "strings" + + "golang.org/x/crypto/ssh/terminal" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" +) + +// Flags +var ( + flagNextProto = flag.String("nextproto", "h2,h2-14", "Comma-separated list of NPN/ALPN protocol names to negotiate.") + flagInsecure = flag.Bool("insecure", false, "Whether to skip TLS cert validation") +) + +type command struct { + run func(*h2i, []string) error // required + + // complete optionally specifies tokens (case-insensitive) which are + // valid for this subcommand. + complete func() []string +} + +var commands = map[string]command{ + "ping": command{run: (*h2i).cmdPing}, + "settings": command{ + run: (*h2i).cmdSettings, + complete: func() []string { + return []string{ + "ACK", + http2.SettingHeaderTableSize.String(), + http2.SettingEnablePush.String(), + http2.SettingMaxConcurrentStreams.String(), + http2.SettingInitialWindowSize.String(), + http2.SettingMaxFrameSize.String(), + http2.SettingMaxHeaderListSize.String(), + } + }, + }, + "quit": command{run: (*h2i).cmdQuit}, + "headers": command{run: (*h2i).cmdHeaders}, +} + +func usage() { + fmt.Fprintf(os.Stderr, "Usage: h2i \n\n") + flag.PrintDefaults() + os.Exit(1) +} + +// withPort adds ":443" if another port isn't already present. +func withPort(host string) string { + if _, _, err := net.SplitHostPort(host); err != nil { + return net.JoinHostPort(host, "443") + } + return host +} + +// h2i is the app's state. +type h2i struct { + host string + tc *tls.Conn + framer *http2.Framer + term *terminal.Terminal + + // owned by the command loop: + streamID uint32 + hbuf bytes.Buffer + henc *hpack.Encoder + + // owned by the readFrames loop: + peerSetting map[http2.SettingID]uint32 + hdec *hpack.Decoder +} + +func main() { + flag.Usage = usage + flag.Parse() + if flag.NArg() != 1 { + usage() + } + log.SetFlags(0) + + host := flag.Arg(0) + app := &h2i{ + host: host, + peerSetting: make(map[http2.SettingID]uint32), + } + app.henc = hpack.NewEncoder(&app.hbuf) + + if err := app.Main(); err != nil { + if app.term != nil { + app.logf("%v\n", err) + } else { + fmt.Fprintf(os.Stderr, "%v\n", err) + } + os.Exit(1) + } + fmt.Fprintf(os.Stdout, "\n") +} + +func (app *h2i) Main() error { + cfg := &tls.Config{ + ServerName: app.host, + NextProtos: strings.Split(*flagNextProto, ","), + InsecureSkipVerify: *flagInsecure, + } + + hostAndPort := withPort(app.host) + log.Printf("Connecting to %s ...", hostAndPort) + tc, err := tls.Dial("tcp", hostAndPort, cfg) + if err != nil { + return fmt.Errorf("Error dialing %s: %v", withPort(app.host), err) + } + log.Printf("Connected to %v", tc.RemoteAddr()) + defer tc.Close() + + if err := tc.Handshake(); err != nil { + return fmt.Errorf("TLS handshake: %v", err) + } + if !*flagInsecure { + if err := tc.VerifyHostname(app.host); err != nil { + return fmt.Errorf("VerifyHostname: %v", err) + } + } + state := tc.ConnectionState() + log.Printf("Negotiated protocol %q", state.NegotiatedProtocol) + if !state.NegotiatedProtocolIsMutual || state.NegotiatedProtocol == "" { + return fmt.Errorf("Could not negotiate protocol mutually") + } + + if _, err := io.WriteString(tc, http2.ClientPreface); err != nil { + return err + } + + app.framer = http2.NewFramer(tc, tc) + + oldState, err := terminal.MakeRaw(0) + if err != nil { + return err + } + defer terminal.Restore(0, oldState) + + var screen = struct { + io.Reader + io.Writer + }{os.Stdin, os.Stdout} + + app.term = terminal.NewTerminal(screen, "h2i> ") + lastWord := regexp.MustCompile(`.+\W(\w+)$`) + app.term.AutoCompleteCallback = func(line string, pos int, key rune) (newLine string, newPos int, ok bool) { + if key != '\t' { + return + } + if pos != len(line) { + // TODO: we're being lazy for now, only supporting tab completion at the end. + return + } + // Auto-complete for the command itself. + if !strings.Contains(line, " ") { + var name string + name, _, ok = lookupCommand(line) + if !ok { + return + } + return name, len(name), true + } + _, c, ok := lookupCommand(line[:strings.IndexByte(line, ' ')]) + if !ok || c.complete == nil { + return + } + if strings.HasSuffix(line, " ") { + app.logf("%s", strings.Join(c.complete(), " ")) + return line, pos, true + } + m := lastWord.FindStringSubmatch(line) + if m == nil { + return line, len(line), true + } + soFar := m[1] + var match []string + for _, cand := range c.complete() { + if len(soFar) > len(cand) || !strings.EqualFold(cand[:len(soFar)], soFar) { + continue + } + match = append(match, cand) + } + if len(match) == 0 { + return + } + if len(match) > 1 { + // TODO: auto-complete any common prefix + app.logf("%s", strings.Join(match, " ")) + return line, pos, true + } + newLine = line[:len(line)-len(soFar)] + match[0] + return newLine, len(newLine), true + + } + + errc := make(chan error, 2) + go func() { errc <- app.readFrames() }() + go func() { errc <- app.readConsole() }() + return <-errc +} + +func (app *h2i) logf(format string, args ...interface{}) { + fmt.Fprintf(app.term, format+"\n", args...) +} + +func (app *h2i) readConsole() error { + for { + line, err := app.term.ReadLine() + if err == io.EOF { + return nil + } + if err != nil { + return fmt.Errorf("terminal.ReadLine: %v", err) + } + f := strings.Fields(line) + if len(f) == 0 { + continue + } + cmd, args := f[0], f[1:] + if _, c, ok := lookupCommand(cmd); ok { + err = c.run(app, args) + } else { + app.logf("Unknown command %q", line) + } + if err == errExitApp { + return nil + } + if err != nil { + return err + } + } +} + +func lookupCommand(prefix string) (name string, c command, ok bool) { + prefix = strings.ToLower(prefix) + if c, ok = commands[prefix]; ok { + return prefix, c, ok + } + + for full, candidate := range commands { + if strings.HasPrefix(full, prefix) { + if c.run != nil { + return "", command{}, false // ambiguous + } + c = candidate + name = full + } + } + return name, c, c.run != nil +} + +var errExitApp = errors.New("internal sentinel error value to quit the console reading loop") + +func (a *h2i) cmdQuit(args []string) error { + if len(args) > 0 { + a.logf("the QUIT command takes no argument") + return nil + } + return errExitApp +} + +func (a *h2i) cmdSettings(args []string) error { + if len(args) == 1 && strings.EqualFold(args[0], "ACK") { + return a.framer.WriteSettingsAck() + } + var settings []http2.Setting + for _, arg := range args { + if strings.EqualFold(arg, "ACK") { + a.logf("Error: ACK must be only argument with the SETTINGS command") + return nil + } + eq := strings.Index(arg, "=") + if eq == -1 { + a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) + return nil + } + sid, ok := settingByName(arg[:eq]) + if !ok { + a.logf("Error: unknown setting name %q", arg[:eq]) + return nil + } + val, err := strconv.ParseUint(arg[eq+1:], 10, 32) + if err != nil { + a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) + return nil + } + settings = append(settings, http2.Setting{ + ID: sid, + Val: uint32(val), + }) + } + a.logf("Sending: %v", settings) + return a.framer.WriteSettings(settings...) +} + +func settingByName(name string) (http2.SettingID, bool) { + for _, sid := range [...]http2.SettingID{ + http2.SettingHeaderTableSize, + http2.SettingEnablePush, + http2.SettingMaxConcurrentStreams, + http2.SettingInitialWindowSize, + http2.SettingMaxFrameSize, + http2.SettingMaxHeaderListSize, + } { + if strings.EqualFold(sid.String(), name) { + return sid, true + } + } + return 0, false +} + +func (app *h2i) cmdPing(args []string) error { + if len(args) > 1 { + app.logf("invalid PING usage: only accepts 0 or 1 args") + return nil // nil means don't end the program + } + var data [8]byte + if len(args) == 1 { + copy(data[:], args[0]) + } else { + copy(data[:], "h2i_ping") + } + return app.framer.WritePing(false, data) +} + +func (app *h2i) cmdHeaders(args []string) error { + if len(args) > 0 { + app.logf("Error: HEADERS doesn't yet take arguments.") + // TODO: flags for restricting window size, to force CONTINUATION + // frames. + return nil + } + var h1req bytes.Buffer + app.term.SetPrompt("(as HTTP/1.1)> ") + defer app.term.SetPrompt("h2i> ") + for { + line, err := app.term.ReadLine() + if err != nil { + return err + } + h1req.WriteString(line) + h1req.WriteString("\r\n") + if line == "" { + break + } + } + req, err := http.ReadRequest(bufio.NewReader(&h1req)) + if err != nil { + app.logf("Invalid HTTP/1.1 request: %v", err) + return nil + } + if app.streamID == 0 { + app.streamID = 1 + } else { + app.streamID += 2 + } + app.logf("Opening Stream-ID %d:", app.streamID) + hbf := app.encodeHeaders(req) + if len(hbf) > 16<<10 { + app.logf("TODO: h2i doesn't yet write CONTINUATION frames. Copy it from transport.go") + return nil + } + return app.framer.WriteHeaders(http2.HeadersFrameParam{ + StreamID: app.streamID, + BlockFragment: hbf, + EndStream: req.Method == "GET" || req.Method == "HEAD", // good enough for now + EndHeaders: true, // for now + }) +} + +func (app *h2i) readFrames() error { + for { + f, err := app.framer.ReadFrame() + if err != nil { + return fmt.Errorf("ReadFrame: %v", err) + } + app.logf("%v", f) + switch f := f.(type) { + case *http2.PingFrame: + app.logf(" Data = %q", f.Data) + case *http2.SettingsFrame: + f.ForeachSetting(func(s http2.Setting) error { + app.logf(" %v", s) + app.peerSetting[s.ID] = s.Val + return nil + }) + case *http2.WindowUpdateFrame: + app.logf(" Window-Increment = %v\n", f.Increment) + case *http2.GoAwayFrame: + app.logf(" Last-Stream-ID = %d; Error-Code = %v (%d)\n", f.LastStreamID, f.ErrCode, f.ErrCode) + case *http2.DataFrame: + app.logf(" %q", f.Data()) + case *http2.HeadersFrame: + if f.HasPriority() { + app.logf(" PRIORITY = %v", f.Priority) + } + if app.hdec == nil { + // TODO: if the user uses h2i to send a SETTINGS frame advertising + // something larger, we'll need to respect SETTINGS_HEADER_TABLE_SIZE + // and stuff here instead of using the 4k default. But for now: + tableSize := uint32(4 << 10) + app.hdec = hpack.NewDecoder(tableSize, app.onNewHeaderField) + } + app.hdec.Write(f.HeaderBlockFragment()) + } + } +} + +// called from readLoop +func (app *h2i) onNewHeaderField(f hpack.HeaderField) { + if f.Sensitive { + app.logf(" %s = %q (SENSITIVE)", f.Name, f.Value) + } + app.logf(" %s = %q", f.Name, f.Value) +} + +func (app *h2i) encodeHeaders(req *http.Request) []byte { + app.hbuf.Reset() + + // TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go + host := req.Host + if host == "" { + host = req.URL.Host + } + + path := req.URL.Path + if path == "" { + path = "/" + } + + app.writeHeader(":authority", host) // probably not right for all sites + app.writeHeader(":method", req.Method) + app.writeHeader(":path", path) + app.writeHeader(":scheme", "https") + + for k, vv := range req.Header { + lowKey := strings.ToLower(k) + if lowKey == "host" { + continue + } + for _, v := range vv { + app.writeHeader(lowKey, v) + } + } + return app.hbuf.Bytes() +} + +func (app *h2i) writeHeader(name, value string) { + app.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) + app.logf(" %s = %s", name, value) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go b/Godeps/_workspace/src/golang.org/x/net/http2/headermap.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go rename to Godeps/_workspace/src/golang.org/x/net/http2/headermap.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go b/Godeps/_workspace/src/golang.org/x/net/http2/hpack/encode.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go rename to Godeps/_workspace/src/golang.org/x/net/http2/hpack/encode.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go b/Godeps/_workspace/src/golang.org/x/net/http2/hpack/hpack.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go rename to Godeps/_workspace/src/golang.org/x/net/http2/hpack/hpack.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go b/Godeps/_workspace/src/golang.org/x/net/http2/hpack/huffman.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go rename to Godeps/_workspace/src/golang.org/x/net/http2/hpack/huffman.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go b/Godeps/_workspace/src/golang.org/x/net/http2/hpack/tables.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go rename to Godeps/_workspace/src/golang.org/x/net/http2/hpack/tables.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/http2.go b/Godeps/_workspace/src/golang.org/x/net/http2/http2.go similarity index 98% rename from Godeps/_workspace/src/github.com/bradfitz/http2/http2.go rename to Godeps/_workspace/src/golang.org/x/net/http2/http2.go index 136692a554a..35f9b26e282 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/http2.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/http2.go @@ -13,7 +13,7 @@ // ConfigureServer. That ConfigureServer call will likely be automatic // or available via an empty import in the future. // -// This package currently targets draft-14. See http://http2.github.io/ +// See http://http2.github.io/ package http2 import ( diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go b/Godeps/_workspace/src/golang.org/x/net/http2/pipe.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go rename to Godeps/_workspace/src/golang.org/x/net/http2/pipe.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/server.go b/Godeps/_workspace/src/golang.org/x/net/http2/server.go similarity index 99% rename from Godeps/_workspace/src/github.com/bradfitz/http2/server.go rename to Godeps/_workspace/src/golang.org/x/net/http2/server.go index 6ac4c4aa2c2..99cc673cc2e 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/server.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/server.go @@ -55,7 +55,7 @@ import ( "sync" "time" - "github.com/bradfitz/http2/hpack" + "golang.org/x/net/http2/hpack" ) const ( @@ -631,6 +631,9 @@ func (sc *serverConn) serve() { case wm := <-sc.wantWriteFrameCh: sc.writeFrame(wm) case <-sc.wroteFrameCh: + if sc.writingFrame != true { + panic("internal error: expected to be already writing a frame") + } sc.writingFrame = false sc.scheduleFrameWrite() case fg, ok := <-sc.readFrameCh: @@ -752,6 +755,7 @@ func (sc *serverConn) startFrameWrite(wm frameWriteMsg) { if sc.writingFrame { panic("internal error: can only be writing one frame at a time") } + sc.writingFrame = true st := wm.stream if st != nil { @@ -768,7 +772,6 @@ func (sc *serverConn) startFrameWrite(wm frameWriteMsg) { } } - sc.writingFrame = true sc.needsFrameFlush = true if endsStream(wm.write) { if st == nil { diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/transport.go b/Godeps/_workspace/src/golang.org/x/net/http2/transport.go similarity index 99% rename from Godeps/_workspace/src/github.com/bradfitz/http2/transport.go rename to Godeps/_workspace/src/golang.org/x/net/http2/transport.go index ea62188db50..73f358eefed 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/transport.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/transport.go @@ -19,7 +19,7 @@ import ( "strings" "sync" - "github.com/bradfitz/http2/hpack" + "golang.org/x/net/http2/hpack" ) type Transport struct { @@ -186,7 +186,7 @@ func (t *Transport) newClientConn(host, port, key string) (*clientConn, error) { NextProtos: []string{NextProtoTLS}, InsecureSkipVerify: t.InsecureTLSDial, } - tconn, err := tls.Dial("tcp", host+":"+port, cfg) + tconn, err := tls.Dial("tcp", net.JoinHostPort(host, port), cfg) if err != nil { return nil, err } diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/write.go b/Godeps/_workspace/src/golang.org/x/net/http2/write.go similarity index 99% rename from Godeps/_workspace/src/github.com/bradfitz/http2/write.go rename to Godeps/_workspace/src/golang.org/x/net/http2/write.go index 7b9bdd3a6a1..02f0743de63 100644 --- a/Godeps/_workspace/src/github.com/bradfitz/http2/write.go +++ b/Godeps/_workspace/src/golang.org/x/net/http2/write.go @@ -13,7 +13,7 @@ import ( "net/http" "time" - "github.com/bradfitz/http2/hpack" + "golang.org/x/net/http2/hpack" ) // writeFramer is implemented by any type that is used to write frames. diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go b/Godeps/_workspace/src/golang.org/x/net/http2/writesched.go similarity index 100% rename from Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go rename to Godeps/_workspace/src/golang.org/x/net/http2/writesched.go diff --git a/Godeps/_workspace/src/google.golang.org/grpc/.travis.yml b/Godeps/_workspace/src/google.golang.org/grpc/.travis.yml index 25035601429..3f83776ec5f 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/.travis.yml +++ b/Godeps/_workspace/src/google.golang.org/grpc/.travis.yml @@ -1,4 +1,14 @@ language: go +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover + +install: + - mkdir -p "$GOPATH/src/google.golang.org" + - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/google.golang.org/grpc" + script: - make test testrace + - make coverage diff --git a/Godeps/_workspace/src/google.golang.org/grpc/grpc-auth-support.md b/Godeps/_workspace/src/google.golang.org/grpc/Documentation/grpc-auth-support.md similarity index 73% rename from Godeps/_workspace/src/google.golang.org/grpc/grpc-auth-support.md rename to Godeps/_workspace/src/google.golang.org/grpc/Documentation/grpc-auth-support.md index f80cbbdb273..5a075f61320 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/grpc-auth-support.md +++ b/Godeps/_workspace/src/google.golang.org/grpc/Documentation/grpc-auth-support.md @@ -1,6 +1,6 @@ # Authentication -As outlined here gRPC supports a number of different mechanisms for asserting identity between an client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it. +As outlined in the [gRPC authentication guide](http://www.grpc.io/docs/guides/auth.html) there are a number of different mechanisms for asserting identity between an client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it. # Enabling TLS on a gRPC client diff --git a/Godeps/_workspace/src/google.golang.org/grpc/Makefile b/Godeps/_workspace/src/google.golang.org/grpc/Makefile index 0dc225ff41e..12e84e4e5be 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/Makefile +++ b/Godeps/_workspace/src/google.golang.org/grpc/Makefile @@ -45,3 +45,6 @@ testrace: testdeps clean: go clean google.golang.org/grpc/... + +coverage: testdeps + ./coverage.sh --coveralls diff --git a/Godeps/_workspace/src/google.golang.org/grpc/README.md b/Godeps/_workspace/src/google.golang.org/grpc/README.md index f16d406a8eb..37b05f0953d 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/README.md +++ b/Godeps/_workspace/src/google.golang.org/grpc/README.md @@ -2,12 +2,12 @@ [![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) -The Go implementation of [gRPC](https://github.com/grpc/grpc) +The Go implementation of [gRPC](http://www.grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [gRPC Quick Start](http://www.grpc.io/docs/) guide. Installation ------------ -To install this package, you need to install Go 1.4 and setup your Go workspace on your computer. The simplest way to install the library is to run: +To install this package, you need to install Go 1.4 or above and setup your Go workspace on your computer. The simplest way to install the library is to run: ``` $ go get google.golang.org/grpc @@ -18,11 +18,15 @@ Prerequisites This requires Go 1.4 or above. +Constraints +----------- +The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](http://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants. + Documentation ------------- -You can find more detailed documentation and examples in the [examples directory](examples/). +See [API documentation](https://godoc.org/google.golang.org/grpc) for package and API descriptions and find examples in the [examples directory](examples/). Status ------ -Alpha - ready for early adopters. +Beta release diff --git a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/client/main.go b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/client/main.go index f9e2a83dbde..e7f0a8fb2c9 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/client/main.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/client/main.go @@ -92,13 +92,6 @@ func closeLoopUnary() { func closeLoopStream() { s, conn, tc := buildConnection() - stream, err := tc.StreamingCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) - } - for i := 0; i < 100; i++ { - streamCaller(tc, stream) - } ch := make(chan int, *maxConcurrentRPCs*4) var ( mu sync.Mutex @@ -108,7 +101,15 @@ func closeLoopStream() { // Distribute RPCs over maxConcurrentCalls workers. for i := 0; i < *maxConcurrentRPCs; i++ { go func() { - for _ = range ch { + stream, err := tc.StreamingCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) + } + // Do some warm up. + for i := 0; i < 100; i++ { + streamCaller(tc, stream) + } + for range ch { start := time.Now() streamCaller(tc, stream) elapse := time.Since(start) diff --git a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go index 619c450cad5..c080709e132 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go @@ -27,18 +27,22 @@ It has these top-level messages: package grpc_testing import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 type PayloadType int32 @@ -65,6 +69,7 @@ var PayloadType_value = map[string]int32{ func (x PayloadType) String() string { return proto.EnumName(PayloadType_name, int32(x)) } +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type ClientType int32 @@ -85,6 +90,7 @@ var ClientType_value = map[string]int32{ func (x ClientType) String() string { return proto.EnumName(ClientType_name, int32(x)) } +func (ClientType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } type ServerType int32 @@ -105,6 +111,7 @@ var ServerType_value = map[string]int32{ func (x ServerType) String() string { return proto.EnumName(ServerType_name, int32(x)) } +func (ServerType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } type RpcType int32 @@ -125,15 +132,17 @@ var RpcType_value = map[string]int32{ func (x RpcType) String() string { return proto.EnumName(RpcType_name, int32(x)) } +func (RpcType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } type StatsRequest struct { // run number TestNum int32 `protobuf:"varint,1,opt,name=test_num" json:"test_num,omitempty"` } -func (m *StatsRequest) Reset() { *m = StatsRequest{} } -func (m *StatsRequest) String() string { return proto.CompactTextString(m) } -func (*StatsRequest) ProtoMessage() {} +func (m *StatsRequest) Reset() { *m = StatsRequest{} } +func (m *StatsRequest) String() string { return proto.CompactTextString(m) } +func (*StatsRequest) ProtoMessage() {} +func (*StatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type ServerStats struct { // wall clock time @@ -144,9 +153,10 @@ type ServerStats struct { TimeSystem float64 `protobuf:"fixed64,3,opt,name=time_system" json:"time_system,omitempty"` } -func (m *ServerStats) Reset() { *m = ServerStats{} } -func (m *ServerStats) String() string { return proto.CompactTextString(m) } -func (*ServerStats) ProtoMessage() {} +func (m *ServerStats) Reset() { *m = ServerStats{} } +func (m *ServerStats) String() string { return proto.CompactTextString(m) } +func (*ServerStats) ProtoMessage() {} +func (*ServerStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } type Payload struct { // The type of data in body. @@ -155,9 +165,10 @@ type Payload struct { Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` } -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } type HistogramData struct { Bucket []uint32 `protobuf:"varint,1,rep,name=bucket" json:"bucket,omitempty"` @@ -168,9 +179,10 @@ type HistogramData struct { Count float64 `protobuf:"fixed64,6,opt,name=count" json:"count,omitempty"` } -func (m *HistogramData) Reset() { *m = HistogramData{} } -func (m *HistogramData) String() string { return proto.CompactTextString(m) } -func (*HistogramData) ProtoMessage() {} +func (m *HistogramData) Reset() { *m = HistogramData{} } +func (m *HistogramData) String() string { return proto.CompactTextString(m) } +func (*HistogramData) ProtoMessage() {} +func (*HistogramData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } type ClientConfig struct { ServerTargets []string `protobuf:"bytes,1,rep,name=server_targets" json:"server_targets,omitempty"` @@ -184,41 +196,141 @@ type ClientConfig struct { RpcType RpcType `protobuf:"varint,8,opt,name=rpc_type,enum=grpc.testing.RpcType" json:"rpc_type,omitempty"` } -func (m *ClientConfig) Reset() { *m = ClientConfig{} } -func (m *ClientConfig) String() string { return proto.CompactTextString(m) } -func (*ClientConfig) ProtoMessage() {} +func (m *ClientConfig) Reset() { *m = ClientConfig{} } +func (m *ClientConfig) String() string { return proto.CompactTextString(m) } +func (*ClientConfig) ProtoMessage() {} +func (*ClientConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } // Request current stats type Mark struct { } -func (m *Mark) Reset() { *m = Mark{} } -func (m *Mark) String() string { return proto.CompactTextString(m) } -func (*Mark) ProtoMessage() {} +func (m *Mark) Reset() { *m = Mark{} } +func (m *Mark) String() string { return proto.CompactTextString(m) } +func (*Mark) ProtoMessage() {} +func (*Mark) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } type ClientArgs struct { - Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup" json:"setup,omitempty"` - Mark *Mark `protobuf:"bytes,2,opt,name=mark" json:"mark,omitempty"` + // Types that are valid to be assigned to Argtype: + // *ClientArgs_Setup + // *ClientArgs_Mark + Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"` } -func (m *ClientArgs) Reset() { *m = ClientArgs{} } -func (m *ClientArgs) String() string { return proto.CompactTextString(m) } -func (*ClientArgs) ProtoMessage() {} +func (m *ClientArgs) Reset() { *m = ClientArgs{} } +func (m *ClientArgs) String() string { return proto.CompactTextString(m) } +func (*ClientArgs) ProtoMessage() {} +func (*ClientArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isClientArgs_Argtype interface { + isClientArgs_Argtype() +} + +type ClientArgs_Setup struct { + Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup,oneof"` +} +type ClientArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` +} + +func (*ClientArgs_Setup) isClientArgs_Argtype() {} +func (*ClientArgs_Mark) isClientArgs_Argtype() {} + +func (m *ClientArgs) GetArgtype() isClientArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} func (m *ClientArgs) GetSetup() *ClientConfig { - if m != nil { - return m.Setup + if x, ok := m.GetArgtype().(*ClientArgs_Setup); ok { + return x.Setup } return nil } func (m *ClientArgs) GetMark() *Mark { - if m != nil { - return m.Mark + if x, ok := m.GetArgtype().(*ClientArgs_Mark); ok { + return x.Mark } return nil } +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ClientArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ClientArgs_OneofMarshaler, _ClientArgs_OneofUnmarshaler, _ClientArgs_OneofSizer, []interface{}{ + (*ClientArgs_Setup)(nil), + (*ClientArgs_Mark)(nil), + } +} + +func _ClientArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ClientArgs) + // argtype + switch x := m.Argtype.(type) { + case *ClientArgs_Setup: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Setup); err != nil { + return err + } + case *ClientArgs_Mark: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mark); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ClientArgs.Argtype has unexpected type %T", x) + } + return nil +} + +func _ClientArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ClientArgs) + switch tag { + case 1: // argtype.setup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ClientConfig) + err := b.DecodeMessage(msg) + m.Argtype = &ClientArgs_Setup{msg} + return true, err + case 2: // argtype.mark + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mark) + err := b.DecodeMessage(msg) + m.Argtype = &ClientArgs_Mark{msg} + return true, err + default: + return false, nil + } +} + +func _ClientArgs_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ClientArgs) + // argtype + switch x := m.Argtype.(type) { + case *ClientArgs_Setup: + s := proto.Size(x.Setup) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ClientArgs_Mark: + s := proto.Size(x.Mark) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + type ClientStats struct { Latencies *HistogramData `protobuf:"bytes,1,opt,name=latencies" json:"latencies,omitempty"` TimeElapsed float64 `protobuf:"fixed64,3,opt,name=time_elapsed" json:"time_elapsed,omitempty"` @@ -226,9 +338,10 @@ type ClientStats struct { TimeSystem float64 `protobuf:"fixed64,5,opt,name=time_system" json:"time_system,omitempty"` } -func (m *ClientStats) Reset() { *m = ClientStats{} } -func (m *ClientStats) String() string { return proto.CompactTextString(m) } -func (*ClientStats) ProtoMessage() {} +func (m *ClientStats) Reset() { *m = ClientStats{} } +func (m *ClientStats) String() string { return proto.CompactTextString(m) } +func (*ClientStats) ProtoMessage() {} +func (*ClientStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *ClientStats) GetLatencies() *HistogramData { if m != nil { @@ -241,9 +354,10 @@ type ClientStatus struct { Stats *ClientStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` } -func (m *ClientStatus) Reset() { *m = ClientStatus{} } -func (m *ClientStatus) String() string { return proto.CompactTextString(m) } -func (*ClientStatus) ProtoMessage() {} +func (m *ClientStatus) Reset() { *m = ClientStatus{} } +func (m *ClientStatus) String() string { return proto.CompactTextString(m) } +func (*ClientStatus) ProtoMessage() {} +func (*ClientStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *ClientStatus) GetStats() *ClientStats { if m != nil { @@ -258,41 +372,141 @@ type ServerConfig struct { EnableSsl bool `protobuf:"varint,3,opt,name=enable_ssl" json:"enable_ssl,omitempty"` } -func (m *ServerConfig) Reset() { *m = ServerConfig{} } -func (m *ServerConfig) String() string { return proto.CompactTextString(m) } -func (*ServerConfig) ProtoMessage() {} +func (m *ServerConfig) Reset() { *m = ServerConfig{} } +func (m *ServerConfig) String() string { return proto.CompactTextString(m) } +func (*ServerConfig) ProtoMessage() {} +func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } type ServerArgs struct { - Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup" json:"setup,omitempty"` - Mark *Mark `protobuf:"bytes,2,opt,name=mark" json:"mark,omitempty"` + // Types that are valid to be assigned to Argtype: + // *ServerArgs_Setup + // *ServerArgs_Mark + Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"` } -func (m *ServerArgs) Reset() { *m = ServerArgs{} } -func (m *ServerArgs) String() string { return proto.CompactTextString(m) } -func (*ServerArgs) ProtoMessage() {} +func (m *ServerArgs) Reset() { *m = ServerArgs{} } +func (m *ServerArgs) String() string { return proto.CompactTextString(m) } +func (*ServerArgs) ProtoMessage() {} +func (*ServerArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +type isServerArgs_Argtype interface { + isServerArgs_Argtype() +} + +type ServerArgs_Setup struct { + Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup,oneof"` +} +type ServerArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` +} + +func (*ServerArgs_Setup) isServerArgs_Argtype() {} +func (*ServerArgs_Mark) isServerArgs_Argtype() {} + +func (m *ServerArgs) GetArgtype() isServerArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} func (m *ServerArgs) GetSetup() *ServerConfig { - if m != nil { - return m.Setup + if x, ok := m.GetArgtype().(*ServerArgs_Setup); ok { + return x.Setup } return nil } func (m *ServerArgs) GetMark() *Mark { - if m != nil { - return m.Mark + if x, ok := m.GetArgtype().(*ServerArgs_Mark); ok { + return x.Mark } return nil } +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ServerArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ServerArgs_OneofMarshaler, _ServerArgs_OneofUnmarshaler, _ServerArgs_OneofSizer, []interface{}{ + (*ServerArgs_Setup)(nil), + (*ServerArgs_Mark)(nil), + } +} + +func _ServerArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ServerArgs) + // argtype + switch x := m.Argtype.(type) { + case *ServerArgs_Setup: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Setup); err != nil { + return err + } + case *ServerArgs_Mark: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mark); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ServerArgs.Argtype has unexpected type %T", x) + } + return nil +} + +func _ServerArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ServerArgs) + switch tag { + case 1: // argtype.setup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ServerConfig) + err := b.DecodeMessage(msg) + m.Argtype = &ServerArgs_Setup{msg} + return true, err + case 2: // argtype.mark + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mark) + err := b.DecodeMessage(msg) + m.Argtype = &ServerArgs_Mark{msg} + return true, err + default: + return false, nil + } +} + +func _ServerArgs_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ServerArgs) + // argtype + switch x := m.Argtype.(type) { + case *ServerArgs_Setup: + s := proto.Size(x.Setup) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerArgs_Mark: + s := proto.Size(x.Mark) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + type ServerStatus struct { Stats *ServerStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` } -func (m *ServerStatus) Reset() { *m = ServerStatus{} } -func (m *ServerStatus) String() string { return proto.CompactTextString(m) } -func (*ServerStatus) ProtoMessage() {} +func (m *ServerStatus) Reset() { *m = ServerStatus{} } +func (m *ServerStatus) String() string { return proto.CompactTextString(m) } +func (*ServerStatus) ProtoMessage() {} +func (*ServerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *ServerStatus) GetStats() *ServerStats { if m != nil { @@ -312,9 +526,10 @@ type SimpleRequest struct { Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` } -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *SimpleRequest) GetPayload() *Payload { if m != nil { @@ -327,9 +542,10 @@ type SimpleResponse struct { Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` } -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *SimpleResponse) GetPayload() *Payload { if m != nil { @@ -339,12 +555,30 @@ func (m *SimpleResponse) GetPayload() *Payload { } func init() { + proto.RegisterType((*StatsRequest)(nil), "grpc.testing.StatsRequest") + proto.RegisterType((*ServerStats)(nil), "grpc.testing.ServerStats") + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*HistogramData)(nil), "grpc.testing.HistogramData") + proto.RegisterType((*ClientConfig)(nil), "grpc.testing.ClientConfig") + proto.RegisterType((*Mark)(nil), "grpc.testing.Mark") + proto.RegisterType((*ClientArgs)(nil), "grpc.testing.ClientArgs") + proto.RegisterType((*ClientStats)(nil), "grpc.testing.ClientStats") + proto.RegisterType((*ClientStatus)(nil), "grpc.testing.ClientStatus") + proto.RegisterType((*ServerConfig)(nil), "grpc.testing.ServerConfig") + proto.RegisterType((*ServerArgs)(nil), "grpc.testing.ServerArgs") + proto.RegisterType((*ServerStatus)(nil), "grpc.testing.ServerStatus") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) proto.RegisterEnum("grpc.testing.ClientType", ClientType_name, ClientType_value) proto.RegisterEnum("grpc.testing.ServerType", ServerType_name, ServerType_value) proto.RegisterEnum("grpc.testing.RpcType", RpcType_name, RpcType_value) } +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + // Client API for TestService service type TestServiceClient interface { @@ -419,9 +653,9 @@ func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { s.RegisterService(&_TestService_serviceDesc, srv) } -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(SimpleRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(TestServiceServer).UnaryCall(ctx, in) @@ -639,3 +873,69 @@ var _Worker_serviceDesc = grpc.ServiceDesc{ }, }, } + +var fileDescriptor0 = []byte{ + // 988 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x56, 0x5f, 0x6f, 0x1b, 0x45, + 0x10, 0xef, 0xc5, 0xff, 0xe2, 0x39, 0x27, 0x44, 0xab, 0x52, 0x39, 0x69, 0x11, 0x70, 0x05, 0x11, + 0x22, 0x91, 0x56, 0x46, 0x42, 0xea, 0x0b, 0x91, 0xeb, 0x1a, 0x52, 0x29, 0x71, 0xa2, 0xbd, 0x04, + 0xd4, 0xa7, 0xd3, 0xc6, 0xde, 0xb8, 0xa7, 0x9c, 0xef, 0xae, 0xb7, 0x7b, 0xa8, 0xe6, 0x09, 0xf1, + 0x19, 0xf8, 0x0a, 0x3c, 0x20, 0xbe, 0x24, 0xb3, 0xb3, 0x7b, 0x89, 0x9d, 0x9a, 0x36, 0x52, 0x9f, + 0x72, 0x3b, 0xf3, 0x9b, 0xdf, 0xce, 0xfe, 0xe6, 0x8f, 0x03, 0xa0, 0xa5, 0xd2, 0xfb, 0x79, 0x91, + 0xe9, 0x8c, 0x75, 0xa6, 0x45, 0x3e, 0xde, 0x37, 0x86, 0x38, 0x9d, 0x06, 0xdf, 0x42, 0x27, 0xd4, + 0x42, 0x2b, 0x2e, 0xdf, 0x94, 0x68, 0x62, 0xdb, 0xb0, 0x6e, 0x5c, 0x51, 0x5a, 0xce, 0xba, 0xde, + 0x17, 0xde, 0x6e, 0x83, 0xb7, 0xcc, 0x79, 0x54, 0xce, 0x82, 0x14, 0xfc, 0x50, 0x16, 0xbf, 0xc9, + 0x82, 0x02, 0xd8, 0x97, 0xd0, 0xd1, 0xf1, 0x4c, 0x46, 0x32, 0x11, 0xb9, 0x92, 0x13, 0x42, 0x7b, + 0xdc, 0x37, 0xb6, 0xa1, 0x35, 0xb1, 0x87, 0xd0, 0x26, 0x48, 0xa9, 0x64, 0xd1, 0x5d, 0x23, 0xff, + 0xba, 0x31, 0x9c, 0xe3, 0x99, 0x7d, 0x0e, 0x84, 0x8d, 0xd4, 0x5c, 0x69, 0x39, 0xeb, 0xd6, 0xc8, + 0x0d, 0xc6, 0x14, 0x92, 0x25, 0x38, 0x82, 0xd6, 0xa9, 0x98, 0x27, 0x99, 0x98, 0xb0, 0xef, 0xa0, + 0xae, 0xe7, 0xb9, 0xa4, 0x3b, 0x36, 0x7b, 0xdb, 0xfb, 0x8b, 0x4f, 0xd8, 0x77, 0xa0, 0x33, 0x04, + 0x70, 0x82, 0x31, 0x06, 0xf5, 0x8b, 0x6c, 0x32, 0xa7, 0x2b, 0x3b, 0x9c, 0xbe, 0x83, 0x7f, 0x3d, + 0xd8, 0x38, 0x8c, 0x95, 0xce, 0xa6, 0x85, 0x98, 0xbd, 0x10, 0x5a, 0xb0, 0x07, 0xd0, 0xbc, 0x28, + 0xc7, 0x57, 0x52, 0x23, 0x6d, 0x6d, 0x77, 0x83, 0xbb, 0x93, 0x91, 0x60, 0x16, 0xa7, 0x91, 0x92, + 0x32, 0x75, 0x49, 0xb7, 0xf0, 0x1c, 0xe2, 0x91, 0x5c, 0xe2, 0xad, 0x75, 0xd5, 0x9c, 0x4b, 0xbc, + 0x25, 0xd7, 0x16, 0xd4, 0x14, 0x6a, 0x56, 0x27, 0xab, 0xf9, 0x64, 0x5f, 0xc1, 0x26, 0xfe, 0x89, + 0xb2, 0xcb, 0x48, 0xbd, 0x29, 0x45, 0x21, 0x55, 0xb7, 0x41, 0xce, 0x0e, 0x5a, 0x4f, 0x2e, 0x43, + 0x6b, 0x63, 0xf7, 0xa1, 0x31, 0xce, 0xca, 0x54, 0x77, 0x9b, 0xe4, 0xb4, 0x87, 0xe0, 0x8f, 0x1a, + 0x74, 0x06, 0x49, 0x2c, 0x53, 0x3d, 0xc8, 0xd2, 0xcb, 0x78, 0xca, 0xbe, 0x46, 0x32, 0x12, 0x3f, + 0xd2, 0xa2, 0x98, 0x4a, 0xad, 0x28, 0xe9, 0x36, 0xdf, 0xb0, 0xd6, 0x33, 0x6b, 0x64, 0xcf, 0xc0, + 0x1f, 0x53, 0x58, 0x44, 0x7a, 0xad, 0x91, 0x5e, 0xdd, 0x65, 0xbd, 0x2c, 0x2f, 0xc9, 0x05, 0xe3, + 0xeb, 0x6f, 0xf6, 0x19, 0x80, 0x4c, 0xc5, 0x45, 0x82, 0x15, 0x51, 0x09, 0xbd, 0x6e, 0x9d, 0xb7, + 0xad, 0x25, 0x54, 0x09, 0x3b, 0x80, 0x47, 0x59, 0xa9, 0x95, 0x16, 0xe9, 0x04, 0x49, 0x22, 0x24, + 0x54, 0x51, 0x8e, 0xe9, 0x8c, 0x5f, 0x8b, 0x34, 0x95, 0x09, 0x3d, 0xbc, 0xc1, 0xb7, 0x17, 0x30, + 0x1c, 0x21, 0xa7, 0xb2, 0x18, 0x58, 0x00, 0xfb, 0x06, 0x3e, 0x71, 0xa9, 0xb9, 0x10, 0xab, 0x47, + 0x83, 0x6f, 0x5a, 0xb3, 0xc3, 0x51, 0x63, 0xe5, 0xb6, 0xa4, 0x91, 0x8a, 0x7f, 0x97, 0x24, 0x4c, + 0x83, 0xfb, 0xce, 0x16, 0xa2, 0x89, 0x3d, 0x85, 0xfb, 0x42, 0xcd, 0xd3, 0x71, 0x54, 0x3d, 0xf6, + 0x75, 0x21, 0xc5, 0x44, 0x75, 0x5b, 0x04, 0x65, 0xe4, 0x73, 0xcf, 0xb4, 0x1e, 0x8c, 0x58, 0xc7, + 0x94, 0xad, 0x2a, 0xeb, 0xa4, 0xca, 0xa7, 0xcb, 0xaa, 0x60, 0xb6, 0x24, 0x49, 0xab, 0xb0, 0x1f, + 0x41, 0x13, 0xea, 0xc7, 0xa2, 0xb8, 0x0a, 0x4a, 0x00, 0x4b, 0xd5, 0x2f, 0xa6, 0x8a, 0xf5, 0xa0, + 0xa1, 0xa4, 0x2e, 0x73, 0x6a, 0x45, 0xbf, 0xb7, 0xb3, 0x4a, 0x5a, 0x5b, 0xb2, 0xc3, 0x7b, 0xdc, + 0x42, 0xd9, 0x2e, 0xd4, 0x67, 0xc8, 0x44, 0xd5, 0xf0, 0x7b, 0x6c, 0x39, 0xc4, 0xdc, 0x81, 0x50, + 0x42, 0x3c, 0x6f, 0x43, 0x0b, 0x0b, 0x69, 0x92, 0x0c, 0xfe, 0xf1, 0xc0, 0xb7, 0x74, 0x76, 0xdc, + 0x9e, 0x41, 0x3b, 0x11, 0x5a, 0xa6, 0xe3, 0x58, 0x2a, 0x77, 0xf9, 0xc3, 0x65, 0xa6, 0xa5, 0xee, + 0xe6, 0x37, 0xe8, 0x77, 0x26, 0xb5, 0xf6, 0x81, 0x49, 0xad, 0xbf, 0x7f, 0x52, 0x1b, 0xef, 0x4c, + 0xea, 0x41, 0xd5, 0xac, 0x26, 0xd5, 0x52, 0xb1, 0x27, 0x28, 0x92, 0x49, 0xda, 0xe5, 0xb9, 0xbd, + 0x4a, 0x24, 0xbb, 0x75, 0x2c, 0x2e, 0xf8, 0xd3, 0xc3, 0x35, 0x44, 0x8d, 0xec, 0xda, 0x1d, 0xfb, + 0xb8, 0x6a, 0xf7, 0x9b, 0xb9, 0xbf, 0xd5, 0xc7, 0x36, 0xc0, 0xf6, 0xb1, 0xba, 0xfe, 0x66, 0x5d, + 0x68, 0x55, 0xed, 0xb0, 0xe6, 0x16, 0x98, 0xeb, 0x81, 0xf7, 0x77, 0xb8, 0x29, 0xb4, 0xa5, 0xbc, + 0x43, 0xa1, 0x17, 0x93, 0xfd, 0xc8, 0x42, 0x87, 0xd5, 0xd3, 0xef, 0x24, 0xde, 0xc2, 0x06, 0x76, + 0xe2, 0x99, 0x6d, 0x97, 0x67, 0x85, 0x76, 0xaf, 0xa5, 0xef, 0xe0, 0x6f, 0xdc, 0x76, 0x61, 0x3c, + 0xcb, 0x13, 0x59, 0x2d, 0xf6, 0x1f, 0x61, 0x03, 0xd7, 0x4d, 0x9e, 0xa5, 0x4a, 0x46, 0x77, 0xdb, + 0xa5, 0x9d, 0x0a, 0x4f, 0xb2, 0x3e, 0x5e, 0x88, 0xa7, 0xb1, 0xb4, 0xd7, 0x5d, 0x83, 0x68, 0x2e, + 0x9f, 0x40, 0xcb, 0x8d, 0x29, 0xc9, 0xeb, 0xdf, 0x1e, 0x32, 0x47, 0xcf, 0x2b, 0x54, 0xd0, 0x87, + 0xcd, 0x2a, 0x4d, 0x4b, 0xb3, 0x48, 0xe1, 0xdd, 0x85, 0x62, 0xef, 0x00, 0xfc, 0x85, 0xac, 0x71, + 0x0f, 0x77, 0x06, 0x27, 0xc7, 0xa7, 0x7c, 0x18, 0x86, 0xfd, 0xe7, 0x47, 0xc3, 0xad, 0x7b, 0xa8, + 0xcf, 0xe6, 0xf9, 0x68, 0xc9, 0xe6, 0x31, 0x80, 0x26, 0xef, 0x8f, 0x5e, 0x9c, 0x1c, 0x6f, 0xad, + 0xed, 0xfd, 0x50, 0x0d, 0x38, 0xc5, 0x3f, 0x00, 0x16, 0xbe, 0x1a, 0x0d, 0x0e, 0xf9, 0xc9, 0xe8, + 0xe4, 0x3c, 0x8c, 0x06, 0x47, 0x2f, 0x87, 0xa3, 0x33, 0x64, 0x41, 0xde, 0xbe, 0x71, 0x54, 0x16, + 0xcf, 0xc4, 0xdd, 0xb4, 0xe0, 0xed, 0xb8, 0x70, 0xc8, 0x7f, 0x19, 0xf2, 0xc5, 0x38, 0x67, 0xf1, + 0xf6, 0x1e, 0x43, 0xcb, 0x2d, 0x1b, 0xd6, 0x86, 0xc6, 0xf9, 0xa8, 0xcf, 0x5f, 0x21, 0x6e, 0x03, + 0xda, 0xe1, 0x19, 0x1f, 0xf6, 0x8f, 0x5f, 0x8e, 0x7e, 0xde, 0xf2, 0x7a, 0x58, 0x40, 0xff, 0x0c, + 0x9f, 0x6c, 0x6e, 0x88, 0xc7, 0x92, 0xfd, 0x04, 0xed, 0xf3, 0x54, 0x14, 0xf3, 0x81, 0x48, 0x12, + 0x76, 0x6b, 0xf0, 0x97, 0x0a, 0xbd, 0xf3, 0x68, 0xb5, 0xd3, 0xc9, 0x3b, 0xc2, 0xbe, 0xd0, 0x38, + 0x0e, 0xf8, 0x8b, 0x36, 0xfd, 0x48, 0xae, 0x5d, 0xef, 0xa9, 0xd7, 0xfb, 0xcb, 0x83, 0xe6, 0xaf, + 0x59, 0x71, 0x85, 0x6b, 0x62, 0x80, 0xef, 0x2a, 0x53, 0x93, 0x34, 0x5b, 0xf9, 0x8b, 0x63, 0xc6, + 0x6a, 0x67, 0xe7, 0xff, 0x76, 0x41, 0xa9, 0x0c, 0x1f, 0x1b, 0x42, 0x1b, 0x49, 0xac, 0xae, 0x6c, + 0xe5, 0xc0, 0xaf, 0xa2, 0x59, 0x1c, 0x20, 0x43, 0x73, 0xd1, 0xa4, 0xff, 0x75, 0xbe, 0xff, 0x2f, + 0x00, 0x00, 0xff, 0xff, 0xe3, 0xb1, 0x00, 0x4d, 0xf9, 0x08, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.proto b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.proto index e3a27f861b8..b0b2f80b56f 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.proto +++ b/Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.proto @@ -17,7 +17,7 @@ enum PayloadType { message StatsRequest { // run number - optional int32 test_num = 1; + int32 test_num = 1; } message ServerStats { diff --git a/Godeps/_workspace/src/google.golang.org/grpc/call.go b/Godeps/_workspace/src/google.golang.org/grpc/call.go index 63b7966c160..d4ae68bee1f 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/call.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/call.go @@ -34,13 +34,13 @@ package grpc import ( + "bytes" "io" "time" "golang.org/x/net/context" "golang.org/x/net/trace" "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/transport" ) @@ -48,7 +48,7 @@ import ( // On error, it returns the error and indicates whether the call should be retried. // // TODO(zhaoq): Check whether the received message sequence is valid. -func recvResponse(codec Codec, t transport.ClientTransport, c *callInfo, stream *transport.Stream, reply interface{}) error { +func recvResponse(dopts dialOptions, t transport.ClientTransport, c *callInfo, stream *transport.Stream, reply interface{}) error { // Try to acquire header metadata from the server if there is any. var err error c.headerMD, err = stream.Header() @@ -57,7 +57,7 @@ func recvResponse(codec Codec, t transport.ClientTransport, c *callInfo, stream } p := &parser{s: stream} for { - if err = recv(p, codec, reply); err != nil { + if err = recv(p, dopts.codec, stream, dopts.dc, reply); err != nil { if err == io.EOF { break } @@ -69,7 +69,7 @@ func recvResponse(codec Codec, t transport.ClientTransport, c *callInfo, stream } // sendRequest writes out various information of an RPC such as Context and Message. -func sendRequest(ctx context.Context, codec Codec, callHdr *transport.CallHdr, t transport.ClientTransport, args interface{}, opts *transport.Options) (_ *transport.Stream, err error) { +func sendRequest(ctx context.Context, codec Codec, compressor Compressor, callHdr *transport.CallHdr, t transport.ClientTransport, args interface{}, opts *transport.Options) (_ *transport.Stream, err error) { stream, err := t.NewStream(ctx, callHdr) if err != nil { return nil, err @@ -81,8 +81,11 @@ func sendRequest(ctx context.Context, codec Codec, callHdr *transport.CallHdr, t } } }() - // TODO(zhaoq): Support compression. - outBuf, err := encode(codec, args, compressionNone) + var cbuf *bytes.Buffer + if compressor != nil { + cbuf = new(bytes.Buffer) + } + outBuf, err := encode(codec, args, compressor, cbuf) if err != nil { return nil, transport.StreamErrorf(codes.Internal, "grpc: %v", err) } @@ -94,14 +97,6 @@ func sendRequest(ctx context.Context, codec Codec, callHdr *transport.CallHdr, t return stream, nil } -// callInfo contains all related configuration and information about an RPC. -type callInfo struct { - failFast bool - headerMD metadata.MD - trailerMD metadata.MD - traceInfo traceInfo // in trace.go -} - // Invoke is called by the generated code. It sends the RPC request on the // wire and returns after response is received. func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) (err error) { @@ -116,7 +111,6 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli o.after(&c) } }() - if EnableTracing { c.traceInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) defer c.traceInfo.tr.Finish() @@ -133,16 +127,11 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli } }() } - callHdr := &transport.CallHdr{ - Host: cc.authority, - Method: method, - } topts := &transport.Options{ Last: true, Delay: false, } var ( - ts int // track the transport sequence number lastErr error // record the error that happened ) for { @@ -155,7 +144,14 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli if lastErr != nil && c.failFast { return toRPCErr(lastErr) } - t, ts, err = cc.wait(ctx, ts) + callHdr := &transport.CallHdr{ + Host: cc.authority, + Method: method, + } + if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() + } + t, err = cc.dopts.picker.Pick(ctx) if err != nil { if lastErr != nil { // This was a retry; return the error from the last attempt. @@ -166,7 +162,7 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli if c.traceInfo.tr != nil { c.traceInfo.tr.LazyLog(&payload{sent: true, msg: args}, true) } - stream, err = sendRequest(ctx, cc.dopts.codec, callHdr, t, args, topts) + stream, err = sendRequest(ctx, cc.dopts.codec, cc.dopts.cp, callHdr, t, args, topts) if err != nil { if _, ok := err.(transport.ConnectionError); ok { lastErr = err @@ -178,7 +174,7 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli return toRPCErr(err) } // Receive the response - lastErr = recvResponse(cc.dopts.codec, t, &c, stream, reply) + lastErr = recvResponse(cc.dopts, t, &c, stream, reply) if _, ok := lastErr.(transport.ConnectionError); ok { continue } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/clientconn.go b/Godeps/_workspace/src/google.golang.org/grpc/clientconn.go index aacba5b9c79..28e74da8b92 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/clientconn.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/clientconn.go @@ -42,6 +42,7 @@ import ( "time" "golang.org/x/net/context" + "golang.org/x/net/trace" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/transport" @@ -72,6 +73,9 @@ var ( // values passed to Dial. type dialOptions struct { codec Codec + cp Compressor + dc Decompressor + picker Picker block bool insecure bool copts transport.ConnectOptions @@ -87,6 +91,29 @@ func WithCodec(c Codec) DialOption { } } +// WithCompressor returns a DialOption which sets a CompressorGenerator for generating message +// compressor. +func WithCompressor(cp Compressor) DialOption { + return func(o *dialOptions) { + o.cp = cp + } +} + +// WithDecompressor returns a DialOption which sets a DecompressorGenerator for generating +// message decompressor. +func WithDecompressor(dc Decompressor) DialOption { + return func(o *dialOptions) { + o.dc = dc + } +} + +// WithPicker returns a DialOption which sets a picker for connection selection. +func WithPicker(p Picker) DialOption { + return func(o *dialOptions) { + o.picker = p + } +} + // WithBlock returns a DialOption which makes caller of Dial blocks until the underlying // connection is up. Without this, Dial returns immediately and connecting the server // happens in background. @@ -96,6 +123,8 @@ func WithBlock() DialOption { } } +// WithInsecure returns a DialOption which disables transport security for this ClientConn. +// Note that transport security is required unless WithInsecure is set. func WithInsecure() DialOption { return func(o *dialOptions) { o.insecure = true @@ -141,62 +170,29 @@ func WithUserAgent(s string) DialOption { // Dial creates a client connection the given target. func Dial(target string, opts ...DialOption) (*ClientConn, error) { - if target == "" { - return nil, ErrUnspecTarget - } cc := &ClientConn{ - target: target, - shutdownChan: make(chan struct{}), + target: target, } for _, opt := range opts { opt(&cc.dopts) } - if !cc.dopts.insecure { - var ok bool - for _, c := range cc.dopts.copts.AuthOptions { - if _, ok := c.(credentials.TransportAuthenticator); !ok { - continue - } - ok = true - } - if !ok { - return nil, ErrNoTransportSecurity - } - } else { - for _, c := range cc.dopts.copts.AuthOptions { - if c.RequireTransportSecurity() { - return nil, ErrCredentialsMisuse - } + if cc.dopts.codec == nil { + // Set the default codec. + cc.dopts.codec = protoCodec{} + } + if cc.dopts.picker == nil { + cc.dopts.picker = &unicastPicker{ + target: target, } } + if err := cc.dopts.picker.Init(cc); err != nil { + return nil, err + } colonPos := strings.LastIndex(target, ":") if colonPos == -1 { colonPos = len(target) } cc.authority = target[:colonPos] - if cc.dopts.codec == nil { - // Set the default codec. - cc.dopts.codec = protoCodec{} - } - cc.stateCV = sync.NewCond(&cc.mu) - if cc.dopts.block { - if err := cc.resetTransport(false); err != nil { - cc.Close() - return nil, err - } - // Start to monitor the error status of transport. - go cc.transportMonitor() - } else { - // Start a goroutine connecting to the server asynchronously. - go func() { - if err := cc.resetTransport(false); err != nil { - grpclog.Printf("Failed to dial %s: %v; please retry.", target, err) - cc.Close() - return - } - go cc.transportMonitor() - }() - } return cc, nil } @@ -212,7 +208,7 @@ const ( Ready // TransientFailure indicates the ClientConn has seen a failure but expects to recover. TransientFailure - // Shutdown indicates the ClientConn has stated shutting down. + // Shutdown indicates the ClientConn has started shutting down. Shutdown ) @@ -235,50 +231,137 @@ func (s ConnectivityState) String() string { // ClientConn represents a client connection to an RPC service. type ClientConn struct { + target string + authority string + dopts dialOptions +} + +// State returns the connectivity state of cc. +// This is EXPERIMENTAL API. +func (cc *ClientConn) State() (ConnectivityState, error) { + return cc.dopts.picker.State() +} + +// WaitForStateChange blocks until the state changes to something other than the sourceState. +// It returns the new state or error. +// This is EXPERIMENTAL API. +func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) { + return cc.dopts.picker.WaitForStateChange(ctx, sourceState) +} + +// Close starts to tear down the ClientConn. +func (cc *ClientConn) Close() error { + return cc.dopts.picker.Close() +} + +// Conn is a client connection to a single destination. +type Conn struct { target string - authority string dopts dialOptions + resetChan chan int shutdownChan chan struct{} + events trace.EventLog mu sync.Mutex state ConnectivityState stateCV *sync.Cond // ready is closed and becomes nil when a new transport is up or failed // due to timeout. - ready chan struct{} - // Every time a new transport is created, this is incremented by 1. Used - // to avoid trying to recreate a transport while the new one is already - // under construction. - transportSeq int - transport transport.ClientTransport + ready chan struct{} + transport transport.ClientTransport } -// State returns the connectivity state of the ClientConn -func (cc *ClientConn) State() ConnectivityState { +// NewConn creates a Conn. +func NewConn(cc *ClientConn) (*Conn, error) { + if cc.target == "" { + return nil, ErrUnspecTarget + } + c := &Conn{ + target: cc.target, + dopts: cc.dopts, + resetChan: make(chan int, 1), + shutdownChan: make(chan struct{}), + } + if EnableTracing { + c.events = trace.NewEventLog("grpc.ClientConn", c.target) + } + if !c.dopts.insecure { + var ok bool + for _, cd := range c.dopts.copts.AuthOptions { + if _, ok := cd.(credentials.TransportAuthenticator); !ok { + continue + } + ok = true + } + if !ok { + return nil, ErrNoTransportSecurity + } + } else { + for _, cd := range c.dopts.copts.AuthOptions { + if cd.RequireTransportSecurity() { + return nil, ErrCredentialsMisuse + } + } + } + c.stateCV = sync.NewCond(&c.mu) + if c.dopts.block { + if err := c.resetTransport(false); err != nil { + c.Close() + return nil, err + } + // Start to monitor the error status of transport. + go c.transportMonitor() + } else { + // Start a goroutine connecting to the server asynchronously. + go func() { + if err := c.resetTransport(false); err != nil { + grpclog.Printf("Failed to dial %s: %v; please retry.", c.target, err) + c.Close() + return + } + c.transportMonitor() + }() + } + return c, nil +} + +// printf records an event in cc's event log, unless cc has been closed. +// REQUIRES cc.mu is held. +func (cc *Conn) printf(format string, a ...interface{}) { + if cc.events != nil { + cc.events.Printf(format, a...) + } +} + +// errorf records an error in cc's event log, unless cc has been closed. +// REQUIRES cc.mu is held. +func (cc *Conn) errorf(format string, a ...interface{}) { + if cc.events != nil { + cc.events.Errorf(format, a...) + } +} + +// State returns the connectivity state of the Conn +func (cc *Conn) State() ConnectivityState { cc.mu.Lock() defer cc.mu.Unlock() return cc.state } -// WaitForStateChange blocks until the state changes to something other than the sourceState -// or timeout fires. It returns false if timeout fires and true otherwise. -func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState ConnectivityState) bool { - start := time.Now() +// WaitForStateChange blocks until the state changes to something other than the sourceState. +func (cc *Conn) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) { cc.mu.Lock() defer cc.mu.Unlock() if sourceState != cc.state { - return true - } - expired := timeout <= time.Since(start) - if expired { - return false + return cc.state, nil } done := make(chan struct{}) + var err error go func() { select { - case <-time.After(timeout - time.Since(start)): + case <-ctx.Done(): cc.mu.Lock() - expired = true + err = ctx.Err() cc.stateCV.Broadcast() cc.mu.Unlock() case <-done: @@ -287,31 +370,38 @@ func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState Conn defer close(done) for sourceState == cc.state { cc.stateCV.Wait() - if expired { - return false + if err != nil { + return cc.state, err } } - return true + return cc.state, nil } -func (cc *ClientConn) resetTransport(closeTransport bool) error { +// NotifyReset tries to signal the underlying transport needs to be reset due to +// for example a name resolution change in flight. +func (cc *Conn) NotifyReset() { + select { + case cc.resetChan <- 0: + default: + } +} + +func (cc *Conn) resetTransport(closeTransport bool) error { var retries int start := time.Now() for { cc.mu.Lock() - cc.state = Connecting - cc.stateCV.Broadcast() - t := cc.transport - ts := cc.transportSeq - // Avoid wait() picking up a dying transport unnecessarily. - cc.transportSeq = 0 + cc.printf("connecting") if cc.state == Shutdown { + // cc.Close() has been invoked. cc.mu.Unlock() return ErrClientConnClosing } + cc.state = Connecting + cc.stateCV.Broadcast() cc.mu.Unlock() if closeTransport { - t.Close() + cc.transport.Close() } // Adjust timeout for the current try. copts := cc.dopts.copts @@ -335,11 +425,25 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error { copts.Timeout = timeout } connectTime := time.Now() - newTransport, err := transport.NewClientTransport(cc.target, &copts) + addr, err := cc.dopts.picker.PickAddr() + var newTransport transport.ClientTransport + if err == nil { + newTransport, err = transport.NewClientTransport(addr, &copts) + } if err != nil { cc.mu.Lock() + if cc.state == Shutdown { + // cc.Close() has been invoked. + cc.mu.Unlock() + return ErrClientConnClosing + } + cc.errorf("transient failure: %v", err) cc.state = TransientFailure cc.stateCV.Broadcast() + if cc.ready != nil { + close(cc.ready) + cc.ready = nil + } cc.mu.Unlock() sleepTime -= time.Since(connectTime) if sleepTime < 0 { @@ -347,16 +451,20 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error { } // Fail early before falling into sleep. if cc.dopts.copts.Timeout > 0 && cc.dopts.copts.Timeout < sleepTime+time.Since(start) { + cc.mu.Lock() + cc.errorf("connection timeout") + cc.mu.Unlock() cc.Close() return ErrClientConnTimeout } closeTransport = false time.Sleep(sleepTime) retries++ - grpclog.Printf("grpc: ClientConn.resetTransport failed to create client transport: %v; Reconnecting to %q", err, cc.target) + grpclog.Printf("grpc: Conn.resetTransport failed to create client transport: %v; Reconnecting to %q", err, cc.target) continue } cc.mu.Lock() + cc.printf("ready") if cc.state == Shutdown { // cc.Close() has been invoked. cc.mu.Unlock() @@ -366,7 +474,6 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error { cc.state = Ready cc.stateCV.Broadcast() cc.transport = newTransport - cc.transportSeq = ts + 1 if cc.ready != nil { close(cc.ready) cc.ready = nil @@ -376,44 +483,64 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error { } } +func (cc *Conn) reconnect() bool { + cc.mu.Lock() + if cc.state == Shutdown { + // cc.Close() has been invoked. + cc.mu.Unlock() + return false + } + cc.state = TransientFailure + cc.stateCV.Broadcast() + cc.mu.Unlock() + if err := cc.resetTransport(true); err != nil { + // The ClientConn is closing. + cc.mu.Lock() + cc.printf("transport exiting: %v", err) + cc.mu.Unlock() + grpclog.Printf("grpc: Conn.transportMonitor exits due to: %v", err) + return false + } + return true +} + // Run in a goroutine to track the error in transport and create the // new transport if an error happens. It returns when the channel is closing. -func (cc *ClientConn) transportMonitor() { +func (cc *Conn) transportMonitor() { for { select { // shutdownChan is needed to detect the teardown when // the ClientConn is idle (i.e., no RPC in flight). case <-cc.shutdownChan: return - case <-cc.transport.Error(): - cc.mu.Lock() - cc.state = TransientFailure - cc.stateCV.Broadcast() - cc.mu.Unlock() - if err := cc.resetTransport(true); err != nil { - // The ClientConn is closing. - grpclog.Printf("grpc: ClientConn.transportMonitor exits due to: %v", err) + case <-cc.resetChan: + if !cc.reconnect() { return } - continue + case <-cc.transport.Error(): + if !cc.reconnect() { + return + } + // Tries to drain reset signal if there is any since it is out-dated. + select { + case <-cc.resetChan: + default: + } } } } -// When wait returns, either the new transport is up or ClientConn is -// closing. Used to avoid working on a dying transport. It updates and -// returns the transport and its version when there is no error. -func (cc *ClientConn) wait(ctx context.Context, ts int) (transport.ClientTransport, int, error) { +// Wait blocks until i) the new transport is up or ii) ctx is done or iii) cc is closed. +func (cc *Conn) Wait(ctx context.Context) (transport.ClientTransport, error) { for { cc.mu.Lock() switch { case cc.state == Shutdown: cc.mu.Unlock() - return nil, 0, ErrClientConnClosing - case ts < cc.transportSeq: - // Worked on a dying transport. Try the new one immediately. - defer cc.mu.Unlock() - return cc.transport, cc.transportSeq, nil + return nil, ErrClientConnClosing + case cc.state == Ready: + cc.mu.Unlock() + return cc.transport, nil default: ready := cc.ready if ready == nil { @@ -423,7 +550,7 @@ func (cc *ClientConn) wait(ctx context.Context, ts int) (transport.ClientTranspo cc.mu.Unlock() select { case <-ctx.Done(): - return nil, 0, transport.ContextErr(ctx.Err()) + return nil, transport.ContextErr(ctx.Err()) // Wait until the new transport is ready or failed. case <-ready: } @@ -431,12 +558,12 @@ func (cc *ClientConn) wait(ctx context.Context, ts int) (transport.ClientTranspo } } -// Close starts to tear down the ClientConn. Returns ErrClientConnClosing if +// Close starts to tear down the Conn. Returns ErrClientConnClosing if // it has been closed (mostly due to dial time-out). // TODO(zhaoq): Make this synchronous to avoid unbounded memory consumption in // some edge cases (e.g., the caller opens and closes many ClientConn's in a // tight loop. -func (cc *ClientConn) Close() error { +func (cc *Conn) Close() error { cc.mu.Lock() defer cc.mu.Unlock() if cc.state == Shutdown { @@ -444,6 +571,10 @@ func (cc *ClientConn) Close() error { } cc.state = Shutdown cc.stateCV.Broadcast() + if cc.events != nil { + cc.events.Finish() + cc.events = nil + } if cc.ready != nil { close(cc.ready) cc.ready = nil diff --git a/Godeps/_workspace/src/google.golang.org/grpc/coverage.sh b/Godeps/_workspace/src/google.golang.org/grpc/coverage.sh new file mode 100644 index 00000000000..120235374a4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/grpc/coverage.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -e + +workdir=.cover +profile="$workdir/cover.out" +mode=set +end2endtest="google.golang.org/grpc/test" + +generate_cover_data() { + rm -rf "$workdir" + mkdir "$workdir" + + for pkg in "$@"; do + if [ $pkg == "google.golang.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ] + then + f="$workdir/$(echo $pkg | tr / -)" + go test -covermode="$mode" -coverprofile="$f.cover" "$pkg" + go test -covermode="$mode" -coverpkg "$pkg" -coverprofile="$f.e2e.cover" "$end2endtest" + fi + done + + echo "mode: $mode" >"$profile" + grep -h -v "^mode:" "$workdir"/*.cover >>"$profile" +} + +show_cover_report() { + go tool cover -${1}="$profile" +} + +push_to_coveralls() { + goveralls -coverprofile="$profile" +} + +generate_cover_data $(go list ./...) +show_cover_report func +case "$1" in +"") + ;; +--html) + show_cover_report html ;; +--coveralls) + push_to_coveralls ;; +*) + echo >&2 "error: invalid option: $1" ;; +esac +rm -rf "$workdir" diff --git a/Godeps/_workspace/src/google.golang.org/grpc/credentials/credentials.go b/Godeps/_workspace/src/google.golang.org/grpc/credentials/credentials.go index 3cec7e49168..0b0b89b6aa6 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/credentials/credentials.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/credentials/credentials.go @@ -87,19 +87,6 @@ type AuthInfo interface { AuthType() string } -type authInfoKey struct{} - -// NewContext creates a new context with authInfo attached. -func NewContext(ctx context.Context, authInfo AuthInfo) context.Context { - return context.WithValue(ctx, authInfoKey{}, authInfo) -} - -// FromContext returns the authInfo in ctx if it exists. -func FromContext(ctx context.Context) (authInfo AuthInfo, ok bool) { - authInfo, ok = ctx.Value(authInfoKey{}).(AuthInfo) - return -} - // TransportAuthenticator defines the common interface for all the live gRPC wire // protocols and supported transport security protocols (e.g., TLS, SSL). type TransportAuthenticator interface { @@ -119,7 +106,7 @@ type TransportAuthenticator interface { // TLSInfo contains the auth information for a TLS authenticated connection. // It implements the AuthInfo interface. type TLSInfo struct { - state tls.ConnectionState + State tls.ConnectionState } func (t TLSInfo) AuthType() string { diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/README.md b/Godeps/_workspace/src/google.golang.org/grpc/examples/README.md index e5c03c38e0d..b65f8c5e632 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/README.md +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/README.md @@ -3,14 +3,15 @@ gRPC in 3 minutes (Go) BACKGROUND ------------- -For this sample, we've already generated the server and client stubs from [helloworld.proto](examples/helloworld/proto/helloworld.proto). +For this sample, we've already generated the server and client stubs from [helloworld.proto](helloworld/helloworld/helloworld.proto). PREREQUISITES ------------- - This requires Go 1.4 - Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH) -```sh + +``` $ go help gopath $ # ensure the PATH contains $GOPATH/bin $ export PATH=$PATH:$GOPATH/bin @@ -19,35 +20,38 @@ $ export PATH=$PATH:$GOPATH/bin INSTALL ------- -```sh -$ go get -u github.com/grpc/grpc-go/examples/greeter_client -$ go get -u github.com/grpc/grpc-go/examples/greeter_server +``` +$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client +$ go get -u google.golang.org/grpc/examples/helloworld/greeter_server ``` TRY IT! ------- - Run the server -```sh + +``` $ greeter_server & ``` - Run the client -```sh + +``` $ greeter_client ``` OPTIONAL - Rebuilding the generated code ---------------------------------------- -1 First [install protoc](https://github.com/google/protobuf/blob/master/INSTALL.txt) +1 First [install protoc](https://github.com/google/protobuf/blob/master/README.md) - For now, this needs to be installed from source - This is will change once proto3 is officially released 2 Install the protoc Go plugin. -```sh + +``` $ go get -a github.com/golang/protobuf/protoc-gen-go $ $ # from this dir; invoke protoc -$ protoc -I ./helloworld/proto/ ./helloworld/proto/helloworld.proto --go_out=plugins=grpc:helloworld +$ protoc -I ./helloworld/helloworld/ ./helloworld/helloworld/helloworld.proto --go_out=plugins=grpc:helloworld ``` diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/gotutorial.md b/Godeps/_workspace/src/google.golang.org/grpc/examples/gotutorial.md index 8df15a4a4e3..39833fdf3da 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/gotutorial.md +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/gotutorial.md @@ -33,7 +33,7 @@ You also should have the relevant tools installed to generate the server and cli ## Defining the service -Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/route_guide/proto/route_guide.proto`](examples/route_guide/proto/route_guide.proto). +Our first step (as you'll know from the [quick start](http://www.grpc.io/docs/#quick-start)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/route_guide/proto/route_guide.proto`](examples/route_guide/proto/route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -227,7 +227,7 @@ func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) e } ``` -In the method body we use the `RouteGuide_RecordRouteServer`s `Recv()` method to repeatedly read in our client's requests to a request object (in this case a `Point`) until there are no more messages: the server needs to check the the error returned from `Read()` after each call. If this is `nil`, the stream is still good and it can continue reading; if it's `io.EOF` the message stream has ended and the server can return its `RouteSummary`. If it has any other value, we return the error "as is" so that it'll be translated to an RPC status by the gRPC layer. +In the method body we use the `RouteGuide_RecordRouteServer`s `Recv()` method to repeatedly read in our client's requests to a request object (in this case a `Point`) until there are no more messages: the server needs to check the the error returned from `Recv()` after each call. If this is `nil`, the stream is still good and it can continue reading; if it's `io.EOF` the message stream has ended and the server can return its `RouteSummary`. If it has any other value, we return the error "as is" so that it'll be translated to an RPC status by the gRPC layer. #### Bidirectional streaming RPC Finally, let's look at our bidirectional streaming RPC `RouteChat()`. diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/greeter_server/main.go b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/greeter_server/main.go index ba985df4c24..66010a51206 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/greeter_server/main.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/greeter_server/main.go @@ -46,7 +46,7 @@ const ( port = ":50051" ) -// server is used to implement hellowrld.GreeterServer. +// server is used to implement helloworld.GreeterServer. type server struct{} // SayHello implements helloworld.GreeterServer diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go index 1ff931a3844..97df8568801 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go @@ -15,40 +15,52 @@ It has these top-level messages: package helloworld import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 // The request message containing the user's name. type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` } -func (m *HelloRequest) Reset() { *m = HelloRequest{} } -func (m *HelloRequest) String() string { return proto.CompactTextString(m) } -func (*HelloRequest) ProtoMessage() {} +func (m *HelloRequest) Reset() { *m = HelloRequest{} } +func (m *HelloRequest) String() string { return proto.CompactTextString(m) } +func (*HelloRequest) ProtoMessage() {} +func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // The response message containing the greetings type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` } -func (m *HelloReply) Reset() { *m = HelloReply{} } -func (m *HelloReply) String() string { return proto.CompactTextString(m) } -func (*HelloReply) ProtoMessage() {} +func (m *HelloReply) Reset() { *m = HelloReply{} } +func (m *HelloReply) String() string { return proto.CompactTextString(m) } +func (*HelloReply) ProtoMessage() {} +func (*HelloReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func init() { + proto.RegisterType((*HelloRequest)(nil), "helloworld.HelloRequest") + proto.RegisterType((*HelloReply)(nil), "helloworld.HelloReply") } +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + // Client API for Greeter service type GreeterClient interface { @@ -84,9 +96,9 @@ func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { s.RegisterService(&_Greeter_serviceDesc, srv) } -func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(HelloRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(GreeterServer).SayHello(ctx, in) @@ -107,3 +119,19 @@ var _Greeter_serviceDesc = grpc.ServiceDesc{ }, Streams: []grpc.StreamDesc{}, } + +var fileDescriptor0 = []byte{ + // 181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9, + 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x42, 0x88, + 0x28, 0x29, 0x71, 0xf1, 0x78, 0x80, 0x78, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, + 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, 0x92, + 0x1a, 0x17, 0x17, 0x54, 0x4d, 0x41, 0x4e, 0xa5, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x71, + 0x62, 0x3a, 0x4c, 0x11, 0x8c, 0x6b, 0xe4, 0xc9, 0xc5, 0xee, 0x5e, 0x94, 0x9a, 0x5a, 0x92, 0x5a, + 0x24, 0x64, 0xc7, 0xc5, 0x11, 0x9c, 0x58, 0x09, 0xd6, 0x25, 0x24, 0xa1, 0x87, 0xe4, 0x02, 0x64, + 0xcb, 0xa4, 0xc4, 0xb0, 0xc8, 0x00, 0xad, 0x50, 0x62, 0x70, 0x32, 0xe3, 0x92, 0xce, 0xcc, 0xd7, + 0x4b, 0x2f, 0x2a, 0x48, 0xd6, 0x4b, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0x46, 0x52, 0xeb, + 0xc4, 0x0f, 0x56, 0x1c, 0x0e, 0x62, 0x07, 0x80, 0xbc, 0x14, 0xc0, 0xb8, 0x88, 0x89, 0xd9, 0xc3, + 0x27, 0x3c, 0x89, 0x0d, 0xec, 0x43, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x0a, 0xdc, + 0xe8, 0xf5, 0x00, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto index 7d58870a708..0bee1fcfcfb 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto @@ -29,7 +29,9 @@ syntax = "proto3"; -option java_package = "io.grpc.examples"; +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; option objc_class_prefix = "HLW"; package helloworld; diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md index 7571621dae7..a7c0c2b0e53 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md @@ -2,7 +2,7 @@ The route guide server and client demonstrate how to use grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs. -Please refer to [Getting Started Guide for Go] (examples/gotutorial.md) for more information. +Please refer to [gRPC Basics: Go] (http://www.grpc.io/docs/tutorials/basic/go.html) for more information. See the definition of the route guide service in proto/route_guide.proto. diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go index fcf5c7484ff..4f5f5c13d03 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go @@ -3,7 +3,7 @@ // DO NOT EDIT! /* -Package proto is a generated protocol buffer package. +Package routeguide is a generated protocol buffer package. It is generated from these files: route_guide.proto @@ -17,7 +17,9 @@ It has these top-level messages: */ package routeguide -import proto1 "github.com/golang/protobuf/proto" +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( context "golang.org/x/net/context" @@ -25,11 +27,13 @@ import ( ) // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto1.Marshal +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 // Points are represented as latitude-longitude pairs in the E7 representation // (degrees multiplied by 10**7 and rounded to the nearest integer). @@ -40,9 +44,10 @@ type Point struct { Longitude int32 `protobuf:"varint,2,opt,name=longitude" json:"longitude,omitempty"` } -func (m *Point) Reset() { *m = Point{} } -func (m *Point) String() string { return proto1.CompactTextString(m) } -func (*Point) ProtoMessage() {} +func (m *Point) Reset() { *m = Point{} } +func (m *Point) String() string { return proto.CompactTextString(m) } +func (*Point) ProtoMessage() {} +func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // A latitude-longitude rectangle, represented as two diagonally opposite // points "lo" and "hi". @@ -53,9 +58,10 @@ type Rectangle struct { Hi *Point `protobuf:"bytes,2,opt,name=hi" json:"hi,omitempty"` } -func (m *Rectangle) Reset() { *m = Rectangle{} } -func (m *Rectangle) String() string { return proto1.CompactTextString(m) } -func (*Rectangle) ProtoMessage() {} +func (m *Rectangle) Reset() { *m = Rectangle{} } +func (m *Rectangle) String() string { return proto.CompactTextString(m) } +func (*Rectangle) ProtoMessage() {} +func (*Rectangle) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Rectangle) GetLo() *Point { if m != nil { @@ -81,9 +87,10 @@ type Feature struct { Location *Point `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` } -func (m *Feature) Reset() { *m = Feature{} } -func (m *Feature) String() string { return proto1.CompactTextString(m) } -func (*Feature) ProtoMessage() {} +func (m *Feature) Reset() { *m = Feature{} } +func (m *Feature) String() string { return proto.CompactTextString(m) } +func (*Feature) ProtoMessage() {} +func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *Feature) GetLocation() *Point { if m != nil { @@ -100,9 +107,10 @@ type RouteNote struct { Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` } -func (m *RouteNote) Reset() { *m = RouteNote{} } -func (m *RouteNote) String() string { return proto1.CompactTextString(m) } -func (*RouteNote) ProtoMessage() {} +func (m *RouteNote) Reset() { *m = RouteNote{} } +func (m *RouteNote) String() string { return proto.CompactTextString(m) } +func (*RouteNote) ProtoMessage() {} +func (*RouteNote) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *RouteNote) GetLocation() *Point { if m != nil { @@ -127,13 +135,23 @@ type RouteSummary struct { ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time" json:"elapsed_time,omitempty"` } -func (m *RouteSummary) Reset() { *m = RouteSummary{} } -func (m *RouteSummary) String() string { return proto1.CompactTextString(m) } -func (*RouteSummary) ProtoMessage() {} +func (m *RouteSummary) Reset() { *m = RouteSummary{} } +func (m *RouteSummary) String() string { return proto.CompactTextString(m) } +func (*RouteSummary) ProtoMessage() {} +func (*RouteSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func init() { + proto.RegisterType((*Point)(nil), "routeguide.Point") + proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") + proto.RegisterType((*Feature)(nil), "routeguide.Feature") + proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") + proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") } +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + // Client API for RouteGuide service type RouteGuideClient interface { @@ -141,8 +159,8 @@ type RouteGuideClient interface { // // Obtains the feature at a given position. // - // If no feature is found for the given point, a feature with an empty name - // should be returned. + // A feature with an empty name is returned if there's no feature at the given + // position. GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) // A server-to-client streaming RPC. // @@ -173,7 +191,7 @@ func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient { func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { out := new(Feature) - err := grpc.Invoke(ctx, "/proto.RouteGuide/GetFeature", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -181,7 +199,7 @@ func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...gr } func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[0], c.cc, "/proto.RouteGuide/ListFeatures", opts...) + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[0], c.cc, "/routeguide.RouteGuide/ListFeatures", opts...) if err != nil { return nil, err } @@ -213,7 +231,7 @@ func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { } func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[1], c.cc, "/proto.RouteGuide/RecordRoute", opts...) + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[1], c.cc, "/routeguide.RouteGuide/RecordRoute", opts...) if err != nil { return nil, err } @@ -247,7 +265,7 @@ func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { } func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[2], c.cc, "/proto.RouteGuide/RouteChat", opts...) + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[2], c.cc, "/routeguide.RouteGuide/RouteChat", opts...) if err != nil { return nil, err } @@ -284,8 +302,8 @@ type RouteGuideServer interface { // // Obtains the feature at a given position. // - // If no feature is found for the given point, a feature with an empty name - // should be returned. + // A feature with an empty name is returned if there's no feature at the given + // position. GetFeature(context.Context, *Point) (*Feature, error) // A server-to-client streaming RPC. // @@ -310,9 +328,9 @@ func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { s.RegisterService(&_RouteGuide_serviceDesc, srv) } -func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(Point) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(RouteGuideServer).GetFeature(ctx, in) @@ -396,7 +414,7 @@ func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { } var _RouteGuide_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.RouteGuide", + ServiceName: "routeguide.RouteGuide", HandlerType: (*RouteGuideServer)(nil), Methods: []grpc.MethodDesc{ { @@ -423,3 +441,33 @@ var _RouteGuide_serviceDesc = grpc.ServiceDesc{ }, }, } + +var fileDescriptor0 = []byte{ + // 412 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x53, 0xd1, 0x6a, 0xa3, 0x40, + 0x14, 0xcd, 0x98, 0x64, 0xb3, 0x5e, 0x5d, 0x96, 0xcc, 0xb2, 0x20, 0xd9, 0x85, 0xb6, 0xf6, 0x25, + 0x2f, 0x95, 0x90, 0x42, 0x1e, 0x5b, 0x9a, 0x40, 0xf3, 0x12, 0x4a, 0x6a, 0xf3, 0x1e, 0xa6, 0x3a, + 0x35, 0x03, 0xea, 0x88, 0x8e, 0xd0, 0x7e, 0x40, 0xbf, 0xa0, 0x7f, 0xd0, 0x2f, 0xed, 0x38, 0x6a, + 0x62, 0xda, 0x84, 0xbe, 0x39, 0xe7, 0x9e, 0x73, 0xef, 0xb9, 0xe7, 0x22, 0xf4, 0x53, 0x9e, 0x0b, + 0xba, 0x0e, 0x72, 0xe6, 0x53, 0x27, 0x49, 0xb9, 0xe0, 0x18, 0x14, 0xa4, 0x10, 0xfb, 0x06, 0xba, + 0x4b, 0xce, 0x62, 0x81, 0x07, 0xf0, 0x33, 0x24, 0x82, 0x89, 0xdc, 0xa7, 0x16, 0x3a, 0x45, 0xc3, + 0xae, 0xbb, 0x7d, 0xe3, 0xff, 0xa0, 0x87, 0x3c, 0x0e, 0xca, 0xa2, 0xa6, 0x8a, 0x3b, 0xc0, 0xbe, + 0x07, 0xdd, 0xa5, 0x9e, 0x20, 0x71, 0x10, 0x52, 0x7c, 0x06, 0x5a, 0xc8, 0x55, 0x03, 0x63, 0xdc, + 0x77, 0x76, 0x83, 0x1c, 0x35, 0xc5, 0x95, 0xc5, 0x82, 0xb2, 0x61, 0xaa, 0xcd, 0x61, 0xca, 0x86, + 0xd9, 0x0b, 0xe8, 0xdd, 0x52, 0x22, 0xf2, 0x94, 0x62, 0x0c, 0x9d, 0x98, 0x44, 0xa5, 0x27, 0xdd, + 0x55, 0xdf, 0xf8, 0x42, 0x7a, 0xe5, 0x9e, 0x74, 0xc7, 0xe3, 0xe3, 0x7d, 0xb6, 0x14, 0x7b, 0x25, + 0x0d, 0x16, 0xd5, 0x3b, 0x2e, 0xf6, 0xb5, 0xe8, 0x5b, 0x2d, 0xb6, 0xa0, 0x17, 0xd1, 0x2c, 0x23, + 0x41, 0xb9, 0xb8, 0xee, 0xd6, 0x4f, 0xfb, 0x0d, 0x81, 0xa9, 0xda, 0x3e, 0xe4, 0x51, 0x44, 0xd2, + 0x17, 0x7c, 0x02, 0x46, 0x52, 0xa8, 0xd7, 0x1e, 0xcf, 0x63, 0x51, 0x85, 0x08, 0x0a, 0x9a, 0x15, + 0x08, 0x3e, 0x87, 0x5f, 0x4f, 0xe5, 0x56, 0x15, 0xa5, 0x8c, 0xd2, 0xac, 0xc0, 0x92, 0x24, 0xef, + 0xe0, 0xb3, 0x4c, 0xa6, 0xe9, 0x51, 0xab, 0x5d, 0xde, 0xa1, 0x7e, 0xcb, 0xe4, 0x4c, 0x1a, 0x92, + 0x24, 0xa3, 0xfe, 0x5a, 0x30, 0x99, 0x49, 0x47, 0xd5, 0x8d, 0x0a, 0x5b, 0x49, 0x68, 0xfc, 0xaa, + 0x01, 0x28, 0x57, 0xf3, 0x62, 0x1d, 0x3c, 0x01, 0x98, 0x53, 0x51, 0x67, 0xf9, 0x75, 0xd3, 0xc1, + 0x9f, 0x26, 0x54, 0xf1, 0xec, 0x16, 0xbe, 0x02, 0x73, 0x21, 0xa7, 0x56, 0x40, 0x86, 0xff, 0x36, + 0x69, 0xdb, 0x6b, 0x1f, 0x51, 0x8f, 0x90, 0xd4, 0x1b, 0x92, 0xc5, 0x53, 0x5f, 0x79, 0x39, 0x34, + 0xd8, 0xda, 0xeb, 0xd8, 0xc8, 0xd1, 0x6e, 0x0d, 0x11, 0xbe, 0xae, 0x4e, 0x36, 0xdb, 0x10, 0xf1, + 0x69, 0x78, 0x7d, 0xc9, 0xc1, 0x61, 0xb8, 0x90, 0x8f, 0xd0, 0x74, 0x02, 0xff, 0x18, 0x77, 0x82, + 0x34, 0xf1, 0x1c, 0xfa, 0x4c, 0xa2, 0x24, 0xa4, 0x59, 0x83, 0x3e, 0xfd, 0xbd, 0xcb, 0x68, 0x59, + 0xfc, 0x13, 0x4b, 0xf4, 0xae, 0xb5, 0xdd, 0xd5, 0xfc, 0xf1, 0x87, 0xfa, 0x45, 0x2e, 0x3f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xf3, 0xe2, 0x76, 0x5e, 0x37, 0x03, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto index bee7ac51ab3..12c4495ffab 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto +++ b/Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto @@ -29,6 +29,11 @@ syntax = "proto3"; +option java_multiple_files = true; +option java_package = "io.grpc.examples.routeguide"; +option java_outer_classname = "RouteGuideProto"; +option objc_class_prefix = "RTG"; + package routeguide; // Interface exported by the server. @@ -37,8 +42,8 @@ service RouteGuide { // // Obtains the feature at a given position. // - // If no feature is found for the given point, a feature with an empty name - // should be returned. + // A feature with an empty name is returned if there's no feature at the given + // position. rpc GetFeature(Point) returns (Feature) {} // A server-to-client streaming RPC. diff --git a/Godeps/_workspace/src/google.golang.org/grpc/grpclog/logger.go b/Godeps/_workspace/src/google.golang.org/grpc/grpclog/logger.go index cc6e27c0649..2cc09be4894 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/grpclog/logger.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/grpclog/logger.go @@ -42,6 +42,8 @@ import ( ) // Use golang's standard logger by default. +// Access is not mutex-protected: do not modify except in init() +// functions. var logger Logger = log.New(os.Stderr, "", log.LstdFlags) // Logger mimics golang's standard Logger as an interface. @@ -54,7 +56,8 @@ type Logger interface { Println(args ...interface{}) } -// SetLogger sets the logger that is used in grpc. +// SetLogger sets the logger that is used in grpc. Call only from +// init() functions. func SetLogger(l Logger) { logger = l } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go index 6bfbe49730b..8e89dc9f27a 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go @@ -15,6 +15,8 @@ It has these top-level messages: package grpc_health_v1alpha import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( context "golang.org/x/net/context" @@ -23,6 +25,12 @@ import ( // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 type HealthCheckResponse_ServingStatus int32 @@ -46,24 +54,31 @@ var HealthCheckResponse_ServingStatus_value = map[string]int32{ func (x HealthCheckResponse_ServingStatus) String() string { return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) } - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"` +func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} } -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} +type HealthCheckRequest struct { + Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` +} + +func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } +func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } +func (*HealthCheckRequest) ProtoMessage() {} +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type HealthCheckResponse struct { Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=grpc.health.v1alpha.HealthCheckResponse_ServingStatus" json:"status,omitempty"` } -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} +func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } +func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } +func (*HealthCheckResponse) ProtoMessage() {} +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func init() { + proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1alpha.HealthCheckRequest") + proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1alpha.HealthCheckResponse") proto.RegisterEnum("grpc.health.v1alpha.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) } @@ -71,59 +86,77 @@ func init() { var _ context.Context var _ grpc.ClientConn -// Client API for HealthCheck service +// Client API for Health service -type HealthCheckClient interface { +type HealthClient interface { Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) } -type healthCheckClient struct { +type healthClient struct { cc *grpc.ClientConn } -func NewHealthCheckClient(cc *grpc.ClientConn) HealthCheckClient { - return &healthCheckClient{cc} +func NewHealthClient(cc *grpc.ClientConn) HealthClient { + return &healthClient{cc} } -func (c *healthCheckClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { +func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { out := new(HealthCheckResponse) - err := grpc.Invoke(ctx, "/grpc.health.v1alpha.HealthCheck/Check", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/grpc.health.v1alpha.Health/Check", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// Server API for HealthCheck service +// Server API for Health service -type HealthCheckServer interface { +type HealthServer interface { Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) } -func RegisterHealthCheckServer(s *grpc.Server, srv HealthCheckServer) { - s.RegisterService(&_HealthCheck_serviceDesc, srv) +func RegisterHealthServer(s *grpc.Server, srv HealthServer) { + s.RegisterService(&_Health_serviceDesc, srv) } -func _HealthCheck_Check_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(HealthCheckRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } - out, err := srv.(HealthCheckServer).Check(ctx, in) + out, err := srv.(HealthServer).Check(ctx, in) if err != nil { return nil, err } return out, nil } -var _HealthCheck_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.health.v1alpha.HealthCheck", - HandlerType: (*HealthCheckServer)(nil), +var _Health_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.health.v1alpha.Health", + HandlerType: (*HealthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", - Handler: _HealthCheck_Check_Handler, + Handler: _Health_Check_Handler, }, }, Streams: []grpc.StreamDesc{}, } + +var fileDescriptor0 = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x48, 0x4d, 0xcc, + 0x29, 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4e, 0x2f, 0x2a, 0x48, 0xd6, 0x83, + 0x0a, 0x95, 0x19, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x2a, 0xe9, 0x71, 0x09, 0x79, 0x80, 0x45, 0x9c, + 0x33, 0x52, 0x93, 0xb3, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x24, 0xb8, 0xd8, 0x8b, + 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0xa5, + 0x85, 0x8c, 0x5c, 0xc2, 0x28, 0x1a, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xfc, 0xb8, 0xd8, + 0x8a, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xc1, 0x1a, 0xf8, 0x8c, 0xcc, 0xf4, 0xb0, 0xd8, 0xa6, 0x87, + 0x45, 0xa7, 0x5e, 0x30, 0xc8, 0xe4, 0xbc, 0xf4, 0x60, 0xb0, 0xee, 0x20, 0xa8, 0x29, 0x4a, 0x56, + 0x5c, 0xbc, 0x28, 0x12, 0x42, 0xdc, 0x5c, 0xec, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0x02, + 0x0c, 0x20, 0x4e, 0xb0, 0x6b, 0x50, 0x98, 0xa7, 0x9f, 0xbb, 0x00, 0xa3, 0x10, 0x3f, 0x17, 0xb7, + 0x9f, 0x7f, 0x48, 0x3c, 0x4c, 0x80, 0xc9, 0x28, 0x85, 0x8b, 0x0d, 0x62, 0x91, 0x50, 0x14, 0x17, + 0x2b, 0xd8, 0x32, 0x21, 0x75, 0xc2, 0xce, 0x01, 0xfb, 0x5c, 0x4a, 0x83, 0x58, 0x77, 0x27, 0xb1, + 0x81, 0x43, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x3f, 0xd0, 0xe1, 0x65, 0x01, 0x00, + 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto b/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto index 1ca5bbc1693..91c7f06e9b2 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto +++ b/Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package grpc.health.v1alpha; message HealthCheckRequest { - string service = 2; + string service = 1; } message HealthCheckResponse { @@ -15,6 +15,6 @@ message HealthCheckResponse { ServingStatus status = 1; } -service HealthCheck{ +service Health{ rpc Check(HealthCheckRequest) returns (HealthCheckResponse); } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/interop/client/client.go b/Godeps/_workspace/src/google.golang.org/grpc/interop/client/client.go index 4f715d35ee7..deb9c3d848d 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/interop/client/client.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/interop/client/client.go @@ -35,29 +35,20 @@ package main import ( "flag" - "io" - "io/ioutil" "net" "strconv" - "strings" - "time" - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" "google.golang.org/grpc" - "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/oauth" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" testpb "google.golang.org/grpc/interop/grpc_testing" - "google.golang.org/grpc/metadata" ) var ( useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") - caFile = flag.String("tls_ca_file", "testdata/ca.pem", "The file containning the CA root cert file") + testCA = flag.Bool("use_test_ca", false, "Whether to replace platform root CAs with test CA as the CA root") serviceAccountKeyFile = flag.String("service_account_key_file", "", "Path to service account json key file") oauthScope = flag.String("oauth_scope", "", "The scope for OAuth2 tokens") defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account") @@ -72,7 +63,7 @@ var ( server_streaming : single request with response streaming; ping_pong : full-duplex streaming; empty_stream : full-duplex streaming with zero message; - timeout_on_sleeping_server: fullduplex streaming; + timeout_on_sleeping_server: fullduplex streaming on a sleeping server; compute_engine_creds: large_unary with compute engine auth; service_account_creds: large_unary with service account auth; jwt_token_creds: large_unary with jwt token auth; @@ -80,411 +71,11 @@ var ( oauth2_auth_token: large_unary with oauth2 token auth; cancel_after_begin: cancellation after metadata has been sent but before payloads are sent; cancel_after_first_response: cancellation after receiving 1st message from the server.`) + + // The test CA root cert file + testCAFile = "testdata/ca.pem" ) -var ( - reqSizes = []int{27182, 8, 1828, 45904} - respSizes = []int{31415, 9, 2653, 58979} - largeReqSize = 271828 - largeRespSize = 314159 -) - -func newPayload(t testpb.PayloadType, size int) *testpb.Payload { - if size < 0 { - grpclog.Fatalf("Requested a response with invalid length %d", size) - } - body := make([]byte, size) - switch t { - case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") - default: - grpclog.Fatalf("Unsupported payload type: %d", t) - } - return &testpb.Payload{ - Type: t.Enum(), - Body: body, - } -} - -func doEmptyUnaryCall(tc testpb.TestServiceClient) { - reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}) - if err != nil { - grpclog.Fatal("/TestService/EmptyCall RPC failed: ", err) - } - if !proto.Equal(&testpb.Empty{}, reply) { - grpclog.Fatalf("/TestService/EmptyCall receives %v, want %v", reply, testpb.Empty{}) - } - grpclog.Println("EmptyUnaryCall done") -} - -func doLargeUnaryCall(tc testpb.TestServiceClient) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - t := reply.GetPayload().GetType() - s := len(reply.GetPayload().GetBody()) - if t != testpb.PayloadType_COMPRESSABLE || s != largeRespSize { - grpclog.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, largeRespSize) - } - grpclog.Println("LargeUnaryCall done") -} - -func doClientStreaming(tc testpb.TestServiceClient) { - stream, err := tc.StreamingInputCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) - } - var sum int - for _, s := range reqSizes { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, s) - req := &testpb.StreamingInputCallRequest{ - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - sum += s - grpclog.Printf("Sent a request of size %d, aggregated size %d", s, sum) - - } - reply, err := stream.CloseAndRecv() - if err != nil { - grpclog.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) - } - if reply.GetAggregatedPayloadSize() != int32(sum) { - grpclog.Fatalf("%v.CloseAndRecv().GetAggregatePayloadSize() = %v; want %v", stream, reply.GetAggregatedPayloadSize(), sum) - } - grpclog.Println("ClientStreaming done") -} - -func doServerStreaming(tc testpb.TestServiceClient) { - respParam := make([]*testpb.ResponseParameters, len(respSizes)) - for i, s := range respSizes { - respParam[i] = &testpb.ResponseParameters{ - Size: proto.Int32(int32(s)), - } - } - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - } - stream, err := tc.StreamingOutputCall(context.Background(), req) - if err != nil { - grpclog.Fatalf("%v.StreamingOutputCall(_) = _, %v", tc, err) - } - var rpcStatus error - var respCnt int - var index int - for { - reply, err := stream.Recv() - if err != nil { - rpcStatus = err - break - } - t := reply.GetPayload().GetType() - if t != testpb.PayloadType_COMPRESSABLE { - grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) - } - size := len(reply.GetPayload().GetBody()) - if size != int(respSizes[index]) { - grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) - } - index++ - respCnt++ - } - if rpcStatus != io.EOF { - grpclog.Fatalf("Failed to finish the server streaming rpc: %v", err) - } - if respCnt != len(respSizes) { - grpclog.Fatalf("Got %d reply, want %d", len(respSizes), respCnt) - } - grpclog.Println("ServerStreaming done") -} - -func doPingPong(tc testpb.TestServiceClient) { - stream, err := tc.FullDuplexCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - var index int - for index < len(reqSizes) { - respParam := []*testpb.ResponseParameters{ - { - Size: proto.Int32(int32(respSizes[index])), - }, - } - pl := newPayload(testpb.PayloadType_COMPRESSABLE, reqSizes[index]) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - reply, err := stream.Recv() - if err != nil { - grpclog.Fatalf("%v.Recv() = %v", stream, err) - } - t := reply.GetPayload().GetType() - if t != testpb.PayloadType_COMPRESSABLE { - grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) - } - size := len(reply.GetPayload().GetBody()) - if size != int(respSizes[index]) { - grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) - } - index++ - } - if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) - } - if _, err := stream.Recv(); err != io.EOF { - grpclog.Fatalf("%v failed to complele the ping pong test: %v", stream, err) - } - grpclog.Println("Pingpong done") -} - -func doEmptyStream(tc testpb.TestServiceClient) { - stream, err := tc.FullDuplexCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) - } - if _, err := stream.Recv(); err != io.EOF { - grpclog.Fatalf("%v failed to complete the empty stream test: %v", stream, err) - } - grpclog.Println("Emptystream done") -} - -func doTimeoutOnSleepingServer(tc testpb.TestServiceClient) { - ctx, _ := context.WithTimeout(context.Background(), 1*time.Millisecond) - stream, err := tc.FullDuplexCall(ctx) - if err != nil { - if grpc.Code(err) == codes.DeadlineExceeded { - grpclog.Println("TimeoutOnSleepingServer done") - return - } - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - pl := newPayload(testpb.PayloadType_COMPRESSABLE, 27182) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - if _, err := stream.Recv(); grpc.Code(err) != codes.DeadlineExceeded { - grpclog.Fatalf("%v.Recv() = _, %v, want error code %d", stream, err, codes.DeadlineExceeded) - } - grpclog.Println("TimeoutOnSleepingServer done") -} - -func doComputeEngineCreds(tc testpb.TestServiceClient) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - user := reply.GetUsername() - scope := reply.GetOauthScope() - if user != *defaultServiceAccount { - grpclog.Fatalf("Got user name %q, want %q.", user, *defaultServiceAccount) - } - if !strings.Contains(*oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, *oauthScope) - } - grpclog.Println("ComputeEngineCreds done") -} - -func getServiceAccountJSONKey() []byte { - jsonKey, err := ioutil.ReadFile(*serviceAccountKeyFile) - if err != nil { - grpclog.Fatalf("Failed to read the service account key file: %v", err) - } - return jsonKey -} - -func doServiceAccountCreds(tc testpb.TestServiceClient) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey() - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(*oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, *oauthScope) - } - grpclog.Println("ServiceAccountCreds done") -} - -func doJWTTokenCreds(tc testpb.TestServiceClient) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey() - user := reply.GetUsername() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - grpclog.Println("JWTtokenCreds done") -} - -func getToken() *oauth2.Token { - jsonKey := getServiceAccountJSONKey() - config, err := google.JWTConfigFromJSON(jsonKey, *oauthScope) - if err != nil { - grpclog.Fatalf("Failed to get the config: %v", err) - } - token, err := config.TokenSource(context.Background()).Token() - if err != nil { - grpclog.Fatalf("Failed to get the token: %v", err) - } - return token -} - -func doOauth2TokenCreds(tc testpb.TestServiceClient) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey() - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(*oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, *oauthScope) - } - grpclog.Println("Oauth2TokenCreds done") -} - -func doPerRPCCreds(tc testpb.TestServiceClient) { - jsonKey := getServiceAccountJSONKey() - pl := newPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - token := getToken() - kv := map[string]string{"authorization": token.TokenType + " " + token.AccessToken} - ctx := metadata.NewContext(context.Background(), metadata.MD{"authorization": []string{kv["authorization"]}}) - reply, err := tc.UnaryCall(ctx, req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(*oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, *oauthScope) - } - grpclog.Println("PerRPCCreds done") -} - -var ( - testMetadata = metadata.MD{ - "key1": []string{"value1"}, - "key2": []string{"value2"}, - } -) - -func doCancelAfterBegin(tc testpb.TestServiceClient) { - ctx, cancel := context.WithCancel(metadata.NewContext(context.Background(), testMetadata)) - stream, err := tc.StreamingInputCall(ctx) - if err != nil { - grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) - } - cancel() - _, err = stream.CloseAndRecv() - if grpc.Code(err) != codes.Canceled { - grpclog.Fatalf("%v.CloseAndRecv() got error code %d, want %d", stream, grpc.Code(err), codes.Canceled) - } - grpclog.Println("CancelAfterBegin done") -} - -func doCancelAfterFirstResponse(tc testpb.TestServiceClient) { - ctx, cancel := context.WithCancel(context.Background()) - stream, err := tc.FullDuplexCall(ctx) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - respParam := []*testpb.ResponseParameters{ - { - Size: proto.Int32(31415), - }, - } - pl := newPayload(testpb.PayloadType_COMPRESSABLE, 27182) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - if _, err := stream.Recv(); err != nil { - grpclog.Fatalf("%v.Recv() = %v", stream, err) - } - cancel() - if _, err := stream.Recv(); grpc.Code(err) != codes.Canceled { - grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), codes.Canceled) - } - grpclog.Println("CancelAfterFirstResponse done") -} - func main() { flag.Parse() serverAddr := net.JoinHostPort(*serverHost, strconv.Itoa(*serverPort)) @@ -495,9 +86,9 @@ func main() { sn = *tlsServerName } var creds credentials.TransportAuthenticator - if *caFile != "" { + if *testCA { var err error - creds, err = credentials.NewClientTLSFromFile(*caFile, sn) + creds, err = credentials.NewClientTLSFromFile(testCAFile, sn) if err != nil { grpclog.Fatalf("Failed to create TLS credentials %v", err) } @@ -520,7 +111,7 @@ func main() { } opts = append(opts, grpc.WithPerRPCCredentials(jwtCreds)) } else if *testCase == "oauth2_auth_token" { - opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(getToken()))) + opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope)))) } } else { opts = append(opts, grpc.WithInsecure()) @@ -533,48 +124,48 @@ func main() { tc := testpb.NewTestServiceClient(conn) switch *testCase { case "empty_unary": - doEmptyUnaryCall(tc) + interop.DoEmptyUnaryCall(tc) case "large_unary": - doLargeUnaryCall(tc) + interop.DoLargeUnaryCall(tc) case "client_streaming": - doClientStreaming(tc) + interop.DoClientStreaming(tc) case "server_streaming": - doServerStreaming(tc) + interop.DoServerStreaming(tc) case "ping_pong": - doPingPong(tc) + interop.DoPingPong(tc) case "empty_stream": - doEmptyStream(tc) + interop.DoEmptyStream(tc) case "timeout_on_sleeping_server": - doTimeoutOnSleepingServer(tc) + interop.DoTimeoutOnSleepingServer(tc) case "compute_engine_creds": if !*useTLS { grpclog.Fatalf("TLS is not enabled. TLS is required to execute compute_engine_creds test case.") } - doComputeEngineCreds(tc) + interop.DoComputeEngineCreds(tc, *defaultServiceAccount, *oauthScope) case "service_account_creds": if !*useTLS { grpclog.Fatalf("TLS is not enabled. TLS is required to execute service_account_creds test case.") } - doServiceAccountCreds(tc) + interop.DoServiceAccountCreds(tc, *serviceAccountKeyFile, *oauthScope) case "jwt_token_creds": if !*useTLS { grpclog.Fatalf("TLS is not enabled. TLS is required to execute jwt_token_creds test case.") } - doJWTTokenCreds(tc) + interop.DoJWTTokenCreds(tc, *serviceAccountKeyFile) case "per_rpc_creds": if !*useTLS { grpclog.Fatalf("TLS is not enabled. TLS is required to execute per_rpc_creds test case.") } - doPerRPCCreds(tc) + interop.DoPerRPCCreds(tc, *serviceAccountKeyFile, *oauthScope) case "oauth2_auth_token": if !*useTLS { grpclog.Fatalf("TLS is not enabled. TLS is required to execute oauth2_auth_token test case.") } - doOauth2TokenCreds(tc) + interop.DoOauth2TokenCreds(tc, *serviceAccountKeyFile, *oauthScope) case "cancel_after_begin": - doCancelAfterBegin(tc) + interop.DoCancelAfterBegin(tc) case "cancel_after_first_response": - doCancelAfterFirstResponse(tc) + interop.DoCancelAfterFirstResponse(tc) default: grpclog.Fatal("Unsupported test case: ", *testCase) } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.pb.go index b25e98b8e43..7b0803f5523 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.pb.go @@ -22,6 +22,7 @@ It has these top-level messages: package grpc_testing import proto "github.com/golang/protobuf/proto" +import fmt "fmt" import math "math" import ( @@ -29,14 +30,15 @@ import ( grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 + // The type of payload that should be returned. type PayloadType int32 @@ -76,14 +78,16 @@ func (x *PayloadType) UnmarshalJSON(data []byte) error { *x = PayloadType(value) return nil } +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type Empty struct { XXX_unrecognized []byte `json:"-"` } -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // A block of data, to simply increase gRPC message size. type Payload struct { @@ -94,9 +98,10 @@ type Payload struct { XXX_unrecognized []byte `json:"-"` } -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Payload) GetType() PayloadType { if m != nil && m.Type != nil { @@ -129,9 +134,10 @@ type SimpleRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *SimpleRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -180,9 +186,10 @@ type SimpleResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *SimpleResponse) GetPayload() *Payload { if m != nil { @@ -212,9 +219,10 @@ type StreamingInputCallRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } -func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallRequest) ProtoMessage() {} +func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } +func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallRequest) ProtoMessage() {} +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *StreamingInputCallRequest) GetPayload() *Payload { if m != nil { @@ -230,9 +238,10 @@ type StreamingInputCallResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } -func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallResponse) ProtoMessage() {} +func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } +func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallResponse) ProtoMessage() {} +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { if m != nil && m.AggregatedPayloadSize != nil { @@ -252,9 +261,10 @@ type ResponseParameters struct { XXX_unrecognized []byte `json:"-"` } -func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } -func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } -func (*ResponseParameters) ProtoMessage() {} +func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } +func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } +func (*ResponseParameters) ProtoMessage() {} +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *ResponseParameters) GetSize() int32 { if m != nil && m.Size != nil { @@ -284,9 +294,10 @@ type StreamingOutputCallRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } -func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallRequest) ProtoMessage() {} +func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } +func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallRequest) ProtoMessage() {} +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -316,9 +327,10 @@ type StreamingOutputCallResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } -func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallResponse) ProtoMessage() {} +func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } +func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallResponse) ProtoMessage() {} +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *StreamingOutputCallResponse) GetPayload() *Payload { if m != nil { @@ -328,9 +340,22 @@ func (m *StreamingOutputCallResponse) GetPayload() *Payload { } func init() { + proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") + proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") + proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") + proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") + proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") + proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) } +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + // Client API for TestService service type TestServiceClient interface { @@ -539,9 +564,9 @@ func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { s.RegisterService(&_TestService_serviceDesc, srv) } -func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(Empty) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(TestServiceServer).EmptyCall(ctx, in) @@ -551,9 +576,9 @@ func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, codec return out, nil } -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(SimpleRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(TestServiceServer).UnaryCall(ctx, in) @@ -700,3 +725,43 @@ var _TestService_serviceDesc = grpc.ServiceDesc{ }, }, } + +var fileDescriptor0 = []byte{ + // 567 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x51, 0x6f, 0xd2, 0x50, + 0x14, 0xb6, 0x03, 0x64, 0x1c, 0x58, 0x43, 0x0e, 0x59, 0x64, 0x9d, 0x89, 0x4b, 0x7d, 0xb0, 0x9a, + 0x88, 0x86, 0x44, 0x1f, 0x35, 0x73, 0x63, 0x71, 0x09, 0x03, 0x6c, 0xe1, 0x99, 0x5c, 0xe1, 0x0e, + 0x9b, 0x94, 0xb6, 0xb6, 0xb7, 0x46, 0x7c, 0xf0, 0x8f, 0xf9, 0x67, 0xfc, 0x11, 0xfe, 0x00, 0xef, + 0xbd, 0x6d, 0xa1, 0x40, 0x17, 0x99, 0xc6, 0xbd, 0xb5, 0xdf, 0xf9, 0xce, 0x77, 0xbe, 0xef, 0x9e, + 0xdb, 0x02, 0x30, 0x1a, 0xb2, 0x96, 0x1f, 0x78, 0xcc, 0xc3, 0xda, 0x2c, 0xf0, 0x27, 0x2d, 0x01, + 0xd8, 0xee, 0x4c, 0x2f, 0x43, 0xa9, 0x33, 0xf7, 0xd9, 0x42, 0xef, 0x42, 0x79, 0x40, 0x16, 0x8e, + 0x47, 0xa6, 0xf8, 0x1c, 0x8a, 0x6c, 0xe1, 0xd3, 0xa6, 0x72, 0xa2, 0x18, 0x6a, 0xfb, 0xa8, 0x95, + 0x6d, 0x68, 0x25, 0xa4, 0x21, 0x27, 0x98, 0x92, 0x86, 0x08, 0xc5, 0x8f, 0xde, 0x74, 0xd1, 0xdc, + 0xe3, 0xf4, 0x9a, 0x29, 0x9f, 0xf5, 0x5f, 0x0a, 0x1c, 0x58, 0xf6, 0xdc, 0x77, 0xa8, 0x49, 0x3f, + 0x47, 0xbc, 0x15, 0xdf, 0xc0, 0x41, 0x40, 0x43, 0xdf, 0x73, 0x43, 0x3a, 0xde, 0x4d, 0xbd, 0x96, + 0xf2, 0xc5, 0x1b, 0x3e, 0xce, 0xf4, 0x87, 0xf6, 0x37, 0x2a, 0xc7, 0x95, 0x56, 0x24, 0x8b, 0x63, + 0xf8, 0x02, 0xca, 0x7e, 0xac, 0xd0, 0x2c, 0xf0, 0x72, 0xb5, 0x7d, 0x98, 0x2b, 0x6f, 0xa6, 0x2c, + 0xa1, 0x7a, 0x6d, 0x3b, 0xce, 0x38, 0x0a, 0x69, 0xe0, 0x92, 0x39, 0x6d, 0x16, 0x79, 0xdb, 0xbe, + 0x59, 0x13, 0xe0, 0x28, 0xc1, 0xd0, 0x80, 0xba, 0x24, 0x79, 0x24, 0x62, 0x9f, 0xc6, 0xe1, 0xc4, + 0xe3, 0xee, 0x4b, 0x92, 0xa7, 0x0a, 0xbc, 0x2f, 0x60, 0x4b, 0xa0, 0xfa, 0x77, 0x50, 0xd3, 0xd4, + 0xb1, 0xab, 0xac, 0x23, 0x65, 0x27, 0x47, 0x1a, 0xec, 0x2f, 0xcd, 0x88, 0x88, 0x15, 0x73, 0xf9, + 0x8e, 0x8f, 0xa0, 0x9a, 0xf5, 0x50, 0x90, 0x65, 0xf0, 0x56, 0xf3, 0xbb, 0x70, 0x64, 0xb1, 0x80, + 0x92, 0x39, 0x97, 0xbe, 0x74, 0xfd, 0x88, 0x9d, 0x11, 0xc7, 0x49, 0x37, 0x70, 0x5b, 0x2b, 0xfa, + 0x10, 0xb4, 0x3c, 0xb5, 0x24, 0xd9, 0x6b, 0x78, 0x40, 0x66, 0xb3, 0x80, 0xce, 0x08, 0xa3, 0xd3, + 0x71, 0xd2, 0x13, 0xaf, 0x46, 0x91, 0xab, 0x39, 0x5c, 0x95, 0x13, 0x69, 0xb1, 0x23, 0xfd, 0x12, + 0x30, 0xd5, 0x18, 0x90, 0x80, 0xc7, 0x62, 0x34, 0x08, 0xc5, 0x25, 0xca, 0xb4, 0xca, 0x67, 0x11, + 0xd7, 0x76, 0x79, 0xf5, 0x0b, 0x11, 0x0b, 0x4a, 0x16, 0x0e, 0x29, 0x34, 0x0a, 0xf5, 0x9f, 0x4a, + 0xc6, 0x61, 0x3f, 0x62, 0x1b, 0x81, 0xff, 0xf5, 0xca, 0x7d, 0x80, 0xc6, 0xb2, 0xdf, 0x5f, 0x5a, + 0xe5, 0x3e, 0x0a, 0xfc, 0xf0, 0x4e, 0xd6, 0x55, 0xb6, 0x23, 0x99, 0x18, 0x6c, 0xc7, 0xbc, 0xed, + 0x05, 0xd5, 0x7b, 0x70, 0x9c, 0x9b, 0xf0, 0x2f, 0xaf, 0xd7, 0xb3, 0xb7, 0x50, 0xcd, 0x04, 0xc6, + 0x3a, 0xd4, 0xce, 0xfa, 0x57, 0x03, 0xb3, 0x63, 0x59, 0xa7, 0xef, 0xba, 0x9d, 0xfa, 0x3d, 0xbe, + 0x08, 0x75, 0xd4, 0x5b, 0xc3, 0x14, 0x04, 0xb8, 0x6f, 0x9e, 0xf6, 0xce, 0xfb, 0x57, 0xf5, 0xbd, + 0xf6, 0x8f, 0x22, 0x54, 0x87, 0x5c, 0xdd, 0xe2, 0x4b, 0xb0, 0x27, 0x14, 0x5f, 0x41, 0x45, 0xfe, + 0x40, 0x84, 0x2d, 0x6c, 0xac, 0x4f, 0x97, 0x05, 0x2d, 0x0f, 0xc4, 0x0b, 0xa8, 0x8c, 0x5c, 0x12, + 0xc4, 0x6d, 0xc7, 0xeb, 0x8c, 0xb5, 0x1f, 0x87, 0xf6, 0x30, 0xbf, 0x98, 0x1c, 0x80, 0x03, 0x8d, + 0x9c, 0xf3, 0x41, 0x63, 0xa3, 0xe9, 0xc6, 0x4b, 0xa2, 0x3d, 0xdd, 0x81, 0x19, 0xcf, 0x7a, 0xa9, + 0xa0, 0x0d, 0xb8, 0xfd, 0x45, 0xe0, 0x93, 0x1b, 0x24, 0x36, 0xbf, 0x40, 0xcd, 0xf8, 0x33, 0x31, + 0x1e, 0x65, 0x88, 0x51, 0xea, 0x45, 0xe4, 0x38, 0xe7, 0x11, 0x4f, 0xfb, 0xf5, 0xbf, 0x65, 0x32, + 0x14, 0x99, 0x4a, 0x7d, 0x4f, 0x9c, 0xeb, 0x3b, 0x18, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4c, + 0x41, 0xfe, 0xb6, 0x89, 0x06, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/interop/server/server.go b/Godeps/_workspace/src/google.golang.org/grpc/interop/server/server.go index f781c9d537f..36ebcb6418e 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/interop/server/server.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/interop/server/server.go @@ -35,17 +35,13 @@ package main import ( "flag" - "fmt" - "io" "net" "strconv" - "time" - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" testpb "google.golang.org/grpc/interop/grpc_testing" ) @@ -56,138 +52,6 @@ var ( port = flag.Int("port", 10000, "The server port") ) -type testServer struct { -} - -func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { - return new(testpb.Empty), nil -} - -func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { - if size < 0 { - return nil, fmt.Errorf("requested a response with invalid length %d", size) - } - body := make([]byte, size) - switch t { - case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - return nil, fmt.Errorf("payloadType UNCOMPRESSABLE is not supported") - default: - return nil, fmt.Errorf("unsupported payload type: %d", t) - } - return &testpb.Payload{ - Type: t.Enum(), - Body: body, - }, nil -} - -func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { - pl, err := newPayload(in.GetResponseType(), in.GetResponseSize()) - if err != nil { - return nil, err - } - return &testpb.SimpleResponse{ - Payload: pl, - }, nil -} - -func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { - cs := args.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := newPayload(args.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - return nil -} - -func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { - var sum int - for { - in, err := stream.Recv() - if err == io.EOF { - return stream.SendAndClose(&testpb.StreamingInputCallResponse{ - AggregatedPayloadSize: proto.Int32(int32(sum)), - }) - } - if err != nil { - return err - } - p := in.GetPayload().GetBody() - sum += len(p) - } -} - -func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - return nil - } - if err != nil { - return err - } - cs := in.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := newPayload(in.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - } -} - -func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { - var msgBuf []*testpb.StreamingOutputCallRequest - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - break - } - if err != nil { - return err - } - msgBuf = append(msgBuf, in) - } - for _, m := range msgBuf { - cs := m.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := newPayload(m.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - } - return nil -} - func main() { flag.Parse() p := strconv.Itoa(*port) @@ -204,6 +68,6 @@ func main() { opts = []grpc.ServerOption{grpc.Creds(creds)} } server := grpc.NewServer(opts...) - testpb.RegisterTestServiceServer(server, &testServer{}) + testpb.RegisterTestServiceServer(server, interop.NewTestServer()) server.Serve(lis) } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/interop/test_utils.go b/Godeps/_workspace/src/google.golang.org/grpc/interop/test_utils.go new file mode 100644 index 00000000000..6a73d6f4533 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/grpc/interop/test_utils.go @@ -0,0 +1,607 @@ +/* + * + * Copyright 2014, Google Inc. + * 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. + * + */ + +package interop + +import ( + "fmt" + "io" + "io/ioutil" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/metadata" +) + +var ( + reqSizes = []int{27182, 8, 1828, 45904} + respSizes = []int{31415, 9, 2653, 58979} + largeReqSize = 271828 + largeRespSize = 314159 +) + +func clientNewPayload(t testpb.PayloadType, size int) *testpb.Payload { + if size < 0 { + grpclog.Fatalf("Requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") + default: + grpclog.Fatalf("Unsupported payload type: %d", t) + } + return &testpb.Payload{ + Type: t.Enum(), + Body: body, + } +} + +// DoEmptyUnaryCall performs a unary RPC with empty request and response messages. +func DoEmptyUnaryCall(tc testpb.TestServiceClient) { + reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}) + if err != nil { + grpclog.Fatal("/TestService/EmptyCall RPC failed: ", err) + } + if !proto.Equal(&testpb.Empty{}, reply) { + grpclog.Fatalf("/TestService/EmptyCall receives %v, want %v", reply, testpb.Empty{}) + } + grpclog.Println("EmptyUnaryCall done") +} + +// DoLargeUnaryCall performs a unary RPC with large payload in the request and response. +func DoLargeUnaryCall(tc testpb.TestServiceClient) { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + t := reply.GetPayload().GetType() + s := len(reply.GetPayload().GetBody()) + if t != testpb.PayloadType_COMPRESSABLE || s != largeRespSize { + grpclog.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, largeRespSize) + } + grpclog.Println("LargeUnaryCall done") +} + +// DoClientStreaming performs a client streaming RPC. +func DoClientStreaming(tc testpb.TestServiceClient) { + stream, err := tc.StreamingInputCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) + } + var sum int + for _, s := range reqSizes { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, s) + req := &testpb.StreamingInputCallRequest{ + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) + } + sum += s + grpclog.Printf("Sent a request of size %d, aggregated size %d", s, sum) + + } + reply, err := stream.CloseAndRecv() + if err != nil { + grpclog.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) + } + if reply.GetAggregatedPayloadSize() != int32(sum) { + grpclog.Fatalf("%v.CloseAndRecv().GetAggregatePayloadSize() = %v; want %v", stream, reply.GetAggregatedPayloadSize(), sum) + } + grpclog.Println("ClientStreaming done") +} + +// DoServerStreaming performs a server streaming RPC. +func DoServerStreaming(tc testpb.TestServiceClient) { + respParam := make([]*testpb.ResponseParameters, len(respSizes)) + for i, s := range respSizes { + respParam[i] = &testpb.ResponseParameters{ + Size: proto.Int32(int32(s)), + } + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseParameters: respParam, + } + stream, err := tc.StreamingOutputCall(context.Background(), req) + if err != nil { + grpclog.Fatalf("%v.StreamingOutputCall(_) = _, %v", tc, err) + } + var rpcStatus error + var respCnt int + var index int + for { + reply, err := stream.Recv() + if err != nil { + rpcStatus = err + break + } + t := reply.GetPayload().GetType() + if t != testpb.PayloadType_COMPRESSABLE { + grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + respCnt++ + } + if rpcStatus != io.EOF { + grpclog.Fatalf("Failed to finish the server streaming rpc: %v", err) + } + if respCnt != len(respSizes) { + grpclog.Fatalf("Got %d reply, want %d", len(respSizes), respCnt) + } + grpclog.Println("ServerStreaming done") +} + +// DoPingPong performs ping-pong style bi-directional streaming RPC. +func DoPingPong(tc testpb.TestServiceClient) { + stream, err := tc.FullDuplexCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + var index int + for index < len(reqSizes) { + respParam := []*testpb.ResponseParameters{ + { + Size: proto.Int32(int32(respSizes[index])), + }, + } + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, reqSizes[index]) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseParameters: respParam, + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) + } + reply, err := stream.Recv() + if err != nil { + grpclog.Fatalf("%v.Recv() = %v", stream, err) + } + t := reply.GetPayload().GetType() + if t != testpb.PayloadType_COMPRESSABLE { + grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + grpclog.Fatalf("%v failed to complele the ping pong test: %v", stream, err) + } + grpclog.Println("Pingpong done") +} + +// DoEmptyStream sets up a bi-directional streaming with zero message. +func DoEmptyStream(tc testpb.TestServiceClient) { + stream, err := tc.FullDuplexCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + grpclog.Fatalf("%v failed to complete the empty stream test: %v", stream, err) + } + grpclog.Println("Emptystream done") +} + +// DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout. +func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient) { + ctx, _ := context.WithTimeout(context.Background(), 1*time.Millisecond) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + if grpc.Code(err) == codes.DeadlineExceeded { + grpclog.Println("TimeoutOnSleepingServer done") + return + } + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) + } + if _, err := stream.Recv(); grpc.Code(err) != codes.DeadlineExceeded { + grpclog.Fatalf("%v.Recv() = _, %v, want error code %d", stream, err, codes.DeadlineExceeded) + } + grpclog.Println("TimeoutOnSleepingServer done") +} + +// DoComputeEngineCreds performs a unary RPC with compute engine auth. +func DoComputeEngineCreds(tc testpb.TestServiceClient, serviceAccount, oauthScope string) { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + FillUsername: proto.Bool(true), + FillOauthScope: proto.Bool(true), + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + user := reply.GetUsername() + scope := reply.GetOauthScope() + if user != serviceAccount { + grpclog.Fatalf("Got user name %q, want %q.", user, serviceAccount) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } + grpclog.Println("ComputeEngineCreds done") +} + +func getServiceAccountJSONKey(keyFile string) []byte { + jsonKey, err := ioutil.ReadFile(keyFile) + if err != nil { + grpclog.Fatalf("Failed to read the service account key file: %v", err) + } + return jsonKey +} + +// DoServiceAccountCreds performs a unary RPC with service account auth. +func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + FillUsername: proto.Bool(true), + FillOauthScope: proto.Bool(true), + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } + grpclog.Println("ServiceAccountCreds done") +} + +// DoJWTTokenCreds performs a unary RPC with JWT token auth. +func DoJWTTokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile string) { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + FillUsername: proto.Bool(true), + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + grpclog.Println("JWTtokenCreds done") +} + +// GetToken obtains an OAUTH token from the input. +func GetToken(serviceAccountKeyFile string, oauthScope string) *oauth2.Token { + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + config, err := google.JWTConfigFromJSON(jsonKey, oauthScope) + if err != nil { + grpclog.Fatalf("Failed to get the config: %v", err) + } + token, err := config.TokenSource(context.Background()).Token() + if err != nil { + grpclog.Fatalf("Failed to get the token: %v", err) + } + return token +} + +// DoOauth2TokenCreds performs a unary RPC with OAUTH2 token auth. +func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + FillUsername: proto.Bool(true), + FillOauthScope: proto.Bool(true), + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } + grpclog.Println("Oauth2TokenCreds done") +} + +// DoPerRPCCreds performs a unary RPC with per RPC OAUTH2 token. +func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseSize: proto.Int32(int32(largeRespSize)), + Payload: pl, + FillUsername: proto.Bool(true), + FillOauthScope: proto.Bool(true), + } + token := GetToken(serviceAccountKeyFile, oauthScope) + kv := map[string]string{"authorization": token.TokenType + " " + token.AccessToken} + ctx := metadata.NewContext(context.Background(), metadata.MD{"authorization": []string{kv["authorization"]}}) + reply, err := tc.UnaryCall(ctx, req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } + grpclog.Println("PerRPCCreds done") +} + +var ( + testMetadata = metadata.MD{ + "key1": []string{"value1"}, + "key2": []string{"value2"}, + } +) + +// DoCancelAfterBegin cancels the RPC after metadata has been sent but before payloads are sent. +func DoCancelAfterBegin(tc testpb.TestServiceClient) { + ctx, cancel := context.WithCancel(metadata.NewContext(context.Background(), testMetadata)) + stream, err := tc.StreamingInputCall(ctx) + if err != nil { + grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) + } + cancel() + _, err = stream.CloseAndRecv() + if grpc.Code(err) != codes.Canceled { + grpclog.Fatalf("%v.CloseAndRecv() got error code %d, want %d", stream, grpc.Code(err), codes.Canceled) + } + grpclog.Println("CancelAfterBegin done") +} + +// DoCancelAfterFirstResponse cancels the RPC after receiving the first message from the server. +func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { + ctx, cancel := context.WithCancel(context.Background()) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: proto.Int32(31415), + }, + } + pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), + ResponseParameters: respParam, + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) + } + if _, err := stream.Recv(); err != nil { + grpclog.Fatalf("%v.Recv() = %v", stream, err) + } + cancel() + if _, err := stream.Recv(); grpc.Code(err) != codes.Canceled { + grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), codes.Canceled) + } + grpclog.Println("CancelAfterFirstResponse done") +} + +type testServer struct { +} + +// NewTestServer creates a test server for test service. +func NewTestServer() testpb.TestServiceServer { + return &testServer{} +} + +func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + return new(testpb.Empty), nil +} + +func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { + if size < 0 { + return nil, fmt.Errorf("requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + return nil, fmt.Errorf("payloadType UNCOMPRESSABLE is not supported") + default: + return nil, fmt.Errorf("unsupported payload type: %d", t) + } + return &testpb.Payload{ + Type: t.Enum(), + Body: body, + }, nil +} + +func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) + if err != nil { + return nil, err + } + return &testpb.SimpleResponse{ + Payload: pl, + }, nil +} + +func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { + cs := args.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(args.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + return nil +} + +func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { + var sum int + for { + in, err := stream.Recv() + if err == io.EOF { + return stream.SendAndClose(&testpb.StreamingInputCallResponse{ + AggregatedPayloadSize: proto.Int32(int32(sum)), + }) + } + if err != nil { + return err + } + p := in.GetPayload().GetBody() + sum += len(p) + } +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + return nil + } + if err != nil { + return err + } + cs := in.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(in.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + } +} + +func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { + var msgBuf []*testpb.StreamingOutputCallRequest + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + break + } + if err != nil { + return err + } + msgBuf = append(msgBuf, in) + } + for _, m := range msgBuf { + cs := m.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(m.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + } + return nil +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata.go b/Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata.go index 5f26abaeacb..58469ddd3fa 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata.go @@ -46,27 +46,16 @@ const ( binHdrSuffix = "-bin" ) -// grpc-http2 requires ASCII header key and value (more detail can be found in -// "Requests" subsection in go/grpc-http2). -func isASCII(s string) bool { - for _, c := range s { - if c > 127 { - return false - } - } - return true -} - // encodeKeyValue encodes key and value qualified for transmission via gRPC. // Transmitting binary headers violates HTTP/2 spec. // TODO(zhaoq): Maybe check if k is ASCII also. func encodeKeyValue(k, v string) (string, string) { - if isASCII(v) { - return k, v + k = strings.ToLower(k) + if strings.HasSuffix(k, binHdrSuffix) { + val := base64.StdEncoding.EncodeToString([]byte(v)) + v = string(val) } - key := strings.ToLower(k + binHdrSuffix) - val := base64.StdEncoding.EncodeToString([]byte(v)) - return key, string(val) + return k, v } // DecodeKeyValue returns the original key and value corresponding to the @@ -75,12 +64,11 @@ func DecodeKeyValue(k, v string) (string, string, error) { if !strings.HasSuffix(k, binHdrSuffix) { return k, v, nil } - key := k[:len(k)-len(binHdrSuffix)] val, err := base64.StdEncoding.DecodeString(v) if err != nil { return "", "", err } - return key, string(val), nil + return k, string(val), nil } // MD is a mapping from metadata keys to values. Users should use the following diff --git a/Godeps/_workspace/src/google.golang.org/grpc/naming/etcd/etcd.go b/Godeps/_workspace/src/google.golang.org/grpc/naming/etcd/etcd.go deleted file mode 100644 index 915e22717e8..00000000000 --- a/Godeps/_workspace/src/google.golang.org/grpc/naming/etcd/etcd.go +++ /dev/null @@ -1,145 +0,0 @@ -package etcd - -import ( - "log" - "sync" - - etcdcl "github.com/coreos/etcd/client" - "golang.org/x/net/context" - "google.golang.org/grpc/naming" -) - -type kv struct { - key, value string -} - -// recvBuffer is an unbounded channel of *kv to record all the pending changes from etcd server. -type recvBuffer struct { - c chan *kv - mu sync.Mutex - stopping bool - backlog []*kv -} - -func newRecvBuffer() *recvBuffer { - b := &recvBuffer{ - c: make(chan *kv, 1), - } - return b -} - -func (b *recvBuffer) put(r *kv) { - b.mu.Lock() - defer b.mu.Unlock() - if b.stopping { - return - } - b.backlog = append(b.backlog, r) - select { - case b.c <- b.backlog[0]: - b.backlog = b.backlog[1:] - default: - } -} - -func (b *recvBuffer) load() { - b.mu.Lock() - defer b.mu.Unlock() - if b.stopping || len(b.backlog) == 0 { - return - } - select { - case b.c <- b.backlog[0]: - b.backlog = b.backlog[1:] - default: - } -} - -func (b *recvBuffer) get() <-chan *kv { - return b.c -} - -// stop terminates the recvBuffer. After it is called, the recvBuffer is not usable any more. -func (b *recvBuffer) stop() { - b.mu.Lock() - b.stopping = true - close(b.c) - b.mu.Unlock() -} - -type etcdNR struct { - kAPI etcdcl.KeysAPI - recv *recvBuffer - ctx context.Context - cancel context.CancelFunc -} - -// NewETCDNR creates an etcd NameResolver. -func NewETCDNR(cfg etcdcl.Config) (naming.Resolver, error) { - c, err := etcdcl.New(cfg) - if err != nil { - return nil, err - } - kAPI := etcdcl.NewKeysAPI(c) - ctx, cancel := context.WithCancel(context.Background()) - return &etcdNR{ - kAPI: kAPI, - recv: newRecvBuffer(), - ctx: ctx, - cancel: cancel, - }, nil -} - -// getNode builds the resulting key-value map starting from node recursively. -func getNode(node *etcdcl.Node, res map[string]string) { - if !node.Dir { - res[node.Key] = node.Value - return - } - for _, val := range node.Nodes { - getNode(val, res) - } -} - -func (nr *etcdNR) Get(target string) map[string]string { - resp, err := nr.kAPI.Get(nr.ctx, target, &etcdcl.GetOptions{Recursive: true, Sort: true}) - if err != nil { - log.Printf("etcdNR.Get(_) stopped: %v", err) - return nil - } - res := make(map[string]string) - getNode(resp.Node, res) - return res -} - -func (nr *etcdNR) Watch(target string) { - watcher := nr.kAPI.Watcher(target, &etcdcl.WatcherOptions{Recursive: true}) - for { - resp, err := watcher.Next(nr.ctx) - if err != nil { - log.Printf("etcdNR.Watch(_) stopped: %v", err) - break - } - if resp.Node.Dir { - continue - } - entry := &kv{key: resp.Node.Key, value: resp.Node.Value} - nr.recv.put(entry) - } -} - -func (nr *etcdNR) GetUpdate() (string, string) { - i := <-nr.recv.get() - nr.recv.load() - if i == nil { - return "", "" - } - // returns key and the corresponding value of the updated kv pair - return i.key, i.value - -} - -func (nr *etcdNR) Stop() { - nr.recv.stop() - nr.cancel() -} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/naming/naming.go b/Godeps/_workspace/src/google.golang.org/grpc/naming/naming.go index a6a319f7507..06605607c37 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/naming/naming.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/naming/naming.go @@ -1,13 +1,73 @@ +/* + * + * Copyright 2014, Google Inc. + * 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. + * + */ + +// Package naming defines the naming API and related data structures for gRPC. +// The interface is EXPERIMENTAL and may be suject to change. package naming -// Resolver dose name resolution and watches for the resolution changes. -type Resolver interface { - // Get gets a snapshot of the current name resolution results for target. - Get(target string) map[string]string - // Watch watches for the name resolution changes on target. It blocks until Stop() is invoked. The watch results are obtained via GetUpdate(). - Watch(target string) - // GetUpdate returns a name resolution change when watch is triggered. It blocks until it observes a change. The caller needs to call it again to get the next change. - GetUpdate() (string, string) - // Stop shuts down the NameResolver. - Stop() +// Operation defines the corresponding operations for a name resolution change. +type Operation uint8 + +const ( + // Add indicates a new address is added. + Add Operation = iota + // Delete indicates an exisiting address is deleted. + Delete +) + +// Update defines a name resolution update. Notice that it is not valid having both +// empty string Addr and nil Metadata in an Update. +type Update struct { + // Op indicates the operation of the update. + Op Operation + // Addr is the updated address. It is empty string if there is no address update. + Addr string + // Metadata is the updated metadata. It is nil if there is no metadata update. + // Metadata is not required for a custom naming implementation. + Metadata interface{} +} + +// Resolver creates a Watcher for a target to track its resolution changes. +type Resolver interface { + // Resolve creates a Watcher for target. + Resolve(target string) (Watcher, error) +} + +// Watcher watches for the updates on the specified target. +type Watcher interface { + // Next blocks until an update or error happens. It may return one or more + // updates. The first call should get the full set of the results. + Next() ([]*Update, error) + // Close closes the Watcher. + Close() } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/peer/peer.go b/Godeps/_workspace/src/google.golang.org/grpc/peer/peer.go new file mode 100644 index 00000000000..bfa6205ba9e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/grpc/peer/peer.go @@ -0,0 +1,65 @@ +/* + * + * Copyright 2014, Google Inc. + * 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. + * + */ + +// Package peer defines various peer information associated with RPCs and +// corresponding utils. +package peer + +import ( + "net" + + "golang.org/x/net/context" + "google.golang.org/grpc/credentials" +) + +// Peer contains the information of the peer for an RPC. +type Peer struct { + // Addr is the peer address. + Addr net.Addr + // AuthInfo is the authentication information of the transport. + // It is nil if there is no transport security being used. + AuthInfo credentials.AuthInfo +} + +type peerKey struct{} + +// NewContext creates a new context with peer information attached. +func NewContext(ctx context.Context, p *Peer) context.Context { + return context.WithValue(ctx, peerKey{}, p) +} + +// FromContext returns the peer information in ctx if it exists. +func FromContext(ctx context.Context) (p *Peer, ok bool) { + p, ok = ctx.Value(peerKey{}).(*Peer) + return +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/picker.go b/Godeps/_workspace/src/google.golang.org/grpc/picker.go new file mode 100644 index 00000000000..50f315b44f3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/grpc/picker.go @@ -0,0 +1,243 @@ +/* + * + * Copyright 2014, Google Inc. + * 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. + * + */ + +package grpc + +import ( + "container/list" + "fmt" + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/naming" + "google.golang.org/grpc/transport" +) + +// Picker picks a Conn for RPC requests. +// This is EXPERIMENTAL and please do not implement your own Picker for now. +type Picker interface { + // Init does initial processing for the Picker, e.g., initiate some connections. + Init(cc *ClientConn) error + // Pick blocks until either a transport.ClientTransport is ready for the upcoming RPC + // or some error happens. + Pick(ctx context.Context) (transport.ClientTransport, error) + // PickAddr picks a peer address for connecting. This will be called repeated for + // connecting/reconnecting. + PickAddr() (string, error) + // State returns the connectivity state of the underlying connections. + State() (ConnectivityState, error) + // WaitForStateChange blocks until the state changes to something other than + // the sourceState. It returns the new state or error. + WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) + // Close closes all the Conn's owned by this Picker. + Close() error +} + +// unicastPicker is the default Picker which is used when there is no custom Picker +// specified by users. It always picks the same Conn. +type unicastPicker struct { + target string + conn *Conn +} + +func (p *unicastPicker) Init(cc *ClientConn) error { + c, err := NewConn(cc) + if err != nil { + return err + } + p.conn = c + return nil +} + +func (p *unicastPicker) Pick(ctx context.Context) (transport.ClientTransport, error) { + return p.conn.Wait(ctx) +} + +func (p *unicastPicker) PickAddr() (string, error) { + return p.target, nil +} + +func (p *unicastPicker) State() (ConnectivityState, error) { + return p.conn.State(), nil +} + +func (p *unicastPicker) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) { + return p.conn.WaitForStateChange(ctx, sourceState) +} + +func (p *unicastPicker) Close() error { + if p.conn != nil { + return p.conn.Close() + } + return nil +} + +// unicastNamingPicker picks an address from a name resolver to set up the connection. +type unicastNamingPicker struct { + cc *ClientConn + resolver naming.Resolver + watcher naming.Watcher + mu sync.Mutex + // The list of the addresses are obtained from watcher. + addrs *list.List + // It tracks the current picked addr by PickAddr(). The next PickAddr may + // push it forward on addrs. + pickedAddr *list.Element + conn *Conn +} + +// NewUnicastNamingPicker creates a Picker to pick addresses from a name resolver +// to connect. +func NewUnicastNamingPicker(r naming.Resolver) Picker { + return &unicastNamingPicker{ + resolver: r, + addrs: list.New(), + } +} + +type addrInfo struct { + addr string + // Set to true if this addrInfo needs to be deleted in the next PickAddrr() call. + deleting bool +} + +// processUpdates calls Watcher.Next() once and processes the obtained updates. +func (p *unicastNamingPicker) processUpdates() error { + updates, err := p.watcher.Next() + if err != nil { + return err + } + for _, update := range updates { + switch update.Op { + case naming.Add: + p.mu.Lock() + p.addrs.PushBack(&addrInfo{ + addr: update.Addr, + }) + p.mu.Unlock() + // Initial connection setup + if p.conn == nil { + conn, err := NewConn(p.cc) + if err != nil { + return err + } + p.conn = conn + } + case naming.Delete: + p.mu.Lock() + for e := p.addrs.Front(); e != nil; e = e.Next() { + if update.Addr == e.Value.(*addrInfo).addr { + if e == p.pickedAddr { + // Do not remove the element now if it is the current picked + // one. We leave the deletion to the next PickAddr() call. + e.Value.(*addrInfo).deleting = true + // Notify Conn to close it. All the live RPCs on this connection + // will be aborted. + p.conn.NotifyReset() + } else { + p.addrs.Remove(e) + } + } + } + p.mu.Unlock() + default: + grpclog.Println("Unknown update.Op ", update.Op) + } + } + return nil +} + +// monitor runs in a standalone goroutine to keep watching name resolution updates until the watcher +// is closed. +func (p *unicastNamingPicker) monitor() { + for { + if err := p.processUpdates(); err != nil { + return + } + } +} + +func (p *unicastNamingPicker) Init(cc *ClientConn) error { + w, err := p.resolver.Resolve(cc.target) + if err != nil { + return err + } + p.watcher = w + p.cc = cc + // Get the initial name resolution. + if err := p.processUpdates(); err != nil { + return err + } + go p.monitor() + return nil +} + +func (p *unicastNamingPicker) Pick(ctx context.Context) (transport.ClientTransport, error) { + return p.conn.Wait(ctx) +} + +func (p *unicastNamingPicker) PickAddr() (string, error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.pickedAddr == nil { + p.pickedAddr = p.addrs.Front() + } else { + pa := p.pickedAddr + p.pickedAddr = pa.Next() + if pa.Value.(*addrInfo).deleting { + p.addrs.Remove(pa) + } + if p.pickedAddr == nil { + p.pickedAddr = p.addrs.Front() + } + } + if p.pickedAddr == nil { + return "", fmt.Errorf("there is no address available to pick") + } + return p.pickedAddr.Value.(*addrInfo).addr, nil +} + +func (p *unicastNamingPicker) State() (ConnectivityState, error) { + return 0, fmt.Errorf("State() is not supported for unicastNamingPicker") +} + +func (p *unicastNamingPicker) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) { + return 0, fmt.Errorf("WaitForStateChange is not supported for unicastNamingPciker") +} + +func (p *unicastNamingPicker) Close() error { + p.watcher.Close() + p.conn.Close() + return nil +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/rpc_util.go b/Godeps/_workspace/src/google.golang.org/grpc/rpc_util.go index a0f0b48bb44..e98ddbcdc5a 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/rpc_util.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/rpc_util.go @@ -35,9 +35,12 @@ package grpc import ( "bytes" + "compress/gzip" "encoding/binary" "fmt" "io" + "io/ioutil" + "math" "math/rand" "os" "time" @@ -75,6 +78,71 @@ func (protoCodec) String() string { return "proto" } +// Compressor defines the interface gRPC uses to compress a message. +type Compressor interface { + // Do compresses p into w. + Do(w io.Writer, p []byte) error + // Type returns the compression algorithm the Compressor uses. + Type() string +} + +// NewGZIPCompressor creates a Compressor based on GZIP. +func NewGZIPCompressor() Compressor { + return &gzipCompressor{} +} + +type gzipCompressor struct { +} + +func (c *gzipCompressor) Do(w io.Writer, p []byte) error { + z := gzip.NewWriter(w) + if _, err := z.Write(p); err != nil { + return err + } + return z.Close() +} + +func (c *gzipCompressor) Type() string { + return "gzip" +} + +// Decompressor defines the interface gRPC uses to decompress a message. +type Decompressor interface { + // Do reads the data from r and uncompress them. + Do(r io.Reader) ([]byte, error) + // Type returns the compression algorithm the Decompressor uses. + Type() string +} + +type gzipDecompressor struct { +} + +// NewGZIPDecompressor creates a Decompressor based on GZIP. +func NewGZIPDecompressor() Decompressor { + return &gzipDecompressor{} +} + +func (d *gzipDecompressor) Do(r io.Reader) ([]byte, error) { + z, err := gzip.NewReader(r) + if err != nil { + return nil, err + } + defer z.Close() + return ioutil.ReadAll(z) +} + +func (d *gzipDecompressor) Type() string { + return "gzip" +} + +// callInfo contains all related configuration and information about an RPC. +type callInfo struct { + failFast bool + headerMD metadata.MD + trailerMD metadata.MD + traceInfo traceInfo // in trace.go +} + // CallOption configures a Call before it starts or extracts information from // a Call after it completes. type CallOption interface { @@ -118,8 +186,7 @@ type payloadFormat uint8 const ( compressionNone payloadFormat = iota // no compression - compressionFlate - // More formats + compressionMade ) // parser reads complelete gRPC messages from the underlying reader. @@ -127,42 +194,40 @@ type parser struct { s io.Reader } -// msgFixedHeader defines the header of a gRPC message (go/grpc-wirefmt). -type msgFixedHeader struct { - T payloadFormat - Length uint32 -} - // recvMsg is to read a complete gRPC message from the stream. It is blocking if // the message has not been complete yet. It returns the message and its type, // EOF is returned with nil msg and 0 pf if the entire stream is done. Other // non-nil error is returned if something is wrong on reading. func (p *parser) recvMsg() (pf payloadFormat, msg []byte, err error) { - var hdr msgFixedHeader - if err := binary.Read(p.s, binary.BigEndian, &hdr); err != nil { + // The header of a gRPC message. Find more detail + // at http://www.grpc.io/docs/guides/wire.html. + var buf [5]byte + + if _, err := io.ReadFull(p.s, buf[:]); err != nil { return 0, nil, err } - if hdr.Length == 0 { - return hdr.T, nil, nil + + pf = payloadFormat(buf[0]) + length := binary.BigEndian.Uint32(buf[1:]) + + if length == 0 { + return pf, nil, nil } - msg = make([]byte, int(hdr.Length)) + msg = make([]byte, int(length)) if _, err := io.ReadFull(p.s, msg); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return 0, nil, err } - return hdr.T, msg, nil + return pf, msg, nil } // encode serializes msg and prepends the message header. If msg is nil, it // generates the message header of 0 message length. -func encode(c Codec, msg interface{}, pf payloadFormat) ([]byte, error) { - var buf bytes.Buffer - // Write message fixed header. - buf.WriteByte(uint8(pf)) +func encode(c Codec, msg interface{}, cp Compressor, cbuf *bytes.Buffer) ([]byte, error) { var b []byte - var length uint32 + var length uint if msg != nil { var err error // TODO(zhaoq): optimize to reduce memory alloc and copying. @@ -170,27 +235,71 @@ func encode(c Codec, msg interface{}, pf payloadFormat) ([]byte, error) { if err != nil { return nil, err } - length = uint32(len(b)) + if cp != nil { + if err := cp.Do(cbuf, b); err != nil { + return nil, err + } + b = cbuf.Bytes() + } + length = uint(len(b)) } - var szHdr [4]byte - binary.BigEndian.PutUint32(szHdr[:], length) - buf.Write(szHdr[:]) - buf.Write(b) - return buf.Bytes(), nil + if length > math.MaxUint32 { + return nil, Errorf(codes.InvalidArgument, "grpc: message too large (%d bytes)", length) + } + + const ( + payloadLen = 1 + sizeLen = 4 + ) + + var buf = make([]byte, payloadLen+sizeLen+len(b)) + + // Write payload format + if cp == nil { + buf[0] = byte(compressionNone) + } else { + buf[0] = byte(compressionMade) + } + // Write length of b into buf + binary.BigEndian.PutUint32(buf[1:], uint32(length)) + // Copy encoded msg to buf + copy(buf[5:], b) + + return buf, nil } -func recv(p *parser, c Codec, m interface{}) error { +func checkRecvPayload(pf payloadFormat, recvCompress string, dc Decompressor) error { + switch pf { + case compressionNone: + case compressionMade: + if recvCompress == "" { + return transport.StreamErrorf(codes.InvalidArgument, "grpc: received unexpected payload format %d", pf) + } + if dc == nil || recvCompress != dc.Type() { + return transport.StreamErrorf(codes.InvalidArgument, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + } + default: + return transport.StreamErrorf(codes.InvalidArgument, "grpc: received unexpected payload format %d", pf) + } + return nil +} + +func recv(p *parser, c Codec, s *transport.Stream, dc Decompressor, m interface{}) error { pf, d, err := p.recvMsg() if err != nil { return err } - switch pf { - case compressionNone: - if err := c.Unmarshal(d, m); err != nil { - return Errorf(codes.Internal, "grpc: %v", err) + if err := checkRecvPayload(pf, s.RecvCompress(), dc); err != nil { + return err + } + if pf == compressionMade { + d, err = dc.Do(bytes.NewReader(d)) + if err != nil { + return transport.StreamErrorf(codes.Internal, "grpc: failed to decompress the received message %v", err) } - default: - return Errorf(codes.Internal, "gprc: compression is not supported yet.") + } + if err := c.Unmarshal(d, m); err != nil { + return transport.StreamErrorf(codes.Internal, "grpc: failed to unmarshal the received message %v", err) } return nil } @@ -217,6 +326,18 @@ func Code(err error) codes.Code { return codes.Unknown } +// ErrorDesc returns the error description of err if it was produced by the rpc system. +// Otherwise, it returns err.Error() or empty string when err is nil. +func ErrorDesc(err error) string { + if err == nil { + return "" + } + if e, ok := err.(rpcError); ok { + return e.desc + } + return err.Error() +} + // Errorf returns an error containing an error code and a description; // Errorf returns nil if c is OK. func Errorf(c codes.Code, format string, a ...interface{}) error { @@ -232,6 +353,8 @@ func Errorf(c codes.Code, format string, a ...interface{}) error { // toRPCErr converts an error into a rpcError. func toRPCErr(err error) error { switch e := err.(type) { + case rpcError: + return err case transport.StreamError: return rpcError{ code: e.Code, diff --git a/Godeps/_workspace/src/google.golang.org/grpc/server.go b/Godeps/_workspace/src/google.golang.org/grpc/server.go index feb29887513..1c42b6eff27 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/server.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/server.go @@ -34,13 +34,16 @@ package grpc import ( + "bytes" "errors" "fmt" "io" "net" "reflect" + "runtime" "strings" "sync" + "time" "golang.org/x/net/context" "golang.org/x/net/trace" @@ -51,7 +54,7 @@ import ( "google.golang.org/grpc/transport" ) -type methodHandler func(srv interface{}, ctx context.Context, codec Codec, buf []byte) (interface{}, error) +type methodHandler func(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) // MethodDesc represents an RPC service's method specification. type MethodDesc struct { @@ -79,16 +82,19 @@ type service struct { // Server is a gRPC server to serve RPC requests. type Server struct { - opts options - mu sync.Mutex - lis map[net.Listener]bool - conns map[transport.ServerTransport]bool - m map[string]*service // service name -> service info + opts options + mu sync.Mutex + lis map[net.Listener]bool + conns map[transport.ServerTransport]bool + m map[string]*service // service name -> service info + events trace.EventLog } type options struct { creds credentials.Credentials codec Codec + cp Compressor + dc Decompressor maxConcurrentStreams uint32 } @@ -102,6 +108,18 @@ func CustomCodec(codec Codec) ServerOption { } } +func RPCCompressor(cp Compressor) ServerOption { + return func(o *options) { + o.cp = cp + } +} + +func RPCDecompressor(dc Decompressor) ServerOption { + return func(o *options) { + o.dc = dc + } +} + // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { @@ -128,12 +146,33 @@ func NewServer(opt ...ServerOption) *Server { // Set the default codec. opts.codec = protoCodec{} } - return &Server{ + s := &Server{ lis: make(map[net.Listener]bool), opts: opts, conns: make(map[transport.ServerTransport]bool), m: make(map[string]*service), } + if EnableTracing { + _, file, line, _ := runtime.Caller(1) + s.events = trace.NewEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) + } + return s +} + +// printf records an event in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) printf(format string, a ...interface{}) { + if s.events != nil { + s.events.Printf(format, a...) + } +} + +// errorf records an error in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) errorf(format string, a ...interface{}) { + if s.events != nil { + s.events.Errorf(format, a...) + } } // RegisterService register a service and its implementation to the gRPC @@ -151,6 +190,7 @@ func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) { func (s *Server) register(sd *ServiceDesc, ss interface{}) { s.mu.Lock() defer s.mu.Unlock() + s.printf("RegisterService(%q)", sd.ServiceName) if _, ok := s.m[sd.ServiceName]; ok { grpclog.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) } @@ -182,6 +222,7 @@ var ( // Service returns when lis.Accept fails. func (s *Server) Serve(lis net.Listener) error { s.mu.Lock() + s.printf("serving") if s.lis == nil { s.mu.Unlock() return ErrServerStopped @@ -197,15 +238,23 @@ func (s *Server) Serve(lis net.Listener) error { for { c, err := lis.Accept() if err != nil { + s.mu.Lock() + s.printf("done serving; Accept = %v", err) + s.mu.Unlock() return err } var authInfo credentials.AuthInfo if creds, ok := s.opts.creds.(credentials.TransportAuthenticator); ok { - c, authInfo, err = creds.ServerHandshake(c) + var conn net.Conn + conn, authInfo, err = creds.ServerHandshake(c) if err != nil { + s.mu.Lock() + s.errorf("ServerHandshake(%q) failed: %v", c.RemoteAddr(), err) + s.mu.Unlock() grpclog.Println("grpc: Server.Serve failed to complete security handshake.") continue } + c = conn } s.mu.Lock() if s.conns == nil { @@ -213,29 +262,85 @@ func (s *Server) Serve(lis net.Listener) error { c.Close() return nil } - st, err := transport.NewServerTransport("http2", c, s.opts.maxConcurrentStreams, authInfo) - if err != nil { - s.mu.Unlock() - c.Close() - grpclog.Println("grpc: Server.Serve failed to create ServerTransport: ", err) - continue - } - s.conns[st] = true s.mu.Unlock() - go func() { - st.HandleStreams(func(stream *transport.Stream) { - s.handleStream(st, stream) - }) - s.mu.Lock() - delete(s.conns, st) - s.mu.Unlock() - }() + go s.serveNewHTTP2Transport(c, authInfo) } } -func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, pf payloadFormat, opts *transport.Options) error { - p, err := encode(s.opts.codec, msg, pf) +func (s *Server) serveNewHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) { + st, err := transport.NewServerTransport("http2", c, s.opts.maxConcurrentStreams, authInfo) + if err != nil { + s.mu.Lock() + s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) + s.mu.Unlock() + c.Close() + grpclog.Println("grpc: Server.Serve failed to create ServerTransport: ", err) + return + } + if !s.addConn(st) { + c.Close() + return + } + s.serveStreams(st) +} + +func (s *Server) serveStreams(st transport.ServerTransport) { + defer s.removeConn(st) + defer st.Close() + var wg sync.WaitGroup + st.HandleStreams(func(stream *transport.Stream) { + wg.Add(1) + go func() { + defer wg.Done() + s.handleStream(st, stream, s.traceInfo(st, stream)) + }() + }) + wg.Wait() +} + +// traceInfo returns a traceInfo and associates it with stream, if tracing is enabled. +// If tracing is not enabled, it returns nil. +func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) { + if !EnableTracing { + return nil + } + trInfo = &traceInfo{ + tr: trace.New("grpc.Recv."+methodFamily(stream.Method()), stream.Method()), + } + trInfo.firstLine.client = false + trInfo.firstLine.remoteAddr = st.RemoteAddr() + stream.TraceContext(trInfo.tr) + if dl, ok := stream.Context().Deadline(); ok { + trInfo.firstLine.deadline = dl.Sub(time.Now()) + } + return trInfo +} + +func (s *Server) addConn(st transport.ServerTransport) bool { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns == nil { + return false + } + s.conns[st] = true + return true +} + +func (s *Server) removeConn(st transport.ServerTransport) { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns != nil { + delete(s.conns, st) + } +} + +func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, cp Compressor, opts *transport.Options) error { + var cbuf *bytes.Buffer + if cp != nil { + cbuf = new(bytes.Buffer) + } + p, err := encode(s.opts.codec, msg, cp, cbuf) if err != nil { // This typically indicates a fatal issue (e.g., memory // corruption or hardware faults) the application program @@ -249,17 +354,15 @@ func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Str return t.Write(stream, p, opts) } -func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc) (err error) { - var traceInfo traceInfo - if EnableTracing { - traceInfo.tr = trace.New("grpc.Recv."+methodFamily(stream.Method()), stream.Method()) - defer traceInfo.tr.Finish() - traceInfo.firstLine.client = false - traceInfo.tr.LazyLog(&traceInfo.firstLine, false) +func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { + if trInfo != nil { + defer trInfo.tr.Finish() + trInfo.firstLine.client = false + trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { if err != nil && err != io.EOF { - traceInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - traceInfo.tr.SetError() + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() } }() } @@ -276,82 +379,124 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport. // Nothing to do here. case transport.StreamError: if err := t.WriteStatus(stream, err.Code, err.Desc); err != nil { - grpclog.Printf("grpc: Server.processUnaryRPC failed to write status: %v", err) + grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", err) } default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from recvMsg: %v", err, err)) } return err } - if traceInfo.tr != nil { - traceInfo.tr.LazyLog(&payload{sent: false, msg: req}, true) - } - switch pf { - case compressionNone: - statusCode := codes.OK - statusDesc := "" - reply, appErr := md.Handler(srv.server, stream.Context(), s.opts.codec, req) - if appErr != nil { - if err, ok := appErr.(rpcError); ok { - statusCode = err.code - statusDesc = err.desc - } else { - statusCode = convertCode(appErr) - statusDesc = appErr.Error() + + if err := checkRecvPayload(pf, stream.RecvCompress(), s.opts.dc); err != nil { + switch err := err.(type) { + case transport.StreamError: + if err := t.WriteStatus(stream, err.Code, err.Desc); err != nil { + grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", err) } - if err := t.WriteStatus(stream, statusCode, statusDesc); err != nil { - grpclog.Printf("grpc: Server.processUnaryRPC failed to write status: %v", err) + default: + if err := t.WriteStatus(stream, codes.Internal, err.Error()); err != nil { + grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", err) + } + + } + return err + } + statusCode := codes.OK + statusDesc := "" + df := func(v interface{}) error { + if pf == compressionMade { + var err error + req, err = s.opts.dc.Do(bytes.NewReader(req)) + if err != nil { + if err := t.WriteStatus(stream, codes.Internal, err.Error()); err != nil { + grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", err) + } return err } - return nil } - opts := &transport.Options{ - Last: true, - Delay: false, - } - if err := s.sendResponse(t, stream, reply, compressionNone, opts); err != nil { - switch err := err.(type) { - case transport.ConnectionError: - // Nothing to do here. - case transport.StreamError: - statusCode = err.Code - statusDesc = err.Desc - default: - statusCode = codes.Unknown - statusDesc = err.Error() - } + if err := s.opts.codec.Unmarshal(req, v); err != nil { return err } - if traceInfo.tr != nil { - traceInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) } - return t.WriteStatus(stream, statusCode, statusDesc) - default: - panic(fmt.Sprintf("payload format to be supported: %d", pf)) + return nil } + reply, appErr := md.Handler(srv.server, stream.Context(), df) + if appErr != nil { + if err, ok := appErr.(rpcError); ok { + statusCode = err.code + statusDesc = err.desc + } else { + statusCode = convertCode(appErr) + statusDesc = appErr.Error() + } + if trInfo != nil && statusCode != codes.OK { + trInfo.tr.LazyLog(stringer(statusDesc), true) + trInfo.tr.SetError() + } + if err := t.WriteStatus(stream, statusCode, statusDesc); err != nil { + grpclog.Printf("grpc: Server.processUnaryRPC failed to write status: %v", err) + return err + } + return nil + } + if trInfo != nil { + trInfo.tr.LazyLog(stringer("OK"), false) + } + opts := &transport.Options{ + Last: true, + Delay: false, + } + if s.opts.cp != nil { + stream.SetSendCompress(s.opts.cp.Type()) + } + if err := s.sendResponse(t, stream, reply, s.opts.cp, opts); err != nil { + switch err := err.(type) { + case transport.ConnectionError: + // Nothing to do here. + case transport.StreamError: + statusCode = err.Code + statusDesc = err.Desc + default: + statusCode = codes.Unknown + statusDesc = err.Error() + } + return err + } + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) + } + return t.WriteStatus(stream, statusCode, statusDesc) } } -func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc) (err error) { - ss := &serverStream{ - t: t, - s: stream, - p: &parser{s: stream}, - codec: s.opts.codec, - tracing: EnableTracing, +func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { + if s.opts.cp != nil { + stream.SetSendCompress(s.opts.cp.Type()) } - if ss.tracing { - ss.traceInfo.tr = trace.New("grpc.Recv."+methodFamily(stream.Method()), stream.Method()) - ss.traceInfo.firstLine.client = false - ss.traceInfo.tr.LazyLog(&ss.traceInfo.firstLine, false) + ss := &serverStream{ + t: t, + s: stream, + p: &parser{s: stream}, + codec: s.opts.codec, + cp: s.opts.cp, + dc: s.opts.dc, + trInfo: trInfo, + } + if ss.cp != nil { + ss.cbuf = new(bytes.Buffer) + } + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { ss.mu.Lock() if err != nil && err != io.EOF { - ss.traceInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - ss.traceInfo.tr.SetError() + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() } - ss.traceInfo.tr.Finish() - ss.traceInfo.tr = nil + ss.trInfo.tr.Finish() + ss.trInfo.tr = nil ss.mu.Unlock() }() } @@ -359,48 +504,94 @@ func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transp if err, ok := appErr.(rpcError); ok { ss.statusCode = err.code ss.statusDesc = err.desc + } else if err, ok := appErr.(transport.StreamError); ok { + ss.statusCode = err.Code + ss.statusDesc = err.Desc } else { ss.statusCode = convertCode(appErr) ss.statusDesc = appErr.Error() } } + if trInfo != nil { + ss.mu.Lock() + if ss.statusCode != codes.OK { + ss.trInfo.tr.LazyLog(stringer(ss.statusDesc), true) + ss.trInfo.tr.SetError() + } else { + ss.trInfo.tr.LazyLog(stringer("OK"), false) + } + ss.mu.Unlock() + } return t.WriteStatus(ss.s, ss.statusCode, ss.statusDesc) } -func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream) { +func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream, trInfo *traceInfo) { sm := stream.Method() if sm != "" && sm[0] == '/' { sm = sm[1:] } pos := strings.LastIndex(sm, "/") if pos == -1 { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Malformed method name %q", []interface{}{sm}}, true) + trInfo.tr.SetError() + } if err := t.WriteStatus(stream, codes.InvalidArgument, fmt.Sprintf("malformed method name: %q", stream.Method())); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } + if trInfo != nil { + trInfo.tr.Finish() + } return } service := sm[:pos] method := sm[pos+1:] srv, ok := s.m[service] if !ok { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Unknown service %v", []interface{}{service}}, true) + trInfo.tr.SetError() + } if err := t.WriteStatus(stream, codes.Unimplemented, fmt.Sprintf("unknown service %v", service)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } + if trInfo != nil { + trInfo.tr.Finish() + } return } // Unary RPC or Streaming RPC? if md, ok := srv.md[method]; ok { - s.processUnaryRPC(t, stream, srv, md) + s.processUnaryRPC(t, stream, srv, md, trInfo) return } if sd, ok := srv.sd[method]; ok { - s.processStreamingRPC(t, stream, srv, sd) + s.processStreamingRPC(t, stream, srv, sd, trInfo) return } + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Unknown method %v", []interface{}{method}}, true) + trInfo.tr.SetError() + } if err := t.WriteStatus(stream, codes.Unimplemented, fmt.Sprintf("unknown method %v", method)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } + if trInfo != nil { + trInfo.tr.Finish() + } } // Stop stops the gRPC server. Once Stop returns, the server stops accepting @@ -418,6 +609,12 @@ func (s *Server) Stop() { for c := range cs { c.Close() } + s.mu.Lock() + if s.events != nil { + s.events.Finish() + s.events = nil + } + s.mu.Unlock() } // TestingCloseConns closes all exiting transports but keeps s.lis accepting new diff --git a/Godeps/_workspace/src/google.golang.org/grpc/stream.go b/Godeps/_workspace/src/google.golang.org/grpc/stream.go index 5c99bffc638..4974d8a82ab 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/stream.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/stream.go @@ -34,6 +34,7 @@ package grpc import ( + "bytes" "errors" "io" "sync" @@ -96,35 +97,63 @@ type ClientStream interface { // NewClientStream creates a new Stream for the client side. This is called // by generated code. func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { + var ( + t transport.ClientTransport + err error + ) + t, err = cc.dopts.picker.Pick(ctx) + if err != nil { + return nil, toRPCErr(err) + } // TODO(zhaoq): CallOption is omitted. Add support when it is needed. callHdr := &transport.CallHdr{ Host: cc.authority, Method: method, + Flush: desc.ServerStreams&&desc.ClientStreams, + } + if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() } cs := &clientStream{ desc: desc, codec: cc.dopts.codec, + cp: cc.dopts.cp, + dc: cc.dopts.dc, tracing: EnableTracing, } - if cs.tracing { - cs.traceInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) - cs.traceInfo.firstLine.client = true - if deadline, ok := ctx.Deadline(); ok { - cs.traceInfo.firstLine.deadline = deadline.Sub(time.Now()) - } - cs.traceInfo.tr.LazyLog(&cs.traceInfo.firstLine, false) + if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() + cs.cbuf = new(bytes.Buffer) } - t, _, err := cc.wait(ctx, 0) - if err != nil { - return nil, toRPCErr(err) + if cs.tracing { + cs.trInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) + cs.trInfo.firstLine.client = true + if deadline, ok := ctx.Deadline(); ok { + cs.trInfo.firstLine.deadline = deadline.Sub(time.Now()) + } + cs.trInfo.tr.LazyLog(&cs.trInfo.firstLine, false) + ctx = trace.NewContext(ctx, cs.trInfo.tr) } s, err := t.NewStream(ctx, callHdr) if err != nil { + cs.finish(err) return nil, toRPCErr(err) } cs.t = t cs.s = s cs.p = &parser{s: s} + // Listen on ctx.Done() to detect cancellation when there is no pending + // I/O operations on this stream. + go func() { + select { + case <-t.Error(): + // Incur transport error, simply exit. + case <-s.Context().Done(): + err := s.Context().Err() + cs.finish(err) + cs.closeTransportStream(transport.ContextErr(err)) + } + }() return cs, nil } @@ -135,13 +164,17 @@ type clientStream struct { p *parser desc *StreamDesc codec Codec + cp Compressor + cbuf *bytes.Buffer + dc Decompressor tracing bool // set to EnableTracing when the clientStream is created. - mu sync.Mutex // protects traceInfo - // traceInfo.tr is set when the clientStream is created (if EnableTracing is true), + mu sync.Mutex + closed bool + // trInfo.tr is set when the clientStream is created (if EnableTracing is true), // and is set to nil when the clientStream's finish method is called. - traceInfo traceInfo + trInfo traceInfo } func (cs *clientStream) Context() context.Context { @@ -152,7 +185,7 @@ func (cs *clientStream) Header() (metadata.MD, error) { m, err := cs.s.Header() if err != nil { if _, ok := err.(transport.ConnectionError); !ok { - cs.t.CloseStream(cs.s, err) + cs.closeTransportStream(err) } } return m, err @@ -165,8 +198,8 @@ func (cs *clientStream) Trailer() metadata.MD { func (cs *clientStream) SendMsg(m interface{}) (err error) { if cs.tracing { cs.mu.Lock() - if cs.traceInfo.tr != nil { - cs.traceInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + if cs.trInfo.tr != nil { + cs.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) } cs.mu.Unlock() } @@ -175,11 +208,16 @@ func (cs *clientStream) SendMsg(m interface{}) (err error) { return } if _, ok := err.(transport.ConnectionError); !ok { - cs.t.CloseStream(cs.s, err) + cs.closeTransportStream(err) } err = toRPCErr(err) }() - out, err := encode(cs.codec, m, compressionNone) + out, err := encode(cs.codec, m, cs.cp, cs.cbuf) + defer func() { + if cs.cbuf != nil { + cs.cbuf.Reset() + } + }() if err != nil { return transport.StreamErrorf(codes.Internal, "grpc: %v", err) } @@ -187,7 +225,7 @@ func (cs *clientStream) SendMsg(m interface{}) (err error) { } func (cs *clientStream) RecvMsg(m interface{}) (err error) { - err = recv(cs.p, cs.codec, m) + err = recv(cs.p, cs.codec, cs.s, cs.dc, m) defer func() { // err != nil indicates the termination of the stream. if err != nil { @@ -197,8 +235,8 @@ func (cs *clientStream) RecvMsg(m interface{}) (err error) { if err == nil { if cs.tracing { cs.mu.Lock() - if cs.traceInfo.tr != nil { - cs.traceInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + if cs.trInfo.tr != nil { + cs.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) } cs.mu.Unlock() } @@ -206,8 +244,8 @@ func (cs *clientStream) RecvMsg(m interface{}) (err error) { return } // Special handling for client streaming rpc. - err = recv(cs.p, cs.codec, m) - cs.t.CloseStream(cs.s, err) + err = recv(cs.p, cs.codec, cs.s, cs.dc, m) + cs.closeTransportStream(err) if err == nil { return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) } @@ -220,7 +258,7 @@ func (cs *clientStream) RecvMsg(m interface{}) (err error) { return toRPCErr(err) } if _, ok := err.(transport.ConnectionError); !ok { - cs.t.CloseStream(cs.s, err) + cs.closeTransportStream(err) } if err == io.EOF { if cs.s.StatusCode() == codes.OK { @@ -238,27 +276,38 @@ func (cs *clientStream) CloseSend() (err error) { return } if _, ok := err.(transport.ConnectionError); !ok { - cs.t.CloseStream(cs.s, err) + cs.closeTransportStream(err) } err = toRPCErr(err) return } +func (cs *clientStream) closeTransportStream(err error) { + cs.mu.Lock() + if cs.closed { + cs.mu.Unlock() + return + } + cs.closed = true + cs.mu.Unlock() + cs.t.CloseStream(cs.s, err) +} + func (cs *clientStream) finish(err error) { if !cs.tracing { return } cs.mu.Lock() defer cs.mu.Unlock() - if cs.traceInfo.tr != nil { + if cs.trInfo.tr != nil { if err == nil || err == io.EOF { - cs.traceInfo.tr.LazyPrintf("RPC: [OK]") + cs.trInfo.tr.LazyPrintf("RPC: [OK]") } else { - cs.traceInfo.tr.LazyPrintf("RPC: [%v]", err) - cs.traceInfo.tr.SetError() + cs.trInfo.tr.LazyPrintf("RPC: [%v]", err) + cs.trInfo.tr.SetError() } - cs.traceInfo.tr.Finish() - cs.traceInfo.tr = nil + cs.trInfo.tr.Finish() + cs.trInfo.tr = nil } } @@ -280,15 +329,14 @@ type serverStream struct { s *transport.Stream p *parser codec Codec + cp Compressor + dc Decompressor + cbuf *bytes.Buffer statusCode codes.Code statusDesc string + trInfo *traceInfo - tracing bool // set to EnableTracing when the serverStream is created. - - mu sync.Mutex // protects traceInfo - // traceInfo.tr is set when the serverStream is created (if EnableTracing is true), - // and is set to nil when the serverStream's finish method is called. - traceInfo traceInfo + mu sync.Mutex // protects trInfo.tr after the service handler runs. } func (ss *serverStream) Context() context.Context { @@ -309,19 +357,25 @@ func (ss *serverStream) SetTrailer(md metadata.MD) { func (ss *serverStream) SendMsg(m interface{}) (err error) { defer func() { - if ss.tracing { + if ss.trInfo != nil { ss.mu.Lock() - if err == nil { - ss.traceInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) - } else { - ss.traceInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - ss.traceInfo.tr.SetError() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + } else { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } } - ss.mu.Unlock() } }() - out, err := encode(ss.codec, m, compressionNone) + out, err := encode(ss.codec, m, ss.cp, ss.cbuf) + defer func() { + if ss.cbuf != nil { + ss.cbuf.Reset() + } + }() if err != nil { err = transport.StreamErrorf(codes.Internal, "grpc: %v", err) return err @@ -331,16 +385,18 @@ func (ss *serverStream) SendMsg(m interface{}) (err error) { func (ss *serverStream) RecvMsg(m interface{}) (err error) { defer func() { - if ss.tracing { + if ss.trInfo != nil { ss.mu.Lock() - if err == nil { - ss.traceInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) - } else if err != io.EOF { - ss.traceInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - ss.traceInfo.tr.SetError() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + } else if err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } } ss.mu.Unlock() } }() - return recv(ss.p, ss.codec, m) + return recv(ss.p, ss.codec, ss.s, ss.dc, m) } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go index 5f72c5570e7..14fae12b81a 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go @@ -14,12 +14,18 @@ It has these top-level messages: package codec_perf import proto "github.com/golang/protobuf/proto" +import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 + // Buffer is a message that contains a body of bytes that is used to exercise // encoding and decoding overheads. type Buffer struct { @@ -27,9 +33,10 @@ type Buffer struct { XXX_unrecognized []byte `json:"-"` } -func (m *Buffer) Reset() { *m = Buffer{} } -func (m *Buffer) String() string { return proto.CompactTextString(m) } -func (*Buffer) ProtoMessage() {} +func (m *Buffer) Reset() { *m = Buffer{} } +func (m *Buffer) String() string { return proto.CompactTextString(m) } +func (*Buffer) ProtoMessage() {} +func (*Buffer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *Buffer) GetBody() []byte { if m != nil { @@ -39,4 +46,14 @@ func (m *Buffer) GetBody() []byte { } func init() { + proto.RegisterType((*Buffer)(nil), "codec.perf.Buffer") +} + +var fileDescriptor0 = []byte{ + // 73 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x48, 0x2d, 0x4a, + 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4a, 0xce, 0x4f, 0x49, 0x4d, 0xd6, 0x03, 0x89, + 0x28, 0xc9, 0x70, 0xb1, 0x39, 0x95, 0xa6, 0xa5, 0xa5, 0x16, 0x09, 0x09, 0x71, 0xb1, 0x24, 0xe5, + 0xa7, 0x54, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x3a, 0x58, 0x92, 0x53, 0x36, 0x00, 0x00, 0x00, } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.pb.go b/Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.pb.go index b25e98b8e43..7b0803f5523 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.pb.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.pb.go @@ -22,6 +22,7 @@ It has these top-level messages: package grpc_testing import proto "github.com/golang/protobuf/proto" +import fmt "fmt" import math "math" import ( @@ -29,14 +30,15 @@ import ( grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 + // The type of payload that should be returned. type PayloadType int32 @@ -76,14 +78,16 @@ func (x *PayloadType) UnmarshalJSON(data []byte) error { *x = PayloadType(value) return nil } +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type Empty struct { XXX_unrecognized []byte `json:"-"` } -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } // A block of data, to simply increase gRPC message size. type Payload struct { @@ -94,9 +98,10 @@ type Payload struct { XXX_unrecognized []byte `json:"-"` } -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Payload) GetType() PayloadType { if m != nil && m.Type != nil { @@ -129,9 +134,10 @@ type SimpleRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *SimpleRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -180,9 +186,10 @@ type SimpleResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *SimpleResponse) GetPayload() *Payload { if m != nil { @@ -212,9 +219,10 @@ type StreamingInputCallRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } -func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallRequest) ProtoMessage() {} +func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } +func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallRequest) ProtoMessage() {} +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *StreamingInputCallRequest) GetPayload() *Payload { if m != nil { @@ -230,9 +238,10 @@ type StreamingInputCallResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } -func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallResponse) ProtoMessage() {} +func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } +func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallResponse) ProtoMessage() {} +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { if m != nil && m.AggregatedPayloadSize != nil { @@ -252,9 +261,10 @@ type ResponseParameters struct { XXX_unrecognized []byte `json:"-"` } -func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } -func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } -func (*ResponseParameters) ProtoMessage() {} +func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } +func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } +func (*ResponseParameters) ProtoMessage() {} +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *ResponseParameters) GetSize() int32 { if m != nil && m.Size != nil { @@ -284,9 +294,10 @@ type StreamingOutputCallRequest struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } -func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallRequest) ProtoMessage() {} +func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } +func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallRequest) ProtoMessage() {} +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -316,9 +327,10 @@ type StreamingOutputCallResponse struct { XXX_unrecognized []byte `json:"-"` } -func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } -func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallResponse) ProtoMessage() {} +func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } +func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallResponse) ProtoMessage() {} +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *StreamingOutputCallResponse) GetPayload() *Payload { if m != nil { @@ -328,9 +340,22 @@ func (m *StreamingOutputCallResponse) GetPayload() *Payload { } func init() { + proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") + proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") + proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") + proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") + proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") + proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) } +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + // Client API for TestService service type TestServiceClient interface { @@ -539,9 +564,9 @@ func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { s.RegisterService(&_TestService_serviceDesc, srv) } -func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(Empty) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(TestServiceServer).EmptyCall(ctx, in) @@ -551,9 +576,9 @@ func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, codec return out, nil } -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { in := new(SimpleRequest) - if err := codec.Unmarshal(buf, in); err != nil { + if err := dec(in); err != nil { return nil, err } out, err := srv.(TestServiceServer).UnaryCall(ctx, in) @@ -700,3 +725,43 @@ var _TestService_serviceDesc = grpc.ServiceDesc{ }, }, } + +var fileDescriptor0 = []byte{ + // 567 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x51, 0x6f, 0xd2, 0x50, + 0x14, 0xb6, 0x03, 0x64, 0x1c, 0x58, 0x43, 0x0e, 0x59, 0x64, 0x9d, 0x89, 0x4b, 0x7d, 0xb0, 0x9a, + 0x88, 0x86, 0x44, 0x1f, 0x35, 0x73, 0x63, 0x71, 0x09, 0x03, 0x6c, 0xe1, 0x99, 0x5c, 0xe1, 0x0e, + 0x9b, 0x94, 0xb6, 0xb6, 0xb7, 0x46, 0x7c, 0xf0, 0x8f, 0xf9, 0x67, 0xfc, 0x11, 0xfe, 0x00, 0xef, + 0xbd, 0x6d, 0xa1, 0x40, 0x17, 0x99, 0xc6, 0xbd, 0xb5, 0xdf, 0xf9, 0xce, 0x77, 0xbe, 0xef, 0x9e, + 0xdb, 0x02, 0x30, 0x1a, 0xb2, 0x96, 0x1f, 0x78, 0xcc, 0xc3, 0xda, 0x2c, 0xf0, 0x27, 0x2d, 0x01, + 0xd8, 0xee, 0x4c, 0x2f, 0x43, 0xa9, 0x33, 0xf7, 0xd9, 0x42, 0xef, 0x42, 0x79, 0x40, 0x16, 0x8e, + 0x47, 0xa6, 0xf8, 0x1c, 0x8a, 0x6c, 0xe1, 0xd3, 0xa6, 0x72, 0xa2, 0x18, 0x6a, 0xfb, 0xa8, 0x95, + 0x6d, 0x68, 0x25, 0xa4, 0x21, 0x27, 0x98, 0x92, 0x86, 0x08, 0xc5, 0x8f, 0xde, 0x74, 0xd1, 0xdc, + 0xe3, 0xf4, 0x9a, 0x29, 0x9f, 0xf5, 0x5f, 0x0a, 0x1c, 0x58, 0xf6, 0xdc, 0x77, 0xa8, 0x49, 0x3f, + 0x47, 0xbc, 0x15, 0xdf, 0xc0, 0x41, 0x40, 0x43, 0xdf, 0x73, 0x43, 0x3a, 0xde, 0x4d, 0xbd, 0x96, + 0xf2, 0xc5, 0x1b, 0x3e, 0xce, 0xf4, 0x87, 0xf6, 0x37, 0x2a, 0xc7, 0x95, 0x56, 0x24, 0x8b, 0x63, + 0xf8, 0x02, 0xca, 0x7e, 0xac, 0xd0, 0x2c, 0xf0, 0x72, 0xb5, 0x7d, 0x98, 0x2b, 0x6f, 0xa6, 0x2c, + 0xa1, 0x7a, 0x6d, 0x3b, 0xce, 0x38, 0x0a, 0x69, 0xe0, 0x92, 0x39, 0x6d, 0x16, 0x79, 0xdb, 0xbe, + 0x59, 0x13, 0xe0, 0x28, 0xc1, 0xd0, 0x80, 0xba, 0x24, 0x79, 0x24, 0x62, 0x9f, 0xc6, 0xe1, 0xc4, + 0xe3, 0xee, 0x4b, 0x92, 0xa7, 0x0a, 0xbc, 0x2f, 0x60, 0x4b, 0xa0, 0xfa, 0x77, 0x50, 0xd3, 0xd4, + 0xb1, 0xab, 0xac, 0x23, 0x65, 0x27, 0x47, 0x1a, 0xec, 0x2f, 0xcd, 0x88, 0x88, 0x15, 0x73, 0xf9, + 0x8e, 0x8f, 0xa0, 0x9a, 0xf5, 0x50, 0x90, 0x65, 0xf0, 0x56, 0xf3, 0xbb, 0x70, 0x64, 0xb1, 0x80, + 0x92, 0x39, 0x97, 0xbe, 0x74, 0xfd, 0x88, 0x9d, 0x11, 0xc7, 0x49, 0x37, 0x70, 0x5b, 0x2b, 0xfa, + 0x10, 0xb4, 0x3c, 0xb5, 0x24, 0xd9, 0x6b, 0x78, 0x40, 0x66, 0xb3, 0x80, 0xce, 0x08, 0xa3, 0xd3, + 0x71, 0xd2, 0x13, 0xaf, 0x46, 0x91, 0xab, 0x39, 0x5c, 0x95, 0x13, 0x69, 0xb1, 0x23, 0xfd, 0x12, + 0x30, 0xd5, 0x18, 0x90, 0x80, 0xc7, 0x62, 0x34, 0x08, 0xc5, 0x25, 0xca, 0xb4, 0xca, 0x67, 0x11, + 0xd7, 0x76, 0x79, 0xf5, 0x0b, 0x11, 0x0b, 0x4a, 0x16, 0x0e, 0x29, 0x34, 0x0a, 0xf5, 0x9f, 0x4a, + 0xc6, 0x61, 0x3f, 0x62, 0x1b, 0x81, 0xff, 0xf5, 0xca, 0x7d, 0x80, 0xc6, 0xb2, 0xdf, 0x5f, 0x5a, + 0xe5, 0x3e, 0x0a, 0xfc, 0xf0, 0x4e, 0xd6, 0x55, 0xb6, 0x23, 0x99, 0x18, 0x6c, 0xc7, 0xbc, 0xed, + 0x05, 0xd5, 0x7b, 0x70, 0x9c, 0x9b, 0xf0, 0x2f, 0xaf, 0xd7, 0xb3, 0xb7, 0x50, 0xcd, 0x04, 0xc6, + 0x3a, 0xd4, 0xce, 0xfa, 0x57, 0x03, 0xb3, 0x63, 0x59, 0xa7, 0xef, 0xba, 0x9d, 0xfa, 0x3d, 0xbe, + 0x08, 0x75, 0xd4, 0x5b, 0xc3, 0x14, 0x04, 0xb8, 0x6f, 0x9e, 0xf6, 0xce, 0xfb, 0x57, 0xf5, 0xbd, + 0xf6, 0x8f, 0x22, 0x54, 0x87, 0x5c, 0xdd, 0xe2, 0x4b, 0xb0, 0x27, 0x14, 0x5f, 0x41, 0x45, 0xfe, + 0x40, 0x84, 0x2d, 0x6c, 0xac, 0x4f, 0x97, 0x05, 0x2d, 0x0f, 0xc4, 0x0b, 0xa8, 0x8c, 0x5c, 0x12, + 0xc4, 0x6d, 0xc7, 0xeb, 0x8c, 0xb5, 0x1f, 0x87, 0xf6, 0x30, 0xbf, 0x98, 0x1c, 0x80, 0x03, 0x8d, + 0x9c, 0xf3, 0x41, 0x63, 0xa3, 0xe9, 0xc6, 0x4b, 0xa2, 0x3d, 0xdd, 0x81, 0x19, 0xcf, 0x7a, 0xa9, + 0xa0, 0x0d, 0xb8, 0xfd, 0x45, 0xe0, 0x93, 0x1b, 0x24, 0x36, 0xbf, 0x40, 0xcd, 0xf8, 0x33, 0x31, + 0x1e, 0x65, 0x88, 0x51, 0xea, 0x45, 0xe4, 0x38, 0xe7, 0x11, 0x4f, 0xfb, 0xf5, 0xbf, 0x65, 0x32, + 0x14, 0x99, 0x4a, 0x7d, 0x4f, 0x9c, 0xeb, 0x3b, 0x18, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4c, + 0x41, 0xfe, 0xb6, 0x89, 0x06, 0x00, 0x00, +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/trace.go b/Godeps/_workspace/src/google.golang.org/grpc/trace.go index 246357406ad..cde04fbfc9e 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/trace.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/trace.go @@ -114,3 +114,7 @@ type fmtStringer struct { func (f *fmtStringer) String() string { return fmt.Sprintf(f.format, f.a...) } + +type stringer string + +func (s stringer) String() string { return string(s) } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/transport/control.go b/Godeps/_workspace/src/google.golang.org/grpc/transport/control.go index 464bf10a360..f6b38a5a6d2 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/transport/control.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/transport/control.go @@ -37,7 +37,7 @@ import ( "fmt" "sync" - "github.com/bradfitz/http2" + "golang.org/x/net/http2" ) const ( @@ -86,7 +86,8 @@ func (flushIO) isItem() bool { } type ping struct { - ack bool + ack bool + data [8]byte } func (ping) isItem() bool { diff --git a/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_client.go b/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_client.go index 40b76408217..7cf700fe3e4 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_client.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_client.go @@ -43,13 +43,14 @@ import ( "sync" "time" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" ) // http2Client implements the ClientTransport interface with HTTP2. @@ -209,6 +210,7 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { s := &Stream{ id: t.nextID, method: callHdr.Method, + sendCompress: callHdr.SendCompress, buf: newRecvBuffer(), fc: fc, sendQuotaPool: newQuotaPool(int(t.streamSendQuota)), @@ -238,10 +240,14 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea return nil, ContextErr(context.DeadlineExceeded) } } + pr := &peer.Peer{ + Addr: t.conn.RemoteAddr(), + } // Attach Auth info if there is any. if t.authInfo != nil { - ctx = credentials.NewContext(ctx, t.authInfo) + pr.AuthInfo = t.authInfo } + ctx = peer.NewContext(ctx, pr) authData := make(map[string]string) for _, c := range t.authCreds { // Construct URI required to get auth request metadata. @@ -293,7 +299,18 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea } s := t.newStream(ctx, callHdr) t.activeStreams[s.id] = s + + // This stream is not counted when applySetings(...) initialize t.streamsQuota. + // Reset t.streamsQuota to the right value. + var reset bool + if !checkStreamsQuota && t.streamsQuota != nil { + reset = true + } t.mu.Unlock() + if reset { + t.streamsQuota.reset(-1) + } + // HPACK encodes various headers. Note that once WriteField(...) is // called, the corresponding headers/continuation frame has to be sent // because hpack.Encoder is stateful. @@ -306,6 +323,9 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea t.hEnc.WriteField(hpack.HeaderField{Name: "user-agent", Value: t.userAgent}) t.hEnc.WriteField(hpack.HeaderField{Name: "te", Value: "trailers"}) + if callHdr.SendCompress != "" { + t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) + } if timeout > 0 { t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-timeout", Value: timeoutEncode(timeout)}) } @@ -333,6 +353,10 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea } else { endHeaders = true } + var flush bool + if endHeaders && (hasMD || callHdr.Flush) { + flush = true + } if first { // Sends a HeadersFrame to server to start a new stream. p := http2.HeadersFrameParam{ @@ -344,11 +368,11 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea // Do a force flush for the buffered frames iff it is the last headers frame // and there is header metadata to be sent. Otherwise, there is flushing until // the corresponding data frame is written. - err = t.framer.writeHeaders(hasMD && endHeaders, p) + err = t.framer.writeHeaders(flush, p) first = false } else { // Sends Continuation frames for the leftover headers. - err = t.framer.writeContinuation(hasMD && endHeaders, s.id, endHeaders, t.hBuf.Next(size)) + err = t.framer.writeContinuation(flush, s.id, endHeaders, t.hBuf.Next(size)) } if err != nil { t.notifyError(err) @@ -372,6 +396,11 @@ func (t *http2Client) CloseStream(s *Stream, err error) { if updateStreams { t.streamsQuota.add(1) } + // In case stream sending and receiving are invoked in separate + // goroutines (e.g., bi-directional streaming), the caller needs + // to call cancel on the stream to interrupt the blocking on + // other goroutines. + s.cancel() s.mu.Lock() if q := s.fc.restoreConn(); q > 0 { t.controlBuf.put(&windowUpdate{0, q}) @@ -386,11 +415,6 @@ func (t *http2Client) CloseStream(s *Stream, err error) { } s.state = streamDone s.mu.Unlock() - // In case stream sending and receiving are invoked in separate - // goroutines (e.g., bi-directional streaming), the caller needs - // to call cancel on the stream to interrupt the blocking on - // other goroutines. - s.cancel() if _, ok := err.(StreamError); ok { t.controlBuf.put(&resetStream{s.id, http2.ErrCodeCancel}) } @@ -635,7 +659,9 @@ func (t *http2Client) handleSettings(f *http2.SettingsFrame) { } func (t *http2Client) handlePing(f *http2.PingFrame) { - t.controlBuf.put(&ping{true}) + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) } func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { @@ -676,8 +702,10 @@ func (t *http2Client) operateHeaders(hDec *hpackDecoder, s *Stream, frame header if !endHeaders { return s } - s.mu.Lock() + if !endStream { + s.recvCompress = hDec.state.encoding + } if !s.headerDone { if !endStream && len(hDec.state.mdata) > 0 { s.header = hDec.state.mdata @@ -740,7 +768,7 @@ func (t *http2Client) reader() { endStream := frame.Header().Flags.Has(http2.FlagHeadersEndStream) curStream = t.operateHeaders(hDec, curStream, frame, endStream) case *http2.ContinuationFrame: - curStream = t.operateHeaders(hDec, curStream, frame, false) + curStream = t.operateHeaders(hDec, curStream, frame, frame.HeadersEnded()) case *http2.DataFrame: t.handleData(frame) case *http2.RSTStreamFrame: @@ -816,9 +844,7 @@ func (t *http2Client) controller() { case *flushIO: t.framer.flushWrite() case *ping: - // TODO(zhaoq): Ack with all-0 data now. will change to some - // meaningful content when this is actually in use. - t.framer.writePing(true, i.ack, [8]byte{}) + t.framer.writePing(true, i.ack, i.data) default: grpclog.Printf("transport: http2Client.controller got unexpected item type %v\n", i) } diff --git a/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_server.go b/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_server.go index 8856d7f4c10..cce2e12d914 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_server.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/transport/http2_server.go @@ -42,13 +42,14 @@ import ( "strconv" "sync" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" ) // ErrIllegalHeaderWrite indicates that setting header is illegal because of @@ -138,7 +139,7 @@ func newHTTP2Server(conn net.Conn, maxStreams uint32, authInfo credentials.AuthI // operateHeader takes action on the decoded headers. It returns the current // stream if there are remaining headers on the wire (in the following // Continuation frame). -func (t *http2Server) operateHeaders(hDec *hpackDecoder, s *Stream, frame headerFrame, endStream bool, handle func(*Stream), wg *sync.WaitGroup) (pendingStream *Stream) { +func (t *http2Server) operateHeaders(hDec *hpackDecoder, s *Stream, frame headerFrame, endStream bool, handle func(*Stream)) (pendingStream *Stream) { defer func() { if pendingStream == nil { hDec.state = decodeState{} @@ -163,6 +164,35 @@ func (t *http2Server) operateHeaders(hDec *hpackDecoder, s *Stream, frame header if !endHeaders { return s } + s.recvCompress = hDec.state.encoding + if hDec.state.timeoutSet { + s.ctx, s.cancel = context.WithTimeout(context.TODO(), hDec.state.timeout) + } else { + s.ctx, s.cancel = context.WithCancel(context.TODO()) + } + pr := &peer.Peer{ + Addr: t.conn.RemoteAddr(), + } + // Attach Auth info if there is any. + if t.authInfo != nil { + pr.AuthInfo = t.authInfo + } + s.ctx = peer.NewContext(s.ctx, pr) + // Cache the current stream to the context so that the server application + // can find out. Required when the server wants to send some metadata + // back to the client (unary call only). + s.ctx = newContextWithStream(s.ctx, s) + // Attach the received metadata to the context. + if len(hDec.state.mdata) > 0 { + s.ctx = metadata.NewContext(s.ctx, hDec.state.mdata) + } + + s.dec = &recvBufferReader{ + ctx: s.ctx, + recv: s.buf, + } + s.recvCompress = hDec.state.encoding + s.method = hDec.state.method t.mu.Lock() if t.state != reachable { t.mu.Unlock() @@ -179,35 +209,7 @@ func (t *http2Server) operateHeaders(hDec *hpackDecoder, s *Stream, frame header s.windowHandler = func(n int) { t.updateWindow(s, uint32(n)) } - if hDec.state.timeoutSet { - s.ctx, s.cancel = context.WithTimeout(context.TODO(), hDec.state.timeout) - } else { - s.ctx, s.cancel = context.WithCancel(context.TODO()) - } - // Attach Auth info if there is any. - if t.authInfo != nil { - s.ctx = credentials.NewContext(s.ctx, t.authInfo) - } - // Cache the current stream to the context so that the server application - // can find out. Required when the server wants to send some metadata - // back to the client (unary call only). - s.ctx = newContextWithStream(s.ctx, s) - // Attach the received metadata to the context. - if len(hDec.state.mdata) > 0 { - s.ctx = metadata.NewContext(s.ctx, hDec.state.mdata) - } - - s.dec = &recvBufferReader{ - ctx: s.ctx, - recv: s.buf, - } - s.method = hDec.state.method - - wg.Add(1) - go func() { - handle(s) - wg.Done() - }() + handle(s) return nil } @@ -243,8 +245,6 @@ func (t *http2Server) HandleStreams(handle func(*Stream)) { hDec := newHPACKDecoder() var curStream *Stream - var wg sync.WaitGroup - defer wg.Wait() for { frame, err := t.framer.readFrame() if err != nil { @@ -273,9 +273,9 @@ func (t *http2Server) HandleStreams(handle func(*Stream)) { fc: fc, } endStream := frame.Header().Flags.Has(http2.FlagHeadersEndStream) - curStream = t.operateHeaders(hDec, curStream, frame, endStream, handle, &wg) + curStream = t.operateHeaders(hDec, curStream, frame, endStream, handle) case *http2.ContinuationFrame: - curStream = t.operateHeaders(hDec, curStream, frame, false, handle, &wg) + curStream = t.operateHeaders(hDec, curStream, frame, frame.HeadersEnded(), handle) case *http2.DataFrame: t.handleData(frame) case *http2.RSTStreamFrame: @@ -384,7 +384,9 @@ func (t *http2Server) handleSettings(f *http2.SettingsFrame) { } func (t *http2Server) handlePing(f *http2.PingFrame) { - t.controlBuf.put(&ping{true}) + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) } func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) { @@ -446,6 +448,9 @@ func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { t.hBuf.Reset() t.hEnc.WriteField(hpack.HeaderField{Name: ":status", Value: "200"}) t.hEnc.WriteField(hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + if s.sendCompress != "" { + t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) + } for k, v := range md { for _, entry := range v { t.hEnc.WriteField(hpack.HeaderField{Name: k, Value: entry}) @@ -463,17 +468,24 @@ func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { // TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early // OK is adopted. func (t *http2Server) WriteStatus(s *Stream, statusCode codes.Code, statusDesc string) error { - s.mu.RLock() + var headersSent bool + s.mu.Lock() if s.state == streamDone { - s.mu.RUnlock() + s.mu.Unlock() return nil } - s.mu.RUnlock() + if s.headerOk { + headersSent = true + } + s.mu.Unlock() if _, err := wait(s.ctx, t.shutdownChan, t.writableChan); err != nil { return err } t.hBuf.Reset() - t.hEnc.WriteField(hpack.HeaderField{Name: ":status", Value: "200"}) + if !headersSent { + t.hEnc.WriteField(hpack.HeaderField{Name: ":status", Value: "200"}) + t.hEnc.WriteField(hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + } t.hEnc.WriteField( hpack.HeaderField{ Name: "grpc-status", @@ -513,6 +525,9 @@ func (t *http2Server) Write(s *Stream, data []byte, opts *Options) error { t.hBuf.Reset() t.hEnc.WriteField(hpack.HeaderField{Name: ":status", Value: "200"}) t.hEnc.WriteField(hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + if s.sendCompress != "" { + t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) + } p := http2.HeadersFrameParam{ StreamID: s.id, BlockFragment: t.hBuf.Bytes(), @@ -628,9 +643,7 @@ func (t *http2Server) controller() { case *flushIO: t.framer.flushWrite() case *ping: - // TODO(zhaoq): Ack with all-0 data now. will change to some - // meaningful content when this is actually in use. - t.framer.writePing(true, i.ack, [8]byte{}) + t.framer.writePing(true, i.ack, i.data) default: grpclog.Printf("transport: http2Server.controller got unexpected item type %v\n", i) } @@ -660,9 +673,9 @@ func (t *http2Server) Close() (err error) { t.mu.Unlock() close(t.shutdownChan) err = t.conn.Close() - // Notify all active streams. + // Cancel all active streams. for _, s := range streams { - s.write(recvMsg{err: ErrConnClosing}) + s.cancel() } return } @@ -684,8 +697,11 @@ func (t *http2Server) closeStream(s *Stream) { s.state = streamDone s.mu.Unlock() // In case stream sending and receiving are invoked in separate - // goroutines (e.g., bi-directional streaming), the caller needs - // to call cancel on the stream to interrupt the blocking on - // other goroutines. + // goroutines (e.g., bi-directional streaming), cancel needs to be + // called to interrupt the potential blocking on other goroutines. s.cancel() } + +func (t *http2Server) RemoteAddr() net.Addr { + return t.conn.RemoteAddr() +} diff --git a/Godeps/_workspace/src/google.golang.org/grpc/transport/http_util.go b/Godeps/_workspace/src/google.golang.org/grpc/transport/http_util.go index ac3c47551a1..f9d9fdf0afd 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/transport/http_util.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/transport/http_util.go @@ -43,8 +43,8 @@ import ( "sync/atomic" "time" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" @@ -52,7 +52,7 @@ import ( const ( // The primary user agent - primaryUA = "grpc-go/0.7" + primaryUA = "grpc-go/0.11" // http2MaxFrameLen specifies the max length of a HTTP2 frame. http2MaxFrameLen = 16384 // 16KB frame // http://http2.github.io/http2-spec/#SettingValues @@ -89,6 +89,7 @@ var ( // Records the states during HPACK decoding. Must be reset once the // decoding of the entire headers are finished. type decodeState struct { + encoding string // statusCode caches the stream status received from the trailer // the server sent. Client side only. statusCode codes.Code @@ -140,6 +141,13 @@ func newHPACKDecoder() *hpackDecoder { d := &hpackDecoder{} d.h = hpack.NewDecoder(http2InitHeaderTableSize, func(f hpack.HeaderField) { switch f.Name { + case "content-type": + if !strings.Contains(f.Value, "application/grpc") { + d.err = StreamErrorf(codes.FailedPrecondition, "transport: received the unexpected header") + return + } + case "grpc-encoding": + d.state.encoding = f.Value case "grpc-status": code, err := strconv.Atoi(f.Value) if err != nil { diff --git a/Godeps/_workspace/src/google.golang.org/grpc/transport/transport.go b/Godeps/_workspace/src/google.golang.org/grpc/transport/transport.go index e20a6d99232..d99233d2ea2 100644 --- a/Godeps/_workspace/src/google.golang.org/grpc/transport/transport.go +++ b/Godeps/_workspace/src/google.golang.org/grpc/transport/transport.go @@ -47,6 +47,7 @@ import ( "time" "golang.org/x/net/context" + "golang.org/x/net/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" @@ -169,11 +170,13 @@ type Stream struct { ctx context.Context cancel context.CancelFunc // method records the associated RPC method of the stream. - method string - buf *recvBuffer - dec io.Reader - fc *inFlow - recvQuota uint32 + method string + recvCompress string + sendCompress string + buf *recvBuffer + dec io.Reader + fc *inFlow + recvQuota uint32 // The accumulated inbound quota pending for window update. updateQuota uint32 // The handler to control the window update procedure for both this @@ -200,6 +203,17 @@ type Stream struct { statusDesc string } +// RecvCompress returns the compression algorithm applied to the inbound +// message. It is empty string if there is no compression applied. +func (s *Stream) RecvCompress() string { + return s.recvCompress +} + +// SetSendCompress sets the compression algorithm to the stream. +func (s *Stream) SetSendCompress(str string) { + s.sendCompress = str +} + // Header acquires the key-value pairs of header metadata once it // is available. It blocks until i) the metadata is ready or ii) there is no // header metadata or iii) the stream is cancelled/expired. @@ -232,6 +246,11 @@ func (s *Stream) Context() context.Context { return s.ctx } +// TraceContext recreates the context of s with a trace.Trace. +func (s *Stream) TraceContext(tr trace.Trace) { + s.ctx = trace.NewContext(s.ctx, tr) +} + // Method returns the method for the stream. func (s *Stream) Method() string { return s.method @@ -342,8 +361,18 @@ type Options struct { // CallHdr carries the information of a particular RPC. type CallHdr struct { - Host string // peer host - Method string // the operation to perform on the specified host + // Host specifies peer host. + Host string + // Method specifies the operation to perform. + Method string + // RecvCompress specifies the compression algorithm applied on inbound messages. + RecvCompress string + // SendCompress specifies the compression algorithm applied on outbound message. + SendCompress string + // Flush indicates if new stream command should be sent to the peer without + // waiting for the first data. This is a hint though. The transport may modify + // the flush decision for performance purpose. + Flush bool } // ClientTransport is the common interface for all gRPC client side transport @@ -390,6 +419,8 @@ type ServerTransport interface { // should not be accessed any more. All the pending streams and their // handlers will be terminated asynchronously. Close() error + // RemoteAddr returns the remote network address. + RemoteAddr() net.Addr } // StreamErrorf creates an StreamError with the specified error code and description. diff --git a/Makefile b/Makefile index 361dc157155..e1ec649eb07 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# 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. + # Old-skool build tools. # # Targets (see each target for more information): diff --git a/api/swagger-spec/resourceListing.json b/api/swagger-spec/resourceListing.json index 2e802cfa360..cb3854c2b03 100644 --- a/api/swagger-spec/resourceListing.json +++ b/api/swagger-spec/resourceListing.json @@ -1,6 +1,10 @@ { "swaggerVersion": "1.2", "apis": [ + { + "path": "/apis", + "description": "get available API versions" + }, { "path": "/version", "description": "git code version from which this is built" @@ -20,10 +24,6 @@ { "path": "/apis/extensions", "description": "get information of a group" - }, - { - "path": "/apis", - "description": "get available API versions" } ], "apiVersion": "", diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index f1baf146938..74d35492741 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -14914,6 +14914,10 @@ "$ref": "v1.FlexVolumeSource", "description": "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." }, + "azureFile": { + "$ref": "v1.AzureFileVolumeSource", + "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod." + }, "accessModes": { "type": "array", "items": { @@ -14935,8 +14939,7 @@ "id": "v1.GCEPersistentDiskVolumeSource", "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist and be formatted before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once. GCE PDs support ownership management and SELinux relabeling.", "required": [ - "pdName", - "fsType" + "pdName" ], "properties": { "pdName": { @@ -14945,7 +14948,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk" + "description": "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#gcepersistentdisk" }, "partition": { "type": "integer", @@ -14962,8 +14965,7 @@ "id": "v1.AWSElasticBlockStoreVolumeSource", "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist and be formatted before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "required": [ - "volumeID", - "fsType" + "volumeID" ], "properties": { "volumeID": { @@ -14972,7 +14974,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore" + "description": "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#awselasticblockstore" }, "partition": { "type": "integer", @@ -15067,7 +15069,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd" + "description": "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": { "type": "string", @@ -15107,8 +15109,7 @@ "required": [ "targetPortal", "iqn", - "lun", - "fsType" + "lun" ], "properties": { "targetPortal": { @@ -15130,7 +15131,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi" + "description": "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#iscsi" }, "readOnly": { "type": "boolean", @@ -15151,7 +15152,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Only ext3 and ext4 are allowed More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" }, "readOnly": { "type": "boolean", @@ -15200,8 +15201,7 @@ "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "required": [ "targetWWNs", - "lun", - "fsType" + "lun" ], "properties": { "targetWWNs": { @@ -15218,7 +15218,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." }, "readOnly": { "type": "boolean", @@ -15252,7 +15252,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script." }, "secretRef": { "$ref": "v1.LocalObjectReference", @@ -15268,6 +15268,28 @@ } } }, + "v1.AzureFileVolumeSource": { + "id": "v1.AzureFileVolumeSource", + "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", + "required": [ + "secretName", + "shareName" + ], + "properties": { + "secretName": { + "type": "string", + "description": "the name of secret that contains Azure Storage Account Name and Key" + }, + "shareName": { + "type": "string", + "description": "Share Name" + }, + "readOnly": { + "type": "boolean", + "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." + } + } + }, "v1.PersistentVolumeStatus": { "id": "v1.PersistentVolumeStatus", "description": "PersistentVolumeStatus is the current status of a persistent volume.", @@ -15498,6 +15520,10 @@ "fc": { "$ref": "v1.FCVolumeSource", "description": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." + }, + "azureFile": { + "$ref": "v1.AzureFileVolumeSource", + "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod." } } }, @@ -15902,11 +15928,36 @@ }, "host": { "type": "string", - "description": "Host name to connect to, defaults to the pod IP." + "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead." }, "scheme": { "type": "string", "description": "Scheme to use for connecting to the host. Defaults to HTTP." + }, + "httpHeaders": { + "type": "array", + "items": { + "$ref": "v1.HTTPHeader" + }, + "description": "Custom headers to set in the request. HTTP allows repeated headers." + } + } + }, + "v1.HTTPHeader": { + "id": "v1.HTTPHeader", + "description": "HTTPHeader describes a custom header to be used in HTTP probes", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The header field name" + }, + "value": { + "type": "string", + "description": "The header field value" } } }, diff --git a/api/swagger-spec/v1beta1.json b/api/swagger-spec/v1beta1.json index 9c9f4774ab7..abdd094b544 100644 --- a/api/swagger-spec/v1beta1.json +++ b/api/swagger-spec/v1beta1.json @@ -2479,6 +2479,831 @@ } ] }, + { + "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "v1beta1.ReplicaSetList", + "method": "GET", + "summary": "list or watch objects of kind ReplicaSet", + "nickname": "listNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSetList" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + }, + { + "type": "v1beta1.ReplicaSet", + "method": "POST", + "summary": "create a ReplicaSet", + "nickname": "createNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "v1beta1.ReplicaSet", + "paramType": "body", + "name": "body", + "description": "", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSet" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + }, + { + "type": "unversioned.Status", + "method": "DELETE", + "summary": "delete collection of ReplicaSet", + "nickname": "deletecollectionNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "unversioned.Status" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "json.WatchEvent", + "method": "GET", + "summary": "watch individual changes to a list of ReplicaSet", + "nickname": "watchNamespacedReplicaSetList", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "json.WatchEvent" + } + ], + "produces": [ + "application/json" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "v1beta1.ReplicaSet", + "method": "GET", + "summary": "read the specified ReplicaSet", + "nickname": "readNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "export", + "description": "Should this value be exported. Export strips fields that a user can not specify.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "exact", + "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSet" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + }, + { + "type": "v1beta1.ReplicaSet", + "method": "PUT", + "summary": "replace the specified ReplicaSet", + "nickname": "replaceNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "v1beta1.ReplicaSet", + "paramType": "body", + "name": "body", + "description": "", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSet" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + }, + { + "type": "v1beta1.ReplicaSet", + "method": "PATCH", + "summary": "partially update the specified ReplicaSet", + "nickname": "patchNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "unversioned.Patch", + "paramType": "body", + "name": "body", + "description": "", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSet" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json" + ] + }, + { + "type": "unversioned.Status", + "method": "DELETE", + "summary": "delete a ReplicaSet", + "nickname": "deleteNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "v1.DeleteOptions", + "paramType": "body", + "name": "body", + "description": "", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "unversioned.Status" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "json.WatchEvent", + "method": "GET", + "summary": "watch changes to an object of kind ReplicaSet", + "nickname": "watchNamespacedReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "json.WatchEvent" + } + ], + "produces": [ + "application/json" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/replicasets", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "v1beta1.ReplicaSetList", + "method": "GET", + "summary": "list or watch objects of kind ReplicaSet", + "nickname": "listReplicaSet", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSetList" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/watch/replicasets", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "json.WatchEvent", + "method": "GET", + "summary": "watch individual changes to a list of ReplicaSet", + "nickname": "watchReplicaSetList", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "labelSelector", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "fieldSelector", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "required": false, + "allowMultiple": false + }, + { + "type": "boolean", + "paramType": "query", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "required": false, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "query", + "name": "resourceVersion", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", + "required": false, + "allowMultiple": false + }, + { + "type": "integer", + "paramType": "query", + "name": "timeoutSeconds", + "description": "Timeout for the list/watch call.", + "required": false, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "json.WatchEvent" + } + ], + "produces": [ + "application/json" + ], + "consumes": [ + "*/*" + ] + } + ] + }, + { + "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "description": "API at /apis/extensions/v1beta1", + "operations": [ + { + "type": "v1beta1.ReplicaSet", + "method": "PUT", + "summary": "replace status of the specified ReplicaSet", + "nickname": "replaceNamespacedReplicaSetStatus", + "parameters": [ + { + "type": "string", + "paramType": "query", + "name": "pretty", + "description": "If 'true', then the output is pretty printed.", + "required": false, + "allowMultiple": false + }, + { + "type": "v1beta1.ReplicaSet", + "paramType": "body", + "name": "body", + "description": "", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "namespace", + "description": "object name and auth scope, such as for teams and projects", + "required": true, + "allowMultiple": false + }, + { + "type": "string", + "paramType": "path", + "name": "name", + "description": "name of the ReplicaSet", + "required": true, + "allowMultiple": false + } + ], + "responseMessages": [ + { + "code": 200, + "message": "OK", + "responseModel": "v1beta1.ReplicaSet" + } + ], + "produces": [ + "application/json", + "application/yaml" + ], + "consumes": [ + "*/*" + ] + } + ] + }, { "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", "description": "API at /apis/extensions/v1beta1", @@ -3074,6 +3899,13 @@ "$ref": "v1beta1.IngressBackend", "description": "A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default." }, + "tls": { + "type": "array", + "items": { + "$ref": "v1beta1.IngressTLS" + }, + "description": "TLS configuration. Currently the Ingress only supports a single TLS port, 443, and assumes TLS termination. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension." + }, "rules": { "type": "array", "items": { @@ -3101,6 +3933,23 @@ } } }, + "v1beta1.IngressTLS": { + "id": "v1beta1.IngressTLS", + "description": "IngressTLS describes the transport layer security associated with an Ingress.", + "properties": { + "hosts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified." + }, + "secretName": { + "type": "string", + "description": "SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing." + } + } + }, "v1beta1.IngressRule": { "id": "v1beta1.IngressRule", "description": "IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.", @@ -3484,6 +4333,10 @@ "fc": { "$ref": "v1.FCVolumeSource", "description": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." + }, + "azureFile": { + "$ref": "v1.AzureFileVolumeSource", + "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod." } } }, @@ -3514,8 +4367,7 @@ "id": "v1.GCEPersistentDiskVolumeSource", "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist and be formatted before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once. GCE PDs support ownership management and SELinux relabeling.", "required": [ - "pdName", - "fsType" + "pdName" ], "properties": { "pdName": { @@ -3524,7 +4376,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk" + "description": "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#gcepersistentdisk" }, "partition": { "type": "integer", @@ -3541,8 +4393,7 @@ "id": "v1.AWSElasticBlockStoreVolumeSource", "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist and be formatted before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "required": [ - "volumeID", - "fsType" + "volumeID" ], "properties": { "volumeID": { @@ -3551,7 +4402,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore" + "description": "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#awselasticblockstore" }, "partition": { "type": "integer", @@ -3623,8 +4474,7 @@ "required": [ "targetPortal", "iqn", - "lun", - "fsType" + "lun" ], "properties": { "targetPortal": { @@ -3646,7 +4496,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi" + "description": "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#iscsi" }, "readOnly": { "type": "boolean", @@ -3718,7 +4568,7 @@ }, "fsType": { "type": "string", - "description": "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd" + "description": "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": { "type": "string", @@ -3765,7 +4615,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script." }, "secretRef": { "$ref": "v1.LocalObjectReference", @@ -3794,7 +4644,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Only ext3 and ext4 are allowed More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" }, "readOnly": { "type": "boolean", @@ -3904,8 +4754,7 @@ "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "required": [ "targetWWNs", - "lun", - "fsType" + "lun" ], "properties": { "targetWWNs": { @@ -3922,7 +4771,7 @@ }, "fsType": { "type": "string", - "description": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"" + "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." }, "readOnly": { "type": "boolean", @@ -3930,6 +4779,28 @@ } } }, + "v1.AzureFileVolumeSource": { + "id": "v1.AzureFileVolumeSource", + "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", + "required": [ + "secretName", + "shareName" + ], + "properties": { + "secretName": { + "type": "string", + "description": "the name of secret that contains Azure Storage Account Name and Key" + }, + "shareName": { + "type": "string", + "description": "Share Name" + }, + "readOnly": { + "type": "boolean", + "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." + } + } + }, "v1.Container": { "id": "v1.Container", "description": "A single application container that you want to run within a pod.", @@ -4239,11 +5110,36 @@ }, "host": { "type": "string", - "description": "Host name to connect to, defaults to the pod IP." + "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead." }, "scheme": { "type": "string", "description": "Scheme to use for connecting to the host. Defaults to HTTP." + }, + "httpHeaders": { + "type": "array", + "items": { + "$ref": "v1.HTTPHeader" + }, + "description": "Custom headers to set in the request. HTTP allows repeated headers." + } + } + }, + "v1.HTTPHeader": { + "id": "v1.HTTPHeader", + "description": "HTTPHeader describes a custom header to be used in HTTP probes", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The header field name" + }, + "value": { + "type": "string", + "description": "The header field value" } } }, @@ -4470,6 +5366,98 @@ } } }, + "v1beta1.ReplicaSetList": { + "id": "v1beta1.ReplicaSetList", + "description": "ReplicaSetList is a collection of ReplicaSets.", + "required": [ + "items" + ], + "properties": { + "kind": { + "type": "string", + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" + }, + "apiVersion": { + "type": "string", + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources" + }, + "metadata": { + "$ref": "unversioned.ListMeta", + "description": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" + }, + "items": { + "type": "array", + "items": { + "$ref": "v1beta1.ReplicaSet" + }, + "description": "List of ReplicaSets. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md" + } + } + }, + "v1beta1.ReplicaSet": { + "id": "v1beta1.ReplicaSet", + "description": "ReplicaSet represents the configuration of a ReplicaSet.", + "properties": { + "kind": { + "type": "string", + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" + }, + "apiVersion": { + "type": "string", + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources" + }, + "metadata": { + "$ref": "v1.ObjectMeta", + "description": "If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata" + }, + "spec": { + "$ref": "v1beta1.ReplicaSetSpec", + "description": "Spec defines the specification of the desired behavior of the ReplicaSet. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status" + }, + "status": { + "$ref": "v1beta1.ReplicaSetStatus", + "description": "Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status" + } + } + }, + "v1beta1.ReplicaSetSpec": { + "id": "v1beta1.ReplicaSetSpec", + "description": "ReplicaSetSpec is the specification of a ReplicaSet.", + "properties": { + "replicas": { + "type": "integer", + "format": "int32", + "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller" + }, + "selector": { + "$ref": "v1beta1.LabelSelector", + "description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors" + }, + "template": { + "$ref": "v1.PodTemplateSpec", + "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#pod-template" + } + } + }, + "v1beta1.ReplicaSetStatus": { + "id": "v1beta1.ReplicaSetStatus", + "description": "ReplicaSetStatus represents the current status of a ReplicaSet.", + "required": [ + "replicas" + ], + "properties": { + "replicas": { + "type": "integer", + "format": "int32", + "description": "Replicas is the most recently oberved number of replicas. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller" + }, + "observedGeneration": { + "type": "integer", + "format": "int64", + "description": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet." + } + } + }, "v1beta1.Scale": { "id": "v1beta1.Scale", "description": "represents a scaling request for a resource.", diff --git a/build/README.md b/build/README.md index cc57ef1af88..586ceabc6cb 100644 --- a/build/README.md +++ b/build/README.md @@ -73,17 +73,19 @@ When building final release tars, they are first staged into `_output/release-st ## Proxy Settings -If you are behind a proxy, you need to edit `build/build-image/Dockerfile` and add proxy settings to execute command in that container correctly. +If you are behind a proxy, you need to export proxy settings for kubernetes build, the following environment variables should be defined. -example: +``` +export KUBE_BUILD_HTTP_PROXY=http://username:password@proxyaddr:proxyport +export KUBE_BUILD_HTTPS_PROXY=http://username:password@proxyaddr:proxyport +``` -`ENV http_proxy http://username:password@proxyaddr:proxyport` +Optionally, you can specify addresses of no proxy for kubernetes build, for example -`ENV https_proxy http://username:password@proxyaddr:proxyport` - -Besides, to avoid integration test touch the proxy while connecting to local etcd service, you need to set - -`ENV no_proxy 127.0.0.1` +``` +export KUBE_BUILD_NO_PROXY=127.0.0.1 +``` +If you are using sudo to make kubernetes build for example make quick-release, you need run `sudo -E make quick-release` to pass the environment variables. ## TODOs diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index 29a8e2d9ccf..4ad4b48520d 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. @@ -20,10 +20,12 @@ FROM KUBE_BUILD_IMAGE_CROSS MAINTAINER Joe Beda -# (set an explicit GOARM of 5 for maximum compatibility) -ENV GOARM 5 ENV GOOS linux ENV GOARCH amd64 +ENV http_proxy KUBE_BUILD_HTTP_PROXY +ENV https_proxy KUBE_BUILD_HTTPS_PROXY +ENV no_proxy KUBE_BUILD_NO_PROXY + # work around 64MB tmpfs size in Docker 1.6 ENV TMPDIR /tmp.k8s @@ -34,8 +36,10 @@ RUN mkdir $TMPDIR && \ # We use rsync to copy some binaries around. It is faster (0.3s vs. 1.1s) on my # machine vs. `install` -RUN rm -rf /var/lib/apt/lists/ -RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y rsync +RUN rm -rf /var/lib/apt/lists/ \ + && apt-get -o Acquire::Check-Valid-Until=false update \ + && apt-get install -y rsync \ + && rm -rf /var/lib/apt/lists/ # Download and symlink etcd. We need this for our integration tests. RUN export ETCD_VERSION=v2.2.1; \ diff --git a/build/build-image/cross/Dockerfile b/build/build-image/cross/Dockerfile index 19368e695bd..e5d70a9c8c9 100644 --- a/build/build-image/cross/Dockerfile +++ b/build/build-image/cross/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. @@ -15,17 +15,20 @@ # This file creates a standard build environment for building cross # platform go binary for the architecture kubernetes cares about. -FROM golang:1.5.3 -# Original MAINTAINER Joe Beda -MAINTAINER Brendan Burns +FROM golang:1.4.2 +MAINTAINER Joe Beda + +ENV GOARM 6 +ENV KUBE_DYNAMIC_CROSSPLATFORMS \ + armel ENV KUBE_CROSSPLATFORMS \ - linux/386 linux/arm \ + linux/386 \ + linux/arm \ darwin/amd64 darwin/386 \ windows/amd64 windows/386 -# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5 -RUN for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done +RUN cd /usr/src/go/src && for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean; done # Install g++, then download and install protoc for generating protobuf output RUN apt-get install -y g++ && apt-get clean && rm -rf /var/lib/apt/lists/* &&\ @@ -40,3 +43,12 @@ RUN apt-get install -y g++ && apt-get clean && rm -rf /var/lib/apt/lists/* &&\ rm -rf protobuf-3.0.0-beta-2 &&\ protoc --version +# Use dynamic cgo linking for architectures other than amd64 for the server platforms +# More info here: https://wiki.debian.org/CrossToolchains +RUN echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/cgocrosscompiling.list \ + && curl -s http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add - \ + && for platform in ${KUBE_DYNAMIC_CROSSPLATFORMS}; do dpkg --add-architecture ${platform}; done \ + && apt-get update \ + && apt-get install -y build-essential \ + && for platform in ${KUBE_DYNAMIC_CROSSPLATFORMS}; do apt-get install -y crossbuild-essential-${platform}; done \ + && apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/build/common.sh b/build/common.sh index b653ea298cd..4ca80ff071e 100755 --- a/build/common.sh +++ b/build/common.sh @@ -48,8 +48,8 @@ readonly KUBE_GCS_DELETE_EXISTING="${KUBE_GCS_DELETE_EXISTING:-n}" # Constants readonly KUBE_BUILD_IMAGE_REPO=kube-build -readonly KUBE_BUILD_GOLANG_VERSION=1.5.3 -readonly KUBE_BUILD_IMAGE_CROSS_TAG="cross-${KUBE_BUILD_GOLANG_VERSION}-1" +readonly KUBE_BUILD_GOLANG_VERSION=1.4.2 +readonly KUBE_BUILD_IMAGE_CROSS_TAG="cross-${KUBE_BUILD_GOLANG_VERSION}-2" readonly KUBE_BUILD_IMAGE_CROSS="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_CROSS_TAG}" # KUBE_BUILD_DATA_CONTAINER_NAME=kube-build-data- @@ -90,17 +90,47 @@ readonly RELEASE_STAGE="${LOCAL_OUTPUT_ROOT}/release-stage" readonly RELEASE_DIR="${LOCAL_OUTPUT_ROOT}/release-tars" readonly GCS_STAGE="${LOCAL_OUTPUT_ROOT}/gcs-stage" -# The set of master binaries that run in Docker (on Linux) +# Get the set of master binaries that run in Docker (on Linux) # Entry format is ",". # Binaries are placed in /usr/local/bin inside the image. -readonly KUBE_DOCKER_WRAPPED_BINARIES=( - kube-apiserver,busybox - kube-controller-manager,busybox - kube-scheduler,busybox - kube-proxy,gcr.io/google_containers/debian-iptables:v1 -) +# +# $1 - server architecture +kube::build::get_docker_wrapped_binaries() { + case $1 in + "amd64") + local targets=( + kube-apiserver,busybox + kube-controller-manager,busybox + kube-scheduler,busybox + kube-proxy,gcr.io/google_containers/debian-iptables:v1 + );; + "arm") # TODO: Use image with iptables installed for kube-proxy for arm, arm64 and ppc64le + local targets=( + kube-apiserver,hypriot/armhf-busybox + kube-controller-manager,hypriot/armhf-busybox + kube-scheduler,hypriot/armhf-busybox + kube-proxy,hypriot/armhf-busybox + );; + "arm64") + local targets=( + kube-apiserver,aarch64/busybox + kube-controller-manager,aarch64/busybox + kube-scheduler,aarch64/busybox + kube-proxy,aarch64/busybox + );; + "ppc64le") + local targets=( + kube-apiserver,ppc64le/busybox + kube-controller-manager,ppc64le/busybox + kube-scheduler,ppc64le/busybox + kube-proxy,ppc64le/busybox + );; + esac -# The set of addons images that should be prepopulated + echo "${targets[@]}" +} + +# The set of addons images that should be prepopulated on linux/amd64 readonly KUBE_ADDON_PATHS=( gcr.io/google_containers/pause:2.0 gcr.io/google_containers/kube-registry-proxy:0.3 @@ -109,7 +139,7 @@ readonly KUBE_ADDON_PATHS=( # --------------------------------------------------------------------------- # Basic setup functions -# Verify that the right utilities and such are installed for building Kube. Set +# Verify that the right utilities and such are installed for building Kube. Set # up some dynamic constants. # # Vars set: @@ -159,7 +189,11 @@ function kube::build::prepare_docker_machine() { kube::log::status "docker-machine was found." docker-machine inspect "${DOCKER_MACHINE_NAME}" >/dev/null || { kube::log::status "Creating a machine to build Kubernetes" - docker-machine create --driver "${DOCKER_MACHINE_DRIVER}" "${DOCKER_MACHINE_NAME}" > /dev/null || { + docker-machine create --driver "${DOCKER_MACHINE_DRIVER}" \ + --engine-env HTTP_PROXY="${KUBE_BUILD_HTTP_PROXY:-}" \ + --engine-env HTTPS_PROXY="${KUBE_BUILD_HTTPS_PROXY:-}" \ + --engine-env NO_PROXY="${KUBE_BUILD_NO_PROXY:-127.0.0.1}" \ + "${DOCKER_MACHINE_NAME}" > /dev/null || { kube::log::error "Something went wrong creating a machine." kube::log::error "Try the following: " kube::log::error "docker-machine create -d ${DOCKER_MACHINE_DRIVER} ${DOCKER_MACHINE_NAME}" @@ -203,6 +237,18 @@ function kube::build::is_osx() { [[ "$(uname)" == "Darwin" ]] } +function kube::build::update_dockerfile() { + if kube::build::is_osx; then + sed_opts=("-i ''") + else + sed_opts=(-i) + fi + sed ${sed_opts[@]} "s/KUBE_BUILD_IMAGE_CROSS/${KUBE_BUILD_IMAGE_CROSS}/" ${build_context_dir}/Dockerfile + sed ${sed_opts[@]} "s#KUBE_BUILD_HTTP_PROXY#${KUBE_BUILD_HTTP_PROXY:-\"\"}#" ${build_context_dir}/Dockerfile + sed ${sed_opts[@]} "s#KUBE_BUILD_HTTPS_PROXY#${KUBE_BUILD_HTTPS_PROXY:-\"\"}#" ${build_context_dir}/Dockerfile + sed ${sed_opts[@]} "s#KUBE_BUILD_NO_PROXY#${KUBE_BUILD_NO_PROXY:-127.0.0.1}#" ${build_context_dir}/Dockerfile +} + function kube::build::ensure_docker_in_path() { if [[ -z "$(which docker)" ]]; then kube::log::error "Can't find 'docker' in PATH, please fix and retry." @@ -472,11 +518,8 @@ function kube::build::build_image() { kube::version::save_version_vars "${build_context_dir}/kube-version-defs" cp build/build-image/Dockerfile ${build_context_dir}/Dockerfile - if kube::build::is_osx; then - sed -i "" "s/KUBE_BUILD_IMAGE_CROSS/${KUBE_BUILD_IMAGE_CROSS}/" ${build_context_dir}/Dockerfile - else - sed -i "s/KUBE_BUILD_IMAGE_CROSS/${KUBE_BUILD_IMAGE_CROSS}/" ${build_context_dir}/Dockerfile - fi + kube::build::update_dockerfile + # We don't want to force-pull this image because it's based on a local image # (see kube::build::build_image_cross), not upstream. kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${build_context_dir}" 'false' @@ -669,7 +712,7 @@ function kube::release::package_tarballs() { kube::util::wait-for-jobs || { kube::log::error "previous tarball phase failed"; return 1; } } -# Package up all of the cross compiled clients. Over time this should grow into +# Package up all of the cross compiled clients. Over time this should grow into # a full SDK function kube::release::package_client_tarballs() { # Find all of the built client binaries @@ -726,7 +769,11 @@ function kube::release::package_server_tarballs() { "${release_stage}/server/bin/" kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}" - kube::release::write_addon_docker_images_for_server "${release_stage}/addons" + + # Only release addon images for linux/amd64. These addon images aren't necessary for other architectures + if [[ ${platform} == "linux/amd64" ]]; then + kube::release::write_addon_docker_images_for_server "${release_stage}/addons" + fi # Include the client binaries here too as they are useful debugging tools. local client_bins=("${KUBE_CLIENT_BINARIES[@]}") @@ -764,15 +811,15 @@ function kube::release::sha1() { # Args: # $1 - binary_dir, the directory to save the tared images to. # $2 - arch, architecture for which we are building docker images. -# Globals: -# KUBE_DOCKER_WRAPPED_BINARIES function kube::release::create_docker_images_for_server() { # Create a sub-shell so that we don't pollute the outer environment ( local binary_dir="$1" local arch="$2" local binary_name - for wrappable in "${KUBE_DOCKER_WRAPPED_BINARIES[@]}"; do + local binaries=($(kube::build::get_docker_wrapped_binaries ${arch})) + + for wrappable in "${binaries[@]}"; do local oldifs=$IFS IFS="," @@ -797,7 +844,14 @@ function kube::release::create_docker_images_for_server() { ln ${binary_dir}/${binary_name} ${docker_build_path}/${binary_name} printf " FROM ${base_image} \n ADD ${binary_name} /usr/local/bin/${binary_name}\n" > ${docker_file_path} - local docker_image_tag=gcr.io/google_containers/$binary_name:$md5_sum + if [[ ${arch} == "amd64" ]]; then + # If we are building a amd64 docker image, preserve the original image name + local docker_image_tag=gcr.io/google_containers/${binary_name}:${md5_sum} + else + # If we are building a docker image for another architecture, append the arch in the image tag + local docker_image_tag=gcr.io/google_containers/${binary_name}-${arch}:${md5_sum} + fi + "${DOCKER[@]}" build -q -t "${docker_image_tag}" ${docker_build_path} >/dev/null "${DOCKER[@]}" save ${docker_image_tag} > ${binary_dir}/${binary_name}.tar echo $md5_sum > ${binary_dir}/${binary_name}.docker_tag @@ -883,27 +937,36 @@ function kube::release::package_salt_tarball() { # such as Ubuntu Trusty. # # There are two sources of manifests files: (1) some manifests in the directory -# cluster/saltbase/salt can be used directly or after minor revision, so we copy -# them from there; (2) otherwise, we will maintain separate copies in -# cluster/gce/kube-manifests. +# cluster/saltbase/salt and cluster/addons can be used directly or after minor +# revision, so we copy them from there; (2) otherwise, we will maintain separate +# copies in cluster/gce//kube-manifests. function kube::release::package_kube_manifests_tarball() { kube::log::status "Building tarball: manifests" local release_stage="${RELEASE_STAGE}/manifests/kubernetes" rm -rf "${release_stage}" - mkdir -p "${release_stage}" + mkdir -p "${release_stage}/trusty" - # Source 1: manifests from cluster/saltbase/salt. - # TODO(andyzheng0831): Add more manifests when supporting master on trusty. + # Source 1: manifests from cluster/saltbase/salt and cluster/addons local salt_dir="${KUBE_ROOT}/cluster/saltbase/salt" cp "${salt_dir}/fluentd-es/fluentd-es.yaml" "${release_stage}/" cp "${salt_dir}/fluentd-gcp/fluentd-gcp.yaml" "${release_stage}/" cp "${salt_dir}/kube-registry-proxy/kube-registry-proxy.yaml" "${release_stage}/" cp "${salt_dir}/kube-proxy/kube-proxy.manifest" "${release_stage}/" + cp "${salt_dir}/etcd/etcd.manifest" "${release_stage}/trusty" + cp "${salt_dir}/kube-scheduler/kube-scheduler.manifest" "${release_stage}/trusty" + cp "${salt_dir}/kube-addons/namespace.yaml" "${release_stage}/trusty" + cp "${salt_dir}/kube-addons/kube-addons.sh" "${release_stage}/trusty" + cp "${salt_dir}/kube-addons/kube-addon-update.sh" "${release_stage}/trusty" + cp -r "${salt_dir}/kube-admission-controls/limit-range" "${release_stage}/trusty" + local objects + objects=$(cd "${KUBE_ROOT}/cluster/addons" && find . \( -name \*.yaml -or -name \*.yaml.in -or -name \*.json \) | grep -v demo) + tar c -C "${KUBE_ROOT}/cluster/addons" ${objects} | tar x -C "${release_stage}/trusty" - # Source 2: manifests from cluster/gce/kube-manifests. - # TODO(andyzheng0831): Enable the following line after finishing issue #16702. - # cp "${KUBE_ROOT}/cluster/gce/kube-manifests/*" "${release_stage}/" + # Source 2: manifests from cluster/gce//kube-manifests. + # TODO(andyzheng0831): Avoid using separate copies for trusty. We should use whatever + # from cluster/saltbase/salt to minimize maintenance cost. + cp "${KUBE_ROOT}/cluster/gce/trusty/kube-manifests/"* "${release_stage}/trusty" cp -r "${KUBE_ROOT}/cluster/gce/coreos/kube-manifests"/* "${release_stage}/" kube::release::clean_cruft @@ -921,7 +984,7 @@ function kube::release::package_test_tarball() { mkdir -p "${release_stage}" local platform - for platform in "${KUBE_CLIENT_PLATFORMS[@]}"; do + for platform in "${KUBE_TEST_PLATFORMS[@]}"; do local test_bins=("${KUBE_TEST_BINARIES[@]}") if [[ "${platform%/*}" == "windows" ]]; then test_bins=("${KUBE_TEST_BINARIES_WIN[@]}") @@ -1094,10 +1157,11 @@ function kube::release::gcs::copy_release_artifacts() { # Stage everything in release directory kube::release::gcs::stage_and_hash "${RELEASE_DIR}"/* . || return 1 - # Having the configure-vm.sh and trusty/node.yaml scripts from the GCE cluster + # Having the configure-vm.sh script and and trusty code from the GCE cluster # deploy hosted with the release is useful for GKE. kube::release::gcs::stage_and_hash "${RELEASE_STAGE}/full/kubernetes/cluster/gce/configure-vm.sh" extra/gce || return 1 kube::release::gcs::stage_and_hash "${RELEASE_STAGE}/full/kubernetes/cluster/gce/trusty/node.yaml" extra/gce || return 1 + kube::release::gcs::stage_and_hash "${RELEASE_STAGE}/full/kubernetes/cluster/gce/trusty/master.yaml" extra/gce || return 1 kube::release::gcs::stage_and_hash "${RELEASE_STAGE}/full/kubernetes/cluster/gce/trusty/configure.sh" extra/gce || return 1 # Upload the "naked" binaries to GCS. This is useful for install scripts that @@ -1472,6 +1536,9 @@ function kube::release::docker::release() { local archs=( "amd64" + "arm" + "arm64" + "ppc64le" ) local docker_push_cmd=("${DOCKER[@]}") @@ -1484,6 +1551,16 @@ function kube::release::docker::release() { local docker_target="${KUBE_DOCKER_REGISTRY}/${binary}-${arch}:${KUBE_DOCKER_IMAGE_TAG}" kube::log::status "Pushing ${binary} to ${docker_target}" "${docker_push_cmd[@]}" push "${docker_target}" + + # If we have a amd64 docker image. Tag it without -amd64 also and push it for compability with earlier versions + if [[ ${arch} == "amd64" ]]; then + local legacy_docker_target="${KUBE_DOCKER_REGISTRY}/${binary}:${KUBE_DOCKER_IMAGE_TAG}" + + "${DOCKER[@]}" tag -f "${docker_target}" "${legacy_docker_target}" 2>/dev/null + + kube::log::status "Pushing ${binary} to ${legacy_docker_target}" + "${docker_push_cmd[@]}" push "${legacy_docker_target}" + fi done done } diff --git a/build/debian-iptables/Dockerfile b/build/debian-iptables/Dockerfile index 9b2048abc19..36cba66ec05 100644 --- a/build/debian-iptables/Dockerfile +++ b/build/debian-iptables/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM debian:jessie # All apt-get's must be in one run command or the diff --git a/build/debian-iptables/Makefile b/build/debian-iptables/Makefile index 3658b0c4bc2..9f50b8776b7 100644 --- a/build/debian-iptables/Makefile +++ b/build/debian-iptables/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: build push IMAGE = debian-iptables diff --git a/build/pause/Dockerfile b/build/pause/Dockerfile index 7463c3e9f5a..30858ee78c8 100644 --- a/build/pause/Dockerfile +++ b/build/pause/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM scratch ADD pause / ENTRYPOINT ["/pause"] diff --git a/build/pause/Makefile b/build/pause/Makefile index df2363d1b1d..c788dcd8c9f 100644 --- a/build/pause/Makefile +++ b/build/pause/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: build push TAG = 2.0 diff --git a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml index b6f0c59c9a1..6136f3afa62 100644 --- a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml @@ -7,26 +7,26 @@ apiVersion: v1 kind: ReplicationController metadata: - name: heapster-v13 + name: heapster-v14 namespace: kube-system labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: k8s-app: heapster - version: v13 + version: v14 template: metadata: labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: containers: - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: heapster resources: # keep request = limit to keep this container in guaranteed class @@ -45,7 +45,7 @@ spec: - name: ssl-certs mountPath: /etc/ssl/certs readOnly: true - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: eventer resources: # keep request = limit to keep this container in guaranteed class diff --git a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml index 19e0b6ab004..a4c75c2d4f1 100644 --- a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml +++ b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -7,26 +7,26 @@ apiVersion: v1 kind: ReplicationController metadata: - name: heapster-v13 + name: heapster-v14 namespace: kube-system labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: k8s-app: heapster - version: v13 + version: v14 template: metadata: labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: containers: - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: heapster resources: # keep request = limit to keep this container in guaranteed class @@ -40,12 +40,13 @@ spec: - /heapster - --source=kubernetes:'' - --sink=influxdb:http://monitoring-influxdb:8086 + - --sink=gcm:?metrics=autoscaling - --metric_resolution=60s volumeMounts: - name: ssl-certs mountPath: /etc/ssl/certs readOnly: true - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: eventer resources: # keep request = limit to keep this container in guaranteed class diff --git a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml index 81eed971baf..3b0bf6754c0 100644 --- a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml @@ -7,26 +7,26 @@ apiVersion: v1 kind: ReplicationController metadata: - name: heapster-v13 + name: heapster-v14 namespace: kube-system labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: k8s-app: heapster - version: v13 + version: v14 template: metadata: labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: containers: - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: heapster resources: # keep request = limit to keep this container in guaranteed class @@ -41,7 +41,7 @@ spec: - --source=kubernetes:'' - --sink=influxdb:http://monitoring-influxdb:8086 - --metric_resolution=60s - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: eventer resources: # keep request = limit to keep this container in guaranteed class diff --git a/cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml b/cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml index b7281ae3e7f..d87f45bda57 100644 --- a/cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml +++ b/cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml @@ -74,4 +74,3 @@ spec: - name: grafana-persistent-storage emptyDir: {} - diff --git a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml index c699a1749f3..c563e284ee9 100644 --- a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml @@ -7,26 +7,26 @@ apiVersion: v1 kind: ReplicationController metadata: - name: heapster-v13 + name: heapster-v14 namespace: kube-system labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: k8s-app: heapster - version: v13 + version: v14 template: metadata: labels: k8s-app: heapster - version: v13 + version: v14 kubernetes.io/cluster-service: "true" spec: containers: - - image: gcr.io/google_containers/heapster:v0.20.0-alpha3 + - image: gcr.io/google_containers/heapster:v0.20.0-alpha5 name: heapster resources: # keep request = limit to keep this container in guaranteed class diff --git a/cluster/addons/dashboard/MAINTAINERS.md b/cluster/addons/dashboard/MAINTAINERS.md new file mode 100644 index 00000000000..3cd983031ba --- /dev/null +++ b/cluster/addons/dashboard/MAINTAINERS.md @@ -0,0 +1,6 @@ +# Maintainers + +Piotr Bryk and committers to the https://github.com/kubernetes/dashboard repository. + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dashboard/MAINTAINERS.md?pixel)]() diff --git a/cluster/addons/dashboard/README.md b/cluster/addons/dashboard/README.md new file mode 100644 index 00000000000..9a798ec39ff --- /dev/null +++ b/cluster/addons/dashboard/README.md @@ -0,0 +1,11 @@ +# Kubernetes Dashboard +============== + +Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. +It allows users to manage applications running in the cluster, troubleshoot them, +as well as manage the cluster itself. + +Learn more at: https://github.com/kubernetes/dashboard + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dashboard/README.md?pixel)]() diff --git a/cluster/addons/dashboard/dashboard-controller.yaml b/cluster/addons/dashboard/dashboard-controller.yaml new file mode 100644 index 00000000000..b05c4c39b4a --- /dev/null +++ b/cluster/addons/dashboard/dashboard-controller.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + # Keep the name in sync with image version and + # gce/coreos/kube-manifests/addons/dashboard counterparts + name: kubernetes-dashboard-v0.1.0 + namespace: kube-system + labels: + k8s-app: kubernetes-dashboard + kubernetes.io/cluster-service: "true" +spec: + replicas: 1 + selector: + k8s-app: kubernetes-dashboard + template: + metadata: + labels: + k8s-app: kubernetes-dashboard + kubernetes.io/cluster-service: "true" + spec: + containers: + - name: kubernetes-dashboard + image: gcr.io/google_containers/kubernetes-dashboard-amd64:v0.1.0 + resources: + # keep request = limit to keep this container in guaranteed class + limits: + cpu: 100m + memory: 50Mi + requests: + cpu: 100m + memory: 50Mi + ports: + - containerPort: 9090 + livenessProbe: + httpGet: + path: / + port: 9090 + initialDelaySeconds: 30 + timeoutSeconds: 30 diff --git a/cluster/addons/kube-ui/kube-ui-svc.yaml b/cluster/addons/dashboard/dashboard-service.yaml similarity index 56% rename from cluster/addons/kube-ui/kube-ui-svc.yaml rename to cluster/addons/dashboard/dashboard-service.yaml index cf960c8bda3..195b503de10 100644 --- a/cluster/addons/kube-ui/kube-ui-svc.yaml +++ b/cluster/addons/dashboard/dashboard-service.yaml @@ -1,15 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: kube-ui + name: kubernetes-dashboard namespace: kube-system labels: - k8s-app: kube-ui + k8s-app: kubernetes-dashboard kubernetes.io/cluster-service: "true" - kubernetes.io/name: "KubeUI" spec: selector: - k8s-app: kube-ui + k8s-app: kubernetes-dashboard ports: - port: 80 - targetPort: 8080 + targetPort: 9090 diff --git a/cluster/addons/dns/kube2sky/Dockerfile b/cluster/addons/dns/kube2sky/Dockerfile index eb1a3b83ebe..bd6dc55b722 100644 --- a/cluster/addons/dns/kube2sky/Dockerfile +++ b/cluster/addons/dns/kube2sky/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM busybox MAINTAINER Tim Hockin ADD kube2sky kube2sky diff --git a/cluster/addons/dns/kube2sky/Makefile b/cluster/addons/dns/kube2sky/Makefile index 3e6f3d97f49..7169d4fea66 100644 --- a/cluster/addons/dns/kube2sky/Makefile +++ b/cluster/addons/dns/kube2sky/Makefile @@ -1,3 +1,17 @@ +# 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. + # Makefile for the Docker image gcr.io/google_containers/kube2sky # MAINTAINER: Tim Hockin # If you update this image please bump the tag value before pushing. diff --git a/cluster/addons/dns/kube2sky/kube2sky.go b/cluster/addons/dns/kube2sky/kube2sky.go index 0c5916787d3..a1537a210b4 100644 --- a/cluster/addons/dns/kube2sky/kube2sky.go +++ b/cluster/addons/dns/kube2sky/kube2sky.go @@ -515,7 +515,7 @@ func watchForServices(kubeClient *kclient.Client, ks *kube2sky) kcache.Store { UpdateFunc: ks.updateService, }, ) - go serviceController.Run(util.NeverStop) + go serviceController.Run(wait.NeverStop) return serviceStore } @@ -533,7 +533,7 @@ func watchEndpoints(kubeClient *kclient.Client, ks *kube2sky) kcache.Store { }, ) - go eController.Run(util.NeverStop) + go eController.Run(wait.NeverStop) return eStore } @@ -551,7 +551,7 @@ func watchPods(kubeClient *kclient.Client, ks *kube2sky) kcache.Store { }, ) - go eController.Run(util.NeverStop) + go eController.Run(wait.NeverStop) return eStore } diff --git a/cluster/addons/dns/skydns/Dockerfile b/cluster/addons/dns/skydns/Dockerfile index 7e0c5b92bc3..b1f045e2891 100644 --- a/cluster/addons/dns/skydns/Dockerfile +++ b/cluster/addons/dns/skydns/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM busybox MAINTAINER Tim Hockin ADD skydns skydns diff --git a/cluster/addons/dns/skydns/Makefile b/cluster/addons/dns/skydns/Makefile index 6e7cb882b4d..16a6563d2e4 100644 --- a/cluster/addons/dns/skydns/Makefile +++ b/cluster/addons/dns/skydns/Makefile @@ -1,3 +1,17 @@ +# 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. + all: skydns skydns: diff --git a/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile b/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile index 1e0c826a229..c7a7c88ddda 100644 --- a/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile +++ b/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + # A Dockerfile for creating an Elasticsearch instance that is designed # to work with Kubernetes logging. Inspired by the Dockerfile # dockerfile/elasticsearch diff --git a/cluster/addons/fluentd-elasticsearch/es-image/Makefile b/cluster/addons/fluentd-elasticsearch/es-image/Makefile index fc10b328acb..2545483e5db 100755 --- a/cluster/addons/fluentd-elasticsearch/es-image/Makefile +++ b/cluster/addons/fluentd-elasticsearch/es-image/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: elasticsearch_logging_discovery build push # The current value of the tag to be used for building and diff --git a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Dockerfile b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Dockerfile index aac23b526cb..cf91f95d6c4 100644 --- a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Dockerfile +++ b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Dockerfile @@ -1,3 +1,17 @@ +# 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 Dockerfile will build an image that is configured # to run Fluentd with an Elasticsearch plug-in and the # provided configuration file. diff --git a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Makefile b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Makefile index f20c9c99e2c..6b818c1f3ee 100644 --- a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Makefile +++ b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/Makefile @@ -1,7 +1,21 @@ +# 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. + .PHONY: build push IMAGE = fluentd-elasticsearch -TAG = 1.13 +TAG = 1.14 build: docker build -t gcr.io/google_containers/$(IMAGE):$(TAG) . diff --git a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf index bbe39854181..1e2013da01d 100644 --- a/cluster/addons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf +++ b/cluster/addons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf @@ -115,65 +115,90 @@ read_from_head true +# Example: +# 2015-12-21 23:17:22,066 [salt.state ][INFO ] Completed state [net.ipv4.ip_forward] at time 23:17:22.066081 type tail - format none + format /^(?
    @@ -675,6 +681,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } +

    tls

    +

    TLS configuration. Currently the Ingress only supports a single TLS port, 443, and assumes TLS termination. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension.

    +

    false

    +

    v1beta1.IngressTLS array

    + + +

    rules

    A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.

    false

    @@ -773,6 +786,61 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } + +
    +

    v1beta1.ReplicaSetList

    +
    +

    ReplicaSetList is a collection of ReplicaSets.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    kind

    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds

    false

    string

    apiVersion

    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources

    false

    string

    metadata

    Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds

    false

    unversioned.ListMeta

    items

    List of ReplicaSets. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md

    true

    v1beta1.ReplicaSet array

    +

    v1.CephFSVolumeSource

    @@ -842,6 +910,47 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } +
    +
    +

    v1.HTTPHeader

    +
    +

    HTTPHeader describes a custom header to be used in HTTP probes

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    name

    The header field name

    true

    string

    value

    The header field value

    true

    string

    +

    v1beta1.HorizontalPodAutoscalerStatus

    @@ -944,8 +1053,8 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs"

    -

    true

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

    +

    false

    string

    @@ -1115,8 +1224,8 @@ Examples:

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk

    -

    true

    +

    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#gcepersistentdisk

    +

    false

    string

    @@ -1456,7 +1565,7 @@ Both these may change in the future. Incoming requests are matched against the h

    host

    -

    Host name to connect to, defaults to the pod IP.

    +

    Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead.

    false

    string

    @@ -1468,6 +1577,13 @@ Both these may change in the future. Incoming requests are matched against the h

    string

    + +

    httpHeaders

    +

    Custom headers to set in the request. HTTP allows repeated headers.

    +

    false

    +

    v1.HTTPHeader array

    + + @@ -2056,6 +2172,95 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
    +
    +

    v1beta1.ReplicaSetStatus

    +
    +

    ReplicaSetStatus represents the current status of a ReplicaSet.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    replicas

    Replicas is the most recently oberved number of replicas. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller

    true

    integer (int32)

    observedGeneration

    ObservedGeneration reflects the generation of the most recently observed ReplicaSet.

    false

    integer (int64)

    + +
    +
    +

    v1beta1.ReplicaSetSpec

    +
    +

    ReplicaSetSpec is the specification of a ReplicaSet.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    replicas

    Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller

    false

    integer (int32)

    selector

    Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors

    false

    v1beta1.LabelSelector

    template

    Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#pod-template

    false

    v1.PodTemplateSpec

    +

    v1beta1.LabelSelector

    @@ -2097,6 +2302,116 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
    +
    +

    v1beta1.ReplicaSet

    +
    +

    ReplicaSet represents the configuration of a ReplicaSet.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    kind

    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds

    false

    string

    apiVersion

    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources

    false

    string

    metadata

    If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object’s metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata

    false

    v1.ObjectMeta

    spec

    Spec defines the specification of the desired behavior of the ReplicaSet. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status

    false

    v1beta1.ReplicaSetSpec

    status

    Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status

    false

    v1beta1.ReplicaSetStatus

    + +
    +
    +

    v1.AzureFileVolumeSource

    +
    +

    AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    secretName

    the name of secret that contains Azure Storage Account Name and Key

    true

    string

    shareName

    Share Name

    true

    string

    readOnly

    Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

    false

    boolean

    false

    +

    v1.HostPathVolumeSource

    @@ -2185,8 +2500,8 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi

    -

    true

    +

    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#iscsi

    +

    false

    string

    @@ -2400,7 +2715,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Only ext3 and ext4 are allowed More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

    false

    string

    @@ -2477,6 +2792,40 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
    +
    +

    v1.FlockerVolumeSource

    +
    +

    Represents a Flocker volume mounted by the Flocker agent. Flocker volumes do not support ownership management or SELinux relabeling.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    datasetName

    Required: the volume name. This is going to be store on metadata → name on the payload for Flocker

    true

    string

    +

    v1.AWSElasticBlockStoreVolumeSource

    @@ -2513,8 +2862,8 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore

    -

    true

    +

    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#awselasticblockstore

    +

    false

    string

    @@ -2576,40 +2925,6 @@ Populated by the system when a graceful deletion is requested. Read-only. More i -
    -
    -

    v1.FlockerVolumeSource

    -
    -

    Represents a Flocker volume mounted by the Flocker agent. Flocker volumes do not support ownership management or SELinux relabeling.

    -
    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    datasetName

    Required: the volume name. This is going to be store on metadata → name on the payload for Flocker

    true

    string

    -

    unversioned.ListMeta

    @@ -3023,7 +3338,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs"

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.

    false

    string

    @@ -3401,6 +3716,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    v1.FCVolumeSource

    + +

    azureFile

    +

    AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

    +

    false

    +

    v1.AzureFileVolumeSource

    + + @@ -4190,6 +4512,47 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
    +
    +

    v1beta1.IngressTLS

    +
    +

    IngressTLS describes the transport layer security associated with an Ingress.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    hosts

    Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.

    false

    string array

    secretName

    SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the "Host" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing.

    false

    string

    +

    v1beta1.SubresourceReference

    @@ -4409,7 +4772,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd

    +

    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

    false

    string

    @@ -4464,7 +4827,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
    diff --git a/docs/api-reference/extensions/v1beta1/operations.html b/docs/api-reference/extensions/v1beta1/operations.html index bdd29bf8894..c7382bf6169 100755 --- a/docs/api-reference/extensions/v1beta1/operations.html +++ b/docs/api-reference/extensions/v1beta1/operations.html @@ -3995,6 +3995,1052 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    +

    list or watch objects of kind ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSetList

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    delete collection of ReplicaSet

    +
    +
    +
    DELETE /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    unversioned.Status

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    create a ReplicaSet

    +
    +
    +
    POST /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1beta1.ReplicaSet

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSet

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    read the specified ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    export

    Should this value be exported. Export strips fields that a user can not specify.

    false

    boolean

    QueryParameter

    exact

    Should the export be exact. Exact export maintains cluster-specific fields like Namespace

    false

    boolean

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSet

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    replace the specified ReplicaSet

    +
    +
    +
    PUT /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1beta1.ReplicaSet

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSet

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    delete a ReplicaSet

    +
    +
    +
    DELETE /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    unversioned.Status

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    partially update the specified ReplicaSet

    +
    +
    +
    PATCH /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    unversioned.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSet

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      application/json-patch+json

      +
    • +
    • +

      application/merge-patch+json

      +
    • +
    • +

      application/strategic-merge-patch+json

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    replace status of the specified ReplicaSet

    +
    +
    +
    PUT /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1beta1.ReplicaSet

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSet

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +

    read scale of the specified Scale

    @@ -4002,7 +5048,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4052,7 +5098,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4077,7 +5123,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4087,7 +5133,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4100,7 +5146,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4118,7 +5164,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4176,7 +5222,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4201,7 +5247,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4211,7 +5257,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4224,7 +5270,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4242,7 +5288,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4300,7 +5346,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4325,7 +5371,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4341,7 +5387,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4354,7 +5400,147 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    + +
    +

    list or watch objects of kind ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/replicasets
    +
    +
    +
    +

    Parameters

    +
    ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    v1beta1.ReplicaSetList

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    • +

      application/yaml

      +
    • +
    +
    +
    +
    +

    Tags

    • @@ -4372,7 +5558,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4446,7 +5632,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4471,7 +5657,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4481,7 +5667,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4491,7 +5677,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4509,7 +5695,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4583,7 +5769,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4608,7 +5794,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4618,7 +5804,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4628,7 +5814,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4646,7 +5832,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4720,7 +5906,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4745,7 +5931,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4755,7 +5941,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4765,7 +5951,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4783,7 +5969,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -4865,7 +6051,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -4890,7 +6076,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -4900,7 +6086,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -4910,7 +6096,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -4928,7 +6114,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -5018,7 +6204,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -5043,7 +6229,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -5053,7 +6239,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -5063,7 +6249,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -5081,7 +6267,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -5163,7 +6349,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -5188,7 +6374,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -5198,7 +6384,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -5208,7 +6394,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -5226,7 +6412,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -5316,7 +6502,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -5341,7 +6527,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -5351,7 +6537,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -5361,7 +6547,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -5379,7 +6565,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -5461,7 +6647,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -5486,7 +6672,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -5496,7 +6682,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -5506,7 +6692,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    • @@ -5524,7 +6710,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Parameters

    +

    Parameters

    @@ -5614,7 +6800,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Responses

    +

    Responses

    @@ -5639,7 +6825,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Consumes

    +

    Consumes

    • @@ -5649,7 +6835,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Produces

    +

    Produces

    • @@ -5659,7 +6845,442 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    -

    Tags

    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    + +
    +

    watch individual changes to a list of ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets
    +
    +
    +
    +

    Parameters

    +
    ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    watch changes to an object of kind ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicaSet

    true

    string

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    +
    +
    +
    +

    Tags

    +
    +
      +
    • +

      apisextensionsv1beta1

      +
    • +
    +
    +
    +
    +
    +

    watch individual changes to a list of ReplicaSet

    +
    +
    +
    GET /apis/extensions/v1beta1/watch/replicasets
    +
    +
    +
    +

    Parameters

    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    A selector to restrict the list of returned objects by their labels. Defaults to everything.

    false

    string

    QueryParameter

    fieldSelector

    A selector to restrict the list of returned objects by their fields. Defaults to everything.

    false

    string

    QueryParameter

    watch

    Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

    false

    boolean

    QueryParameter

    resourceVersion

    When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

    false

    string

    QueryParameter

    timeoutSeconds

    Timeout for the list/watch call.

    false

    integer (int32)

    + +
    +
    +

    Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    + +
    +
    +

    Consumes

    +
    +
      +
    • +

      /

      +
    • +
    +
    +
    +
    +

    Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    +
    +
    +
    +

    Tags

    • @@ -5674,7 +7295,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
    diff --git a/docs/api-reference/v1/definitions.html b/docs/api-reference/v1/definitions.html index 8cf00cdf63c..ee9176ffb8a 100755 --- a/docs/api-reference/v1/definitions.html +++ b/docs/api-reference/v1/definitions.html @@ -1011,8 +1011,8 @@ Examples:

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk

    -

    true

    +

    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#gcepersistentdisk

    +

    false

    string

    @@ -1891,6 +1891,54 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
    +
    +

    v1.AzureFileVolumeSource

    +
    +

    AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    secretName

    the name of secret that contains Azure Storage Account Name and Key

    true

    string

    shareName

    Share Name

    true

    string

    readOnly

    Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

    false

    boolean

    false

    +

    v1.ISCSIVolumeSource

    @@ -1945,8 +1993,8 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi

    -

    true

    +

    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#iscsi

    +

    false

    string

    @@ -2681,7 +2729,7 @@ The resulting set of endpoints can be viewed as:

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs"

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.

    false

    string

    @@ -3235,6 +3283,13 @@ The resulting set of endpoints can be viewed as:

    v1.FCVolumeSource

    + +

    azureFile

    +

    AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

    +

    false

    +

    v1.AzureFileVolumeSource

    + + @@ -3432,6 +3487,89 @@ The resulting set of endpoints can be viewed as:

    v1.Capability

    +
    +
    +

    v1.PodStatus

    +
    +

    PodStatus represents information about the status of a pod. Status may trail the actual state of a system.

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    phase

    Current condition of the pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-phase

    false

    string

    conditions

    Current service state of pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions

    false

    v1.PodCondition array

    message

    A human readable message indicating details about why the pod is in this condition.

    false

    string

    reason

    A brief CamelCase message indicating details about why the pod is in this state. e.g. OutOfDisk

    false

    string

    hostIP

    IP address of the host to which the pod is assigned. Empty if not yet scheduled.

    false

    string

    podIP

    IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.

    false

    string

    startTime

    RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.

    false

    string

    containerStatuses

    The list has one entry per container in the manifest. Each entry is currently the output of docker inspect. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-statuses

    false

    v1.ContainerStatus array

    +

    v1.LimitRange

    @@ -3528,89 +3666,6 @@ The resulting set of endpoints can be viewed as:
    -
    -
    -

    v1.PodStatus

    -
    -

    PodStatus represents information about the status of a pod. Status may trail the actual state of a system.

    -
    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    phase

    Current condition of the pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-phase

    false

    string

    conditions

    Current service state of pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions

    false

    v1.PodCondition array

    message

    A human readable message indicating details about why the pod is in this condition.

    false

    string

    reason

    A brief CamelCase message indicating details about why the pod is in this state. e.g. OutOfDisk

    false

    string

    hostIP

    IP address of the host to which the pod is assigned. Empty if not yet scheduled.

    false

    string

    podIP

    IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.

    false

    string

    startTime

    RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.

    false

    string

    containerStatuses

    The list has one entry per container in the manifest. Each entry is currently the output of docker inspect. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-statuses

    false

    v1.ContainerStatus array

    -

    v1.PodSpec

    @@ -4340,7 +4395,7 @@ The resulting set of endpoints can be viewed as:

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd

    +

    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

    false

    string

    @@ -4520,6 +4575,47 @@ The resulting set of endpoints can be viewed as:
    +
    +
    +

    v1.HTTPHeader

    +
    +

    HTTPHeader describes a custom header to be used in HTTP probes

    +
    + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionRequiredSchemaDefault

    name

    The header field name

    true

    string

    value

    The header field value

    true

    string

    +

    v1.FCVolumeSource

    @@ -4560,8 +4656,8 @@ The resulting set of endpoints can be viewed as:

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs"

    -

    true

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

    +

    false

    string

    @@ -4759,7 +4855,7 @@ The resulting set of endpoints can be viewed as:

    host

    -

    Host name to connect to, defaults to the pod IP.

    +

    Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead.

    false

    string

    @@ -4771,6 +4867,13 @@ The resulting set of endpoints can be viewed as:

    string

    + +

    httpHeaders

    +

    Custom headers to set in the request. HTTP allows repeated headers.

    +

    false

    +

    v1.HTTPHeader array

    + + @@ -5132,6 +5235,13 @@ The resulting set of endpoints can be viewed as:
    +

    azureFile

    +

    AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

    +

    false

    +

    v1.AzureFileVolumeSource

    + + +

    accessModes

    AccessModes contains all ways the volume can be mounted. More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#access-modes

    false

    @@ -5672,7 +5782,7 @@ The resulting set of endpoints can be viewed as:

    fsType

    -

    Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Only ext3 and ext4 are allowed More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

    +

    Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

    false

    string

    @@ -5833,8 +5943,8 @@ The resulting set of endpoints can be viewed as:

    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". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore

    -

    true

    +

    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#awselasticblockstore

    +

    false

    string

    @@ -7268,7 +7378,7 @@ The resulting set of endpoints can be viewed as:
    diff --git a/docs/api.md b/docs/api.md index 91b1bb2d387..a25dc79e0dc 100644 --- a/docs/api.md +++ b/docs/api.md @@ -113,7 +113,7 @@ create their own API groups](design/extending-api.md), and to avoid naming colli ## Enabling resources in the extensions group -Jobs, Ingress and HorizontalPodAutoscalers are enabled by default. +HorizontalPodAutoscalers, Jobs, Ingress and ReplicaSets are enabled by default. Other extensions resources can be enabled by setting runtime-config on apiserver. runtime-config accepts comma separated values. For ex: to enable deployments and disable jobs, set `--runtime-config=extensions/v1beta1/deployments=true,extensions/v1beta1/jobs=false` diff --git a/docs/design/clustering/Dockerfile b/docs/design/clustering/Dockerfile index 3353419d843..60d258c4525 100644 --- a/docs/design/clustering/Dockerfile +++ b/docs/design/clustering/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM debian:jessie RUN apt-get update diff --git a/docs/design/clustering/Makefile b/docs/design/clustering/Makefile index f6aa53ed442..b1743cf49be 100644 --- a/docs/design/clustering/Makefile +++ b/docs/design/clustering/Makefile @@ -1,3 +1,17 @@ +# 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. + FONT := DroidSansMono.ttf PNGS := $(patsubst %.seqdiag,%.png,$(wildcard *.seqdiag)) diff --git a/docs/design/metadata-policy.md b/docs/design/metadata-policy.md new file mode 100644 index 00000000000..1d02fcf4215 --- /dev/null +++ b/docs/design/metadata-policy.md @@ -0,0 +1,160 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# MetadataPolicy and its use in choosing the scheduler in a multi-scheduler system + +## Introduction + +This document describes a new API resource, `MetadataPolicy`, that configures an +admission controller to take one or more actions based on an object's metadata. +Initially the metadata fields that the predicates can examine are labels and annotations, +and the actions are to add one or more labels and/or annotations, or to reject creation/update +of the object. In the future other actions might be supported, such as applying an initializer. + +The first use of `MetadataPolicy` will be to decide which scheduler should schedule a pod +in a [multi-scheduler](../proposals/multiple-schedulers.md) Kubernetes system. In particular, the +policy will add the scheduler name annotation to a pod based on an annotation that +is already on the pod that indicates the QoS of the pod. +(That annotation was presumably set by a simpler admission controller that +uses code, rather than configuration, to map the resource requests and limits of a pod +to QoS, and attaches the corresponding annotation.) + +We anticipate a number of other uses for `MetadataPolicy`, such as defaulting for +labels and annotations, prohibiting/requiring particular labels or annotations, or +choosing a scheduling policy within a scheduler. We do not discuss them in this doc. + + +## API + +```go +// MetadataPolicySpec defines the configuration of the MetadataPolicy API resource. +// Every rule is applied, in an unspecified order, but if the action for any rule +// that matches is to reject the object, then the object is rejected without being mutated. +type MetadataPolicySpec struct { + Rules []MetadataPolicyRule `json:"rules,omitempty"` +} + +// If the PolicyPredicate is met, then the PolicyAction is applied. +// Example rules: +// reject object if label with key X is present (i.e. require X) +// reject object if label with key X is not present (i.e. forbid X) +// add label X=Y if label with key X is not present (i.e. default X) +// add annotation A=B if object has annotation C=D or E=F +type MetadataPolicyRule struct { + PolicyPredicate PolicyPredicate `json:"policyPredicate"` + PolicyAction PolicyAction `json:policyAction"` +} + +// All criteria must be met for the PolicyPredicate to be considered met. +type PolicyPredicate struct { + // Note that Namespace is not listed here because MetadataPolicy is per-Namespace. + LabelSelector *LabelSelector `json:"labelSelector,omitempty"` + AnnotationSelector *LabelSelector `json:"annotationSelector,omitempty"` +} + +// Apply the indicated Labels and/or Annotations (if present), unless Reject is set +// to true, in which case reject the object without mutating it. +type PolicyAction struct { + // If true, the object will be rejected and not mutated. + Reject bool `json:"reject"` + // The labels to add or update, if any. + UpdatedLabels *map[string]string `json:"updatedLabels,omitempty"` + // The annotations to add or update, if any. + UpdatedAnnotations *map[string]string `json:"updatedAnnotations,omitempty"` +} + +// MetadataPolicy describes the MetadataPolicy API resource, which is used for specifying +// policies that should be applied to objects based on the objects' metadata. All MetadataPolicy's +// are applied to all objects in the namespace; the order of evaluation is not guaranteed, +// but if any of the matching policies have an action of rejecting the object, then the object +// will be rejected without being mutated. +type MetadataPolicy struct { + unversioned.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the metadata policy that should be enforced. + // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + Spec MetadataPolicySpec `json:"spec,omitempty"` +} + +// MetadataPolicyList is a list of MetadataPolicy items. +type MetadataPolicyList struct { + unversioned.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds + unversioned.ListMeta `json:"metadata,omitempty"` + + // Items is a list of MetadataPolicy objects. + // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota + Items []MetadataPolicy `json:"items"` +} +``` + +## Implementation plan + +1. Create `MetadataPolicy` API resource +1. Create admission controller that implements policies defined in `MetadataPolicy` +1. Create admission controller that sets annotation +`scheduler.alpha.kubernetes.io/qos: ` +(where `QOS` is one of `Guaranteed, Burstable, BestEffort`) +based on pod's resource request and limit. + +## Future work + +Longer-term we will have QoS be set on create and update by the registry, similar to `Pending` phase today, +instead of having an admission controller (that runs before the one that takes `MetadataPolicy` as input) +do it. + +We plan to eventually move from having an admission controller +set the scheduler name as a pod annotation, to using the initializer concept. In particular, the +scheduler will be an initializer, and the admission controller that decides which scheduler to use +will add the scheduler's name to the list of initializers for the pod (presumably the scheduler +will be the last initializer to run on each pod). +The admission controller would still be configured using the `MetadataPolicy` described here, only the +mechanism the admission controller uses to record its decision of which scheduler to use would change. + +## Related issues + +The main issue for multiple schedulers is #11793. There was also a lot of discussion +in PRs #17197 and #17865. + +We could use the approach described here to choose a scheduling +policy within a single scheduler, as opposed to choosing a scheduler, a desire mentioned in #9920. +Issue #17097 describes a scenario unrelated to scheduler-choosing where `MetadataPolicy` could be used. +Issue #17324 proposes to create a generalized API for matching +"claims" to "service classes"; matching a pod to a scheduler would be one use for such an API. + + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/metadata-policy.md?pixel)]() + diff --git a/docs/devel/README.md b/docs/devel/README.md index 8a01a8d65c7..4128e00179e 100644 --- a/docs/devel/README.md +++ b/docs/devel/README.md @@ -48,6 +48,8 @@ Guide](../admin/README.md). * **Pull Request Process** ([pull-requests.md](pull-requests.md)): When and why pull requests are closed. +* **Kubernetes On-Call Rotations** ([on-call-rotations.md](on-call-rotations.md)): Descriptions of on-call rotations for build and end-user support + * **Faster PR reviews** ([faster_reviews.md](faster_reviews.md)): How to get faster PR reviews. * **Getting Recent Builds** ([getting-builds.md](getting-builds.md)): How to get recent builds including the latest builds that pass CI. @@ -73,6 +75,9 @@ Guide](../admin/README.md). * **Coding Conventions** ([coding-conventions.md](coding-conventions.md)): Coding style advice for contributors. +* **Document Conventions** ([how-to-doc.md](how-to-doc.md)) + Document style advice for contributors. + * **Running a cluster locally** ([running-locally.md](running-locally.md)): A fast and lightweight local cluster deployment for developement. diff --git a/docs/devel/api-conventions.md b/docs/devel/api-conventions.md index c5fda4bb5bd..af02d3dbaf9 100644 --- a/docs/devel/api-conventions.md +++ b/docs/devel/api-conventions.md @@ -53,6 +53,7 @@ using resources with kubectl can be found in [Working with resources](../user-gu - [Lists of named subobjects preferred over maps](#lists-of-named-subobjects-preferred-over-maps) - [Primitive types](#primitive-types) - [Constants](#constants) + - [Unions](#unions) - [Lists and Simple kinds](#lists-and-simple-kinds) - [Differing Representations](#differing-representations) - [Verbs on Resources](#verbs-on-resources) @@ -263,6 +264,15 @@ This rule maintains the invariant that all JSON/YAML keys are fields in API obje Some fields will have a list of allowed values (enumerations). These values will be strings, and they will be in CamelCase, with an initial uppercase letter. Examples: "ClusterFirst", "Pending", "ClientIP". +#### Unions + +Sometimes, at most one of a set of fields can be set. For example, the [volumes] field of a PodSpec has 17 different volume type-specific +fields, such as `nfs` and `iscsi`. All fields in the set should be [Optional](#optional-vs-required). + +Sometimes, when a new type is created, the api designer may anticipate that a union will be needed in the future, even if only one field is +allowed initially. In this case, be sure to make the field [Optional](#optional-vs-required) optional. In the validation, you may +still return an error if the sole field is unset. Do not set a default value for that field. + ### Lists and Simple kinds Every list or simple kind SHOULD have the following metadata in a nested object field called "metadata": diff --git a/docs/devel/api_changes.md b/docs/devel/api_changes.md index 2fe8a5af8cd..0c039aab187 100644 --- a/docs/devel/api_changes.md +++ b/docs/devel/api_changes.md @@ -32,6 +32,38 @@ Documentation for other releases can be found at +*This document is oriented at developers who want to change existing APIs. +A set of API conventions, which applies to new APIs and to changes, can be +found at [API Conventions](api-conventions.md). + +**Table of Contents** + + +- [So you want to change the API?](#so-you-want-to-change-the-api) + - [Operational overview](#operational-overview) + - [On compatibility](#on-compatibility) + - [Incompatible API changes](#incompatible-api-changes) + - [Changing versioned APIs](#changing-versioned-apis) + - [Edit types.go](#edit-typesgo) + - [Edit defaults.go](#edit-defaultsgo) + - [Edit conversion.go](#edit-conversiongo) + - [Changing the internal structures](#changing-the-internal-structures) + - [Edit types.go](#edit-typesgo) + - [Edit validation.go](#edit-validationgo) + - [Edit version conversions](#edit-version-conversions) + - [Edit deep copy files](#edit-deep-copy-files) + - [Edit json (un)marshaling code](#edit-json-unmarshaling-code) + - [Making a new API Group](#making-a-new-api-group) + - [Update the fuzzer](#update-the-fuzzer) + - [Update the semantic comparisons](#update-the-semantic-comparisons) + - [Implement your change](#implement-your-change) + - [Write end-to-end tests](#write-end-to-end-tests) + - [Examples and docs](#examples-and-docs) + - [Alpha, Beta, and Stable Versions](#alpha-beta-and-stable-versions) + - [Adding Unstable Features to Stable Versions](#adding-unstable-features-to-stable-versions) + + + # So you want to change the API? Before attempting a change to the API, you should familiarize yourself @@ -273,6 +305,11 @@ enumerated set *can* be a compatible change, if handled properly (treat the removed value as deprecated but allowed). This is actually a special case of a new representation, discussed above. +For [Unions](api-conventions.md), sets of fields where at most one should be set, +it is acceptible to add a new option to the union if the [appropriate conventions] +were followed in the original object. Removing an option requires following +the deprecation process. + ## Incompatible API changes There are times when this might be OK, but mostly we want changes that @@ -549,10 +586,6 @@ hack/update-swagger-spec.sh The API spec changes should be in a commit separate from your other changes. -## Adding new REST objects - -TODO(smarterclayton): write this. - ## Alpha, Beta, and Stable Versions New feature development proceeds through a series of stages of increasing maturity: @@ -617,6 +650,82 @@ New feature development proceeds through a series of stages of increasing maturi - Support: API version will continue to be present for many subsequent software releases; - Recommended Use Cases: any +### Adding Unstable Features to Stable Versions + +When adding a feature to an object which is already Stable, the new fields and new behaviors +need to meet the Stable level requirements. If these cannot be met, then the new +field cannot be added to the object. + +For example, consider the following object: + +```go +// API v6. +type Frobber struct { + Height int `json:"height"` + Param string `json:"param"` +} +``` + +A developer is considering adding a new `Width` parameter, like this: + +```go +// API v6. +type Frobber struct { + Height int `json:"height"` + Width int `json:"height"` + Param string `json:"param"` +} +``` + +However, the new feature is not stable enough to be used in a stable version (`v6`). +Some reasons for this might include: + +- the final representation is undecided (e.g. should it be called `Width` or `Breadth`?) +- the implementation is not stable enough for general use (e.g. the `Area()` routine sometimes overflows.) + +The developer cannot add the new field until stability is met. However, sometimes stability +cannot be met until some users try the new feature, and some users are only able or willing +to accept a released version of Kubernetes. In that case, the developer has a few options, +both of which require staging work over several releases. + + +A preferred option is to first make a release where the new value (`Width` in this example) +is specified via an annotation, like this: + +```go +kind: frobber +version: v6 +metadata: + name: myfrobber + annotations: + frobbing.alpha.kubernetes.io/width: 2 +height: 4 +param: "green and blue" +``` + +This format allows users to specify the new field, but makes it clear +that they are using a Alpha feature when they do, since the word `alpha` +is in the annotation key. + +Another option is to introduce a new type with an new `alpha` or `beta` version +designator, like this: + +``` +// API v6alpha2 +type Frobber struct { + Height int `json:"height"` + Width int `json:"height"` + Param string `json:"param"` +} +``` + +The latter requires that all objects in the same API group as `Frobber` to be replicated in +the new version, `v6alpha2`. This also requires user to use a new client which uses the +other version. Therefore, this is not a preferred option. + +A releated issue is how a cluster manager can roll back from a new version +with a new feature, that is already being used by users. See https://github.com/kubernetes/kubernetes/issues/4855. + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/api_changes.md?pixel)]() diff --git a/docs/devel/e2e-tests.md b/docs/devel/e2e-tests.md index 388e25f08e6..f07f2b59732 100644 --- a/docs/devel/e2e-tests.md +++ b/docs/devel/e2e-tests.md @@ -110,21 +110,59 @@ We are working on implementing clearer partitioning of our e2e tests to make run - `[Slow]`: If a test takes more than five minutes to run (by itself or in parallel with many other tests), it is labeled `[Slow]`. This partition allows us to run almost all of our tests quickly in parallel, without waiting for the stragglers to finish. - `[Serial]`: If a test cannot be run in parallel with other tests (e.g. it takes too many resources or restarts nodes), it is labeled `[Serial]`, and should be run in serial as part of a separate suite. - `[Disruptive]`: If a test restarts components that might cause other tests to fail or break the cluster completely, it is labeled `[Disruptive]`. Any `[Disruptive]` test is also assumed to qualify for the `[Serial]` label, but need not be labeled as both. These tests are not run against soak clusters to avoid restarting components. -- `[Flaky]`: If a test is found to be flaky, it receives the `[Flaky]` label until it is fixed. A `[Flaky]` label should be accompanied with a reference to the issue for de-flaking the test, because while a test remains labeled `[Flaky]`, it is not monitored closely in CI. `[Flaky]` tests are by default not run, unless a `focus` or `skip` argument is explicitly given. +- `[Flaky]`: If a test is found to be flaky and we have decided that it's too hard to fix in the short term (e.g. it's going to take a full engineer-week), it receives the `[Flaky]` label until it is fixed. The `[Flaky]` label should be used very sparingly, and should be accompanied with a reference to the issue for de-flaking the test, because while a test remains labeled `[Flaky]`, it is not monitored closely in CI. `[Flaky]` tests are by default not run, unless a `focus` or `skip` argument is explicitly given. - `[Skipped]`: `[Skipped]` is a legacy label that we're phasing out. If a test is marked `[Skipped]`, there should be an issue open to label it properly. `[Skipped]` tests are by default not run, unless a `focus` or `skip` argument is explicitly given. -- `[Feature:...]`: If a test has non-default requirements to run or targets some non-core functionality, and thus should not be run as part of the standard suite, it receives a `[Feature:...]` label, e.g. `[Feature:Performance]` or `[Feature:Ingress]`. `[Feature:...]` tests are not run in our core suites, instead running in custom suites. There are a few use-cases for `[Feature:...]` tests: - - If a feature is experimental or alpha and is not enabled by default due to being incomplete or potentially subject to breaking changes, it should *not* block the merge-queue, and thus should run in some separate test suites owned by the feature owner(s). - - If a feature is in beta or GA, it *should* block the merge-queue. In moving from experimental to beta or GA, tests that are expected to pass by default should simply remove the `[Feature:...]` label, and will be incorporated into our core suites. If tests are not expected to pass by default, (e.g. they require a special environment such as added quota,) they should remain with the `[Feature:...]` label, and the suites that run them should be incorporated into our merge-queue, owned by the Build Cop. +- `[Feature:.+]`: If a test has non-default requirements to run or targets some non-core functionality, and thus should not be run as part of the standard suite, it receives a `[Feature:.+]` label, e.g. `[Feature:Performance]` or `[Feature:Ingress]`. `[Feature:.+]` tests are not run in our core suites, instead running in custom suites. If a feature is experimental or alpha and is not enabled by default due to being incomplete or potentially subject to breaking changes, it does *not* block the merge-queue, and thus should run in some separate test suites owned by the feature owner(s) (see #continuous_integration below). Finally, `[Conformance]` tests are tests we expect to pass on **any** Kubernetes cluster. The `[Conformance]` label does not supersede any other labels. `[Conformance]` test policies are a work-in-progress; see #18162. -## Adding a New Test +## Continuous Integration + +A quick overview of how we run e2e CI on Kubernetes. + +### What is CI? + +We run a battery of `e2e` tests against `HEAD` of the master branch on a continuous basis, and block merges via the [submit queue](http://submit-queue.k8s.io/) on a subset of those tests if they fail (the subset is defined in the [munger config](https://github.com/kubernetes/contrib/blob/master/mungegithub/mungers/submit-queue.go) via the `jenkins-jobs` flag; note we also block on `kubernetes-build` and `kubernetes-test-go` jobs for build and unit and integration tests). + +CI results can be found at [ci-test.k8s.io](http://ci-test.k8s.io), e.g. [ci-test.k8s.io/kubernetes-e2e-gce/10594](http://ci-test.k8s.io/kubernetes-e2e-gce/10594). + +### What runs in CI? + +We run all default tests (those that aren't marked `[Flaky]` or `[Feature:.+]`) against GCE and GKE. To minimize the time from regression-to-green-run, we partition tests across different jobs: + +- `kubernetes-e2e-` runs all non-`[Slow]`, non-`[Serial]`, non-`[Disruptive]`, non-`[Flaky]`, non-`[Feature:.+]` tests in parallel. +- `kubernetes-e2e--slow` runs all `[Slow]`, non-`[Serial]`, non-`[Disruptive]`, non-`[Flaky]`, non-`[Feature:.+]` tests in parallel. +- `kubernetes-e2e--serial` runs all `[Serial]` and `[Disruptive]`, non-`[Flaky]`, non-`[Feature:.+]` tests in serial. + +We also run non-default tests if the tests exercise general-availability ("GA") features that require a special environment to run in, e.g. `kubernetes-e2e-gce-scalability` and `kubernetes-kubemark-gce`, which test for Kubernetes performance. + +#### Non-default tests + +Many `[Feature:.+]` tests we don't run in CI. These tests are for features that are experimental (often in the `experimental` API), and aren't enabled by default. + +### The PR-builder + +We also run a battery of tests against every PR before we merge it. These tests are equivalent to `kubernetes-gce`: it runs all non-`[Slow]`, non-`[Serial]`, non-`[Disruptive]`, non-`[Flaky]`, non-`[Feature:.+]` tests in parallel. These tests are considered "smoke tests" to give a decent signal that the PR doesn't break most functionality. Results for you PR can be found at [pr-test.k8s.io](http://pr-test.k8s.io), e.g. [pr-test.k8s.io/20354](http://pr-test.k8s.io/20354) for #20354. + +### Adding a test to CI As mentioned above, prior to adding a new test, it is a good idea to perform a `-ginkgo.dryRun=true` on the system, in order to see if a behavior is already being tested, or to determine if it may be possible to augment an existing set of tests for a specific use case. If a behavior does not currently have coverage and a developer wishes to add a new e2e test, navigate to the ./test/e2e directory and create a new test using the existing suite as a guide. -**TODO:** Create a self-documented example which has been disabled, but can be copied to create new tests and outlines the capabilities and libraries used. +TODO(#20357): Create a self-documented example which has been disabled, but can be copied to create new tests and outlines the capabilities and libraries used. + +When writing a test, consult #kinds_of_tests above to determine how your test should be marked, (e.g. `[Slow]`, `[Serial]`; remember, by default we assume a test can run in parallel with other tests!). + +When first adding a test it should *not* go straight into CI, because failures block ordinary development. A test should only be added to CI after is has been running in some non-CI suite long enough to establish a track record showing that the test does not fail when run against *working* software. Note also that tests running in CI are generally running on a well-loaded cluster, so must contend for resources; see above about [kinds of tests](#kinds_of_tests). + +Generally, a feature starts as `experimental`, and will be run in some suite owned by the team developing the feature. If a feature is in beta or GA, it *should* block the merge-queue. In moving from experimental to beta or GA, tests that are expected to pass by default should simply remove the `[Feature:.+]` label, and will be incorporated into our core suites. If tests are not expected to pass by default, (e.g. they require a special environment such as added quota,) they should remain with the `[Feature:.+]` label, and the suites that run them should be incorporated into the [munger config](https://github.com/kubernetes/contrib/blob/master/mungegithub/mungers/submit-queue.go) via the `jenkins-jobs` flag. + +Occasionally, we'll want to add tests to better exercise features that are already GA. These tests also shouldn't go straight to CI. They should begin by being marked as `[Flaky]` to be run outside of CI, and once a track-record for them is established, they may be promoted out of `[Flaky]`. + +### Moving a test out of CI + +If we have determined that a test is known-flaky and cannot be fixed in the short-term, we may move it out of CI indefinitely. This move should be used sparingly, as it effectively means that we have no coverage of that test. When a test if demoted, it should be marked `[Flaky]` with a comment accompanying the label with a reference to an issue opened to fix the test. ## Performance Evaluation diff --git a/docs/devel/kubectl-conventions.md b/docs/devel/kubectl-conventions.md index 126fd71aaf5..ba72d6fb467 100644 --- a/docs/devel/kubectl-conventions.md +++ b/docs/devel/kubectl-conventions.md @@ -45,6 +45,8 @@ Updated: 8/27/2015 - [Flag conventions](#flag-conventions) - [Output conventions](#output-conventions) - [Documentation conventions](#documentation-conventions) + - [Command implementation conventions](#command-implementation-conventions) + - [Generators](#generators) @@ -59,19 +61,15 @@ Updated: 8/27/2015 ## Command conventions * Command names are all lowercase, and hyphenated if multiple words. -* kubectl VERB NOUNs for commands that apply to multiple resource types -* NOUNs may be specified as TYPE name1 name2 ... or TYPE/name1 TYPE/name2; TYPE is omitted when only a single type is expected -* Resource types are all lowercase, with no hyphens; both singular and plural forms are accepted +* kubectl VERB NOUNs for commands that apply to multiple resource types. +* NOUNs may be specified as `TYPE name1 name2` or `TYPE/name1 TYPE/name2` or `TYPE1,TYPE2,TYPE3/name1`; TYPE is omitted when only a single type is expected. +* Resource types are all lowercase, with no hyphens; both singular and plural forms are accepted. * NOUNs may also be specified by one or more file arguments: -f file1 -f file2 ... * Resource types may have 2- or 3-letter aliases. * Business logic should be decoupled from the command framework, so that it can be reused independently of kubectl, cobra, etc. - * Ideally, commonly needed functionality would be implemented server-side in order to avoid problems typical of "fat" clients and to make it readily available to non-Go clients -* Commands that generate resources, such as `run` or `expose`, should obey the following conventions: - * Flags should be converted to a parameter Go map or json map prior to invoking the generator - * The generator must be versioned so that users depending on a specific behavior may pin to that version, via `--generator=` - * Generation should be decoupled from creation - * `--dry-run` should output the resource that would be created, without creating it -* A command group (e.g., `kubectl config`) may be used to group related non-standard commands, such as custom generators, mutations, and computations + * Ideally, commonly needed functionality would be implemented server-side in order to avoid problems typical of "fat" clients and to make it readily available to non-Go clients. +* Commands that generate resources, such as `run` or `expose`, should obey specific conventions, see [generators](#generators). +* A command group (e.g., `kubectl config`) may be used to group related non-standard commands, such as custom generators, mutations, and computations. ## Flag conventions @@ -136,6 +134,124 @@ Updated: 8/27/2015 * Use "TYPE" for the particular flavor of resource type accepted by kubectl, rather than "RESOURCE" or "KIND" * Use "NAME" for resource names +## Command implementation conventions + +For every command there should be a `NewCmd` function that creates the command and returns a pointer to a `cobra.Command`, which can later be added to other parent commands to compose the structure tree. There should also be a `Config` struct with a variable to every flag and argument declared by the command (and any other variable required for the command to run). This makes tests and mocking easier. The struct ideally exposes three methods: + +* `Complete`: Completes the struct fields with values that may or may not be directly provided by the user, for example, by flags pointers, by the `args` slice, by using the Factory, etc. +* `Validate`: performs validation on the struct fields and returns appropriate errors. +* `Run`: runs the actual logic of the command, taking as assumption that the struct is complete with all required values to run, and they are valid. + +Sample command skeleton: + +```go +// MineRecommendedName is the recommended command name for kubectl mine. +const MineRecommendedName = "mine" + +// MineConfig contains all the options for running the mine cli command. +type MineConfig struct { + mineLatest bool +} + +const ( + mineLong = `Some long description +for my command.` + + mineExample = ` # Run my command's first action + $ %[1]s first + + # Run my command's second action on latest stuff + $ %[1]s second --latest` +) + +// NewCmdMine implements the kubectl mine command. +func NewCmdMine(parent, name string, f *cmdutil.Factory, out io.Writer) *cobra.Command { + opts := &MineConfig{} + + cmd := &cobra.Command{ + Use: fmt.Sprintf("%s [--latest]", name), + Short: "Run my command", + Long: mineLong, + Example: fmt.Sprintf(mineExample, parent+" "+name), + Run: func(cmd *cobra.Command, args []string) { + if err := opts.Complete(f, cmd, args, out); err != nil { + cmdutil.CheckErr(err) + } + if err := opts.Validate(); err != nil { + cmdutil.CheckErr(cmdutil.UsageError(cmd, err.Error())) + } + if err := opts.RunMine(); err != nil { + cmdutil.CheckErr(err) + } + }, + } + + cmd.Flags().BoolVar(&options.mineLatest, "latest", false, "Use latest stuff") + return cmd +} + +// Complete completes all the required options for mine. +func (o *MineConfig) Complete(f *cmdutil.Factory, cmd *cobra.Command, args []string, out io.Writer) error { + return nil +} + +// Validate validates all the required options for mine. +func (o MineConfig) Validate() error { + return nil +} + +// RunMine implements all the necessary functionality for mine. +func (o MineConfig) RunMine() error { + return nil +} +``` + +The `Run` method should contain the business logic of the command and as noted in [command conventions](#command-conventions), ideally that logic should exist server-side so any client could take advantage of it. Notice that this is not a mandatory structure and not every command is implemented this way, but this is a nice convention so try to be compliant with it. As an example, have a look at how [kubectl logs](../../pkg/kubectl/cmd/logs.go) is implemented. + +## Generators + +Generators are kubectl commands that generate resources based on a set of inputs (other resources, flags, or a combination of both). + +The point of generators is: +* to enable users using kubectl in a scripted fashion to pin to a particular behavior which may change in the future. Explicit use of a generator will always guarantee that the expected behavior stays the same. +* to enable potential expansion of the generated resources for scenarios other than just creation, similar to how -f is supported for most general-purpose commands. + +Generator commands shoud obey to the following conventions: +* A `--generator` flag should be defined. Users then can choose between different generators, if the command supports them (for example, `kubectl run` currently supports generators for pods, jobs, replication controllers, and deployments), or between different versions of a generator so that users depending on a specific behavior may pin to that version (for example, `kubectl expose` currently supports two different versions of a service generator). +* Generation should be decoupled from creation. A generator should implement the `kubectl.StructuredGenerator` interface and have no dependencies on cobra or the Factory. See, for example, how the first version of the namespace generator is defined: + +```go +// NamespaceGeneratorV1 supports stable generation of a namespace +type NamespaceGeneratorV1 struct { + // Name of namespace + Name string +} + +// Ensure it supports the generator pattern that uses parameters specified during construction +var _ StructuredGenerator = &NamespaceGeneratorV1{} + +// StructuredGenerate outputs a namespace object using the configured fields +func (g *NamespaceGeneratorV1) StructuredGenerate() (runtime.Object, error) { + if err := g.validate(); err != nil { + return nil, err + } + namespace := &api.Namespace{} + namespace.Name = g.Name + return namespace, nil +} + +// validate validates required fields are set to support structured generation +func (g *NamespaceGeneratorV1) validate() error { + if len(g.Name) == 0 { + return fmt.Errorf("name must be specified") + } + return nil +} +``` + +The generator struct (`NamespaceGeneratorV1`) holds the necessary fields for namespace generation. It also satisfies the `kubectl.StructuredGenerator` interface by implementing the `StructuredGenerate() (runtime.Object, error)` method which configures the generated namespace that callers of the generator (`kubectl create namespace` in our case) need to create. +* `--dry-run` should output the resource that would be created, without creating it. + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/kubectl-conventions.md?pixel)]() diff --git a/docs/devel/mesos-style.md b/docs/devel/mesos-style.md index c8d096be14e..c05102642a5 100644 --- a/docs/devel/mesos-style.md +++ b/docs/devel/mesos-style.md @@ -129,7 +129,7 @@ In contrast, in Mesos, API operations go to a particular framework. However, the in the API server rather than in the controller. Of course you can choose to make these operations be no-ops for your application-specific collection abstractions, and handle them in your controller. * On the node level, Mesos allows application-specific executors, whereas Kubernetes only has -executors for Docker and Rocket containers. +executors for Docker and rkt containers. The end-to-end flow is diff --git a/docs/devel/on-call-build-cop.md b/docs/devel/on-call-build-cop.md new file mode 100644 index 00000000000..7530963ec65 --- /dev/null +++ b/docs/devel/on-call-build-cop.md @@ -0,0 +1,105 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + +Kubernetes "Github and Build-cop" Rotation +========================================== + +Preqrequisites +-------------- + +* Ensure you have [write access to http://github.com/kubernetes/kubernetes](https://github.com/orgs/kubernetes/teams/kubernetes-maintainers) + * Test your admin access by e.g. adding a label to an issue. + +Traffic sources and responsibilities +------------------------------------ + +* GitHub [https://github.com/kubernetes/kubernetes/issues](https://github.com/kubernetes/kubernetes/issues) and [https://github.com/kubernetes/kubernetes/pulls](https://github.com/kubernetes/kubernetes/pulls): Your job is to be the first responder to all new issues and PRs. If you are not equipped to do this (which is fine!), it is your job to seek guidance! + * Support issues should be closed and redirected to Stackoverflow (see example response below). + * All incoming issues should be tagged with a team label (team/{api,ux,control-plane,node,cluster,csi,redhat,mesosphere,gke,release-infra,test-infra,none}); for issues that overlap teams, you can use multiple team labels + * There is a related concept of "Github teams" which allow you to @ mention a set of people; feel free to @ mention a Github team if you wish, but this is not a substitute for adding a team/* label, which is required + * [Google teams](https://github.com/orgs/kubernetes/teams?utf8=%E2%9C%93&query=goog-) + * [Redhat teams](https://github.com/orgs/kubernetes/teams?utf8=%E2%9C%93&query=rh-) + * [SIGs](https://github.com/orgs/kubernetes/teams?utf8=%E2%9C%93&query=sig-) + * If the issue is reporting broken builds, broken e2e tests, or other obvious P0 issues, label the issue with priority/P0 and assign it to someone. This is the only situation in which you should add a priority/* label + * non-P0 issues do not need a reviewer assigned initially + * Assign any issues related to Vagrant to @derekwaynecarr (and @mention him in the issue) + * All incoming PRs should be assigned a reviewer. + * unless it is a WIP (Work in Progress), RFC (Request for Comments), or design proposal. + * An auto-assigner [should do this for you] (https://github.com/kubernetes/kubernetes/pull/12365/files) + * When in doubt, choose a TL or team maintainer of the most relevant team; they can delegate + * Keep in mind that you can @ mention people in an issue/PR to bring it to their attention without assigning it to them. You can also @ mention github teams, such as @kubernetes/goog-ux or @kubernetes/kubectl + * If you need help triaging an issue or PR, consult with (or assign it to) @brendandburns, @thockin, @bgrant0607, @quinton-hoole, @davidopp, @dchen1107, @lavalamp (all U.S. Pacific Time) or @fgrzadkowski (Central European Time). + * At the beginning of your shift, please add team/* labels to any issues that have fallen through the cracks and don't have one. Likewise, be fair to the next person in rotation: try to ensure that every issue that gets filed while you are on duty is handled. The Github query to find issues with no team/* label is: [here](https://github.com/kubernetes/kubernetes/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+-label%3Ateam%2Fcontrol-plane+-label%3Ateam%2Fmesosphere+-label%3Ateam%2Fredhat+-label%3Ateam%2Frelease-infra+-label%3Ateam%2Fnone+-label%3Ateam%2Fnode+-label%3Ateam%2Fcluster+-label%3Ateam%2Fux+-label%3Ateam%2Fcsi+-label%3Ateam%2Fapi+-label%3Ateam%2Ftest-infra+). + +Example response for support issues: + + Please re-post your question to [stackoverflow](http://stackoverflow.com/questions/tagged/kubernetes). + + We are trying to consolidate the channels to which questions for help/support are posted so that we can improve our efficiency in responding to your requests, and to make it easier for you to find answers to frequently asked questions and how to address common use cases. + + We regularly see messages posted in multiple forums, with the full response thread only in one place or, worse, spread across multiple forums. Also, the large volume of support issues on github is making it difficult for us to use issues to identify real bugs. + + The Kubernetes team scans stackoverflow on a regular basis, and will try to ensure your questions don't go unanswered. + + Before posting a new question, please search stackoverflow for answers to similar questions, and also familiarize yourself with: + * [the user guide](http://kubernetes.io/v1.0/) + * [the troubleshooting guide](http://kubernetes.io/v1.0/docs/troubleshooting.html) + + Again, thanks for using Kubernetes. + + The Kubernetes Team + +Build-copping +------------- + +* The [merge-bot submit queue](http://submit-queue.k8s.io/) ([source](https://github.com/kubernetes/contrib/tree/master/submit-queue)) should auto-merge all eligible PRs for you once they've passed all the relevant checks mentioned below and all [critical e2e tests] (https://goto.google.com/k8s-test/view/Critical%20Builds/) are passing. If the merge-bot been disabled for some reason, or tests are failing, you might need to do some manual merging to get things back on track. +* Once a day or so, look at the [flaky test builds](https://goto.google.com/k8s-test/view/Flaky/); if they are timing out, clusters are failing to start, or tests are consistently failing (instead of just flaking), file an issue to get things back on track. +* Jobs that are not in [critical e2e tests] (https://goto.google.com/k8s-test/view/Critical%20Builds/) or [flaky test builds](https://goto.google.com/k8s-test/view/Flaky/) are not your responsibility to monitor. The `Test owner:` in the job description will be automatically emailed if the job is failing. +* If you are a weekday oncall, ensure that PRs confirming to the following pre-requisites are being merged at a reasonable rate: + * [Have been LGTMd](https://github.com/kubernetes/kubernetes/labels/lgtm) + * Pass Travis and Shippable. + * Author has signed CLA if applicable. +* If you are a weekend oncall, [never merge PRs manually](collab.md), instead add the label "lgtm" to the PRs once they have been LGTMd and passed Travis and Shippable; this will cause merge-bot to merge them automatically (or make them easy to find by the next oncall, who will merge them). +* When the build is broken, roll back the PRs responsible ASAP +* When E2E tests are unstable, a "merge freeze" may be instituted. During a merge freeze: + * Oncall should slowly merge LGTMd changes throughout the day while monitoring E2E to ensure stability. + * Ideally the E2E run should be green, but some tests are flaky and can fail randomly (not as a result of a particular change). + * If a large number of tests fail, or tests that normally pass fail, that is an indication that one or more of the PR(s) in that build might be problematic (and should be reverted). + * Use the Test Results Analyzer to see individual test history over time. +* Flake mitigation + * Tests that flake (fail a small percentage of the time) need an issue filed against them. Please read [this](https://github.com/kubernetes/kubernetes/blob/doc-flaky-test/docs/devel/flaky-tests.md#filing-issues-for-flaky-tests); the build cop is expected to file issues for any flaky tests they encounter. + * It's reasonable to manually merge PRs that fix a flake or otherwise mitigate it. + +Contact information +------------------- + +[@k8s-oncall](https://github.com/k8s-oncall) will reach the current person on call. + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/on-call-build-cop.md?pixel)]() + diff --git a/docs/devel/on-call-rotations.md b/docs/devel/on-call-rotations.md new file mode 100644 index 00000000000..9544db5102c --- /dev/null +++ b/docs/devel/on-call-rotations.md @@ -0,0 +1,52 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + +Kubernetes On-Call Rotations +==================== + +Kubernetes "first responder" rotations +-------------------------------------- + +Kubernetes has generated a lot of public traffic: email, pull-requests, bugs, etc. So much traffic that it's becoming impossible to keep up with it all! This is a fantastic problem to have. In order to be sure that SOMEONE, but not EVERYONE on the team is paying attention to public traffic, we have instituted two "first responder" rotations, listed below. Please read this page before proceeding to the pages linked below, which are specific to each rotation. + +Please also read our [notes on OSS collaboration](collab.md), particularly the bits about hours. Specifically, each rotation is expected to be active primarily during work hours, less so off hours. + +During regular workday work hours of your shift, your primary responsibility is to monitor the traffic sources specific to your rotation. You can check traffic in the evenings if you feel so inclined, but it is not expected to be as highly focused as work hours. For weekends, you should check traffic very occasionally (e.g. once or twice a day). Again, it is not expected to be as highly focused as workdays. It is assumed that over time, everyone will get weekday and weekend shifts, so the workload will balance out. + +If you can not serve your shift, and you know this ahead of time, it is your responsibility to find someone to cover and to change the rotation. If you have an emergency, your responsibilities fall on the primary of the other rotation, who acts as your secondary. If you need help to cover all of the tasks, partners with oncall rotations (e.g., [Redhat](https://github.com/orgs/kubernetes/teams/rh-oncall)). + +If you are not on duty you DO NOT need to do these things. You are free to focus on "real work". + +Note that Kubernetes will occasionally enter code slush/freeze, prior to milestones. When it does, there might be changes in the instructions (assigning milestones, for instance). + +* [Github and Build Cop Rotation](on-call-build-cop.md) +* [User Support Rotation](on-call-user-support.md) + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/on-call-rotations.md?pixel)]() + diff --git a/docs/devel/on-call-user-support.md b/docs/devel/on-call-user-support.md new file mode 100644 index 00000000000..ceea9c76a18 --- /dev/null +++ b/docs/devel/on-call-user-support.md @@ -0,0 +1,83 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + +Kubernetes "User Support" Rotation +================================== + +Traffic sources and responsibilities +------------------------------------ + +* [StackOverflow](http://stackoverflow.com/questions/tagged/kubernetes) and [ServerFault](http://serverfault.com/questions/tagged/google-kubernetes): Respond to any thread that has no responses and is more than 6 hours old (over time we will lengthen this timeout to allow community responses). If you are not equipped to respond, it is your job to redirect to someone who can. + * [Query for unanswered Kubernetes StackOverflow questions](http://stackoverflow.com/search?q=%5Bkubernetes%5D+answers%3A0) + * [Query for unanswered Kubernetes ServerFault questions](http://serverfault.com/questions/tagged/google-kubernetes?sort=unanswered&pageSize=15) + * Direct poorly formulated questions to [stackoverflow's tips about how to ask](http://stackoverflow.com/help/how-to-ask) + * Direct off-topic questions to [stackoverflow's policy](http://stackoverflow.com/help/on-topic) +* [Slack](https://kubernetes.slack.com) ([registration](http://slack.k8s.io)): Your job is to be on Slack, watching for questions and answering or redirecting as needed. Also check out the [Slack Archive](http://kubernetes.slackarchive.io/). +* [Email/Groups](https://groups.google.com/forum/#!forum/google-containers): Respond to any thread that has no responses and is more than 6 hours old (over time we will lengthen this timeout to allow community responses). If you are not equipped to respond, it is your job to redirect to someone who can. +* [Legacy] [IRC](irc://irc.freenode.net/#google-containers) (irc.freenode.net #google-containers): watch IRC for questions and try to redirect users to Slack. Also check out the [IRC logs](https://botbot.me/freenode/google-containers/). + +In general, try to direct support questions to: + +1. Documentation, such as the [user guide](../user-guide/README.md) and [troubleshooting guide](../troubleshooting.md) +2. Stackoverflow + +If you see questions on a forum other than Stackoverflow, try to redirect them to Stackoverflow. Example response: + + Please re-post your question to [stackoverflow](http://stackoverflow.com/questions/tagged/kubernetes). + + We are trying to consolidate the channels to which questions for help/support are posted so that we can improve our efficiency in responding to your requests, and to make it easier for you to find answers to frequently asked questions and how to address common use cases. + + We regularly see messages posted in multiple forums, with the full response thread only in one place or, worse, spread across multiple forums. Also, the large volume of support issues on github is making it difficult for us to use issues to identify real bugs. + + The Kubernetes team scans stackoverflow on a regular basis, and will try to ensure your questions don't go unanswered. + + Before posting a new question, please search stackoverflow for answers to similar questions, and also familiarize yourself with: + * [the user guide](http://kubernetes.io/v1.1/) + * [the troubleshooting guide](http://kubernetes.io/v1.1/docs/troubleshooting.html) + + Again, thanks for using Kubernetes. + + The Kubernetes Team + +If you answer a question (in any of the above forums) that you think might be useful for someone else in the future, *please add it to one of the FAQs in the wiki*: +* [User FAQ](https://github.com/kubernetes/kubernetes/wiki/User-FAQ) +* [Developer FAQ](https://github.com/kubernetes/kubernetes/wiki/Developer-FAQ) +* [Debugging FAQ](https://github.com/kubernetes/kubernetes/wiki/Debugging-FAQ). + +Getting it into the FAQ is more important than polish. Please indicate the date it was added, so people can judge the likelihood that it is out-of-date (and please correct any FAQ entries that you see contain out-of-date information). + +Contact information +------------------- + +[@k8s-support-oncall](https://github.com/k8s-support-oncall) will reach the current person on call. + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/on-call-user-support.md?pixel)]() + diff --git a/docs/devel/pr_workflow.dia b/docs/devel/pr_workflow.dia new file mode 100644 index 00000000000..753a284b4a4 Binary files /dev/null and b/docs/devel/pr_workflow.dia differ diff --git a/docs/devel/pr_workflow.png b/docs/devel/pr_workflow.png new file mode 100644 index 00000000000..0e2bd5d6eda Binary files /dev/null and b/docs/devel/pr_workflow.png differ diff --git a/docs/devel/pull-requests.md b/docs/devel/pull-requests.md index eaffce237d6..817882dbb55 100644 --- a/docs/devel/pull-requests.md +++ b/docs/devel/pull-requests.md @@ -34,34 +34,54 @@ Documentation for other releases can be found at Pull Request Process ==================== -An overview of how we will manage old or out-of-date pull requests. - -Process -------- - -We will close any pull requests older than two weeks. - -Exceptions can be made for PRs that have active review comments, or that are awaiting other dependent PRs. Closed pull requests are easy to recreate, and little work is lost by closing a pull request that subsequently needs to be reopened. - -We want to limit the total number of PRs in flight to: -* Maintain a clean project -* Remove old PRs that would be difficult to rebase as the underlying code has changed over time -* Encourage code velocity +An overview of how pull requests are managed for kubernetes. This document +assumes the reader has already followed the [development guide](development.md) +to set up their environment. Life of a Pull Request ---------------------- Unless in the last few weeks of a milestone when we need to reduce churn and stabilize, we aim to be always accepting pull requests. -Either the [on call](https://github.com/kubernetes/kubernetes/wiki/Kubernetes-on-call-rotations) manually or the [github "munger"](https://github.com/kubernetes/contrib/tree/master/mungegithub) submit-queue plugin automatically will manage merging PRs. +Either the [on call](on-call-rotations.md) manually or the [github "munger"](https://github.com/kubernetes/contrib/tree/master/mungegithub) submit-queue plugin automatically will manage merging PRs. There are several requirements for the submit-queue to work: * Author must have signed CLA ("cla: yes" label added to PR) * No changes can be made since last lgtm label was applied -* k8s-bot must have reported the GCE E2E build and test steps passed (Travis, Shippable and Jenkins build) +* k8s-bot must have reported the GCE E2E build and test steps passed (Travis, Jenkins unit/integration, Jenkins e2e) Additionally, for infrequent or new contributors, we require the on call to apply the "ok-to-merge" label manually. This is gated by the [whitelist](https://github.com/kubernetes/contrib/blob/master/mungegithub/whitelist.txt). +### Before sending a pull request + +The following will save time for both you and your reviewer: + +* Enable [pre-commit hooks](development.md#committing-changes-to-your-fork) and verify they pass. +* Verify `hack/verify-generated-docs.sh` passes. +* Verify `hack/test-go.sh` passes. + +### Visual overview + +![PR workflow](pr_workflow.png) + +Other notes +----------- + +Pull requests that are purely support questions will be closed and +redirected to [stackoverflow](http://stackoverflow.com/questions/tagged/kubernetes). +We do this to consolidate help/support questions into a single channel, +improve efficiency in responding to requests and make FAQs easier +to find. + +Pull requests older than 2 weeks will be closed. Exceptions can be made +for PRs that have active review comments, or that are awaiting other dependent PRs. +Closed pull requests are easy to recreate, and little work is lost by closing a pull +request that subsequently needs to be reopened. We want to limit the total number of PRs in flight to: +* Maintain a clean project +* Remove old PRs that would be difficult to rebase as the underlying code has changed over time +* Encourage code velocity + + Automation ---------- diff --git a/docs/devel/scheduler_algorithm.md b/docs/devel/scheduler_algorithm.md index 00a812a55c9..a3897ffb7f7 100755 --- a/docs/devel/scheduler_algorithm.md +++ b/docs/devel/scheduler_algorithm.md @@ -47,6 +47,8 @@ The purpose of filtering the nodes is to filter out the nodes that do not meet c - `PodFitsHost`: Filter out all nodes except the one specified in the PodSpec's NodeName field. - `PodSelectorMatches`: Check if the labels of the node match the labels specified in the Pod's `nodeSelector` field ([Here](../user-guide/node-selection/) is an example of how to use `nodeSelector` field). - `CheckNodeLabelPresence`: Check if all the specified labels exist on a node or not, regardless of the value. +- `MaxEBSVolumeCount`: Ensure that the number of attached ElasticBlockStore volumes does not exceed a maximum value (by default, 39, since Amazon recommends a maximum of 40 with one of those 40 reserved for the root volume -- see [Amazon's documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html#linux-specific-volume-limits)). The maximum value can be controlled by setting the `KUBE_MAX_PD_VOLS` environment variable. +- `MaxGCEPDVolumeCount`: Ensure that the number of attached GCE PersistentDisk volumes does not exceed a maximum value (by default, 16, which is the maximum GCE allows -- see [GCE's documentation](https://cloud.google.com/compute/docs/disks/persistent-disks#limits_for_predefined_machine_types)). The maximum value can be controlled by setting the `KUBE_MAX_PD_VOLS` environment variable. The details of the above predicates can be found in [plugin/pkg/scheduler/algorithm/predicates/predicates.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/predicates/predicates.go). All predicates mentioned above can be used in combination to perform a sophisticated filtering policy. Kubernetes uses some, but not all, of these predicates by default. You can see which ones are used by default in [plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go). @@ -65,6 +67,7 @@ Currently, Kubernetes scheduler provides some practical priority functions, incl - `BalancedResourceAllocation`: This priority function tries to put the Pod on a node such that the CPU and Memory utilization rate is balanced after the Pod is deployed. - `CalculateSpreadPriority`: Spread Pods by minimizing the number of Pods belonging to the same service on the same node. If zone information is present on the nodes, the priority will be adjusted so that pods are spread across zones and nodes. - `CalculateAntiAffinityPriority`: Spread Pods by minimizing the number of Pods belonging to the same service on nodes with the same value for a particular label. +- `ImageLocalityPriority`: Nodes are prioritized based on locality of images requested by a pod. Nodes with larger size of already-installed packages required by the pod will be preferred over nodes with no already-installed packages required by the pod or a small total size of already-installed packages required by the pod. The details of the above priority functions can be found in [plugin/pkg/scheduler/algorithm/priorities](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/priorities/). Kubernetes uses some, but not all, of these priority functions by default. You can see which ones are used by default in [plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go). Similar as predicates, you can combine the above priority functions and assign weight factors (positive number) to them as you want (check [scheduler.md](scheduler.md) for how to customize). diff --git a/docs/getting-started-guides/README.md b/docs/getting-started-guides/README.md index 383fc78bf76..cdade774371 100644 --- a/docs/getting-started-guides/README.md +++ b/docs/getting-started-guides/README.md @@ -117,7 +117,7 @@ writing a new solution](../../docs/devel/writing-a-getting-started-guide.md). These solutions are combinations of cloud provider and OS not covered by the above solutions. -- [AWS + coreos](coreos.md) +- [AWS + CoreOS](coreos.md) - [GCE + CoreOS](coreos.md) - [AWS + Ubuntu](juju.md) - [Joyent + Ubuntu](juju.md) @@ -173,14 +173,14 @@ Bare-metal | custom | Fedora | _none_ | [docs](fedora/fedor Bare-metal | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) libvirt | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) KVM | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) -Mesos/Docker | custom | Ubuntu | Docker | [docs](mesos-docker.md) | [✓][4] | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md)) +Mesos/Docker | custom | Ubuntu | Docker | [docs](mesos-docker.md) | [✓][4] | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md)) Mesos/GCE | | | | [docs](mesos.md) | | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md)) DCOS | Marathon | CoreOS/Alpine | custom | [docs](dcos.md) | | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md)) AWS | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community GCE | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community ([@pires](https://github.com/pires)) Vagrant | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community ([@pires](https://github.com/pires), [@AntonioMeireles](https://github.com/AntonioMeireles)) Bare-metal (Offline) | CoreOS | CoreOS | flannel | [docs](coreos/bare_metal_offline.md) | | Community ([@jeffbean](https://github.com/jeffbean)) -Bare-metal | CoreOS | CoreOS | Calico | [docs](coreos/bare_metal_calico.md) | | Community ([@caseydavenport](https://github.com/caseydavenport)) +Bare-metal | CoreOS | CoreOS | Calico | [docs](coreos/bare_metal_calico.md) | [✓][5] | Community ([@caseydavenport](https://github.com/caseydavenport)) CloudStack | Ansible | CoreOS | flannel | [docs](cloudstack.md) | | Community ([@runseb](https://github.com/runseb)) Vmware | | Debian | OVS | [docs](vsphere.md) | | Community ([@pietern](https://github.com/pietern)) Bare-metal | custom | CentOS | _none_ | [docs](centos/centos_manual_config.md) | | Community ([@coolsvap](https://github.com/coolsvap)) @@ -226,6 +226,8 @@ Definition of columns: [3]: https://gist.github.com/erictune/2f39b22f72565365e59b [4]: https://gist.github.com/sttts/d27f3b879223895494d4 + +[5]: https://gist.github.com/caseydavenport/98ca87e709b21f03d195 diff --git a/docs/getting-started-guides/centos/centos_manual_config.md b/docs/getting-started-guides/centos/centos_manual_config.md index 8a0a575ffce..1a946c056cf 100644 --- a/docs/getting-started-guides/centos/centos_manual_config.md +++ b/docs/getting-started-guides/centos/centos_manual_config.md @@ -88,7 +88,7 @@ echo "192.168.121.9 centos-master ```sh # Comma separated list of nodes in the etcd cluster -KUBE_ETCD_SERVERS="--etcd-servers=http://centos-master:4001" +KUBE_ETCD_SERVERS="--etcd-servers=http://centos-master:2379" # logging to stderr means we get it in the systemd journal KUBE_LOGTOSTDERR="--logtostderr=true" diff --git a/docs/getting-started-guides/coreos/azure/README.md b/docs/getting-started-guides/coreos/azure/README.md index 1eca00bbda4..79e128151db 100644 --- a/docs/getting-started-guides/coreos/azure/README.md +++ b/docs/getting-started-guides/coreos/azure/README.md @@ -78,6 +78,13 @@ Now, all you need to do is: ``` This script will provision a cluster suitable for production use, where there is a ring of 3 dedicated etcd nodes: 1 kubernetes master and 2 kubernetes nodes. The `kube-00` VM will be the master, your work loads are only to be deployed on the nodes, `kube-01` and `kube-02`. Initially, all VMs are single-core, to ensure a user of the free tier can reproduce it without paying extra. I will show how to add more bigger VMs later. +If you need to pass Azure specific options for the creation script you can do this via additional environment variables e.g. + +``` +AZ_SUBSCRIPTION= AZ_LOCATION="East US" ./create-kubernetes-cluster.js +# or +AZ_VM_COREOS_CHANNEL=beta ./create-kubernetes-cluster.js +``` ![VMs in Azure](initial_cluster.png) diff --git a/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js b/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js index 3afa6bb45e2..93402c10eda 100644 --- a/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js +++ b/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js @@ -13,9 +13,9 @@ var inspect = require('util').inspect; var util = require('./util.js'); var coreos_image_ids = { - 'stable': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-766.4.0', - 'beta': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Beta-766.4.0', // untested - 'alpha': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Alpha-815.0.0' // untested + 'stable': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-835.12.0', // untested + 'beta': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Beta-899.6.0', + 'alpha': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Alpha-942.0.0' // untested }; var conf = {}; @@ -159,11 +159,18 @@ var get_vm_size = function () { } } +var get_subscription= function () { + if (process.env['AZ_SUBSCRIPTION']) { + return '--subscription=' + process.env['AZ_SUBSCRIPTION']; + } +} + exports.queue_default_network = function () { task_queue.push([ 'network', 'vnet', 'create', get_location(), '--address-space=172.16.0.0', + get_subscription(), conf.resources['vnet'], ]); } @@ -175,6 +182,7 @@ exports.queue_storage_if_needed = function() { 'storage', 'account', 'create', '--type=LRS', get_location(), + get_subscription(), conf.resources['storage_account'], ]); process.env['AZURE_STORAGE_ACCOUNT'] = conf.resources['storage_account']; @@ -195,6 +203,7 @@ exports.queue_machines = function (name_prefix, coreos_update_channel, cloud_con '--virtual-network-name=' + conf.resources['vnet'], '--no-ssh-password', '--ssh-cert=' + conf.resources['ssh_key']['pem'], + get_subscription(), ]; var cloud_config = cloud_config_creator(x, conf); @@ -219,6 +228,9 @@ exports.queue_machines = function (name_prefix, coreos_update_channel, cloud_con if (conf.resizing && n < conf.old_size) { return []; } else { + if (process.env['AZ_VM_COREOS_CHANNEL']) { + coreos_update_channel = process.env['AZ_VM_COREOS_CHANNEL'] + } return vm_create_base_args.concat(next_host(n), [ coreos_image_ids[coreos_update_channel], 'core', ]); @@ -249,11 +261,11 @@ exports.destroy_cluster = function (state_file) { conf.destroying = true; task_queue = _.map(conf.hosts, function (host) { - return ['vm', 'delete', '--quiet', '--blob-delete', host.name]; + return ['vm', 'delete', '--quiet', '--blob-delete', host.name, get_subscription()]; }); - task_queue.push(['network', 'vnet', 'delete', '--quiet', conf.resources['vnet']]); - task_queue.push(['storage', 'account', 'delete', '--quiet', conf.resources['storage_account']]); + task_queue.push(['network', 'vnet', 'delete', '--quiet', conf.resources['vnet'], get_subscription()]); + task_queue.push(['storage', 'account', 'delete', '--quiet', conf.resources['storage_account'], get_subscription()]); exports.run_task_queue(); }; diff --git a/docs/getting-started-guides/coreos/bare_metal_calico.md b/docs/getting-started-guides/coreos/bare_metal_calico.md index 73c2b431f72..dc45a18e60f 100644 --- a/docs/getting-started-guides/coreos/bare_metal_calico.md +++ b/docs/getting-started-guides/coreos/bare_metal_calico.md @@ -34,91 +34,202 @@ Documentation for other releases can be found at Bare Metal Kubernetes on CoreOS with Calico Networking ------------------------------------------ -This document describes how to deploy Kubernetes with Calico networking on _bare metal_ CoreOS. For more information on Project Calico, visit [projectcalico.org](http://projectcalico.org) and the [calico-docker repository](https://github.com/projectcalico/calico-docker). +This document describes how to deploy Kubernetes with Calico networking on _bare metal_ CoreOS. For more information on Project Calico, visit [projectcalico.org](http://projectcalico.org) and the [calico-containers repository](https://github.com/projectcalico/calico-containers). -To install Calico on an existing Kubernetes cluster, or for more information on deploying Calico with Kubernetes in a number of other environments take a look at our supported [deployment guides](https://github.com/projectcalico/calico-docker/tree/master/docs/kubernetes). +To install Calico on an existing Kubernetes cluster, or for more information on deploying Calico with Kubernetes in a number of other environments take a look at our supported [deployment guides](https://github.com/projectcalico/calico-containers/tree/master/docs/cni/kubernetes). Specifically, this guide will have you do the following: -- Deploy a Kubernetes master node on CoreOS using cloud-config -- Deploy two Kubernetes compute nodes with Calico Networking using cloud-config +- Deploy a Kubernetes master node on CoreOS using cloud-config. +- Deploy two Kubernetes compute nodes with Calico Networking using cloud-config. +- Configure `kubectl` to access your cluster. -## Prerequisites +The resulting cluster will use SSL between Kubernetes components. It will run the SkyDNS service and kube-ui, and be fully conformant with the Kubernetes v1.1 conformance tests. -1. At least three bare-metal machines (or VMs) to work with. This guide will configure them as follows: - - 1 Kubernetes Master - - 2 Kubernetes Nodes -2. Your nodes should have IP connectivity. +## Prerequisites and Assumptions + +- At least three bare-metal machines (or VMs) to work with. This guide will configure them as follows: + - 1 Kubernetes Master + - 2 Kubernetes Nodes +- Your nodes should have IP connectivity to each other and the internet. +- This guide assumes a DHCP server on your network to assign server IPs. +- This guide uses `192.168.0.0/16` as the subnet from which pod IP addresses are assigned. If this overlaps with your host subnet, you will need to configure Calico to use a different [IP pool](https://github.com/projectcalico/calico-containers/blob/master/docs/calicoctl/pool.md#calicoctl-pool-commands). ## Cloud-config This guide will use [cloud-config](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/) to configure each of the nodes in our Kubernetes cluster. We'll use two cloud-config files: -- `master-config.yaml`: Cloud-config for the Kubernetes master -- `node-config.yaml`: Cloud-config for each Kubernetes node +- `master-config.yaml`: cloud-config for the Kubernetes master +- `node-config.yaml`: cloud-config for each Kubernetes node ## Download CoreOS -Let's download the CoreOS bootable ISO. We'll use this image to boot and install CoreOS on each server. - -``` -wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_iso_image.iso -``` - -> You can also download the ISO from the [CoreOS website](https://coreos.com/docs/running-coreos/platforms/iso/). +Download the stable CoreOS bootable ISO from the [CoreOS website](https://coreos.com/docs/running-coreos/platforms/iso/). ## Configure the Kubernetes Master -Once you've downloaded the image, use it to boot your Kubernetes master. Once booted, you should be automatically logged in as the `core` user. +1. Once you've downloaded the ISO image, burn the ISO to a CD/DVD/USB key and boot from it (if using a virtual machine you can boot directly from the ISO). Once booted, you should be automatically logged in as the `core` user at the terminal. At this point CoreOS is running from the ISO and it hasn't been installed yet. -*On another machine*, download the `calico-kubernetes` repository, which contains the necessary cloud-config files for this guide, and make a copy of the file `master-config-template.yaml`. +2. *On another machine*, download the the [master cloud-config template](https://raw.githubusercontent.com/projectcalico/calico-cni/k8s-1.1-docs/samples/kubernetes/cloud-config/master-config-template.yaml) and save it as `master-config.yaml`. + +3. Replace the following variables in the `master-config.yaml` file. + + - ``: The public key you will use for SSH access to this server. See [generating ssh keys](https://help.github.com/articles/generating-ssh-keys/) + +4. Copy the edited `master-config.yaml` to your Kubernetes master machine (using a USB stick, for example). + +5. The CoreOS bootable ISO comes with a tool called `coreos-install` which will allow us to install CoreOS and configure the machine using a cloud-config file. The following command will download and install stable CoreOS using the `master-config.yaml` file we just created for configuration. Run this on the Kubernetes master. + + > **Warning:** this is a destructive operation that erases disk `sda` on your server. + + ``` + sudo coreos-install -d /dev/sda -C stable -c master-config.yaml + ``` + +6. Once complete, restart the server and boot from `/dev/sda` (you may need to remove the ISO image). When it comes back up, you should have SSH access as the `core` user using the public key provided in the `master-config.yaml` file. + +### Configure TLS + +The master requires the CA certificate, `ca.pem`; its own certificate, `apiserver.pem` and its private key, `apiserver-key.pem`. This [CoreOS guide](https://coreos.com/kubernetes/docs/latest/openssl.html) explains how to generate these. + +1. Generate the necessary certificates for the master. This [guide for generating Kubernetes TLS Assets](https://coreos.com/kubernetes/docs/latest/openssl.html) explains how to use OpenSSL to generate the required assets. + +2. Send the three files to your master host (using `scp` for example). + +3. Move them to the `/etc/kubernetes/ssl` folder and ensure that only the root user can read the key: + + ``` + # Move keys + sudo mkdir -p /etc/kubernetes/ssl/ + sudo mv -t /etc/kubernetes/ssl/ ca.pem apiserver.pem apiserver-key.pem + + # Set Permissions + sudo chmod 600 /etc/kubernetes/ssl/apiserver-key.pem + sudo chown root:root /etc/kubernetes/ssl/apiserver-key.pem + ``` + +4. Restart the kubelet to pick up the changes: + + ``` + sudo systemctl restart kubelet + ``` + +## Configure the compute nodes + +The following steps will set up a single Kubernetes node for use as a compute host. Run these steps to deploy each Kubernetes node in your cluster. + +1. Boot up the node machine using the bootable ISO we downloaded earlier. You should be automatically logged in as the `core` user. + +2. Make a copy of the [node cloud-config template](https://raw.githubusercontent.com/projectcalico/calico-cni/k8s-1.1-docs/samples/kubernetes/cloud-config/node-config-template.yaml) for this machine. + +3. Replace the following placeholders in the `node-config.yaml` file to match your deployment. + + - ``: Hostname for this node (e.g. kube-node1, kube-node2) + - ``: The public key you will use for SSH access to this server. + - ``: The IPv4 address of the Kubernetes master. + +4. Replace the following placeholders with the contents of their respective files. + + - ``: Complete contents of `ca.pem` + - ``: Complete contents of `ca-key.pem` + + > **Important:** in a production deployment, embedding the secret key in cloud-config is a bad idea! In production you should use an appropriate secret manager. + + > **Important:** Make sure you indent the entire file to match the indentation of the placeholder. For example: + > + > ``` + > - path: /etc/kubernetes/ssl/ca.pem + > owner: core + > permissions: 0644 + > content: | + > + > ``` + > + > should look like this once the certificate is in place: + > + > ``` + > - path: /etc/kubernetes/ssl/ca.pem + > owner: core + > permissions: 0644 + > content: | + > -----BEGIN CERTIFICATE----- + > MIIC9zCCAd+gAwIBAgIJAJMnVnhVhy5pMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV + > ...... + > QHwi1rNc8eBLNrd4BM/A1ZeDVh/Q9KxN+ZG/hHIXhmWKgN5wQx6/81FIFg== + > -----END CERTIFICATE----- + > ``` + +5. Move the modified `node-config.yaml` to your Kubernetes node machine and install and configure CoreOS on the node using the following command. + + > **Warning:** this is a destructive operation that erases disk `sda` on your server. + + ``` + sudo coreos-install -d /dev/sda -C stable -c node-config.yaml + ``` + +6. Once complete, restart the server and boot into `/dev/sda`. When it comes back up, you should have SSH access as the `core` user using the public key provided in the `node-config.yaml` file. It will take some time for the node to be fully configured. + +## Configure Kubeconfig + +To administer your cluster from a separate host, you will need the client and admin certificates generated earlier (`ca.pem`, `admin.pem`, `admin-key.pem`). With certificates in place, run the following commands with the appropriate filepaths. ``` -wget https://github.com/projectcalico/calico-kubernetes/archive/master.tar.gz -tar -xvf master.tar.gz -cp calico-kubernetes-master/config/cloud-config/master-config-template.yaml master-config.yaml +kubectl config set-cluster calico-cluster --server=https:// --certificate-authority= +kubectl config set-credentials calico-admin --certificate-authority= --client-key= --client-certificate= +kubectl config set-context calico --cluster=calico-cluster --user=calico-admin +kubectl config use-context calico ``` -You'll need to replace the following variables in the `master-config.yaml` file. -- ``: The public key you will use for SSH access to this server. +Check your work with `kubectl get nodes`. -Move the edited `master-config.yaml` to your Kubernetes master machine. The CoreOS bootable ISO comes with a tool called `coreos-install` which will allow us to install CoreOS and configure the machine using a cloud-config file. The following command will download and install stable CoreOS using the `master-config.yaml` file we just created for configuration. Run this on the Kubernetes master. +## Install the DNS Addon + +Most Kubernetes deployments will require the DNS addon for service discovery. To install DNS, create the skydns service and replication controller provided. ``` -sudo coreos-install -d /dev/sda -C stable -c master-config.yaml +kubectl create -f https://raw.githubusercontent.com/projectcalico/calico-cni/k8s-1.1-docs/samples/kubernetes/master/dns/skydns.yaml ``` -Once complete, eject the bootable ISO and restart the server. When it comes back up, you should have SSH access as the `core` user using the public key provided in the `master-config.yaml` file. It may take a few minutes for the machine to be fully configured with Kubernetes and Calico. +## Install the Kubernetes UI Addon (Optional) -## Configure the compute hosts - ->The following steps will set up a single Kubernetes node for use as a compute host. Run these steps to deploy each Kubernetes node in your cluster. - -First, boot up the node machine using the bootable ISO we downloaded earlier. You should be automatically logged in as the `core` user. - -Make a copy of the `node-config-template.yaml` in the `calico-kubernetes` repository for this machine. +The Kubernetes UI can be installed using `kubectl` to run the following manifest file. ``` -cp calico-kubernetes-master/config/cloud-config/node-config-template.yaml node-config.yaml +kubectl create -f https://raw.githubusercontent.com/projectcalico/calico-cni/k8s-1.1-docs/samples/kubernetes/master/kube-ui/kube-ui.yaml ``` -You'll need to replace the following variables in the `node-config.yaml` file to match your deployment. -- ``: Hostname for this node (e.g. kube-node1, kube-node2) -- ``: The public key you will use for SSH access to this server. -- ``: The IPv4 address of the Kubernetes master. +## Launch other Services With Calico-Kubernetes -Move the modified `node-config.yaml` to your Kubernetes node machine and install and configure CoreOS on the node using the following command. +At this point, you have a fully functioning cluster running on Kubernetes with a master and two nodes networked with Calico. You can now follow any of the [standard documentation](../../../examples/) to set up other services on your cluster. + +## Connectivity to outside the cluster + +Because containers in this guide have private `192.168.0.0/16` IPs, you will need NAT to allow connectivity between containers and the internet. However, in a production data center deployment, NAT is not always necessary, since Calico can peer with the data center's border routers over BGP. + +### NAT on the nodes + +The simplest method for enabling connectivity from containers to the internet is to use outgoing NAT on your Kubernetes nodes. + +Calico can provide outgoing NAT for containers. To enable it, use the following `calicoctl` command: ``` -sudo coreos-install -d /dev/sda -C stable -c node-config.yaml +ETCD_AUTHORITY= calicoctl pool add --nat-outgoing ``` -Once complete, eject the bootable disc and restart the server. When it comes back up, you should have SSH access as the `core` user using the public key provided in the `node-config.yaml` file. It will take some time for the node to be fully configured. Once fully configured, you can check that the node is running with the following command on the Kubernetes master. +By default, `` will be `192.168.0.0/16`. You can find out which pools have been configured with the following command: ``` -kubectl get nodes +ETCD_AUTHORITY= calicoctl pool show ``` +### NAT at the border router + +In a data center environment, it is recommended to configure Calico to peer with the border routers over BGP. This means that the container IPs will be routable anywhere in the data center, and so NAT is not needed on the nodes (though it may be enabled at the data center edge to allow outbound-only internet connectivity). + +The Calico documentation contains more information on how to configure Calico to [peer with existing infrastructure](https://github.com/projectcalico/calico-containers/blob/master/docs/ExternalConnectivity.md). + +[![Analytics](https://ga-beacon.appspot.com/UA-52125893-3/kubernetes/docs/getting-started-guides/coreos/bare_metal_calico.md?pixel)](https://github.com/igrigorik/ga-beacon) + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos/bare_metal_calico.md?pixel)]() diff --git a/docs/getting-started-guides/docker-multinode.md b/docs/getting-started-guides/docker-multinode.md index fac16f3319b..16c6b69e84c 100644 --- a/docs/getting-started-guides/docker-multinode.md +++ b/docs/getting-started-guides/docker-multinode.md @@ -55,7 +55,7 @@ The only thing you need is a machine with **Docker 1.7.1 or higher** ## Overview This guide will set up a 2-node Kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work -and a _worker_ node which receives work from the master. You can repeat the process of adding worker nodes an arbitrary number of +and a _worker_ node which receives work from the master. You can repeat the process of adding worker nodes an arbitrary number of times to create larger clusters. Here's a diagram of what the final result will look like: @@ -74,10 +74,11 @@ it is still useful to use containers for deployment and management, so we create You can specify the version on every node before install: ```sh -export K8S_VERSION= +export K8S_VERSION= export ETCD_VERSION= export FLANNEL_VERSION= export FLANNEL_IFACE= +export FLANNEL_IPMASQ= ``` Otherwise, we'll use latest `hyperkube` image as default k8s version. diff --git a/docs/getting-started-guides/docker-multinode/master.md b/docs/getting-started-guides/docker-multinode/master.md index 3a79243d59a..42b0041841d 100644 --- a/docs/getting-started-guides/docker-multinode/master.md +++ b/docs/getting-started-guides/docker-multinode/master.md @@ -36,16 +36,17 @@ Documentation for other releases can be found at We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine is `${MASTER_IP}`. We'll need to run several versioned Kubernetes components, so we'll assume that the version we want -to run is `${K8S_VERSION}`, which should hold a released version of Kubernetes >= "1.2.0-alpha.6" +to run is `${K8S_VERSION}`, which should hold a released version of Kubernetes >= "1.2.0-alpha.7" Enviroinment variables used: ```sh export MASTER_IP= -export K8S_VERSION= +export K8S_VERSION= export ETCD_VERSION= export FLANNEL_VERSION= export FLANNEL_IFACE= +export FLANNEL_IPMASQ= ``` There are two main phases to installing the master: @@ -82,7 +83,7 @@ Run: ```sh sudo docker -H unix:///var/run/docker-bootstrap.sock run -d \ --net=host \ - gcr.io/google_containers/etcd:${ETCD_VERSION} \ + gcr.io/google_containers/etcd-amd64:${ETCD_VERSION} \ /usr/local/bin/etcd \ --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 \ --advertise-client-urls=http://${MASTER_IP}:4001 \ @@ -94,7 +95,7 @@ Next, you need to set a CIDR range for flannel. This CIDR should be chosen to b ```sh sudo docker -H unix:///var/run/docker-bootstrap.sock run \ --net=host \ - gcr.io/google_containers/etcd:${ETCD_VERSION} \ + gcr.io/google_containers/etcd-amd64:${ETCD_VERSION} \ etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }' ``` @@ -139,7 +140,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock run -d \ --privileged \ -v /dev/net:/dev/net \ quay.io/coreos/flannel:${FLANNEL_VERSION} \ - --ip-masq \ + --ip-masq=${FLANNEL_IPMASQ} \ --iface=${FLANNEL_IFACE} ``` @@ -225,11 +226,11 @@ sudo docker run \ At this point, you should have a functioning 1-node cluster. Let's test it out! Download the kubectl binary for `${K8S_VERSION}` (look at the URL in the following links) and make it available by editing your PATH environment variable. -([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/amd64/kubectl)) -([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/386/kubectl)) -([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/amd64/kubectl)) -([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/386/kubectl)) -([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/arm/kubectl)) +([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/darwin/amd64/kubectl)) +([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/darwin/386/kubectl)) +([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/amd64/kubectl)) +([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/386/kubectl)) +([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/arm/kubectl)) For example, OS X: diff --git a/docs/getting-started-guides/docker-multinode/master.sh b/docs/getting-started-guides/docker-multinode/master.sh index d831845a5da..5024410e496 100755 --- a/docs/getting-started-guides/docker-multinode/master.sh +++ b/docs/getting-started-guides/docker-multinode/master.sh @@ -26,9 +26,10 @@ if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then fi # Make sure k8s version env is properly set -K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.6"} +K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.7"} ETCD_VERSION=${ETCD_VERSION:-"2.2.1"} FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"} +FLANNEL_IPMASQ=${FLANNEL_IPMASQ:-"true"} FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"} ARCH=${ARCH:-"amd64"} @@ -47,6 +48,7 @@ echo "K8S_VERSION is set to: ${K8S_VERSION}" echo "ETCD_VERSION is set to: ${ETCD_VERSION}" echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}" echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}" +echo "FLANNEL_IPMASQ is set to: ${FLANNEL_IPMASQ}" echo "MASTER_IP is set to: ${MASTER_IP}" echo "ARCH is set to: ${ARCH}" @@ -120,10 +122,10 @@ DOCKER_CONF="" start_k8s(){ # Start etcd docker -H unix:///var/run/docker-bootstrap.sock run \ - --restart=always \ + --restart=on-failure \ --net=host \ -d \ - gcr.io/google_containers/etcd:${ETCD_VERSION} \ + gcr.io/google_containers/etcd-${ARCH}:${ETCD_VERSION} \ /usr/local/bin/etcd \ --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 \ --advertise-client-urls=http://${MASTER_IP}:4001 \ @@ -139,14 +141,14 @@ start_k8s(){ # iface may change to a private network interface, eth0 is for default flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run \ - --restart=always \ + --restart=on-failure \ -d \ --net=host \ --privileged \ -v /dev/net:/dev/net \ quay.io/coreos/flannel:${FLANNEL_VERSION} \ /opt/bin/flanneld \ - --ip-masq \ + --ip-masq="${FLANNEL_IPMASQ}" \ --iface="${FLANNEL_IFACE}") sleep 8 @@ -200,7 +202,7 @@ start_k8s(){ --net=host \ --pid=host \ --privileged \ - --restart=always \ + --restart=on-failure \ -d \ -v /sys:/sys:ro \ -v /var/run:/var/run:rw \ diff --git a/docs/getting-started-guides/docker-multinode/worker.md b/docs/getting-started-guides/docker-multinode/worker.md index 82308a13522..5ec5b77b6f5 100644 --- a/docs/getting-started-guides/docker-multinode/worker.md +++ b/docs/getting-started-guides/docker-multinode/worker.md @@ -47,6 +47,7 @@ export MASTER_IP= export K8S_VERSION= export FLANNEL_VERSION= export FLANNEL_IFACE= +export FLANNEL_IPMASQ= ``` For each worker node, there are three steps: @@ -105,7 +106,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock run -d \ -v /dev/net:/dev/net \ quay.io/coreos/flannel:${FLANNEL_VERSION} \ /opt/bin/flanneld \ - --ip-masq \ + --ip-masq=${FLANNEL_IPMASQ} \ --etcd-endpoints=http://${MASTER_IP}:4001 \ --iface=${FLANNEL_IFACE} ``` diff --git a/docs/getting-started-guides/docker-multinode/worker.sh b/docs/getting-started-guides/docker-multinode/worker.sh index 759d638275f..419b14b3f69 100755 --- a/docs/getting-started-guides/docker-multinode/worker.sh +++ b/docs/getting-started-guides/docker-multinode/worker.sh @@ -26,9 +26,10 @@ if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then fi # Make sure k8s version env is properly set -K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.6"} +K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.7"} FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"} FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"} +FLANNEL_IPMASQ=${FLANNEL_IPMASQ:-"true"} ARCH=${ARCH:-"amd64"} # Run as root @@ -46,6 +47,7 @@ fi echo "K8S_VERSION is set to: ${K8S_VERSION}" echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}" echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}" +echo "FLANNEL_IPMASQ is set to: ${FLANNEL_IPMASQ}" echo "MASTER_IP is set to: ${MASTER_IP}" echo "ARCH is set to: ${ARCH}" @@ -118,13 +120,13 @@ start_k8s() { # Start flannel flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run \ -d \ - --restart=always \ + --restart=on-failure \ --net=host \ --privileged \ -v /dev/net:/dev/net \ quay.io/coreos/flannel:${FLANNEL_VERSION} \ /opt/bin/flanneld \ - --ip-masq \ + --ip-masq="${FLANNEL_IPMASQ}" \ --etcd-endpoints=http://${MASTER_IP}:4001 \ --iface="${FLANNEL_IFACE}") @@ -180,7 +182,7 @@ start_k8s() { --net=host \ --pid=host \ --privileged \ - --restart=always \ + --restart=on-failure \ -d \ -v /sys:/sys:ro \ -v /var/run:/var/run:rw \ @@ -203,7 +205,7 @@ start_k8s() { -d \ --net=host \ --privileged \ - --restart=always \ + --restart=on-failure \ gcr.io/google_containers/hyperkube-${ARCH}:v${K8S_VERSION} \ /hyperkube proxy \ --master=http://${MASTER_IP}:8080 \ diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 7582ffd6c8c..806514014a3 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -58,7 +58,7 @@ Here's a diagram of what the final result will look like: 1. You need to have docker installed on one machine. 2. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to - a released version of Kubernetes >= "1.2.0-alpha.6" + a released version of Kubernetes >= "1.2.0-alpha.7" ### Run it @@ -96,11 +96,11 @@ At this point you should have a running Kubernetes cluster. You can test this by downloading the kubectl binary for `${K8S_VERSION}` (look at the URL in the following links) and make it available by editing your PATH environment variable. -([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/amd64/kubectl)) -([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/386/kubectl)) -([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/amd64/kubectl)) -([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/386/kubectl)) -([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/arm/kubectl)) +([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/darwin/amd64/kubectl)) +([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/darwin/386/kubectl)) +([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/amd64/kubectl)) +([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/386/kubectl)) +([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.7/bin/linux/arm/kubectl)) For example, OS X: @@ -159,7 +159,7 @@ Now run `docker ps` you should see nginx running. You may need to wait a few mi kubectl expose rc nginx --port=80 ``` -Run the following command to obtain the IP of this service we just created. There are two IPs, the first one is internal (CLUSTER_IP), and the second one is the external load-balanced IP. +Run the following command to obtain the IP of this service we just created. There are two IPs, the first one is internal (CLUSTER_IP), and the second one is the external load-balanced IP (if a LoadBalancer is configured) ```sh kubectl get svc nginx @@ -219,9 +219,8 @@ parameters as follows: output of /proc/cmdline: ```console - $cat /proc/cmdline - BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory - swapaccount=1 + $ cat /proc/cmdline + BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory swapaccount=1 ``` diff --git a/docs/getting-started-guides/logging.md b/docs/getting-started-guides/logging.md index 273065f6764..7315ada3182 100644 --- a/docs/getting-started-guides/logging.md +++ b/docs/getting-started-guides/logging.md @@ -172,7 +172,7 @@ metadata: spec: containers: - name: fluentd-cloud-logging - image: gcr.io/google_containers/fluentd-gcp:1.15 + image: gcr.io/google_containers/fluentd-gcp:1.16 resources: limits: cpu: 100m diff --git a/docs/man/man1/kubectl-annotate.1 b/docs/man/man1/kubectl-annotate.1 index 84de22540fa..6794d734a2a 100644 --- a/docs/man/man1/kubectl-annotate.1 +++ b/docs/man/man1/kubectl-annotate.1 @@ -55,6 +55,10 @@ horizontalpodautoscalers (hpa), resourcequotas (quota) or secrets. \fB\-\-overwrite\fP=false If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations. +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-resource\-version\fP="" If non\-empty, the annotation update will only succeed if this is the current resource\-version for the object. Only valid when specifying a single resource. @@ -67,6 +71,10 @@ horizontalpodautoscalers (hpa), resourcequotas (quota) or secrets. \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-apply.1 b/docs/man/man1/kubectl-apply.1 index ad0418b3224..a5f3d080e00 100644 --- a/docs/man/man1/kubectl-apply.1 +++ b/docs/man/man1/kubectl-apply.1 @@ -29,6 +29,10 @@ JSON and YAML formats are accepted. \fB\-o\fP, \fB\-\-output\fP="" Output mode. Use "\-o name" for shorter output (resource/name). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-schema\-cache\-dir\fP="\~/.kube/schema" If non\-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' diff --git a/docs/man/man1/kubectl-autoscale.1 b/docs/man/man1/kubectl-autoscale.1 index 348f55e05ed..33c5868975d 100644 --- a/docs/man/man1/kubectl-autoscale.1 +++ b/docs/man/man1/kubectl-autoscale.1 @@ -63,6 +63,10 @@ An autoscaler can automatically increase or decrease number of pods deployed wit \fB\-\-output\-version\fP="" Output the formatted object with the given version (default api\-version). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-save\-config\fP=false If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. @@ -71,6 +75,10 @@ An autoscaler can automatically increase or decrease number of pods deployed wit \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-config-view.1 b/docs/man/man1/kubectl-config-view.1 index 2ac3848213f..1446c90fa44 100644 --- a/docs/man/man1/kubectl-config-view.1 +++ b/docs/man/man1/kubectl-config-view.1 @@ -54,6 +54,10 @@ You can use \-\-output jsonpath={...} to extract specific values using a jsonpat \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-convert.1 b/docs/man/man1/kubectl-convert.1 index bae38580fbc..c0aebad0a9e 100644 --- a/docs/man/man1/kubectl-convert.1 +++ b/docs/man/man1/kubectl-convert.1 @@ -57,6 +57,10 @@ to change to output destination. \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-create.1 b/docs/man/man1/kubectl-create.1 index e10b7828558..958b3ec2c71 100644 --- a/docs/man/man1/kubectl-create.1 +++ b/docs/man/man1/kubectl-create.1 @@ -28,6 +28,10 @@ JSON and YAML formats are accepted. \fB\-o\fP, \fB\-\-output\fP="" Output mode. Use "\-o name" for shorter output (resource/name). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-save\-config\fP=false If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. diff --git a/docs/man/man1/kubectl-drain.1 b/docs/man/man1/kubectl-drain.1 index 512969f2e2f..d8514b45278 100644 --- a/docs/man/man1/kubectl-drain.1 +++ b/docs/man/man1/kubectl-drain.1 @@ -18,9 +18,12 @@ Drain node in preparation for maintenance. .PP The given node will be marked unschedulable to prevent new pods from arriving. Then drain deletes all pods except mirror pods (which cannot be deleted through -the API server). If there are any pods that are neither mirror pods nor -managed by a ReplicationController, Job, or DaemonSet, then drain will not -delete any pods unless you use \-\-force. +the API server). If there are DaemonSet\-managed pods, drain will not proceed +without \-\-ignore\-daemonsets, and regardless it will not delete any +DaemonSet\-managed pods, because those pods would be immediately replaced by the +DaemonSet controller, which ignores unschedulable marknigs. If there are any +pods that are neither mirror pods nor managed\-\-by ReplicationController, +DaemonSet or Job\-\-, then drain will not delete any pods unless you use \-\-force. .PP When you are ready to put the node back into service, use kubectl uncordon, which @@ -36,6 +39,10 @@ will make the node schedulable again. \fB\-\-grace\-period\fP=\-1 Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used. +.PP +\fB\-\-ignore\-daemonsets\fP=false + Ignore DaemonSet\-managed pods. + .SH OPTIONS INHERITED FROM PARENT COMMANDS .PP diff --git a/docs/man/man1/kubectl-edit.1 b/docs/man/man1/kubectl-edit.1 index 0e833a7d1f8..5ac2eee6ab7 100644 --- a/docs/man/man1/kubectl-edit.1 +++ b/docs/man/man1/kubectl-edit.1 @@ -50,6 +50,10 @@ saved copy to include the latest resource version. \fB\-\-output\-version\fP="" Output the formatted object with the given version (default api\-version). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-save\-config\fP=false If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. diff --git a/docs/man/man1/kubectl-expose.1 b/docs/man/man1/kubectl-expose.1 index 0be697f7a20..5274cce775a 100644 --- a/docs/man/man1/kubectl-expose.1 +++ b/docs/man/man1/kubectl-expose.1 @@ -85,6 +85,10 @@ the new service will re\-use the labels from the resource it exposes. \fB\-\-protocol\fP="TCP" The network protocol for the service to be created. Default is 'tcp'. +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-save\-config\fP=false If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. @@ -101,6 +105,10 @@ the new service will re\-use the labels from the resource it exposes. \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-get.1 b/docs/man/man1/kubectl-get.1 index 0c517589e5a..ba518037c5e 100644 --- a/docs/man/man1/kubectl-get.1 +++ b/docs/man/man1/kubectl-get.1 @@ -66,6 +66,10 @@ of the \-\-template flag, you can filter the attributes of the fetched resource( \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-label.1 b/docs/man/man1/kubectl-label.1 index 755962a8bce..9f2c7c5c4a0 100644 --- a/docs/man/man1/kubectl-label.1 +++ b/docs/man/man1/kubectl-label.1 @@ -52,6 +52,10 @@ If \-\-resource\-version is specified, then updates will use this resource versi \fB\-\-overwrite\fP=false If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels. +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-resource\-version\fP="" If non\-empty, the labels update will only succeed if this is the current resource\-version for the object. Only valid when specifying a single resource. @@ -64,6 +68,10 @@ If \-\-resource\-version is specified, then updates will use this resource versi \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-patch.1 b/docs/man/man1/kubectl-patch.1 index 454684f825d..ca1f1089924 100644 --- a/docs/man/man1/kubectl-patch.1 +++ b/docs/man/man1/kubectl-patch.1 @@ -36,6 +36,10 @@ Please refer to the models in \fB\-p\fP, \fB\-\-patch\fP="" The patch to be applied to the resource JSON file. +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .SH OPTIONS INHERITED FROM PARENT COMMANDS .PP diff --git a/docs/man/man1/kubectl-replace.1 b/docs/man/man1/kubectl-replace.1 index 3418877c5e5..33eb80b7685 100644 --- a/docs/man/man1/kubectl-replace.1 +++ b/docs/man/man1/kubectl-replace.1 @@ -46,6 +46,10 @@ Please refer to the models in \fB\-o\fP, \fB\-\-output\fP="" Output mode. Use "\-o name" for shorter output (resource/name). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-save\-config\fP=false If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. diff --git a/docs/man/man1/kubectl-rolling-update.1 b/docs/man/man1/kubectl-rolling-update.1 index f492d35fbe5..8e9a245c31a 100644 --- a/docs/man/man1/kubectl-rolling-update.1 +++ b/docs/man/man1/kubectl-rolling-update.1 @@ -72,6 +72,10 @@ existing replication controller and overwrite at least one (common) label in its \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-rollout-pause.1 b/docs/man/man1/kubectl-rollout-pause.1 new file mode 100644 index 00000000000..5dc75d21fa7 --- /dev/null +++ b/docs/man/man1/kubectl-rollout-pause.1 @@ -0,0 +1,145 @@ +.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" + + +.SH NAME +.PP +kubectl rollout pause \- Mark the provided resource as paused + + +.SH SYNOPSIS +.PP +\fBkubectl rollout pause\fP [OPTIONS] + + +.SH DESCRIPTION +.PP +Mark the provided resource as paused + +.PP +Paused resources will not be reconciled by a controller. +Use \\"kubectl rollout resume\\" to resume a paused resource. +Currently only deployments support being paused. + + +.SH OPTIONS +.PP +\fB\-f\fP, \fB\-\-filename\fP=[] + Filename, directory, or URL to a file identifying the resource to get from a server. + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB\-\-alsologtostderr\fP=false + log to standard error as well as files + +.PP +\fB\-\-api\-version\fP="" + The API version to use when talking to the server + +.PP +\fB\-\-certificate\-authority\fP="" + Path to a cert. file for the certificate authority. + +.PP +\fB\-\-client\-certificate\fP="" + Path to a client certificate file for TLS. + +.PP +\fB\-\-client\-key\fP="" + Path to a client key file for TLS. + +.PP +\fB\-\-cluster\fP="" + The name of the kubeconfig cluster to use + +.PP +\fB\-\-context\fP="" + The name of the kubeconfig context to use + +.PP +\fB\-\-insecure\-skip\-tls\-verify\fP=false + If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + +.PP +\fB\-\-kubeconfig\fP="" + Path to the kubeconfig file to use for CLI requests. + +.PP +\fB\-\-log\-backtrace\-at\fP=:0 + when logging hits line file:N, emit a stack trace + +.PP +\fB\-\-log\-dir\fP="" + If non\-empty, write log files in this directory + +.PP +\fB\-\-log\-flush\-frequency\fP=5s + Maximum number of seconds between log flushes + +.PP +\fB\-\-logtostderr\fP=true + log to standard error instead of files + +.PP +\fB\-\-match\-server\-version\fP=false + Require server version to match client version + +.PP +\fB\-\-namespace\fP="" + If present, the namespace scope for this CLI request. + +.PP +\fB\-\-password\fP="" + Password for basic authentication to the API server. + +.PP +\fB\-s\fP, \fB\-\-server\fP="" + The address and port of the Kubernetes API server + +.PP +\fB\-\-stderrthreshold\fP=2 + logs at or above this threshold go to stderr + +.PP +\fB\-\-token\fP="" + Bearer token for authentication to the API server. + +.PP +\fB\-\-user\fP="" + The name of the kubeconfig user to use + +.PP +\fB\-\-username\fP="" + Username for basic authentication to the API server. + +.PP +\fB\-\-v\fP=0 + log level for V logs + +.PP +\fB\-\-vmodule\fP= + comma\-separated list of pattern=N settings for file\-filtered logging + + +.SH EXAMPLE +.PP +.RS + +.nf +# Mark the nginx deployment as paused. Any current state of +# the deployment will continue its function, new updates to the deployment will not +# have an effect as long as the deployment is paused. +$ kubectl rollout pause deployment/nginx + +.fi +.RE + + +.SH SEE ALSO +.PP +\fBkubectl\-rollout(1)\fP, + + +.SH HISTORY +.PP +January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/docs/man/man1/kubectl-rollout-resume.1 b/docs/man/man1/kubectl-rollout-resume.1 new file mode 100644 index 00000000000..34b9e8d7035 --- /dev/null +++ b/docs/man/man1/kubectl-rollout-resume.1 @@ -0,0 +1,143 @@ +.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" + + +.SH NAME +.PP +kubectl rollout resume \- Resume a paused resource + + +.SH SYNOPSIS +.PP +\fBkubectl rollout resume\fP [OPTIONS] + + +.SH DESCRIPTION +.PP +Resume a paused resource + +.PP +Paused resources will not be reconciled by a controller. By resuming a +resource, we allow it to be reconciled again. +Currently only deployments support being resumed. + + +.SH OPTIONS +.PP +\fB\-f\fP, \fB\-\-filename\fP=[] + Filename, directory, or URL to a file identifying the resource to get from a server. + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB\-\-alsologtostderr\fP=false + log to standard error as well as files + +.PP +\fB\-\-api\-version\fP="" + The API version to use when talking to the server + +.PP +\fB\-\-certificate\-authority\fP="" + Path to a cert. file for the certificate authority. + +.PP +\fB\-\-client\-certificate\fP="" + Path to a client certificate file for TLS. + +.PP +\fB\-\-client\-key\fP="" + Path to a client key file for TLS. + +.PP +\fB\-\-cluster\fP="" + The name of the kubeconfig cluster to use + +.PP +\fB\-\-context\fP="" + The name of the kubeconfig context to use + +.PP +\fB\-\-insecure\-skip\-tls\-verify\fP=false + If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + +.PP +\fB\-\-kubeconfig\fP="" + Path to the kubeconfig file to use for CLI requests. + +.PP +\fB\-\-log\-backtrace\-at\fP=:0 + when logging hits line file:N, emit a stack trace + +.PP +\fB\-\-log\-dir\fP="" + If non\-empty, write log files in this directory + +.PP +\fB\-\-log\-flush\-frequency\fP=5s + Maximum number of seconds between log flushes + +.PP +\fB\-\-logtostderr\fP=true + log to standard error instead of files + +.PP +\fB\-\-match\-server\-version\fP=false + Require server version to match client version + +.PP +\fB\-\-namespace\fP="" + If present, the namespace scope for this CLI request. + +.PP +\fB\-\-password\fP="" + Password for basic authentication to the API server. + +.PP +\fB\-s\fP, \fB\-\-server\fP="" + The address and port of the Kubernetes API server + +.PP +\fB\-\-stderrthreshold\fP=2 + logs at or above this threshold go to stderr + +.PP +\fB\-\-token\fP="" + Bearer token for authentication to the API server. + +.PP +\fB\-\-user\fP="" + The name of the kubeconfig user to use + +.PP +\fB\-\-username\fP="" + Username for basic authentication to the API server. + +.PP +\fB\-\-v\fP=0 + log level for V logs + +.PP +\fB\-\-vmodule\fP= + comma\-separated list of pattern=N settings for file\-filtered logging + + +.SH EXAMPLE +.PP +.RS + +.nf +# Resume an already paused deployment +$ kubectl rollout resume deployment/nginx + +.fi +.RE + + +.SH SEE ALSO +.PP +\fBkubectl\-rollout(1)\fP, + + +.SH HISTORY +.PP +January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/docs/man/man1/kubectl-rollout-undo.1 b/docs/man/man1/kubectl-rollout-undo.1 new file mode 100644 index 00000000000..c976f355dd9 --- /dev/null +++ b/docs/man/man1/kubectl-rollout-undo.1 @@ -0,0 +1,142 @@ +.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" + + +.SH NAME +.PP +kubectl rollout undo \- undoes a previous rollout + + +.SH SYNOPSIS +.PP +\fBkubectl rollout undo\fP [OPTIONS] + + +.SH DESCRIPTION +.PP +undo rolls back to a previous rollout. + + +.SH OPTIONS +.PP +\fB\-f\fP, \fB\-\-filename\fP=[] + Filename, directory, or URL to a file identifying the resource to get from a server. + +.PP +\fB\-\-to\-revision\fP=0 + The revision to rollback to. Default to 0 (last revision). + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB\-\-alsologtostderr\fP=false + log to standard error as well as files + +.PP +\fB\-\-api\-version\fP="" + The API version to use when talking to the server + +.PP +\fB\-\-certificate\-authority\fP="" + Path to a cert. file for the certificate authority. + +.PP +\fB\-\-client\-certificate\fP="" + Path to a client certificate file for TLS. + +.PP +\fB\-\-client\-key\fP="" + Path to a client key file for TLS. + +.PP +\fB\-\-cluster\fP="" + The name of the kubeconfig cluster to use + +.PP +\fB\-\-context\fP="" + The name of the kubeconfig context to use + +.PP +\fB\-\-insecure\-skip\-tls\-verify\fP=false + If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + +.PP +\fB\-\-kubeconfig\fP="" + Path to the kubeconfig file to use for CLI requests. + +.PP +\fB\-\-log\-backtrace\-at\fP=:0 + when logging hits line file:N, emit a stack trace + +.PP +\fB\-\-log\-dir\fP="" + If non\-empty, write log files in this directory + +.PP +\fB\-\-log\-flush\-frequency\fP=5s + Maximum number of seconds between log flushes + +.PP +\fB\-\-logtostderr\fP=true + log to standard error instead of files + +.PP +\fB\-\-match\-server\-version\fP=false + Require server version to match client version + +.PP +\fB\-\-namespace\fP="" + If present, the namespace scope for this CLI request. + +.PP +\fB\-\-password\fP="" + Password for basic authentication to the API server. + +.PP +\fB\-s\fP, \fB\-\-server\fP="" + The address and port of the Kubernetes API server + +.PP +\fB\-\-stderrthreshold\fP=2 + logs at or above this threshold go to stderr + +.PP +\fB\-\-token\fP="" + Bearer token for authentication to the API server. + +.PP +\fB\-\-user\fP="" + The name of the kubeconfig user to use + +.PP +\fB\-\-username\fP="" + Username for basic authentication to the API server. + +.PP +\fB\-\-v\fP=0 + log level for V logs + +.PP +\fB\-\-vmodule\fP= + comma\-separated list of pattern=N settings for file\-filtered logging + + +.SH EXAMPLE +.PP +.RS + +.nf +# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc + +.fi +.RE + + +.SH SEE ALSO +.PP +\fBkubectl\-rollout(1)\fP, + + +.SH HISTORY +.PP +January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/docs/man/man1/kubectl-rollout.1 b/docs/man/man1/kubectl-rollout.1 index 99e74cb6ab4..d0a73e89b0e 100644 --- a/docs/man/man1/kubectl-rollout.1 +++ b/docs/man/man1/kubectl-rollout.1 @@ -13,7 +13,7 @@ kubectl rollout \- rollout manages a deployment .SH DESCRIPTION .PP -rollout manages a deployment using subcommands +rollout manages a deployment using subcommands like "kubectl rollout undo deployment/abc" .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -110,9 +110,21 @@ rollout manages a deployment using subcommands comma\-separated list of pattern=N settings for file\-filtered logging +.SH EXAMPLE +.PP +.RS + +.nf +# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc + +.fi +.RE + + .SH SEE ALSO .PP -\fBkubectl(1)\fP, \fBkubectl\-rollout\-history(1)\fP, +\fBkubectl(1)\fP, \fBkubectl\-rollout\-history(1)\fP, \fBkubectl\-rollout\-pause(1)\fP, \fBkubectl\-rollout\-resume(1)\fP, \fBkubectl\-rollout\-undo(1)\fP, .SH HISTORY diff --git a/docs/man/man1/kubectl-run.1 b/docs/man/man1/kubectl-run.1 index bea0069e3b1..6ea50079706 100644 --- a/docs/man/man1/kubectl-run.1 +++ b/docs/man/man1/kubectl-run.1 @@ -84,6 +84,10 @@ Creates a replication controller or job to manage the created container(s). \fB\-\-port\fP=\-1 The port that this container exposes. If \-\-expose is true, this is also the port used by the service that is created. +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-r\fP, \fB\-\-replicas\fP=1 Number of replicas to create for this container. Default is 1. @@ -116,6 +120,10 @@ Creates a replication controller or job to manage the created container(s). \fB\-a\fP, \fB\-\-show\-all\fP=false When printing, show all resources (default hide terminated pods.) +.PP +\fB\-\-show\-labels\fP=false + When printing, show all labels as the last column (default hide labels column) + .PP \fB\-\-sort\-by\fP="" If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. diff --git a/docs/man/man1/kubectl-scale.1 b/docs/man/man1/kubectl-scale.1 index cea0bafa123..92b4f2daaf9 100644 --- a/docs/man/man1/kubectl-scale.1 +++ b/docs/man/man1/kubectl-scale.1 @@ -35,6 +35,10 @@ scale is sent to the server. \fB\-o\fP, \fB\-\-output\fP="" Output mode. Use "\-o name" for shorter output (resource/name). +.PP +\fB\-\-record\fP=false + Record current kubectl command in the resource annotation. + .PP \fB\-\-replicas\fP=\-1 The new desired number of replicas. Required. diff --git a/docs/proposals/deployment.md b/docs/proposals/deployment.md index 991ea5e790a..777d159764c 100644 --- a/docs/proposals/deployment.md +++ b/docs/proposals/deployment.md @@ -71,7 +71,7 @@ type DeploymentSpec struct { // Label selector for pods. Existing ReplicationControllers whose pods are // selected by this will be scaled down. New ReplicationControllers will be - // created with this selector, with a unique label as defined by UniqueLabelKey. + // created with this selector, with a unique label `pod-template-hash`. // If Selector is empty, it is defaulted to the labels present on the Pod template. Selector map[string]string @@ -80,15 +80,6 @@ type DeploymentSpec struct { // The deployment strategy to use to replace existing pods with new ones. Strategy DeploymentStrategy - - // Key of the selector that is added to existing RCs (and label key that is - // added to its pods) to prevent the existing RCs to select new pods (and old - // pods being selected by new RC). - // Users can set this to an empty string to indicate that the system should - // not add any selector and label. If unspecified, system uses - // "deployment.kubernetes.io/podTemplateHash". - // Value of this key is hash of DeploymentSpec.PodTemplateSpec. - UniqueLabelKey *string } type DeploymentStrategy struct { @@ -170,7 +161,7 @@ For each pending deployment, it will: selector to all these RCs (and the corresponding label to their pods) to ensure that they do not select the newly created pods (or old pods get selected by new RC). - - The label key will be "deployment.kubernetes.io/podTemplateHash". + - The label key will be "pod-template-hash". - The label value will be hash of the podTemplateSpec for that RC without this label. This value will be unique for all RCs, since PodTemplateSpec should be unique. - If the RCs and pods dont already have this label and selector: @@ -178,10 +169,10 @@ For each pending deployment, it will: ensure that all new pods that they create will have this label. - Then we will add this label to their existing pods and then add this as a selector to that RC. -3. Find if there exists an RC for which value of "deployment.kubernetes.io/podTemplateHash" label +3. Find if there exists an RC for which value of "pod-template-hash" label is same as hash of DeploymentSpec.PodTemplateSpec. If it exists already, then this is the RC that will be ramped up. If there is no such RC, then we create - a new one using DeploymentSpec and then add a "deployment.kubernetes.io/podTemplateHash" label + a new one using DeploymentSpec and then add a "pod-template-hash" label to it. RCSpec.replicas = 0 for a newly created RC. 4. Scale up the new RC and scale down the olds ones as per the DeploymentStrategy. - Raise an event if we detect an error, like new pods failing to come up. diff --git a/docs/proposals/job.md b/docs/proposals/job.md index 202e39ac227..36e7a760605 100644 --- a/docs/proposals/job.md +++ b/docs/proposals/job.md @@ -179,12 +179,13 @@ Job controller will be emitting the following events: ## Future evolution Below are the possible future extensions to the Job controller: -* Be able to limit the execution time for a job, similarly to ActiveDeadlineSeconds for Pods. -* Be able to create a chain of jobs dependent one on another. +* Be able to limit the execution time for a job, similarly to ActiveDeadlineSeconds for Pods. *now implemented* +* Be able to create a chain of jobs dependent one on another. *will be implemented in a separate type called Workflow* * Be able to specify the work each of the workers should execute (see type 1 from [this comment](https://github.com/kubernetes/kubernetes/issues/1624#issuecomment-97622142)) * Be able to inspect Pods running a Job, especially after a Job has finished, e.g. by providing pointers to Pods in the JobStatus ([see comment](https://github.com/kubernetes/kubernetes/pull/11746/files#r37142628)). +* help users avoid non-unique label selectors ([see this proposal](selector-generation.md)) diff --git a/docs/proposals/pleg.png b/docs/proposals/pleg.png new file mode 100644 index 00000000000..f15c5d83dad Binary files /dev/null and b/docs/proposals/pleg.png differ diff --git a/docs/proposals/pod-cache.png b/docs/proposals/pod-cache.png new file mode 100644 index 00000000000..dee86c40cb0 Binary files /dev/null and b/docs/proposals/pod-cache.png differ diff --git a/docs/proposals/pod-lifecycle-event-generator.md b/docs/proposals/pod-lifecycle-event-generator.md new file mode 100644 index 00000000000..cec047de182 --- /dev/null +++ b/docs/proposals/pod-lifecycle-event-generator.md @@ -0,0 +1,230 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# Kubelet: Pod Lifecycle Event Generator (PLEG) + +In Kubernetes, Kubelet is a per-node daemon that manages the pods on the node, +driving the pod states to match their pod specifications (specs). To achieve +this, Kubelet needs to react to changes in both (1) pod specs and (2) the +container states. For the former, Kubelet watches the pod specs changes from +multiple sources; for the latter, Kubelet polls the container runtime +periodically (e.g., 10s) for the latest states for all containers. + +Polling incurs non-negligible overhead as the number of pods/containers increases, +and is exacerbated by Kubelet's parallelism -- one worker (goroutine) per pod, which +queries the container runtime individually. Periodic, concurrent, large number +of requests causes high CPU usage spikes (even when there is no spec/state +change), poor performance, and reliability problems due to overwhelmed container +runtime. Ultimately, it limits Kubelet's scalability. + +(Related issues reported by users: [#10451](https://issues.k8s.io/10451), +[#12099](https://issues.k8s.io/12099), [#12082](https://issues.k8s.io/12082)) + +## Goals and Requirements + +The goal of this proposal is to improve Kubelet's scalability and performance +by lowering the pod management overhead. + - Reduce unnecessary work during inactivity (no spec/state changes) + - Lower the concurrent requests to the container runtime. + +The design should be generic so that it can support different container runtimes +(e.g., Docker and rkt). + +## Overview + +This proposal aims to replace the periodic polling with a pod lifecycle event +watcher. + +![pleg](pleg.png) + +## Pod Lifecycle Event + +A pod lifecycle event interprets the underlying container state change at the +pod-level abstraction, making it container-runtime-agnostic. The abstraction +shields Kubelet from the runtime specifics. + +```go +type PodLifeCycleEventType string + +const ( + ContainerStarted PodLifeCycleEventType = "ContainerStarted" + ContainerStopped PodLifeCycleEventType = "ContainerStopped" + NetworkSetupCompleted PodLifeCycleEventType = "NetworkSetupCompleted" + NetworkFailed PodLifeCycleEventType = "NetworkFailed" +) + +// PodLifecycleEvent is an event reflects the change of the pod state. +type PodLifecycleEvent struct { + // The pod ID. + ID types.UID + // The type of the event. + Type PodLifeCycleEventType + // The accompanied data which varies based on the event type. + Data interface{} +} +``` + +Using Docker as an example, starting of a POD infra container would be +translated to a NetworkSetupCompleted`pod lifecycle event. + + +## Detect Changes in Container States Via Relisting + +In order to generate pod lifecycle events, PLEG needs to detect changes in +container states. We can achieve this by periodically relisting all containers +(e.g., docker ps). Although this is similar to Kubelet's polling today, it will +only be performed by a single thread (PLEG). This means that we still +benefit from not having all pod workers hitting the container runtime +concurrently. Moreover, only the relevant pod worker would be woken up +to perform a sync. + +The upside of relying on relisting is that it is container runtime-agnostic, +and requires no external dependency. + +### Relist period + +The shorter the relist period is, the sooner that Kubelet can detect the +change. Shorter relist period also implies higher cpu usage. Moreover, the +relist latency depends on the underlying container runtime, and usually +increases as the number of containers/pods grows. We should set a default +relist period based on measurements. Regardless of what period we set, it will +likely be significantly shorter than the current pod sync period (10s), i.e., +Kubelet will detect container changes sooner. + + +## Impact on the Pod Worker Control Flow + +Kubelet is responsible for dispatching an event to the appropriate pod +worker based on the pod ID. Only one pod worker would be woken up for +each event. + +Today, the pod syncing routine in Kubelet is idempotent as it always +examines the pod state and the spec, and tries to drive to state to +match the spec by performing a series of operations. It should be +noted that this proposal does not intend to change this property -- +the sync pod routine would still perform all necessary checks, +regardless of the event type. This trades some efficiency for +reliability and eliminate the need to build a state machine that is +compatible with different runtimes. + +## Leverage Upstream Container Events + +Instead of relying on relisting, PLEG can leverage other components which +provide container events, and translate these events into pod lifecycle +events. This will further improve Kubelet's responsiveness and reduce the +resource usage caused by frequent relisting. + +The upstream container events can come from: + +(1). *Event stream provided by each container runtime* + +Docker's API exposes an [event +stream](https://docs.docker.com/reference/api/docker_remote_api_v1.17/#monitor-docker-s-events). +Nonetheless, rkt does not support this yet, but they will eventually support it +(see [coreos/rkt#1193](https://github.com/coreos/rkt/issues/1193)). + +(2). *cgroups event stream by cAdvisor* + +cAdvisor is integrated in Kubelet to provide container stats. It watches cgroups +containers using inotify and exposes an event stream. Even though it does not +support rkt yet, it should be straightforward to add such a support. + +Option (1) may provide richer sets of events, but option (2) has the advantage +to be more universal across runtimes, as long as the container runtime uses +cgroups. Regardless of what one chooses to implement now, the container event +stream should be easily swappable with a clearly defined interface. + +Note that we cannot solely rely on the upstream container events due to the +possibility of missing events. PLEG should relist infrequently to ensure no +events are missed. + +## Generate Expected Events + +*This is optional for PLEGs which performs only relisting, but required for +PLEGs that watch upstream events.* + +A pod worker's actions could lead to pod lifecycle events (e.g., +create/kill a container), which the worker would not observe until +later. The pod worker should ignore such events to avoid unnecessary +work. + +For example, assume a pod has two containers, A and B. The worker + + - Creates container A + - Receives an event `(ContainerStopped, B)` + - Receives an event `(ContainerStarted, A)` + + +The worker should ignore the `(ContainerStarted, A)` event since it is +expected. Arguably, the worker could process `(ContainerStopped, B)` +as soon as it receives the event, before observing the creation of +A. However, it is desirable to wait until the expected event +`(ContainerStarted, A)` is observed to keep a consistent per-pod view +at the worker. Therefore, the control flow of a single pod worker +should adhere to the following rules: + +1. Pod worker should process the events sequentially. +2. Pod worker should not start syncing until it observes the outcome of its own + actions in the last sync to maintain a consistent view. + +In other words, a pod worker should record the expected events, and +only wake up to perform the next sync until all expectations are met. + + - Creates container A, records an expected event `(ContainerStarted, A)` + - Receives `(ContainerStopped, B)`; stores the event and goes back to sleep. + - Receives `(ContainerStarted, A)`; clears the expectation. Proceeds to handle + `(ContainerStopped, B)`. + +We should set an expiration time for each expected events to prevent the worker +from being stalled indefinitely by missing events. + +## TODOs for v1.2 + +For v1.2, we will add a generic PLEG which relists periodically, and leave +adopting container events for future work. We will also *not* implement the +optimization that generate and filters out expected events to minimize +redundant syncs. + +- Add a generic PLEG using relisting. Modify the container runtime interface + to provide all necessary information to detect container state changes + in `GetPods()` (#13571). + +- Benchmark docker to adjust relising frequency. + +- Fix/adapt features that rely on frequent, periodic pod syncing. + * Liveness/Readiness probing: Create a separate probing manager using + explicitly container probing period [#10878](https://issues.k8s.io/10878). + * Instruct pod workers to set up a wake-up call if syncing failed, so that + it can retry. + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/pod-lifecycle-event-generator.md?pixel)]() + diff --git a/docs/proposals/runtime-pod-cache.md b/docs/proposals/runtime-pod-cache.md new file mode 100644 index 00000000000..02d43ba0d90 --- /dev/null +++ b/docs/proposals/runtime-pod-cache.md @@ -0,0 +1,202 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# Kubelet: Runtime Pod Cache + +This proposal builds on top of the Pod Lifecycle Event Generator (PLEG) proposed +in [#12802](https://issues.k8s.io/12802). It assumes that Kubelet subscribes to +the pod lifecycle event stream to eliminate periodic polling of pod +states. Please see [#12802](https://issues.k8s.io/12802). for the motivation and +design concept for PLEG. + +Runtime pod cache is an in-memory cache which stores the *status* of +all pods, and is maintained by PLEG. It serves as a single source of +truth for internal pod status, freeing Kubelet from querying the +container runtime. + +## Motivation + +With PLEG, Kubelet no longer needs to perform comprehensive state +checking for all pods periodically. It only instructs a pod worker to +start syncing when there is a change of its pod status. Nevertheless, +during each sync, a pod worker still needs to construct the pod status +by examining all containers (whether dead or alive) in the pod, due to +the lack of the caching of previous states. With the integration of +pod cache, we can further improve Kubelet's CPU usage by + + 1. Lowering the number of concurrent requests to the container + runtime since pod workers no longer have to query the runtime + individually. + 2. Lowering the total number of inspect requests because there is no + need to inspect containers with no state changes. + +***Don't we already have a [container runtime cache] +(https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/container/runtime_cache.go)?*** + +The runtime cache is an optimization that reduces the number of `GetPods()` +calls from the workers. However, + + * The cache does not store all information necessary for a worker to + complete a sync (e.g., `docker inspect`); workers still need to inspect + containers individually to generate `api.PodStatus`. + * Workers sometimes need to bypass the cache in order to retrieve the + latest pod state. + +This proposal generalizes the cache and instructs PLEG to populate the cache, so +that the content is always up-to-date. + +**Why can't each worker cache its own pod status?** + +The short answer is yes, they can. The longer answer is that localized +caching limits the use of the cache content -- other components cannot +access it. This often leads to caching at multiple places and/or passing +objects around, complicating the control flow. + +## Runtime Pod Cache + +![pod cache](pod-cache.png) + +Pod cache stores the `PodStatus` for all pods on the node. `PodStatus` encompasses +all the information required from the container runtime to generate +`api.PodStatus` for a pod. + +```go +// PodStatus represents the status of the pod and its containers. +// api.PodStatus can be derived from examining PodStatus and api.Pod. +type PodStatus struct { + ID types.UID + Name string + Namespace string + IP string + ContainerStatuses []*ContainerStatus +} + +// ContainerStatus represents the status of a container. +type ContainerStatus struct { + ID ContainerID + Name string + State ContainerState + CreatedAt time.Time + StartedAt time.Time + FinishedAt time.Time + ExitCode int + Image string + ImageID string + Hash uint64 + RestartCount int + Reason string + Message string +} +``` + +`PodStatus` is defined in the container runtime interface, hence is +runtime-agnostic. + +PLEG is responsible for updating the entries pod cache, hence always keeping +the cache up-to-date. + +1. Detect change of container state +2. Inspect the pod for details +3. Update the pod cache with the new PodStatus + - If there is no real change of the pod entry, do nothing + - Otherwise, generate and send out the corresponding pod lifecycle event + +Note that in (3), PLEG can check if there is any disparity between the old +and the new pod entry to filter out duplicated events if needed. + +### Evict cache entries + +Note that the cache represents all the pods/containers known by the container +runtime. A cache entry should only be evicted if the pod is no longer visible +by the container runtime. PLEG is responsible for deleting entries in the +cache. + +### Generate `api.PodStatus` + +Because pod cache stores the up-to-date `PodStatus` of the pods, Kubelet can +generate the `api.PodStatus` by interpreting the cache entry at any +time. To avoid sending intermediate status (e.g., while a pod worker +is restarting a container), we will instruct the pod worker to generate a new +status at the beginning of each sync. + +### Cache contention + +Cache contention should not be a problem when the number of pods is +small. When Kubelet scales, we can always shard the pods by ID to +reduce contention. + +### Disk management + +The pod cache is not capable to fulfill the needs of container/image garbage +collectors as they may demand more than pod-level information. These components +will still need to query the container runtime directly at times. We may +consider extending the cache for these use cases, but they are beyond the scope +of this proposal. + + +## Impact on Pod Worker Control Flow + +A pod worker may perform various operations (e.g., start/kill a container) +during a sync. They will expect to see the results of such operations reflected +in the cache in the next sync. Alternately, they can bypass the cache and +query the container runtime directly to get the latest status. However, this +is not desirable since the cache is introduced exactly to eliminate unnecessary, +concurrent queries. Therefore, a pod worker should be blocked until all expected +results have been updated to the cache by PLEG. + +Depending on the type of PLEG (see [#12802](https://issues.k8s.io/12802)) in +use, the methods to check whether a requirement is met can differ. For a +PLEG that solely relies on relisting, a pod worker can simply wait until the +relist timestamp is newer than the end of the worker's last sync. On the other +hand, if pod worker knows what events to expect, they can also block until the +events are observed. + +It should be noted that `api.PodStatus` will only be generated by the pod +worker *after* the cache has been updated. This means that the perceived +responsiveness of Kubelet (from querying the API server) will be affected by +how soon the cache can be populated. For the pure-relisting PLEG, the relist +period can become the bottleneck. On the other hand, A PLEG which watches the +upstream event stream (and knows how what events to expect) is not restricted +by such periods and should improve Kubelet's perceived responsiveness. + +## TODOs for v1.2 + + - Redefine container runtime types ([#12619](https://issues.k8s.io/12619)): + and introduce `PodStatus`. Refactor dockertools and rkt to use the new type. + + - Add cache and instruct PLEG to populate it. + + - Refactor Kubelet to use the cache. + + - Deprecate the old runtime cache. + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/runtime-pod-cache.md?pixel)]() + diff --git a/docs/proposals/security-context-constraints.md b/docs/proposals/security-context-constraints.md new file mode 100644 index 00000000000..8a2efd8d4e7 --- /dev/null +++ b/docs/proposals/security-context-constraints.md @@ -0,0 +1,377 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +## Abstract + +PodSecurityPolicy allows cluster administrators to control the creation and validation of a security +context for a pod and containers. + +## Motivation + +Administration of a multi-tenant cluster requires the ability to provide varying sets of permissions +among the tenants, the infrastructure components, and end users of the system who may themselves be +administrators within their own isolated namespace. + +Actors in a cluster may include infrastructure that is managed by administrators, infrastructure +that is exposed to end users (builds, deployments), the isolated end user namespaces in the cluster, and +the individual users inside those namespaces. Infrastructure components that operate on behalf of a +user (builds, deployments) should be allowed to run at an elevated level of permissions without +granting the user themselves an elevated set of permissions. + +## Goals + +1. Associate [service accounts](http://docs.k8s.io/design/service_accounts.md), groups, and users with +a set of constraints that dictate how a security context is established for a pod and the pod's containers. +1. Provide the ability for users and infrastructure components to run pods with elevated privileges +on behalf of another user or within a namespace where privileges are more restrictive. +1. Secure the ability to reference elevated permissions or to change the constraints under which +a user runs. + +## Use Cases + +Use case 1: +As an administrator, I can create a namespace for a person that can't create privileged containers +AND enforce that the UID of the containers is set to a certain value + +Use case 2: +As a cluster operator, an infrastructure component should be able to create a pod with elevated +privileges in a namespace where regular users cannot create pods with these privileges or execute +commands in that pod. + +Use case 3: +As a cluster administrator, I can allow a given namespace (or service account) to create privileged +pods or to run root pods + +Use case 4: +As a cluster administrator, I can allow a project administrator to control the security contexts of +pods and service accounts within a project + + +## Requirements + +1. Provide a set of restrictions that controls how a security context is created for pods and containers +as a new cluster-scoped object called `PodSecurityPolicy`. +1. User information in `user.Info` must be available to admission controllers. (Completed in +https://github.com/GoogleCloudPlatform/kubernetes/pull/8203) +1. Some authorizers may restrict a user’s ability to reference a service account. Systems requiring +the ability to secure service accounts on a user level must be able to add a policy that enables +referencing specific service accounts themselves. +1. Admission control must validate the creation of Pods against the allowed set of constraints. + +## Design + +### Model + +PodSecurityPolicy objects exist in the root scope, outside of a namespace. The +PodSecurityPolicy will reference users and groups that are allowed +to operate under the constraints. In order to support this, `ServiceAccounts` must be mapped +to a user name or group list by the authentication/authorization layers. This allows the security +context to treat users, groups, and service accounts uniformly. + +Below is a list of PodSecurityPolicies which will likely serve most use cases: + +1. A default policy object. This object is permissioned to something which covers all actors, such +as a `system:authenticated` group, and will likely be the most restrictive set of constraints. +1. A default constraints object for service accounts. This object can be identified as serving +a group identified by `system:service-accounts`, which can be imposed by the service account authenticator / token generator. +1. Cluster admin constraints identified by `system:cluster-admins` group - a set of constraints with elevated privileges that can be used +by an administrative user or group. +1. Infrastructure components constraints which can be identified either by a specific service +account or by a group containing all service accounts. + +```go +// PodSecurityPolicy governs the ability to make requests that affect the SecurityContext +// that will be applied to a pod and container. +type PodSecurityPolicy struct { + unversioned.TypeMeta `json:",inline"` + api.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the policy enforced. + Spec PodSecurityPolicySpec `json:"spec,omitempty"` +} + +// PodSecurityPolicySpec defines the policy enforced. +type PodSecurityPolicySpec struct { + // Privileged determines if a pod can request to be run as privileged. + Privileged bool `json:"privileged,omitempty"` + // Capabilities is a list of capabilities that can be added. + Capabilities []api.Capability `json:"capabilities,omitempty"` + // Volumes allows and disallows the use of different types of volume plugins. + Volumes VolumeSecurityPolicy `json:"volumes,omitempty"` + // HostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + HostNetwork bool `json:"hostNetwork,omitempty"` + // HostPorts determines which host port ranges are allowed to be exposed. + HostPorts []HostPortRange `json:"hostPorts,omitempty"` + // HostPID determines if the policy allows the use of HostPID in the pod spec. + HostPID bool `json:"hostPID,omitempty"` + // HostIPC determines if the policy allows the use of HostIPC in the pod spec. + HostIPC bool `json:"hostIPC,omitempty"` + // SELinuxContext is the strategy that will dictate the allowable labels that may be set. + SELinuxContext SELinuxContextStrategyOptions `json:"seLinuxContext,omitempty"` + // RunAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + RunAsUser RunAsUserStrategyOptions `json:"runAsUser,omitempty"` + + // The users who have permissions to use this policy + Users []string `json:"users,omitempty"` + // The groups that have permission to use this policy + Groups []string `json:"groups,omitempty"` +} + +// HostPortRange defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +type HostPortRange struct { + // Start is the beginning of the port range which will be allowed. + Start int `json:"start"` + // End is the end of the port range which will be allowed. + End int `json:"end"` +} + +// VolumeSecurityPolicy allows and disallows the use of different types of volume plugins. +type VolumeSecurityPolicy struct { + // HostPath allows or disallows the use of the HostPath volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#hostpath + HostPath bool `json:"hostPath,omitempty"` + // EmptyDir allows or disallows the use of the EmptyDir volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#emptydir + EmptyDir bool `json:"emptyDir,omitempty"` + // GCEPersistentDisk allows or disallows the use of the GCEPersistentDisk volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk + GCEPersistentDisk bool `json:"gcePersistentDisk,omitempty"` + // AWSElasticBlockStore allows or disallows the use of the AWSElasticBlockStore volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore + AWSElasticBlockStore bool `json:"awsElasticBlockStore,omitempty"` + // GitRepo allows or disallows the use of the GitRepo volume plugin. + GitRepo bool `json:"gitRepo,omitempty"` + // Secret allows or disallows the use of the Secret volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets + Secret bool `json:"secret,omitempty"` + // NFS allows or disallows the use of the NFS volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs + NFS bool `json:"nfs,omitempty"` + // ISCSI allows or disallows the use of the ISCSI volume plugin. + // More info: http://releases.k8s.io/HEAD/examples/iscsi/README.md + ISCSI bool `json:"iscsi,omitempty"` + // Glusterfs allows or disallows the use of the Glusterfs volume plugin. + // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md + Glusterfs bool `json:"glusterfs,omitempty"` + // PersistentVolumeClaim allows or disallows the use of the PersistentVolumeClaim volume plugin. + // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims + PersistentVolumeClaim bool `json:"persistentVolumeClaim,omitempty"` + // RBD allows or disallows the use of the RBD volume plugin. + // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md + RBD bool `json:"rbd,omitempty"` + // Cinder allows or disallows the use of the Cinder volume plugin. + // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md + Cinder bool `json:"cinder,omitempty"` + // CephFS allows or disallows the use of the CephFS volume plugin. + CephFS bool `json:"cephfs,omitempty"` + // DownwardAPI allows or disallows the use of the DownwardAPI volume plugin. + DownwardAPI bool `json:"downwardAPI,omitempty"` + // FC allows or disallows the use of the FC volume plugin. + FC bool `json:"fc,omitempty"` +} + +// SELinuxContextStrategyOptions defines the strategy type and any options used to create the strategy. +type SELinuxContextStrategyOptions struct { + // Type is the strategy that will dictate the allowable labels that may be set. + Type SELinuxContextStrategy `json:"type"` + // seLinuxOptions required to run as; required for MustRunAs + // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context + SELinuxOptions *api.SELinuxOptions `json:"seLinuxOptions,omitempty"` +} + +// SELinuxContextStrategyType denotes strategy types for generating SELinux options for a +// SecurityContext. +type SELinuxContextStrategy string + +const ( + // container must have SELinux labels of X applied. + SELinuxStrategyMustRunAs SELinuxContextStrategy = "MustRunAs" + // container may make requests for any SELinux context labels. + SELinuxStrategyRunAsAny SELinuxContextStrategy = "RunAsAny" +) + +// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. +type RunAsUserStrategyOptions struct { + // Type is the strategy that will dictate the allowable RunAsUser values that may be set. + Type RunAsUserStrategy `json:"type"` + // UID is the user id that containers must run as. Required for the MustRunAs strategy if not using + // a strategy that supports pre-allocated uids. + UID *int64 `json:"uid,omitempty"` + // UIDRangeMin defines the min value for a strategy that allocates by a range based strategy. + UIDRangeMin *int64 `json:"uidRangeMin,omitempty"` + // UIDRangeMax defines the max value for a strategy that allocates by a range based strategy. + UIDRangeMax *int64 `json:"uidRangeMax,omitempty"` +} + +// RunAsUserStrategyType denotes strategy types for generating RunAsUser values for a +// SecurityContext. +type RunAsUserStrategy string + +const ( + // container must run as a particular uid. + RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs" + // container must run as a particular uid. + RunAsUserStrategyMustRunAsRange RunAsUserStrategy = "MustRunAsRange" + // container must run as a non-root uid + RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot" + // container may make requests for any uid. + RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny" +) +``` + +### PodSecurityPolicy Lifecycle + +As reusable objects in the root scope, PodSecurityPolicy follows the lifecycle of the +cluster itself. Maintenance of constraints such as adding, assigning, or changing them is the +responsibility of the cluster administrator. + +Creating a new user within a namespace should not require the cluster administrator to +define the user's PodSecurityPolicy. They should receive the default set of policies +that the administrator has defined for the groups they are assigned. + + +## Default PodSecurityPolicy And Overrides + +In order to establish policy for service accounts and users, there must be a way +to identify the default set of constraints that is to be used. This is best accomplished by using +groups. As mentioned above, groups may be used by the authentication/authorization layer to ensure +that every user maps to at least one group (with a default example of `system:authenticated`) and it +is up to the cluster administrator to ensure that a `PodSecurityPolicy` object exists that +references the group. + +If an administrator would like to provide a user with a changed set of security context permissions, +they may do the following: + +1. Create a new `PodSecurityPolicy` object and add a reference to the user or a group +that the user belongs to. +1. Add the user (or group) to an existing `PodSecurityPolicy` object with the proper +elevated privileges. + +## Admission + +Admission control using an authorizer provides the ability to control the creation of resources +based on capabilities granted to a user. In terms of the `PodSecurityPolicy`, it means +that an admission controller may inspect the user info made available in the context to retrieve +an appropriate set of policies for validation. + +The appropriate set of PodSecurityPolicies is defined as all of the policies +available that have reference to the user or groups that the user belongs to. + +Admission will use the PodSecurityPolicy to ensure that any requests for a +specific security context setting are valid and to generate settings using the following approach: + +1. Determine all the available `PodSecurityPolicy` objects that are allowed to be used +1. Sort the `PodSecurityPolicy` objects in a most restrictive to least restrictive order. +1. For each `PodSecurityPolicy`, generate a `SecurityContext` for each container. The generation phase will not override +any user requested settings in the `SecurityContext`, and will rely on the validation phase to ensure that +the user requests are valid. +1. Validate the generated `SecurityContext` to ensure it falls within the boundaries of the `PodSecurityPolicy` +1. If all containers validate under a single `PodSecurityPolicy` then the pod will be admitted +1. If all containers DO NOT validate under the `PodSecurityPolicy` then try the next `PodSecurityPolicy` +1. If no `PodSecurityPolicy` validates for the pod then the pod will not be admitted + + +## Creation of a SecurityContext Based on PodSecurityPolicy + +The creation of a `SecurityContext` based on a `PodSecurityPolicy` is based upon the configured +settings of the `PodSecurityPolicy`. + +There are three scenarios under which a `PodSecurityPolicy` field may fall: + +1. Governed by a boolean: fields of this type will be defaulted to the most restrictive value. +For instance, `AllowPrivileged` will always be set to false if unspecified. + +1. Governed by an allowable set: fields of this type will be checked against the set to ensure +their value is allowed. For example, `AllowCapabilities` will ensure that only capabilities +that are allowed to be requested are considered valid. `HostNetworkSources` will ensure that +only pods created from source X are allowed to request access to the host network. +1. Governed by a strategy: Items that have a strategy to generate a value will provide a +mechanism to generate the value as well as a mechanism to ensure that a specified value falls into +the set of allowable values. See the Types section for the description of the interfaces that +strategies must implement. + +Strategies have the ability to become dynamic. In order to support a dynamic strategy it should be +possible to make a strategy that has the ability to either be pre-populated with dynamic data by +another component (such as an admission controller) or has the ability to retrieve the information +itself based on the data in the pod. An example of this would be a pre-allocated UID for the namespace. +A dynamic `RunAsUser` strategy could inspect the namespace of the pod in order to find the required pre-allocated +UID and generate or validate requests based on that information. + + +```go +// SELinuxStrategy defines the interface for all SELinux constraint strategies. +type SELinuxStrategy interface { + // Generate creates the SELinuxOptions based on constraint rules. + Generate(pod *api.Pod, container *api.Container) (*api.SELinuxOptions, error) + // Validate ensures that the specified values fall within the range of the strategy. + Validate(pod *api.Pod, container *api.Container) fielderrors.ValidationErrorList +} + +// RunAsUserStrategy defines the interface for all uid constraint strategies. +type RunAsUserStrategy interface { + // Generate creates the uid based on policy rules. + Generate(pod *api.Pod, container *api.Container) (*int64, error) + // Validate ensures that the specified values fall within the range of the strategy. + Validate(pod *api.Pod, container *api.Container) fielderrors.ValidationErrorList +} +``` + +## Escalating Privileges by an Administrator + +An administrator may wish to create a resource in a namespace that runs with +escalated privileges. By allowing security context +constraints to operate on both the requesting user and the pod's service account, administrators are able to +create pods in namespaces with elevated privileges based on the administrator's security context +constraints. + +This also allows the system to guard commands being executed in the non-conforming container. For +instance, an `exec` command can first check the security context of the pod against the security +context constraints of the user or the user's ability to reference a service account. +If it does not validate then it can block users from executing the command. Since the validation +will be user aware, administrators would still be able to run the commands that are restricted to normal users. + +## Interaction with the Kubelet + +In certain cases, the Kubelet may need provide information about +the image in order to validate the security context. An example of this is a cluster +that is configured to run with a UID strategy of `MustRunAsNonRoot`. + +In this case the admission controller can set the existing `MustRunAsNonRoot` flag on the `SecurityContext` +based on the UID strategy of the `SecurityPolicy`. It should still validate any requests on the pod +for a specific UID and fail early if possible. However, if the `RunAsUser` is not set on the pod +it should still admit the pod and allow the Kubelet to ensure that the image does not run as +`root` with the existing non-root checks. + + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/security-context-constraints.md?pixel)]() + diff --git a/docs/proposals/selector-generation.md b/docs/proposals/selector-generation.md new file mode 100644 index 00000000000..27107c31291 --- /dev/null +++ b/docs/proposals/selector-generation.md @@ -0,0 +1,133 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +Proposed Design +============= + +# Goals + +Make it really hard to accidentally create a job which has an overlapping selector, while still making it possible to chose an arbitrary selector, and without adding complex constraint solving to the APIserver. + +# Use Cases + +1. user can leave all label and selector fields blank and system will fill in reasonable ones: non-overlappingness guaranteed. +2. user can put on the pod template some labels that are useful to the user, without reasoning about non-overlappingness. System adds additional label to assure not overlapping. +3. If user wants to reparent pods to new job (very rare case) and knows what they are doing, they can completely disable this behavior and specify explicit selector. +4. If a controller that makes jobs, like scheduled job, wants to use different labels, such as the time and date of the run, it can do that. +5. If User reads v1beta1 documentation or reuses v1beta1 Job definitions and just changes the API group, the user should not automatically be allowed to specify a selector, since this is very rarely what people want to do and is error prone. +6. If User downloads an existing job definition, e.g. with `kubectl get jobs/old -o yaml` and tries to modify and post it, he should not create an overlapping job. +7. If User downloads an existing job definition, e.g. with `kubectl get jobs/old -o yaml` and tries to modify and post it, and he accidentally copies the uniquifying label from the old one, then he should not get an error from a label-key conflict, nor get erratic behavior. +8. If user reads swagger docs and sees the selector field, he should not be able to set it without realizing the risks. +8. (Deferred requirement:) If user wants to specify a preferred name for the non-overlappingness key, they can pick a name. + +# Proposed changes + +## APIserver + +`extensions/v1beta1 Job` remains the same. `batch/v1 Job` changes change as follows. + +There are two allowed usage modes: + +### Automatic Mode + +- User does not specify `job.spec.selector`. +- User is probably unaware of the `job.spec.noAutoSelector` field and does not think about it. +- User optionally puts labels on pod template (optional). user does not think about uniqueness, just labeling for user's own reasons. +- Defaulting logic sets `job.spec.selector` to `matchLabels["controller-uid"]="$UIDOFJOB"` +- Defaulting logic appends 2 labels to the `.spec.template.metadata.labels`. + - The first label is controller-uid=$UIDOFJOB. + - The second label is "job-name=$NAMEOFJOB". + +### Manual Mode + +- User means User or Controller for the rest of this list. +- User does specify `job.spec.selector`. +- User does specify `job.spec.noAutoSelector=true` +- User puts a unique label or label(s) on pod template (required). user does think carefully about uniqueness. +- No defaulting of pod labels or the selector happen. + +### Common to both modes + +- Validation code ensures that the selector on the job selects the labels on the pod template, and rejects if not. + +### Rationale + +UID is better than Name in that: +- it allows cross-namespace control someday if we need it. +- it is unique across all kinds. `controller-name=foo` does not ensure uniqueness across Kinds `job` vs `replicaSet`. Even `job-name=foo` has a problem: you might have a `batch.Job` and a `snazzyjob.io/types.Job` -- the latter cannot use label `job-name=foo`, though there is a temptation to do so. +- it uniquely identifies the controller across time. This prevents the case where, for example, someone deletes a job via the REST api or client (where cascade=false), leaving pods around. We don't want those to be picked up unintentionally. It also prevents the case where a user looks at an old job that finished but is not deleted, and tries to select its pods, and gets the wrong impression that it is still running. + +Job name is more user friendly. It is self documenting + +Commands like `kubectl get pods -l job-name=myjob` should do exactly what is wanted 99.9% of the time. Automated control loops should still use the controller-uid=label. + +Using both gets the benefits of both, at the cost of some label verbosity. + +### Overriding Unique Labels + +If user does specify `job.spec.selector` then the user must also specify `job.spec.noAutoSelector`. +This ensures the user knows that what he is doing is not the normal thing to do. + +To prevent users from copying the `job.spec.noAutoSelector` flag from existing jobs, it will be +optional and default to false, which means when you ask GET and existing job back that didn't use this feature, you don't even see the `job.spec.noAutoSelector` flag, so you are not tempted to wonder if you should fiddle with it. + +## Job Controller + +No changes + +## Kubectl + +No required changes. +Suggest moving SELECTOR to wide output of `kubectl get jobs` since users don't write the selector. + +## Docs + +Remove examples that use selector and remove labels from pod templates. +Recommend `kubectl get jobs -l job-name=name` as the way to find pods of a job. + +# Cross Version Compat + +`v1beta1` will not have a `job.spec.noAutoSelector` and will not provide a default selector. + +Conversion from v1beta1 to v1 will use the user-provided selector and set `job.spec.noAutoSelector=true`. + +# Future Work + +Follow this pattern for Deployments, ReplicaSet, DaemonSet when going to v1, if it works well for job. + +Docs will be edited to show examples without a `job.spec.selector`. + +We probably want as much as possible the same behavior for Job and ReplicationController. + + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/selector-generation.md?pixel)]() + diff --git a/docs/proposals/selinux.md b/docs/proposals/selinux.md index 14ce3671f39..27e4087da52 100644 --- a/docs/proposals/selinux.md +++ b/docs/proposals/selinux.md @@ -74,9 +74,9 @@ use-cases: We should avoid using the `:z` flag, because it relaxes the SELinux context so that any container (from an SELinux standpoint) can use the volume. -### Rocket +### rkt -Rocket currently reads the base SELinux context to use from `/etc/selinux/*/contexts/lxc_contexts` +rkt currently reads the base SELinux context to use from `/etc/selinux/*/contexts/lxc_contexts` and allocates a unique MCS label per pod. ### Kubernetes diff --git a/docs/proposals/service-discovery.md b/docs/proposals/service-discovery.md new file mode 100644 index 00000000000..e0551535442 --- /dev/null +++ b/docs/proposals/service-discovery.md @@ -0,0 +1,98 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# Service Discovery Proposal + +## Goal of this document + +To consume a service, a developer needs to know the full URL and a description of the API. Kubernetes contains the host and port information of a service, but it lacks the scheme and the path information needed if the service is not bound at the root. In this document we propose some standard kubernetes service annotations to fix these gaps. It is important that these annotations are a standard to allow for standard service discovery across Kubernetes implementations. Note that the example largely speaks to consuming WebServices but that the same concepts apply to other types of services. + +## Endpoint URL, Service Type + +A URL can accurately describe the location of a Service. A generic URL is of the following form + + scheme:[//[user:password@]host[:port]][/]path[?query][#fragment] + +however for the purpose of service discovery we can simplify this to the following form + + scheme:[//host[:port]][/]path + +If a user and/or password is required then this information can be passed using Kubernetes Secrets. Kubernetes contains the host and port of each service but it lacks the scheme and path. + +`Service Path` - Every Service has one (or more) endpoint. As a rule the endpoint should be located at the root "/" of the localtion URL, i.e. `http://172.100.1.52/`. There are cases where this is not possible and the actual service endpoint could be located at `http://172.100.1.52/cxfcdi`. The Kubernetes metadata for a service does not capture the path part, making it hard to consume this service. + +`Service Scheme` - Services can be deployed using different schemes. Some popular schemes include `http`,`https`,`file`,`ftp` and `jdbc`. + +`Service Protocol` - Services use different protocols that clients need to speak in order to communicate with the service, some examples of service level protocols are SOAP, REST (Yes, technically REST isn’t a protocol but an architectural style). For service consumers it can be hard to tell what protocol is expected. + +## Service Description + +The API of a service is the point of interaction with a service consumer. The description of the API is an essential piece of information at creation time of the service consumer. It has become common to publish a service definition document on a know location on the service itself. This 'well known' place it not very standard, so it is proposed the service developer provides the service description path and the type of Definition Language (DL) used. + +`Service Description Path` - To facilitate the consumption of the service by client, the location this document would be greatly helpful to the service consumer. In some cases the client side code can be generated from such a document. It is assumed that the service description document is published somewhere on the service endpoint itself. + +`Service Description Language` - A number of Definition Languages (DL) have been developed to describe the service. Some of examples are `WSDL`, `WADL` and `Swagger`. In order to consume a decription document it is good to know the type of DL used. + +## Standard Service Annotations + +Kubernetes allows the creation of Service Annotations. Here we propose the use of the following standard annotations + +* `api.service.kubernetes.io/path` - the path part of the service endpoint url. An example value could be `cxfcdi`, +* `api.service.kubernetes.io/scheme` - the scheme part of the service endpoint url. Some values could be `http` or `https`. +* `api.service.kubernetes.io/protocol` - the protocol of the service. Known values are `SOAP`, `XML-RPC` and `REST`, +* `api.service.kubernetes.io/description-path` - the path part of the service description document’s endpoint. It is a pretty safe assumption that the service self-documents. An example value for a swagger 2.0 document can be `cxfcdi/swagger.json`, +* `api.kubernetes.io/description-language` - the type of Description Language used. Known values are `WSDL`, `WADL`, `SwaggerJSON`, `SwaggerYAML`. + +The fragment below is taken from the service section of the kubernetes.json were these annotations are used + + ... + "objects" : [ { + "apiVersion" : "v1", + "kind" : "Service", + "metadata" : { + "annotations" : { + "api.service.kubernetes.io/protocol" : "REST", + "api.service.kubernetes.io/scheme" "http", + "api.service.kubernetes.io/path" : "cxfcdi", + "api.service.kubernetes.io/description-path" : "cxfcdi/swagger.json", + "api.service.kubernetes.io/description-language" : "SwaggerJSON" + }, + ... + +## Conclusion + +Five service annotations are proposed as a standard way to desribe a service endpoint. These five annotation are promoted as a Kubernetes standard, so that services can be discovered and a service catalog can be build to facilitate service consumers. + + + + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/service-discovery.md?pixel)]() + diff --git a/docs/proposals/templates.md b/docs/proposals/templates.md new file mode 100644 index 00000000000..fad8d27b518 --- /dev/null +++ b/docs/proposals/templates.md @@ -0,0 +1,597 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# Templates+Parameterization: Repeatedly instantiating user-customized application topologies. + +## Motivation + +Addresses https://github.com/kubernetes/kubernetes/issues/11492 + +There are two main motivators for Template functionality in Kubernetes: Controller Instantiation and Application Definition + +### Controller Instantiation + +Today the replication controller defines a PodTemplate which allows it to instantiate multiple pods with identical characteristics. +This is useful but limited. Stateful applications have a need to instantiate multiple instances of a more sophisticated topology +than just a single pod (eg they also need Volume definitions). A Template concept would allow a Controller to stamp out multiple +instances of a given Template definition. This capability would be immediately useful to the [PetSet](https://github.com/kubernetes/kubernetes/pull/18016) proposal. + +Similarly the [Service Catalog proposal](https://github.com/kubernetes/kubernetes/pull/17543) could leverage template instantiation as a mechanism for claiming service instances. + + +### Application Definition + +Kubernetes gives developers a platform on which to run images and many configuration objects to control those images, but +constructing a cohesive application made up of images and configuration objects is currently difficult. Applications +require: + +* Information sharing between images (eg one image provides a DB service, another consumes it) +* Configuration/tuning settings (memory sizes, queue limits) +* Unique/customizable identifiers (service names, routes) + +Application authors know which values should be tunable and what information must be shared, but there is currently no +consistent way for an application author to define that set of information so that application consumers can easily deploy +an application and make appropriate decisions about the tunable parameters the author intended to expose. + +Furthermore, even if an application author provides consumers with a set of API object definitions (eg a set of yaml files) +it is difficult to build a UI around those objects that would allow the deployer to modify names in one place without +potentially breaking assumed linkages to other pieces. There is also no prescriptive way to define which configuration +values are appropriate for a deployer to tune or what the parameters control. + +## Use Cases + +### Use cases for templates in general + +* Providing a full baked application experience in a single portable object that can be repeatably deployed in different environments. + * eg Wordpress deployment with separate database pod/replica controller + * Complex service/replication controller/volume topologies +* Bulk object creation +* Provide a management mechanism for deleting/uninstalling an entire set of components related to a single deployed application +* Providing a library of predefined application definitions that users can select from +* Enabling the creation of user interfaces that can guide an application deployer through the deployment process with descriptive help about the configuration value decisions they are making, and useful default values where appropriate +* Exporting a set of objects in a namespace as a template so the topology can be inspected/visualized or recreated in another environment +* Controllers that need to instantiate multiple instances of identical objects (eg PetSets). + + +### Use cases for parameters within templates + +* Share passwords between components (parameter value is provided to each component as an environment variable or as a Secret reference, with the Secret value being parameterized or produced by an [initializer](https://github.com/kubernetes/kubernetes/issues/3585)) +* Allow for simple deployment-time customization of “app” configuration via environment values or api objects, e.g. memory + tuning parameters to a MySQL image, Docker image registry prefix for image strings, pod resource requests and limits, default + scale size. +* Allow simple, declarative defaulting of parameter values and expose them to end users in an approachable way - a parameter + like “MySQL table space” can be parameterized in images as an env var - the template parameters declare the parameter, give + it a friendly name, give it a reasonable default, and informs the user what tuning options are available. +* Customization of component names to avoid collisions and ensure matched labeling (eg replica selector value and pod label are + user provided and in sync). +* Customize cross-component references (eg user provides the name of a secret that already exists in their namespace, to use in + a pod as a TLS cert). +* Provide guidance to users for parameters such as default values, descriptions, and whether or not a particular parameter value + is required or can be left blank. +* Parameterize the replica count of a deployment or [PetSet](https://github.com/kubernetes/kubernetes/pull/18016) +* Parameterize part of the labels and selector for a DaemonSet +* Parameterize quota/limit values for a pod +* Parameterize a secret value so a user can provide a custom password or other secret at deployment time + + +## Design Assumptions + +The goal for this proposal is a simple schema which addresses a few basic challenges: + +* Allow application authors to expose configuration knobs for application deployers, with suggested defaults and +descriptions of the purpose of each knob +* Allow application deployers to easily customize exposed values like object names while maintaining referential integrity + between dependent pieces (for example ensuring a pod's labels always match the corresponding selector definition of the service) +* Support maintaining a library of templates within Kubernetes that can be accessed and instantiated by end users +* Allow users to quickly and repeatedly deploy instances of well-defined application patterns produced by the community +* Follow established Kubernetes API patterns by defining new template related APIs which consume+return first class Kubernetes + API (and therefore json conformant) objects. + +We do not wish to invent a new Turing-complete templating language. There are good options available +(e.g. https://github.com/mustache/mustache) for developers who want a completely flexible and powerful solution for creating +arbitrarily complex templates with parameters, and tooling can be built around such schemes. + +This desire for simplicity also intentionally excludes template composability/embedding as a supported use case. + +Allowing templates to reference other templates presents versioning+consistency challenges along with making the template +no longer a self-contained portable object. Scenarios necessitating multiple templates can be handled in one of several +alternate ways: + +* Explicitly constructing a new template that merges the existing templates (tooling can easily be constructed to perform this + operation since the templates are first class api objects). +* Manually instantiating each template and utilizing [service linking](https://github.com/kubernetes/kubernetes/pull/17543) to share + any necessary configuration data. + +This document will also refrain from proposing server APIs or client implementations. This has been a point of debate, and it makes +more sense to focus on the template/parameter specification/syntax than to worry about the tooling that will process or manage the +template objects. However since there is a desire to at least be able to support a server side implementation, this proposal +does assume the specification will be k8s API friendly. + +## Desired characteristics + +* Fully k8s object json-compliant syntax. This allows server side apis that align with existing k8s apis to be constructed + which consume templates and existing k8s tooling to work with them. It also allows for api versioning/migration to be managed by + the existing k8s codec scheme rather than having to define/introduce a new syntax evolution mechanism. + * (Even if they are not part of the k8s core, it would still be good if a server side template processing+managing api supplied + as an ApiGroup consumed the same k8s object schema as the peer k8s apis rather than introducing a new one) +* Self-contained parameter definitions. This allows a template to be a portable object which includes metadata that describe + the inputs it expects, making it easy to wrapper a user interface around the parameterization flow. + + scheme should support all of those types for substitution. + * complex types (struct/map/list) can be defined in terms of the available primitives, so it's preferred to avoid the complexity + of allowing for full complex-type substitution. +* Parameter metadata. Parameters should include at a minimum, information describing the purpose of the parameter, whether it is + required/optional, and a default/suggested value. Type information could also be required to enable more intelligent client interfaces. +* Template metadata. Templates should be able to include metadata describing their purpose or links to further documentation and + versioning information. Annotations on the Template's metadata field can fulfill this requirement. + + +## Proposed Implementation + +### Overview + +We began by looking at the List object which allows a user to easily group a set of objects together for easy creation via a +single CLI invocation. It also provides a portable format which requires only a single file to represent an application. + +From that starting point, we propose a Template API object which can encapsulate the definition of all components of an +application to be created. The application definition is encapsulated in the form of an array of API objects (identical to +List), plus a parameterization section. Components reference the parameter by name and the value of the parameter is +substituted during a processing step, prior to submitting each component to the appropriate API endpoint for creation. + +The primary capability provided is that parameter values can easily be shared between components, such as a database password +that is provided by the user once, but then attached as an environment variable to both a database pod and a web frontend pod. + +In addition, the template can be repeatedly instantiated for a consistent application deployment experience in different +namespaces or Kubernetes clusters. + +Lastly, we propose the Template API object include a “Labels” section in which the template author can define a set of labels +to be applied to all objects created from the template. This will give the template deployer an easy way to manage all the +components created from a given template. These labels will also be applied to selectors defined by Objects within the template, +allowing a combination of templates and labels to be used to scope resources within a namespace. That is, a given template +can be instantiated multiple times within the same namespace, as long as a different label value is used each for each +instantiation. The resulting objects will be independent from a replica/load-balancing perspective. + +Generation of parameter values for fields such as Secrets will be delegated to an [admission controller/initializer/finalizer](https://github.com/kubernetes/kubernetes/issues/3585) rather than being solved by the template processor. Some discussion about a generation +service is occuring [here](https://github.com/kubernetes/kubernetes/issues/12732) + +Labels to be assigned to all objects could also be generated in addition to, or instead of, allowing labels to be supplied in the +Template definition. + +### API Objects + +**Template Object** + +``` +// Template contains the inputs needed to produce a Config. +type Template struct { + unversioned.TypeMeta + kapi.ObjectMeta + + // Optional: Parameters is an array of Parameters used during the + // Template to Config transformation. + Parameters []Parameter + + // Required: A list of resources to create + Objects []runtime.Object + + // Optional: ObjectLabels is a set of labels that are applied to every + // object during the Template to Config transformation + // These labels are also be applied to selectors defined by objects in the template + ObjectLabels map[string]string +} +``` + +**Parameter Object** + +``` +// Parameter defines a name/value variable that is to be processed during +// the Template to Config transformation. +type Parameter struct { + // Required: Parameter name must be set and it can be referenced in Template + // Items using $(PARAMETER_NAME) + Name string + + // Optional: The name that will show in UI instead of parameter 'Name' + DisplayName string + + // Optional: Parameter can have description + Description string + + // Optional: Value holds the Parameter data. + // The value replaces all occurrences of the Parameter $(Name) or + // $((Name)) expression during the Template to Config transformation. + Value string + + // Optional: Indicates the parameter must have a value. Defaults to false. + Required bool + + // Optional: Type-value of the parameter (one of string, int, bool, or base64) + // Used by clients to provide validation of user input and guide users. + Type ParameterType +} +``` + +As seen above, parameters allow for metadata which can be fed into client implementations to display information about the +parameter’s purpose and whether a value is required. In lieu of type information, two reference styles are offered: `$(PARAM)` +and `$((PARAM))`. When the single parens option is used, the result of the substitution will remain quoted. When the double +parens option is used, the result of the substitution will not be quoted. For example, given a parameter defined with a value +of "BAR", the following behavior will be observed: + +``` +somefield: "$(FOO)" -> somefield: "BAR" +somefield: "$((FOO))" -> somefield: BAR +``` + +// for concatenation, the result value reflects the type of substitution (quoted or unquoted): + +``` +somefield: "prefix_$(FOO)_suffix" -> somefield: "prefix_BAR_suffix" +somefield: "prefix_$((FOO))_suffix" -> somefield: prefix_BAR_suffix +``` + +// if both types of substitution exist, quoting is performed: + +``` +somefield: "prefix_$((FOO))_$(FOO)_suffix" -> somefield: "prefix_BAR_BAR_suffix" +``` + +This mechanism allows for integer/boolean values to be substituted properly. + +The value of the parameter can be explicitly defined in template. This should be considered a default value for the parameter, clients +which process templates are free to override this value based on user input. + + +**Example Template** + +Illustration of a template which defines a service and replication controller with parameters to specialized +the name of the top level objects, the number of replicas, and serveral environment variables defined on the +pod template. + +``` +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mongodb-ephemeral", + "annotations": { + "description": "Provides a MongoDB database service" + } + }, + "labels": { + "template": "mongodb-ephemeral-template" + }, + "objects": [ + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "$(DATABASE_SERVICE_NAME)" + }, + "spec": { + "ports": [ + { + "name": "mongo", + "protocol": "TCP", + "targetPort": 27017 + } + ], + "selector": { + "name": "$(DATABASE_SERVICE_NAME)" + } + } + }, + { + "kind": "ReplicationController", + "apiVersion": "v1", + "metadata": { + "name": "$(DATABASE_SERVICE_NAME)", + }, + "spec": { + "replicas": "$((REPLICA_COUNT))", + "selector": { + "name": "$(DATABASE_SERVICE_NAME)" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "$(DATABASE_SERVICE_NAME)" + } + }, + "spec": { + "containers": [ + { + "name": "mongodb", + "image": "docker.io/centos/mongodb-26-centos7", + "ports": [ + { + "containerPort": 27017, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MONGODB_USER", + "value": "${MONGODB_USER}" + }, + { + "name": "MONGODB_PASSWORD", + "value": "${MONGODB_PASSWORD}" + }, + { + "name": "MONGODB_DATABASE", + "value": "${MONGODB_DATABASE}" + } + ] + } + ] + } + } + } + } + ], + "parameters": [ + { + "name": "DATABASE_SERVICE_NAME", + "description": "Database service name", + "value": "mongodb", + "required": true + }, + { + "name": "MONGODB_USER", + "description": "Username for MongoDB user that will be used for accessing the database", + "value": "password" + "required": true + }, + { + "name": "MONGODB_PASSWORD", + "description": "Password for the MongoDB user", + "required": true + }, + { + "name": "MONGODB_DATABASE", + "description": "Database name", + "value": "sampledb", + "required": true + }, + { + "name": "REPLICA_COUNT", + "description": "Number of mongo replicas to run", + "value": "1", + "required": true + } + ] +} +``` + +### API Endpoints + +* **/processedtemplates** - when a template is POSTed to this endpoint, all parameters in the template are processed and +substituted into appropriate locations in the object definitions. Validation is performed to ensure required parameters have +a value supplied. In addition labels defined in the template are applied to the object definitions. Finally the customized +template (still a `Template` object) is returned to the caller. + +The client is then responsible for iterating the objects returned and POSTing them to the appropriate resource api endpoint to +create each object, if that is the desired end goal for the client. + +Performing parameter substitution on the server side has the benefit of centralizing the processing so that new clients of +k8s, such as IDEs, CI systems, Web consoles, etc, do not need to reimplement template processing or embed the k8s binary. +Instead they can invoke the k8s api directly. + +* **/templates** - the REST storage resource for storing and retrieving template objects, scoped within a namespace. + +Storing templates within k8s has the benefit of enabling template sharing and securing via the same roles/resources +that are used to provide access control to other cluster resoures. It also enables sophisticated service catalog +flows in which selecting a service from a catalog results in a new instantiation of that service. (This is not the +only way to implement such a flow, but it does provide a useful level of integration). + +Creating a new template (POST to the /templates api endpoint) simply stores the template definition, it has no side +effects(no other objects are created). + +This resource can also support a subresource "/templates/templatename/processed". This resource would accept just a +Parameters object and would process the template stored in the cluster as "templatename". The processed result would be +returned in the same form as `/processedtemplates` + +### Workflow + +#### Template Instantiation + +Given a well-formed template, a client will + +1. Optionally set an explicit `value` for any parameter values the user wishes to explicitly set +2. Submit the new template object to the `/processedtemplates` api endpoint + +The api endpoint will then: + +1. Validate the template including confirming “required” parameters have an explicit value. +2. Walk each api object in the template. +3. Adding all labels defined in the template’s ObjectLabels field. +4. For each field, check if the value matches a parameter name and if so, set the value of the field to the value of the parameter. + * Partial substitutions are accepted, such as `SOME_$(PARAM)` which would be transformed into `SOME_XXXX` where `XXXX` is the value + of the `$(PARAM)` parameter. + * If a given $(VAL) could be resolved to either a parameter or an environment variable/downward api reference, an error will be + returned. +5. Return the processed template object. + +The client can now either return the processed template to the user in a desired form (eg json or yaml), or directly iterate the +api objects within the template, invoking the appropriate object creation api endpoint for each element. + +The result is a consistently recreatable application configuration, including well-defined labels for grouping objects created by +the template, with end-user customizations as enabled by the template author. + +#### Template Authoring + +To aid application authors in the creation of new templates, it should be possible to export existing objects from a project +in template form. A user should be able to export all or a filtered subset of objects from a namespace, wrappered into a +Template API object. The user will still need to customize the resulting object to enable parameterization and labeling, +though sophisticated export logic could attempt to auto-parameterize well understood api fields. Such logic is not considered +in this proposal. + +#### Tooling + +As described above, templates can be instantiated by posting them to a template processing endpoint. CLI tools should +exist which can input parameter values from the user as part of the template instantiation flow. + +More sophisticated UI implementations should also guide the user through which parameters the template expects, the description +of those templates, and the collection of user provided values. + +In addition, as described above, existing objects in a namespace can be exported in template form, making it easy to recreate a +set of objects in a new namespace or a new cluster. + + +## Examples + +### Example Templates + +These examples reflect the current OpenShift template schema, not the exact schema proposed in this document, however this +proposal, if accepted, provides sufficient capability to support the examples defined here, with the exception of +automatic generation of passwords. + +* [Jenkins template](https://github.com/openshift/origin/blob/master/examples/jenkins/jenkins-persistent-template.json) +* [MySQL DB service template](https://github.com/openshift/origin/blob/master/examples/db-templates/mysql-persistent-template.json) + +### Examples of OpenShift Parameter Usage + +(mapped to use cases described above) + +* [Share passwords](https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-mongodb-s2i.json#L146-L152) +* [Simple deployment-time customization of “app” configuration via environment values](https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-mongodb-s2i.json#L108-L126) (eg memory tuning, resource limits, etc) +* [Customization of component names with referential integrity](https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-mongodb-s2i.json#L199-L207) +* [Customize cross-component references](https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-mongodb-s2i.json#L78-L83) (eg user provides the name of a secret that already exists in their namespace, to use in a pod as a TLS cert) + +## Requirements analysis + +There has been some discussion of desired goals for a templating/parameterization solution [here](https://github.com/kubernetes/kubernetes/issues/11492#issuecomment-160853594). This section will attempt to address each of those points. + +*The primary goal is that parameterization should facilitate reuse of declarative configuration templates in different environments in + a "significant number" of common cases without further expansion, substitution, or other static preprocessing.* + +* This solution provides for templates that can be reused as is (assuming parameters are not used or provide sane default values) across + different environments, they are a self-contained description of a topology. + +*Parameterization should not impede the ability to use kubectl commands with concrete resource specifications.* + +* The parameterization proposal here does not extend beyond Template objects. That is both a strength and limitation of this proposal. + Parameterizable objects must be wrapped into a Template object, rather than existing on their own. + +*Parameterization should work with all kubectl commands that accept --filename, and should work on templates comprised of multiple resources.* + +* Same as above. + +*The parameterization mechanism should not prevent the ability to wrap kubectl with workflow/orchestration tools, such as Deployment manager.* + +* Since this proposal uses standard API objects, a DM or Helm flow could still be constructed around a set of templates, just as those flows are + constructed around other API objects today. + +*Any parameterization mechanism we add should not preclude the use of a different parameterization mechanism, it should be possible +to use different mechanisms for different resources, and, ideally, the transformation should be composable with other +substitution/decoration passes.* + +* This templating scheme does not preclude layering an additional templating mechanism over top of it. For example, it would be + possible to write a Mustache template which, after Mustache processing, resulted in a Template which could then be instantiated + through the normal template instantiating process. + +*Parameterization should not compromise reproducibility. For instance, it should be possible to manage template arguments as well as +templates under version control.* + +* Templates are a single file, including default or chosen values for parameters. They can easily be managed under version control. + +*It should be possible to specify template arguments (i.e., parameter values) declaratively, in a way that is "self-describing" +(i.e., naming the parameters and the template to which they correspond). It should be possible to write generic commands to +process templates.* + +* Parameter definitions include metadata which describes the purpose of the parameter. Since parameter definitions are part of the template, + there is no need to indicate which template they correspond to. + +*It should be possible to validate templates and template parameters, both values and the schema.* + +* Template objects are subject to standard api validation. + +*It should also be possible to validate and view the output of the substitution process.* + +* The `/processedtemplates` api returns the result of the substitution process, which is itself a Template object that can be validated. + +*It should be possible to generate forms for parameterized templates, as discussed in #4210 and #6487.* + +* Parameter definitions provide metadata that allows for the construction of form-based UIs to gather parameter values from users. + +*It shouldn't be inordinately difficult to evolve templates. Thus, strategies such as versioning and encapsulation should be +encouraged, at least by convention.* + +* Templates can be versioned via annotations on the template object. + +## Key discussion points + +The preceding document is opinionated about each of these topics, however they have been popular topics of discussion so they are called out explicitly below. + +### Where to define parameters + +There has been some discussion around where to define parameters that are being injected into a Template + +1. In a separate standalone file +2. Within the Template itself + +This proposal suggests including the parameter definitions within the Template, which provides a self-contained structure that +can be easily versioned, transported, and instantiated without risk of mismatching content. In addition, a Template can easily +be validated to confirm that all parameter references are resolveable. + +Separating the parameter definitions makes for a more complex process with respect to +* Editing a template (if/when first class editing tools are created) +* Storing/retrieving template objects with a central store + +Note that the `/templates/sometemplate/processed` subresource would accept a standalone set of parameters to be applied to `sometemplate`. + +### How to define parameters + +There has also been debate about how a parameter should be referenced from within a template. This proposal suggests that +fields to be substituted by a parameter value use the "$(parameter)" syntax which is already used elsewhere within k8s. The +value of `parameter` should be matched to a parameter with that name, and the value of the matched parameter substituted into +the field value. + +Other suggestions include a path/map approach in which a list of field paths (eg json path expressions) and corresponding +parameter names are provided. The substitution process would walk the map, replacing fields with the appropriate +parameter value. This approach makes templates more fragile from the perspective of editing/refactoring as field paths +may change, thus breaking the map. There is of course also risk of breaking references with the previous scheme, but +renaming parameters seems less likely than changing field paths. + +### Storing templates in k8s + +Openshift defines templates as a first class resource so they can be created/retrieved/etc via standard tools. This allows client tools to list available templates (available in the openshift cluster), allows existing resource security controls to be applied to templates, and generally provides a more integrated feel to templates. However there is no explicit requirement that for k8s to adopt templates, it must also adopt storing them in the cluster. + +### Processing templates (server vs client) + +Openshift handles template processing via a server endpoint which consumes a template object from the client and returns the list of objects +produced by processing the template. It is also possible to handle the entire template processing flow via the client, but this was deemed +undesirable as it would force each client tool to reimplement template processing (eg the standard CLI tool, an eclipse plugin, a plugin for a CI system like Jenkins, etc). The assumption in this proposal is that server side template processing is the preferred implementation approach for +this reason. + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/templates.md?pixel)]() + diff --git a/docs/proposals/volumes.md b/docs/proposals/volumes.md index 059375c4d59..de6bdf0ae8f 100644 --- a/docs/proposals/volumes.md +++ b/docs/proposals/volumes.md @@ -90,15 +90,15 @@ There is a [proposal](https://github.com/docker/docker/pull/14632) to add a bind Docker to change the ownership of a volume to the effective UID and GID of a container, but this has not yet been accepted. -### Rocket +### rkt -Rocket +rkt [image manifests](https://github.com/appc/spec/blob/master/spec/aci.md#image-manifest-schema) can -specify users and groups, similarly to how a Docker image can. A Rocket +specify users and groups, similarly to how a Docker image can. A rkt [pod manifest](https://github.com/appc/spec/blob/master/spec/pods.md#pod-manifest-schema) can also override the default user and group specified by the image manifest. -Rocket does not currently support supplemental groups or changing the owning UID or +rkt does not currently support supplemental groups or changing the owning UID or group of a volume, but it has been [requested](https://github.com/coreos/rkt/issues/1309). ## Use Cases diff --git a/docs/user-guide/debugging-services.md b/docs/user-guide/debugging-services.md index cb69e2cc668..810a37cb3cc 100644 --- a/docs/user-guide/debugging-services.md +++ b/docs/user-guide/debugging-services.md @@ -513,11 +513,11 @@ then look at the logs again. ```console u@node$ iptables-save | grep hostnames --A KUBE-SEP-57KPRZ3JQVENLNBR -s 10.244.3.6/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x4d415351/0xffffffff +-A KUBE-SEP-57KPRZ3JQVENLNBR -s 10.244.3.6/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x00004000/0x00004000 -A KUBE-SEP-57KPRZ3JQVENLNBR -p tcp -m comment --comment "default/hostnames:" -m tcp -j DNAT --to-destination 10.244.3.6:9376 --A KUBE-SEP-WNBA2IHDGP2BOBGZ -s 10.244.1.7/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x4d415351/0xffffffff +-A KUBE-SEP-WNBA2IHDGP2BOBGZ -s 10.244.1.7/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x00004000/0x00004000 -A KUBE-SEP-WNBA2IHDGP2BOBGZ -p tcp -m comment --comment "default/hostnames:" -m tcp -j DNAT --to-destination 10.244.1.7:9376 --A KUBE-SEP-X3P2623AGDH6CDF3 -s 10.244.2.3/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x4d415351/0xffffffff +-A KUBE-SEP-X3P2623AGDH6CDF3 -s 10.244.2.3/32 -m comment --comment "default/hostnames:" -j MARK --set-xmark 0x00004000/0x00004000 -A KUBE-SEP-X3P2623AGDH6CDF3 -p tcp -m comment --comment "default/hostnames:" -m tcp -j DNAT --to-destination 10.244.2.3:9376 -A KUBE-SERVICES -d 10.0.1.175/32 -p tcp -m comment --comment "default/hostnames: cluster IP" -m tcp --dport 80 -j KUBE-SVC-NWV5X2332I4OT4T3 -A KUBE-SVC-NWV5X2332I4OT4T3 -m comment --comment "default/hostnames:" -m statistic --mode random --probability 0.33332999982 -j KUBE-SEP-WNBA2IHDGP2BOBGZ diff --git a/docs/user-guide/deployments.md b/docs/user-guide/deployments.md index 18782011a8b..be88fcb636a 100644 --- a/docs/user-guide/deployments.md +++ b/docs/user-guide/deployments.md @@ -47,7 +47,6 @@ Documentation for other releases can be found at - [Pod Template](#pod-template) - [Replicas](#replicas) - [Selector](#selector) - - [Unique Label Key](#unique-label-key) - [Strategy](#strategy) - [Recreate Deployment](#recreate-deployment) - [Rolling Update Deployment](#rolling-update-deployment) @@ -153,7 +152,7 @@ Running ```kubectl get rc``` and ```kubectl get pods``` will show the replicatio $ kubectl get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE REPLICAS AGE -deploymentrc-1975012602 nginx nginx:1.7.9 deployment.kubernetes.io/podTemplateHash=1975012602,app=nginx 3 2m +deploymentrc-1975012602 nginx nginx:1.7.9 pod-template-hash=1975012602,app=nginx 3 2m ``` ```console @@ -237,8 +236,8 @@ which it scaled up to 3 replicas, and has scaled down the old RC to 0 replicas. ```console kubectl get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE -deploymentrc-1562004724 nginx nginx:1.9.1 deployment.kubernetes.io/podTemplateHash=1562004724,app=nginx 3 5m -deploymentrc-1975012602 nginx nginx:1.7.9 deployment.kubernetes.io/podTemplateHash=1975012602,app=nginx 0 7m +deploymentrc-1562004724 nginx nginx:1.9.1 pod-template-hash=1562004724,app=nginx 3 5m +deploymentrc-1975012602 nginx nginx:1.7.9 pod-template-hash=1975012602,app=nginx 0 7m ``` Running `get pods` should now show only the new pods: @@ -335,17 +334,6 @@ template is different than `.spec.template` or if the total number of such pods exceeds `.spec.replicas`. It will bring up new pods with `.spec.template` if number of pods are less than the desired number. -### Unique Label Key - -`.spec.uniqueLabelKey` is an optional field specifying key of the selector that -is added to existing RCs (and label key that is added to its pods) to prevent -the existing RCs to select new pods (and old pods being selected by new RC). -Users can set this to an empty string to indicate that the system should -not add any selector and label. If unspecified, the system uses -`deployment.kubernetes.io/podTemplateHash`. -The value of this key is the hash of `.spec.template`. -No label is added if this is set to the empty string. - ### Strategy `.spec.strategy` specifies the strategy used to replace old pods by new ones. @@ -399,7 +387,7 @@ at any time during the update is at most 130% of desired pods. ##### Min Ready Seconds -`.spec.strategy.rollingUpdate.minReadySeconds` is an optional field that specifies the +`.spec.minReadySeconds` is an optional field that specifies the minimum number of seconds for which a newly created pod should be ready without any of its containers crashing, for it to be considered available. This defaults to 0 (the pod will be considered available as soon as it is ready). diff --git a/docs/user-guide/environment-guide/containers/backend/Dockerfile b/docs/user-guide/environment-guide/containers/backend/Dockerfile index 3fa58ff7abe..a0fe23c3897 100644 --- a/docs/user-guide/environment-guide/containers/backend/Dockerfile +++ b/docs/user-guide/environment-guide/containers/backend/Dockerfile @@ -1,2 +1,16 @@ +# 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. + FROM golang:onbuild EXPOSE 8080 diff --git a/docs/user-guide/environment-guide/containers/show/Dockerfile b/docs/user-guide/environment-guide/containers/show/Dockerfile index 3fa58ff7abe..a0fe23c3897 100644 --- a/docs/user-guide/environment-guide/containers/show/Dockerfile +++ b/docs/user-guide/environment-guide/containers/show/Dockerfile @@ -1,2 +1,16 @@ +# 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. + FROM golang:onbuild EXPOSE 8080 diff --git a/docs/user-guide/horizontal-pod-autoscaling/image/Dockerfile b/docs/user-guide/horizontal-pod-autoscaling/image/Dockerfile index 56f2d6252eb..1a93ea2ddc5 100644 --- a/docs/user-guide/horizontal-pod-autoscaling/image/Dockerfile +++ b/docs/user-guide/horizontal-pod-autoscaling/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM php:5-apache ADD index.php /var/www/html/index.php diff --git a/docs/user-guide/images.md b/docs/user-guide/images.md index 7c2db77c2cd..bbfbb56460b 100644 --- a/docs/user-guide/images.md +++ b/docs/user-guide/images.md @@ -51,6 +51,9 @@ The `image` property of a container supports the same syntax as the `docker` com - [Configuring Nodes to Authenticate to a Private Repository](#configuring-nodes-to-authenticate-to-a-private-repository) - [Pre-pulling Images](#pre-pulling-images) - [Specifying ImagePullSecrets on a Pod](#specifying-imagepullsecrets-on-a-pod) + - [Creating a Secret with a Docker Config](#creating-a-secret-with-a-docker-config) + - [Bypassing kubectl create secrets](#bypassing-kubectl-create-secrets) + - [Referring to an imagePullSecrets on a Pod](#referring-to-an-imagepullsecrets-on-a-pod) - [Use Cases](#use-cases) @@ -207,42 +210,40 @@ where node creation is automated. Kubernetes supports specifying registry keys on a pod. -First, create a `.docker/config.json`, such as by running `docker login `. -Then put the resulting `.docker/config.json` file into a [secret resource](secrets.md). For example: +#### Creating a Secret with a Docker Config + +Run the following command, substituting the appropriate uppercase values: ```console -$ docker login -Username: janedoe -Password: ●●●●●●●●●●● -Email: jdoe@example.com -WARNING: login credentials saved in /Users/jdoe/.docker/config.json. -Login Succeeded - -$ echo $(cat ~/.docker/config.json) -{ "https://index.docker.io/v1/": { "auth": "ZmFrZXBhc3N3b3JkMTIK", "email": "jdoe@example.com" } } - -$ cat ~/.docker/config.json | base64 -eyAiaHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvIjogeyAiYXV0aCI6ICJabUZyWlhCaGMzTjNiM0prTVRJSyIsICJlbWFpbCI6ICJqZG9lQGV4YW1wbGUuY29tIiB9IH0K - -$ cat > /tmp/image-pull-secret.yaml < [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_annotate.md b/docs/user-guide/kubectl/kubectl_annotate.md index 6cf45f22c99..b7b273deb49 100644 --- a/docs/user-guide/kubectl/kubectl_annotate.md +++ b/docs/user-guide/kubectl/kubectl_annotate.md @@ -88,9 +88,11 @@ $ kubectl annotate pods foo description- -o, --output="": 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]. --output-version="": Output the formatted object with the given version (default api-version). --overwrite[=false]: If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations. + --record[=false]: Record current kubectl command in the resource annotation. --resource-version="": If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. -l, --selector="": Selector (label query) to filter on -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. ``` @@ -127,7 +129,7 @@ $ kubectl annotate pods foo description- * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_apply.md b/docs/user-guide/kubectl/kubectl_apply.md index f447378517e..0d2fca94f57 100644 --- a/docs/user-guide/kubectl/kubectl_apply.md +++ b/docs/user-guide/kubectl/kubectl_apply.md @@ -63,6 +63,7 @@ $ cat pod.json | kubectl apply -f - ``` -f, --filename=[]: Filename, directory, or URL to file that contains the configuration to apply -o, --output="": Output mode. Use "-o name" for shorter output (resource/name). + --record[=false]: Record current kubectl command in the resource annotation. --schema-cache-dir="~/.kube/schema": If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' --validate[=true]: If true, use a schema to validate the input before sending it ``` @@ -99,7 +100,7 @@ $ cat pod.json | kubectl apply -f - * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_apply.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_autoscale.md b/docs/user-guide/kubectl/kubectl_autoscale.md index f2477073a6c..ade072cef5f 100644 --- a/docs/user-guide/kubectl/kubectl_autoscale.md +++ b/docs/user-guide/kubectl/kubectl_autoscale.md @@ -71,8 +71,10 @@ $ kubectl autoscale rc foo --max=5 --cpu-percent=80 --no-headers[=false]: When using the default output, don't print headers. -o, --output="": 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]. --output-version="": Output the formatted object with the given version (default api-version). + --record[=false]: Record current kubectl command in the resource annotation. --save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. ``` @@ -109,7 +111,7 @@ $ kubectl autoscale rc foo --max=5 --cpu-percent=80 * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_autoscale.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_config_view.md b/docs/user-guide/kubectl/kubectl_config_view.md index db1a1adac61..bf9c8a995c0 100644 --- a/docs/user-guide/kubectl/kubectl_config_view.md +++ b/docs/user-guide/kubectl/kubectl_config_view.md @@ -68,6 +68,7 @@ $ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}' --output-version="": Output the formatted object with the given version (default api-version). --raw[=false]: display raw byte data -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. ``` diff --git a/docs/user-guide/kubectl/kubectl_convert.md b/docs/user-guide/kubectl/kubectl_convert.md index e048ab4536f..d83a39d6c43 100644 --- a/docs/user-guide/kubectl/kubectl_convert.md +++ b/docs/user-guide/kubectl/kubectl_convert.md @@ -74,6 +74,7 @@ $ kubectl convert -f . | kubectl create -f - --output-version="": Output the formatted object with the given version (default api-version). --schema-cache-dir="~/.kube/schema": If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. --validate[=true]: If true, use a schema to validate the input before sending it @@ -111,7 +112,7 @@ $ kubectl convert -f . | kubectl create -f - * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 24-Nov-2015 +###### Auto generated by spf13/cobra on 20-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_convert.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_create.md b/docs/user-guide/kubectl/kubectl_create.md index b3c25d94177..4ac999e08e7 100644 --- a/docs/user-guide/kubectl/kubectl_create.md +++ b/docs/user-guide/kubectl/kubectl_create.md @@ -62,6 +62,7 @@ $ cat pod.json | kubectl create -f - ``` -f, --filename=[]: Filename, directory, or URL to file to use to create the resource -o, --output="": Output mode. Use "-o name" for shorter output (resource/name). + --record[=false]: Record current kubectl command in the resource annotation. --save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. --schema-cache-dir="~/.kube/schema": If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' --validate[=true]: If true, use a schema to validate the input before sending it @@ -101,7 +102,7 @@ $ cat pod.json | kubectl create -f - * [kubectl create namespace](kubectl_create_namespace.md) - Create a namespace with the specified name. * [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand. -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_drain.md b/docs/user-guide/kubectl/kubectl_drain.md index 6a586aa1f22..1b4199c9106 100644 --- a/docs/user-guide/kubectl/kubectl_drain.md +++ b/docs/user-guide/kubectl/kubectl_drain.md @@ -38,9 +38,12 @@ Drain node in preparation for maintenance. The given node will be marked unschedulable to prevent new pods from arriving. Then drain deletes all pods except mirror pods (which cannot be deleted through -the API server). If there are any pods that are neither mirror pods nor -managed by a ReplicationController, Job, or DaemonSet, then drain will not -delete any pods unless you use --force. +the API server). If there are DaemonSet-managed pods, drain will not proceed +without --ignore-daemonsets, and regardless it will not delete any +DaemonSet-managed pods, because those pods would be immediately replaced by the +DaemonSet controller, which ignores unschedulable marknigs. If there are any +pods that are neither mirror pods nor managed--by ReplicationController, +DaemonSet or Job--, then drain will not delete any pods unless you use --force. When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again. @@ -66,6 +69,7 @@ $ kubectl drain foo --grace-period=900 ``` --force[=false]: Continue even if there are pods not managed by a ReplicationController, Job, or DaemonSet. --grace-period=-1: Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used. + --ignore-daemonsets[=false]: Ignore DaemonSet-managed pods. ``` ### Options inherited from parent commands @@ -100,7 +104,7 @@ $ kubectl drain foo --grace-period=900 * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 28-Jan-2016 +###### Auto generated by spf13/cobra on 2-Feb-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_drain.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_edit.md b/docs/user-guide/kubectl/kubectl_edit.md index bd719a673fe..ee8ec24b66c 100644 --- a/docs/user-guide/kubectl/kubectl_edit.md +++ b/docs/user-guide/kubectl/kubectl_edit.md @@ -82,6 +82,7 @@ kubectl edit (RESOURCE/NAME | -f FILENAME) -f, --filename=[]: Filename, directory, or URL to file to use to edit the resource -o, --output="yaml": Output format. One of: yaml|json. --output-version="": Output the formatted object with the given version (default api-version). + --record[=false]: Record current kubectl command in the resource annotation. --save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. --windows-line-endings[=false]: Use Windows line-endings (default Unix line-endings) ``` @@ -118,7 +119,7 @@ kubectl edit (RESOURCE/NAME | -f FILENAME) * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_edit.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_expose.md b/docs/user-guide/kubectl/kubectl_expose.md index 25c62661c94..4d6e1d66d0e 100644 --- a/docs/user-guide/kubectl/kubectl_expose.md +++ b/docs/user-guide/kubectl/kubectl_expose.md @@ -86,10 +86,12 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream --overrides="": An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. --port="": The port that the service should serve on. Copied from the resource being exposed, if unspecified --protocol="TCP": The network protocol for the service to be created. Default is 'tcp'. + --record[=false]: Record current kubectl command in the resource annotation. --save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. --selector="": A label selector to use for this service. If empty (the default) infer the selector from the replication controller. --session-affinity="": If non-empty, set the session affinity for the service to this; legal values: 'None', 'ClientIP' -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. --target-port="": Name or number for the port on the container that the service should direct traffic to. Optional. --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]. @@ -128,7 +130,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 10-Jan-2016 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_get.md b/docs/user-guide/kubectl/kubectl_get.md index 25f21b8720f..29c202fa300 100644 --- a/docs/user-guide/kubectl/kubectl_get.md +++ b/docs/user-guide/kubectl/kubectl_get.md @@ -94,6 +94,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 --output-version="": Output the formatted object with the given version (default api-version). -l, --selector="": Selector (label query) to filter on -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. -w, --watch[=false]: After listing/getting the requested object, watch for changes. @@ -132,7 +133,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 22-Dec-2015 +###### Auto generated by spf13/cobra on 20-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_label.md b/docs/user-guide/kubectl/kubectl_label.md index 09339404f37..31d250e0b9c 100644 --- a/docs/user-guide/kubectl/kubectl_label.md +++ b/docs/user-guide/kubectl/kubectl_label.md @@ -82,9 +82,11 @@ $ kubectl label pods foo bar- -o, --output="": 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]. --output-version="": Output the formatted object with the given version (default api-version). --overwrite[=false]: If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels. + --record[=false]: Record current kubectl command in the resource annotation. --resource-version="": If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. -l, --selector="": Selector (label query) to filter on -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. ``` @@ -121,7 +123,7 @@ $ kubectl label pods foo bar- * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_patch.md b/docs/user-guide/kubectl/kubectl_patch.md index 91fb4c841ab..6d67664c4aa 100644 --- a/docs/user-guide/kubectl/kubectl_patch.md +++ b/docs/user-guide/kubectl/kubectl_patch.md @@ -69,6 +69,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update -o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -p, --patch="": The patch to be applied to the resource JSON file. + --record[=false]: Record current kubectl command in the resource annotation. ``` ### Options inherited from parent commands @@ -103,7 +104,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_replace.md b/docs/user-guide/kubectl/kubectl_replace.md index f1bedbf948c..100f3dff75b 100644 --- a/docs/user-guide/kubectl/kubectl_replace.md +++ b/docs/user-guide/kubectl/kubectl_replace.md @@ -75,6 +75,7 @@ kubectl replace --force -f ./pod.json --force[=false]: Delete and re-create the specified resource --grace-period=-1: Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. -o, --output="": Output mode. Use "-o name" for shorter output (resource/name). + --record[=false]: Record current kubectl command in the resource annotation. --save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future. --schema-cache-dir="~/.kube/schema": If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' --timeout=0: Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object @@ -113,7 +114,7 @@ kubectl replace --force -f ./pod.json * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_rolling-update.md b/docs/user-guide/kubectl/kubectl_rolling-update.md index 65fa08d3267..4c3889555bd 100644 --- a/docs/user-guide/kubectl/kubectl_rolling-update.md +++ b/docs/user-guide/kubectl/kubectl_rolling-update.md @@ -85,6 +85,7 @@ $ kubectl rolling-update frontend-v1 frontend-v2 --rollback --rollback[=false]: If true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout --schema-cache-dir="~/.kube/schema": If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema' -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a 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]. --timeout=5m0s: Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". @@ -124,7 +125,7 @@ $ kubectl rolling-update frontend-v1 frontend-v2 --rollback * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 20-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_rollout.md b/docs/user-guide/kubectl/kubectl_rollout.md index 3e2c755dc7b..327d5f67a13 100644 --- a/docs/user-guide/kubectl/kubectl_rollout.md +++ b/docs/user-guide/kubectl/kubectl_rollout.md @@ -34,12 +34,19 @@ rollout manages a deployment ### Synopsis -rollout manages a deployment using subcommands +rollout manages a deployment using subcommands like "kubectl rollout undo deployment/abc" ``` kubectl rollout SUBCOMMAND ``` +### Examples + +``` +# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc +``` + ### Options inherited from parent commands ``` @@ -72,8 +79,11 @@ kubectl rollout SUBCOMMAND * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl rollout history](kubectl_rollout_history.md) - view rollout history +* [kubectl rollout pause](kubectl_rollout_pause.md) - Mark the provided resource as paused +* [kubectl rollout resume](kubectl_rollout_resume.md) - Resume a paused resource +* [kubectl rollout undo](kubectl_rollout_undo.md) - undoes a previous rollout -###### Auto generated by spf13/cobra on 20-Jan-2016 +###### Auto generated by spf13/cobra on 2-Feb-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_rollout_pause.md b/docs/user-guide/kubectl/kubectl_rollout_pause.md new file mode 100644 index 00000000000..1a79dc5378f --- /dev/null +++ b/docs/user-guide/kubectl/kubectl_rollout_pause.md @@ -0,0 +1,98 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +## kubectl rollout pause + +Mark the provided resource as paused + +### Synopsis + + +Mark the provided resource as paused + +Paused resources will not be reconciled by a controller. +Use \"kubectl rollout resume\" to resume a paused resource. +Currently only deployments support being paused. + +``` +kubectl rollout pause RESOURCE +``` + +### Examples + +``` +# Mark the nginx deployment as paused. Any current state of +# the deployment will continue its function, new updates to the deployment will not +# have an effect as long as the deployment is paused. +$ kubectl rollout pause deployment/nginx +``` + +### Options + +``` + -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server. +``` + +### Options inherited from parent commands + +``` + --alsologtostderr[=false]: log to standard error as well as files + --api-version="": The API version to use when talking to the server + --certificate-authority="": Path to a cert. file for the certificate authority. + --client-certificate="": Path to a client certificate file for TLS. + --client-key="": Path to a client key file for TLS. + --cluster="": The name of the kubeconfig cluster to use + --context="": The name of the kubeconfig context to use + --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + --kubeconfig="": Path to the kubeconfig file to use for CLI requests. + --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace + --log-dir="": If non-empty, write log files in this directory + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --logtostderr[=true]: log to standard error instead of files + --match-server-version[=false]: Require server version to match client version + --namespace="": If present, the namespace scope for this CLI request. + --password="": Password for basic authentication to the API server. + -s, --server="": The address and port of the Kubernetes API server + --stderrthreshold=2: logs at or above this threshold go to stderr + --token="": Bearer token for authentication to the API server. + --user="": The name of the kubeconfig user to use + --username="": Username for basic authentication to the API server. + --v=0: log level for V logs + --vmodule=: comma-separated list of pattern=N settings for file-filtered logging +``` + +### SEE ALSO + +* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment + +###### Auto generated by spf13/cobra on 2-Feb-2016 + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_pause.md?pixel)]() + diff --git a/docs/user-guide/kubectl/kubectl_rollout_resume.md b/docs/user-guide/kubectl/kubectl_rollout_resume.md new file mode 100644 index 00000000000..f5fd45277e9 --- /dev/null +++ b/docs/user-guide/kubectl/kubectl_rollout_resume.md @@ -0,0 +1,96 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +## kubectl rollout resume + +Resume a paused resource + +### Synopsis + + +Resume a paused resource + +Paused resources will not be reconciled by a controller. By resuming a +resource, we allow it to be reconciled again. +Currently only deployments support being resumed. + +``` +kubectl rollout resume RESOURCE +``` + +### Examples + +``` +# Resume an already paused deployment +$ kubectl rollout resume deployment/nginx +``` + +### Options + +``` + -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server. +``` + +### Options inherited from parent commands + +``` + --alsologtostderr[=false]: log to standard error as well as files + --api-version="": The API version to use when talking to the server + --certificate-authority="": Path to a cert. file for the certificate authority. + --client-certificate="": Path to a client certificate file for TLS. + --client-key="": Path to a client key file for TLS. + --cluster="": The name of the kubeconfig cluster to use + --context="": The name of the kubeconfig context to use + --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + --kubeconfig="": Path to the kubeconfig file to use for CLI requests. + --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace + --log-dir="": If non-empty, write log files in this directory + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --logtostderr[=true]: log to standard error instead of files + --match-server-version[=false]: Require server version to match client version + --namespace="": If present, the namespace scope for this CLI request. + --password="": Password for basic authentication to the API server. + -s, --server="": The address and port of the Kubernetes API server + --stderrthreshold=2: logs at or above this threshold go to stderr + --token="": Bearer token for authentication to the API server. + --user="": The name of the kubeconfig user to use + --username="": Username for basic authentication to the API server. + --v=0: log level for V logs + --vmodule=: comma-separated list of pattern=N settings for file-filtered logging +``` + +### SEE ALSO + +* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment + +###### Auto generated by spf13/cobra on 2-Feb-2016 + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_resume.md?pixel)]() + diff --git a/docs/user-guide/kubectl/kubectl_rollout_undo.md b/docs/user-guide/kubectl/kubectl_rollout_undo.md new file mode 100644 index 00000000000..659177bf81a --- /dev/null +++ b/docs/user-guide/kubectl/kubectl_rollout_undo.md @@ -0,0 +1,93 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +## kubectl rollout undo + +undoes a previous rollout + +### Synopsis + + +undo rolls back to a previous rollout. + +``` +kubectl rollout undo (TYPE NAME | TYPE/NAME) [flags] +``` + +### Examples + +``` +# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc +``` + +### Options + +``` + -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server. + --to-revision=0: The revision to rollback to. Default to 0 (last revision). +``` + +### Options inherited from parent commands + +``` + --alsologtostderr[=false]: log to standard error as well as files + --api-version="": The API version to use when talking to the server + --certificate-authority="": Path to a cert. file for the certificate authority. + --client-certificate="": Path to a client certificate file for TLS. + --client-key="": Path to a client key file for TLS. + --cluster="": The name of the kubeconfig cluster to use + --context="": The name of the kubeconfig context to use + --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. + --kubeconfig="": Path to the kubeconfig file to use for CLI requests. + --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace + --log-dir="": If non-empty, write log files in this directory + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --logtostderr[=true]: log to standard error instead of files + --match-server-version[=false]: Require server version to match client version + --namespace="": If present, the namespace scope for this CLI request. + --password="": Password for basic authentication to the API server. + -s, --server="": The address and port of the Kubernetes API server + --stderrthreshold=2: logs at or above this threshold go to stderr + --token="": Bearer token for authentication to the API server. + --user="": The name of the kubeconfig user to use + --username="": Username for basic authentication to the API server. + --v=0: log level for V logs + --vmodule=: comma-separated list of pattern=N settings for file-filtered logging +``` + +### SEE ALSO + +* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment + +###### Auto generated by spf13/cobra on 29-Jan-2016 + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_undo.md?pixel)]() + diff --git a/docs/user-guide/kubectl/kubectl_run.md b/docs/user-guide/kubectl/kubectl_run.md index 9b8a6f8ef8f..887c1239489 100644 --- a/docs/user-guide/kubectl/kubectl_run.md +++ b/docs/user-guide/kubectl/kubectl_run.md @@ -99,6 +99,7 @@ $ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'pri --output-version="": Output the formatted object with the given version (default api-version). --overrides="": An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. --port=-1: The port that this container exposes. If --expose is true, this is also the port used by the service that is created. + --record[=false]: Record current kubectl command in the resource annotation. -r, --replicas=1: Number of replicas to create for this container. Default is 1. --requests="": The resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi' --restart="Always": The restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to 'Always' a replication controller is created for this pod, if set to OnFailure or Never, a job is created for this pod and --replicas must be 1. Default 'Always' @@ -107,6 +108,7 @@ $ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'pri --service-generator="service/v2": The name of the generator to use for creating a service. Only used if --expose is true --service-overrides="": An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true. -a, --show-all[=false]: When printing, show all resources (default hide terminated pods.) + --show-labels[=false]: When printing, show all labels as the last column (default hide labels column) --sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. -i, --stdin[=false]: Keep stdin open on the container(s) in the pod, even if nothing is attached. --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]. @@ -145,7 +147,7 @@ $ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'pri * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 14-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]() diff --git a/docs/user-guide/kubectl/kubectl_scale.md b/docs/user-guide/kubectl/kubectl_scale.md index 77c820e9055..61699354b82 100644 --- a/docs/user-guide/kubectl/kubectl_scale.md +++ b/docs/user-guide/kubectl/kubectl_scale.md @@ -75,6 +75,7 @@ $ kubectl scale --replicas=3 job/cron --current-replicas=-1: Precondition for current size. Requires that the current size of the resource match this value in order to scale. -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to set a new size -o, --output="": Output mode. Use "-o name" for shorter output (resource/name). + --record[=false]: Record current kubectl command in the resource annotation. --replicas=-1: The new desired number of replicas. Required. --resource-version="": Precondition for resource version. Requires that the current resource version match this value in order to scale. --timeout=0: The length of time to wait before giving up on a scale operation, zero means don't wait. @@ -112,7 +113,7 @@ $ kubectl scale --replicas=3 job/cron * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager -###### Auto generated by spf13/cobra on 8-Dec-2015 +###### Auto generated by spf13/cobra on 22-Jan-2016 [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]() diff --git a/docs/user-guide/liveness/README.md b/docs/user-guide/liveness/README.md index 500256dd8c9..1e5311f471b 100644 --- a/docs/user-guide/liveness/README.md +++ b/docs/user-guide/liveness/README.md @@ -66,11 +66,14 @@ The [http-liveness.yaml](http-liveness.yaml) demonstrates the HTTP check. httpGet: path: /healthz port: 8080 + httpHeaders: + - name: X-Custom-Header + value: Awesome initialDelaySeconds: 15 timeoutSeconds: 1 ``` -The Kubelet sends an HTTP request to the specified path and port to perform the health check. If you take a look at image/server.go, you will see the server starts to respond with an error code 500 after 10 seconds, so the check fails. The Kubelet sends the probe to the container's ip address by default which could be specified with `host` as part of httpGet probe. If the container listens on `127.0.0.1`, `host` should be specified as `127.0.0.1`. In general, if the container listens on its ip address or on all interfaces (0.0.0.0), there is no need to specify the `host` as part of the httpGet probe. +The Kubelet sends an HTTP request to the specified path and port to perform the health check. If you take a look at image/server.go, you will see the server starts to respond with an error code 500 after 10 seconds, so the check fails. The Kubelet sends probes to the container's IP address, unless overridden by the optional `host` field in httpGet. If the container listens on `127.0.0.1` and `hostNetwork` is `true` (i.e., it does not use the pod-specific network), then `host` should be specified as `127.0.0.1`. Be warned that, outside of less common cases like that, `host` does probably not result in what you would expect. If you set it to a non-existing hostname (or your competitor's!), probes will never reach the pod, defeating the whole point of health checks. If your pod relies on e.g. virtual hosts, which is probably the more common case, you should not use `host`, but rather set the `Host` header in `httpHeaders`. This [guide](../walkthrough/k8s201.md#health-checking) has more information on health checks. diff --git a/docs/user-guide/liveness/http-liveness.yaml b/docs/user-guide/liveness/http-liveness.yaml index ca8d212ae2c..c2c6065450f 100644 --- a/docs/user-guide/liveness/http-liveness.yaml +++ b/docs/user-guide/liveness/http-liveness.yaml @@ -13,6 +13,9 @@ spec: httpGet: path: /healthz port: 8080 + httpHeaders: + - name: X-Custom-Header + value: Awesome initialDelaySeconds: 15 timeoutSeconds: 1 name: liveness diff --git a/docs/user-guide/liveness/image/Dockerfile b/docs/user-guide/liveness/image/Dockerfile index d057ecd309e..2c5481c63ee 100644 --- a/docs/user-guide/liveness/image/Dockerfile +++ b/docs/user-guide/liveness/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM scratch ADD server /server diff --git a/docs/user-guide/liveness/image/Makefile b/docs/user-guide/liveness/image/Makefile index 3eb9f0e2fe1..f29214f3501 100644 --- a/docs/user-guide/liveness/image/Makefile +++ b/docs/user-guide/liveness/image/Makefile @@ -1,3 +1,17 @@ +# 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. + all: push server: server.go diff --git a/docs/user-guide/logging-demo/Makefile b/docs/user-guide/logging-demo/Makefile index e4af040081a..0df0a18d2e3 100644 --- a/docs/user-guide/logging-demo/Makefile +++ b/docs/user-guide/logging-demo/Makefile @@ -1,3 +1,17 @@ +# 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. + # Makefile for launching synthetic logging sources (any platform) # and for reporting the forwarding rules for the # Elasticsearch and Kibana pods for the GCE platform. diff --git a/docs/user-guide/node-selection/pod-with-node-affinity.yaml b/docs/user-guide/node-selection/pod-with-node-affinity.yaml new file mode 100644 index 00000000000..526f83e4d4f --- /dev/null +++ b/docs/user-guide/node-selection/pod-with-node-affinity.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Pod +metadata: + name: with-labels + annotations: + scheduler.alpha.kubernetes.io/affinity: > + { + "nodeAffinity": { + "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { + "matchExpressions": [ + { + "key": "kubernetes.io/e2e-az-name", + "operator": "In", + "values": ["e2e-az1", "e2e-az2"] + } + ] + } + ] + } + } + } + another-annotation-key: another-annotation-value +spec: + containers: + - name: with-labels + image: gcr.io/google_containers/pause:2.0 diff --git a/docs/user-guide/overview.md b/docs/user-guide/overview.md index 8349b7fd39f..908db2e5b2e 100644 --- a/docs/user-guide/overview.md +++ b/docs/user-guide/overview.md @@ -38,7 +38,7 @@ Kubernetes is an open-source system for managing containerized applications acro Kubernetes provides mechanisms for application deployment, scheduling, updating, maintenance, and scaling. A key feature of Kubernetes is that it actively manages the containers to ensure that the state of the cluster continually matches the user's intentions. An operations user should be able to launch a micro-service, letting the scheduler find the right placement. We also want to improve the tools and experience for how users can roll-out applications through patterns like canary deployments. -Kubernetes supports [Docker](http://www.docker.io) and [Rocket](https://coreos.com/blog/rocket/) containers, and other container image formats and container runtimes will be supported in the future. +Kubernetes supports [Docker](http://www.docker.io) and [rkt](https://coreos.com/blog/rocket/) containers, and other container image formats and container runtimes will be supported in the future. While Kubernetes currently focuses on continuously-running stateless (e.g. web server or in-memory object cache) and "cloud native" stateful applications (e.g. NoSQL datastores), in the near future it will support all the other workload types commonly found in production cluster environments, such as batch, stream processing, and traditional databases. diff --git a/docs/user-guide/pod-templates.md b/docs/user-guide/pod-templates.md new file mode 100644 index 00000000000..63fe8ad16af --- /dev/null +++ b/docs/user-guide/pod-templates.md @@ -0,0 +1,46 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# Pod Templates + +Pod templates are [pod](pods.md) specifications which are included in other objects, such as +[Replication Controllers](replication-controller.md), [Jobs](jobs.md), and +[DaemonSets](../admin/daemons.md). Controllers use Pod Templates to make actual pods. + +Rather than specifying the current desired state of all replicas, pod templates are like cookie cutters. Once a cookie has been cut, the cookie has no relationship to the cutter. There is no quantum entanglement. Subsequent changes to the template or even switching to a new template has no direct effect on the pods already created. Similarly, pods created by a replication controller may subsequently be updated directly. This is in deliberate contrast to pods, which do specify the current desired state of all containers belonging to the pod. This approach radically simplifies system semantics and increases the flexibility of the primitive. + + +## Future Work + +A replication controller creates new pods from a template, which is currently inline in the `ReplicationController` object, but which we plan to extract into its own resource [#170](http://issue.k8s.io/170). + + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/pod-templates.md?pixel)]() + diff --git a/docs/user-guide/replication-controller.md b/docs/user-guide/replication-controller.md index ee7a33b632b..b45f792e882 100644 --- a/docs/user-guide/replication-controller.md +++ b/docs/user-guide/replication-controller.md @@ -39,59 +39,228 @@ Documentation for other releases can be found at - [Replication Controller](#replication-controller) - [What is a _replication controller_?](#what-is-a-replication-controller) - - [How does a replication controller work?](#how-does-a-replication-controller-work) - - [Pod template](#pod-template) - - [Labels](#labels) - - [Responsibilities of the replication controller](#responsibilities-of-the-replication-controller) + - [Running an example Replication Controller](#running-an-example-replication-controller) + - [Writing a Replication Controller Spec](#writing-a-replication-controller-spec) + - [Pod Template](#pod-template) + - [Labels on the Replication Controller](#labels-on-the-replication-controller) + - [Pod Selector](#pod-selector) + - [Multiple Replicas](#multiple-replicas) + - [Working with Replication Controllers](#working-with-replication-controllers) + - [Deleting a Replication Controller and its Pods](#deleting-a-replication-controller-and-its-pods) + - [Deleting just a Replication Controller](#deleting-just-a-replication-controller) + - [Isolating pods from a Replication Controller](#isolating-pods-from-a-replication-controller) - [Common usage patterns](#common-usage-patterns) - [Rescheduling](#rescheduling) - [Scaling](#scaling) - [Rolling updates](#rolling-updates) - [Multiple release tracks](#multiple-release-tracks) + - [Using Replication Controllers with Services](#using-replication-controllers-with-services) + - [Writing programs for Replication](#writing-programs-for-replication) + - [Responsibilities of the replication controller](#responsibilities-of-the-replication-controller) - [API Object](#api-object) + - [Alternatives to Replication Controller](#alternatives-to-replication-controller) + - [Bare Pods](#bare-pods) + - [Job](#job) + - [DaemonSet](#daemonset) ## What is a _replication controller_? -A _replication controller_ ensures that a specified number of pod "replicas" are running at any one time. In other words, a replication controller makes sure that a pod or homogenous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the replication controller will start more. Unlike manually created pods, the pods maintained by a replication controller are automatically replaced if they fail, get deleted, or are terminated. For example, your pods get re-created on a node after disruptive maintenance such as a kernel upgrade. For this reason, we recommend that you use a replication controller even if your application requires only a single pod. You can think of a replication controller as something similar to a process supervisor, but rather then individual processes on a single node, the replication controller supervises multiple pods across multiple nodes. +A _replication controller_ ensures that a specified number of pod "replicas" are running at any one +time. In other words, a replication controller makes sure that a pod or homogenous set of pods are +always up and available. +If there are too many pods, it will kill some. If there are too few, the +replication controller will start more. Unlike manually created pods, the pods maintained by a +replication controller are automatically replaced if they fail, get deleted, or are terminated. +For example, your pods get re-created on a node after disruptive maintenance such as a kernel upgrade. +For this reason, we recommend that you use a replication controller even if your application requires +only a single pod. You can think of a replication controller as something similar to a process supervisor, +but rather then individual processes on a single node, the replication controller supervises multiple pods +across multiple nodes. -As discussed in [life of a pod](pod-states.md), `ReplicationController` is *only* appropriate for pods with `RestartPolicy = Always`. (Note: If `RestartPolicy` is not set, the default value is `Always`.) `ReplicationController` should refuse to instantiate any pod that has a different restart policy. As discussed in [issue #503](http://issue.k8s.io/503#issuecomment-50169443), we expect other types of controllers to be added to Kubernetes to handle other types of workloads, such as build/test and batch workloads, in the future. +Replication Controller is often abbreviated to "rc" or "rcs" in discussion, and as a shortcut in +kubectl commands. -A replication controller will never terminate on its own, but it isn't expected to be as long-lived as services. Services may be composed of pods controlled by multiple replication controllers, and it is expected that many replication controllers may be created and destroyed over the lifetime of a service (for instance, to perform an update of pods that run the service). Both services themselves and their clients should remain oblivious to the replication controllers that maintain the pods of the services. +A simple case is to create 1 Replication Controller object in order to reliably run one instance of +a Pod indefinitely. A more complex use case is to run several identical replicas of a replicated +service, such as web servers. -For local container restarts, replication controllers delegate to an agent on the node, for example the [Kubelet](../admin/kubelet.md) or Docker. +## Running an example Replication Controller -## How does a replication controller work? +Here is an example Replication Controller config. It runs 3 copies of the nginx web server. + -### Pod template +```yaml +apiVersion: v1 +kind: ReplicationController +metadata: + name: nginx +spec: + replicas: 3 + selector: + app: nginx + template: + metadata: + name: nginx + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 +``` -A replication controller creates new pods from a template, which is currently inline in the `ReplicationController` object, but which we plan to extract into its own resource [#170](http://issue.k8s.io/170). +[Download example](replication.yaml?raw=true) + -Rather than specifying the current desired state of all replicas, pod templates are like cookie cutters. Once a cookie has been cut, the cookie has no relationship to the cutter. There is no quantum entanglement. Subsequent changes to the template or even switching to a new template has no direct effect on the pods already created. Similarly, pods created by a replication controller may subsequently be updated directly. This is in deliberate contrast to pods, which do specify the current desired state of all containers belonging to the pod. This approach radically simplifies system semantics and increases the flexibility of the primitive, as demonstrated by the use cases explained below. +Run the example job by downloading the example file and then running this command: -Pods created by a replication controller are intended to be fungible and semantically identical, though their configurations may become heterogeneous over time. This is an obvious fit for replicated stateless servers, but replication controllers can also be used to maintain availability of master-elected, sharded, and worker-pool applications. Such applications should use dynamic work assignment mechanisms, such as the [etcd lock module](https://coreos.com/docs/distributed-configuration/etcd-modules/) or [RabbitMQ work queues](https://www.rabbitmq.com/tutorials/tutorial-two-python.html), as opposed to static/one-time customization of the configuration of each pod, which is considered an anti-pattern. Any pod customization performed, such as vertical auto-sizing of resources (e.g., cpu or memory), should be performed by another online controller process, not unlike the replication controller itself. +```console -### Labels +$ kubectl create -f ./replication.yaml +replicationcontrollers/nginx -The population of pods that a replication controller is monitoring is defined with a [label selector](labels.md#label-selectors), which creates a loosely coupled relationship between the controller and the pods controlled, in contrast to pods, which are more tightly coupled to their definition. We deliberately chose not to represent the set of pods controlled using a fixed-length array of pod specifications, because our experience is that approach increases complexity of management operations, for both clients and the system. +``` -The replication controller should verify that the pods created from the specified template have labels that match its label selector. Though it isn't verified yet, you should also ensure that only one replication controller controls any given pod, by ensuring that the label selectors of replication controllers do not target overlapping sets. If you do end up with multiple controllers that have overlapping selectors, you will have to manage the deletion yourself with --cascade=false until there are no controllers with an overlapping superset of selectors. +Check on the status of the replication controller using this command: -Note that replication controllers may themselves have labels and would generally carry the labels their corresponding pods have in common, but these labels do not affect the behavior of the replication controllers. +```console + +$ kubectl describe replicationcontrollers/nginx +Name: nginx +Namespace: default +Image(s): nginx +Selector: app=nginx +Labels: app=nginx +Replicas: 3 current / 3 desired +Pods Status: 0 Running / 3 Waiting / 0 Succeeded / 0 Failed +Events: + FirstSeen LastSeen Count From +SubobjectPath Reason Message + Thu, 24 Sep 2015 10:38:20 -0700 Thu, 24 Sep 2015 10:38:20 -0700 1 +{replication-controller } SuccessfulCreate Created pod: nginx-qrm3m + Thu, 24 Sep 2015 10:38:20 -0700 Thu, 24 Sep 2015 10:38:20 -0700 1 +{replication-controller } SuccessfulCreate Created pod: nginx-3ntk0 + Thu, 24 Sep 2015 10:38:20 -0700 Thu, 24 Sep 2015 10:38:20 -0700 1 +{replication-controller } SuccessfulCreate Created pod: nginx-4ok8v + +``` + +Here, 3 pods have been made, but none are running yet, perhaps because the image is being pulled. +A little later, the same command may show: + +``` +Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed + +``` + +To list all the pods that belong to the rc in a machine readable form, you can use a command like this: + +```console + +$ pods=$(kubectl get pods --selector=app=nginx --output=jsonpath={.items..metadata.name}) +echo $pods +nginx-3ntk0 nginx-4ok8v nginx-qrm3m + +``` + +Here, the selector is the same as the selector for the replication controller (seen in the +`kubectl describe` output, and in a different form in `replication.yaml`. The `--output=jsonpath` option +specifies an expression that just gets the name from each pod in the returned list. + + +## Writing a Replication Controller Spec + +As with all other Kubernetes config, a Job needs `apiVersion`, `kind`, and `metadata` fields. For +general information about working with config files, see [here](simple-yaml.md), +[here](configuring-containers.md), and [here](working-with-resources.md). + +A Replication Controller also needs a [`.spec` section](../devel/api-conventions.md#spec-and-status). + +### Pod Template + +The `.spec.template` is the only required field of the `.spec`. + +The `.spec.template` is a [pod template](replication-controller.md#pod-template). It has exactly +the same schema as a [pod](pods.md), except it is nested and does not have an `apiVersion` or +`kind`. + +In addition to required fields for a Pod, a pod template in a job must specify appropriate +labels (see [pod selector](#pod-selector) and an appropriate restart policy. + +Only a [`RestartPolicy`](pod-states.md) equal to `Always` is allowed, which is the default +if not specified. + +For local container restarts, replication controllers delegate to an agent on the node, +for example the [Kubelet](../admin/kubelet.md) or Docker. + +### Labels on the Replication Controller + +The replication controller can itself have labels (`.metadata.labels`). Typically, you +would set these the same as the `.spec.template.metadata.labels`; if `.metadata.labels` is not specified +then it is defaulted to `.spec.template.metadata.labels`. However, they are allowed to be +different, and the `.metadata.labels` do not affec the behavior of the replication controller. + +### Pod Selector + +The `.spec.selector` field is a [label selector](labels.md#label-selectors). A replication +controller manages all the pods with labels which match the selector. It does not distinguish +between pods which it created or deleted versus pods which some other person or process created or +deleted. This allows the replication controller to be replaced without affecting the running pods. + +If specified, the `.spec.template.metadata.labels` must be equal to the `.spec.selector`, or it will +be rejected by the API. If `.spec.selector` is unspecified, it will be defaulted to +`.spec.template.metadata.labels`. + +Also you should not normally create any pods whose labels match this selector, either directly, via +another ReplicationController or via another controller such as Job. Otherwise, the +ReplicationController will think that those pods were created by it. Kubernetes will not stop you +from doing this. + +If you do end up with multiple controllers that have overlapping selectors, you +will have to manage the deletion yourself (see [below](#updating-a-replication-controller)). + +### Multiple Replicas + +You can specify how many pods should run concurrently by setting `.spec.replicas` to the number +of pods you would like to have running concurrently. The number running at any time may be higher +or lower, such as if the replicas was just increased or decreased, or if a pod is gracefully +shutdown, and a replacement starts early. + +If you do not specify `.spec.replicas`, then it defaults to 1. + +## Working with Replication Controllers + +### Deleting a Replication Controller and its Pods + +To delete a replication controller and all its pods, use [`kubectl +delete`](kubectl/kubectl_delete.md). Kubectl will scale the replication controller to zero and wait +for it to delete each pod before deleting the replication controller itself. If this kubectl +command is interrupted, it can be restarted. + +When using the REST API or go client library, you need to do the steps explicitly (scale replicas to +0, wait for pod deletions, then delete the replication controller). + +### Deleting just a Replication Controller + +You can delete a replication controller without affecting any of its pods. + +Using kubectl, specify the `--cascade=false` option to [`kubectl delete`](kubectl/kubectl_delete.md). + +When using the REST API or go client library, simply delete the replication controller object. + +Once the original is deleted, you can create a new replication controller to replace it. As long +as the old and new `.spec.selector` are the same, then the new one will adopt the old pods. +However, it will not make any effort to make existing pods match a new, different pod template. +To update pods to a new spec in a controlled way, use a [rolling update](#rolling-updates). + +### Isolating pods from a Replication Controller Pods may be removed from a replication controller's target set by changing their labels. This technique may be used to remove pods from service for debugging, data recovery, etc. Pods that are removed in this way will be replaced automatically (assuming that the number of replicas is not also changed). -Similarly, deleting a replication controller using the API does not affect the pods it created. Its `replicas` field must first be set to `0` in order to delete the pods controlled. (Note that the client tool, `kubectl`, provides a single operation, [delete](kubectl/kubectl_delete.md) to delete both the replication controller and the pods it controls. If you want to leave the pods running when deleting a replication controller, specify `--cascade=false`. However, there is no such operation in the API at the moment) - -## Responsibilities of the replication controller - -The replication controller simply ensures that the desired number of pods matches its label selector and are operational. Currently, only terminated pods are excluded from its count. In the future, [readiness](http://issue.k8s.io/620) and other information available from the system may be taken into account, we may add more controls over the replacement policy, and we plan to emit events that could be used by external clients to implement arbitrarily sophisticated replacement and/or scale-down policies. - -The replication controller is forever constrained to this narrow responsibility. It itself will not perform readiness nor liveness probes. Rather than performing auto-scaling, it is intended to be controlled by an external auto-scaler (as discussed in [#492](http://issue.k8s.io/492)), which would change its `replicas` field. We will not add scheduling policies (e.g., [spreading](http://issue.k8s.io/367#issuecomment-48428019)) to the replication controller. Nor should it verify that the pods controlled match the currently specified template, as that would obstruct auto-sizing and other automated processes. Similarly, completion deadlines, ordering dependencies, configuration expansion, and other features belong elsewhere. We even plan to factor out the mechanism for bulk pod creation ([#170](http://issue.k8s.io/170)). - -The replication controller is intended to be a composable building-block primitive. We expect higher-level APIs and/or tools to be built on top of it and other complementary primitives for user convenience in the future. The "macro" operations currently supported by kubectl (run, stop, scale, rolling-update) are proof-of-concept examples of this. For instance, we could imagine something like [Asgard](http://techblog.netflix.com/2012/06/asgard-web-based-cloud-management-and.html) managing replication controllers, auto-scalers, services, scheduling policies, canaries, etc. - ## Common usage patterns ### Rescheduling @@ -121,12 +290,50 @@ In addition to running multiple releases of an application while a rolling updat For instance, a service might target all pods with `tier in (frontend), environment in (prod)`. Now say you have 10 replicated pods that make up this tier. But you want to be able to 'canary' a new version of this component. You could set up a replication controller with `replicas` set to 9 for the bulk of the replicas, with labels `tier=frontend, environment=prod, track=stable`, and another replication controller with `replicas` set to 1 for the canary, with labels `tier=frontend, environment=prod, track=canary`. Now the service is covering both the canary and non-canary pods. But you can mess with the replication controllers separately to test things out, monitor the results, etc. +### Using Replication Controllers with Services + +Multiple replication controllers can sit behind a single service, so that, for example, some traffic +goes to the old version, and some goes to the new version. + +A replication controller will never terminate on its own, but it isn't expected to be as long-lived as services. Services may be composed of pods controlled by multiple replication controllers, and it is expected that many replication controllers may be created and destroyed over the lifetime of a service (for instance, to perform an update of pods that run the service). Both services themselves and their clients should remain oblivious to the replication controllers that maintain the pods of the services. + +## Writing programs for Replication + +Pods created by a replication controller are intended to be fungible and semantically identical, though their configurations may become heterogeneous over time. This is an obvious fit for replicated stateless servers, but replication controllers can also be used to maintain availability of master-elected, sharded, and worker-pool applications. Such applications should use dynamic work assignment mechanisms, such as the [etcd lock module](https://coreos.com/docs/distributed-configuration/etcd-modules/) or [RabbitMQ work queues](https://www.rabbitmq.com/tutorials/tutorial-two-python.html), as opposed to static/one-time customization of the configuration of each pod, which is considered an anti-pattern. Any pod customization performed, such as vertical auto-sizing of resources (e.g., cpu or memory), should be performed by another online controller process, not unlike the replication controller itself. + +## Responsibilities of the replication controller + +The replication controller simply ensures that the desired number of pods matches its label selector and are operational. Currently, only terminated pods are excluded from its count. In the future, [readiness](http://issue.k8s.io/620) and other information available from the system may be taken into account, we may add more controls over the replacement policy, and we plan to emit events that could be used by external clients to implement arbitrarily sophisticated replacement and/or scale-down policies. + +The replication controller is forever constrained to this narrow responsibility. It itself will not perform readiness nor liveness probes. Rather than performing auto-scaling, it is intended to be controlled by an external auto-scaler (as discussed in [#492](http://issue.k8s.io/492)), which would change its `replicas` field. We will not add scheduling policies (e.g., [spreading](http://issue.k8s.io/367#issuecomment-48428019)) to the replication controller. Nor should it verify that the pods controlled match the currently specified template, as that would obstruct auto-sizing and other automated processes. Similarly, completion deadlines, ordering dependencies, configuration expansion, and other features belong elsewhere. We even plan to factor out the mechanism for bulk pod creation ([#170](http://issue.k8s.io/170)). + +The replication controller is intended to be a composable building-block primitive. We expect higher-level APIs and/or tools to be built on top of it and other complementary primitives for user convenience in the future. The "macro" operations currently supported by kubectl (run, stop, scale, rolling-update) are proof-of-concept examples of this. For instance, we could imagine something like [Asgard](http://techblog.netflix.com/2012/06/asgard-web-based-cloud-management-and.html) managing replication controllers, auto-scalers, services, scheduling policies, canaries, etc. + + ## API Object Replication controller is a top-level resource in the kubernetes REST API. More details about the API object can be found at: [ReplicationController API object](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/docs/api-reference/v1/definitions.html#_v1_replicationcontroller). +## Alternatives to Replication Controller + +### Bare Pods + +Unlike in the case where a user directly created pods, a replication controller replaces pods that are deleted or terminated for any reason, such as in the case of node failure or disruptive node maintenance, such as a kernel upgrade. For this reason, we recommend that you use a replication controller even if your application requires only a single pod. Think of it similarly to a process supervisor, only it supervises multiple pods across multiple nodes instead of individual processes on a single node. A replication controller delegates local container restarts to some agent on the node (e.g., Kubelet or Docker). + +### Job + +Use a [Job](jobs.md) instead of a replication controller for pods that are expected to terminate on their own +(i.e. batch jobs). + +### DaemonSet + +Use a [DaemonSet](../admin/daemons.md) instead of a replication controller for pods that provide a +machine-level function, such as machine monitoring or machine logging. These pods have a lifetime is tied +to machine lifetime: the pod needs to be running on the machine before other pods start, and are +safe to terminate when the machine is otherwise ready to be rebooted/shutdown. + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/replication-controller.md?pixel)]() diff --git a/docs/user-guide/replication.yaml b/docs/user-guide/replication.yaml new file mode 100644 index 00000000000..6eff0b9b576 --- /dev/null +++ b/docs/user-guide/replication.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: nginx +spec: + replicas: 3 + selector: + app: nginx + template: + metadata: + name: nginx + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 diff --git a/docs/user-guide/secrets.md b/docs/user-guide/secrets.md index a7a46daf6fd..2c6dd21079d 100644 --- a/docs/user-guide/secrets.md +++ b/docs/user-guide/secrets.md @@ -44,15 +44,23 @@ a docker image. See [Secrets design document](../design/secrets.md) for more inf - [Secrets](#secrets) - [Overview of Secrets](#overview-of-secrets) - - [Service Accounts Automatically Create and Attach Secrets with API Credentials](#service-accounts-automatically-create-and-attach-secrets-with-api-credentials) - - [Creating a Secret Manually](#creating-a-secret-manually) - - [Manually specifying a Secret to be Mounted on a Pod](#manually-specifying-a-secret-to-be-mounted-on-a-pod) - - [Manually specifying an imagePullSecret](#manually-specifying-an-imagepullsecret) - - [Arranging for imagePullSecrets to be Automatically Attached](#arranging-for-imagepullsecrets-to-be-automatically-attached) - - [Automatic Mounting of Manually Created Secrets](#automatic-mounting-of-manually-created-secrets) + - [Built-in Secrets](#built-in-secrets) + - [Service Accounts Automatically Create and Attach Secrets with API Credentials](#service-accounts-automatically-create-and-attach-secrets-with-api-credentials) + - [Creating your own Secrets](#creating-your-own-secrets) + - [Creating a Secret Using kubectl create secret](#creating-a-secret-using-kubectl-create-secret) + - [Creating a Secret Manually](#creating-a-secret-manually) + - [Decoding a Secret](#decoding-a-secret) + - [Using Secrets](#using-secrets) + - [Using Secrets as Files from a Pod](#using-secrets-as-files-from-a-pod) + - [Consuming Secret Values from Volumes](#consuming-secret-values-from-volumes) + - [Using Secrets as Environment Variables](#using-secrets-as-environment-variables) + - [Consuming Secret Values from Environment Variables](#consuming-secret-values-from-environment-variables) + - [Using imagePullSecrets](#using-imagepullsecrets) + - [Manually specifying an imagePullSecret](#manually-specifying-an-imagepullsecret) + - [Arranging for imagePullSecrets to be Automatically Attached](#arranging-for-imagepullsecrets-to-be-automatically-attached) + - [Automatic Mounting of Manually Created Secrets](#automatic-mounting-of-manually-created-secrets) - [Details](#details) - [Restrictions](#restrictions) - - [Consuming Secret Values](#consuming-secret-values) - [Secret and Pod Lifetime interaction](#secret-and-pod-lifetime-interaction) - [Use cases](#use-cases) - [Use-Case: Pod with ssh keys](#use-case-pod-with-ssh-keys) @@ -75,10 +83,12 @@ more control over how it is used, and reduces the risk of accidental exposure. Users can create secrets, and the system also creates some secrets. To use a secret, a pod needs to reference the secret. -A secret can be used with a pod in two ways: either as files in a [volume](volumes.md) mounted on one or more of -its containers, or used by kubelet when pulling images for the pod. +A secret can be used with a pod in two ways: as files in a [volume](volumes.md) mounted on one or more of +its containers, in environment variables, or used by kubelet when pulling images for the pod. -### Service Accounts Automatically Create and Attach Secrets with API Credentials +### Built-in Secrets + +#### Service Accounts Automatically Create and Attach Secrets with API Credentials Kubernetes automatically creates secrets which contain credentials for accessing the API and it automatically modifies your pods to use this type of @@ -91,9 +101,70 @@ this is the recommended workflow. See the [Service Account](service-accounts.md) documentation for more information on how Service Accounts work. -### Creating a Secret Manually +### Creating your own Secrets -This is an example of a simple secret, in yaml format: +#### Creating a Secret Using kubectl create secret + +Say that some pods need to access a database. The +username and password that the pods should use is in the files +`./username.txt` and `./password.txt` on your local machine. + +```console +# Create files needed for rest of example. +$ echo "admin" > ./username.txt +$ echo "1f2d1e2e67df" > ./password.txt +``` + +The `kubectl create secret` command +packages these files into a Secret and creates +the object on the Apiserver. + +```console +$ kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt +secret "db-user-pass" created +``` + +You can check that the secret was created like this: + +```console +$ kubectl get secrets +NAME TYPE DATA AGE +db-user-pass Opaque 2 51s +$ kubectl describe secrets/db-user-pass +Name: db-user-pass +Namespace: default +Labels: +Annotations: + +Type: Opaque + +Data +==== +password.txt: 13 bytes +username.txt: 6 bytes +``` + +Note that neither `get` nor `describe` shows the contents of the file by default. +This is to protect the secret from being exposed accidentally to someone looking +or from being stored in a terminal log. + +See [decoding a secret](#decoding-a-secret) for how to see the contents. + +#### Creating a Secret Manually + +You can also create a secret object in a file first, +in json or yaml format, and then create that object. + +Each item must be base64 encoded: + +```console +$ echo "admin" | base64 +YWRtaW4K +$ echo "1f2d1e2e67df" | base64 +MWYyZDFlMmU2N2RmCg== +``` + +Now write a secret object that looks like this: ```yaml apiVersion: v1 @@ -102,22 +173,69 @@ metadata: name: mysecret type: Opaque data: - password: dmFsdWUtMg0K - username: dmFsdWUtMQ0K + password: MWYyZDFlMmU2N2RmCg== + username: YWRtaW4K ``` The data field is a map. Its keys must match [`DNS_SUBDOMAIN`](../design/identifiers.md), except that leading dots are also -allowed. The values are arbitrary data, encoded using base64. The values of -username and password in the example above, before base64 encoding, -are `value-1` and `value-2`, respectively, with carriage return and newline characters at the end. +allowed. The values are arbitrary data, encoded using base64. -Create the secret using [`kubectl create`](kubectl/kubectl_create.md). +Create the secret using [`kubectl create`](kubectl/kubectl_create.md): -Once the secret is created, you can need to modify your pod to specify -that it should use the secret. +```console +$ kubectl create -f ./secret.yaml +secret "mysecret" created +``` -### Manually specifying a Secret to be Mounted on a Pod +**Encoding Note:** The serialized JSON and YAML values of secret data are encoded as +base64 strings. Newlines are not valid within these strings and must be +omitted (i.e. do not use `-b` option of `base64` which breaks long lines.) + +#### Decoding a Secret + +Get back the secret created in the previous section: + +```console +$ kubectl get secret mysecret -o yaml +apiVersion: v1 +data: + password: MWYyZDFlMmU2N2RmCg== + username: YWRtaW4K +kind: Secret +metadata: + creationTimestamp: 2016-01-22T18:41:56Z + name: mysecret + namespace: default + resourceVersion: "164619" + selfLink: /api/v1/namespaces/default/secrets/mysecret + uid: cfee02d6-c137-11e5-8d73-42010af00002 +type: Opaque +``` + +Decode the password field: + +```console +$ echo "MWYyZDFlMmU2N2RmCg==" | base64 -D +1f2d1e2e67df +``` + +### Using Secrets + +Secrets can be mounted as data volumes or be exposed as environment variables to +be used by a container in a pod. They can also be used by other parts of the +system, without being directly exposed to the pod. For example, they can hold +credentials that other parts of the system should use to interact with external +systems on your behalf. + +#### Using Secrets as Files from a Pod + +To consume a Secret in a volume in a Pod: + +1. Create a secret or use an existing one. Multiple pods can reference the same secret. +1. Modify your Pod definition to add a volume under `spec.volumes[]`. Name the volume anything, and have a `spec.volumes[].secret.secretName` field equal to the name of the secret object. +1. Add a `spec.containers[].volumeMounts[]` to each container that needs the secret. Specify `spec.containers[].volumeMounts[].readOnly = true` and `spec.containers[].volumeMounts[].mountPath` to an unused directory name where you would like the secrets to appear. +1. Modify your image and/or command line so that the the program looks for files in that directory. Each key in the secret `data` map becomes the filename under `mountPath`. This is an example of a pod that mounts a secret in a volume: @@ -149,21 +267,91 @@ This is an example of a pod that mounts a secret in a volume: } ``` -Each secret you want to use needs its own `spec.volumes`. +Each secret you want to use needs to be referred to in `spec.volumes`. If there are multiple containers in the pod, then each container needs its own `volumeMounts` block, but only one `spec.volumes` is needed per secret. -You can package many files into one secret, or use many secrets, -whichever is convenient. +You can package many files into one secret, or use many secrets, whichever is convenient. See another example of creating a secret and a pod that consumes that secret in a volume [here](secrets/). -### Manually specifying an imagePullSecret +##### Consuming Secret Values from Volumes + +Inside the container that mounts a secret volume, the secret keys appear as +files and the secret values are base-64 decoded and stored inside these files. +This is the result of commands +executed inside the container from the example above: + +```console +$ ls /etc/foo/ +username +password +$ cat /etc/foo/username +admin +$ cat /etc/foo/password +1f2d1e2e67df +``` + +The program in a container is responsible for reading the secret(s) from the +files. + +#### Using Secrets as Environment Variables + +To use a secret in an environment variable in a pod: + +1. Create a secret or use an existing one. Multiple pods can reference the same secret. +1. Modify your Pod definition in each container that you wish to consume the value of a secret key to add an environment variable for each secret key you wish to consume. The environment variable that consumes the secret key should populate the secret's name and key in `env[x].valueFrom.secretKeyRef`. +1. Modify your image and/or command line so that the the program looks for values in the specified environment variabless + +This is an example of a pod that mounts a secret in a volume: + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: secret-env-pod +spec: + containers: + - name: mycontainer + image: redis + env: + - name: SECRET_USERNAME + valueFrom: + secretKeyRef: + name: mysecret + key: username + - name: SECRET_PASSWORD + valueFrom: + secretKeyRef: + name: mysecret + key: password + restartPolicy: Never +``` + +##### Consuming Secret Values from Environment Variables + +Inside a container that consumes a secret in an environment variables, the secret keys appear as +normal environment variables containing the base-64 decoded values of the secret data. +This is the result of commands executed inside the container from the example above: + +```console +$ echo $SECRET_USERNAME +admin +$ cat /etc/foo/password +1f2d1e2e67df +``` + +#### Using imagePullSecrets + +An imagePullSecret is a way to pass a secret that contains a Docker (or other) image registry +password to the Kubelet so it can pull a private image on behalf of your Pod. + +##### Manually specifying an imagePullSecret Use of imagePullSecrets is described in the [images documentation](images.md#specifying-imagepullsecrets-on-a-pod) -### Arranging for imagePullSecrets to be Automatically Attached +##### Arranging for imagePullSecrets to be Automatically Attached You can manually create an imagePullSecret, and reference it from a serviceAccount. Any pods created with that serviceAccount @@ -172,8 +360,7 @@ field set to that of the service account. See [here](service-accounts.md#adding-imagepullsecrets-to-a-service-account) for a detailed explanation of that process. - -### Automatic Mounting of Manually Created Secrets +#### Automatic Mounting of Manually Created Secrets We plan to extend the service account behavior so that manually created secrets (e.g. one containing a token for accessing a github account) @@ -202,31 +389,6 @@ controller. It does not include pods created via the kubelets `--manifest-url` flag, its `--config` flag, or its REST API (these are not common ways to create pods.) -### Consuming Secret Values - -Inside the container that mounts a secret volume, the secret keys appear as -files and the secret values are base-64 decoded and stored inside these files. -This is the result of commands -executed inside the container from the example above: - -```console -$ ls /etc/foo/ -username -password -$ cat /etc/foo/username -value-1 -$ cat /etc/foo/password -value-2 -``` - -The program in a container is responsible for reading the secret(s) from the -files. Currently, if a program expects a secret to be stored in an environment -variable, then the user needs to modify the image to populate the environment -variable from the file as an step before running the main program. Future -versions of Kubernetes are expected to provide more automation for populating -environment variables from files. - - ### Secret and Pod Lifetime interaction When a pod is created via the API, there is no check whether a referenced @@ -259,25 +421,14 @@ update the data of existing secrets, but to create new ones with distinct names. ### Use-Case: Pod with ssh keys -To create a pod that uses an ssh key stored as a secret, we first need to create a secret: +Create a secret containing some ssh keys: -```json -{ - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "ssh-key-secret" - }, - "data": { - "id-rsa": "dmFsdWUtMg0KDQo=", - "id-rsa.pub": "dmFsdWUtMQ0K" - } -} +```console +$ kubectl create secret generic my-secret --from-file=ssh-privatekey=/path/to/.ssh/id_rsa --from-file=ssh-publickey=/path/to/.ssh/id_rsa.pub ``` -**Note:** The serialized JSON and YAML values of secret data are encoded as -base64 strings. Newlines are not valid within these strings and must be -omitted. +**Security Note:** think carefully before sending your own ssh keys: other users of the cluster may have access to the secret. Use a service account which you want to have accessible to all the users with whom you share the kubernetes cluster, and can revoke if they are compromised. + Now we can create a pod which references the secret with the ssh key and consumes it in a volume: @@ -331,39 +482,16 @@ This example illustrates a pod which consumes a secret containing prod credentials and another pod which consumes a secret with test environment credentials. -The secrets: +Make the secrets: -```json -{ - "apiVersion": "v1", - "kind": "List", - "items": - [{ - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "prod-db-secret" - }, - "data": { - "password": "dmFsdWUtMg0KDQo=", - "username": "dmFsdWUtMQ0K" - } - }, - { - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "test-db-secret" - }, - "data": { - "password": "dmFsdWUtMg0KDQo=", - "username": "dmFsdWUtMQ0K" - } - }] -} +```console +$ kubectl create secret generic prod-db-password --from-literal=user=produser --from-literal=password=Y4nys7f11 +secret "prod-db-password" created +$ kubectl create secret generic test-db-password --from-literal=user=testuser --from-literal=password=iluvtests +secret "test-db-password" created ``` -The pods: +Now make the pods: ```json { @@ -468,7 +596,7 @@ one called, say, `prod-user` with the `prod-db-secret`, and one called, say, "containers": [ { "name": "db-client-container", - "image": "myClientImage", + "image": "myClientImage" } ] } diff --git a/docs/user-guide/services.md b/docs/user-guide/services.md index 4596ce382c7..5e1e35570b0 100644 --- a/docs/user-guide/services.md +++ b/docs/user-guide/services.md @@ -191,7 +191,7 @@ created. You can manually map the service to your own specific endpoints: "subsets": [ { "addresses": [ - { "IP": "1.2.3.4" } + { "ip": "1.2.3.4" } ], "ports": [ { "port": 9376 } diff --git a/docs/user-guide/ui-dashboard-deploy-more.png b/docs/user-guide/ui-dashboard-deploy-more.png new file mode 100644 index 00000000000..b76ee9c4ae2 Binary files /dev/null and b/docs/user-guide/ui-dashboard-deploy-more.png differ diff --git a/docs/user-guide/ui-dashboard-deploy-simple.png b/docs/user-guide/ui-dashboard-deploy-simple.png new file mode 100644 index 00000000000..55e2642d9a5 Binary files /dev/null and b/docs/user-guide/ui-dashboard-deploy-simple.png differ diff --git a/docs/user-guide/ui-dashboard-rcs-detail.png b/docs/user-guide/ui-dashboard-rcs-detail.png new file mode 100644 index 00000000000..80974213e80 Binary files /dev/null and b/docs/user-guide/ui-dashboard-rcs-detail.png differ diff --git a/docs/user-guide/ui-dashboard-rcs.png b/docs/user-guide/ui-dashboard-rcs.png new file mode 100644 index 00000000000..5825cfbb470 Binary files /dev/null and b/docs/user-guide/ui-dashboard-rcs.png differ diff --git a/docs/user-guide/ui-dashboard-zerostate.png b/docs/user-guide/ui-dashboard-zerostate.png new file mode 100644 index 00000000000..348bfeefcb4 Binary files /dev/null and b/docs/user-guide/ui-dashboard-zerostate.png differ diff --git a/docs/user-guide/ui.md b/docs/user-guide/ui.md index b99a4ef25bd..045b4081e08 100644 --- a/docs/user-guide/ui.md +++ b/docs/user-guide/ui.md @@ -32,56 +32,79 @@ Documentation for other releases can be found at -# Kubernetes User Interface +# Kubernetes Dashboard User Interface -Kubernetes has a web-based user interface that displays the current cluster state graphically. +Kubernetes has a web-based user interface that allows users to manage applications running in +the cluster and troubleshoot them, as well as manage the cluster itself. -## Accessing the UI +## Accessing the Dashboard -By default, the Kubernetes UI is deployed as a cluster addon. To access it, visit `https:///ui`, which redirects to `https:///api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/`. +By default, the Kubernetes Dashboard is deployed as a cluster addon. To access it, visit +`https:///ui`, which redirects to +`https:///api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard`. -If you find that you're not able to access the UI, it may be because the kube-ui service has not been started on your cluster. In that case, you can start it manually with: +If you find that you're not able to access the Dashboard, it may be because the kubernetes-dashboard +service has not been started on your cluster. In that case, you can start it manually with: ```sh -kubectl create -f cluster/addons/kube-ui/kube-ui-rc.yaml --namespace=kube-system -kubectl create -f cluster/addons/kube-ui/kube-ui-svc.yaml --namespace=kube-system +kubectl create -f cluster/addons/dashboard/dashboard-controller.yaml --namespace=kube-system +kubectl create -f cluster/addons/dashboard/dashboard-service.yaml --namespace=kube-system ``` -Normally, this should be taken care of automatically by the [`kube-addons.sh`](http://releases.k8s.io/HEAD/cluster/saltbase/salt/kube-addons/kube-addons.sh) script that runs on the master. +Normally, this should be taken care of automatically by the +[`kube-addons.sh`](http://releases.k8s.io/HEAD/cluster/saltbase/salt/kube-addons/kube-addons.sh) +script that runs on the master. Release notes and development versions of the Dashboard can be +found at https://github.com/kubernetes/dashboard/releases. -## Using the UI +## Overview -The Kubernetes UI can be used to introspect your current cluster, such as checking how resources are used, or looking at error messages. You cannot, however, use the UI to modify your cluster. +The Dashboard can be used to provide an overview of applications running on the cluster and provide +information on any errors that have occurred. You can also inspect your replication controllers and +corresponding services, change the number of replicas and deploy new applications using a wizard. -### Node Resource Usage +### Using the Dashboard -After accessing Kubernetes UI, you'll see a homepage dynamically listing out all nodes in your current cluster, with related information including internal IP addresses, CPU usage, memory usage, and file systems usage. -![Kubernetes UI home page](k8s-ui-overview.png) +When first accessing the dashboard on an empty cluster, you should see the welcome page. +This contains some useful links to the documentation, and a big button to deploy your first +application. +![Kubernetes Dashboard welcome page](ui-dashboard-zerostate.png) -### Dashboard Views +### Deploying applications -Click on the "Views" button in the top-right of the page to see other views available, which include: Explore, Pods, Nodes, Replication Controllers, Services, and Events. +The Kubernetes Dashboard lets you create and deploy a Replication Controller with a simple wizard. +You can simply provide the name for your application, the name of a Docker container (commonly +hosted on the Google Container Registry or Docker Hub) and the target number of Pods you want deployed. +Optionally, if your container listens on a port, you can also provide a port and target port. The +wizard will create a corresponding Kubernetes Service which will route to your deployed Pods. -#### Explore View +![Kubernetes Dashboard deploy form](ui-dashboard-deploy-simple.png) -The "Explore" view allows your to see the pods, replication controllers, and services in current cluster easily. -![Kubernetes UI Explore View](k8s-ui-explore.png) -The "Group by" dropdown list allows you to group these resources by a number of factors, such as type, name, host, etc. -![Kubernetes UI Explore View - Group by](k8s-ui-explore-groupby.png) -You can also create filters by clicking on the down triangle of any listed resource instances and choose which filters you want to add. -![Kubernetes UI Explore View - Filter](k8s-ui-explore-filter.png) -To see more details of each resource instance, simply click on it. -![Kubernetes UI - Pod](k8s-ui-explore-poddetail.png) +If needed, you can expand the "more options" section where you can change more advanced settings, +such as the Kubernetes namespace that the resulting Pods run in, image pull secrets for private +registries, resource limits, container entrypoint and privileged status. -### Other Views +![Kubernetes Dashboard deploy form advanced options](ui-dashboard-deploy-more.png) -Other views (Pods, Nodes, Replication Controllers, Services, and Events) simply list information about each type of resource. You can also click on any instance for more details. -![Kubernetes UI - Nodes](k8s-ui-nodes.png) +#### Applications view + +If some applications are running on your cluster, the Dashboard will default to showing an overview. +Individual applications are shown as cards - where an application is defined as a Replication Controller +and its corresponding services. Each card shows the current number of replicas running and desired, +along with any errors reported by Kubernetes. You can also view logs, make quick changes to the number +of replicas or delete the application directly from the menu in the cards' corner. + +![Kubernetes Dashboard applications view](ui-dashboard-rcs.png) + +Clicking "View details" from the card menu will take you to the following screen, where you +can view more information about the Pods that make up your application. The events tab can be useful +in debugging flapping applications. + +![Kubernetes Dashboard application detail](ui-dashboard-rcs-detail.png) ## More Information -For more information, see the [Kubernetes UI development document](http://releases.k8s.io/HEAD/www/README.md) in the www directory. - +For more information, see the +[Kubernetes Dashboard repository](https://github.com/kubernetes/dashboard). [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/ui.md?pixel)]() diff --git a/docs/user-guide/update-demo/images/kitten/Dockerfile b/docs/user-guide/update-demo/images/kitten/Dockerfile index b053138b352..aef0de58c6b 100644 --- a/docs/user-guide/update-demo/images/kitten/Dockerfile +++ b/docs/user-guide/update-demo/images/kitten/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. diff --git a/docs/user-guide/update-demo/images/nautilus/Dockerfile b/docs/user-guide/update-demo/images/nautilus/Dockerfile index 2904a107916..16280b82159 100644 --- a/docs/user-guide/update-demo/images/nautilus/Dockerfile +++ b/docs/user-guide/update-demo/images/nautilus/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. diff --git a/docs/user-guide/volumes.md b/docs/user-guide/volumes.md index 46dc57843a3..b59c1381448 100644 --- a/docs/user-guide/volumes.md +++ b/docs/user-guide/volumes.md @@ -67,6 +67,7 @@ Familiarity with [pods](pods.md) is suggested. - [persistentVolumeClaim](#persistentvolumeclaim) - [downwardAPI](#downwardapi) - [FlexVolume](#flexvolume) + - [AzureFileVolume](#azurefilevolume) - [Resources](#resources) @@ -124,6 +125,7 @@ Kubernetes supports several types of Volumes: * `secret` * `persistentVolumeClaim` * `downwardAPI` + * `azureFileVolume` We welcome additional contributions. @@ -427,6 +429,13 @@ an alpha feature and may change in future. More details are in [here](../../examples/flexvolume/README.md) +### AzureFileVolume + +A `AzureFileVolume` is used to mount a Microsoft Azure File Volume (SMB 2.1 and 3.0) +into a Pod. + +More details can be found [here](../../examples/azure_file/README.md) + ## Resources The storage media (Disk, SSD, etc) of an `emptyDir` volume is determined by the @@ -440,7 +449,6 @@ request a certain amount of space using a [resource](compute-resources.md) specification, and to select the type of media to use, for clusters that have several media types. - [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/volumes.md?pixel)]() diff --git a/docs/user-guide/walkthrough/README.md b/docs/user-guide/walkthrough/README.md index fa22775ef18..dd8c25d76e9 100644 --- a/docs/user-guide/walkthrough/README.md +++ b/docs/user-guide/walkthrough/README.md @@ -129,21 +129,21 @@ For this example we'll be creating a Redis pod with a named volume and volume mo 1. Define a volume: - ```yaml - volumes: - - name: redis-persistent-storage - emptyDir: {} - ``` + ```yaml + volumes: + - name: redis-persistent-storage + emptyDir: {} + ``` 2. Define a volume mount within a container definition: - ```yaml - volumeMounts: - # name must match the volume name below - - name: redis-persistent-storage - # mount path within the container - mountPath: /data/redis - ``` + ```yaml + volumeMounts: + # name must match the volume name below + - name: redis-persistent-storage + # mount path within the container + mountPath: /data/redis + ``` Example Redis pod definition with a persistent storage volume ([pod-redis.yaml](pod-redis.yaml)): diff --git a/examples/apiserver/README.md b/examples/apiserver/README.md index 522544984f8..d493f7fbdea 100644 --- a/examples/apiserver/README.md +++ b/examples/apiserver/README.md @@ -39,6 +39,12 @@ API objects. Some relevant issues: This code here is to examplify what it takes to write your own API server. +To start this example api server, run: + +``` +$ go run examples/apiserver/server/main.go +``` + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/apiserver/README.md?pixel)]() diff --git a/examples/apiserver/server.go b/examples/apiserver/apiserver.go similarity index 84% rename from examples/apiserver/server.go rename to examples/apiserver/apiserver.go index cd565e43a3c..e515f349b55 100644 --- a/examples/apiserver/server.go +++ b/examples/apiserver/apiserver.go @@ -14,12 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package apiserver import ( - "github.com/golang/glog" + "fmt" + "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup/v1" testgroupetcd "k8s.io/kubernetes/examples/apiserver/rest" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/rest" "k8s.io/kubernetes/pkg/apimachinery" "k8s.io/kubernetes/pkg/apimachinery/registered" @@ -44,23 +46,27 @@ func newStorageDestinations(groupName string, groupMeta *apimachinery.GroupMeta) return &storageDestinations, nil } -func main() { +func Run() error { config := genericapiserver.Config{ EnableIndex: true, APIPrefix: "/api", APIGroupPrefix: "/apis", + Serializer: api.Codecs, + } + s, err := genericapiserver.New(&config) + if err != nil { + return fmt.Errorf("Error in bringing up the server: %v", err) } - s := genericapiserver.New(&config) groupVersion := v1.SchemeGroupVersion groupName := groupVersion.Group groupMeta, err := registered.Group(groupName) if err != nil { - glog.Fatalf("%v", err) + return fmt.Errorf("%v", err) } storageDestinations, err := newStorageDestinations(groupName, groupMeta) if err != nil { - glog.Fatalf("Unable to init etcd: %v", err) + return fmt.Errorf("Unable to init etcd: %v", err) } restStorageMap := map[string]rest.Storage{ "testtypes": testgroupetcd.NewREST(storageDestinations.Get(groupName, "testtype"), s.StorageDecorator()), @@ -70,9 +76,12 @@ func main() { VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ groupVersion.Version: restStorageMap, }, + Scheme: api.Scheme, + NegotiatedSerializer: api.Codecs, } if err := s.InstallAPIGroups([]genericapiserver.APIGroupInfo{apiGroupInfo}); err != nil { - glog.Fatalf("Error in installing API: %v", err) + return fmt.Errorf("Error in installing API: %v", err) } s.Run(genericapiserver.NewServerRunOptions()) + return nil } diff --git a/examples/apiserver/apiserver_test.go b/examples/apiserver/apiserver_test.go new file mode 100644 index 00000000000..6f74dedd397 --- /dev/null +++ b/examples/apiserver/apiserver_test.go @@ -0,0 +1,108 @@ +/* +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. +*/ + +package apiserver + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "testing" + "time" + + "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup/v1" + + "github.com/stretchr/testify/assert" + "k8s.io/kubernetes/pkg/api/unversioned" +) + +var serverIP = "http://localhost:8080" + +var groupVersion = v1.SchemeGroupVersion + +func TestRun(t *testing.T) { + go func() { + if err := Run(); err != nil { + t.Fatalf("Error in bringing up the server: %v", err) + } + }() + if err := waitForApiserverUp(); err != nil { + t.Fatalf("%v", err) + } + testAPIGroup(t) + testAPIResourceList(t) +} + +func waitForApiserverUp() error { + for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { + _, err := http.Get(serverIP) + if err == nil { + return nil + } + } + return fmt.Errorf("waiting for apiserver timed out") +} + +func readResponse(serverURL string) ([]byte, error) { + response, err := http.Get(serverURL) + if err != nil { + return nil, fmt.Errorf("Error in fetching %s: %v", serverURL, err) + } + defer response.Body.Close() + contents, err := ioutil.ReadAll(response.Body) + if err != nil { + return nil, fmt.Errorf("Error reading response from %s: %v", serverURL, err) + } + return contents, nil +} + +func testAPIGroup(t *testing.T) { + serverURL := serverIP + "/apis/testgroup" + contents, err := readResponse(serverURL) + if err != nil { + t.Fatalf("%v", err) + } + var apiGroup unversioned.APIGroup + err = json.Unmarshal(contents, &apiGroup) + if err != nil { + t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) + } + assert.Equal(t, apiGroup.APIVersion, groupVersion.Version) + assert.Equal(t, apiGroup.Name, groupVersion.Group) + assert.Equal(t, 1, len(apiGroup.Versions)) + assert.Equal(t, apiGroup.Versions[0].GroupVersion, groupVersion.String()) + assert.Equal(t, apiGroup.Versions[0].Version, groupVersion.Version) + assert.Equal(t, apiGroup.Versions[0], apiGroup.PreferredVersion) +} + +func testAPIResourceList(t *testing.T) { + serverURL := serverIP + "/apis/testgroup/v1" + contents, err := readResponse(serverURL) + if err != nil { + t.Fatalf("%v", err) + } + var apiResourceList unversioned.APIResourceList + err = json.Unmarshal(contents, &apiResourceList) + if err != nil { + t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) + } + assert.Equal(t, apiResourceList.APIVersion, groupVersion.Version) + assert.Equal(t, apiResourceList.GroupVersion, groupVersion.String()) + assert.Equal(t, 1, len(apiResourceList.APIResources)) + assert.Equal(t, apiResourceList.APIResources[0].Name, "testtypes") + assert.True(t, apiResourceList.APIResources[0].Namespaced) +} diff --git a/examples/apiserver/server/main.go b/examples/apiserver/server/main.go new file mode 100644 index 00000000000..aec0ef0ec90 --- /dev/null +++ b/examples/apiserver/server/main.go @@ -0,0 +1,29 @@ +/* +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. +*/ + +package main + +import ( + "k8s.io/kubernetes/examples/apiserver" + + "github.com/golang/glog" +) + +func main() { + if err := apiserver.Run(); err != nil { + glog.Fatalf("Error in bringing up the server: %v", err) + } +} diff --git a/examples/azure_file/README.md b/examples/azure_file/README.md new file mode 100644 index 00000000000..0e014c8ab11 --- /dev/null +++ b/examples/azure_file/README.md @@ -0,0 +1,64 @@ + + + + +WARNING +WARNING +WARNING +WARNING +WARNING + +

    PLEASE NOTE: This document applies to the HEAD of the source tree

    + +If you are using a released version of Kubernetes, you should +refer to the docs that go with that version. + +Documentation for other releases can be found at +[releases.k8s.io](http://releases.k8s.io). + +-- + + + + + +# How to Use it? + +Install *cifs-utils* on the Kubernetes host. For example, on Fedora based Linux + + # yum -y install cifs-utils + +Note, as explained in [Azure File Storage for Linux](https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/), the Linux hosts and the file share must be in the same Azure region. + +Obtain an Microsoft Azure storage account and create a [secret](secret/azure-secret.yaml) that contains the base64 encoded Azure Storage account name and key. In the secret file, base64-encode Azure Storage account name and pair it with name *azurestorageaccountname*, and base64-encode Azure Storage access key and pair it with name *azurestorageaccountkey*. + +Then create a Pod using the volume spec based on [azure](azure.yaml). + +In the pod, you need to provide the following information: + +- *secretName*: the name of the secret that contains both Azure storage account name and key. +- *shareName*: The share name to be used. +- *readOnly*: Whether the filesystem is used as readOnly. + +Create the secret: + +```console + # kubectl create -f examples/azure_file/secret/azure-secret.yaml +``` + +You should see the account name and key from `kubectl get secret` + +Then create the Pod: + +```console + # kubectl create -f examples/azure_file/azure.yaml +``` + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/azure_file/README.md?pixel)]() + diff --git a/examples/azure_file/azure.yaml b/examples/azure_file/azure.yaml new file mode 100644 index 00000000000..6567f30799a --- /dev/null +++ b/examples/azure_file/azure.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Pod +metadata: + name: azure +spec: + containers: + - image: kubernetes/pause + name: azure + volumeMounts: + - name: azure + mountPath: /mnt/azure + volumes: + - name: azure + azureFile: + secretName: azure-secret + shareName: k8stest + readOnly: false diff --git a/examples/azure_file/secret/azure-secret.yaml b/examples/azure_file/secret/azure-secret.yaml new file mode 100644 index 00000000000..bf448bd9cef --- /dev/null +++ b/examples/azure_file/secret/azure-secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: azure-secret +type: Opaque +data: + azurestorageaccountname: azhzdGVzdA== + azurestorageaccountkey: eElGMXpKYm5ub2pGTE1Ta0JwNTBteDAyckhzTUsyc2pVN21GdDRMMTNob0I3ZHJBYUo4akQ2K0E0NDNqSm9nVjd5MkZVT2hRQ1dQbU02WWFOSHk3cWc9PQ== diff --git a/examples/cassandra/image/Dockerfile b/examples/cassandra/image/Dockerfile index 2ebd62fa5ab..d40c53ba085 100644 --- a/examples/cassandra/image/Dockerfile +++ b/examples/cassandra/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM google/debian:wheezy COPY cassandra.list /etc/apt/sources.list.d/cassandra.list diff --git a/examples/cassandra/image/Makefile b/examples/cassandra/image/Makefile index 79497b69598..df761ef387f 100644 --- a/examples/cassandra/image/Makefile +++ b/examples/cassandra/image/Makefile @@ -1,3 +1,17 @@ +# 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. + # build the cassandra image. VERSION=v7 diff --git a/examples/celery-rabbitmq/celery-app-add/Dockerfile b/examples/celery-rabbitmq/celery-app-add/Dockerfile index f507e0df647..13a6437a811 100644 --- a/examples/celery-rabbitmq/celery-app-add/Dockerfile +++ b/examples/celery-rabbitmq/celery-app-add/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM library/celery ADD celery_conf.py /data/celery_conf.py diff --git a/examples/celery-rabbitmq/flower/Dockerfile b/examples/celery-rabbitmq/flower/Dockerfile index 387ce3b98fd..cf70be419dd 100644 --- a/examples/celery-rabbitmq/flower/Dockerfile +++ b/examples/celery-rabbitmq/flower/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM ubuntu:trusty # update the package repository and install python pip diff --git a/examples/cluster-dns/images/backend/Dockerfile b/examples/cluster-dns/images/backend/Dockerfile index d45858468e9..dd1597001fa 100644 --- a/examples/cluster-dns/images/backend/Dockerfile +++ b/examples/cluster-dns/images/backend/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM python:2.7-slim COPY . /dns-backend diff --git a/examples/cluster-dns/images/backend/Makefile b/examples/cluster-dns/images/backend/Makefile index 1b5ae02503f..91d8c3dd070 100644 --- a/examples/cluster-dns/images/backend/Makefile +++ b/examples/cluster-dns/images/backend/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = v1 PREFIX = gcr.io/google_containers IMAGE = example-dns-backend diff --git a/examples/cluster-dns/images/frontend/Dockerfile b/examples/cluster-dns/images/frontend/Dockerfile index a2662881394..ba5bc065168 100644 --- a/examples/cluster-dns/images/frontend/Dockerfile +++ b/examples/cluster-dns/images/frontend/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM python:2.7-slim RUN pip install requests diff --git a/examples/cluster-dns/images/frontend/Makefile b/examples/cluster-dns/images/frontend/Makefile index a987ff7b67f..a198c6da6a9 100644 --- a/examples/cluster-dns/images/frontend/Makefile +++ b/examples/cluster-dns/images/frontend/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = v1 PREFIX = gcr.io/google_containers IMAGE = example-dns-frontend diff --git a/examples/examples_test.go b/examples/examples_test.go index f6920945d1b..04bc0464cac 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -230,6 +230,7 @@ func TestExampleObjectSchemas(t *testing.T) { "ingress": &extensions.Ingress{}, "nginx-deployment": &extensions.Deployment{}, "new-nginx-deployment": &extensions.Deployment{}, + "replication": &api.ReplicationController{}, }, "../docs/admin": { "daemon": &extensions.DaemonSet{}, @@ -320,6 +321,7 @@ func TestExampleObjectSchemas(t *testing.T) { }, "../docs/user-guide/node-selection": { "pod": &api.Pod{}, + "pod-with-node-affinity": &api.Pod{}, }, "../examples/openshift-origin": { "openshift-origin-namespace": &api.Namespace{}, @@ -401,6 +403,9 @@ func TestExampleObjectSchemas(t *testing.T) { "redis-service": &api.Service{}, "job": &extensions.Job{}, }, + "../examples/azure_file": { + "azure": &api.Pod{}, + }, } capabilities.SetForTests(capabilities.Capabilities{ diff --git a/examples/explorer/Dockerfile b/examples/explorer/Dockerfile index e6545402f20..8bf0ec065c7 100644 --- a/examples/explorer/Dockerfile +++ b/examples/explorer/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 The Kubernetes Authors. All rights reserved. +# 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. diff --git a/examples/explorer/Makefile b/examples/explorer/Makefile index ccbd90d75bb..b7dda571292 100644 --- a/examples/explorer/Makefile +++ b/examples/explorer/Makefile @@ -1,3 +1,17 @@ +# 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. + all: push # Keep this one version ahead, so no one accidentally blows away the latest published version. diff --git a/examples/extensions/deployment.yaml b/examples/extensions/deployment.yaml index 340103836ac..98e614ceb2e 100644 --- a/examples/extensions/deployment.yaml +++ b/examples/extensions/deployment.yaml @@ -7,7 +7,8 @@ metadata: spec: replicas: 3 selector: - name: nginx + matchLabels: + name: nginx template: metadata: labels: diff --git a/examples/guestbook-go/_src/Dockerfile b/examples/guestbook-go/_src/Dockerfile index 65416f211d6..adbe6c2237e 100644 --- a/examples/guestbook-go/_src/Dockerfile +++ b/examples/guestbook-go/_src/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM google/golang:latest ADD . /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src diff --git a/examples/guestbook-go/_src/guestbook/Dockerfile b/examples/guestbook-go/_src/guestbook/Dockerfile index 9ac96c7db29..5012dbb5634 100644 --- a/examples/guestbook-go/_src/guestbook/Dockerfile +++ b/examples/guestbook-go/_src/guestbook/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM busybox:ubuntu-14.04 ADD ./bin/guestbook /app/guestbook diff --git a/examples/guestbook/php-redis/Dockerfile b/examples/guestbook/php-redis/Dockerfile index 093cd7cbdc0..b7f699c5828 100644 --- a/examples/guestbook/php-redis/Dockerfile +++ b/examples/guestbook/php-redis/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM php:5-apache RUN apt-get update diff --git a/examples/guestbook/redis-slave/Dockerfile b/examples/guestbook/redis-slave/Dockerfile index 8167438bbea..1d097b57ac2 100644 --- a/examples/guestbook/redis-slave/Dockerfile +++ b/examples/guestbook/redis-slave/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM redis ADD run.sh /run.sh diff --git a/examples/hazelcast/image/Dockerfile b/examples/hazelcast/image/Dockerfile index bbb094a1310..3a26f29e693 100644 --- a/examples/hazelcast/image/Dockerfile +++ b/examples/hazelcast/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM quay.io/pires/docker-jre:8u45-2 MAINTAINER Paulo Pires diff --git a/examples/https-nginx/Dockerfile b/examples/https-nginx/Dockerfile index 2df7579c844..cf61b7c989d 100644 --- a/examples/https-nginx/Dockerfile +++ b/examples/https-nginx/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 The Kubernetes Authors. All rights reserved. +# 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. diff --git a/examples/https-nginx/Makefile b/examples/https-nginx/Makefile index a45d4c8c0ae..be53807d19f 100644 --- a/examples/https-nginx/Makefile +++ b/examples/https-nginx/Makefile @@ -1,3 +1,17 @@ +# 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. + all: TAG = 1.0 diff --git a/examples/job/work-queue-1/Dockerfile b/examples/job/work-queue-1/Dockerfile index cbd36bb6203..aea1ee70ffc 100644 --- a/examples/job/work-queue-1/Dockerfile +++ b/examples/job/work-queue-1/Dockerfile @@ -1,3 +1,17 @@ +# 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. + # Specify BROKER_URL and QUEUE when running FROM ubuntu:14.04 diff --git a/examples/job/work-queue-2/Dockerfile b/examples/job/work-queue-2/Dockerfile index 2de23b3c983..5246f0735e9 100644 --- a/examples/job/work-queue-2/Dockerfile +++ b/examples/job/work-queue-2/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM python RUN pip install redis COPY ./worker.py /worker.py diff --git a/examples/k8petstore/redis-master/Dockerfile b/examples/k8petstore/redis-master/Dockerfile index d0bfc7bb075..9467d5a3ddd 100644 --- a/examples/k8petstore/redis-master/Dockerfile +++ b/examples/k8petstore/redis-master/Dockerfile @@ -1,3 +1,17 @@ +# 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. + # # Redis Dockerfile # diff --git a/examples/k8petstore/redis-slave/Dockerfile b/examples/k8petstore/redis-slave/Dockerfile index 764fea7ff67..f35885e9d19 100644 --- a/examples/k8petstore/redis-slave/Dockerfile +++ b/examples/k8petstore/redis-slave/Dockerfile @@ -1,3 +1,17 @@ +# 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. + # # Redis Dockerfile # diff --git a/examples/k8petstore/redis/Dockerfile b/examples/k8petstore/redis/Dockerfile index af1a8a46463..4261913d810 100644 --- a/examples/k8petstore/redis/Dockerfile +++ b/examples/k8petstore/redis/Dockerfile @@ -1,3 +1,17 @@ +# 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. + # # Redis Dockerfile # diff --git a/examples/k8petstore/web-server/Dockerfile b/examples/k8petstore/web-server/Dockerfile index d951a88f868..c85b58dd98c 100644 --- a/examples/k8petstore/web-server/Dockerfile +++ b/examples/k8petstore/web-server/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM golang:latest # Add source to gopath. This is defacto required for go apps. diff --git a/examples/kubectl-container/Dockerfile b/examples/kubectl-container/Dockerfile index d27d3573644..d4ab65f6c4c 100644 --- a/examples/kubectl-container/Dockerfile +++ b/examples/kubectl-container/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. diff --git a/examples/kubectl-container/Makefile b/examples/kubectl-container/Makefile index 8622f1140f8..3683432680a 100644 --- a/examples/kubectl-container/Makefile +++ b/examples/kubectl-container/Makefile @@ -1,3 +1,17 @@ +# 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. + # Use: # # `make kubectl` will build kubectl. diff --git a/examples/meteor/dockerbase/Dockerfile b/examples/meteor/dockerbase/Dockerfile index 8ce633c634b..53d5bbfa972 100644 --- a/examples/meteor/dockerbase/Dockerfile +++ b/examples/meteor/dockerbase/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM node:0.10 MAINTAINER Christiaan Hees diff --git a/examples/mysql-galera/image/Dockerfile b/examples/mysql-galera/image/Dockerfile index 8359a53b088..ed7d45683c3 100644 --- a/examples/mysql-galera/image/Dockerfile +++ b/examples/mysql-galera/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM ubuntu:trusty # add our user and group first to make sure their IDs get assigned diff --git a/examples/nfs/nfs-data/Dockerfile b/examples/nfs/nfs-data/Dockerfile index 33fd131a5c7..77735a1ed1a 100644 --- a/examples/nfs/nfs-data/Dockerfile +++ b/examples/nfs/nfs-data/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM jsafrane/nfsexporter MAINTAINER Jan Safranek ADD index.html /mnt/data/index.html diff --git a/examples/phabricator/php-phabricator/Dockerfile b/examples/phabricator/php-phabricator/Dockerfile index 9bf1e0d3620..42eba6fdb7e 100644 --- a/examples/phabricator/php-phabricator/Dockerfile +++ b/examples/phabricator/php-phabricator/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM ubuntu:14.04 # Install all the required packages. diff --git a/examples/redis/image/Dockerfile b/examples/redis/image/Dockerfile index e4a1588a53a..612b93e5abb 100644 --- a/examples/redis/image/Dockerfile +++ b/examples/redis/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM redis:2.8 RUN apt-get update RUN apt-get install -yy -q python diff --git a/examples/rethinkdb/image/Dockerfile b/examples/rethinkdb/image/Dockerfile index 802181b9162..8c60c28a299 100644 --- a/examples/rethinkdb/image/Dockerfile +++ b/examples/rethinkdb/image/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM rethinkdb:1.16.0 MAINTAINER BinZhao diff --git a/examples/spark/spark-master-controller.yaml b/examples/spark/spark-master-controller.yaml index f002dc72339..b979925552c 100644 --- a/examples/spark/spark-master-controller.yaml +++ b/examples/spark/spark-master-controller.yaml @@ -13,7 +13,8 @@ spec: spec: containers: - name: spark-master - image: gcr.io/google_containers/spark-master:1.5.1_v2 + image: gcr.io/google_containers/spark:1.5.1_v3 + command: ["/start-master"] ports: - containerPort: 7077 - containerPort: 8080 diff --git a/examples/spark/spark-worker-controller.yaml b/examples/spark/spark-worker-controller.yaml index f9c0b022fe1..33d04b6e502 100644 --- a/examples/spark/spark-worker-controller.yaml +++ b/examples/spark/spark-worker-controller.yaml @@ -13,7 +13,8 @@ spec: spec: containers: - name: spark-worker - image: gcr.io/google_containers/spark-worker:1.5.1_v2 + image: gcr.io/google_containers/spark:1.5.1_v3 + command: ["/start-worker"] ports: - containerPort: 8081 resources: diff --git a/cluster/aws/templates/extract-kube-env.sh b/hack/boilerplate/boilerplate.Dockerfile.txt similarity index 56% rename from cluster/aws/templates/extract-kube-env.sh rename to hack/boilerplate/boilerplate.Dockerfile.txt index 5d4152bf612..6ce3fbd4645 100644 --- a/cluster/aws/templates/extract-kube-env.sh +++ b/hack/boilerplate/boilerplate.Dockerfile.txt @@ -1,6 +1,4 @@ -#!/bin/bash - -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright YEAR 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. @@ -14,14 +12,3 @@ # See the License for the specific language governing permissions and # limitations under the License. -apt-get-install python-yaml - -# kube-env has all the environment variables we care about, in a flat yaml format -eval "$(python -c ' -import pipes,sys,yaml - -for k,v in yaml.load(sys.stdin).iteritems(): - print("""readonly {var}={value}""".format(var = k, value = pipes.quote(str(v)))) - print("""export {var}""".format(var = k)) - ' < kube-env.yaml)" - diff --git a/hack/boilerplate/boilerplate.Makefile.txt b/hack/boilerplate/boilerplate.Makefile.txt new file mode 100644 index 00000000000..6ce3fbd4645 --- /dev/null +++ b/hack/boilerplate/boilerplate.Makefile.txt @@ -0,0 +1,14 @@ +# Copyright YEAR 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. + diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index 7b1ff435ecf..9a5f7010574 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -33,6 +33,7 @@ rootdir = os.path.abspath(rootdir) def get_refs(): refs = {} + for path in glob.glob(os.path.join(rootdir, "hack/boilerplate/boilerplate.*.txt")): extension = os.path.basename(path).split(".")[1] @@ -52,8 +53,12 @@ def file_passes(filename, refs, regexs): data = f.read() f.close() + basename = os.path.basename(filename) extension = file_extension(filename) - ref = refs[extension] + if extension != "": + ref = refs[extension] + else: + ref = refs[basename] # remove build tags from the top of Go files if extension == "go": @@ -128,8 +133,9 @@ def get_files(extensions): files = normalize_files(files) outfiles = [] for pathname in files: + basename = os.path.basename(pathname) extension = file_extension(pathname) - if extension in extensions: + if extension in extensions or basename in extensions: outfiles.append(pathname) return outfiles diff --git a/hack/build-cross.sh b/hack/build-cross.sh index 14fa501d7fc..98a9c603923 100755 --- a/hack/build-cross.sh +++ b/hack/build-cross.sh @@ -28,6 +28,9 @@ KUBE_BUILD_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") kube::golang::build_binaries "${KUBE_SERVER_TARGETS[@]}" KUBE_BUILD_PLATFORMS=("${KUBE_CLIENT_PLATFORMS[@]}") -kube::golang::build_binaries "${KUBE_CLIENT_TARGETS[@]}" "${KUBE_TEST_TARGETS[@]}" +kube::golang::build_binaries "${KUBE_CLIENT_TARGETS[@]}" + +KUBE_BUILD_PLATFORMS=("${KUBE_TEST_PLATFORMS[@]}") +kube::golang::build_binaries "${KUBE_TEST_TARGETS[@]}" kube::golang::place_bins diff --git a/hack/gen-swagger-doc/Dockerfile b/hack/gen-swagger-doc/Dockerfile index 9ad26afcc61..441bdacdc05 100644 --- a/hack/gen-swagger-doc/Dockerfile +++ b/hack/gen-swagger-doc/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM java:7-jre RUN apt-get update diff --git a/hack/jenkins/e2e-runner.sh b/hack/jenkins/e2e-runner.sh index d676f54a925..f9a71d690a1 100755 --- a/hack/jenkins/e2e-runner.sh +++ b/hack/jenkins/e2e-runner.sh @@ -115,6 +115,11 @@ fi cd kubernetes +# Upload build start time and k8s version to GCS, but not on PR Jenkins. +if [[ ! "${JOB_NAME}" =~ -pull- ]]; then + bash <(curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-started.sh") +fi + # Have cmd/e2e run by goe2e.sh generate JUnit report in ${WORKSPACE}/junit*.xml ARTIFACTS=${WORKSPACE}/_artifacts mkdir -p ${ARTIFACTS} @@ -185,7 +190,7 @@ if [[ "${USE_KUBEMARK:-}" == "true" ]]; then NUM_NODES=${KUBEMARK_NUM_NODES:-$NUM_NODES} MASTER_SIZE=${KUBEMARK_MASTER_SIZE:-$MASTER_SIZE} ./test/kubemark/start-kubemark.sh - ./test/kubemark/run-e2e-tests.sh --ginkgo.focus="should\sallow\sstarting\s30\spods\sper\snode" --delete-namespace="false" --gather-resource-usage="false" + ./test/kubemark/run-e2e-tests.sh --ginkgo.focus="${KUBEMARK_TESTS}" --gather-resource-usage="false" ./test/kubemark/stop-kubemark.sh NUM_NODES=${NUM_NODES_BKP} MASTER_SIZE=${MASTER_SIZE_BKP} diff --git a/hack/jenkins/e2e.sh b/hack/jenkins/e2e.sh index 9980d55499d..60eb7c33f4d 100755 --- a/hack/jenkins/e2e.sh +++ b/hack/jenkins/e2e.sh @@ -21,25 +21,6 @@ set -o errexit set -o nounset set -o pipefail -# Join all args with | -# Example: join_regex_allow_empty a b "c d" e => a|b|c d|e -function join_regex_allow_empty() { - local IFS="|" - echo "$*" -} - -# Join all args with |, butin case of empty result prints "EMPTY\sSET" instead. -# Example: join_regex_no_empty a b "c d" e => a|b|c d|e -# join_regex_no_empty => EMPTY\sSET -function join_regex_no_empty() { - local IFS="|" - if [ -z "$*" ]; then - echo "EMPTY\sSET" - else - echo "$*" - fi -} - # Properly configure globals for an upgrade step in a GKE or GCE upgrade suite # # These suites: @@ -54,9 +35,6 @@ function join_regex_no_empty() { # Assumes globals: # $JOB_NAME # $KUBERNETES_PROVIDER -# $GCE_DEFAULT_SKIP_TESTS -# $GCE_FLAKY_TESTS -# $GCE_SLOW_TESTS # # Args: # $1 old_version: the version to deploy a cluster at, and old e2e tests to run @@ -80,17 +58,6 @@ function configure_upgrade_step() { } local -r step="${BASH_REMATCH[1]}" - local -r gce_test_args="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )" - local -r gke_test_args="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )" - if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then KUBE_GCE_INSTANCE_PREFIX="$cluster_name" NUM_NODES=5 @@ -149,12 +116,6 @@ function configure_upgrade_step() { E2E_UP="false" E2E_TEST="true" E2E_DOWN="false" - - if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then - GINKGO_TEST_ARGS="${gke_test_args}" - else - GINKGO_TEST_ARGS="${gce_test_args}" - fi ;; step5) @@ -178,12 +139,6 @@ function configure_upgrade_step() { E2E_UP="false" E2E_TEST="true" E2E_DOWN="false" - - if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then - GINKGO_TEST_ARGS="${gke_test_args}" - else - GINKGO_TEST_ARGS="${gce_test_args}" - fi ;; step7) @@ -198,12 +153,6 @@ function configure_upgrade_step() { E2E_UP="false" E2E_TEST="true" E2E_DOWN="true" - - if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then - GINKGO_TEST_ARGS="${gke_test_args}" - else - GINKGO_TEST_ARGS="${gce_test_args}" - fi ;; esac } @@ -263,51 +212,37 @@ fi # When 1.2.0-beta.0 comes out, e.g., this will become "ci/latest-1.2" CURRENT_RELEASE_PUBLISHED_VERSION="ci/latest-1.1" -# Specialized tests which should be skipped by default for projects. -GCE_DEFAULT_SKIP_TESTS=( - "\[Skipped\]" - "\[Feature:.+\]" - ) - -# Tests which kills or restarts components and/or nodes. -DISRUPTIVE_TESTS=( - "\[Disruptive\]" -) - -# The following tests are known to be flaky, and are thus run only in their own -# -flaky- build variants. -GCE_FLAKY_TESTS=( - "\[Flaky\]" - ) - -# The following tests are known to be slow running (> 2 min), and are -# thus run only in their own -slow- build variants. Note that tests -# can be slow by explicit design (e.g. some soak tests), or slow -# through poor implementation. Please indicate which applies in the -# comments below, and for poorly implemented tests, please quote the -# issue number tracking speed improvements. -GCE_SLOW_TESTS=( - "\[Slow\]" - ) - -# Tests which are not able to be run in parallel. -# -# TODO(ihmccreery) I'd like to get these combined with DISRUPTIVE_TESTS. -GCE_PARALLEL_SKIP_TESTS=( - "\[Serial\]" - "\[Disruptive\]" -) - # Define environment variables based on the Jenkins project name. # NOTE: Not all jobs are defined here. The hack/jenkins/e2e.sh in master and # release branches defines relevant jobs for that particular version of # Kubernetes. case ${JOB_NAME} in + + # PR builder + + # Runs a subset of tests on GCE in parallel. Run against all pending PRs. + kubernetes-pull-build-test-e2e-gce) + : ${E2E_CLUSTER_NAME:="jnks-e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} + : ${E2E_NETWORK:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} + : ${GINKGO_PARALLEL:="y"} + # This list should match the list in kubernetes-e2e-gce. + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} + : ${PROJECT:="kubernetes-jenkins-pull"} + : ${ENABLE_DEPLOYMENTS:=true} + # Override GCE defaults + NUM_NODES=${NUM_NODES_PARALLEL} + ;; + + # GCE core jobs + # Runs all non-slow, non-serial, non-flaky, tests on GCE in parallel. kubernetes-e2e-gce) : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e"} : ${E2E_PUBLISH_GREEN_VERSION:="true"} : ${E2E_NETWORK:="e2e-gce"} + # This list should match the list in kubernetes-pull-build-test-e2e-gce. # TODO(ihmccreery) remove [Skipped] once tests are relabeled : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} : ${GINKGO_PARALLEL:="y"} @@ -317,6 +252,135 @@ case ${JOB_NAME} in : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} ;; + # Runs slow tests on GCE, sequentially. + kubernetes-e2e-gce-slow) + : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-slow"} + : ${E2E_NETWORK:="e2e-slow"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Slow\] \ + --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${GINKGO_PARALLEL:="y"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-slow"} + : ${PROJECT:="k8s-jkns-e2e-gce-slow"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + ;; + + # Run the [Serial], [Disruptive], and [Feature:Restart] tests on GCE. + kubernetes-e2e-gce-serial) + : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-serial"} + : ${E2E_NETWORK:="jenkins-gce-e2e-serial"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Serial\]|\[Disruptive\] \ + --ginkgo.skip=\[Flaky\]|\[Feature:.+\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-serial"} + : ${PROJECT:="kubernetes-jkns-e2e-gce-serial"} + ;; + + # Runs only the ingress tests on GCE. + kubernetes-e2e-gce-ingress) + : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-ingress"} + : ${E2E_NETWORK:="e2e-ingress"} + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Feature:Ingress\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-ingress"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # TODO: Move this into a different project. Currently, since this test + # shares resources with various other networking tests, so it's easier + # to zero in on the source of a leak if it's run in isolation. + : ${PROJECT:="kubernetes-flannel"} + ;; + + # Runs only the ingress tests on GKE. + kubernetes-e2e-gke-ingress) + : ${E2E_CLUSTER_NAME:="jenkins-gke-e2e-ingress"} + : ${E2E_NETWORK:="e2e-gke-ingress"} + : ${E2E_SET_CLUSTER_API_VERSION:=y} + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Feature:Ingress\]"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-gke-ingress"} + # TODO: Move this into a different project. Currently, since this test + # shares resources with various other networking tests, it's easier to + # zero in on the source of a leak if it's run in isolation. + : ${PROJECT:="kubernetes-flannel"} + ;; + + # Runs the flaky tests on GCE, sequentially. + kubernetes-e2e-gce-flaky) + : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-flaky"} + : ${E2E_NETWORK:="e2e-flaky"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Flaky\] \ + --ginkgo.skip=\[Feature:.+\]|\[Skipped\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-flaky"} + : ${PROJECT:="k8s-jkns-e2e-gce-flaky"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + : ${E2E_DOWN:="true"} + ;; + + # Runs the flaky tests on GCE in parallel. + kubernetes-e2e-gce-parallel-flaky) + : ${E2E_CLUSTER_NAME:="parallel-flaky"} + : ${E2E_NETWORK:="e2e-parallel-flaky"} + : ${GINKGO_PARALLEL:="y"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Flaky\] \ + --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Feature:.+\]|\[Skipped\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="parallel-flaky"} + : ${PROJECT:="k8s-jkns-e2e-gce-prl-flaky"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # Override GCE defaults. + NUM_NODES=${NUM_NODES_PARALLEL} + ;; + + # GKE core jobs + + # Runs all non-slow, non-serial, non-flaky, tests on GKE in parallel. + kubernetes-e2e-gke) + : ${E2E_CLUSTER_NAME:="jkns-gke-e2e-ci"} + : ${E2E_NETWORK:="e2e-gke-ci"} + : ${E2E_SET_CLUSTER_API_VERSION:=y} + : ${PROJECT:="k8s-jkns-e2e-gke-ci"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${GINKGO_PARALLEL:="y"} + ;; + + kubernetes-e2e-gke-slow) + : ${E2E_CLUSTER_NAME:="jkns-gke-e2e-slow"} + : ${E2E_NETWORK:="e2e-gke-slow"} + : ${E2E_SET_CLUSTER_API_VERSION:=y} + : ${PROJECT:="k8s-jkns-e2e-gke-slow"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Slow\] \ + --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${GINKGO_PARALLEL:="y"} + ;; + + # Run the [Serial], [Disruptive], and [Feature:Restart] tests on GKE. + kubernetes-e2e-gke-serial) + : ${E2E_CLUSTER_NAME:="jenkins-gke-e2e-serial"} + : ${E2E_NETWORK:="jenkins-gke-e2e-serial"} + : ${E2E_SET_CLUSTER_API_VERSION:=y} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Serial\]|\[Disruptive\] \ + --ginkgo.skip=\[Flaky\]|\[Feature:.+\]"} + : ${PROJECT:="jenkins-gke-e2e-serial"} + ;; + + kubernetes-e2e-gke-flaky) + : ${E2E_CLUSTER_NAME:="kubernetes-gke-e2e-flaky"} + : ${E2E_NETWORK:="gke-e2e-flaky"} + : ${E2E_SET_CLUSTER_API_VERSION:=y} + : ${PROJECT:="k8s-jkns-e2e-gke-ci-flaky"} + : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Flaky\] \ + --ginkgo.skip=\[Feature:.+\]|\[Skipped\]"} + ;; + + # AWS core jobs + # Runs all non-flaky, non-slow tests on AWS, sequentially. kubernetes-e2e-aws) : ${E2E_PUBLISH_GREEN_VERSION:=true} @@ -324,11 +388,9 @@ case ${JOB_NAME} in : ${E2E_ZONE:="us-west-2a"} : ${ZONE:="us-west-2a"} : ${E2E_NETWORK:="e2e-aws"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )"} + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${GINKGO_PARALLEL:="y"} : ${KUBE_GCE_INSTANCE_PREFIX="e2e-aws"} : ${PROJECT:="k8s-jkns-e2e-aws"} : ${ENABLE_DEPLOYMENTS:=true} @@ -339,6 +401,8 @@ case ${JOB_NAME} in : ${AWS_SHARED_CREDENTIALS_FILE:='/var/lib/jenkins/.aws/credentials'} ;; + # Feature jobs + # Runs only the examples tests on GCE. kubernetes-e2e-gce-examples) : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-examples"} @@ -358,111 +422,11 @@ case ${JOB_NAME} in : ${PROJECT:="k8s-jnks-e2e-gce-autoscaling"} : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} : ${ENABLE_DEPLOYMENTS:=true} + # Override GCE default for cluster size autoscaling purposes. + ENABLE_CLUSTER_MONITORING="googleinfluxdb" ADMISSION_CONTROL="NamespaceLifecycle,InitialResources,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota" ;; - # Runs the flaky tests on GCE, sequentially. - kubernetes-e2e-gce-flaky) - : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-flaky"} - : ${E2E_NETWORK:="e2e-flaky"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ) --ginkgo.focus=$(join_regex_no_empty \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} - : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-flaky"} - : ${PROJECT:="k8s-jkns-e2e-gce-flaky"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - : ${E2E_DOWN:="true"} - ;; - - # Runs slow tests on GCE, sequentially. - kubernetes-e2e-gce-slow) - : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-slow"} - : ${E2E_NETWORK:="e2e-slow"} - # TODO(ihmccreery) remove [Skipped] once tetss are relabeled - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Slow\] \ - --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} - : ${GINKGO_PARALLEL:="y"} - : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-slow"} - : ${PROJECT:="k8s-jkns-e2e-gce-slow"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - ;; - - # Runs a subset of tests on GCE in parallel. Run against all pending PRs. - kubernetes-pull-build-test-e2e-gce) - : ${E2E_CLUSTER_NAME:="jnks-e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} - : ${E2E_NETWORK:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} - : ${GINKGO_PARALLEL:="y"} - # This list should match the list in kubernetes-e2e-gce-parallel. - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_PARALLEL_SKIP_TESTS[@]:+${GCE_PARALLEL_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )"} - : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"} - : ${PROJECT:="kubernetes-jenkins-pull"} - : ${ENABLE_DEPLOYMENTS:=true} - # Override GCE defaults - NUM_NODES=${NUM_NODES_PARALLEL} - ;; - - # Runs all non-flaky tests on AWS in parallel. - kubernetes-e2e-aws-parallel) - : ${E2E_CLUSTER_NAME:="jenkins-aws-e2e-parallel"} - : ${E2E_NETWORK:="e2e-parallel"} - : ${GINKGO_PARALLEL:="y"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_PARALLEL_SKIP_TESTS[@]:+${GCE_PARALLEL_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} - : ${ENABLE_DEPLOYMENTS:=true} - # Override AWS defaults. - NUM_NODES=${NUM_NODES_PARALLEL} - ;; - - # Runs the flaky tests on GCE in parallel. - kubernetes-e2e-gce-parallel-flaky) - : ${E2E_CLUSTER_NAME:="parallel-flaky"} - : ${E2E_NETWORK:="e2e-parallel-flaky"} - : ${GINKGO_PARALLEL:="y"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_PARALLEL_SKIP_TESTS[@]:+${GCE_PARALLEL_SKIP_TESTS[@]}} \ - ) --ginkgo.focus=$(join_regex_no_empty \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} - : ${KUBE_GCE_INSTANCE_PREFIX:="parallel-flaky"} - : ${PROJECT:="k8s-jkns-e2e-gce-prl-flaky"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - # Override GCE defaults. - NUM_NODES=${NUM_NODES_PARALLEL} - ;; - - # Run the [Serial], [Disruptive], and [Feature:Restart] tests on GCE. - kubernetes-e2e-gce-serial) - : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-serial"} - : ${E2E_NETWORK:="jenkins-gce-e2e-serial"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Serial\]|\[Disruptive\] \ - --ginkgo.skip=\[Flaky\]|\[Feature:.+\]"} - : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-serial"} - : ${PROJECT:="kubernetes-jkns-e2e-gce-serial"} - ;; - - # Run the [Serial], [Disruptive], and [Feature:Restart] tests on GKE. - kubernetes-e2e-gke-serial) - : ${E2E_CLUSTER_NAME:="jenkins-gke-e2e-serial"} - : ${E2E_NETWORK:="jenkins-gke-e2e-serial"} - : ${E2E_SET_CLUSTER_API_VERSION:=y} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Serial\]|\[Disruptive\] \ - --ginkgo.skip=\[Flaky\]|\[Feature:.+\]"} - : ${PROJECT:="jenkins-gke-e2e-serial"} - ;; - # Runs the performance/scalability tests on GCE. A larger cluster is used. kubernetes-e2e-gce-scalability) : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-scalability"} @@ -492,12 +456,6 @@ case ${JOB_NAME} in : ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-flannel"} : ${E2E_PUBLISH_GREEN_VERSION:="true"} : ${E2E_NETWORK:="e2e-gce-flannel"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_PARALLEL_SKIP_TESTS[@]:+${GCE_PARALLEL_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )"} : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-flannel"} : ${PROJECT:="kubernetes-flannel"} # Override GCE defaults. @@ -506,6 +464,7 @@ case ${JOB_NAME} in # Runs the performance/scalability test on huge 1000-node cluster on GCE. # Flannel is used as network provider. + # Allows a couple of nodes to be NotReady during startup kubernetes-e2e-gce-enormous-cluster) : ${E2E_CLUSTER_NAME:="jenkins-gce-enormous-cluster"} : ${E2E_NETWORK:="e2e-enormous-cluster"} @@ -524,12 +483,106 @@ case ${JOB_NAME} in NODE_SIZE="n1-standard-1" NODE_DISK_SIZE="50GB" NUM_NODES="1000" + ALLOWED_NOTREADY_NODES="2" + EXIT_ON_WEAK_ERROR="false" # Reduce logs verbosity TEST_CLUSTER_LOG_LEVEL="--v=1" # Increase resync period to simulate production TEST_CLUSTER_RESYNC_PERIOD="--min-resync-period=12h" ;; + # Starts and tears down 1000-node cluster on GCE using flannel networking + # Requires all 1000 nodes to come up. + kubernetes-e2e-gce-enormous-startup) + : ${E2E_CLUSTER_NAME:="jenkins-gce-enormous-startup"} + # TODO: increase a quota for networks in kubernetes-scale and move this test to its own network + : ${E2E_NETWORK:="e2e-enormous-cluster"} + : ${E2E_TEST:="false"} + : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-enormous-startup"} + : ${PROJECT:="kubernetes-scale"} + # Override GCE defaults. + NETWORK_PROVIDER="flannel" + # Temporarily switch of Heapster, as this will not schedule anywhere. + # TODO: Think of a solution to enable it. + ENABLE_CLUSTER_MONITORING="none" + E2E_ZONE="us-east1-b" + MASTER_SIZE="n1-standard-32" + NODE_SIZE="n1-standard-1" + NODE_DISK_SIZE="50GB" + NUM_NODES="1000" + # Reduce logs verbosity + TEST_CLUSTER_LOG_LEVEL="--v=1" + # Increase resync period to simulate production + TEST_CLUSTER_RESYNC_PERIOD="--min-resync-period=12h" + ;; + + # Run Kubemark test on a fake 100 node cluster to have a comparison + # to the real results from scalability suite + kubernetes-kubemark-gce) + : ${E2E_CLUSTER_NAME:="kubernetes-kubemark"} + : ${E2E_NETWORK:="kubernetes-kubemark"} + : ${PROJECT:="k8s-jenkins-kubemark"} + : ${E2E_UP:="true"} + : ${E2E_DOWN:="true"} + : ${E2E_TEST:="false"} + : ${USE_KUBEMARK:="true"} + : ${KUBEMARK_TESTS:="should\sallow\sstarting\s30\spods\sper\snode"} + # Override defaults to be indpendent from GCE defaults and set kubemark parameters + KUBE_GCE_INSTANCE_PREFIX="kubemark100" + NUM_NODES="10" + MASTER_SIZE="n1-standard-2" + NODE_SIZE="n1-standard-1" + E2E_ZONE="asia-east1-a" + KUBEMARK_MASTER_SIZE="n1-standard-4" + KUBEMARK_NUM_NODES="100" + ;; + + # Run Kubemark test on a fake 500 node cluster to test for regressions on + # bigger clusters + kubernetes-kubemark-500-gce) + : ${E2E_CLUSTER_NAME:="kubernetes-kubemark-500"} + : ${E2E_NETWORK:="kubernetes-kubemark-500"} + : ${PROJECT:="kubernetes-scale"} + : ${E2E_UP:="true"} + : ${E2E_DOWN:="true"} + : ${E2E_TEST:="false"} + : ${USE_KUBEMARK:="true"} + : ${KUBEMARK_TESTS:="\[Feature:Performance\]"} + # Override defaults to be indpendent from GCE defaults and set kubemark parameters + NUM_NODES="6" + MASTER_SIZE="n1-standard-4" + NODE_SIZE="n1-standard-8" + KUBE_GCE_INSTANCE_PREFIX="kubemark500" + E2E_ZONE="us-east1-b" + KUBEMARK_MASTER_SIZE="n1-standard-16" + KUBEMARK_NUM_NODES="500" + ;; + + # Run big Kubemark test, this currently means a 1000 node cluster and 16 core master + kubernetes-kubemark-gce-scale) + : ${E2E_CLUSTER_NAME:="kubernetes-kubemark-scale"} + : ${E2E_NETWORK:="kubernetes-kubemark-scale"} + : ${PROJECT:="kubernetes-scale"} + : ${E2E_UP:="true"} + : ${E2E_DOWN:="true"} + : ${E2E_TEST:="false"} + : ${USE_KUBEMARK:="true"} + : ${KUBEMARK_TESTS:="should\sallow\sstarting\s30\spods\sper\snode"} + # Override defaults to be indpendent from GCE defaults and set kubemark parameters + # We need 11 so that we won't hit max-pods limit (set to 100). TODO: do it in a nicer way. + NUM_NODES="11" + MASTER_SIZE="n1-standard-4" + NODE_SIZE="n1-standard-8" # Note: can fit about 17 hollow nodes per core + # so NUM_NODES x cores_per_node should + # be set accordingly. + KUBE_GCE_INSTANCE_PREFIX="kubemark1000" + E2E_ZONE="us-east1-b" + KUBEMARK_MASTER_SIZE="n1-standard-16" + KUBEMARK_NUM_NODES="1000" + ;; + + # Soak jobs + # Sets up the GCE soak cluster weekly using the latest CI release. kubernetes-soak-weekly-deploy-gce) : ${E2E_CLUSTER_NAME:="gce-soak-weekly"} @@ -538,6 +591,7 @@ case ${JOB_NAME} in : ${E2E_TEST:="false"} : ${E2E_UP:="true"} : ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly"} + : ${HAIRPIN_MODE:="false"} : ${PROJECT:="kubernetes-jenkins"} ;; @@ -550,50 +604,43 @@ case ${JOB_NAME} in # Clear out any orphaned namespaces in case previous run was interrupted. : ${E2E_CLEAN_START:="true"} # We should be testing the reliability of a long-running cluster. The - # DISRUPTIVE_TESTS kill/restart components or nodes in the cluster, + # [Disruptive] tests kill/restart components or nodes in the cluster, # defeating the purpose of a soak cluster. (#15722) - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${DISRUPTIVE_TESTS[@]:+${DISRUPTIVE_TESTS[@]}} \ - )"} + # + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} : ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly"} + : ${HAIRPIN_MODE:="false"} : ${PROJECT:="kubernetes-jenkins"} ;; - # Runs all non-slow, non-serial, non-flaky, tests on GKE in parallel. - kubernetes-e2e-gke) - : ${E2E_CLUSTER_NAME:="jkns-gke-e2e-ci"} - : ${E2E_NETWORK:="e2e-gke-ci"} - : ${E2E_SET_CLUSTER_API_VERSION:=y} - : ${PROJECT:="k8s-jkns-e2e-gke-ci"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} + # Clone of kubernetes-soak-weekly-deploy-gce. Issue #20832. + kubernetes-soak-weekly-deploy-gce-2) + : ${E2E_CLUSTER_NAME:="gce-soak-weekly-2"} + : ${E2E_DOWN:="false"} + : ${E2E_NETWORK:="gce-soak-weekly-2"} + : ${E2E_TEST:="false"} + : ${E2E_UP:="true"} + : ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly-2"} + : ${PROJECT:="kubernetes-jenkins"} + ;; + + # Clone of kubernetes-soak-continuous-e2e-gce. Issue #20832. + kubernetes-soak-continuous-e2e-gce-2) + : ${E2E_CLUSTER_NAME:="gce-soak-weekly-2"} + : ${E2E_DOWN:="false"} + : ${E2E_NETWORK:="gce-soak-weekly-2"} + : ${E2E_UP:="false"} + # Clear out any orphaned namespaces in case previous run was interrupted. + : ${E2E_CLEAN_START:="true"} + # We should be testing the reliability of a long-running cluster. The + # [Disruptive] tests kill/restart components or nodes in the cluster, + # defeating the purpose of a soak cluster. (#15722) + # # TODO(ihmccreery) remove [Skipped] once tests are relabeled - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} - : ${GINKGO_PARALLEL:="y"} - ;; - - kubernetes-e2e-gke-slow) - : ${E2E_CLUSTER_NAME:="jkns-gke-e2e-slow"} - : ${E2E_NETWORK:="e2e-gke-slow"} - : ${E2E_SET_CLUSTER_API_VERSION:=y} - : ${PROJECT:="k8s-jkns-e2e-gke-slow"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - # TODO(ihmccreery) remove [Skipped] once tetss are relabeled - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Slow\] \ - --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} - : ${GINKGO_PARALLEL:="y"} - ;; - - kubernetes-e2e-gke-flaky) - : ${E2E_CLUSTER_NAME:="kubernetes-gke-e2e-flaky"} - : ${E2E_NETWORK:="gke-e2e-flaky"} - : ${E2E_SET_CLUSTER_API_VERSION:=y} - : ${PROJECT:="k8s-jkns-e2e-gke-ci-flaky"} - : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} - : ${GINKGO_TEST_ARGS:="--ginkgo.focus=$(join_regex_no_empty \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} + : ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly-2"} + : ${PROJECT:="kubernetes-jenkins"} ;; # Sets up the GKE soak cluster weekly using the latest CI release. @@ -621,15 +668,15 @@ case ${JOB_NAME} in : ${PROJECT:="kubernetes-jenkins"} : ${E2E_OPT:="--check_version_skew=false"} # We should be testing the reliability of a long-running cluster. The - # DISRUPTIVE_TESTS kill/restart components or nodes in the cluster, + # [Disruptive] tests kill/restart components or nodes in the cluster, # defeating the purpose of a soak cluster. (#15722) - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${DISRUPTIVE_TESTS[@]:+${DISRUPTIVE_TESTS[@]}} \ - )"} + # + # TODO(ihmccreery) remove [Skipped] once tests are relabeled + : ${GINKGO_TEST_ARGS:="--ginkgo.skip=\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[Skipped\]"} ;; + # Upgrade jobs + # kubernetes-upgrade-gke-1.0-master # # Test upgrades from the latest release-1.0 build to the latest master build. @@ -748,10 +795,6 @@ case ${JOB_NAME} in : ${E2E_UP:="false"} : ${E2E_TEST:="true"} : ${E2E_DOWN:="false"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-upgrade-1-0"} : ${NUM_NODES:=5} ;; @@ -785,10 +828,6 @@ case ${JOB_NAME} in : ${E2E_UP:="false"} : ${E2E_TEST:="true"} : ${E2E_DOWN:="false"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - )"} : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-upgrade-1-0"} : ${NUM_NODES:=5} ;; @@ -805,76 +844,9 @@ case ${JOB_NAME} in : ${E2E_UP:="false"} : ${E2E_TEST:="true"} : ${E2E_DOWN:="true"} - : ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \ - ${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \ - ${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \ - ${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \ - )"} : ${KUBE_GCE_INSTANCE_PREFIX:="e2e-upgrade-1-0"} : ${NUM_NODES:=5} ;; - - # Run Kubemark test on a fake 100 node cluster to have a comparison - # to the real results from scalability suite - kubernetes-kubemark-gce) - : ${E2E_CLUSTER_NAME:="kubernetes-kubemark"} - : ${E2E_NETWORK:="kubernetes-kubemark"} - : ${PROJECT:="k8s-jenkins-kubemark"} - : ${E2E_UP:="true"} - : ${E2E_DOWN:="true"} - : ${E2E_TEST:="false"} - : ${USE_KUBEMARK:="true"} - # Override defaults to be indpendent from GCE defaults and set kubemark parameters - KUBE_GCE_INSTANCE_PREFIX="kubemark100" - NUM_NODES="10" - MASTER_SIZE="n1-standard-2" - NODE_SIZE="n1-standard-1" - E2E_ZONE="asia-east1-a" - KUBEMARK_MASTER_SIZE="n1-standard-4" - KUBEMARK_NUM_NODES="100" - ;; - - # Run Kubemark test on a fake 500 node cluster to test for regressions on - # bigger clusters - kubernetes-kubemark-500-gce) - : ${E2E_CLUSTER_NAME:="kubernetes-kubemark-500"} - : ${E2E_NETWORK:="kubernetes-kubemark-500"} - : ${PROJECT:="kubernetes-scale"} - : ${E2E_UP:="true"} - : ${E2E_DOWN:="true"} - : ${E2E_TEST:="false"} - : ${USE_KUBEMARK:="true"} - # Override defaults to be indpendent from GCE defaults and set kubemark parameters - NUM_NODES="6" - MASTER_SIZE="n1-standard-4" - NODE_SIZE="n1-standard-8" - KUBE_GCE_INSTANCE_PREFIX="kubemark500" - E2E_ZONE="us-east1-b" - KUBEMARK_MASTER_SIZE="n1-standard-16" - KUBEMARK_NUM_NODES="500" - ;; - - # Run big Kubemark test, this currently means a 1000 node cluster and 16 core master - kubernetes-kubemark-gce-scale) - : ${E2E_CLUSTER_NAME:="kubernetes-kubemark-scale"} - : ${E2E_NETWORK:="kubernetes-kubemark-scale"} - : ${PROJECT:="kubernetes-scale"} - : ${E2E_UP:="true"} - : ${E2E_DOWN:="true"} - : ${E2E_TEST:="false"} - : ${USE_KUBEMARK:="true"} - # Override defaults to be indpendent from GCE defaults and set kubemark parameters - # We need 11 so that we won't hit max-pods limit (set to 100). TODO: do it in a nicer way. - NUM_NODES="11" - MASTER_SIZE="n1-standard-4" - NODE_SIZE="n1-standard-8" # Note: can fit about 17 hollow nodes per core - # so NUM_NODES x cores_per_node should - # be set accordingly. - KUBE_GCE_INSTANCE_PREFIX="kubemark1000" - E2E_ZONE="us-east1-b" - KUBEMARK_MASTER_SIZE="n1-standard-16" - KUBEMARK_NUM_NODES="1000" - ;; esac # Skip gcloud update checking @@ -898,6 +870,8 @@ export KUBE_GCE_NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-} export KUBE_OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-} export GCE_SERVICE_ACCOUNT=$(gcloud auth list 2> /dev/null | grep active | cut -f3 -d' ') export FAIL_ON_GCP_RESOURCE_LEAK="${FAIL_ON_GCP_RESOURCE_LEAK:-false}" +export ALLOWED_NOTREADY_NODES=${ALLOWED_NOTREADY_NODES:-} +export EXIT_ON_WEAK_ERROR=${EXIT_ON_WEAK_ERROR:-} # GKE variables export CLUSTER_NAME=${E2E_CLUSTER_NAME} @@ -939,6 +913,7 @@ export KUBE_SKIP_CONFIRMATIONS=y # Kubemark export USE_KUBEMARK="${USE_KUBEMARK:-false}" +export KUBEMARK_TESTS="${KUBEMARK_TESTS:-}" export KUBEMARK_MASTER_SIZE="${KUBEMARK_MASTER_SIZE:-$MASTER_SIZE}" export KUBEMARK_NUM_NODES="${KUBEMARK_NUM_NODES:-$NUM_NODES}" diff --git a/hack/jenkins/job-builder-image/Dockerfile b/hack/jenkins/job-builder-image/Dockerfile index 3e116dfe7e2..5f253a2db4f 100644 --- a/hack/jenkins/job-builder-image/Dockerfile +++ b/hack/jenkins/job-builder-image/Dockerfile @@ -1,3 +1,17 @@ +# 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 docker image runs Jenkins Job Builder (JJB) for automatic job reconciliation. FROM ubuntu:14.04 diff --git a/hack/jenkins/job-builder-image/Makefile b/hack/jenkins/job-builder-image/Makefile index d0c0ba1c736..dde94ebfa83 100644 --- a/hack/jenkins/job-builder-image/Makefile +++ b/hack/jenkins/job-builder-image/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 1 all: diff --git a/hack/jenkins/job-configs/global.yaml b/hack/jenkins/job-configs/global.yaml index 6a04d685291..e80dc2bca6a 100644 --- a/hack/jenkins/job-configs/global.yaml +++ b/hack/jenkins/job-configs/global.yaml @@ -29,6 +29,33 @@ else curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-to-gcs.sh" | bash - fi + - shell: | + curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-finished.sh" > upload-finished.sh + chmod +x upload-finished.sh + - conditional-step: + condition-kind: current-status + condition-worst: SUCCESS + condition-best: SUCCESS + steps: + - shell: './upload-finished.sh SUCCESS' + - conditional-step: + condition-kind: current-status + condition-worst: UNSTABLE + condition-best: UNSTABLE + steps: + - shell: './upload-finished.sh UNSTABLE' + - conditional-step: + condition-kind: current-status + condition-worst: FAILURE + condition-best: FAILURE + steps: + - shell: './upload-finished.sh FAILURE' + - conditional-step: + condition-kind: current-status + condition-worst: ABORTED + condition-best: ABORTED + steps: + - shell: './upload-finished.sh ABORTED' script-only-if-succeeded: False script-only-if-failed: False @@ -62,3 +89,4 @@ - defaults: name: global emails: '$DEFAULT_RECIPIENTS' + cron-string: 'H/30 * * * *' diff --git a/hack/jenkins/job-configs/kubernetes-build.yaml b/hack/jenkins/job-configs/kubernetes-build.yaml index 10f914d2550..31b94301af4 100644 --- a/hack/jenkins/job-configs/kubernetes-build.yaml +++ b/hack/jenkins/job-configs/kubernetes-build.yaml @@ -5,6 +5,7 @@ logrotate: numToKeep: 200 builders: + - shell: 'bash <(curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-started.sh")' - shell: './hack/jenkins/build.sh' properties: - mail-watcher diff --git a/hack/jenkins/job-configs/kubernetes-e2e-trusty.yaml b/hack/jenkins/job-configs/kubernetes-e2e-trusty.yaml new file mode 100644 index 00000000000..0aeedb2f849 --- /dev/null +++ b/hack/jenkins/job-configs/kubernetes-e2e-trusty.yaml @@ -0,0 +1,69 @@ +- job-template: + name: 'kubernetes-e2e-gce-trusty-{suffix}' + description: '{description} Test owner: {test-owner}.' + logrotate: + daysToKeep: 7 + builders: + - shell: | + curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/{branch}/hack/jenkins/e2e.sh" | bash - + properties: + - mail-watcher + publishers: + - claim-build + - junit-publisher + - log-parser + - email-ext: + recipients: "{emails}" + - description-setter: + regexp: KUBE_GCE_MINION_IMAGE=(.*) + - groovy-postbuild: + script: | + def trustyImageMatcher = manager.getLogMatcher("KUBE_GCE_MINION_IMAGE=(.*)") + if(trustyImageMatcher?.matches()) manager.addShortText("Trusty Image: " + trustyImageMatcher.group(1) + "", "grey", "white", "0px", "white") + def k8sVersionMatcher = manager.getLogMatcher("Using\\spublished\\sversion\\s(.*)\\s\\(from.*") + if(k8sVersionMatcher?.matches()) manager.addShortText("
    Kubernetes version: " + k8sVersionMatcher.group(1) + "", "grey", "white", "0px", "white") + + triggers: + - timed: 'H H/8 * * *' + wrappers: + - ansicolor: + colormap: xterm + - timeout: + timeout: '{timeout}' + fail: true + - timestamps + - workspace-cleanup + +- project: + name: kubernetes-e2e-gce-trusty + test-owner: 'wonderfly@google.com' + branch: 'release-1.1' + emails: + adityakali@google.com,ameyd@google.com,andryeu@google.com,gwells@google.com,qzheng@google.com,saied@google.com,wonderfly@google.com,yinghan@google.com + suffix: + - 'head-release': + description: 'Continuously test Trusty build against latest k8s release.' + timeout: 150 + - 'dev-release': + description: 'Continuously test Trusty dev build against latest k8s release.' + timeout: 150 + - 'beta-release': + description: 'Continuously test Trusty beta build against latest k8s release.' + timeout: 150 + - 'stable-release': + description: 'Continuously test Trusty stable build against latest k8s release.' + timeout: 150 + - 'head-slow': + description: 'Run slow E2E tests on latest Trusty build.' + timeout: 270 + - 'dev-slow': + description: 'Run slow E2E tests on latest Trusty dev build.' + timeout: 270 + - 'beta-slow': + description: 'Run slow E2E tests on latest Trusty beta build.' + timeout: 270 + - 'stable-slow': + description: 'Run slow E2E tests on latest Trusty stable build.' + timeout: 270 + jobs: + - 'kubernetes-e2e-gce-trusty-{suffix}' diff --git a/hack/jenkins/job-configs/kubernetes-e2e.yaml b/hack/jenkins/job-configs/kubernetes-e2e.yaml index 1d5cd706108..65c2dd6bb99 100644 --- a/hack/jenkins/job-configs/kubernetes-e2e.yaml +++ b/hack/jenkins/job-configs/kubernetes-e2e.yaml @@ -20,7 +20,7 @@ - reverse: jobs: '{trigger-job}' result: success - - timed: 'H/30 * * * *' + - timed: '{cron-string}' wrappers: - ansicolor: colormap: xterm @@ -38,7 +38,10 @@ suffix: - 'gce': description: 'Run E2E tests on GCE using the latest successful build.' - timeout: 150 + timeout: 30 + - 'gce-slow': + description: 'Run slow E2E tests on GCE using the latest successful build.' + timeout: 60 - 'gce-autoscaling': description: 'Run autoscaling E2E tests on GCE using the latest successful build.' timeout: 210 @@ -50,10 +53,7 @@ timeout: 90 - 'gce-scalability': description: 'Run scalability E2E tests on GCE using the latest successful build.' - timeout: 210 - - 'gce-slow': - description: 'Run slow E2E tests on GCE using the latest successful build.' - timeout: 270 + timeout: 120 - 'gce-flannel': description: 'Run E2E tests on GCE using Flannel and the latest successful build. This suite is quarantined in a dedicated project because Flannel integration is experimental.' timeout: 90 @@ -72,10 +72,10 @@ suffix: - 'gke': description: Runs all non-slow, non-serial, non-flaky, tests on GKE in parallel (against GKE test endpoint) - timeout: 300 + timeout: 30 - 'gke-slow': description: 'Run slow E2E tests on GKE using the latest successful build.' - timeout: 300 + timeout: 60 - 'gke-flaky': description: | Run flaky e2e tests using the following config:
    @@ -189,5 +189,33 @@ timeout: 300 emails: '$DEFAULT_RECIPIENTS, ihmccreery@google.com' test-owner: 'ihmccreery' + - 'gke-ingress': + description: 'Run [Feature:Ingress] tests on GKE using the latest successful build.' + timeout: 90 + emails: '$DEFAULT_RECIPIENTS, beeps@google.com' + test-owner: 'beeps' + - 'gce-ingress': + description: 'Run [Feature:Ingress] tests on GCE using the latest successful build.' + timeout: 90 + emails: '$DEFAULT_RECIPIENTS, beeps@google.com' + test-owner: 'beeps' + jobs: + - 'kubernetes-e2e-{suffix}' + +- project: + name: kubernetes-aws + test-owner: 'bburns' + emails: 'bburns@google.com' + cron-string: '@daily' + trigger-job: '' + suffix: + - 'aws': + description: 'Run e2e tests on AWS using the latest successful Kubernetes build.' + timeout: 240 + branch: 'master' + - 'aws-release-1.1': + description: 'Run e2e tests on AWS using the latest successful 1.1 Kubernetes build.' + timeout: 240 + branch: 'release-1.1' jobs: - 'kubernetes-e2e-{suffix}' diff --git a/hack/jenkins/job-configs/kubernetes-kubemark.yaml b/hack/jenkins/job-configs/kubernetes-kubemark.yaml index 14f579e5a6b..d4785ed3beb 100644 --- a/hack/jenkins/job-configs/kubernetes-kubemark.yaml +++ b/hack/jenkins/job-configs/kubernetes-kubemark.yaml @@ -34,15 +34,15 @@ suffix: - 'gce': description: 'Continuously run Density test on Kubemark.' - timeout: 90 + timeout: 120 cron-string: '@hourly' - '500-gce': description: 'Run Density test on Kubemark in a large cluster that we should be able to handle.' - timeout: 180 + timeout: 300 cron-string: '@hourly' - 'gce-scale': description: 'Run Density test on Kubemark in very large cluster. Currently only scheduled to run every 6 hours so as not to waste too many resources.' - timeout: 180 - cron-string: 'H H/6 * * *' + timeout: 480 + cron-string: 'H H/8 * * *' jobs: - 'kubernetes-kubemark-{suffix}' diff --git a/hack/jenkins/job-configs/kubernetes-soak.yaml b/hack/jenkins/job-configs/kubernetes-soak.yaml index 5c9273a59ad..218e3502387 100644 --- a/hack/jenkins/job-configs/kubernetes-soak.yaml +++ b/hack/jenkins/job-configs/kubernetes-soak.yaml @@ -70,6 +70,10 @@ builds will be blocked and remain in the queue until the deployment is complete.
    branch: 'master' + - 'gce-2': + deploy-description: Clone of kubernetes-soak-weekly-deploy-gce. + e2e-description: Clone of kubernetes-soak-continuous-e2e-gce. + branch: 'master' - 'gce-1.1': deploy-description: | Deploy Kubernetes to soak cluster using the latest successful diff --git a/hack/jenkins/job-configs/kubernetes-test-go.yaml b/hack/jenkins/job-configs/kubernetes-test-go.yaml index 21b890caf3d..a9fbfb6aaeb 100644 --- a/hack/jenkins/job-configs/kubernetes-test-go.yaml +++ b/hack/jenkins/job-configs/kubernetes-test-go.yaml @@ -7,6 +7,7 @@ numToKeep: 200 node: unittest builders: + - shell: 'bash <(curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-started.sh")' - shell: './hack/jenkins/gotest-dockerized.sh' publishers: - claim-build diff --git a/hack/jenkins/test-image/Makefile b/hack/jenkins/test-image/Makefile index d805d5e5665..4cea80684a1 100644 --- a/hack/jenkins/test-image/Makefile +++ b/hack/jenkins/test-image/Makefile @@ -1,3 +1,17 @@ +# 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. + all: push TAG = 0.7 diff --git a/hack/jenkins/upload-finished.sh b/hack/jenkins/upload-finished.sh new file mode 100755 index 00000000000..cb864a169e8 --- /dev/null +++ b/hack/jenkins/upload-finished.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# 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 is meant to be run at the end of every Jenkins job. +# +# Pass in the result of the build in $1. This will upload that, along with the +# current time, to GCS. + +set -o errexit +set -o nounset +set -o pipefail + +if [[ $# -ne 1 ]]; then + echo "Usage: hack/jenkins/upload-finished.sh RESULT" >&2 + exit 1 +fi + +readonly result="$1" +readonly timestamp=$(date +%s) +readonly location="gs://kubernetes-jenkins/logs/${JOB_NAME}/${BUILD_NUMBER}/finished.json" + +echo "Uploading build result to: ${location}" +gsutil -q cp -a "public-read" <( + echo "{" + echo " \"result\": \"${result}\"," + echo " \"timestamp\": ${timestamp}" + echo "}" +) "${location}" diff --git a/hack/jenkins/upload-started.sh b/hack/jenkins/upload-started.sh new file mode 100755 index 00000000000..9ef612af029 --- /dev/null +++ b/hack/jenkins/upload-started.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# 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 is meant to be run at the start of every Jenkins job. +# +# Discovers the local kubernetes version and uploads it, along with +# the current time, to GCS. + +set -o errexit +set -o nounset +set -o pipefail + +version="" +readonly timestamp=$(date +%s) +readonly location="gs://kubernetes-jenkins/logs/${JOB_NAME}/${BUILD_NUMBER}/started.json" + +# Try to discover the kubernetes version. +if [[ -e "version" ]]; then + version=$(cat "version") +elif [[ -e "hack/lib/version.sh" ]]; then + version=$( + export KUBE_ROOT="." + source "hack/lib/version.sh" + kube::version::get_version_vars + echo "${KUBE_GIT_VERSION-}" + ) +fi + +if [[ -n "${version}" ]]; then + echo "Found Kubernetes version: ${version}" +else + echo "Could not find Kubernetes version" +fi + +echo "Uploading version to: ${location}" +gsutil -q cp -a "public-read" <( + echo "{" + echo " \"version\": \"${version}\"," + echo " \"timestamp\": ${timestamp}" + echo "}" +) "${location}" diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 43a1f68ff8c..c1b97d7678f 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -60,6 +60,18 @@ readonly KUBE_CLIENT_TARGETS=( readonly KUBE_CLIENT_BINARIES=("${KUBE_CLIENT_TARGETS[@]##*/}") readonly KUBE_CLIENT_BINARIES_WIN=("${KUBE_CLIENT_BINARIES[@]/%/.exe}") +# If we update this we should also update the set of golang compilers we build +# in 'build/build-image/cross/Dockerfile'. However, it's only a bit faster since go 1.5, not mandatory +readonly KUBE_CLIENT_PLATFORMS=( + linux/amd64 + linux/386 + linux/arm + darwin/amd64 + darwin/386 + windows/amd64 + windows/386 +) + # The set of test targets that we are building for all platforms kube::golang::test_targets() { local targets=( @@ -97,14 +109,10 @@ readonly KUBE_TEST_PORTABLE=( hack/lib ) -# If we update this we need to also update the set of golang compilers we build -# in 'build/build-image/Dockerfile' -readonly KUBE_CLIENT_PLATFORMS=( +# Which platforms we should compile test targets for. Not all client platforms need these tests +readonly KUBE_TEST_PLATFORMS=( linux/amd64 - linux/386 - linux/arm darwin/amd64 - darwin/386 windows/amd64 ) @@ -161,7 +169,7 @@ kube::golang::binaries_from_targets() { done } -# Asks golang what it thinks the host platform is. The go tool chain does some +# Asks golang what it thinks the host platform is. The go tool chain does some # slightly different things when the target platform matches the host platform. kube::golang::host_platform() { echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" @@ -190,11 +198,26 @@ kube::golang::set_platform_envs() { export GOOS=${platform%/*} export GOARCH=${platform##*/} + + # Dynamic CGO linking for other server architectures than linux/amd64 goes here + # If you want to include support for more server platforms than these, add arch-specific gcc names here + if [[ ${platform} == "linux/arm" ]]; then + export CGO_ENABLED=1 + export CC=arm-linux-gnueabi-gcc + elif [[ ${platform} == "linux/arm64" ]]; then + export CGO_ENABLED=1 + export CC=aarch64-linux-gnu-gcc + elif [[ ${platform} == "linux/ppc64le" ]]; then + export CGO_ENABLED=1 + export CC=powerpc64le-linux-gnu-gcc + fi } kube::golang::unset_platform_envs() { unset GOOS unset GOARCH + unset CGO_ENABLED + unset CC } # Create the GOPATH tree under $KUBE_OUTPUT @@ -409,6 +432,7 @@ kube::golang::build_binaries_for_platform() { # Go 1.4 added -o to control where the binary is saved, but Go 1.3 doesn't # have this flag. Whenever we deprecate go 1.3, update to use -o instead of # changing into the output directory. + mkdir -p "$(dirname ${outfile})" pushd "$(dirname ${outfile})" >/dev/null go test -c \ "${goflags[@]:+${goflags[@]}}" \ diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index f1cba1f2d5f..876a9a7b0dc 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -24,6 +24,7 @@ DOCKERIZE_KUBELET=${DOCKERIZE_KUBELET:-""} ALLOW_PRIVILEGED=${ALLOW_PRIVILEGED:-""} ALLOW_SECURITY_CONTEXT=${ALLOW_SECURITY_CONTEXT:-""} RUNTIME_CONFIG=${RUNTIME_CONFIG:-""} +NET_PLUGIN=${NET_PLUGIN:-""} KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. cd "${KUBE_ROOT}" @@ -255,12 +256,18 @@ function start_apiserver { } function start_controller_manager { + node_cidr_args="" + if [[ "${NET_PLUGIN}" == "kubenet" ]]; then + node_cidr_args="--allocate-node-cidrs=true --cluster-cidr=10.1.0.0/16 " + fi + CTLRMGR_LOG=/tmp/kube-controller-manager.log sudo -E "${GO_OUT}/kube-controller-manager" \ --v=${LOG_LEVEL} \ --service-account-private-key-file="${SERVICE_ACCOUNT_KEY}" \ --root-ca-file="${ROOT_CA_FILE}" \ --enable-hostpath-provisioner="${ENABLE_HOSTPATH_PROVISIONER}" \ + ${node_cidr_args} \ --master="${API_HOST}:${API_PORT}" >"${CTLRMGR_LOG}" 2>&1 & CTLRMGR_PID=$! } @@ -283,6 +290,16 @@ function start_kubelet { fi fi + net_plugin_args="" + if [[ -n "${NET_PLUGIN}" ]]; then + net_plugin_args="--network-plugin=${NET_PLUGIN}" + fi + + kubenet_plugin_args="" + if [[ "${NET_PLUGIN}" == "kubenet" ]]; then + kubenet_plugin_args="--reconcile-cidr=true " + fi + sudo -E "${GO_OUT}/kubelet" ${priv_arg}\ --v=${LOG_LEVEL} \ --chaos-chance="${CHAOS_CHANCE}" \ @@ -294,6 +311,8 @@ function start_kubelet { --api-servers="${API_HOST}:${API_PORT}" \ --cpu-cfs-quota=${CPU_CFS_QUOTA} \ --cluster-dns="127.0.0.1" \ + ${net_plugin_args} \ + ${kubenet_plugin_args} \ --port="$KUBELET_PORT" >"${KUBELET_LOG}" 2>&1 & KUBELET_PID=$! else diff --git a/hack/test-cmd.sh b/hack/test-cmd.sh index 62dae08321c..06c78e07d34 100755 --- a/hack/test-cmd.sh +++ b/hack/test-cmd.sh @@ -174,10 +174,15 @@ kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kub # Start kube-apiserver kube::log::status "Starting kube-apiserver" + +# Admission Controllers to invoke prior to persisting objects in cluster +ADMISSION_CONTROL="NamespaceLifecycle,LimitRanger,ResourceQuota" + KUBE_API_VERSIONS="v1,extensions/v1beta1" "${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \ --address="127.0.0.1" \ --public-address-override="127.0.0.1" \ --port="${API_PORT}" \ + --admission-control="${ADMISSION_CONTROL}" \ --etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \ --public-address-override="127.0.0.1" \ --kubelet-port=${KUBELET_PORT} \ @@ -241,6 +246,7 @@ runTests() { deployment_replicas=".spec.replicas" secret_data=".data" secret_type=".type" + deployment_image_field="(index .spec.template.spec.containers 0).image" # Passing no arguments to create is an error ! kubectl create @@ -659,7 +665,7 @@ runTests() { # Pre-Condition: no Job exists kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" '' # Command - kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" + kubectl run pi --generator=job/v1beta1 --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" # Post-Condition: Job "pi" is created kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' # Clean up @@ -672,7 +678,7 @@ runTests() { kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:' # Clean up kubectl delete deployment nginx "${kube_flags[@]}" - kubectl delete rc -l deployment.kubernetes.io/podTemplateHash "${kube_flags[@]}" + kubectl delete rc -l pod-template-hash "${kube_flags[@]}" ############## # Namespaces # @@ -680,7 +686,7 @@ runTests() { ### Create a new namespace # Pre-condition: only the "default" namespace exists - kube::test::get_object_assert 'namespaces' "{{range.items}}{{$id_field}}:{{end}}" 'default:' + kube::test::get_object_assert namespaces "{{range.items}}{{$id_field}}:{{end}}" 'default:' # Command kubectl create namespace my-namespace # Post-condition: namespace 'my-namespace' is created. @@ -692,6 +698,14 @@ runTests() { # Pods in Namespaces # ############## + ### Create a new namespace + # Pre-condition: the other namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"other\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace other + # Post-condition: namespace 'other' is created. + kube::test::get_object_assert 'namespaces/other' "{{$id_field}}" 'other' + ### Create POD valid-pod in specific namespace # Pre-condition: no POD exists kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' @@ -706,12 +720,22 @@ runTests() { # Command kubectl delete "${kube_flags[@]}" pod --namespace=other valid-pod --grace-period=0 # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' + kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' + # Clean up + kubectl delete namespace other ############## # Secrets # ############## + ### Create a new namespace + # Pre-condition: the test-secrets namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-secrets\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace test-secrets + # Post-condition: namespace 'test-secrets' is created. + kube::test::get_object_assert 'namespaces/test-secrets' "{{$id_field}}" 'test-secrets' + ### Create a generic secret in a specific namespace # Pre-condition: no SECRET exists kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' @@ -735,6 +759,8 @@ runTests() { [[ "$(kubectl get secret/test-secret --namespace=test-secrets -o yaml "${kube_flags[@]}" | grep '.dockercfg:')" ]] # Clean-up kubectl delete secret test-secret --namespace=test-secrets + # Clean up + kubectl delete namespace test-secrets ################# # Pod templates # @@ -917,6 +943,7 @@ __EOF__ kubectl scale --replicas=2 -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}" # Post-condition: 2 replicas kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + kubectl delete rc frontend "${kube_flags[@]}" ### Scale multiple replication controllers kubectl create -f examples/guestbook/redis-master-controller.yaml "${kube_flags[@]}" @@ -937,16 +964,17 @@ __EOF__ kube::test::get_object_assert 'job pi' "{{$job_parallelism_field}}" '2' # Clean-up kubectl delete job/pi "${kube_flags[@]}" - ### Scale a deployment - kubectl create -f examples/extensions/deployment.yaml "${kube_flags[@]}" - # Command - kubectl scale --current-replicas=3 --replicas=1 deployment/nginx-deployment - # Post-condition: 1 replica for nginx-deployment - kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '1' - # Clean-up - kubectl delete deployment/nginx-deployment "${kube_flags[@]}" - # TODO: Remove once deployment reaping is implemented - kubectl delete rc --all "${kube_flags[@]}" + # TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). + # ### Scale a deployment + # kubectl create -f examples/extensions/deployment.yaml "${kube_flags[@]}" + # # Command + # kubectl scale --current-replicas=3 --replicas=1 deployment/nginx-deployment + # # Post-condition: 1 replica for nginx-deployment + # kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '1' + # # Clean-up + # kubectl delete deployment/nginx-deployment "${kube_flags[@]}" + # # TODO: Remove once deployment reaping is implemented + # kubectl delete rs --all "${kube_flags[@]}" ### Expose a deployment as a service kubectl create -f examples/extensions/deployment.yaml "${kube_flags[@]}" @@ -959,7 +987,7 @@ __EOF__ # Clean-up kubectl delete deployment/nginx-deployment service/nginx-deployment "${kube_flags[@]}" # TODO: Remove once deployment reaping is implemented - kubectl delete rc --all "${kube_flags[@]}" + kubectl delete rs --all "${kube_flags[@]}" ### Expose replication controller as service kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}" @@ -1076,7 +1104,36 @@ __EOF__ # Clean up kubectl delete hpa nginx-deployment "${kube_flags[@]}" kubectl delete deployment nginx-deployment "${kube_flags[@]}" - kubectl delete rc -l deployment.kubernetes.io/podTemplateHash "${kube_flags[@]}" + kubectl delete rs -l pod-template-hash "${kube_flags[@]}" + + ### Rollback a deployment + # Pre-condition: no deployment exists + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + # Create a deployment (revision 1) + kubectl create -f examples/extensions/deployment.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx-deployment:' + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:' + # Rollback to revision 1 - should be no-op + kubectl rollout undo deployment nginx-deployment --to-revision=1 "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:' + # Update the deployment (revision 2) + kubectl apply -f hack/testdata/deployment-revision2.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:latest:' + # Rollback to revision 1 + kubectl rollout undo deployment nginx-deployment --to-revision=1 "${kube_flags[@]}" + sleep 1 + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:' + # Rollback to revision 1000000 - should be no-op + kubectl rollout undo deployment nginx-deployment --to-revision=1000000 "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:' + # Rollback to last revision + kubectl rollout undo deployment nginx-deployment "${kube_flags[@]}" + sleep 1 + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" 'nginx:latest:' + # Clean up + kubectl delete deployment nginx-deployment "${kube_flags[@]}" + kubectl delete rs -l pod-template-hash "${kube_flags[@]}" ###################### # ConfigMap # diff --git a/hack/test-update-storage-objects.sh b/hack/test-update-storage-objects.sh index 107336b6080..950be12a108 100755 --- a/hack/test-update-storage-objects.sh +++ b/hack/test-update-storage-objects.sh @@ -84,7 +84,7 @@ kube::etcd::start kube::log::status "Running test for update etcd object scenario" -"${KUBE_ROOT}/hack/build-go.sh" +"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver ####################################################### diff --git a/hack/testdata/deployment-revision2.yaml b/hack/testdata/deployment-revision2.yaml new file mode 100644 index 00000000000..e723526b106 --- /dev/null +++ b/hack/testdata/deployment-revision2.yaml @@ -0,0 +1,21 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: nginx-deployment + labels: + name: nginx-deployment +spec: + replicas: 3 + selector: + matchLabels: + name: nginx + template: + metadata: + labels: + name: nginx + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 diff --git a/hack/verify-flags/exceptions.txt b/hack/verify-flags/exceptions.txt index 33875837998..b188a28e49d 100644 --- a/hack/verify-flags/exceptions.txt +++ b/hack/verify-flags/exceptions.txt @@ -1,13 +1,16 @@ Vagrantfile: node_ip = $node_ips[n] cluster/addons/registry/images/Dockerfile:ADD run_proxy.sh /usr/bin/run_proxy cluster/addons/registry/images/Dockerfile:CMD ["/usr/bin/run_proxy"] -cluster/aws/templates/salt-minion.sh: hostname_override: "${HOSTNAME_OVERRIDE}" +cluster/aws/templates/configure-vm-aws.sh: # We set the hostname_override to the full EC2 private dns name +cluster/aws/templates/configure-vm-aws.sh: api_servers: '${API_SERVERS}' +cluster/aws/templates/configure-vm-aws.sh: env-to-grains "hostname_override" +cluster/aws/templates/configure-vm-aws.sh: env-to-grains "runtime_config" cluster/aws/templates/salt-minion.sh:# We set the hostname_override to the full EC2 private dns name cluster/centos/util.sh: local node_ip=${node#*@} cluster/gce/configure-vm.sh: advertise_address: '${EXTERNAL_IP}' cluster/gce/configure-vm.sh: api_servers: '${KUBERNETES_MASTER_NAME}' cluster/gce/configure-vm.sh: cloud_config: ${CLOUD_CONFIG} -cluster/gce/configure-vm.sh: runtime_config: '$(echo "$RUNTIME_CONFIG" | sed -e "s/'/''/g")' +cluster/gce/configure-vm.sh: env-to-grains "runtime_config" cluster/gce/coreos/helper.sh:# cloud_config yaml file should be passed cluster/gce/util.sh: local node_ip=$(gcloud compute instances describe --project "${PROJECT}" --zone "${ZONE}" \ cluster/juju/charms/trusty/kubernetes-master/files/controller-manager.upstart.tmpl: --address=%(bind_address)s \ @@ -57,6 +60,7 @@ cluster/saltbase/salt/kube-proxy/kube-proxy.manifest: {% set api_servers_with_p cluster/saltbase/salt/kube-proxy/kube-proxy.manifest: {% set api_servers_with_port = api_servers -%} cluster/saltbase/salt/kubelet/default: {% set api_servers_with_port = api_servers + ":6443" -%} cluster/saltbase/salt/kubelet/default: {% set api_servers_with_port = api_servers -%} +cluster/saltbase/salt/kubelet/default: {% set enable_custom_metrics="--enable-custom-metrics=" + pillar['enable_custom_metrics'] %} cluster/saltbase/salt/kubelet/default: {% set kubelet_port="--port=" + pillar['kubelet_port'] %} cluster/saltbase/salt/opencontrail-networking-master/init.sls: - 'SERVICE_CLUSTER_IP_RANGE': '{{ pillar.get('service_cluster_ip_range') }}' cluster/saltbase/salt/opencontrail-networking-minion/init.sls: - 'SERVICE_CLUSTER_IP_RANGE': '{{ pillar.get('service_cluster_ip_range') }}' diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index d30e43f3b9f..5555264cf54 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -47,7 +47,9 @@ cluster-name cluster-tag concurrent-deployment-syncs concurrent-endpoint-syncs +concurrent-replicaset-syncs concurrent-resource-quota-syncs +concurrent-namespace-syncs config-sync-period configure-cbr0 conntrack-max @@ -84,6 +86,7 @@ dry-run duration-sec e2e-output-dir e2e-verify-service-account +enable-custom-metrics enable-debugging-handlers enable-hostpath-provisioner enable-server @@ -138,6 +141,7 @@ host-pid-sources hostname-override http-check-frequency http-port +ignore-daemonsets ignore-not-found image-gc-high-threshold image-gc-low-threshold @@ -145,6 +149,7 @@ input-dirs insecure-bind-address insecure-port insecure-skip-tls-verify +iptables-masquerade-bit iptables-sync-period ir-data-source ir-dbname @@ -276,6 +281,7 @@ pv-recycler-minimum-timeout-hostpath pv-recycler-minimum-timeout-nfs pv-recycler-pod-template-filepath-hostpath pv-recycler-pod-template-filepath-nfs +pv-recycler-maximum-retry pv-recycler-timeout-increment-hostpath pvclaimbinder-sync-period read-only-port @@ -323,6 +329,7 @@ service-overrides service-sync-period session-affinity show-all +show-labels shutdown-fd shutdown-fifo since-seconds @@ -347,6 +354,7 @@ tcp-services terminated-pod-gc-threshold tls-cert-file tls-private-key-file +to-version token-auth-file ttl-secs type-src @@ -358,7 +366,9 @@ upgrade-target use-kubernetes-cluster-service user-whitelist verify-only +volume-dir volume-plugin-dir +volume-stats-agg-period watch-cache watch-only whitelist-override-label @@ -371,3 +381,5 @@ leader-elect leader-elect-lease-duration leader-elect-renew-deadline leader-elect-retry-period +watch-cache-sizes +configure-hairpin-mode diff --git a/pkg/admission/chain.go b/pkg/admission/chain.go index 6fc33a5a90b..5301a7b724e 100644 --- a/pkg/admission/chain.go +++ b/pkg/admission/chain.go @@ -16,16 +16,14 @@ limitations under the License. package admission -import ( - client "k8s.io/kubernetes/pkg/client/unversioned" -) +import clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" // chainAdmissionHandler is an instance of admission.Interface that performs admission control using a chain of admission handlers type chainAdmissionHandler []Interface // NewFromPlugins returns an admission.Interface that will enforce admission control decisions of all // the given plugins. -func NewFromPlugins(client client.Interface, pluginNames []string, configFilePath string) Interface { +func NewFromPlugins(client clientset.Interface, pluginNames []string, configFilePath string) Interface { plugins := []Interface{} for _, pluginName := range pluginNames { plugin := InitPlugin(pluginName, client, configFilePath) diff --git a/pkg/admission/plugins.go b/pkg/admission/plugins.go index b63e468950f..09fc449e1db 100644 --- a/pkg/admission/plugins.go +++ b/pkg/admission/plugins.go @@ -23,14 +23,14 @@ import ( "sync" "github.com/golang/glog" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" ) // Factory is a function that returns an Interface for admission decisions. // The config parameter provides an io.Reader handler to the factory in // order to load specific configurations. If no configuration is provided // the parameter is nil. -type Factory func(client client.Interface, config io.Reader) (Interface, error) +type Factory func(client clientset.Interface, config io.Reader) (Interface, error) // All registered admission options. var ( @@ -67,7 +67,7 @@ func RegisterPlugin(name string, plugin Factory) { // known. The error is returned only when the named provider was known but failed // to initialize. The config parameter specifies the io.Reader handler of the // configuration file for the cloud provider, or nil for no configuration. -func GetPlugin(name string, client client.Interface, config io.Reader) (Interface, error) { +func GetPlugin(name string, client clientset.Interface, config io.Reader) (Interface, error) { pluginsMutex.Lock() defer pluginsMutex.Unlock() f, found := plugins[name] @@ -78,7 +78,7 @@ func GetPlugin(name string, client client.Interface, config io.Reader) (Interfac } // InitPlugin creates an instance of the named interface. -func InitPlugin(name string, client client.Interface, configFilePath string) Interface { +func InitPlugin(name string, client clientset.Interface, configFilePath string) Interface { var ( config *os.File err error diff --git a/pkg/api/deep_copy_generated.go b/pkg/api/deep_copy_generated.go index 5f1d83cfc9c..bb6a4ce6fb6 100644 --- a/pkg/api/deep_copy_generated.go +++ b/pkg/api/deep_copy_generated.go @@ -31,152 +31,159 @@ import ( func init() { if err := Scheme.AddGeneratedDeepCopyFuncs( - deepCopy_api_AWSElasticBlockStoreVolumeSource, - deepCopy_api_Binding, - deepCopy_api_Capabilities, - deepCopy_api_CephFSVolumeSource, - deepCopy_api_CinderVolumeSource, - deepCopy_api_ComponentCondition, - deepCopy_api_ComponentStatus, - deepCopy_api_ComponentStatusList, - deepCopy_api_ConfigMap, - deepCopy_api_ConfigMapKeySelector, - deepCopy_api_ConfigMapList, - deepCopy_api_Container, - deepCopy_api_ContainerImage, - deepCopy_api_ContainerPort, - deepCopy_api_ContainerState, - deepCopy_api_ContainerStateRunning, - deepCopy_api_ContainerStateTerminated, - deepCopy_api_ContainerStateWaiting, - deepCopy_api_ContainerStatus, - deepCopy_api_ConversionError, - deepCopy_api_DaemonEndpoint, - deepCopy_api_DeleteOptions, - deepCopy_api_DownwardAPIVolumeFile, - deepCopy_api_DownwardAPIVolumeSource, - deepCopy_api_EmptyDirVolumeSource, - deepCopy_api_EndpointAddress, - deepCopy_api_EndpointPort, - deepCopy_api_EndpointSubset, - deepCopy_api_Endpoints, - deepCopy_api_EndpointsList, - deepCopy_api_EnvVar, - deepCopy_api_EnvVarSource, - deepCopy_api_Event, - deepCopy_api_EventList, - deepCopy_api_EventSource, - deepCopy_api_ExecAction, - deepCopy_api_ExportOptions, - deepCopy_api_FCVolumeSource, - deepCopy_api_FlexVolumeSource, - deepCopy_api_FlockerVolumeSource, - deepCopy_api_GCEPersistentDiskVolumeSource, - deepCopy_api_GitRepoVolumeSource, - deepCopy_api_GlusterfsVolumeSource, - deepCopy_api_HTTPGetAction, - deepCopy_api_Handler, - deepCopy_api_HostPathVolumeSource, - deepCopy_api_ISCSIVolumeSource, - deepCopy_api_Lifecycle, - deepCopy_api_LimitRange, - deepCopy_api_LimitRangeItem, - deepCopy_api_LimitRangeList, - deepCopy_api_LimitRangeSpec, - deepCopy_api_List, - deepCopy_api_ListOptions, - deepCopy_api_LoadBalancerIngress, - deepCopy_api_LoadBalancerStatus, - deepCopy_api_LocalObjectReference, - deepCopy_api_NFSVolumeSource, - deepCopy_api_Namespace, - deepCopy_api_NamespaceList, - deepCopy_api_NamespaceSpec, - deepCopy_api_NamespaceStatus, - deepCopy_api_Node, - deepCopy_api_NodeAddress, - deepCopy_api_NodeCondition, - deepCopy_api_NodeDaemonEndpoints, - deepCopy_api_NodeList, - deepCopy_api_NodeResources, - deepCopy_api_NodeSpec, - deepCopy_api_NodeStatus, - deepCopy_api_NodeSystemInfo, - deepCopy_api_ObjectFieldSelector, - deepCopy_api_ObjectMeta, - deepCopy_api_ObjectReference, - deepCopy_api_PersistentVolume, - deepCopy_api_PersistentVolumeClaim, - deepCopy_api_PersistentVolumeClaimList, - deepCopy_api_PersistentVolumeClaimSpec, - deepCopy_api_PersistentVolumeClaimStatus, - deepCopy_api_PersistentVolumeClaimVolumeSource, - deepCopy_api_PersistentVolumeList, - deepCopy_api_PersistentVolumeSource, - deepCopy_api_PersistentVolumeSpec, - deepCopy_api_PersistentVolumeStatus, - deepCopy_api_Pod, - deepCopy_api_PodAttachOptions, - deepCopy_api_PodCondition, - deepCopy_api_PodExecOptions, - deepCopy_api_PodList, - deepCopy_api_PodLogOptions, - deepCopy_api_PodProxyOptions, - deepCopy_api_PodSecurityContext, - deepCopy_api_PodSpec, - deepCopy_api_PodStatus, - deepCopy_api_PodStatusResult, - deepCopy_api_PodTemplate, - deepCopy_api_PodTemplateList, - deepCopy_api_PodTemplateSpec, - deepCopy_api_Probe, - deepCopy_api_RBDVolumeSource, - deepCopy_api_RangeAllocation, - deepCopy_api_ReplicationController, - deepCopy_api_ReplicationControllerList, - deepCopy_api_ReplicationControllerSpec, - deepCopy_api_ReplicationControllerStatus, - deepCopy_api_ResourceQuota, - deepCopy_api_ResourceQuotaList, - deepCopy_api_ResourceQuotaSpec, - deepCopy_api_ResourceQuotaStatus, - deepCopy_api_ResourceRequirements, - deepCopy_api_SELinuxOptions, - deepCopy_api_Secret, - deepCopy_api_SecretKeySelector, - deepCopy_api_SecretList, - deepCopy_api_SecretVolumeSource, - deepCopy_api_SecurityContext, - deepCopy_api_SerializedReference, - deepCopy_api_Service, - deepCopy_api_ServiceAccount, - deepCopy_api_ServiceAccountList, - deepCopy_api_ServiceList, - deepCopy_api_ServicePort, - deepCopy_api_ServiceSpec, - deepCopy_api_ServiceStatus, - deepCopy_api_TCPSocketAction, - deepCopy_api_Volume, - deepCopy_api_VolumeMount, - deepCopy_api_VolumeSource, - deepCopy_conversion_Meta, - deepCopy_intstr_IntOrString, - deepCopy_runtime_RawExtension, - deepCopy_sets_Empty, - deepCopy_unversioned_GroupKind, - deepCopy_unversioned_GroupResource, - deepCopy_unversioned_GroupVersion, - deepCopy_unversioned_GroupVersionKind, - deepCopy_unversioned_GroupVersionResource, - deepCopy_unversioned_ListMeta, - deepCopy_unversioned_TypeMeta, + DeepCopy_api_AWSElasticBlockStoreVolumeSource, + DeepCopy_api_Affinity, + DeepCopy_api_AzureFileVolumeSource, + DeepCopy_api_Binding, + DeepCopy_api_Capabilities, + DeepCopy_api_CephFSVolumeSource, + DeepCopy_api_CinderVolumeSource, + DeepCopy_api_ComponentCondition, + DeepCopy_api_ComponentStatus, + DeepCopy_api_ComponentStatusList, + DeepCopy_api_ConfigMap, + DeepCopy_api_ConfigMapKeySelector, + DeepCopy_api_ConfigMapList, + DeepCopy_api_Container, + DeepCopy_api_ContainerImage, + DeepCopy_api_ContainerPort, + DeepCopy_api_ContainerState, + DeepCopy_api_ContainerStateRunning, + DeepCopy_api_ContainerStateTerminated, + DeepCopy_api_ContainerStateWaiting, + DeepCopy_api_ContainerStatus, + DeepCopy_api_ConversionError, + DeepCopy_api_DaemonEndpoint, + DeepCopy_api_DeleteOptions, + DeepCopy_api_DownwardAPIVolumeFile, + DeepCopy_api_DownwardAPIVolumeSource, + DeepCopy_api_EmptyDirVolumeSource, + DeepCopy_api_EndpointAddress, + DeepCopy_api_EndpointPort, + DeepCopy_api_EndpointSubset, + DeepCopy_api_Endpoints, + DeepCopy_api_EndpointsList, + DeepCopy_api_EnvVar, + DeepCopy_api_EnvVarSource, + DeepCopy_api_Event, + DeepCopy_api_EventList, + DeepCopy_api_EventSource, + DeepCopy_api_ExecAction, + DeepCopy_api_ExportOptions, + DeepCopy_api_FCVolumeSource, + DeepCopy_api_FlexVolumeSource, + DeepCopy_api_FlockerVolumeSource, + DeepCopy_api_GCEPersistentDiskVolumeSource, + DeepCopy_api_GitRepoVolumeSource, + DeepCopy_api_GlusterfsVolumeSource, + DeepCopy_api_HTTPGetAction, + DeepCopy_api_HTTPHeader, + DeepCopy_api_Handler, + DeepCopy_api_HostPathVolumeSource, + DeepCopy_api_ISCSIVolumeSource, + DeepCopy_api_Lifecycle, + DeepCopy_api_LimitRange, + DeepCopy_api_LimitRangeItem, + DeepCopy_api_LimitRangeList, + DeepCopy_api_LimitRangeSpec, + DeepCopy_api_List, + DeepCopy_api_ListOptions, + DeepCopy_api_LoadBalancerIngress, + DeepCopy_api_LoadBalancerStatus, + DeepCopy_api_LocalObjectReference, + DeepCopy_api_NFSVolumeSource, + DeepCopy_api_Namespace, + DeepCopy_api_NamespaceList, + DeepCopy_api_NamespaceSpec, + DeepCopy_api_NamespaceStatus, + DeepCopy_api_Node, + DeepCopy_api_NodeAddress, + DeepCopy_api_NodeAffinity, + DeepCopy_api_NodeCondition, + DeepCopy_api_NodeDaemonEndpoints, + DeepCopy_api_NodeList, + DeepCopy_api_NodeResources, + DeepCopy_api_NodeSelector, + DeepCopy_api_NodeSelectorRequirement, + DeepCopy_api_NodeSelectorTerm, + DeepCopy_api_NodeSpec, + DeepCopy_api_NodeStatus, + DeepCopy_api_NodeSystemInfo, + DeepCopy_api_ObjectFieldSelector, + DeepCopy_api_ObjectMeta, + DeepCopy_api_ObjectReference, + DeepCopy_api_PersistentVolume, + DeepCopy_api_PersistentVolumeClaim, + DeepCopy_api_PersistentVolumeClaimList, + DeepCopy_api_PersistentVolumeClaimSpec, + DeepCopy_api_PersistentVolumeClaimStatus, + DeepCopy_api_PersistentVolumeClaimVolumeSource, + DeepCopy_api_PersistentVolumeList, + DeepCopy_api_PersistentVolumeSource, + DeepCopy_api_PersistentVolumeSpec, + DeepCopy_api_PersistentVolumeStatus, + DeepCopy_api_Pod, + DeepCopy_api_PodAttachOptions, + DeepCopy_api_PodCondition, + DeepCopy_api_PodExecOptions, + DeepCopy_api_PodList, + DeepCopy_api_PodLogOptions, + DeepCopy_api_PodProxyOptions, + DeepCopy_api_PodSecurityContext, + DeepCopy_api_PodSpec, + DeepCopy_api_PodStatus, + DeepCopy_api_PodStatusResult, + DeepCopy_api_PodTemplate, + DeepCopy_api_PodTemplateList, + DeepCopy_api_PodTemplateSpec, + DeepCopy_api_PreferredSchedulingTerm, + DeepCopy_api_Probe, + DeepCopy_api_RBDVolumeSource, + DeepCopy_api_RangeAllocation, + DeepCopy_api_ReplicationController, + DeepCopy_api_ReplicationControllerList, + DeepCopy_api_ReplicationControllerSpec, + DeepCopy_api_ReplicationControllerStatus, + DeepCopy_api_ResourceQuota, + DeepCopy_api_ResourceQuotaList, + DeepCopy_api_ResourceQuotaSpec, + DeepCopy_api_ResourceQuotaStatus, + DeepCopy_api_ResourceRequirements, + DeepCopy_api_SELinuxOptions, + DeepCopy_api_Secret, + DeepCopy_api_SecretKeySelector, + DeepCopy_api_SecretList, + DeepCopy_api_SecretVolumeSource, + DeepCopy_api_SecurityContext, + DeepCopy_api_SerializedReference, + DeepCopy_api_Service, + DeepCopy_api_ServiceAccount, + DeepCopy_api_ServiceAccountList, + DeepCopy_api_ServiceList, + DeepCopy_api_ServicePort, + DeepCopy_api_ServiceSpec, + DeepCopy_api_ServiceStatus, + DeepCopy_api_TCPSocketAction, + DeepCopy_api_Volume, + DeepCopy_api_VolumeMount, + DeepCopy_api_VolumeSource, + DeepCopy_conversion_Meta, + DeepCopy_intstr_IntOrString, + DeepCopy_sets_Empty, + DeepCopy_unversioned_GroupKind, + DeepCopy_unversioned_GroupResource, + DeepCopy_unversioned_GroupVersion, + DeepCopy_unversioned_GroupVersionKind, + DeepCopy_unversioned_GroupVersionResource, + DeepCopy_unversioned_ListMeta, + DeepCopy_unversioned_TypeMeta, ); err != nil { // if one of the deep copy functions is malformed, detect it immediately. panic(err) } } -func deepCopy_api_AWSElasticBlockStoreVolumeSource(in AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_AWSElasticBlockStoreVolumeSource(in AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, c *conversion.Cloner) error { out.VolumeID = in.VolumeID out.FSType = in.FSType out.Partition = in.Partition @@ -184,20 +191,40 @@ func deepCopy_api_AWSElasticBlockStoreVolumeSource(in AWSElasticBlockStoreVolume return nil } -func deepCopy_api_Binding(in Binding, out *Binding, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Affinity(in Affinity, out *Affinity, c *conversion.Cloner) error { + if in.NodeAffinity != nil { + in, out := in.NodeAffinity, &out.NodeAffinity + *out = new(NodeAffinity) + if err := DeepCopy_api_NodeAffinity(*in, *out, c); err != nil { + return err + } + } else { + out.NodeAffinity = nil + } + return nil +} + +func DeepCopy_api_AzureFileVolumeSource(in AzureFileVolumeSource, out *AzureFileVolumeSource, c *conversion.Cloner) error { + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + +func DeepCopy_api_Binding(in Binding, out *Binding, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + if err := DeepCopy_api_ObjectReference(in.Target, &out.Target, c); err != nil { return err } return nil } -func deepCopy_api_Capabilities(in Capabilities, out *Capabilities, c *conversion.Cloner) error { +func DeepCopy_api_Capabilities(in Capabilities, out *Capabilities, c *conversion.Cloner) error { if in.Add != nil { in, out := in.Add, &out.Add *out = make([]Capability, len(in)) @@ -219,7 +246,7 @@ func deepCopy_api_Capabilities(in Capabilities, out *Capabilities, c *conversion return nil } -func deepCopy_api_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSource, c *conversion.Cloner) error { if in.Monitors != nil { in, out := in.Monitors, &out.Monitors *out = make([]string, len(in)) @@ -233,7 +260,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 { + if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { return err } } else { @@ -243,14 +270,14 @@ func deepCopy_api_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSou return nil } -func deepCopy_api_CinderVolumeSource(in CinderVolumeSource, out *CinderVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_CinderVolumeSource(in CinderVolumeSource, out *CinderVolumeSource, c *conversion.Cloner) error { out.VolumeID = in.VolumeID out.FSType = in.FSType out.ReadOnly = in.ReadOnly return nil } -func deepCopy_api_ComponentCondition(in ComponentCondition, out *ComponentCondition, c *conversion.Cloner) error { +func DeepCopy_api_ComponentCondition(in ComponentCondition, out *ComponentCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status out.Message = in.Message @@ -258,18 +285,18 @@ func deepCopy_api_ComponentCondition(in ComponentCondition, out *ComponentCondit return nil } -func deepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if in.Conditions != nil { 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 { + if err := DeepCopy_api_ComponentCondition(in[i], &(*out)[i], c); err != nil { return err } } @@ -279,18 +306,18 @@ func deepCopy_api_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *c return nil } -func deepCopy_api_ComponentStatusList(in ComponentStatusList, out *ComponentStatusList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ComponentStatusList(in ComponentStatusList, out *ComponentStatusList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ComponentStatus, len(in)) for i := range in { - if err := deepCopy_api_ComponentStatus(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ComponentStatus(in[i], &(*out)[i], c); err != nil { return err } } @@ -300,11 +327,11 @@ func deepCopy_api_ComponentStatusList(in ComponentStatusList, out *ComponentStat return nil } -func deepCopy_api_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if in.Data != nil { @@ -319,26 +346,26 @@ func deepCopy_api_ConfigMap(in ConfigMap, out *ConfigMap, c *conversion.Cloner) return nil } -func deepCopy_api_ConfigMapKeySelector(in ConfigMapKeySelector, out *ConfigMapKeySelector, c *conversion.Cloner) error { - if err := deepCopy_api_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { +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.Key = in.Key return nil } -func deepCopy_api_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ConfigMapList(in ConfigMapList, out *ConfigMapList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ConfigMap, len(in)) for i := range in { - if err := deepCopy_api_ConfigMap(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ConfigMap(in[i], &(*out)[i], c); err != nil { return err } } @@ -348,7 +375,7 @@ func deepCopy_api_ConfigMapList(in ConfigMapList, out *ConfigMapList, c *convers return nil } -func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) error { +func DeepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) error { out.Name = in.Name out.Image = in.Image if in.Command != nil { @@ -370,7 +397,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 { + if err := DeepCopy_api_ContainerPort(in[i], &(*out)[i], c); err != nil { return err } } @@ -381,21 +408,21 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) in, out := in.Env, &out.Env *out = make([]EnvVar, len(in)) for i := range in { - if err := deepCopy_api_EnvVar(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_EnvVar(in[i], &(*out)[i], c); err != nil { return err } } } else { out.Env = nil } - if err := deepCopy_api_ResourceRequirements(in.Resources, &out.Resources, c); err != nil { + if err := DeepCopy_api_ResourceRequirements(in.Resources, &out.Resources, c); err != nil { return err } if in.VolumeMounts != nil { 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 { + if err := DeepCopy_api_VolumeMount(in[i], &(*out)[i], c); err != nil { return err } } @@ -405,7 +432,7 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) if in.LivenessProbe != nil { in, out := in.LivenessProbe, &out.LivenessProbe *out = new(Probe) - if err := deepCopy_api_Probe(*in, *out, c); err != nil { + if err := DeepCopy_api_Probe(*in, *out, c); err != nil { return err } } else { @@ -414,7 +441,7 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) if in.ReadinessProbe != nil { in, out := in.ReadinessProbe, &out.ReadinessProbe *out = new(Probe) - if err := deepCopy_api_Probe(*in, *out, c); err != nil { + if err := DeepCopy_api_Probe(*in, *out, c); err != nil { return err } } else { @@ -423,7 +450,7 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) if in.Lifecycle != nil { in, out := in.Lifecycle, &out.Lifecycle *out = new(Lifecycle) - if err := deepCopy_api_Lifecycle(*in, *out, c); err != nil { + if err := DeepCopy_api_Lifecycle(*in, *out, c); err != nil { return err } } else { @@ -434,7 +461,7 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) if in.SecurityContext != nil { in, out := in.SecurityContext, &out.SecurityContext *out = new(SecurityContext) - if err := deepCopy_api_SecurityContext(*in, *out, c); err != nil { + if err := DeepCopy_api_SecurityContext(*in, *out, c); err != nil { return err } } else { @@ -446,7 +473,7 @@ func deepCopy_api_Container(in Container, out *Container, c *conversion.Cloner) return nil } -func deepCopy_api_ContainerImage(in ContainerImage, out *ContainerImage, c *conversion.Cloner) error { +func DeepCopy_api_ContainerImage(in ContainerImage, out *ContainerImage, c *conversion.Cloner) error { if in.RepoTags != nil { in, out := in.RepoTags, &out.RepoTags *out = make([]string, len(in)) @@ -458,7 +485,7 @@ func deepCopy_api_ContainerImage(in ContainerImage, out *ContainerImage, c *conv return nil } -func deepCopy_api_ContainerPort(in ContainerPort, out *ContainerPort, c *conversion.Cloner) error { +func DeepCopy_api_ContainerPort(in ContainerPort, out *ContainerPort, c *conversion.Cloner) error { out.Name = in.Name out.HostPort = in.HostPort out.ContainerPort = in.ContainerPort @@ -467,11 +494,11 @@ func deepCopy_api_ContainerPort(in ContainerPort, out *ContainerPort, c *convers return nil } -func deepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conversion.Cloner) error { +func DeepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conversion.Cloner) error { if in.Waiting != nil { in, out := in.Waiting, &out.Waiting *out = new(ContainerStateWaiting) - if err := deepCopy_api_ContainerStateWaiting(*in, *out, c); err != nil { + if err := DeepCopy_api_ContainerStateWaiting(*in, *out, c); err != nil { return err } } else { @@ -480,7 +507,7 @@ func deepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conv if in.Running != nil { in, out := in.Running, &out.Running *out = new(ContainerStateRunning) - if err := deepCopy_api_ContainerStateRunning(*in, *out, c); err != nil { + if err := DeepCopy_api_ContainerStateRunning(*in, *out, c); err != nil { return err } } else { @@ -489,7 +516,7 @@ func deepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conv if in.Terminated != nil { in, out := in.Terminated, &out.Terminated *out = new(ContainerStateTerminated) - if err := deepCopy_api_ContainerStateTerminated(*in, *out, c); err != nil { + if err := DeepCopy_api_ContainerStateTerminated(*in, *out, c); err != nil { return err } } else { @@ -498,7 +525,7 @@ func deepCopy_api_ContainerState(in ContainerState, out *ContainerState, c *conv return nil } -func deepCopy_api_ContainerStateRunning(in ContainerStateRunning, out *ContainerStateRunning, c *conversion.Cloner) error { +func DeepCopy_api_ContainerStateRunning(in ContainerStateRunning, out *ContainerStateRunning, c *conversion.Cloner) error { if newVal, err := c.DeepCopy(in.StartedAt); err != nil { return err } else { @@ -507,7 +534,7 @@ func deepCopy_api_ContainerStateRunning(in ContainerStateRunning, out *Container return nil } -func deepCopy_api_ContainerStateTerminated(in ContainerStateTerminated, out *ContainerStateTerminated, c *conversion.Cloner) error { +func DeepCopy_api_ContainerStateTerminated(in ContainerStateTerminated, out *ContainerStateTerminated, c *conversion.Cloner) error { out.ExitCode = in.ExitCode out.Signal = in.Signal out.Reason = in.Reason @@ -526,18 +553,18 @@ func deepCopy_api_ContainerStateTerminated(in ContainerStateTerminated, out *Con return nil } -func deepCopy_api_ContainerStateWaiting(in ContainerStateWaiting, out *ContainerStateWaiting, c *conversion.Cloner) error { +func DeepCopy_api_ContainerStateWaiting(in ContainerStateWaiting, out *ContainerStateWaiting, c *conversion.Cloner) error { out.Reason = in.Reason out.Message = in.Message return nil } -func deepCopy_api_ContainerStatus(in ContainerStatus, out *ContainerStatus, c *conversion.Cloner) error { +func DeepCopy_api_ContainerStatus(in ContainerStatus, out *ContainerStatus, c *conversion.Cloner) error { out.Name = in.Name - if err := deepCopy_api_ContainerState(in.State, &out.State, c); err != nil { + if err := DeepCopy_api_ContainerState(in.State, &out.State, c); err != nil { return err } - if err := deepCopy_api_ContainerState(in.LastTerminationState, &out.LastTerminationState, c); err != nil { + if err := DeepCopy_api_ContainerState(in.LastTerminationState, &out.LastTerminationState, c); err != nil { return err } out.Ready = in.Ready @@ -548,7 +575,7 @@ func deepCopy_api_ContainerStatus(in ContainerStatus, out *ContainerStatus, c *c return nil } -func deepCopy_api_ConversionError(in ConversionError, out *ConversionError, c *conversion.Cloner) error { +func DeepCopy_api_ConversionError(in ConversionError, out *ConversionError, c *conversion.Cloner) error { if newVal, err := c.DeepCopy(in.In); err != nil { return err } else { @@ -563,13 +590,13 @@ func deepCopy_api_ConversionError(in ConversionError, out *ConversionError, c *c return nil } -func deepCopy_api_DaemonEndpoint(in DaemonEndpoint, out *DaemonEndpoint, c *conversion.Cloner) error { +func DeepCopy_api_DaemonEndpoint(in DaemonEndpoint, out *DaemonEndpoint, c *conversion.Cloner) error { out.Port = in.Port return nil } -func deepCopy_api_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } if in.GracePeriodSeconds != nil { @@ -582,20 +609,20 @@ func deepCopy_api_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *convers return nil } -func deepCopy_api_DownwardAPIVolumeFile(in DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, c *conversion.Cloner) error { +func DeepCopy_api_DownwardAPIVolumeFile(in DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, c *conversion.Cloner) error { out.Path = in.Path - if err := deepCopy_api_ObjectFieldSelector(in.FieldRef, &out.FieldRef, c); err != nil { + if err := DeepCopy_api_ObjectFieldSelector(in.FieldRef, &out.FieldRef, c); err != nil { return err } return nil } -func deepCopy_api_DownwardAPIVolumeSource(in DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_DownwardAPIVolumeSource(in DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, c *conversion.Cloner) error { if in.Items != nil { in, out := in.Items, &out.Items *out = make([]DownwardAPIVolumeFile, len(in)) for i := range in { - if err := deepCopy_api_DownwardAPIVolumeFile(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_DownwardAPIVolumeFile(in[i], &(*out)[i], c); err != nil { return err } } @@ -605,17 +632,17 @@ func deepCopy_api_DownwardAPIVolumeSource(in DownwardAPIVolumeSource, out *Downw return nil } -func deepCopy_api_EmptyDirVolumeSource(in EmptyDirVolumeSource, out *EmptyDirVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_EmptyDirVolumeSource(in EmptyDirVolumeSource, out *EmptyDirVolumeSource, c *conversion.Cloner) error { out.Medium = in.Medium return nil } -func deepCopy_api_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *conversion.Cloner) error { +func DeepCopy_api_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *conversion.Cloner) error { out.IP = in.IP if in.TargetRef != nil { in, out := in.TargetRef, &out.TargetRef *out = new(ObjectReference) - if err := deepCopy_api_ObjectReference(*in, *out, c); err != nil { + if err := DeepCopy_api_ObjectReference(*in, *out, c); err != nil { return err } } else { @@ -624,19 +651,19 @@ func deepCopy_api_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *c return nil } -func deepCopy_api_EndpointPort(in EndpointPort, out *EndpointPort, c *conversion.Cloner) error { +func DeepCopy_api_EndpointPort(in EndpointPort, out *EndpointPort, c *conversion.Cloner) error { out.Name = in.Name out.Port = in.Port out.Protocol = in.Protocol return nil } -func deepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conversion.Cloner) error { +func DeepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conversion.Cloner) error { if in.Addresses != nil { in, out := in.Addresses, &out.Addresses *out = make([]EndpointAddress, len(in)) for i := range in { - if err := deepCopy_api_EndpointAddress(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_EndpointAddress(in[i], &(*out)[i], c); err != nil { return err } } @@ -647,7 +674,7 @@ func deepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conv in, out := in.NotReadyAddresses, &out.NotReadyAddresses *out = make([]EndpointAddress, len(in)) for i := range in { - if err := deepCopy_api_EndpointAddress(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_EndpointAddress(in[i], &(*out)[i], c); err != nil { return err } } @@ -658,7 +685,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 { + if err := DeepCopy_api_EndpointPort(in[i], &(*out)[i], c); err != nil { return err } } @@ -668,18 +695,18 @@ func deepCopy_api_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conv return nil } -func deepCopy_api_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if in.Subsets != nil { in, out := in.Subsets, &out.Subsets *out = make([]EndpointSubset, len(in)) for i := range in { - if err := deepCopy_api_EndpointSubset(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_EndpointSubset(in[i], &(*out)[i], c); err != nil { return err } } @@ -689,18 +716,18 @@ func deepCopy_api_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) return nil } -func deepCopy_api_EndpointsList(in EndpointsList, out *EndpointsList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_EndpointsList(in EndpointsList, out *EndpointsList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Endpoints, len(in)) for i := range in { - if err := deepCopy_api_Endpoints(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Endpoints(in[i], &(*out)[i], c); err != nil { return err } } @@ -710,13 +737,13 @@ func deepCopy_api_EndpointsList(in EndpointsList, out *EndpointsList, c *convers return nil } -func deepCopy_api_EnvVar(in EnvVar, out *EnvVar, c *conversion.Cloner) error { +func DeepCopy_api_EnvVar(in EnvVar, out *EnvVar, c *conversion.Cloner) error { out.Name = in.Name out.Value = in.Value if in.ValueFrom != nil { in, out := in.ValueFrom, &out.ValueFrom *out = new(EnvVarSource) - if err := deepCopy_api_EnvVarSource(*in, *out, c); err != nil { + if err := DeepCopy_api_EnvVarSource(*in, *out, c); err != nil { return err } } else { @@ -725,11 +752,11 @@ func deepCopy_api_EnvVar(in EnvVar, out *EnvVar, c *conversion.Cloner) error { return nil } -func deepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion.Cloner) error { +func DeepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion.Cloner) error { if in.FieldRef != nil { in, out := in.FieldRef, &out.FieldRef *out = new(ObjectFieldSelector) - if err := deepCopy_api_ObjectFieldSelector(*in, *out, c); err != nil { + if err := DeepCopy_api_ObjectFieldSelector(*in, *out, c); err != nil { return err } } else { @@ -738,7 +765,7 @@ 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 { + if err := DeepCopy_api_ConfigMapKeySelector(*in, *out, c); err != nil { return err } } else { @@ -747,7 +774,7 @@ func deepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion if in.SecretKeyRef != nil { in, out := in.SecretKeyRef, &out.SecretKeyRef *out = new(SecretKeySelector) - if err := deepCopy_api_SecretKeySelector(*in, *out, c); err != nil { + if err := DeepCopy_api_SecretKeySelector(*in, *out, c); err != nil { return err } } else { @@ -756,19 +783,19 @@ func deepCopy_api_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion return nil } -func deepCopy_api_Event(in Event, out *Event, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Event(in Event, out *Event, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + if err := DeepCopy_api_ObjectReference(in.InvolvedObject, &out.InvolvedObject, c); err != nil { return err } out.Reason = in.Reason out.Message = in.Message - if err := deepCopy_api_EventSource(in.Source, &out.Source, c); err != nil { + if err := DeepCopy_api_EventSource(in.Source, &out.Source, c); err != nil { return err } if newVal, err := c.DeepCopy(in.FirstTimestamp); err != nil { @@ -786,18 +813,18 @@ func deepCopy_api_Event(in Event, out *Event, c *conversion.Cloner) error { return nil } -func deepCopy_api_EventList(in EventList, out *EventList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_EventList(in EventList, out *EventList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Event, len(in)) for i := range in { - if err := deepCopy_api_Event(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Event(in[i], &(*out)[i], c); err != nil { return err } } @@ -807,13 +834,13 @@ func deepCopy_api_EventList(in EventList, out *EventList, c *conversion.Cloner) return nil } -func deepCopy_api_EventSource(in EventSource, out *EventSource, c *conversion.Cloner) error { +func DeepCopy_api_EventSource(in EventSource, out *EventSource, c *conversion.Cloner) error { out.Component = in.Component out.Host = in.Host return nil } -func deepCopy_api_ExecAction(in ExecAction, out *ExecAction, c *conversion.Cloner) error { +func DeepCopy_api_ExecAction(in ExecAction, out *ExecAction, c *conversion.Cloner) error { if in.Command != nil { in, out := in.Command, &out.Command *out = make([]string, len(in)) @@ -824,8 +851,8 @@ func deepCopy_api_ExecAction(in ExecAction, out *ExecAction, c *conversion.Clone return nil } -func deepCopy_api_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } out.Export = in.Export @@ -833,7 +860,7 @@ func deepCopy_api_ExportOptions(in ExportOptions, out *ExportOptions, c *convers return nil } -func deepCopy_api_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conversion.Cloner) error { if in.TargetWWNs != nil { in, out := in.TargetWWNs, &out.TargetWWNs *out = make([]string, len(in)) @@ -853,13 +880,13 @@ func deepCopy_api_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conv return nil } -func deepCopy_api_FlexVolumeSource(in FlexVolumeSource, out *FlexVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_FlexVolumeSource(in FlexVolumeSource, out *FlexVolumeSource, c *conversion.Cloner) error { out.Driver = in.Driver out.FSType = in.FSType if in.SecretRef != nil { in, out := in.SecretRef, &out.SecretRef *out = new(LocalObjectReference) - if err := deepCopy_api_LocalObjectReference(*in, *out, c); err != nil { + if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { return err } } else { @@ -878,12 +905,12 @@ func deepCopy_api_FlexVolumeSource(in FlexVolumeSource, out *FlexVolumeSource, c return nil } -func deepCopy_api_FlockerVolumeSource(in FlockerVolumeSource, out *FlockerVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_FlockerVolumeSource(in FlockerVolumeSource, out *FlockerVolumeSource, c *conversion.Cloner) error { out.DatasetName = in.DatasetName return nil } -func deepCopy_api_GCEPersistentDiskVolumeSource(in GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_GCEPersistentDiskVolumeSource(in GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, c *conversion.Cloner) error { out.PDName = in.PDName out.FSType = in.FSType out.Partition = in.Partition @@ -891,35 +918,52 @@ func deepCopy_api_GCEPersistentDiskVolumeSource(in GCEPersistentDiskVolumeSource return nil } -func deepCopy_api_GitRepoVolumeSource(in GitRepoVolumeSource, out *GitRepoVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_GitRepoVolumeSource(in GitRepoVolumeSource, out *GitRepoVolumeSource, c *conversion.Cloner) error { out.Repository = in.Repository out.Revision = in.Revision out.Directory = in.Directory return nil } -func deepCopy_api_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *GlusterfsVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *GlusterfsVolumeSource, c *conversion.Cloner) error { out.EndpointsName = in.EndpointsName out.Path = in.Path out.ReadOnly = in.ReadOnly return nil } -func deepCopy_api_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error { +func DeepCopy_api_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error { out.Path = in.Path - if err := deepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { + if err := DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { return err } 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 + } + } + } else { + out.HTTPHeaders = nil + } return nil } -func deepCopy_api_Handler(in Handler, out *Handler, c *conversion.Cloner) error { +func DeepCopy_api_HTTPHeader(in HTTPHeader, out *HTTPHeader, c *conversion.Cloner) error { + out.Name = in.Name + out.Value = in.Value + return nil +} + +func DeepCopy_api_Handler(in Handler, out *Handler, c *conversion.Cloner) error { if in.Exec != nil { in, out := in.Exec, &out.Exec *out = new(ExecAction) - if err := deepCopy_api_ExecAction(*in, *out, c); err != nil { + if err := DeepCopy_api_ExecAction(*in, *out, c); err != nil { return err } } else { @@ -928,7 +972,7 @@ func deepCopy_api_Handler(in Handler, out *Handler, c *conversion.Cloner) error if in.HTTPGet != nil { in, out := in.HTTPGet, &out.HTTPGet *out = new(HTTPGetAction) - if err := deepCopy_api_HTTPGetAction(*in, *out, c); err != nil { + if err := DeepCopy_api_HTTPGetAction(*in, *out, c); err != nil { return err } } else { @@ -937,7 +981,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 { + if err := DeepCopy_api_TCPSocketAction(*in, *out, c); err != nil { return err } } else { @@ -946,12 +990,12 @@ func deepCopy_api_Handler(in Handler, out *Handler, c *conversion.Cloner) error return nil } -func deepCopy_api_HostPathVolumeSource(in HostPathVolumeSource, out *HostPathVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_HostPathVolumeSource(in HostPathVolumeSource, out *HostPathVolumeSource, c *conversion.Cloner) error { out.Path = in.Path return nil } -func deepCopy_api_ISCSIVolumeSource(in ISCSIVolumeSource, out *ISCSIVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_ISCSIVolumeSource(in ISCSIVolumeSource, out *ISCSIVolumeSource, c *conversion.Cloner) error { out.TargetPortal = in.TargetPortal out.IQN = in.IQN out.Lun = in.Lun @@ -961,11 +1005,11 @@ func deepCopy_api_ISCSIVolumeSource(in ISCSIVolumeSource, out *ISCSIVolumeSource return nil } -func deepCopy_api_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) error { +func DeepCopy_api_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) error { if in.PostStart != nil { in, out := in.PostStart, &out.PostStart *out = new(Handler) - if err := deepCopy_api_Handler(*in, *out, c); err != nil { + if err := DeepCopy_api_Handler(*in, *out, c); err != nil { return err } } else { @@ -974,7 +1018,7 @@ func deepCopy_api_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) if in.PreStop != nil { in, out := in.PreStop, &out.PreStop *out = new(Handler) - if err := deepCopy_api_Handler(*in, *out, c); err != nil { + if err := DeepCopy_api_Handler(*in, *out, c); err != nil { return err } } else { @@ -983,20 +1027,20 @@ func deepCopy_api_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) return nil } -func deepCopy_api_LimitRange(in LimitRange, out *LimitRange, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_LimitRange(in LimitRange, out *LimitRange, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_LimitRangeSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_LimitRangeSpec(in.Spec, &out.Spec, c); err != nil { return err } return nil } -func deepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conversion.Cloner) error { +func DeepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conversion.Cloner) error { out.Type = in.Type if in.Max != nil { in, out := in.Max, &out.Max @@ -1066,18 +1110,18 @@ func deepCopy_api_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conv return nil } -func deepCopy_api_LimitRangeList(in LimitRangeList, out *LimitRangeList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_LimitRangeList(in LimitRangeList, out *LimitRangeList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]LimitRange, len(in)) for i := range in { - if err := deepCopy_api_LimitRange(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_LimitRange(in[i], &(*out)[i], c); err != nil { return err } } @@ -1087,12 +1131,12 @@ func deepCopy_api_LimitRangeList(in LimitRangeList, out *LimitRangeList, c *conv return nil } -func deepCopy_api_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conversion.Cloner) error { +func DeepCopy_api_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conversion.Cloner) error { if in.Limits != nil { in, out := in.Limits, &out.Limits *out = make([]LimitRangeItem, len(in)) for i := range in { - if err := deepCopy_api_LimitRangeItem(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_LimitRangeItem(in[i], &(*out)[i], c); err != nil { return err } } @@ -1102,11 +1146,11 @@ func deepCopy_api_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conv return nil } -func deepCopy_api_List(in List, out *List, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_List(in List, out *List, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { @@ -1125,8 +1169,8 @@ func deepCopy_api_List(in List, out *List, c *conversion.Cloner) error { return nil } -func deepCopy_api_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } if newVal, err := c.DeepCopy(in.LabelSelector); err != nil { @@ -1151,18 +1195,18 @@ func deepCopy_api_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cl return nil } -func deepCopy_api_LoadBalancerIngress(in LoadBalancerIngress, out *LoadBalancerIngress, c *conversion.Cloner) error { +func DeepCopy_api_LoadBalancerIngress(in LoadBalancerIngress, out *LoadBalancerIngress, c *conversion.Cloner) error { out.IP = in.IP out.Hostname = in.Hostname return nil } -func deepCopy_api_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerStatus, c *conversion.Cloner) error { +func DeepCopy_api_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerStatus, c *conversion.Cloner) error { if in.Ingress != nil { 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 { + if err := DeepCopy_api_LoadBalancerIngress(in[i], &(*out)[i], c); err != nil { return err } } @@ -1172,46 +1216,46 @@ func deepCopy_api_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerSta return nil } -func deepCopy_api_LocalObjectReference(in LocalObjectReference, out *LocalObjectReference, c *conversion.Cloner) error { +func DeepCopy_api_LocalObjectReference(in LocalObjectReference, out *LocalObjectReference, c *conversion.Cloner) error { out.Name = in.Name return nil } -func deepCopy_api_NFSVolumeSource(in NFSVolumeSource, out *NFSVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_NFSVolumeSource(in NFSVolumeSource, out *NFSVolumeSource, c *conversion.Cloner) error { out.Server = in.Server out.Path = in.Path out.ReadOnly = in.ReadOnly return nil } -func deepCopy_api_Namespace(in Namespace, out *Namespace, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Namespace(in Namespace, out *Namespace, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + 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 { + if err := DeepCopy_api_NamespaceStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_NamespaceList(in NamespaceList, out *NamespaceList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_NamespaceList(in NamespaceList, out *NamespaceList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Namespace, len(in)) for i := range in { - if err := deepCopy_api_Namespace(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Namespace(in[i], &(*out)[i], c); err != nil { return err } } @@ -1221,7 +1265,7 @@ func deepCopy_api_NamespaceList(in NamespaceList, out *NamespaceList, c *convers return nil } -func deepCopy_api_NamespaceSpec(in NamespaceSpec, out *NamespaceSpec, c *conversion.Cloner) error { +func DeepCopy_api_NamespaceSpec(in NamespaceSpec, out *NamespaceSpec, c *conversion.Cloner) error { if in.Finalizers != nil { in, out := in.Finalizers, &out.Finalizers *out = make([]FinalizerName, len(in)) @@ -1234,34 +1278,67 @@ func deepCopy_api_NamespaceSpec(in NamespaceSpec, out *NamespaceSpec, c *convers return nil } -func deepCopy_api_NamespaceStatus(in NamespaceStatus, out *NamespaceStatus, c *conversion.Cloner) error { +func DeepCopy_api_NamespaceStatus(in NamespaceStatus, out *NamespaceStatus, c *conversion.Cloner) error { out.Phase = in.Phase return nil } -func deepCopy_api_Node(in Node, out *Node, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Node(in Node, out *Node, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + if err := DeepCopy_api_NodeSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := deepCopy_api_NodeStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_NodeStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_NodeAddress(in NodeAddress, out *NodeAddress, c *conversion.Cloner) error { +func DeepCopy_api_NodeAddress(in NodeAddress, out *NodeAddress, c *conversion.Cloner) error { out.Type = in.Type out.Address = in.Address return nil } -func deepCopy_api_NodeCondition(in NodeCondition, out *NodeCondition, c *conversion.Cloner) error { +func DeepCopy_api_NodeAffinity(in NodeAffinity, out *NodeAffinity, c *conversion.Cloner) error { + if in.RequiredDuringSchedulingRequiredDuringExecution != nil { + in, out := in.RequiredDuringSchedulingRequiredDuringExecution, &out.RequiredDuringSchedulingRequiredDuringExecution + *out = new(NodeSelector) + if err := DeepCopy_api_NodeSelector(*in, *out, c); err != nil { + return err + } + } else { + out.RequiredDuringSchedulingRequiredDuringExecution = nil + } + if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { + in, out := in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution + *out = new(NodeSelector) + if err := DeepCopy_api_NodeSelector(*in, *out, c); err != nil { + return err + } + } else { + out.RequiredDuringSchedulingIgnoredDuringExecution = nil + } + if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { + in, out := in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution + *out = make([]PreferredSchedulingTerm, len(in)) + for i := range in { + if err := DeepCopy_api_PreferredSchedulingTerm(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.PreferredDuringSchedulingIgnoredDuringExecution = nil + } + return nil +} + +func DeepCopy_api_NodeCondition(in NodeCondition, out *NodeCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status if newVal, err := c.DeepCopy(in.LastHeartbeatTime); err != nil { @@ -1279,25 +1356,25 @@ func deepCopy_api_NodeCondition(in NodeCondition, out *NodeCondition, c *convers 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 { +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 } return nil } -func deepCopy_api_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_NodeList(in NodeList, out *NodeList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Node, len(in)) for i := range in { - if err := deepCopy_api_Node(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Node(in[i], &(*out)[i], c); err != nil { return err } } @@ -1307,7 +1384,7 @@ func deepCopy_api_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) err return nil } -func deepCopy_api_NodeResources(in NodeResources, out *NodeResources, c *conversion.Cloner) error { +func DeepCopy_api_NodeResources(in NodeResources, out *NodeResources, c *conversion.Cloner) error { if in.Capacity != nil { in, out := in.Capacity, &out.Capacity *out = make(ResourceList) @@ -1324,7 +1401,50 @@ func deepCopy_api_NodeResources(in NodeResources, out *NodeResources, c *convers return nil } -func deepCopy_api_NodeSpec(in NodeSpec, out *NodeSpec, c *conversion.Cloner) error { +func DeepCopy_api_NodeSelector(in NodeSelector, out *NodeSelector, c *conversion.Cloner) error { + if in.NodeSelectorTerms != nil { + in, out := in.NodeSelectorTerms, &out.NodeSelectorTerms + *out = make([]NodeSelectorTerm, len(in)) + for i := range in { + if err := DeepCopy_api_NodeSelectorTerm(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.NodeSelectorTerms = nil + } + return nil +} + +func DeepCopy_api_NodeSelectorRequirement(in NodeSelectorRequirement, out *NodeSelectorRequirement, c *conversion.Cloner) error { + out.Key = in.Key + out.Operator = in.Operator + if in.Values != nil { + in, out := in.Values, &out.Values + *out = make([]string, len(in)) + copy(*out, in) + } else { + out.Values = nil + } + return nil +} + +func DeepCopy_api_NodeSelectorTerm(in NodeSelectorTerm, out *NodeSelectorTerm, c *conversion.Cloner) error { + if in.MatchExpressions != nil { + in, out := in.MatchExpressions, &out.MatchExpressions + *out = make([]NodeSelectorRequirement, len(in)) + for i := range in { + if err := DeepCopy_api_NodeSelectorRequirement(in[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.MatchExpressions = nil + } + return nil +} + +func DeepCopy_api_NodeSpec(in NodeSpec, out *NodeSpec, c *conversion.Cloner) error { out.PodCIDR = in.PodCIDR out.ExternalID = in.ExternalID out.ProviderID = in.ProviderID @@ -1332,7 +1452,7 @@ func deepCopy_api_NodeSpec(in NodeSpec, out *NodeSpec, c *conversion.Cloner) err return nil } -func deepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner) error { +func DeepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner) error { if in.Capacity != nil { in, out := in.Capacity, &out.Capacity *out = make(ResourceList) @@ -1364,7 +1484,7 @@ func deepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone in, out := in.Conditions, &out.Conditions *out = make([]NodeCondition, len(in)) for i := range in { - if err := deepCopy_api_NodeCondition(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_NodeCondition(in[i], &(*out)[i], c); err != nil { return err } } @@ -1375,24 +1495,24 @@ 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 { + if err := DeepCopy_api_NodeAddress(in[i], &(*out)[i], c); err != nil { return err } } } else { out.Addresses = nil } - if err := deepCopy_api_NodeDaemonEndpoints(in.DaemonEndpoints, &out.DaemonEndpoints, c); err != 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 { + if err := DeepCopy_api_NodeSystemInfo(in.NodeInfo, &out.NodeInfo, c); err != nil { return err } if in.Images != nil { in, out := in.Images, &out.Images *out = make([]ContainerImage, len(in)) for i := range in { - if err := deepCopy_api_ContainerImage(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ContainerImage(in[i], &(*out)[i], c); err != nil { return err } } @@ -1402,7 +1522,7 @@ func deepCopy_api_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Clone return nil } -func deepCopy_api_NodeSystemInfo(in NodeSystemInfo, out *NodeSystemInfo, c *conversion.Cloner) error { +func DeepCopy_api_NodeSystemInfo(in NodeSystemInfo, out *NodeSystemInfo, c *conversion.Cloner) error { out.MachineID = in.MachineID out.SystemUUID = in.SystemUUID out.BootID = in.BootID @@ -1414,13 +1534,13 @@ func deepCopy_api_NodeSystemInfo(in NodeSystemInfo, out *NodeSystemInfo, c *conv return nil } -func deepCopy_api_ObjectFieldSelector(in ObjectFieldSelector, out *ObjectFieldSelector, c *conversion.Cloner) error { +func DeepCopy_api_ObjectFieldSelector(in ObjectFieldSelector, out *ObjectFieldSelector, c *conversion.Cloner) error { out.APIVersion = in.APIVersion out.FieldPath = in.FieldPath return nil } -func deepCopy_api_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Cloner) error { +func DeepCopy_api_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Cloner) error { out.Name = in.Name out.GenerateName = in.GenerateName out.Namespace = in.Namespace @@ -1472,7 +1592,7 @@ func deepCopy_api_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Clone return nil } -func deepCopy_api_ObjectReference(in ObjectReference, out *ObjectReference, c *conversion.Cloner) error { +func DeepCopy_api_ObjectReference(in ObjectReference, out *ObjectReference, c *conversion.Cloner) error { out.Kind = in.Kind out.Namespace = in.Namespace out.Name = in.Name @@ -1483,50 +1603,50 @@ func deepCopy_api_ObjectReference(in ObjectReference, out *ObjectReference, c *c return nil } -func deepCopy_api_PersistentVolume(in PersistentVolume, out *PersistentVolume, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PersistentVolume(in PersistentVolume, out *PersistentVolume, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + 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 { + if err := DeepCopy_api_PersistentVolumeStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_PersistentVolumeClaim(in PersistentVolumeClaim, out *PersistentVolumeClaim, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PersistentVolumeClaim(in PersistentVolumeClaim, out *PersistentVolumeClaim, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_PersistentVolumeClaimSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_PersistentVolumeClaimSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := deepCopy_api_PersistentVolumeClaimStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_PersistentVolumeClaimStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *PersistentVolumeClaimList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *PersistentVolumeClaimList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolumeClaim, len(in)) for i := range in { - if err := deepCopy_api_PersistentVolumeClaim(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_PersistentVolumeClaim(in[i], &(*out)[i], c); err != nil { return err } } @@ -1536,7 +1656,7 @@ func deepCopy_api_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *P return nil } -func deepCopy_api_PersistentVolumeClaimSpec(in PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeClaimSpec(in PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, c *conversion.Cloner) error { if in.AccessModes != nil { in, out := in.AccessModes, &out.AccessModes *out = make([]PersistentVolumeAccessMode, len(in)) @@ -1546,14 +1666,14 @@ func deepCopy_api_PersistentVolumeClaimSpec(in PersistentVolumeClaimSpec, out *P } else { out.AccessModes = nil } - if err := deepCopy_api_ResourceRequirements(in.Resources, &out.Resources, c); err != nil { + if err := DeepCopy_api_ResourceRequirements(in.Resources, &out.Resources, c); err != nil { return err } out.VolumeName = in.VolumeName return nil } -func deepCopy_api_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, c *conversion.Cloner) error { out.Phase = in.Phase if in.AccessModes != nil { in, out := in.AccessModes, &out.AccessModes @@ -1580,24 +1700,24 @@ func deepCopy_api_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, ou return nil } -func deepCopy_api_PersistentVolumeClaimVolumeSource(in PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeClaimVolumeSource(in PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, c *conversion.Cloner) error { out.ClaimName = in.ClaimName out.ReadOnly = in.ReadOnly return nil } -func deepCopy_api_PersistentVolumeList(in PersistentVolumeList, out *PersistentVolumeList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PersistentVolumeList(in PersistentVolumeList, out *PersistentVolumeList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PersistentVolume, len(in)) for i := range in { - if err := deepCopy_api_PersistentVolume(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_PersistentVolume(in[i], &(*out)[i], c); err != nil { return err } } @@ -1607,11 +1727,11 @@ func deepCopy_api_PersistentVolumeList(in PersistentVolumeList, out *PersistentV return nil } -func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *PersistentVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *PersistentVolumeSource, c *conversion.Cloner) error { if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := deepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1620,7 +1740,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := deepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1629,7 +1749,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := deepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1638,7 +1758,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := deepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1647,7 +1767,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.NFS != nil { in, out := in.NFS, &out.NFS *out = new(NFSVolumeSource) - if err := deepCopy_api_NFSVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_NFSVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1656,7 +1776,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.RBD != nil { in, out := in.RBD, &out.RBD *out = new(RBDVolumeSource) - if err := deepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1665,7 +1785,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 { + if err := DeepCopy_api_ISCSIVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1674,7 +1794,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.FlexVolume != nil { in, out := in.FlexVolume, &out.FlexVolume *out = new(FlexVolumeSource) - if err := deepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1683,7 +1803,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 { + if err := DeepCopy_api_CinderVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1692,7 +1812,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.CephFS != nil { in, out := in.CephFS, &out.CephFS *out = new(CephFSVolumeSource) - if err := deepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1701,7 +1821,7 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist if in.FC != nil { in, out := in.FC, &out.FC *out = new(FCVolumeSource) - if err := deepCopy_api_FCVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_FCVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -1710,16 +1830,25 @@ 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 { + if err := DeepCopy_api_FlockerVolumeSource(*in, *out, c); err != nil { return err } } 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 + } + } else { + out.AzureFile = nil + } return nil } -func deepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentVolumeSpec, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentVolumeSpec, c *conversion.Cloner) error { if in.Capacity != nil { in, out := in.Capacity, &out.Capacity *out = make(ResourceList) @@ -1733,7 +1862,7 @@ func deepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentV } else { out.Capacity = nil } - if err := deepCopy_api_PersistentVolumeSource(in.PersistentVolumeSource, &out.PersistentVolumeSource, c); err != nil { + if err := DeepCopy_api_PersistentVolumeSource(in.PersistentVolumeSource, &out.PersistentVolumeSource, c); err != nil { return err } if in.AccessModes != nil { @@ -1748,7 +1877,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 { + if err := DeepCopy_api_ObjectReference(*in, *out, c); err != nil { return err } } else { @@ -1758,31 +1887,31 @@ func deepCopy_api_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentV return nil } -func deepCopy_api_PersistentVolumeStatus(in PersistentVolumeStatus, out *PersistentVolumeStatus, c *conversion.Cloner) error { +func DeepCopy_api_PersistentVolumeStatus(in PersistentVolumeStatus, out *PersistentVolumeStatus, c *conversion.Cloner) error { out.Phase = in.Phase out.Message = in.Message out.Reason = in.Reason return nil } -func deepCopy_api_Pod(in Pod, out *Pod, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Pod(in Pod, out *Pod, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_PodSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_PodSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := deepCopy_api_PodStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_PodStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } out.Stdin = in.Stdin @@ -1793,7 +1922,7 @@ func deepCopy_api_PodAttachOptions(in PodAttachOptions, out *PodAttachOptions, c return nil } -func deepCopy_api_PodCondition(in PodCondition, out *PodCondition, c *conversion.Cloner) error { +func DeepCopy_api_PodCondition(in PodCondition, out *PodCondition, c *conversion.Cloner) error { out.Type = in.Type out.Status = in.Status if newVal, err := c.DeepCopy(in.LastProbeTime); err != nil { @@ -1811,8 +1940,8 @@ func deepCopy_api_PodCondition(in PodCondition, out *PodCondition, c *conversion return nil } -func deepCopy_api_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } out.Stdin = in.Stdin @@ -1830,18 +1959,18 @@ func deepCopy_api_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conv return nil } -func deepCopy_api_PodList(in PodList, out *PodList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodList(in PodList, out *PodList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Pod, len(in)) for i := range in { - if err := deepCopy_api_Pod(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Pod(in[i], &(*out)[i], c); err != nil { return err } } @@ -1851,8 +1980,8 @@ func deepCopy_api_PodList(in PodList, out *PodList, c *conversion.Cloner) error return nil } -func deepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } out.Container = in.Container @@ -1894,22 +2023,22 @@ func deepCopy_api_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *convers return nil } -func deepCopy_api_PodProxyOptions(in PodProxyOptions, out *PodProxyOptions, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodProxyOptions(in PodProxyOptions, out *PodProxyOptions, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } out.Path = in.Path return nil } -func deepCopy_api_PodSecurityContext(in PodSecurityContext, out *PodSecurityContext, c *conversion.Cloner) error { +func DeepCopy_api_PodSecurityContext(in PodSecurityContext, out *PodSecurityContext, c *conversion.Cloner) error { out.HostNetwork = in.HostNetwork out.HostPID = in.HostPID out.HostIPC = in.HostIPC if in.SELinuxOptions != nil { in, out := in.SELinuxOptions, &out.SELinuxOptions *out = new(SELinuxOptions) - if err := deepCopy_api_SELinuxOptions(*in, *out, c); err != nil { + if err := DeepCopy_api_SELinuxOptions(*in, *out, c); err != nil { return err } } else { @@ -1946,12 +2075,12 @@ func deepCopy_api_PodSecurityContext(in PodSecurityContext, out *PodSecurityCont return nil } -func deepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error { +func DeepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error { if in.Volumes != nil { in, out := in.Volumes, &out.Volumes *out = make([]Volume, len(in)) for i := range in { - if err := deepCopy_api_Volume(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Volume(in[i], &(*out)[i], c); err != nil { return err } } @@ -1962,7 +2091,7 @@ func deepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error in, out := in.Containers, &out.Containers *out = make([]Container, len(in)) for i := range in { - if err := deepCopy_api_Container(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Container(in[i], &(*out)[i], c); err != nil { return err } } @@ -1999,7 +2128,7 @@ func deepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error if in.SecurityContext != nil { in, out := in.SecurityContext, &out.SecurityContext *out = new(PodSecurityContext) - if err := deepCopy_api_PodSecurityContext(*in, *out, c); err != nil { + if err := DeepCopy_api_PodSecurityContext(*in, *out, c); err != nil { return err } } else { @@ -2009,7 +2138,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 { + if err := DeepCopy_api_LocalObjectReference(in[i], &(*out)[i], c); err != nil { return err } } @@ -2019,13 +2148,13 @@ func deepCopy_api_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error return nil } -func deepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) error { +func DeepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) error { out.Phase = in.Phase if in.Conditions != nil { in, out := in.Conditions, &out.Conditions *out = make([]PodCondition, len(in)) for i := range in { - if err := deepCopy_api_PodCondition(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_PodCondition(in[i], &(*out)[i], c); err != nil { return err } } @@ -2051,7 +2180,7 @@ func deepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) in, out := in.ContainerStatuses, &out.ContainerStatuses *out = make([]ContainerStatus, len(in)) for i := range in { - if err := deepCopy_api_ContainerStatus(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ContainerStatus(in[i], &(*out)[i], c); err != nil { return err } } @@ -2061,44 +2190,44 @@ func deepCopy_api_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) return nil } -func deepCopy_api_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_PodStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_PodStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_PodTemplateSpec(in.Template, &out.Template, c); err != nil { + if err := DeepCopy_api_PodTemplateSpec(in.Template, &out.Template, c); err != nil { return err } return nil } -func deepCopy_api_PodTemplateList(in PodTemplateList, out *PodTemplateList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_PodTemplateList(in PodTemplateList, out *PodTemplateList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]PodTemplate, len(in)) for i := range in { - if err := deepCopy_api_PodTemplate(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_PodTemplate(in[i], &(*out)[i], c); err != nil { return err } } @@ -2108,18 +2237,26 @@ func deepCopy_api_PodTemplateList(in PodTemplateList, out *PodTemplateList, c *c return nil } -func deepCopy_api_PodTemplateSpec(in PodTemplateSpec, out *PodTemplateSpec, c *conversion.Cloner) error { - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { +func DeepCopy_api_PodTemplateSpec(in PodTemplateSpec, out *PodTemplateSpec, c *conversion.Cloner) error { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_PodSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_PodSpec(in.Spec, &out.Spec, c); err != nil { return err } return nil } -func deepCopy_api_Probe(in Probe, out *Probe, c *conversion.Cloner) error { - if err := deepCopy_api_Handler(in.Handler, &out.Handler, c); err != nil { +func DeepCopy_api_PreferredSchedulingTerm(in PreferredSchedulingTerm, out *PreferredSchedulingTerm, c *conversion.Cloner) error { + out.Weight = in.Weight + if err := DeepCopy_api_NodeSelectorTerm(in.Preference, &out.Preference, c); err != nil { + return err + } + return nil +} + +func DeepCopy_api_Probe(in Probe, out *Probe, c *conversion.Cloner) error { + if err := DeepCopy_api_Handler(in.Handler, &out.Handler, c); err != nil { return err } out.InitialDelaySeconds = in.InitialDelaySeconds @@ -2130,7 +2267,7 @@ func deepCopy_api_Probe(in Probe, out *Probe, c *conversion.Cloner) error { return nil } -func deepCopy_api_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *conversion.Cloner) error { if in.CephMonitors != nil { in, out := in.CephMonitors, &out.CephMonitors *out = make([]string, len(in)) @@ -2146,7 +2283,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 { + if err := DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil { return err } } else { @@ -2156,11 +2293,11 @@ func deepCopy_api_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *c return nil } -func deepCopy_api_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } out.Range = in.Range @@ -2174,34 +2311,34 @@ func deepCopy_api_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *c return nil } -func deepCopy_api_ReplicationController(in ReplicationController, out *ReplicationController, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ReplicationController(in ReplicationController, out *ReplicationController, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + 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 { + 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 { + if err := DeepCopy_api_ReplicationControllerStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_ReplicationControllerList(in ReplicationControllerList, out *ReplicationControllerList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ReplicationControllerList(in ReplicationControllerList, out *ReplicationControllerList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ReplicationController, len(in)) for i := range in { - if err := deepCopy_api_ReplicationController(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ReplicationController(in[i], &(*out)[i], c); err != nil { return err } } @@ -2211,7 +2348,7 @@ func deepCopy_api_ReplicationControllerList(in ReplicationControllerList, out *R return nil } -func deepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *ReplicationControllerSpec, c *conversion.Cloner) error { +func DeepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *ReplicationControllerSpec, c *conversion.Cloner) error { out.Replicas = in.Replicas if in.Selector != nil { in, out := in.Selector, &out.Selector @@ -2225,7 +2362,7 @@ func deepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *R if in.Template != nil { in, out := in.Template, &out.Template *out = new(PodTemplateSpec) - if err := deepCopy_api_PodTemplateSpec(*in, *out, c); err != nil { + if err := DeepCopy_api_PodTemplateSpec(*in, *out, c); err != nil { return err } } else { @@ -2234,40 +2371,40 @@ func deepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *R return nil } -func deepCopy_api_ReplicationControllerStatus(in ReplicationControllerStatus, out *ReplicationControllerStatus, c *conversion.Cloner) error { +func DeepCopy_api_ReplicationControllerStatus(in ReplicationControllerStatus, out *ReplicationControllerStatus, c *conversion.Cloner) error { out.Replicas = in.Replicas out.ObservedGeneration = in.ObservedGeneration return nil } -func deepCopy_api_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_ResourceQuotaSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_ResourceQuotaSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := deepCopy_api_ResourceQuotaStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_ResourceQuotaStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ResourceQuota, len(in)) for i := range in { - if err := deepCopy_api_ResourceQuota(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ResourceQuota(in[i], &(*out)[i], c); err != nil { return err } } @@ -2277,7 +2414,7 @@ func deepCopy_api_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList return nil } -func deepCopy_api_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec, c *conversion.Cloner) error { +func DeepCopy_api_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec, c *conversion.Cloner) error { if in.Hard != nil { in, out := in.Hard, &out.Hard *out = make(ResourceList) @@ -2294,7 +2431,7 @@ func deepCopy_api_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec return nil } -func deepCopy_api_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuotaStatus, c *conversion.Cloner) error { +func DeepCopy_api_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuotaStatus, c *conversion.Cloner) error { if in.Hard != nil { in, out := in.Hard, &out.Hard *out = make(ResourceList) @@ -2324,7 +2461,7 @@ func deepCopy_api_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuota return nil } -func deepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceRequirements, c *conversion.Cloner) error { +func DeepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceRequirements, c *conversion.Cloner) error { if in.Limits != nil { in, out := in.Limits, &out.Limits *out = make(ResourceList) @@ -2354,7 +2491,7 @@ func deepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceReq return nil } -func deepCopy_api_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conversion.Cloner) error { +func DeepCopy_api_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conversion.Cloner) error { out.User = in.User out.Role = in.Role out.Type = in.Type @@ -2362,11 +2499,11 @@ func deepCopy_api_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conv return nil } -func deepCopy_api_Secret(in Secret, out *Secret, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Secret(in Secret, out *Secret, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if in.Data != nil { @@ -2386,26 +2523,26 @@ func deepCopy_api_Secret(in Secret, out *Secret, c *conversion.Cloner) error { return nil } -func deepCopy_api_SecretKeySelector(in SecretKeySelector, out *SecretKeySelector, c *conversion.Cloner) error { - if err := deepCopy_api_LocalObjectReference(in.LocalObjectReference, &out.LocalObjectReference, c); err != nil { +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.Key = in.Key return nil } -func deepCopy_api_SecretList(in SecretList, out *SecretList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_SecretList(in SecretList, out *SecretList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Secret, len(in)) for i := range in { - if err := deepCopy_api_Secret(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Secret(in[i], &(*out)[i], c); err != nil { return err } } @@ -2415,16 +2552,16 @@ func deepCopy_api_SecretList(in SecretList, out *SecretList, c *conversion.Clone return nil } -func deepCopy_api_SecretVolumeSource(in SecretVolumeSource, out *SecretVolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_SecretVolumeSource(in SecretVolumeSource, out *SecretVolumeSource, c *conversion.Cloner) error { out.SecretName = in.SecretName return nil } -func deepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *conversion.Cloner) error { +func DeepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *conversion.Cloner) error { if in.Capabilities != nil { in, out := in.Capabilities, &out.Capabilities *out = new(Capabilities) - if err := deepCopy_api_Capabilities(*in, *out, c); err != nil { + if err := DeepCopy_api_Capabilities(*in, *out, c); err != nil { return err } } else { @@ -2440,7 +2577,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 { + if err := DeepCopy_api_SELinuxOptions(*in, *out, c); err != nil { return err } } else { @@ -2463,44 +2600,44 @@ func deepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *c return nil } -func deepCopy_api_SerializedReference(in SerializedReference, out *SerializedReference, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_SerializedReference(in SerializedReference, out *SerializedReference, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectReference(in.Reference, &out.Reference, c); err != nil { + if err := DeepCopy_api_ObjectReference(in.Reference, &out.Reference, c); err != nil { return err } return nil } -func deepCopy_api_Service(in Service, out *Service, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_Service(in Service, out *Service, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := deepCopy_api_ServiceSpec(in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_api_ServiceSpec(in.Spec, &out.Spec, c); err != nil { return err } - if err := deepCopy_api_ServiceStatus(in.Status, &out.Status, c); err != nil { + if err := DeepCopy_api_ServiceStatus(in.Status, &out.Status, c); err != nil { return err } return nil } -func deepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conversion.Cloner) error { + if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err } - if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + if err := DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if in.Secrets != nil { 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 { + if err := DeepCopy_api_ObjectReference(in[i], &(*out)[i], c); err != nil { return err } } @@ -2511,7 +2648,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 { + if err := DeepCopy_api_LocalObjectReference(in[i], &(*out)[i], c); err != nil { return err } } @@ -2521,18 +2658,18 @@ func deepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conv return nil } -func deepCopy_api_ServiceAccountList(in ServiceAccountList, out *ServiceAccountList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ServiceAccountList(in ServiceAccountList, out *ServiceAccountList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]ServiceAccount, len(in)) for i := range in { - if err := deepCopy_api_ServiceAccount(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_ServiceAccount(in[i], &(*out)[i], c); err != nil { return err } } @@ -2542,18 +2679,18 @@ func deepCopy_api_ServiceAccountList(in ServiceAccountList, out *ServiceAccountL return nil } -func deepCopy_api_ServiceList(in ServiceList, out *ServiceList, c *conversion.Cloner) error { - if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { +func DeepCopy_api_ServiceList(in ServiceList, out *ServiceList, 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 { + if err := DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil { return err } if in.Items != nil { in, out := in.Items, &out.Items *out = make([]Service, len(in)) for i := range in { - if err := deepCopy_api_Service(in[i], &(*out)[i], c); err != nil { + if err := DeepCopy_api_Service(in[i], &(*out)[i], c); err != nil { return err } } @@ -2563,24 +2700,24 @@ func deepCopy_api_ServiceList(in ServiceList, out *ServiceList, c *conversion.Cl return nil } -func deepCopy_api_ServicePort(in ServicePort, out *ServicePort, c *conversion.Cloner) error { +func DeepCopy_api_ServicePort(in ServicePort, out *ServicePort, c *conversion.Cloner) error { out.Name = in.Name out.Protocol = in.Protocol out.Port = in.Port - if err := deepCopy_intstr_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil { + if err := DeepCopy_intstr_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil { return err } out.NodePort = in.NodePort return nil } -func deepCopy_api_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Cloner) error { +func DeepCopy_api_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Cloner) error { out.Type = in.Type if in.Ports != nil { 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 { + if err := DeepCopy_api_ServicePort(in[i], &(*out)[i], c); err != nil { return err } } @@ -2609,40 +2746,40 @@ func deepCopy_api_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Cl return nil } -func deepCopy_api_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversion.Cloner) error { - if err := deepCopy_api_LoadBalancerStatus(in.LoadBalancer, &out.LoadBalancer, c); err != nil { +func DeepCopy_api_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversion.Cloner) error { + if err := DeepCopy_api_LoadBalancerStatus(in.LoadBalancer, &out.LoadBalancer, c); err != nil { return err } return nil } -func deepCopy_api_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error { - if err := deepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { +func DeepCopy_api_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error { + if err := DeepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil { return err } return nil } -func deepCopy_api_Volume(in Volume, out *Volume, c *conversion.Cloner) error { +func DeepCopy_api_Volume(in Volume, out *Volume, c *conversion.Cloner) error { out.Name = in.Name - if err := deepCopy_api_VolumeSource(in.VolumeSource, &out.VolumeSource, c); err != nil { + if err := DeepCopy_api_VolumeSource(in.VolumeSource, &out.VolumeSource, c); err != nil { return err } return nil } -func deepCopy_api_VolumeMount(in VolumeMount, out *VolumeMount, c *conversion.Cloner) error { +func DeepCopy_api_VolumeMount(in VolumeMount, out *VolumeMount, c *conversion.Cloner) error { out.Name = in.Name out.ReadOnly = in.ReadOnly out.MountPath = in.MountPath return nil } -func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion.Cloner) error { +func DeepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion.Cloner) error { if in.HostPath != nil { in, out := in.HostPath, &out.HostPath *out = new(HostPathVolumeSource) - if err := deepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_HostPathVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2651,7 +2788,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.EmptyDir != nil { in, out := in.EmptyDir, &out.EmptyDir *out = new(EmptyDirVolumeSource) - if err := deepCopy_api_EmptyDirVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_EmptyDirVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2660,7 +2797,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.GCEPersistentDisk != nil { in, out := in.GCEPersistentDisk, &out.GCEPersistentDisk *out = new(GCEPersistentDiskVolumeSource) - if err := deepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_GCEPersistentDiskVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2669,7 +2806,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.AWSElasticBlockStore != nil { in, out := in.AWSElasticBlockStore, &out.AWSElasticBlockStore *out = new(AWSElasticBlockStoreVolumeSource) - if err := deepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_AWSElasticBlockStoreVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2678,7 +2815,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.GitRepo != nil { in, out := in.GitRepo, &out.GitRepo *out = new(GitRepoVolumeSource) - if err := deepCopy_api_GitRepoVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_GitRepoVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2687,7 +2824,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.Secret != nil { in, out := in.Secret, &out.Secret *out = new(SecretVolumeSource) - if err := deepCopy_api_SecretVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_SecretVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2696,7 +2833,7 @@ 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 { + if err := DeepCopy_api_NFSVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2705,7 +2842,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.ISCSI != nil { in, out := in.ISCSI, &out.ISCSI *out = new(ISCSIVolumeSource) - if err := deepCopy_api_ISCSIVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_ISCSIVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2714,7 +2851,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.Glusterfs != nil { in, out := in.Glusterfs, &out.Glusterfs *out = new(GlusterfsVolumeSource) - if err := deepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_GlusterfsVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2723,7 +2860,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.PersistentVolumeClaim != nil { in, out := in.PersistentVolumeClaim, &out.PersistentVolumeClaim *out = new(PersistentVolumeClaimVolumeSource) - if err := deepCopy_api_PersistentVolumeClaimVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_PersistentVolumeClaimVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2732,7 +2869,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.RBD != nil { in, out := in.RBD, &out.RBD *out = new(RBDVolumeSource) - if err := deepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2741,7 +2878,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.FlexVolume != nil { in, out := in.FlexVolume, &out.FlexVolume *out = new(FlexVolumeSource) - if err := deepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2750,7 +2887,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 { + if err := DeepCopy_api_CinderVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2759,7 +2896,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.CephFS != nil { in, out := in.CephFS, &out.CephFS *out = new(CephFSVolumeSource) - if err := deepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2768,7 +2905,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 { + if err := DeepCopy_api_FlockerVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2777,7 +2914,7 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.DownwardAPI != nil { in, out := in.DownwardAPI, &out.DownwardAPI *out = new(DownwardAPIVolumeSource) - if err := deepCopy_api_DownwardAPIVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_DownwardAPIVolumeSource(*in, *out, c); err != nil { return err } } else { @@ -2786,16 +2923,25 @@ func deepCopy_api_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion if in.FC != nil { in, out := in.FC, &out.FC *out = new(FCVolumeSource) - if err := deepCopy_api_FCVolumeSource(*in, *out, c); err != nil { + if err := DeepCopy_api_FCVolumeSource(*in, *out, c); err != nil { return err } } else { out.FC = 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 + } + } else { + out.AzureFile = nil + } return nil } -func deepCopy_conversion_Meta(in conversion.Meta, out *conversion.Meta, c *conversion.Cloner) error { +func DeepCopy_conversion_Meta(in conversion.Meta, out *conversion.Meta, c *conversion.Cloner) error { out.SrcVersion = in.SrcVersion out.DestVersion = in.DestVersion if newVal, err := c.DeepCopy(in.KeyNameMapping); err != nil { @@ -2806,72 +2952,56 @@ func deepCopy_conversion_Meta(in conversion.Meta, out *conversion.Meta, c *conve return nil } -func deepCopy_intstr_IntOrString(in intstr.IntOrString, out *intstr.IntOrString, c *conversion.Cloner) error { +func DeepCopy_intstr_IntOrString(in intstr.IntOrString, out *intstr.IntOrString, c *conversion.Cloner) error { out.Type = in.Type out.IntVal = in.IntVal out.StrVal = in.StrVal return nil } -func deepCopy_runtime_RawExtension(in runtime.RawExtension, out *runtime.RawExtension, c *conversion.Cloner) error { - if in.RawJSON != nil { - in, out := in.RawJSON, &out.RawJSON - *out = make([]byte, len(in)) - copy(*out, in) - } else { - out.RawJSON = nil - } - if newVal, err := c.DeepCopy(in.Object); err != nil { - return err - } else { - out.Object = newVal.(runtime.Object) - } +func DeepCopy_sets_Empty(in sets.Empty, out *sets.Empty, c *conversion.Cloner) error { return nil } -func deepCopy_sets_Empty(in sets.Empty, out *sets.Empty, c *conversion.Cloner) error { - return nil -} - -func deepCopy_unversioned_GroupKind(in unversioned.GroupKind, out *unversioned.GroupKind, c *conversion.Cloner) error { +func DeepCopy_unversioned_GroupKind(in unversioned.GroupKind, out *unversioned.GroupKind, c *conversion.Cloner) error { out.Group = in.Group out.Kind = in.Kind return nil } -func deepCopy_unversioned_GroupResource(in unversioned.GroupResource, out *unversioned.GroupResource, c *conversion.Cloner) error { +func DeepCopy_unversioned_GroupResource(in unversioned.GroupResource, out *unversioned.GroupResource, c *conversion.Cloner) error { out.Group = in.Group out.Resource = in.Resource return nil } -func deepCopy_unversioned_GroupVersion(in unversioned.GroupVersion, out *unversioned.GroupVersion, c *conversion.Cloner) error { +func DeepCopy_unversioned_GroupVersion(in unversioned.GroupVersion, out *unversioned.GroupVersion, c *conversion.Cloner) error { out.Group = in.Group out.Version = in.Version return nil } -func deepCopy_unversioned_GroupVersionKind(in unversioned.GroupVersionKind, out *unversioned.GroupVersionKind, c *conversion.Cloner) error { +func DeepCopy_unversioned_GroupVersionKind(in unversioned.GroupVersionKind, out *unversioned.GroupVersionKind, c *conversion.Cloner) error { out.Group = in.Group out.Version = in.Version out.Kind = in.Kind return nil } -func deepCopy_unversioned_GroupVersionResource(in unversioned.GroupVersionResource, out *unversioned.GroupVersionResource, c *conversion.Cloner) error { +func DeepCopy_unversioned_GroupVersionResource(in unversioned.GroupVersionResource, out *unversioned.GroupVersionResource, c *conversion.Cloner) error { out.Group = in.Group out.Version = in.Version out.Resource = in.Resource return nil } -func deepCopy_unversioned_ListMeta(in unversioned.ListMeta, out *unversioned.ListMeta, c *conversion.Cloner) error { +func DeepCopy_unversioned_ListMeta(in unversioned.ListMeta, out *unversioned.ListMeta, c *conversion.Cloner) error { out.SelfLink = in.SelfLink out.ResourceVersion = in.ResourceVersion return nil } -func deepCopy_unversioned_TypeMeta(in unversioned.TypeMeta, out *unversioned.TypeMeta, c *conversion.Cloner) error { +func DeepCopy_unversioned_TypeMeta(in unversioned.TypeMeta, out *unversioned.TypeMeta, c *conversion.Cloner) error { out.Kind = in.Kind out.APIVersion = in.APIVersion return nil diff --git a/pkg/api/helpers.go b/pkg/api/helpers.go index 5bb480d7e0a..b373b9eee81 100644 --- a/pkg/api/helpers.go +++ b/pkg/api/helpers.go @@ -18,6 +18,7 @@ package api import ( "crypto/md5" + "encoding/json" "fmt" "reflect" "strings" @@ -263,3 +264,54 @@ func ParseRFC3339(s string, nowFn func() unversioned.Time) (unversioned.Time, er } return unversioned.Time{t}, nil } + +// NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements +// labels.Selector. +func NodeSelectorRequirementsAsSelector(nsm []NodeSelectorRequirement) (labels.Selector, error) { + if len(nsm) == 0 { + return labels.Nothing(), nil + } + selector := labels.NewSelector() + for _, expr := range nsm { + var op labels.Operator + switch expr.Operator { + case NodeSelectorOpIn: + op = labels.InOperator + case NodeSelectorOpNotIn: + op = labels.NotInOperator + case NodeSelectorOpExists: + op = labels.ExistsOperator + case NodeSelectorOpDoesNotExist: + op = labels.DoesNotExistOperator + case NodeSelectorOpGt: + op = labels.GreaterThanOperator + case NodeSelectorOpLt: + op = labels.LessThanOperator + default: + return nil, fmt.Errorf("%q is not a valid node selector operator", expr.Operator) + } + r, err := labels.NewRequirement(expr.Key, op, sets.NewString(expr.Values...)) + if err != nil { + return nil, err + } + selector = selector.Add(*r) + } + return selector, nil +} + +// AffinityAnnotationKey represents the key of affinity data (json serialized) +// in the Annotations of a Pod. +const AffinityAnnotationKey string = "scheduler.alpha.kubernetes.io/affinity" + +// GetAffinityFromPod gets the json serialized affinity data from Pod.Annotations +// and converts it to the Affinity type in api. +func GetAffinityFromPodAnnotations(annotations map[string]string) (Affinity, error) { + var affinity Affinity + if len(annotations) > 0 && annotations[AffinityAnnotationKey] != "" { + err := json.Unmarshal([]byte(annotations[AffinityAnnotationKey]), &affinity) + if err != nil { + return affinity, err + } + } + return affinity, nil +} diff --git a/pkg/api/helpers_test.go b/pkg/api/helpers_test.go index 6cbe4726939..2d6bd488f09 100644 --- a/pkg/api/helpers_test.go +++ b/pkg/api/helpers_test.go @@ -17,10 +17,12 @@ limitations under the License. package api import ( + "reflect" "strings" "testing" "k8s.io/kubernetes/pkg/api/resource" + "k8s.io/kubernetes/pkg/labels" "speter.net/go/exp/math/dec/inf" ) @@ -175,3 +177,123 @@ func TestRemoveDuplicateAccessModes(t *testing.T) { t.Errorf("Expected 2 distinct modes in set but found %v", len(modes)) } } + +func TestNodeSelectorRequirementsAsSelector(t *testing.T) { + matchExpressions := []NodeSelectorRequirement{{ + Key: "foo", + Operator: NodeSelectorOpIn, + Values: []string{"bar", "baz"}, + }} + mustParse := func(s string) labels.Selector { + out, e := labels.Parse(s) + if e != nil { + panic(e) + } + return out + } + tc := []struct { + in []NodeSelectorRequirement + out labels.Selector + expectErr bool + }{ + {in: nil, out: labels.Nothing()}, + {in: []NodeSelectorRequirement{}, out: labels.Nothing()}, + { + in: matchExpressions, + out: mustParse("foo in (baz,bar)"), + }, + { + in: []NodeSelectorRequirement{{ + Key: "foo", + Operator: NodeSelectorOpExists, + Values: []string{"bar", "baz"}, + }}, + expectErr: true, + }, + { + in: []NodeSelectorRequirement{{ + Key: "foo", + Operator: NodeSelectorOpGt, + Values: []string{"1.1"}, + }}, + out: mustParse("foo>1.1"), + }, + { + in: []NodeSelectorRequirement{{ + Key: "bar", + Operator: NodeSelectorOpLt, + Values: []string{"7.1"}, + }}, + out: mustParse("bar<7.1"), + }, + } + + for i, tc := range tc { + out, err := NodeSelectorRequirementsAsSelector(tc.in) + if err == nil && tc.expectErr { + t.Errorf("[%v]expected error but got none.", i) + } + if err != nil && !tc.expectErr { + t.Errorf("[%v]did not expect error but got: %v", i, err) + } + if !reflect.DeepEqual(out, tc.out) { + t.Errorf("[%v]expected:\n\t%+v\nbut got:\n\t%+v", i, tc.out, out) + } + } +} + +func TestGetAffinityFromPod(t *testing.T) { + testCases := []struct { + pod *Pod + expectErr bool + }{ + { + pod: &Pod{}, + expectErr: false, + }, + { + pod: &Pod{ + ObjectMeta: ObjectMeta{ + Annotations: map[string]string{ + AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["value1", "value2"] + }] + }] + }}}`, + }, + }, + }, + expectErr: false, + }, + { + pod: &Pod{ + ObjectMeta: ObjectMeta{ + Annotations: map[string]string{ + AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + `, + }, + }, + }, + expectErr: true, + }, + } + + for i, tc := range testCases { + _, err := GetAffinityFromPodAnnotations(tc.pod.Annotations) + if err == nil && tc.expectErr { + t.Errorf("[%v]expected error but got none.", i) + } + if err != nil && !tc.expectErr { + t.Errorf("[%v]did not expect error but got: %v", i, err) + } + } +} diff --git a/pkg/api/mapper.go b/pkg/api/mapper.go index e2468fdadf3..054f74d5e99 100644 --- a/pkg/api/mapper.go +++ b/pkg/api/mapper.go @@ -53,7 +53,7 @@ func NewDefaultRESTMapper(defaultGroupVersions []unversioned.GroupVersion, inter if rootScoped.Has(kind) { scope = meta.RESTScopeRoot } - mapper.Add(gvk, scope, false) + mapper.Add(gvk, scope) } } return mapper diff --git a/pkg/api/meta/restmapper.go b/pkg/api/meta/restmapper.go index f1a4d4113bf..d6ad4360069 100644 --- a/pkg/api/meta/restmapper.go +++ b/pkg/api/meta/restmapper.go @@ -83,6 +83,10 @@ type DefaultRESTMapper struct { interfacesFunc VersionInterfacesFunc } +func (m *DefaultRESTMapper) String() string { + return fmt.Sprintf("DefaultRESTMapper{kindToPluralResource=%v}", m.kindToPluralResource) +} + var _ RESTMapper = &DefaultRESTMapper{} // VersionInterfacesFunc returns the appropriate typer, and metadata accessor for a @@ -113,57 +117,50 @@ func NewDefaultRESTMapper(defaultGroupVersions []unversioned.GroupVersion, f Ver } } -func (m *DefaultRESTMapper) Add(kind unversioned.GroupVersionKind, scope RESTScope, mixedCase bool) { - plural, singular := KindToResource(kind, mixedCase) - lowerPlural := plural.GroupVersion().WithResource(strings.ToLower(plural.Resource)) - lowerSingular := singular.GroupVersion().WithResource(strings.ToLower(singular.Resource)) +func (m *DefaultRESTMapper) Add(kind unversioned.GroupVersionKind, scope RESTScope) { + plural, singular := KindToResource(kind) m.singularToPlural[singular] = plural m.pluralToSingular[plural] = singular - m.singularToPlural[lowerSingular] = lowerPlural - m.pluralToSingular[lowerPlural] = lowerSingular - if _, mixedCaseExists := m.resourceToKind[plural]; !mixedCaseExists { - m.resourceToKind[plural] = kind - m.resourceToKind[singular] = kind - } - - if _, lowerCaseExists := m.resourceToKind[lowerPlural]; !lowerCaseExists && (lowerPlural != plural) { - m.resourceToKind[lowerPlural] = kind - m.resourceToKind[lowerSingular] = kind - } + m.resourceToKind[singular] = kind + m.resourceToKind[plural] = kind m.kindToPluralResource[kind] = plural m.kindToScope[kind] = scope } +// unpluralizedSuffixes is a list of resource suffixes that are the same plural and singular +// This is only is only necessary because some bits of code are lazy and don't actually use the RESTMapper like they should. +// TODO eliminate this so that different callers can correctly map to resources. This probably means updating all +// callers to use the RESTMapper they mean. +var unpluralizedSuffixes = []string{ + "endpoints", +} + // KindToResource converts Kind to a resource name. -func KindToResource(kind unversioned.GroupVersionKind, mixedCase bool) (plural, singular unversioned.GroupVersionResource) { +func KindToResource(kind unversioned.GroupVersionKind) ( /*plural*/ unversioned.GroupVersionResource /*singular*/, unversioned.GroupVersionResource) { kindName := kind.Kind if len(kindName) == 0 { - return - } - if mixedCase { - // Legacy support for mixed case names - singular = kind.GroupVersion().WithResource(strings.ToLower(kindName[:1]) + kindName[1:]) - } else { - singular = kind.GroupVersion().WithResource(strings.ToLower(kindName)) + return unversioned.GroupVersionResource{}, unversioned.GroupVersionResource{} } + singularName := strings.ToLower(kindName) + singular := kind.GroupVersion().WithResource(singularName) - singularName := singular.Resource - if strings.HasSuffix(singularName, "endpoints") { - plural = singular - } else { - switch string(singularName[len(singularName)-1]) { - case "s": - plural = kind.GroupVersion().WithResource(singularName + "es") - case "y": - plural = kind.GroupVersion().WithResource(strings.TrimSuffix(singularName, "y") + "ies") - default: - plural = kind.GroupVersion().WithResource(singularName + "s") + for _, skip := range unpluralizedSuffixes { + if strings.HasSuffix(singularName, skip) { + return singular, singular } } - return + + switch string(singularName[len(singularName)-1]) { + case "s": + return kind.GroupVersion().WithResource(singularName + "es"), singular + case "y": + return kind.GroupVersion().WithResource(strings.TrimSuffix(singularName, "y") + "ies"), singular + } + + return kind.GroupVersion().WithResource(singularName + "s"), singular } // ResourceSingularizer implements RESTMapper @@ -511,6 +508,17 @@ func (m *DefaultRESTMapper) ResourceIsValid(resource unversioned.GroupVersionRes // MultiRESTMapper is a wrapper for multiple RESTMappers. type MultiRESTMapper []RESTMapper +func (m MultiRESTMapper) String() string { + nested := []string{} + for _, t := range m { + currString := fmt.Sprintf("%v", t) + splitStrings := strings.Split(currString, "\n") + nested = append(nested, strings.Join(splitStrings, "\n\t")) + } + + return fmt.Sprintf("MultiRESTMapper{\n\t%s\n}", strings.Join(nested, "\n\t")) +} + // ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod) // This implementation supports multiple REST schemas and return the first match. func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { diff --git a/pkg/api/meta/restmapper_test.go b/pkg/api/meta/restmapper_test.go index 17525df502e..0f7b0fcd9d6 100644 --- a/pkg/api/meta/restmapper_test.go +++ b/pkg/api/meta/restmapper_test.go @@ -62,7 +62,6 @@ func TestRESTMapperVersionAndKindForResource(t *testing.T) { Resource unversioned.GroupVersionResource GroupVersionToRegister unversioned.GroupVersion ExpectedGVK unversioned.GroupVersionKind - MixedCase bool Err bool }{ {Resource: unversioned.GroupVersionResource{Resource: "internalobjec"}, Err: true}, @@ -70,17 +69,11 @@ func TestRESTMapperVersionAndKindForResource(t *testing.T) { {Resource: unversioned.GroupVersionResource{Resource: "internalobject"}, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, {Resource: unversioned.GroupVersionResource{Resource: "internalobjects"}, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, - - {Resource: unversioned.GroupVersionResource{Resource: "internalobject"}, MixedCase: true, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, - {Resource: unversioned.GroupVersionResource{Resource: "internalobjects"}, MixedCase: true, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, - - {Resource: unversioned.GroupVersionResource{Resource: "internalObject"}, MixedCase: true, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, - {Resource: unversioned.GroupVersionResource{Resource: "internalObjects"}, MixedCase: true, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, } for i, testCase := range testCases { mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{testGroupVersion}, fakeInterfaces) if len(testCase.ExpectedGVK.Kind) != 0 { - mapper.Add(testCase.ExpectedGVK, RESTScopeNamespace, testCase.MixedCase) + mapper.Add(testCase.ExpectedGVK, RESTScopeNamespace) } actualGVK, err := mapper.KindFor(testCase.Resource) @@ -112,7 +105,7 @@ func TestRESTMapperGroupForResource(t *testing.T) { } for i, testCase := range testCases { mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{testCase.GroupVersionKind.GroupVersion()}, fakeInterfaces) - mapper.Add(testCase.GroupVersionKind, RESTScopeNamespace, false) + mapper.Add(testCase.GroupVersionKind, RESTScopeNamespace) actualGVK, err := mapper.KindFor(testCase.Resource) if testCase.Err { @@ -202,7 +195,7 @@ func TestRESTMapperKindsFor(t *testing.T) { tcName := testCase.Name mapper := NewDefaultRESTMapper(testCase.PreferredOrder, fakeInterfaces) for _, kind := range testCase.KindsToRegister { - mapper.Add(kind, RESTScopeNamespace, false) + mapper.Add(kind, RESTScopeNamespace) } actualKinds, err := mapper.KindsFor(testCase.PartialResourceToRequest) @@ -314,7 +307,7 @@ func TestRESTMapperResourcesFor(t *testing.T) { tcName := testCase.Name mapper := NewDefaultRESTMapper(testCase.PreferredOrder, fakeInterfaces) for _, kind := range testCase.KindsToRegister { - mapper.Add(kind, RESTScopeNamespace, false) + mapper.Add(kind, RESTScopeNamespace) } actualResources, err := mapper.ResourcesFor(testCase.PartialResourceToRequest) @@ -354,28 +347,23 @@ func TestRESTMapperResourcesFor(t *testing.T) { func TestKindToResource(t *testing.T) { testCases := []struct { Kind string - MixedCase bool Plural, Singular string }{ - {Kind: "Pod", MixedCase: true, Plural: "pods", Singular: "pod"}, - {Kind: "Pod", MixedCase: true, Plural: "pods", Singular: "pod"}, - {Kind: "Pod", MixedCase: false, Plural: "pods", Singular: "pod"}, + {Kind: "Pod", Plural: "pods", Singular: "pod"}, - {Kind: "ReplicationController", MixedCase: true, Plural: "replicationControllers", Singular: "replicationController"}, - {Kind: "ReplicationController", MixedCase: true, Plural: "replicationControllers", Singular: "replicationController"}, - {Kind: "ReplicationController", MixedCase: false, Plural: "replicationcontrollers", Singular: "replicationcontroller"}, + {Kind: "ReplicationController", Plural: "replicationcontrollers", Singular: "replicationcontroller"}, // Add "ies" when ending with "y" - {Kind: "ImageRepository", MixedCase: true, Plural: "imageRepositories", Singular: "imageRepository"}, + {Kind: "ImageRepository", Plural: "imagerepositories", Singular: "imagerepository"}, // Add "es" when ending with "s" - {Kind: "miss", MixedCase: false, Plural: "misses", Singular: "miss"}, + {Kind: "miss", Plural: "misses", Singular: "miss"}, // Add "s" otherwise - {Kind: "lowercase", MixedCase: false, Plural: "lowercases", Singular: "lowercase"}, + {Kind: "lowercase", Plural: "lowercases", Singular: "lowercase"}, } for i, testCase := range testCases { version := unversioned.GroupVersion{} - plural, singular := KindToResource(version.WithKind(testCase.Kind), testCase.MixedCase) + plural, singular := KindToResource(version.WithKind(testCase.Kind)) if singular != version.WithResource(testCase.Singular) || plural != version.WithResource(testCase.Plural) { t.Errorf("%d: unexpected plural and singular: %v %v", i, plural, singular) } @@ -386,32 +374,24 @@ func TestRESTMapperResourceSingularizer(t *testing.T) { testGroupVersion := unversioned.GroupVersion{Group: "tgroup", Version: "test"} testCases := []struct { - Kind string - MixedCase bool - Plural string - Singular string + Kind string + Plural string + Singular string }{ - {Kind: "Pod", MixedCase: true, Plural: "pods", Singular: "pod"}, - {Kind: "Pod", MixedCase: false, Plural: "pods", Singular: "pod"}, + {Kind: "Pod", Plural: "pods", Singular: "pod"}, + {Kind: "ReplicationController", Plural: "replicationcontrollers", Singular: "replicationcontroller"}, + {Kind: "ImageRepository", Plural: "imagerepositories", Singular: "imagerepository"}, + {Kind: "Status", Plural: "statuses", Singular: "status"}, - {Kind: "ReplicationController", MixedCase: true, Plural: "replicationControllers", Singular: "replicationController"}, - {Kind: "ReplicationController", MixedCase: false, Plural: "replicationcontrollers", Singular: "replicationcontroller"}, - - {Kind: "ImageRepository", MixedCase: true, Plural: "imageRepositories", Singular: "imageRepository"}, - {Kind: "ImageRepository", MixedCase: false, Plural: "imagerepositories", Singular: "imagerepository"}, - - {Kind: "Status", MixedCase: true, Plural: "statuses", Singular: "status"}, - {Kind: "Status", MixedCase: false, Plural: "statuses", Singular: "status"}, - - {Kind: "lowercase", MixedCase: false, Plural: "lowercases", Singular: "lowercase"}, + {Kind: "lowercase", Plural: "lowercases", Singular: "lowercase"}, // TODO this test is broken. This updates to reflect actual behavior. Kinds are expected to be singular // old (incorrect), coment: Don't add extra s if the original object is already plural - {Kind: "lowercases", MixedCase: false, Plural: "lowercaseses", Singular: "lowercases"}, + {Kind: "lowercases", Plural: "lowercaseses", Singular: "lowercases"}, } for i, testCase := range testCases { mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{testGroupVersion}, fakeInterfaces) // create singular/plural mapping - mapper.Add(testGroupVersion.WithKind(testCase.Kind), RESTScopeNamespace, testCase.MixedCase) + mapper.Add(testGroupVersion.WithKind(testCase.Kind), RESTScopeNamespace) singular, err := mapper.ResourceSingularizer(testCase.Plural) if err != nil { @@ -431,7 +411,6 @@ func TestRESTMapperRESTMapping(t *testing.T) { testCases := []struct { Kind string APIGroupVersions []unversioned.GroupVersion - MixedCase bool DefaultVersions []unversioned.GroupVersion Resource string @@ -451,13 +430,12 @@ func TestRESTMapperRESTMapping(t *testing.T) { {DefaultVersions: []unversioned.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []unversioned.GroupVersion{}, Resource: "internalobjects", ExpectedGroupVersion: &unversioned.GroupVersion{Group: testGroup, Version: "test"}}, {DefaultVersions: []unversioned.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []unversioned.GroupVersion{{Group: testGroup, Version: "test"}}, Resource: "internalobjects"}, - {DefaultVersions: []unversioned.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []unversioned.GroupVersion{{Group: testGroup, Version: "test"}}, MixedCase: true, Resource: "internalObjects"}, // TODO: add test for a resource that exists in one version but not another } for i, testCase := range testCases { mapper := NewDefaultRESTMapper(testCase.DefaultVersions, fakeInterfaces) - mapper.Add(internalGroupVersion.WithKind("InternalObject"), RESTScopeNamespace, testCase.MixedCase) + mapper.Add(internalGroupVersion.WithKind("InternalObject"), RESTScopeNamespace) preferredVersions := []string{} for _, gv := range testCase.APIGroupVersions { @@ -500,8 +478,8 @@ func TestRESTMapperRESTMappingSelectsVersion(t *testing.T) { otherObjectGK := unversioned.GroupKind{Group: "tgroup", Kind: "OtherObject"} mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{expectedGroupVersion1, expectedGroupVersion2}, fakeInterfaces) - mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace, false) - mapper.Add(expectedGroupVersion2.WithKind("OtherObject"), RESTScopeNamespace, false) + mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace) + mapper.Add(expectedGroupVersion2.WithKind("OtherObject"), RESTScopeNamespace) // pick default matching object kind based on search order mapping, err := mapper.RESTMapping(otherObjectGK) @@ -557,7 +535,7 @@ func TestRESTMapperReportsErrorOnBadVersion(t *testing.T) { internalObjectGK := unversioned.GroupKind{Group: "tgroup", Kind: "InternalObject"} mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{expectedGroupVersion1, expectedGroupVersion2}, unmatchedVersionInterfaces) - mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace, false) + mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace) _, err := mapper.RESTMapping(internalObjectGK, expectedGroupVersion1.Version) if err == nil { t.Errorf("unexpected non-error") diff --git a/pkg/api/resource/quantity.go b/pkg/api/resource/quantity.go index 19d497df829..aeb43c89767 100644 --- a/pkg/api/resource/quantity.go +++ b/pkg/api/resource/quantity.go @@ -349,6 +349,11 @@ func (q *Quantity) Add(y Quantity) error { q.Amount = &inf.Dec{} return q.Add(y) default: + // we want to preserve the format of the non-zero value + zero := &inf.Dec{} + if q.Amount.Cmp(zero) == 0 && y.Amount.Cmp(zero) != 0 { + q.Format = y.Format + } q.Amount.Add(q.Amount, y.Amount) } return nil @@ -362,11 +367,32 @@ func (q *Quantity) Sub(y Quantity) error { q.Amount = &inf.Dec{} return q.Sub(y) default: + // we want to preserve the format of the non-zero value + zero := &inf.Dec{} + if q.Amount.Cmp(zero) == 0 && y.Amount.Cmp(zero) != 0 { + q.Format = y.Format + } q.Amount.Sub(q.Amount, y.Amount) } return nil } +// Neg sets q to the negative value of y. +// It updates the format of q to match y. +func (q *Quantity) Neg(y Quantity) error { + switch { + case y.Amount == nil: + *q = y + case q.Amount == nil: + q.Amount = &inf.Dec{} + fallthrough + default: + q.Amount.Neg(y.Amount) + q.Format = y.Format + } + return nil +} + // MarshalJSON implements the json.Marshaller interface. func (q Quantity) MarshalJSON() ([]byte, error) { return []byte(`"` + q.String() + `"`), nil diff --git a/pkg/api/resource/quantity_test.go b/pkg/api/resource/quantity_test.go index a9f4d6aaf4d..bb62251e237 100644 --- a/pkg/api/resource/quantity_test.go +++ b/pkg/api/resource/quantity_test.go @@ -65,6 +65,70 @@ func TestQuantityParseZero(t *testing.T) { } } +// TestQuantityAddZeroPreservesSuffix verifies that a suffix is preserved +// independent of the order of operations when adding a zero and non-zero val +func TestQuantityAddZeroPreservesSuffix(t *testing.T) { + testValues := []string{"100m", "1Gi"} + zero := MustParse("0") + for _, testValue := range testValues { + value := MustParse(testValue) + v1 := *value.Copy() + // ensure non-zero + zero = non-zero (suffix preserved) + err := v1.Add(zero) + if err != nil { + t.Errorf("Unexpected error %v", err) + } + // ensure zero + non-zero = non-zero (suffix preserved) + v2 := *zero.Copy() + err = v2.Add(value) + if err != nil { + t.Errorf("Unexpected error %v", err) + } + // ensure we preserved the input value + if v1.String() != testValue { + t.Errorf("Expected %v, actual %v", testValue, v1.String()) + } + if v2.String() != testValue { + t.Errorf("Expected %v, actual %v", testValue, v2.String()) + } + } +} + +// TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved +// independent of the order of operations when subtracting a zero and non-zero val +func TestQuantitySubZeroPreservesSuffix(t *testing.T) { + testValues := []string{"100m", "1Gi"} + zero := MustParse("0") + for _, testValue := range testValues { + value := MustParse(testValue) + v1 := *value.Copy() + // ensure non-zero - zero = non-zero (suffix preserved) + err := v1.Sub(zero) + if err != nil { + t.Errorf("Unexpected error %v", err) + } + // ensure we preserved the input value + if v1.String() != testValue { + t.Errorf("Expected %v, actual %v", testValue, v1.String()) + } + + // ensure zero - non-zero = -non-zero (suffix preserved) + v2 := *zero.Copy() + err = v2.Sub(value) + if err != nil { + t.Errorf("Unexpected error %v", err) + } + negVal := *value.Copy() + err = negVal.Neg(negVal) + if err != nil { + t.Errorf("Unexpected error %v", err) + } + if v2.String() != negVal.String() { + t.Errorf("Expected %v, actual %v", negVal.String(), v2.String()) + } + } +} + // Verifies that you get 0 as canonical value if internal value is 0, and not 0 func TestQuantityCanocicalizeZero(t *testing.T) { val := MustParse("1000m") @@ -667,6 +731,62 @@ func TestSub(t *testing.T) { } } +func TestNeg(t *testing.T) { + tests := []struct { + a Quantity + b Quantity + expected Quantity + }{ + { + a: Quantity{dec(0, 0), DecimalSI}, + b: Quantity{dec(10, 0), DecimalSI}, + expected: Quantity{dec(-10, 0), DecimalSI}, + }, + { + a: Quantity{dec(0, 0), DecimalSI}, + b: Quantity{dec(-10, 0), DecimalSI}, + expected: Quantity{dec(10, 0), DecimalSI}, + }, + { + a: Quantity{dec(0, 0), DecimalSI}, + b: Quantity{dec(10, 0), BinarySI}, + expected: Quantity{dec(-10, 0), BinarySI}, + }, + { + a: Quantity{dec(0, 0), DecimalSI}, + b: Quantity{dec(0, 0), BinarySI}, + expected: Quantity{dec(0, 0), BinarySI}, + }, + { + a: Quantity{}, + b: Quantity{dec(10, 0), BinarySI}, + expected: Quantity{dec(-10, 0), BinarySI}, + }, + { + a: Quantity{dec(10, 0), BinarySI}, + b: Quantity{}, + expected: Quantity{}, + }, + { + a: Quantity{dec(10, 0), BinarySI}, + b: Quantity{Format: DecimalSI}, + expected: Quantity{dec(0, 0), DecimalSI}, + }, + } + + for i, test := range tests { + test.a.Neg(test.b) + // ensure value is same + if test.a.Cmp(test.expected) != 0 { + t.Errorf("[%d] Expected %q, got %q", i, test.expected.String(), test.a.String()) + } + // ensure format is updated + if test.a.Format != test.expected.Format { + t.Errorf("[%d] Expected format %v, got format %v", i, test.expected.Format, test.a.Format) + } + } +} + func TestAdd(t *testing.T) { tests := []struct { a Quantity diff --git a/pkg/api/rest/rest.go b/pkg/api/rest/rest.go index 32c78215ca2..584670f7789 100644 --- a/pkg/api/rest/rest.go +++ b/pkg/api/rest/rest.go @@ -55,6 +55,14 @@ type Storage interface { New() runtime.Object } +// KindProvider specifies a different kind for its API than for its internal storage. This is necessary for external +// objects that are not compiled into the api server. For such objects, there is no in-memory representation for +// the object, so they must be represented as generic objects (e.g. RawJSON), but when we present the object as part of +// API discovery we want to present the specific kind, not the generic internal representation. +type KindProvider interface { + Kind() string +} + // Lister is an object that can retrieve resources that match the provided field and label criteria. type Lister interface { // NewList returns an empty object that can be used with the List call. diff --git a/pkg/api/rest/resttest/resttest.go b/pkg/api/rest/resttest/resttest.go index 17e0a584220..fbf0bf87d81 100644 --- a/pkg/api/rest/resttest/resttest.go +++ b/pkg/api/rest/resttest/resttest.go @@ -32,7 +32,7 @@ import ( "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) type Tester struct { @@ -673,7 +673,8 @@ func (t *Tester) testDeleteGracefulImmediate(obj runtime.Object, setFn SetFunc, t.Errorf("unexpected error, object should be deleted immediately: %v", err) } objectMeta = t.getObjectMetaOrFail(out) - if objectMeta.DeletionTimestamp == nil || objectMeta.DeletionGracePeriodSeconds == nil || *objectMeta.DeletionGracePeriodSeconds != 0 { + // the second delete shouldn't update the object, so the objectMeta.DeletionGracePeriodSeconds should eqaul to the value set in the first delete. + if objectMeta.DeletionTimestamp == nil || objectMeta.DeletionGracePeriodSeconds == nil || *objectMeta.DeletionGracePeriodSeconds != expectedGrace { t.Errorf("unexpected deleted meta: %#v", objectMeta) } } @@ -926,7 +927,7 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass if !ok { t.Errorf("watch channel should be open") } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("unexpected timeout from result channel") } watcher.Stop() @@ -974,7 +975,7 @@ func (t *Tester) testWatchLabels(obj runtime.Object, emitFn EmitFunc, labelsPass if !ok { t.Errorf("watch channel should be open") } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("unexpected timeout from result channel") } watcher.Stop() diff --git a/pkg/api/serialization_test.go b/pkg/api/serialization_test.go index 0f69b8be81d..f95e9a27754 100644 --- a/pkg/api/serialization_test.go +++ b/pkg/api/serialization_test.go @@ -32,8 +32,6 @@ import ( apitesting "k8s.io/kubernetes/pkg/api/testing" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/v1" - _ "k8s.io/kubernetes/pkg/apis/extensions" - _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" @@ -61,7 +59,7 @@ func fuzzInternalObject(t *testing.T, forVersion unversioned.GroupVersion, item } func roundTrip(t *testing.T, codec runtime.Codec, item runtime.Object) { - t.Logf("codec: %#v", codec) + //t.Logf("codec: %#v", codec) printer := spew.ConfigState{DisableMethods: true} @@ -94,12 +92,12 @@ func roundTrip(t *testing.T, codec runtime.Codec, item runtime.Object) { } // roundTripSame verifies the same source object is tested in all API versions. -func roundTripSame(t *testing.T, item runtime.Object, except ...string) { +func roundTripSame(t *testing.T, group testapi.TestGroup, item runtime.Object, except ...string) { set := sets.NewString(except...) seed := rand.Int63() - fuzzInternalObject(t, testapi.Default.InternalGroupVersion(), item, seed) + fuzzInternalObject(t, group.InternalGroupVersion(), item, seed) - version := *testapi.Default.GroupVersion() + version := *group.GroupVersion() codecs := []runtime.Codec{} for _, fn := range codecsToTest { codec, err := fn(version, item) @@ -123,9 +121,9 @@ func TestSpecificKind(t *testing.T) { // api.Scheme.Log(t) // defer api.Scheme.Log(nil) - kind := "List" + kind := "DaemonSet" for i := 0; i < *fuzzIters; i++ { - doRoundTripTest(kind, t) + doRoundTripTest(testapi.Groups["extensions"], kind, t) if t.Failed() { break } @@ -142,7 +140,7 @@ func TestList(t *testing.T) { t.Errorf("Couldn't make a %v? %v", kind, err) return } - roundTripSame(t, item) + roundTripSame(t, testapi.Default, item) } var nonRoundTrippableTypes = sets.NewString("ExportOptions") @@ -154,34 +152,36 @@ func TestRoundTripTypes(t *testing.T) { // api.Scheme.Log(t) // defer api.Scheme.Log(nil) - for kind := range api.Scheme.KnownTypes(testapi.Default.InternalGroupVersion()) { - t.Logf("working on %v in %v", kind, testapi.Default.InternalGroupVersion()) - if nonRoundTrippableTypes.Has(kind) { - continue - } - // Try a few times, since runTest uses random values. - for i := 0; i < *fuzzIters; i++ { - doRoundTripTest(kind, t) - if t.Failed() { - break + for groupKey, group := range testapi.Groups { + for kind := range api.Scheme.KnownTypes(group.InternalGroupVersion()) { + t.Logf("working on %v in %v", kind, groupKey) + if nonRoundTrippableTypes.Has(kind) { + continue + } + // Try a few times, since runTest uses random values. + for i := 0; i < *fuzzIters; i++ { + doRoundTripTest(group, kind, t) + if t.Failed() { + break + } } } } } -func doRoundTripTest(kind string, t *testing.T) { - item, err := api.Scheme.New(testapi.Default.InternalGroupVersion().WithKind(kind)) +func doRoundTripTest(group testapi.TestGroup, kind string, t *testing.T) { + item, err := api.Scheme.New(group.InternalGroupVersion().WithKind(kind)) if err != nil { t.Fatalf("Couldn't make a %v? %v", kind, err) } if _, err := meta.TypeAccessor(item); err != nil { t.Fatalf("%q is not a TypeMeta and cannot be tested - add it to nonRoundTrippableTypes: %v", kind, err) } - if api.Scheme.Recognizes(testapi.Default.GroupVersion().WithKind(kind)) { - roundTripSame(t, item, nonRoundTrippableTypesByVersion[kind]...) + if api.Scheme.Recognizes(group.GroupVersion().WithKind(kind)) { + roundTripSame(t, group, item, nonRoundTrippableTypesByVersion[kind]...) } if !nonInternalRoundTrippableTypes.Has(kind) { - roundTrip(t, testapi.Default.Codec(), fuzzInternalObject(t, testapi.Default.InternalGroupVersion(), item, rand.Int63())) + roundTrip(t, group.Codec(), fuzzInternalObject(t, group.InternalGroupVersion(), item, rand.Int63())) } } diff --git a/pkg/api/testapi/testapi.go b/pkg/api/testapi/testapi.go index 33b2e201fc8..d3fc91aae27 100644 --- a/pkg/api/testapi/testapi.go +++ b/pkg/api/testapi/testapi.go @@ -23,15 +23,16 @@ import ( "strings" "k8s.io/kubernetes/pkg/api" - _ "k8s.io/kubernetes/pkg/api/install" - _ "k8s.io/kubernetes/pkg/apis/extensions/install" - _ "k8s.io/kubernetes/pkg/apis/metrics/install" - "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/runtime" + + _ "k8s.io/kubernetes/pkg/api/install" + _ "k8s.io/kubernetes/pkg/apis/componentconfig/install" + _ "k8s.io/kubernetes/pkg/apis/extensions/install" + _ "k8s.io/kubernetes/pkg/apis/metrics/install" ) var ( diff --git a/pkg/api/testing/fuzzer.go b/pkg/api/testing/fuzzer.go index 30a2ed18746..4d9e18f24a1 100644 --- a/pkg/api/testing/fuzzer.go +++ b/pkg/api/testing/fuzzer.go @@ -397,6 +397,20 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source) s.MinReplicas = &minReplicas s.CPUUtilization = &extensions.CPUTargetUtilization{TargetPercentage: int(int32(c.RandUint64()))} }, + func(s *extensions.DaemonSetUpdateStrategy, c fuzz.Continue) { + c.FuzzNoCustom(s) + s.Type = extensions.RollingUpdateDaemonSetStrategyType + s.RollingUpdate = &extensions.RollingUpdateDaemonSet{ + MaxUnavailable: intstr.FromInt(10), + } + }, + func(psp *extensions.PodSecurityPolicySpec, c fuzz.Continue) { + c.FuzzNoCustom(psp) // fuzz self without calling this function again + userTypes := []extensions.RunAsUserStrategy{extensions.RunAsUserStrategyMustRunAsNonRoot, extensions.RunAsUserStrategyMustRunAs, extensions.RunAsUserStrategyRunAsAny} + psp.RunAsUser.Type = userTypes[c.Rand.Intn(len(userTypes))] + seLinuxTypes := []extensions.SELinuxContextStrategy{extensions.SELinuxStrategyRunAsAny, extensions.SELinuxStrategyMustRunAs} + psp.SELinuxContext.Type = seLinuxTypes[c.Rand.Intn(len(seLinuxTypes))] + }, ) return f } diff --git a/pkg/api/types.generated.go b/pkg/api/types.generated.go index 428584d70a5..944f81dc148 100644 --- a/pkg/api/types.generated.go +++ b/pkg/api/types.generated.go @@ -946,7 +946,7 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep82 := !z.EncBinary() yy2arr82 := z.EncBasicHandle().StructToArray - var yyq82 [18]bool + var yyq82 [19]bool _, _, _ = yysep82, yyq82, yy2arr82 const yyr82 bool = false yyq82[1] = x.VolumeSource.HostPath != nil && x.HostPath != nil @@ -966,9 +966,10 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { yyq82[15] = x.VolumeSource.Flocker != nil && x.Flocker != nil yyq82[16] = x.VolumeSource.DownwardAPI != nil && x.DownwardAPI != nil yyq82[17] = x.VolumeSource.FC != nil && x.FC != nil + yyq82[18] = x.VolumeSource.AzureFile != nil && x.AzureFile != nil var yynn82 int if yyr82 || yy2arr82 { - r.EncodeArrayStart(18) + r.EncodeArrayStart(19) } else { yynn82 = 1 for _, b := range yyq82 { @@ -1627,6 +1628,43 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { } } } + var yyn103 bool + if x.VolumeSource.AzureFile == nil { + yyn103 = true + goto LABEL103 + } + LABEL103: + if yyr82 || yy2arr82 { + if yyn103 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq82[18] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq82[18] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn103 { + r.EncodeNil() + } else { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + } if yyr82 || yy2arr82 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1640,25 +1678,25 @@ func (x *Volume) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym103 := z.DecBinary() - _ = yym103 + yym104 := z.DecBinary() + _ = yym104 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct104 := r.ContainerType() - if yyct104 == codecSelferValueTypeMap1234 { - yyl104 := r.ReadMapStart() - if yyl104 == 0 { + yyct105 := r.ContainerType() + if yyct105 == codecSelferValueTypeMap1234 { + yyl105 := r.ReadMapStart() + if yyl105 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl104, d) + x.codecDecodeSelfFromMap(yyl105, d) } - } else if yyct104 == codecSelferValueTypeArray1234 { - yyl104 := r.ReadArrayStart() - if yyl104 == 0 { + } else if yyct105 == codecSelferValueTypeArray1234 { + yyl105 := r.ReadArrayStart() + if yyl105 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl104, d) + x.codecDecodeSelfFromArray(yyl105, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1670,12 +1708,12 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys105Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys105Slc - var yyhl105 bool = l >= 0 - for yyj105 := 0; ; yyj105++ { - if yyhl105 { - if yyj105 >= l { + var yys106Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys106Slc + var yyhl106 bool = l >= 0 + for yyj106 := 0; ; yyj106++ { + if yyhl106 { + if yyj106 >= l { break } } else { @@ -1684,10 +1722,10 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys105Slc = r.DecodeBytes(yys105Slc, true, true) - yys105 := string(yys105Slc) + yys106Slc = r.DecodeBytes(yys106Slc, true, true) + yys106 := string(yys106Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys105 { + switch yys106 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -1932,10 +1970,24 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } + case "azureFile": + if x.VolumeSource.AzureFile == nil { + x.VolumeSource.AzureFile = new(AzureFileVolumeSource) + } + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys105) - } // end switch yys105 - } // end for yyj105 + z.DecStructFieldNotFound(-1, yys106) + } // end switch yys106 + } // end for yyj106 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1943,16 +1995,16 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj124 int - var yyb124 bool - var yyhl124 bool = l >= 0 - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + var yyj126 int + var yyb126 bool + var yyhl126 bool = l >= 0 + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1965,13 +2017,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.HostPath == nil { x.VolumeSource.HostPath = new(HostPathVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1989,13 +2041,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.EmptyDir == nil { x.VolumeSource.EmptyDir = new(EmptyDirVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2013,13 +2065,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.GCEPersistentDisk == nil { x.VolumeSource.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2037,13 +2089,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.AWSElasticBlockStore == nil { x.VolumeSource.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2061,13 +2113,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.GitRepo == nil { x.VolumeSource.GitRepo = new(GitRepoVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2085,13 +2137,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Secret == nil { x.VolumeSource.Secret = new(SecretVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2109,13 +2161,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.NFS == nil { x.VolumeSource.NFS = new(NFSVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2133,13 +2185,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.ISCSI == nil { x.VolumeSource.ISCSI = new(ISCSIVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2157,13 +2209,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Glusterfs == nil { x.VolumeSource.Glusterfs = new(GlusterfsVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2181,13 +2233,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.PersistentVolumeClaim == nil { x.VolumeSource.PersistentVolumeClaim = new(PersistentVolumeClaimVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2205,13 +2257,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.RBD == nil { x.VolumeSource.RBD = new(RBDVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2229,13 +2281,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.FlexVolume == nil { x.VolumeSource.FlexVolume = new(FlexVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2253,13 +2305,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Cinder == nil { x.VolumeSource.Cinder = new(CinderVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2277,13 +2329,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.CephFS == nil { x.VolumeSource.CephFS = new(CephFSVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2301,13 +2353,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Flocker == nil { x.VolumeSource.Flocker = new(FlockerVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2325,13 +2377,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.DownwardAPI == nil { x.VolumeSource.DownwardAPI = new(DownwardAPIVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2349,13 +2401,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.FC == nil { x.VolumeSource.FC = new(FCVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2370,18 +2422,42 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } - for { - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l - } else { - yyb124 = r.CheckBreak() + if x.VolumeSource.AzureFile == nil { + x.VolumeSource.AzureFile = new(AzureFileVolumeSource) + } + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l + } else { + yyb126 = r.CheckBreak() + } + if yyb126 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb124 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l + } else { + yyb126 = r.CheckBreak() + } + if yyb126 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj124-1, "") + z.DecStructFieldNotFound(yyj126-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -2393,49 +2469,50 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym143 := z.EncBinary() - _ = yym143 + yym146 := z.EncBinary() + _ = yym146 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep144 := !z.EncBinary() - yy2arr144 := z.EncBasicHandle().StructToArray - var yyq144 [17]bool - _, _, _ = yysep144, yyq144, yy2arr144 - const yyr144 bool = false - yyq144[0] = x.HostPath != nil - yyq144[1] = x.EmptyDir != nil - yyq144[2] = x.GCEPersistentDisk != nil - yyq144[3] = x.AWSElasticBlockStore != nil - yyq144[4] = x.GitRepo != nil - yyq144[5] = x.Secret != nil - yyq144[6] = x.NFS != nil - yyq144[7] = x.ISCSI != nil - yyq144[8] = x.Glusterfs != nil - yyq144[9] = x.PersistentVolumeClaim != nil - yyq144[10] = x.RBD != nil - yyq144[11] = x.FlexVolume != nil - yyq144[12] = x.Cinder != nil - yyq144[13] = x.CephFS != nil - yyq144[14] = x.Flocker != nil - yyq144[15] = x.DownwardAPI != nil - yyq144[16] = x.FC != nil - var yynn144 int - if yyr144 || yy2arr144 { - r.EncodeArrayStart(17) + yysep147 := !z.EncBinary() + yy2arr147 := z.EncBasicHandle().StructToArray + var yyq147 [18]bool + _, _, _ = yysep147, yyq147, yy2arr147 + const yyr147 bool = false + yyq147[0] = x.HostPath != nil + yyq147[1] = x.EmptyDir != nil + yyq147[2] = x.GCEPersistentDisk != nil + yyq147[3] = x.AWSElasticBlockStore != nil + yyq147[4] = x.GitRepo != nil + yyq147[5] = x.Secret != nil + yyq147[6] = x.NFS != nil + yyq147[7] = x.ISCSI != nil + yyq147[8] = x.Glusterfs != nil + yyq147[9] = x.PersistentVolumeClaim != nil + yyq147[10] = x.RBD != nil + yyq147[11] = x.FlexVolume != nil + yyq147[12] = x.Cinder != nil + yyq147[13] = x.CephFS != nil + yyq147[14] = x.Flocker != nil + yyq147[15] = x.DownwardAPI != nil + yyq147[16] = x.FC != nil + yyq147[17] = x.AzureFile != nil + var yynn147 int + if yyr147 || yy2arr147 { + r.EncodeArrayStart(18) } else { - yynn144 = 0 - for _, b := range yyq144 { + yynn147 = 0 + for _, b := range yyq147 { if b { - yynn144++ + yynn147++ } } - r.EncodeMapStart(yynn144) - yynn144 = 0 + r.EncodeMapStart(yynn147) + yynn147 = 0 } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[0] { + if yyq147[0] { if x.HostPath == nil { r.EncodeNil() } else { @@ -2445,7 +2522,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[0] { + if yyq147[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2456,9 +2533,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[1] { + if yyq147[1] { if x.EmptyDir == nil { r.EncodeNil() } else { @@ -2468,7 +2545,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[1] { + if yyq147[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("emptyDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2479,9 +2556,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[2] { + if yyq147[2] { if x.GCEPersistentDisk == nil { r.EncodeNil() } else { @@ -2491,7 +2568,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[2] { + if yyq147[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2502,9 +2579,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[3] { + if yyq147[3] { if x.AWSElasticBlockStore == nil { r.EncodeNil() } else { @@ -2514,7 +2591,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[3] { + if yyq147[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2525,9 +2602,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[4] { + if yyq147[4] { if x.GitRepo == nil { r.EncodeNil() } else { @@ -2537,7 +2614,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[4] { + if yyq147[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gitRepo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2548,9 +2625,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[5] { + if yyq147[5] { if x.Secret == nil { r.EncodeNil() } else { @@ -2560,7 +2637,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[5] { + if yyq147[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secret")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2571,9 +2648,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[6] { + if yyq147[6] { if x.NFS == nil { r.EncodeNil() } else { @@ -2583,7 +2660,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[6] { + if yyq147[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2594,9 +2671,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[7] { + if yyq147[7] { if x.ISCSI == nil { r.EncodeNil() } else { @@ -2606,7 +2683,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[7] { + if yyq147[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsi")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2617,9 +2694,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[8] { + if yyq147[8] { if x.Glusterfs == nil { r.EncodeNil() } else { @@ -2629,7 +2706,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[8] { + if yyq147[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2640,9 +2717,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[9] { + if yyq147[9] { if x.PersistentVolumeClaim == nil { r.EncodeNil() } else { @@ -2652,7 +2729,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[9] { + if yyq147[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("persistentVolumeClaim")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2663,9 +2740,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[10] { + if yyq147[10] { if x.RBD == nil { r.EncodeNil() } else { @@ -2675,7 +2752,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[10] { + if yyq147[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rbd")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2686,9 +2763,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[11] { + if yyq147[11] { if x.FlexVolume == nil { r.EncodeNil() } else { @@ -2698,7 +2775,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[11] { + if yyq147[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2709,9 +2786,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[12] { + if yyq147[12] { if x.Cinder == nil { r.EncodeNil() } else { @@ -2721,7 +2798,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[12] { + if yyq147[12] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cinder")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2732,9 +2809,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[13] { + if yyq147[13] { if x.CephFS == nil { r.EncodeNil() } else { @@ -2744,7 +2821,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[13] { + if yyq147[13] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cephfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2755,9 +2832,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[14] { + if yyq147[14] { if x.Flocker == nil { r.EncodeNil() } else { @@ -2767,7 +2844,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[14] { + if yyq147[14] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flocker")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2778,9 +2855,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[15] { + if yyq147[15] { if x.DownwardAPI == nil { r.EncodeNil() } else { @@ -2790,7 +2867,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[15] { + if yyq147[15] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("downwardAPI")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2801,9 +2878,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[16] { + if yyq147[16] { if x.FC == nil { r.EncodeNil() } else { @@ -2813,7 +2890,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[16] { + if yyq147[16] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fc")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2824,7 +2901,30 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq147[17] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq147[17] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -2837,25 +2937,25 @@ func (x *VolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym162 := z.DecBinary() - _ = yym162 + yym166 := z.DecBinary() + _ = yym166 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct163 := r.ContainerType() - if yyct163 == codecSelferValueTypeMap1234 { - yyl163 := r.ReadMapStart() - if yyl163 == 0 { + yyct167 := r.ContainerType() + if yyct167 == codecSelferValueTypeMap1234 { + yyl167 := r.ReadMapStart() + if yyl167 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl163, d) + x.codecDecodeSelfFromMap(yyl167, d) } - } else if yyct163 == codecSelferValueTypeArray1234 { - yyl163 := r.ReadArrayStart() - if yyl163 == 0 { + } else if yyct167 == codecSelferValueTypeArray1234 { + yyl167 := r.ReadArrayStart() + if yyl167 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl163, d) + x.codecDecodeSelfFromArray(yyl167, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -2867,12 +2967,12 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys164Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys164Slc - var yyhl164 bool = l >= 0 - for yyj164 := 0; ; yyj164++ { - if yyhl164 { - if yyj164 >= l { + var yys168Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys168Slc + var yyhl168 bool = l >= 0 + for yyj168 := 0; ; yyj168++ { + if yyhl168 { + if yyj168 >= l { break } } else { @@ -2881,10 +2981,10 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys164Slc = r.DecodeBytes(yys164Slc, true, true) - yys164 := string(yys164Slc) + yys168Slc = r.DecodeBytes(yys168Slc, true, true) + yys168 := string(yys168Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys164 { + switch yys168 { case "hostPath": if r.TryDecodeAsNil() { if x.HostPath != nil { @@ -3072,10 +3172,21 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } + case "azureFile": + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys164) - } // end switch yys164 - } // end for yyj164 + z.DecStructFieldNotFound(-1, yys168) + } // end switch yys168 + } // end for yyj168 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -3083,16 +3194,16 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj182 int - var yyb182 bool - var yyhl182 bool = l >= 0 - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + var yyj187 int + var yyb187 bool + var yyhl187 bool = l >= 0 + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3107,13 +3218,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.HostPath.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3128,13 +3239,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.EmptyDir.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3149,13 +3260,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.GCEPersistentDisk.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3170,13 +3281,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.AWSElasticBlockStore.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3191,13 +3302,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.GitRepo.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3212,13 +3323,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Secret.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3233,13 +3344,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.NFS.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3254,13 +3365,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.ISCSI.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3275,13 +3386,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Glusterfs.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3296,13 +3407,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.PersistentVolumeClaim.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3317,13 +3428,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.RBD.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3338,13 +3449,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FlexVolume.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3359,13 +3470,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Cinder.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3380,13 +3491,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.CephFS.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3401,13 +3512,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Flocker.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3422,13 +3533,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.DownwardAPI.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3443,18 +3554,39 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } - for { - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l - } else { - yyb182 = r.CheckBreak() + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l + } else { + yyb187 = r.CheckBreak() + } + if yyb187 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb182 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l + } else { + yyb187 = r.CheckBreak() + } + if yyb187 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj182-1, "") + z.DecStructFieldNotFound(yyj187-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -3466,44 +3598,45 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym200 := z.EncBinary() - _ = yym200 + yym206 := z.EncBinary() + _ = yym206 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep201 := !z.EncBinary() - yy2arr201 := z.EncBasicHandle().StructToArray - var yyq201 [12]bool - _, _, _ = yysep201, yyq201, yy2arr201 - const yyr201 bool = false - yyq201[0] = x.GCEPersistentDisk != nil - yyq201[1] = x.AWSElasticBlockStore != nil - yyq201[2] = x.HostPath != nil - yyq201[3] = x.Glusterfs != nil - yyq201[4] = x.NFS != nil - yyq201[5] = x.RBD != nil - yyq201[6] = x.ISCSI != nil - yyq201[7] = x.FlexVolume != nil - yyq201[8] = x.Cinder != nil - yyq201[9] = x.CephFS != nil - yyq201[10] = x.FC != nil - yyq201[11] = x.Flocker != nil - var yynn201 int - if yyr201 || yy2arr201 { - r.EncodeArrayStart(12) + yysep207 := !z.EncBinary() + yy2arr207 := z.EncBasicHandle().StructToArray + var yyq207 [13]bool + _, _, _ = yysep207, yyq207, yy2arr207 + const yyr207 bool = false + yyq207[0] = x.GCEPersistentDisk != nil + yyq207[1] = x.AWSElasticBlockStore != nil + yyq207[2] = x.HostPath != nil + yyq207[3] = x.Glusterfs != nil + yyq207[4] = x.NFS != nil + yyq207[5] = x.RBD != nil + yyq207[6] = x.ISCSI != nil + yyq207[7] = x.FlexVolume != nil + yyq207[8] = x.Cinder != nil + yyq207[9] = x.CephFS != nil + yyq207[10] = x.FC != nil + yyq207[11] = x.Flocker != nil + yyq207[12] = x.AzureFile != nil + var yynn207 int + if yyr207 || yy2arr207 { + r.EncodeArrayStart(13) } else { - yynn201 = 0 - for _, b := range yyq201 { + yynn207 = 0 + for _, b := range yyq207 { if b { - yynn201++ + yynn207++ } } - r.EncodeMapStart(yynn201) - yynn201 = 0 + r.EncodeMapStart(yynn207) + yynn207 = 0 } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[0] { + if yyq207[0] { if x.GCEPersistentDisk == nil { r.EncodeNil() } else { @@ -3513,7 +3646,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[0] { + if yyq207[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3524,9 +3657,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[1] { + if yyq207[1] { if x.AWSElasticBlockStore == nil { r.EncodeNil() } else { @@ -3536,7 +3669,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[1] { + if yyq207[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3547,9 +3680,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[2] { + if yyq207[2] { if x.HostPath == nil { r.EncodeNil() } else { @@ -3559,7 +3692,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[2] { + if yyq207[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3570,9 +3703,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[3] { + if yyq207[3] { if x.Glusterfs == nil { r.EncodeNil() } else { @@ -3582,7 +3715,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[3] { + if yyq207[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3593,9 +3726,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[4] { + if yyq207[4] { if x.NFS == nil { r.EncodeNil() } else { @@ -3605,7 +3738,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[4] { + if yyq207[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3616,9 +3749,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[5] { + if yyq207[5] { if x.RBD == nil { r.EncodeNil() } else { @@ -3628,7 +3761,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[5] { + if yyq207[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rbd")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3639,9 +3772,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[6] { + if yyq207[6] { if x.ISCSI == nil { r.EncodeNil() } else { @@ -3651,7 +3784,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[6] { + if yyq207[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsi")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3662,9 +3795,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[7] { + if yyq207[7] { if x.FlexVolume == nil { r.EncodeNil() } else { @@ -3674,7 +3807,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[7] { + if yyq207[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3685,9 +3818,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[8] { + if yyq207[8] { if x.Cinder == nil { r.EncodeNil() } else { @@ -3697,7 +3830,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[8] { + if yyq207[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cinder")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3708,9 +3841,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[9] { + if yyq207[9] { if x.CephFS == nil { r.EncodeNil() } else { @@ -3720,7 +3853,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[9] { + if yyq207[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cephfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3731,9 +3864,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[10] { + if yyq207[10] { if x.FC == nil { r.EncodeNil() } else { @@ -3743,7 +3876,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[10] { + if yyq207[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fc")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3754,9 +3887,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[11] { + if yyq207[11] { if x.Flocker == nil { r.EncodeNil() } else { @@ -3766,7 +3899,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq201[11] { + if yyq207[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flocker")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3777,7 +3910,30 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq207[12] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq207[12] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -3790,25 +3946,25 @@ func (x *PersistentVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym214 := z.DecBinary() - _ = yym214 + yym221 := z.DecBinary() + _ = yym221 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct215 := r.ContainerType() - if yyct215 == codecSelferValueTypeMap1234 { - yyl215 := r.ReadMapStart() - if yyl215 == 0 { + yyct222 := r.ContainerType() + if yyct222 == codecSelferValueTypeMap1234 { + yyl222 := r.ReadMapStart() + if yyl222 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl215, d) + x.codecDecodeSelfFromMap(yyl222, d) } - } else if yyct215 == codecSelferValueTypeArray1234 { - yyl215 := r.ReadArrayStart() - if yyl215 == 0 { + } else if yyct222 == codecSelferValueTypeArray1234 { + yyl222 := r.ReadArrayStart() + if yyl222 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl215, d) + x.codecDecodeSelfFromArray(yyl222, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -3820,12 +3976,12 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys216Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys216Slc - var yyhl216 bool = l >= 0 - for yyj216 := 0; ; yyj216++ { - if yyhl216 { - if yyj216 >= l { + var yys223Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys223Slc + var yyhl223 bool = l >= 0 + for yyj223 := 0; ; yyj223++ { + if yyhl223 { + if yyj223 >= l { break } } else { @@ -3834,10 +3990,10 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys216Slc = r.DecodeBytes(yys216Slc, true, true) - yys216 := string(yys216Slc) + yys223Slc = r.DecodeBytes(yys223Slc, true, true) + yys223 := string(yys223Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys216 { + switch yys223 { case "gcePersistentDisk": if r.TryDecodeAsNil() { if x.GCEPersistentDisk != nil { @@ -3970,10 +4126,21 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco } x.Flocker.CodecDecodeSelf(d) } + case "azureFile": + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys216) - } // end switch yys216 - } // end for yyj216 + z.DecStructFieldNotFound(-1, yys223) + } // end switch yys223 + } // end for yyj223 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -3981,16 +4148,16 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj229 int - var yyb229 bool - var yyhl229 bool = l >= 0 - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + var yyj237 int + var yyb237 bool + var yyhl237 bool = l >= 0 + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4005,13 +4172,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.GCEPersistentDisk.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4026,13 +4193,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.AWSElasticBlockStore.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4047,13 +4214,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.HostPath.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4068,13 +4235,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Glusterfs.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4089,13 +4256,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.NFS.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4110,13 +4277,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.RBD.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4131,13 +4298,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.ISCSI.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4152,13 +4319,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.FlexVolume.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4173,13 +4340,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Cinder.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4194,13 +4361,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.CephFS.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4215,13 +4382,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.FC.CodecDecodeSelf(d) } - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l } else { - yyb229 = r.CheckBreak() + yyb237 = r.CheckBreak() } - if yyb229 { + if yyb237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4236,18 +4403,39 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Flocker.CodecDecodeSelf(d) } - for { - yyj229++ - if yyhl229 { - yyb229 = yyj229 > l - } else { - yyb229 = r.CheckBreak() + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l + } else { + yyb237 = r.CheckBreak() + } + if yyb237 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb229 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj237++ + if yyhl237 { + yyb237 = yyj237 > l + } else { + yyb237 = r.CheckBreak() + } + if yyb237 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj229-1, "") + z.DecStructFieldNotFound(yyj237-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4259,34 +4447,34 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder if x == nil { r.EncodeNil() } else { - yym242 := z.EncBinary() - _ = yym242 + yym251 := z.EncBinary() + _ = yym251 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep243 := !z.EncBinary() - yy2arr243 := z.EncBasicHandle().StructToArray - var yyq243 [2]bool - _, _, _ = yysep243, yyq243, yy2arr243 - const yyr243 bool = false - yyq243[1] = x.ReadOnly != false - var yynn243 int - if yyr243 || yy2arr243 { + yysep252 := !z.EncBinary() + yy2arr252 := z.EncBasicHandle().StructToArray + var yyq252 [2]bool + _, _, _ = yysep252, yyq252, yy2arr252 + const yyr252 bool = false + yyq252[1] = x.ReadOnly != false + var yynn252 int + if yyr252 || yy2arr252 { r.EncodeArrayStart(2) } else { - yynn243 = 1 - for _, b := range yyq243 { + yynn252 = 1 + for _, b := range yyq252 { if b { - yynn243++ + yynn252++ } } - r.EncodeMapStart(yynn243) - yynn243 = 0 + r.EncodeMapStart(yynn252) + yynn252 = 0 } - if yyr243 || yy2arr243 { + if yyr252 || yy2arr252 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym245 := z.EncBinary() - _ = yym245 + yym254 := z.EncBinary() + _ = yym254 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClaimName)) @@ -4295,18 +4483,18 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("claimName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym246 := z.EncBinary() - _ = yym246 + yym255 := z.EncBinary() + _ = yym255 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClaimName)) } } - if yyr243 || yy2arr243 { + if yyr252 || yy2arr252 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq243[1] { - yym248 := z.EncBinary() - _ = yym248 + if yyq252[1] { + yym257 := z.EncBinary() + _ = yym257 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -4315,19 +4503,19 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder r.EncodeBool(false) } } else { - if yyq243[1] { + if yyq252[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym249 := z.EncBinary() - _ = yym249 + yym258 := z.EncBinary() + _ = yym258 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr243 || yy2arr243 { + if yyr252 || yy2arr252 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -4340,25 +4528,25 @@ func (x *PersistentVolumeClaimVolumeSource) CodecDecodeSelf(d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym250 := z.DecBinary() - _ = yym250 + yym259 := z.DecBinary() + _ = yym259 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct251 := r.ContainerType() - if yyct251 == codecSelferValueTypeMap1234 { - yyl251 := r.ReadMapStart() - if yyl251 == 0 { + yyct260 := r.ContainerType() + if yyct260 == codecSelferValueTypeMap1234 { + yyl260 := r.ReadMapStart() + if yyl260 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl251, d) + x.codecDecodeSelfFromMap(yyl260, d) } - } else if yyct251 == codecSelferValueTypeArray1234 { - yyl251 := r.ReadArrayStart() - if yyl251 == 0 { + } else if yyct260 == codecSelferValueTypeArray1234 { + yyl260 := r.ReadArrayStart() + if yyl260 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl251, d) + x.codecDecodeSelfFromArray(yyl260, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4370,12 +4558,12 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys252Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys252Slc - var yyhl252 bool = l >= 0 - for yyj252 := 0; ; yyj252++ { - if yyhl252 { - if yyj252 >= l { + var yys261Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys261Slc + var yyhl261 bool = l >= 0 + for yyj261 := 0; ; yyj261++ { + if yyhl261 { + if yyj261 >= l { break } } else { @@ -4384,10 +4572,10 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys252Slc = r.DecodeBytes(yys252Slc, true, true) - yys252 := string(yys252Slc) + yys261Slc = r.DecodeBytes(yys261Slc, true, true) + yys261 := string(yys261Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys252 { + switch yys261 { case "claimName": if r.TryDecodeAsNil() { x.ClaimName = "" @@ -4401,9 +4589,9 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys252) - } // end switch yys252 - } // end for yyj252 + z.DecStructFieldNotFound(-1, yys261) + } // end switch yys261 + } // end for yyj261 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -4411,16 +4599,16 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj255 int - var yyb255 bool - var yyhl255 bool = l >= 0 - yyj255++ - if yyhl255 { - yyb255 = yyj255 > l + var yyj264 int + var yyb264 bool + var yyhl264 bool = l >= 0 + yyj264++ + if yyhl264 { + yyb264 = yyj264 > l } else { - yyb255 = r.CheckBreak() + yyb264 = r.CheckBreak() } - if yyb255 { + if yyb264 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4430,13 +4618,13 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c } else { x.ClaimName = string(r.DecodeString()) } - yyj255++ - if yyhl255 { - yyb255 = yyj255 > l + yyj264++ + if yyhl264 { + yyb264 = yyj264 > l } else { - yyb255 = r.CheckBreak() + yyb264 = r.CheckBreak() } - if yyb255 { + if yyb264 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4447,17 +4635,17 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c x.ReadOnly = bool(r.DecodeBool()) } for { - yyj255++ - if yyhl255 { - yyb255 = yyj255 > l + yyj264++ + if yyhl264 { + yyb264 = yyj264 > l } else { - yyb255 = r.CheckBreak() + yyb264 = r.CheckBreak() } - if yyb255 { + if yyb264 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj255-1, "") + z.DecStructFieldNotFound(yyj264-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4469,136 +4657,136 @@ func (x *PersistentVolume) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym258 := z.EncBinary() - _ = yym258 + yym267 := z.EncBinary() + _ = yym267 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep259 := !z.EncBinary() - yy2arr259 := z.EncBasicHandle().StructToArray - var yyq259 [5]bool - _, _, _ = yysep259, yyq259, yy2arr259 - const yyr259 bool = false - yyq259[0] = x.Kind != "" - yyq259[1] = x.APIVersion != "" - yyq259[2] = true - yyq259[3] = true - yyq259[4] = true - var yynn259 int - if yyr259 || yy2arr259 { + yysep268 := !z.EncBinary() + yy2arr268 := z.EncBasicHandle().StructToArray + var yyq268 [5]bool + _, _, _ = yysep268, yyq268, yy2arr268 + const yyr268 bool = false + yyq268[0] = true + yyq268[1] = true + yyq268[2] = true + yyq268[3] = x.Kind != "" + yyq268[4] = x.APIVersion != "" + var yynn268 int + if yyr268 || yy2arr268 { r.EncodeArrayStart(5) } else { - yynn259 = 0 - for _, b := range yyq259 { + yynn268 = 0 + for _, b := range yyq268 { if b { - yynn259++ + yynn268++ } } - r.EncodeMapStart(yynn259) - yynn259 = 0 + r.EncodeMapStart(yynn268) + yynn268 = 0 } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[0] { - yym261 := z.EncBinary() - _ = yym261 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq259[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym262 := z.EncBinary() - _ = yym262 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[1] { - yym264 := z.EncBinary() - _ = yym264 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq259[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym265 := z.EncBinary() - _ = yym265 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[2] { - yy267 := &x.ObjectMeta - yy267.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq259[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy268 := &x.ObjectMeta - yy268.CodecEncodeSelf(e) - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[3] { - yy270 := &x.Spec + if yyq268[0] { + yy270 := &x.ObjectMeta yy270.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq259[3] { + if yyq268[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy271 := &x.Spec + yy271 := &x.ObjectMeta yy271.CodecEncodeSelf(e) } } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[4] { - yy273 := &x.Status + if yyq268[1] { + yy273 := &x.Spec yy273.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq259[4] { + if yyq268[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy274 := &x.Status + yy274 := &x.Spec yy274.CodecEncodeSelf(e) } } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[2] { + yy276 := &x.Status + yy276.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq268[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy277 := &x.Status + yy277.CodecEncodeSelf(e) + } + } + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[3] { + yym279 := z.EncBinary() + _ = yym279 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq268[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym280 := z.EncBinary() + _ = yym280 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[4] { + yym282 := z.EncBinary() + _ = yym282 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq268[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym283 := z.EncBinary() + _ = yym283 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -4611,25 +4799,25 @@ func (x *PersistentVolume) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym275 := z.DecBinary() - _ = yym275 + yym284 := z.DecBinary() + _ = yym284 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct276 := r.ContainerType() - if yyct276 == codecSelferValueTypeMap1234 { - yyl276 := r.ReadMapStart() - if yyl276 == 0 { + yyct285 := r.ContainerType() + if yyct285 == codecSelferValueTypeMap1234 { + yyl285 := r.ReadMapStart() + if yyl285 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl276, d) + x.codecDecodeSelfFromMap(yyl285, d) } - } else if yyct276 == codecSelferValueTypeArray1234 { - yyl276 := r.ReadArrayStart() - if yyl276 == 0 { + } else if yyct285 == codecSelferValueTypeArray1234 { + yyl285 := r.ReadArrayStart() + if yyl285 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl276, d) + x.codecDecodeSelfFromArray(yyl285, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4641,12 +4829,12 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys277Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys277Slc - var yyhl277 bool = l >= 0 - for yyj277 := 0; ; yyj277++ { - if yyhl277 { - if yyj277 >= l { + var yys286Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys286Slc + var yyhl286 bool = l >= 0 + for yyj286 := 0; ; yyj286++ { + if yyhl286 { + if yyj286 >= l { break } } else { @@ -4655,10 +4843,31 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys277Slc = r.DecodeBytes(yys277Slc, true, true) - yys277 := string(yys277Slc) + yys286Slc = r.DecodeBytes(yys286Slc, true, true) + yys286 := string(yys286Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys277 { + switch yys286 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv287 := &x.ObjectMeta + yyv287.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeSpec{} + } else { + yyv288 := &x.Spec + yyv288.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeStatus{} + } else { + yyv289 := &x.Status + yyv289.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4671,31 +4880,10 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv280 := &x.ObjectMeta - yyv280.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeSpec{} - } else { - yyv281 := &x.Spec - yyv281.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeStatus{} - } else { - yyv282 := &x.Status - yyv282.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys277) - } // end switch yys277 - } // end for yyj277 + z.DecStructFieldNotFound(-1, yys286) + } // end switch yys286 + } // end for yyj286 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -4703,16 +4891,67 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj283 int - var yyb283 bool - var yyhl283 bool = l >= 0 - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + var yyj292 int + var yyb292 bool + var yyhl292 bool = l >= 0 + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv293 := &x.ObjectMeta + yyv293.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeSpec{} + } else { + yyv294 := &x.Spec + yyv294.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeStatus{} + } else { + yyv295 := &x.Status + yyv295.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4722,13 +4961,13 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4738,69 +4977,18 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv286 := &x.ObjectMeta - yyv286.CodecDecodeSelf(d) - } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeSpec{} - } else { - yyv287 := &x.Spec - yyv287.CodecDecodeSelf(d) - } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeStatus{} - } else { - yyv288 := &x.Status - yyv288.CodecDecodeSelf(d) - } for { - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj283-1, "") + z.DecStructFieldNotFound(yyj292-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4812,45 +5000,46 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym289 := z.EncBinary() - _ = yym289 + yym298 := z.EncBinary() + _ = yym298 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep290 := !z.EncBinary() - yy2arr290 := z.EncBasicHandle().StructToArray - var yyq290 [16]bool - _, _, _ = yysep290, yyq290, yy2arr290 - const yyr290 bool = false - yyq290[1] = x.PersistentVolumeSource.GCEPersistentDisk != nil && x.GCEPersistentDisk != nil - yyq290[2] = x.PersistentVolumeSource.AWSElasticBlockStore != nil && x.AWSElasticBlockStore != nil - yyq290[3] = x.PersistentVolumeSource.HostPath != nil && x.HostPath != nil - yyq290[4] = x.PersistentVolumeSource.Glusterfs != nil && x.Glusterfs != nil - yyq290[5] = x.PersistentVolumeSource.NFS != nil && x.NFS != nil - yyq290[6] = x.PersistentVolumeSource.RBD != nil && x.RBD != nil - yyq290[7] = x.PersistentVolumeSource.ISCSI != nil && x.ISCSI != nil - yyq290[8] = x.PersistentVolumeSource.FlexVolume != nil && x.FlexVolume != nil - yyq290[9] = x.PersistentVolumeSource.Cinder != nil && x.Cinder != nil - yyq290[10] = x.PersistentVolumeSource.CephFS != nil && x.CephFS != nil - yyq290[11] = x.PersistentVolumeSource.FC != nil && x.FC != nil - yyq290[12] = x.PersistentVolumeSource.Flocker != nil && x.Flocker != nil - yyq290[13] = len(x.AccessModes) != 0 - yyq290[14] = x.ClaimRef != nil - yyq290[15] = x.PersistentVolumeReclaimPolicy != "" - var yynn290 int - if yyr290 || yy2arr290 { - r.EncodeArrayStart(16) + yysep299 := !z.EncBinary() + yy2arr299 := z.EncBasicHandle().StructToArray + var yyq299 [17]bool + _, _, _ = yysep299, yyq299, yy2arr299 + const yyr299 bool = false + yyq299[1] = len(x.AccessModes) != 0 + yyq299[2] = x.ClaimRef != nil + yyq299[3] = x.PersistentVolumeReclaimPolicy != "" + yyq299[4] = x.PersistentVolumeSource.GCEPersistentDisk != nil && x.GCEPersistentDisk != nil + yyq299[5] = x.PersistentVolumeSource.AWSElasticBlockStore != nil && x.AWSElasticBlockStore != nil + yyq299[6] = x.PersistentVolumeSource.HostPath != nil && x.HostPath != nil + yyq299[7] = x.PersistentVolumeSource.Glusterfs != nil && x.Glusterfs != nil + yyq299[8] = x.PersistentVolumeSource.NFS != nil && x.NFS != nil + yyq299[9] = x.PersistentVolumeSource.RBD != nil && x.RBD != nil + yyq299[10] = x.PersistentVolumeSource.ISCSI != nil && x.ISCSI != nil + yyq299[11] = x.PersistentVolumeSource.FlexVolume != nil && x.FlexVolume != nil + yyq299[12] = x.PersistentVolumeSource.Cinder != nil && x.Cinder != nil + yyq299[13] = x.PersistentVolumeSource.CephFS != nil && x.CephFS != nil + yyq299[14] = x.PersistentVolumeSource.FC != nil && x.FC != nil + yyq299[15] = x.PersistentVolumeSource.Flocker != nil && x.Flocker != nil + yyq299[16] = x.PersistentVolumeSource.AzureFile != nil && x.AzureFile != nil + var yynn299 int + if yyr299 || yy2arr299 { + r.EncodeArrayStart(17) } else { - yynn290 = 1 - for _, b := range yyq290 { + yynn299 = 1 + for _, b := range yyq299 { if b { - yynn290++ + yynn299++ } } - r.EncodeMapStart(yynn290) - yynn290 = 0 + r.EncodeMapStart(yynn299) + yynn299 = 0 } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Capacity == nil { r.EncodeNil() @@ -4867,458 +5056,14 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { x.Capacity.CodecEncodeSelf(e) } } - var yyn292 bool - if x.PersistentVolumeSource.GCEPersistentDisk == nil { - yyn292 = true - goto LABEL292 - } - LABEL292: - if yyr290 || yy2arr290 { - if yyn292 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[1] { - if x.GCEPersistentDisk == nil { - r.EncodeNil() - } else { - x.GCEPersistentDisk.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn292 { - r.EncodeNil() - } else { - if x.GCEPersistentDisk == nil { - r.EncodeNil() - } else { - x.GCEPersistentDisk.CodecEncodeSelf(e) - } - } - } - } - var yyn293 bool - if x.PersistentVolumeSource.AWSElasticBlockStore == nil { - yyn293 = true - goto LABEL293 - } - LABEL293: - if yyr290 || yy2arr290 { - if yyn293 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[2] { - if x.AWSElasticBlockStore == nil { - r.EncodeNil() - } else { - x.AWSElasticBlockStore.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn293 { - r.EncodeNil() - } else { - if x.AWSElasticBlockStore == nil { - r.EncodeNil() - } else { - x.AWSElasticBlockStore.CodecEncodeSelf(e) - } - } - } - } - var yyn294 bool - if x.PersistentVolumeSource.HostPath == nil { - yyn294 = true - goto LABEL294 - } - LABEL294: - if yyr290 || yy2arr290 { - if yyn294 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[3] { - if x.HostPath == nil { - r.EncodeNil() - } else { - x.HostPath.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hostPath")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn294 { - r.EncodeNil() - } else { - if x.HostPath == nil { - r.EncodeNil() - } else { - x.HostPath.CodecEncodeSelf(e) - } - } - } - } - var yyn295 bool - if x.PersistentVolumeSource.Glusterfs == nil { - yyn295 = true - goto LABEL295 - } - LABEL295: - if yyr290 || yy2arr290 { - if yyn295 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[4] { - if x.Glusterfs == nil { - r.EncodeNil() - } else { - x.Glusterfs.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn295 { - r.EncodeNil() - } else { - if x.Glusterfs == nil { - r.EncodeNil() - } else { - x.Glusterfs.CodecEncodeSelf(e) - } - } - } - } - var yyn296 bool - if x.PersistentVolumeSource.NFS == nil { - yyn296 = true - goto LABEL296 - } - LABEL296: - if yyr290 || yy2arr290 { - if yyn296 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[5] { - if x.NFS == nil { - r.EncodeNil() - } else { - x.NFS.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("nfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn296 { - r.EncodeNil() - } else { - if x.NFS == nil { - r.EncodeNil() - } else { - x.NFS.CodecEncodeSelf(e) - } - } - } - } - var yyn297 bool - if x.PersistentVolumeSource.RBD == nil { - yyn297 = true - goto LABEL297 - } - LABEL297: - if yyr290 || yy2arr290 { - if yyn297 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[6] { - if x.RBD == nil { - r.EncodeNil() - } else { - x.RBD.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("rbd")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn297 { - r.EncodeNil() - } else { - if x.RBD == nil { - r.EncodeNil() - } else { - x.RBD.CodecEncodeSelf(e) - } - } - } - } - var yyn298 bool - if x.PersistentVolumeSource.ISCSI == nil { - yyn298 = true - goto LABEL298 - } - LABEL298: - if yyr290 || yy2arr290 { - if yyn298 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[7] { - if x.ISCSI == nil { - r.EncodeNil() - } else { - x.ISCSI.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[7] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("iscsi")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn298 { - r.EncodeNil() - } else { - if x.ISCSI == nil { - r.EncodeNil() - } else { - x.ISCSI.CodecEncodeSelf(e) - } - } - } - } - var yyn299 bool - if x.PersistentVolumeSource.FlexVolume == nil { - yyn299 = true - goto LABEL299 - } - LABEL299: - if yyr290 || yy2arr290 { - if yyn299 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[8] { - if x.FlexVolume == nil { - r.EncodeNil() - } else { - x.FlexVolume.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[8] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn299 { - r.EncodeNil() - } else { - if x.FlexVolume == nil { - r.EncodeNil() - } else { - x.FlexVolume.CodecEncodeSelf(e) - } - } - } - } - var yyn300 bool - if x.PersistentVolumeSource.Cinder == nil { - yyn300 = true - goto LABEL300 - } - LABEL300: - if yyr290 || yy2arr290 { - if yyn300 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[9] { - if x.Cinder == nil { - r.EncodeNil() - } else { - x.Cinder.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[9] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("cinder")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn300 { - r.EncodeNil() - } else { - if x.Cinder == nil { - r.EncodeNil() - } else { - x.Cinder.CodecEncodeSelf(e) - } - } - } - } - var yyn301 bool - if x.PersistentVolumeSource.CephFS == nil { - yyn301 = true - goto LABEL301 - } - LABEL301: - if yyr290 || yy2arr290 { - if yyn301 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[10] { - if x.CephFS == nil { - r.EncodeNil() - } else { - x.CephFS.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[10] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("cephfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn301 { - r.EncodeNil() - } else { - if x.CephFS == nil { - r.EncodeNil() - } else { - x.CephFS.CodecEncodeSelf(e) - } - } - } - } - var yyn302 bool - if x.PersistentVolumeSource.FC == nil { - yyn302 = true - goto LABEL302 - } - LABEL302: - if yyr290 || yy2arr290 { - if yyn302 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[11] { - if x.FC == nil { - r.EncodeNil() - } else { - x.FC.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[11] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fc")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn302 { - r.EncodeNil() - } else { - if x.FC == nil { - r.EncodeNil() - } else { - x.FC.CodecEncodeSelf(e) - } - } - } - } - var yyn303 bool - if x.PersistentVolumeSource.Flocker == nil { - yyn303 = true - goto LABEL303 - } - LABEL303: - if yyr290 || yy2arr290 { - if yyn303 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[12] { - if x.Flocker == nil { - r.EncodeNil() - } else { - x.Flocker.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[12] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("flocker")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn303 { - r.EncodeNil() - } else { - if x.Flocker == nil { - r.EncodeNil() - } else { - x.Flocker.CodecEncodeSelf(e) - } - } - } - } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[13] { + if yyq299[1] { if x.AccessModes == nil { r.EncodeNil() } else { - yym305 := z.EncBinary() - _ = yym305 + yym302 := z.EncBinary() + _ = yym302 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -5328,15 +5073,15 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq290[13] { + if yyq299[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym306 := z.EncBinary() - _ = yym306 + yym303 := z.EncBinary() + _ = yym303 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -5344,9 +5089,9 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[14] { + if yyq299[2] { if x.ClaimRef == nil { r.EncodeNil() } else { @@ -5356,7 +5101,7 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq290[14] { + if yyq299[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("claimRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -5367,22 +5112,503 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[15] { + if yyq299[3] { x.PersistentVolumeReclaimPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq290[15] { + if yyq299[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("persistentVolumeReclaimPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.PersistentVolumeReclaimPolicy.CodecEncodeSelf(e) } } - if yyr290 || yy2arr290 { + var yyn306 bool + if x.PersistentVolumeSource.GCEPersistentDisk == nil { + yyn306 = true + goto LABEL306 + } + LABEL306: + if yyr299 || yy2arr299 { + if yyn306 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[4] { + if x.GCEPersistentDisk == nil { + r.EncodeNil() + } else { + x.GCEPersistentDisk.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn306 { + r.EncodeNil() + } else { + if x.GCEPersistentDisk == nil { + r.EncodeNil() + } else { + x.GCEPersistentDisk.CodecEncodeSelf(e) + } + } + } + } + var yyn307 bool + if x.PersistentVolumeSource.AWSElasticBlockStore == nil { + yyn307 = true + goto LABEL307 + } + LABEL307: + if yyr299 || yy2arr299 { + if yyn307 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[5] { + if x.AWSElasticBlockStore == nil { + r.EncodeNil() + } else { + x.AWSElasticBlockStore.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn307 { + r.EncodeNil() + } else { + if x.AWSElasticBlockStore == nil { + r.EncodeNil() + } else { + x.AWSElasticBlockStore.CodecEncodeSelf(e) + } + } + } + } + var yyn308 bool + if x.PersistentVolumeSource.HostPath == nil { + yyn308 = true + goto LABEL308 + } + LABEL308: + if yyr299 || yy2arr299 { + if yyn308 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[6] { + if x.HostPath == nil { + r.EncodeNil() + } else { + x.HostPath.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPath")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn308 { + r.EncodeNil() + } else { + if x.HostPath == nil { + r.EncodeNil() + } else { + x.HostPath.CodecEncodeSelf(e) + } + } + } + } + var yyn309 bool + if x.PersistentVolumeSource.Glusterfs == nil { + yyn309 = true + goto LABEL309 + } + LABEL309: + if yyr299 || yy2arr299 { + if yyn309 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[7] { + if x.Glusterfs == nil { + r.EncodeNil() + } else { + x.Glusterfs.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn309 { + r.EncodeNil() + } else { + if x.Glusterfs == nil { + r.EncodeNil() + } else { + x.Glusterfs.CodecEncodeSelf(e) + } + } + } + } + var yyn310 bool + if x.PersistentVolumeSource.NFS == nil { + yyn310 = true + goto LABEL310 + } + LABEL310: + if yyr299 || yy2arr299 { + if yyn310 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[8] { + if x.NFS == nil { + r.EncodeNil() + } else { + x.NFS.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn310 { + r.EncodeNil() + } else { + if x.NFS == nil { + r.EncodeNil() + } else { + x.NFS.CodecEncodeSelf(e) + } + } + } + } + var yyn311 bool + if x.PersistentVolumeSource.RBD == nil { + yyn311 = true + goto LABEL311 + } + LABEL311: + if yyr299 || yy2arr299 { + if yyn311 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[9] { + if x.RBD == nil { + r.EncodeNil() + } else { + x.RBD.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("rbd")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn311 { + r.EncodeNil() + } else { + if x.RBD == nil { + r.EncodeNil() + } else { + x.RBD.CodecEncodeSelf(e) + } + } + } + } + var yyn312 bool + if x.PersistentVolumeSource.ISCSI == nil { + yyn312 = true + goto LABEL312 + } + LABEL312: + if yyr299 || yy2arr299 { + if yyn312 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[10] { + if x.ISCSI == nil { + r.EncodeNil() + } else { + x.ISCSI.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("iscsi")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn312 { + r.EncodeNil() + } else { + if x.ISCSI == nil { + r.EncodeNil() + } else { + x.ISCSI.CodecEncodeSelf(e) + } + } + } + } + var yyn313 bool + if x.PersistentVolumeSource.FlexVolume == nil { + yyn313 = true + goto LABEL313 + } + LABEL313: + if yyr299 || yy2arr299 { + if yyn313 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[11] { + if x.FlexVolume == nil { + r.EncodeNil() + } else { + x.FlexVolume.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[11] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn313 { + r.EncodeNil() + } else { + if x.FlexVolume == nil { + r.EncodeNil() + } else { + x.FlexVolume.CodecEncodeSelf(e) + } + } + } + } + var yyn314 bool + if x.PersistentVolumeSource.Cinder == nil { + yyn314 = true + goto LABEL314 + } + LABEL314: + if yyr299 || yy2arr299 { + if yyn314 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[12] { + if x.Cinder == nil { + r.EncodeNil() + } else { + x.Cinder.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[12] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("cinder")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn314 { + r.EncodeNil() + } else { + if x.Cinder == nil { + r.EncodeNil() + } else { + x.Cinder.CodecEncodeSelf(e) + } + } + } + } + var yyn315 bool + if x.PersistentVolumeSource.CephFS == nil { + yyn315 = true + goto LABEL315 + } + LABEL315: + if yyr299 || yy2arr299 { + if yyn315 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[13] { + if x.CephFS == nil { + r.EncodeNil() + } else { + x.CephFS.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[13] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("cephfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn315 { + r.EncodeNil() + } else { + if x.CephFS == nil { + r.EncodeNil() + } else { + x.CephFS.CodecEncodeSelf(e) + } + } + } + } + var yyn316 bool + if x.PersistentVolumeSource.FC == nil { + yyn316 = true + goto LABEL316 + } + LABEL316: + if yyr299 || yy2arr299 { + if yyn316 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[14] { + if x.FC == nil { + r.EncodeNil() + } else { + x.FC.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[14] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fc")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn316 { + r.EncodeNil() + } else { + if x.FC == nil { + r.EncodeNil() + } else { + x.FC.CodecEncodeSelf(e) + } + } + } + } + var yyn317 bool + if x.PersistentVolumeSource.Flocker == nil { + yyn317 = true + goto LABEL317 + } + LABEL317: + if yyr299 || yy2arr299 { + if yyn317 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[15] { + if x.Flocker == nil { + r.EncodeNil() + } else { + x.Flocker.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[15] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("flocker")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn317 { + r.EncodeNil() + } else { + if x.Flocker == nil { + r.EncodeNil() + } else { + x.Flocker.CodecEncodeSelf(e) + } + } + } + } + var yyn318 bool + if x.PersistentVolumeSource.AzureFile == nil { + yyn318 = true + goto LABEL318 + } + LABEL318: + if yyr299 || yy2arr299 { + if yyn318 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[16] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[16] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn318 { + r.EncodeNil() + } else { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + } + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -5395,25 +5621,25 @@ func (x *PersistentVolumeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym309 := z.DecBinary() - _ = yym309 + yym319 := z.DecBinary() + _ = yym319 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct310 := r.ContainerType() - if yyct310 == codecSelferValueTypeMap1234 { - yyl310 := r.ReadMapStart() - if yyl310 == 0 { + yyct320 := r.ContainerType() + if yyct320 == codecSelferValueTypeMap1234 { + yyl320 := r.ReadMapStart() + if yyl320 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl310, d) + x.codecDecodeSelfFromMap(yyl320, d) } - } else if yyct310 == codecSelferValueTypeArray1234 { - yyl310 := r.ReadArrayStart() - if yyl310 == 0 { + } else if yyct320 == codecSelferValueTypeArray1234 { + yyl320 := r.ReadArrayStart() + if yyl320 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl310, d) + x.codecDecodeSelfFromArray(yyl320, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -5425,12 +5651,12 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys311Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys311Slc - var yyhl311 bool = l >= 0 - for yyj311 := 0; ; yyj311++ { - if yyhl311 { - if yyj311 >= l { + var yys321Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys321Slc + var yyhl321 bool = l >= 0 + for yyj321 := 0; ; yyj321++ { + if yyhl321 { + if yyj321 >= l { break } } else { @@ -5439,16 +5665,45 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys311Slc = r.DecodeBytes(yys311Slc, true, true) - yys311 := string(yys311Slc) + yys321Slc = r.DecodeBytes(yys321Slc, true, true) + yys321 := string(yys321Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys311 { + switch yys321 { case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv312 := &x.Capacity - yyv312.CodecDecodeSelf(d) + yyv322 := &x.Capacity + yyv322.CodecDecodeSelf(d) + } + case "accessModes": + if r.TryDecodeAsNil() { + x.AccessModes = nil + } else { + yyv323 := &x.AccessModes + yym324 := z.DecBinary() + _ = yym324 + if false { + } else { + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv323), d) + } + } + case "claimRef": + if r.TryDecodeAsNil() { + if x.ClaimRef != nil { + x.ClaimRef = nil + } + } else { + if x.ClaimRef == nil { + x.ClaimRef = new(ObjectReference) + } + x.ClaimRef.CodecDecodeSelf(d) + } + case "persistentVolumeReclaimPolicy": + if r.TryDecodeAsNil() { + x.PersistentVolumeReclaimPolicy = "" + } else { + x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) } case "gcePersistentDisk": if x.PersistentVolumeSource.GCEPersistentDisk == nil { @@ -5618,39 +5873,24 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode } x.Flocker.CodecDecodeSelf(d) } - case "accessModes": - if r.TryDecodeAsNil() { - x.AccessModes = nil - } else { - yyv325 := &x.AccessModes - yym326 := z.DecBinary() - _ = yym326 - if false { - } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv325), d) - } + case "azureFile": + if x.PersistentVolumeSource.AzureFile == nil { + x.PersistentVolumeSource.AzureFile = new(AzureFileVolumeSource) } - case "claimRef": if r.TryDecodeAsNil() { - if x.ClaimRef != nil { - x.ClaimRef = nil + if x.AzureFile != nil { + x.AzureFile = nil } } else { - if x.ClaimRef == nil { - x.ClaimRef = new(ObjectReference) + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) } - x.ClaimRef.CodecDecodeSelf(d) - } - case "persistentVolumeReclaimPolicy": - if r.TryDecodeAsNil() { - x.PersistentVolumeReclaimPolicy = "" - } else { - x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) + x.AzureFile.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys311) - } // end switch yys311 - } // end for yyj311 + z.DecStructFieldNotFound(-1, yys321) + } // end switch yys321 + } // end for yyj321 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -5658,16 +5898,16 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj329 int - var yyb329 bool - var yyhl329 bool = l >= 0 - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + var yyj340 int + var yyb340 bool + var yyhl340 bool = l >= 0 + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5675,19 +5915,78 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv330 := &x.Capacity - yyv330.CodecDecodeSelf(d) + yyv341 := &x.Capacity + yyv341.CodecDecodeSelf(d) + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.AccessModes = nil + } else { + yyv342 := &x.AccessModes + yym343 := z.DecBinary() + _ = yym343 + if false { + } else { + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv342), d) + } + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.ClaimRef != nil { + x.ClaimRef = nil + } + } else { + if x.ClaimRef == nil { + x.ClaimRef = new(ObjectReference) + } + x.ClaimRef.CodecDecodeSelf(d) + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PersistentVolumeReclaimPolicy = "" + } else { + x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) } if x.PersistentVolumeSource.GCEPersistentDisk == nil { x.PersistentVolumeSource.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5705,13 +6004,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.AWSElasticBlockStore == nil { x.PersistentVolumeSource.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5729,13 +6028,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.HostPath == nil { x.PersistentVolumeSource.HostPath = new(HostPathVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5753,13 +6052,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Glusterfs == nil { x.PersistentVolumeSource.Glusterfs = new(GlusterfsVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5777,13 +6076,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.NFS == nil { x.PersistentVolumeSource.NFS = new(NFSVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5801,13 +6100,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.RBD == nil { x.PersistentVolumeSource.RBD = new(RBDVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5825,13 +6124,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.ISCSI == nil { x.PersistentVolumeSource.ISCSI = new(ISCSIVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5849,13 +6148,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.FlexVolume == nil { x.PersistentVolumeSource.FlexVolume = new(FlexVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5873,13 +6172,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Cinder == nil { x.PersistentVolumeSource.Cinder = new(CinderVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5897,13 +6196,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.CephFS == nil { x.PersistentVolumeSource.CephFS = new(CephFSVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5921,13 +6220,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.FC == nil { x.PersistentVolumeSource.FC = new(FCVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5945,13 +6244,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Flocker == nil { x.PersistentVolumeSource.Flocker = new(FlockerVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5966,77 +6265,42 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco } x.Flocker.CodecDecodeSelf(d) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() + if x.PersistentVolumeSource.AzureFile == nil { + x.PersistentVolumeSource.AzureFile = new(AzureFileVolumeSource) } - if yyb329 { + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.AccessModes = nil - } else { - yyv343 := &x.AccessModes - yym344 := z.DecBinary() - _ = yym344 - if false { - } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv343), d) - } - } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() - } - if yyb329 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.ClaimRef != nil { - x.ClaimRef = nil + if x.AzureFile != nil { + x.AzureFile = nil } } else { - if x.ClaimRef == nil { - x.ClaimRef = new(ObjectReference) + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) } - x.ClaimRef.CodecDecodeSelf(d) - } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() - } - if yyb329 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PersistentVolumeReclaimPolicy = "" - } else { - x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) + x.AzureFile.CodecDecodeSelf(d) } for { - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj329-1, "") + z.DecStructFieldNotFound(yyj340-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6045,8 +6309,8 @@ func (x PersistentVolumeReclaimPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym347 := z.EncBinary() - _ = yym347 + yym359 := z.EncBinary() + _ = yym359 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -6058,8 +6322,8 @@ func (x *PersistentVolumeReclaimPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym348 := z.DecBinary() - _ = yym348 + yym360 := z.DecBinary() + _ = yym360 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -6074,52 +6338,52 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym349 := z.EncBinary() - _ = yym349 + yym361 := z.EncBinary() + _ = yym361 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep350 := !z.EncBinary() - yy2arr350 := z.EncBasicHandle().StructToArray - var yyq350 [3]bool - _, _, _ = yysep350, yyq350, yy2arr350 - const yyr350 bool = false - yyq350[0] = x.Phase != "" - yyq350[1] = x.Message != "" - yyq350[2] = x.Reason != "" - var yynn350 int - if yyr350 || yy2arr350 { + yysep362 := !z.EncBinary() + yy2arr362 := z.EncBasicHandle().StructToArray + var yyq362 [3]bool + _, _, _ = yysep362, yyq362, yy2arr362 + const yyr362 bool = false + yyq362[0] = x.Phase != "" + yyq362[1] = x.Message != "" + yyq362[2] = x.Reason != "" + var yynn362 int + if yyr362 || yy2arr362 { r.EncodeArrayStart(3) } else { - yynn350 = 0 - for _, b := range yyq350 { + yynn362 = 0 + for _, b := range yyq362 { if b { - yynn350++ + yynn362++ } } - r.EncodeMapStart(yynn350) - yynn350 = 0 + r.EncodeMapStart(yynn362) + yynn362 = 0 } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[0] { + if yyq362[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[0] { + if yyq362[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[1] { - yym353 := z.EncBinary() - _ = yym353 + if yyq362[1] { + yym365 := z.EncBinary() + _ = yym365 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -6128,23 +6392,23 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[1] { + if yyq362[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym354 := z.EncBinary() - _ = yym354 + yym366 := z.EncBinary() + _ = yym366 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[2] { - yym356 := z.EncBinary() - _ = yym356 + if yyq362[2] { + yym368 := z.EncBinary() + _ = yym368 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -6153,19 +6417,19 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[2] { + if yyq362[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym357 := z.EncBinary() - _ = yym357 + yym369 := z.EncBinary() + _ = yym369 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6178,25 +6442,25 @@ func (x *PersistentVolumeStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym358 := z.DecBinary() - _ = yym358 + yym370 := z.DecBinary() + _ = yym370 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct359 := r.ContainerType() - if yyct359 == codecSelferValueTypeMap1234 { - yyl359 := r.ReadMapStart() - if yyl359 == 0 { + yyct371 := r.ContainerType() + if yyct371 == codecSelferValueTypeMap1234 { + yyl371 := r.ReadMapStart() + if yyl371 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl359, d) + x.codecDecodeSelfFromMap(yyl371, d) } - } else if yyct359 == codecSelferValueTypeArray1234 { - yyl359 := r.ReadArrayStart() - if yyl359 == 0 { + } else if yyct371 == codecSelferValueTypeArray1234 { + yyl371 := r.ReadArrayStart() + if yyl371 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl359, d) + x.codecDecodeSelfFromArray(yyl371, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6208,12 +6472,12 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys360Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys360Slc - var yyhl360 bool = l >= 0 - for yyj360 := 0; ; yyj360++ { - if yyhl360 { - if yyj360 >= l { + var yys372Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys372Slc + var yyhl372 bool = l >= 0 + for yyj372 := 0; ; yyj372++ { + if yyhl372 { + if yyj372 >= l { break } } else { @@ -6222,10 +6486,10 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys360Slc = r.DecodeBytes(yys360Slc, true, true) - yys360 := string(yys360Slc) + yys372Slc = r.DecodeBytes(yys372Slc, true, true) + yys372 := string(yys372Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys360 { + switch yys372 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -6245,9 +6509,9 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco x.Reason = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys360) - } // end switch yys360 - } // end for yyj360 + z.DecStructFieldNotFound(-1, yys372) + } // end switch yys372 + } // end for yyj372 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6255,16 +6519,16 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj364 int - var yyb364 bool - var yyhl364 bool = l >= 0 - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + var yyj376 int + var yyb376 bool + var yyhl376 bool = l >= 0 + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6274,13 +6538,13 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Phase = PersistentVolumePhase(r.DecodeString()) } - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6290,13 +6554,13 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Message = string(r.DecodeString()) } - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6307,17 +6571,17 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De x.Reason = string(r.DecodeString()) } for { - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj364-1, "") + z.DecStructFieldNotFound(yyj376-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6329,118 +6593,68 @@ func (x *PersistentVolumeList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym368 := z.EncBinary() - _ = yym368 + yym380 := z.EncBinary() + _ = yym380 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep369 := !z.EncBinary() - yy2arr369 := z.EncBasicHandle().StructToArray - var yyq369 [4]bool - _, _, _ = yysep369, yyq369, yy2arr369 - const yyr369 bool = false - yyq369[0] = x.Kind != "" - yyq369[1] = x.APIVersion != "" - yyq369[2] = true - var yynn369 int - if yyr369 || yy2arr369 { + yysep381 := !z.EncBinary() + yy2arr381 := z.EncBasicHandle().StructToArray + var yyq381 [4]bool + _, _, _ = yysep381, yyq381, yy2arr381 + const yyr381 bool = false + yyq381[0] = true + yyq381[2] = x.Kind != "" + yyq381[3] = x.APIVersion != "" + var yynn381 int + if yyr381 || yy2arr381 { r.EncodeArrayStart(4) } else { - yynn369 = 1 - for _, b := range yyq369 { + yynn381 = 1 + for _, b := range yyq381 { if b { - yynn369++ + yynn381++ } } - r.EncodeMapStart(yynn369) - yynn369 = 0 + r.EncodeMapStart(yynn381) + yynn381 = 0 } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[0] { - yym371 := z.EncBinary() - _ = yym371 + if yyq381[0] { + yy383 := &x.ListMeta + yym384 := z.EncBinary() + _ = yym384 if false { + } else if z.HasExtensions() && z.EncExt(yy383) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq369[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym372 := z.EncBinary() - _ = yym372 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr369 || yy2arr369 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[1] { - yym374 := z.EncBinary() - _ = yym374 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq369[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym375 := z.EncBinary() - _ = yym375 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr369 || yy2arr369 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[2] { - yy377 := &x.ListMeta - yym378 := z.EncBinary() - _ = yym378 - if false { - } else if z.HasExtensions() && z.EncExt(yy377) { - } else { - z.EncFallback(yy377) + z.EncFallback(yy383) } } else { r.EncodeNil() } } else { - if yyq369[2] { + if yyq381[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy379 := &x.ListMeta - yym380 := z.EncBinary() - _ = yym380 + yy385 := &x.ListMeta + yym386 := z.EncBinary() + _ = yym386 if false { - } else if z.HasExtensions() && z.EncExt(yy379) { + } else if z.HasExtensions() && z.EncExt(yy385) { } else { - z.EncFallback(yy379) + z.EncFallback(yy385) } } } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym382 := z.EncBinary() - _ = yym382 + yym388 := z.EncBinary() + _ = yym388 if false { } else { h.encSlicePersistentVolume(([]PersistentVolume)(x.Items), e) @@ -6453,15 +6667,65 @@ func (x *PersistentVolumeList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym383 := z.EncBinary() - _ = yym383 + yym389 := z.EncBinary() + _ = yym389 if false { } else { h.encSlicePersistentVolume(([]PersistentVolume)(x.Items), e) } } } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq381[2] { + yym391 := z.EncBinary() + _ = yym391 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq381[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym392 := z.EncBinary() + _ = yym392 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr381 || yy2arr381 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq381[3] { + yym394 := z.EncBinary() + _ = yym394 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq381[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym395 := z.EncBinary() + _ = yym395 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6474,25 +6738,25 @@ func (x *PersistentVolumeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym384 := z.DecBinary() - _ = yym384 + yym396 := z.DecBinary() + _ = yym396 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct385 := r.ContainerType() - if yyct385 == codecSelferValueTypeMap1234 { - yyl385 := r.ReadMapStart() - if yyl385 == 0 { + yyct397 := r.ContainerType() + if yyct397 == codecSelferValueTypeMap1234 { + yyl397 := r.ReadMapStart() + if yyl397 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl385, d) + x.codecDecodeSelfFromMap(yyl397, d) } - } else if yyct385 == codecSelferValueTypeArray1234 { - yyl385 := r.ReadArrayStart() - if yyl385 == 0 { + } else if yyct397 == codecSelferValueTypeArray1234 { + yyl397 := r.ReadArrayStart() + if yyl397 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl385, d) + x.codecDecodeSelfFromArray(yyl397, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6504,12 +6768,12 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys386Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys386Slc - var yyhl386 bool = l >= 0 - for yyj386 := 0; ; yyj386++ { - if yyhl386 { - if yyj386 >= l { + var yys398Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys398Slc + var yyhl398 bool = l >= 0 + for yyj398 := 0; ; yyj398++ { + if yyhl398 { + if yyj398 >= l { break } } else { @@ -6518,10 +6782,35 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys386Slc = r.DecodeBytes(yys386Slc, true, true) - yys386 := string(yys386Slc) + yys398Slc = r.DecodeBytes(yys398Slc, true, true) + yys398 := string(yys398Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys386 { + switch yys398 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv399 := &x.ListMeta + yym400 := z.DecBinary() + _ = yym400 + if false { + } else if z.HasExtensions() && z.DecExt(yyv399) { + } else { + z.DecFallback(yyv399, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv401 := &x.Items + yym402 := z.DecBinary() + _ = yym402 + if false { + } else { + h.decSlicePersistentVolume((*[]PersistentVolume)(yyv401), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6534,35 +6823,10 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv389 := &x.ListMeta - yym390 := z.DecBinary() - _ = yym390 - if false { - } else if z.HasExtensions() && z.DecExt(yyv389) { - } else { - z.DecFallback(yyv389, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv391 := &x.Items - yym392 := z.DecBinary() - _ = yym392 - if false { - } else { - h.decSlicePersistentVolume((*[]PersistentVolume)(yyv391), d) - } - } default: - z.DecStructFieldNotFound(-1, yys386) - } // end switch yys386 - } // end for yyj386 + z.DecStructFieldNotFound(-1, yys398) + } // end switch yys398 + } // end for yyj398 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6570,16 +6834,61 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj393 int - var yyb393 bool - var yyhl393 bool = l >= 0 - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + var yyj405 int + var yyb405 bool + var yyhl405 bool = l >= 0 + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv406 := &x.ListMeta + yym407 := z.DecBinary() + _ = yym407 + if false { + } else if z.HasExtensions() && z.DecExt(yyv406) { + } else { + z.DecFallback(yyv406, false) + } + } + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l + } else { + yyb405 = r.CheckBreak() + } + if yyb405 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv408 := &x.Items + yym409 := z.DecBinary() + _ = yym409 + if false { + } else { + h.decSlicePersistentVolume((*[]PersistentVolume)(yyv408), d) + } + } + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l + } else { + yyb405 = r.CheckBreak() + } + if yyb405 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6589,13 +6898,13 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.Kind = string(r.DecodeString()) } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6605,63 +6914,18 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l - } else { - yyb393 = r.CheckBreak() - } - if yyb393 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv396 := &x.ListMeta - yym397 := z.DecBinary() - _ = yym397 - if false { - } else if z.HasExtensions() && z.DecExt(yyv396) { - } else { - z.DecFallback(yyv396, false) - } - } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l - } else { - yyb393 = r.CheckBreak() - } - if yyb393 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv398 := &x.Items - yym399 := z.DecBinary() - _ = yym399 - if false { - } else { - h.decSlicePersistentVolume((*[]PersistentVolume)(yyv398), d) - } - } for { - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj393-1, "") + z.DecStructFieldNotFound(yyj405-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6673,136 +6937,136 @@ func (x *PersistentVolumeClaim) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym400 := z.EncBinary() - _ = yym400 + yym412 := z.EncBinary() + _ = yym412 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep401 := !z.EncBinary() - yy2arr401 := z.EncBasicHandle().StructToArray - var yyq401 [5]bool - _, _, _ = yysep401, yyq401, yy2arr401 - const yyr401 bool = false - yyq401[0] = x.Kind != "" - yyq401[1] = x.APIVersion != "" - yyq401[2] = true - yyq401[3] = true - yyq401[4] = true - var yynn401 int - if yyr401 || yy2arr401 { + yysep413 := !z.EncBinary() + yy2arr413 := z.EncBasicHandle().StructToArray + var yyq413 [5]bool + _, _, _ = yysep413, yyq413, yy2arr413 + const yyr413 bool = false + yyq413[0] = true + yyq413[1] = true + yyq413[2] = true + yyq413[3] = x.Kind != "" + yyq413[4] = x.APIVersion != "" + var yynn413 int + if yyr413 || yy2arr413 { r.EncodeArrayStart(5) } else { - yynn401 = 0 - for _, b := range yyq401 { + yynn413 = 0 + for _, b := range yyq413 { if b { - yynn401++ + yynn413++ } } - r.EncodeMapStart(yynn401) - yynn401 = 0 + r.EncodeMapStart(yynn413) + yynn413 = 0 } - if yyr401 || yy2arr401 { + if yyr413 || yy2arr413 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[0] { - yym403 := z.EncBinary() - _ = yym403 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq401[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym404 := z.EncBinary() - _ = yym404 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[1] { - yym406 := z.EncBinary() - _ = yym406 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq401[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym407 := z.EncBinary() - _ = yym407 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[2] { - yy409 := &x.ObjectMeta - yy409.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq401[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy410 := &x.ObjectMeta - yy410.CodecEncodeSelf(e) - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[3] { - yy412 := &x.Spec - yy412.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq401[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy413 := &x.Spec - yy413.CodecEncodeSelf(e) - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[4] { - yy415 := &x.Status + if yyq413[0] { + yy415 := &x.ObjectMeta yy415.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq401[4] { + if yyq413[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy416 := &x.Status + yy416 := &x.ObjectMeta yy416.CodecEncodeSelf(e) } } - if yyr401 || yy2arr401 { + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[1] { + yy418 := &x.Spec + yy418.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq413[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy419 := &x.Spec + yy419.CodecEncodeSelf(e) + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[2] { + yy421 := &x.Status + yy421.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq413[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy422 := &x.Status + yy422.CodecEncodeSelf(e) + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[3] { + yym424 := z.EncBinary() + _ = yym424 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq413[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym425 := z.EncBinary() + _ = yym425 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[4] { + yym427 := z.EncBinary() + _ = yym427 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq413[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym428 := z.EncBinary() + _ = yym428 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr413 || yy2arr413 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6815,25 +7079,25 @@ func (x *PersistentVolumeClaim) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym417 := z.DecBinary() - _ = yym417 + yym429 := z.DecBinary() + _ = yym429 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct418 := r.ContainerType() - if yyct418 == codecSelferValueTypeMap1234 { - yyl418 := r.ReadMapStart() - if yyl418 == 0 { + yyct430 := r.ContainerType() + if yyct430 == codecSelferValueTypeMap1234 { + yyl430 := r.ReadMapStart() + if yyl430 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl418, d) + x.codecDecodeSelfFromMap(yyl430, d) } - } else if yyct418 == codecSelferValueTypeArray1234 { - yyl418 := r.ReadArrayStart() - if yyl418 == 0 { + } else if yyct430 == codecSelferValueTypeArray1234 { + yyl430 := r.ReadArrayStart() + if yyl430 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl418, d) + x.codecDecodeSelfFromArray(yyl430, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6845,12 +7109,12 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys419Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys419Slc - var yyhl419 bool = l >= 0 - for yyj419 := 0; ; yyj419++ { - if yyhl419 { - if yyj419 >= l { + var yys431Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys431Slc + var yyhl431 bool = l >= 0 + for yyj431 := 0; ; yyj431++ { + if yyhl431 { + if yyj431 >= l { break } } else { @@ -6859,10 +7123,31 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys419Slc = r.DecodeBytes(yys419Slc, true, true) - yys419 := string(yys419Slc) + yys431Slc = r.DecodeBytes(yys431Slc, true, true) + yys431 := string(yys431Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys419 { + switch yys431 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv432 := &x.ObjectMeta + yyv432.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeClaimSpec{} + } else { + yyv433 := &x.Spec + yyv433.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeClaimStatus{} + } else { + yyv434 := &x.Status + yyv434.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6875,31 +7160,10 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv422 := &x.ObjectMeta - yyv422.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeClaimSpec{} - } else { - yyv423 := &x.Spec - yyv423.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeClaimStatus{} - } else { - yyv424 := &x.Status - yyv424.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys419) - } // end switch yys419 - } // end for yyj419 + z.DecStructFieldNotFound(-1, yys431) + } // end switch yys431 + } // end for yyj431 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6907,16 +7171,67 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj425 int - var yyb425 bool - var yyhl425 bool = l >= 0 - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + var yyj437 int + var yyb437 bool + var yyhl437 bool = l >= 0 + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv438 := &x.ObjectMeta + yyv438.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeClaimSpec{} + } else { + yyv439 := &x.Spec + yyv439.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeClaimStatus{} + } else { + yyv440 := &x.Status + yyv440.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6926,13 +7241,13 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6942,69 +7257,18 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv428 := &x.ObjectMeta - yyv428.CodecDecodeSelf(d) - } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeClaimSpec{} - } else { - yyv429 := &x.Spec - yyv429.CodecDecodeSelf(d) - } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeClaimStatus{} - } else { - yyv430 := &x.Status - yyv430.CodecDecodeSelf(d) - } for { - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj425-1, "") + z.DecStructFieldNotFound(yyj437-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7016,118 +7280,68 @@ func (x *PersistentVolumeClaimList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym431 := z.EncBinary() - _ = yym431 + yym443 := z.EncBinary() + _ = yym443 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep432 := !z.EncBinary() - yy2arr432 := z.EncBasicHandle().StructToArray - var yyq432 [4]bool - _, _, _ = yysep432, yyq432, yy2arr432 - const yyr432 bool = false - yyq432[0] = x.Kind != "" - yyq432[1] = x.APIVersion != "" - yyq432[2] = true - var yynn432 int - if yyr432 || yy2arr432 { + yysep444 := !z.EncBinary() + yy2arr444 := z.EncBasicHandle().StructToArray + var yyq444 [4]bool + _, _, _ = yysep444, yyq444, yy2arr444 + const yyr444 bool = false + yyq444[0] = true + yyq444[2] = x.Kind != "" + yyq444[3] = x.APIVersion != "" + var yynn444 int + if yyr444 || yy2arr444 { r.EncodeArrayStart(4) } else { - yynn432 = 1 - for _, b := range yyq432 { + yynn444 = 1 + for _, b := range yyq444 { if b { - yynn432++ + yynn444++ } } - r.EncodeMapStart(yynn432) - yynn432 = 0 + r.EncodeMapStart(yynn444) + yynn444 = 0 } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[0] { - yym434 := z.EncBinary() - _ = yym434 + if yyq444[0] { + yy446 := &x.ListMeta + yym447 := z.EncBinary() + _ = yym447 if false { + } else if z.HasExtensions() && z.EncExt(yy446) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq432[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym435 := z.EncBinary() - _ = yym435 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr432 || yy2arr432 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[1] { - yym437 := z.EncBinary() - _ = yym437 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq432[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym438 := z.EncBinary() - _ = yym438 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr432 || yy2arr432 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[2] { - yy440 := &x.ListMeta - yym441 := z.EncBinary() - _ = yym441 - if false { - } else if z.HasExtensions() && z.EncExt(yy440) { - } else { - z.EncFallback(yy440) + z.EncFallback(yy446) } } else { r.EncodeNil() } } else { - if yyq432[2] { + if yyq444[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy442 := &x.ListMeta - yym443 := z.EncBinary() - _ = yym443 + yy448 := &x.ListMeta + yym449 := z.EncBinary() + _ = yym449 if false { - } else if z.HasExtensions() && z.EncExt(yy442) { + } else if z.HasExtensions() && z.EncExt(yy448) { } else { - z.EncFallback(yy442) + z.EncFallback(yy448) } } } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym445 := z.EncBinary() - _ = yym445 + yym451 := z.EncBinary() + _ = yym451 if false { } else { h.encSlicePersistentVolumeClaim(([]PersistentVolumeClaim)(x.Items), e) @@ -7140,15 +7354,65 @@ func (x *PersistentVolumeClaimList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym446 := z.EncBinary() - _ = yym446 + yym452 := z.EncBinary() + _ = yym452 if false { } else { h.encSlicePersistentVolumeClaim(([]PersistentVolumeClaim)(x.Items), e) } } } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq444[2] { + yym454 := z.EncBinary() + _ = yym454 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq444[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym455 := z.EncBinary() + _ = yym455 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr444 || yy2arr444 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq444[3] { + yym457 := z.EncBinary() + _ = yym457 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq444[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym458 := z.EncBinary() + _ = yym458 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7161,25 +7425,25 @@ func (x *PersistentVolumeClaimList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym447 := z.DecBinary() - _ = yym447 + yym459 := z.DecBinary() + _ = yym459 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct448 := r.ContainerType() - if yyct448 == codecSelferValueTypeMap1234 { - yyl448 := r.ReadMapStart() - if yyl448 == 0 { + yyct460 := r.ContainerType() + if yyct460 == codecSelferValueTypeMap1234 { + yyl460 := r.ReadMapStart() + if yyl460 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl448, d) + x.codecDecodeSelfFromMap(yyl460, d) } - } else if yyct448 == codecSelferValueTypeArray1234 { - yyl448 := r.ReadArrayStart() - if yyl448 == 0 { + } else if yyct460 == codecSelferValueTypeArray1234 { + yyl460 := r.ReadArrayStart() + if yyl460 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl448, d) + x.codecDecodeSelfFromArray(yyl460, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7191,12 +7455,12 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys449Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys449Slc - var yyhl449 bool = l >= 0 - for yyj449 := 0; ; yyj449++ { - if yyhl449 { - if yyj449 >= l { + var yys461Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys461Slc + var yyhl461 bool = l >= 0 + for yyj461 := 0; ; yyj461++ { + if yyhl461 { + if yyj461 >= l { break } } else { @@ -7205,10 +7469,35 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys449Slc = r.DecodeBytes(yys449Slc, true, true) - yys449 := string(yys449Slc) + yys461Slc = r.DecodeBytes(yys461Slc, true, true) + yys461 := string(yys461Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys449 { + switch yys461 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv462 := &x.ListMeta + yym463 := z.DecBinary() + _ = yym463 + if false { + } else if z.HasExtensions() && z.DecExt(yyv462) { + } else { + z.DecFallback(yyv462, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv464 := &x.Items + yym465 := z.DecBinary() + _ = yym465 + if false { + } else { + h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv464), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -7221,35 +7510,10 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv452 := &x.ListMeta - yym453 := z.DecBinary() - _ = yym453 - if false { - } else if z.HasExtensions() && z.DecExt(yyv452) { - } else { - z.DecFallback(yyv452, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv454 := &x.Items - yym455 := z.DecBinary() - _ = yym455 - if false { - } else { - h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv454), d) - } - } default: - z.DecStructFieldNotFound(-1, yys449) - } // end switch yys449 - } // end for yyj449 + z.DecStructFieldNotFound(-1, yys461) + } // end switch yys461 + } // end for yyj461 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7257,16 +7521,61 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj456 int - var yyb456 bool - var yyhl456 bool = l >= 0 - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + var yyj468 int + var yyb468 bool + var yyhl468 bool = l >= 0 + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv469 := &x.ListMeta + yym470 := z.DecBinary() + _ = yym470 + if false { + } else if z.HasExtensions() && z.DecExt(yyv469) { + } else { + z.DecFallback(yyv469, false) + } + } + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l + } else { + yyb468 = r.CheckBreak() + } + if yyb468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv471 := &x.Items + yym472 := z.DecBinary() + _ = yym472 + if false { + } else { + h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv471), d) + } + } + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l + } else { + yyb468 = r.CheckBreak() + } + if yyb468 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7276,13 +7585,13 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.Kind = string(r.DecodeString()) } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7292,63 +7601,18 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l - } else { - yyb456 = r.CheckBreak() - } - if yyb456 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv459 := &x.ListMeta - yym460 := z.DecBinary() - _ = yym460 - if false { - } else if z.HasExtensions() && z.DecExt(yyv459) { - } else { - z.DecFallback(yyv459, false) - } - } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l - } else { - yyb456 = r.CheckBreak() - } - if yyb456 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv461 := &x.Items - yym462 := z.DecBinary() - _ = yym462 - if false { - } else { - h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv461), d) - } - } for { - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj456-1, "") + z.DecStructFieldNotFound(yyj468-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7360,40 +7624,40 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym463 := z.EncBinary() - _ = yym463 + yym475 := z.EncBinary() + _ = yym475 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep464 := !z.EncBinary() - yy2arr464 := z.EncBasicHandle().StructToArray - var yyq464 [3]bool - _, _, _ = yysep464, yyq464, yy2arr464 - const yyr464 bool = false - yyq464[0] = len(x.AccessModes) != 0 - yyq464[1] = true - yyq464[2] = x.VolumeName != "" - var yynn464 int - if yyr464 || yy2arr464 { + yysep476 := !z.EncBinary() + yy2arr476 := z.EncBasicHandle().StructToArray + var yyq476 [3]bool + _, _, _ = yysep476, yyq476, yy2arr476 + const yyr476 bool = false + yyq476[0] = len(x.AccessModes) != 0 + yyq476[1] = true + yyq476[2] = x.VolumeName != "" + var yynn476 int + if yyr476 || yy2arr476 { r.EncodeArrayStart(3) } else { - yynn464 = 0 - for _, b := range yyq464 { + yynn476 = 0 + for _, b := range yyq476 { if b { - yynn464++ + yynn476++ } } - r.EncodeMapStart(yynn464) - yynn464 = 0 + r.EncodeMapStart(yynn476) + yynn476 = 0 } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[0] { + if yyq476[0] { if x.AccessModes == nil { r.EncodeNil() } else { - yym466 := z.EncBinary() - _ = yym466 + yym478 := z.EncBinary() + _ = yym478 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7403,15 +7667,15 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq464[0] { + if yyq476[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym467 := z.EncBinary() - _ = yym467 + yym479 := z.EncBinary() + _ = yym479 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7419,28 +7683,28 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[1] { - yy469 := &x.Resources - yy469.CodecEncodeSelf(e) + if yyq476[1] { + yy481 := &x.Resources + yy481.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq464[1] { + if yyq476[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy470 := &x.Resources - yy470.CodecEncodeSelf(e) + yy482 := &x.Resources + yy482.CodecEncodeSelf(e) } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[2] { - yym472 := z.EncBinary() - _ = yym472 + if yyq476[2] { + yym484 := z.EncBinary() + _ = yym484 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeName)) @@ -7449,19 +7713,19 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq464[2] { + if yyq476[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym473 := z.EncBinary() - _ = yym473 + yym485 := z.EncBinary() + _ = yym485 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeName)) } } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7474,25 +7738,25 @@ func (x *PersistentVolumeClaimSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym474 := z.DecBinary() - _ = yym474 + yym486 := z.DecBinary() + _ = yym486 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct475 := r.ContainerType() - if yyct475 == codecSelferValueTypeMap1234 { - yyl475 := r.ReadMapStart() - if yyl475 == 0 { + yyct487 := r.ContainerType() + if yyct487 == codecSelferValueTypeMap1234 { + yyl487 := r.ReadMapStart() + if yyl487 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl475, d) + x.codecDecodeSelfFromMap(yyl487, d) } - } else if yyct475 == codecSelferValueTypeArray1234 { - yyl475 := r.ReadArrayStart() - if yyl475 == 0 { + } else if yyct487 == codecSelferValueTypeArray1234 { + yyl487 := r.ReadArrayStart() + if yyl487 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl475, d) + x.codecDecodeSelfFromArray(yyl487, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7504,12 +7768,12 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys476Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys476Slc - var yyhl476 bool = l >= 0 - for yyj476 := 0; ; yyj476++ { - if yyhl476 { - if yyj476 >= l { + var yys488Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys488Slc + var yyhl488 bool = l >= 0 + for yyj488 := 0; ; yyj488++ { + if yyhl488 { + if yyj488 >= l { break } } else { @@ -7518,28 +7782,28 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys476Slc = r.DecodeBytes(yys476Slc, true, true) - yys476 := string(yys476Slc) + yys488Slc = r.DecodeBytes(yys488Slc, true, true) + yys488 := string(yys488Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys476 { + switch yys488 { case "accessModes": if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv477 := &x.AccessModes - yym478 := z.DecBinary() - _ = yym478 + yyv489 := &x.AccessModes + yym490 := z.DecBinary() + _ = yym490 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv477), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv489), d) } } case "resources": if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv479 := &x.Resources - yyv479.CodecDecodeSelf(d) + yyv491 := &x.Resources + yyv491.CodecDecodeSelf(d) } case "volumeName": if r.TryDecodeAsNil() { @@ -7548,9 +7812,9 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D x.VolumeName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys476) - } // end switch yys476 - } // end for yyj476 + z.DecStructFieldNotFound(-1, yys488) + } // end switch yys488 + } // end for yyj488 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7558,16 +7822,16 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj481 int - var yyb481 bool - var yyhl481 bool = l >= 0 - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + var yyj493 int + var yyb493 bool + var yyhl493 bool = l >= 0 + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7575,21 +7839,21 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv482 := &x.AccessModes - yym483 := z.DecBinary() - _ = yym483 + yyv494 := &x.AccessModes + yym495 := z.DecBinary() + _ = yym495 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv482), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv494), d) } } - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7597,16 +7861,16 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv484 := &x.Resources - yyv484.CodecDecodeSelf(d) + yyv496 := &x.Resources + yyv496.CodecDecodeSelf(d) } - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7617,17 +7881,17 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 x.VolumeName = string(r.DecodeString()) } for { - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj481-1, "") + z.DecStructFieldNotFound(yyj493-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7639,55 +7903,55 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym486 := z.EncBinary() - _ = yym486 + yym498 := z.EncBinary() + _ = yym498 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep487 := !z.EncBinary() - yy2arr487 := z.EncBasicHandle().StructToArray - var yyq487 [3]bool - _, _, _ = yysep487, yyq487, yy2arr487 - const yyr487 bool = false - yyq487[0] = x.Phase != "" - yyq487[1] = len(x.AccessModes) != 0 - yyq487[2] = len(x.Capacity) != 0 - var yynn487 int - if yyr487 || yy2arr487 { + yysep499 := !z.EncBinary() + yy2arr499 := z.EncBasicHandle().StructToArray + var yyq499 [3]bool + _, _, _ = yysep499, yyq499, yy2arr499 + const yyr499 bool = false + yyq499[0] = x.Phase != "" + yyq499[1] = len(x.AccessModes) != 0 + yyq499[2] = len(x.Capacity) != 0 + var yynn499 int + if yyr499 || yy2arr499 { r.EncodeArrayStart(3) } else { - yynn487 = 0 - for _, b := range yyq487 { + yynn499 = 0 + for _, b := range yyq499 { if b { - yynn487++ + yynn499++ } } - r.EncodeMapStart(yynn487) - yynn487 = 0 + r.EncodeMapStart(yynn499) + yynn499 = 0 } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[0] { + if yyq499[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq487[0] { + if yyq499[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[1] { + if yyq499[1] { if x.AccessModes == nil { r.EncodeNil() } else { - yym490 := z.EncBinary() - _ = yym490 + yym502 := z.EncBinary() + _ = yym502 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7697,15 +7961,15 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq487[1] { + if yyq499[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym491 := z.EncBinary() - _ = yym491 + yym503 := z.EncBinary() + _ = yym503 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7713,9 +7977,9 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[2] { + if yyq499[2] { if x.Capacity == nil { r.EncodeNil() } else { @@ -7725,7 +7989,7 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq487[2] { + if yyq499[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -7736,7 +8000,7 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7749,25 +8013,25 @@ func (x *PersistentVolumeClaimStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym493 := z.DecBinary() - _ = yym493 + yym505 := z.DecBinary() + _ = yym505 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct494 := r.ContainerType() - if yyct494 == codecSelferValueTypeMap1234 { - yyl494 := r.ReadMapStart() - if yyl494 == 0 { + yyct506 := r.ContainerType() + if yyct506 == codecSelferValueTypeMap1234 { + yyl506 := r.ReadMapStart() + if yyl506 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl494, d) + x.codecDecodeSelfFromMap(yyl506, d) } - } else if yyct494 == codecSelferValueTypeArray1234 { - yyl494 := r.ReadArrayStart() - if yyl494 == 0 { + } else if yyct506 == codecSelferValueTypeArray1234 { + yyl506 := r.ReadArrayStart() + if yyl506 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl494, d) + x.codecDecodeSelfFromArray(yyl506, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7779,12 +8043,12 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys495Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys495Slc - var yyhl495 bool = l >= 0 - for yyj495 := 0; ; yyj495++ { - if yyhl495 { - if yyj495 >= l { + var yys507Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys507Slc + var yyhl507 bool = l >= 0 + for yyj507 := 0; ; yyj507++ { + if yyhl507 { + if yyj507 >= l { break } } else { @@ -7793,10 +8057,10 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys495Slc = r.DecodeBytes(yys495Slc, true, true) - yys495 := string(yys495Slc) + yys507Slc = r.DecodeBytes(yys507Slc, true, true) + yys507 := string(yys507Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys495 { + switch yys507 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -7807,25 +8071,25 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv497 := &x.AccessModes - yym498 := z.DecBinary() - _ = yym498 + yyv509 := &x.AccessModes + yym510 := z.DecBinary() + _ = yym510 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv497), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv509), d) } } case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv499 := &x.Capacity - yyv499.CodecDecodeSelf(d) + yyv511 := &x.Capacity + yyv511.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys495) - } // end switch yys495 - } // end for yyj495 + z.DecStructFieldNotFound(-1, yys507) + } // end switch yys507 + } // end for yyj507 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7833,16 +8097,16 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj500 int - var yyb500 bool - var yyhl500 bool = l >= 0 - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + var yyj512 int + var yyb512 bool + var yyhl512 bool = l >= 0 + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7852,13 +8116,13 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 } else { x.Phase = PersistentVolumeClaimPhase(r.DecodeString()) } - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7866,21 +8130,21 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv502 := &x.AccessModes - yym503 := z.DecBinary() - _ = yym503 + yyv514 := &x.AccessModes + yym515 := z.DecBinary() + _ = yym515 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv502), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv514), d) } } - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7888,21 +8152,21 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv504 := &x.Capacity - yyv504.CodecDecodeSelf(d) + yyv516 := &x.Capacity + yyv516.CodecDecodeSelf(d) } for { - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj500-1, "") + z.DecStructFieldNotFound(yyj512-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7911,8 +8175,8 @@ func (x PersistentVolumeAccessMode) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym505 := z.EncBinary() - _ = yym505 + yym517 := z.EncBinary() + _ = yym517 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7924,8 +8188,8 @@ func (x *PersistentVolumeAccessMode) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym506 := z.DecBinary() - _ = yym506 + yym518 := z.DecBinary() + _ = yym518 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7937,8 +8201,8 @@ func (x PersistentVolumePhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym507 := z.EncBinary() - _ = yym507 + yym519 := z.EncBinary() + _ = yym519 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7950,8 +8214,8 @@ func (x *PersistentVolumePhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym508 := z.DecBinary() - _ = yym508 + yym520 := z.DecBinary() + _ = yym520 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7963,8 +8227,8 @@ func (x PersistentVolumeClaimPhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym509 := z.EncBinary() - _ = yym509 + yym521 := z.EncBinary() + _ = yym521 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7976,8 +8240,8 @@ func (x *PersistentVolumeClaimPhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym510 := z.DecBinary() - _ = yym510 + yym522 := z.DecBinary() + _ = yym522 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7992,33 +8256,33 @@ func (x *HostPathVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym511 := z.EncBinary() - _ = yym511 + yym523 := z.EncBinary() + _ = yym523 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep512 := !z.EncBinary() - yy2arr512 := z.EncBasicHandle().StructToArray - var yyq512 [1]bool - _, _, _ = yysep512, yyq512, yy2arr512 - const yyr512 bool = false - var yynn512 int - if yyr512 || yy2arr512 { + yysep524 := !z.EncBinary() + yy2arr524 := z.EncBasicHandle().StructToArray + var yyq524 [1]bool + _, _, _ = yysep524, yyq524, yy2arr524 + const yyr524 bool = false + var yynn524 int + if yyr524 || yy2arr524 { r.EncodeArrayStart(1) } else { - yynn512 = 1 - for _, b := range yyq512 { + yynn524 = 1 + for _, b := range yyq524 { if b { - yynn512++ + yynn524++ } } - r.EncodeMapStart(yynn512) - yynn512 = 0 + r.EncodeMapStart(yynn524) + yynn524 = 0 } - if yyr512 || yy2arr512 { + if yyr524 || yy2arr524 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym514 := z.EncBinary() - _ = yym514 + yym526 := z.EncBinary() + _ = yym526 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -8027,14 +8291,14 @@ func (x *HostPathVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym515 := z.EncBinary() - _ = yym515 + yym527 := z.EncBinary() + _ = yym527 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr512 || yy2arr512 { + if yyr524 || yy2arr524 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8047,25 +8311,25 @@ func (x *HostPathVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym516 := z.DecBinary() - _ = yym516 + yym528 := z.DecBinary() + _ = yym528 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct517 := r.ContainerType() - if yyct517 == codecSelferValueTypeMap1234 { - yyl517 := r.ReadMapStart() - if yyl517 == 0 { + yyct529 := r.ContainerType() + if yyct529 == codecSelferValueTypeMap1234 { + yyl529 := r.ReadMapStart() + if yyl529 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl517, d) + x.codecDecodeSelfFromMap(yyl529, d) } - } else if yyct517 == codecSelferValueTypeArray1234 { - yyl517 := r.ReadArrayStart() - if yyl517 == 0 { + } else if yyct529 == codecSelferValueTypeArray1234 { + yyl529 := r.ReadArrayStart() + if yyl529 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl517, d) + x.codecDecodeSelfFromArray(yyl529, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8077,12 +8341,12 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys518Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys518Slc - var yyhl518 bool = l >= 0 - for yyj518 := 0; ; yyj518++ { - if yyhl518 { - if yyj518 >= l { + var yys530Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys530Slc + var yyhl530 bool = l >= 0 + for yyj530 := 0; ; yyj530++ { + if yyhl530 { + if yyj530 >= l { break } } else { @@ -8091,10 +8355,10 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys518Slc = r.DecodeBytes(yys518Slc, true, true) - yys518 := string(yys518Slc) + yys530Slc = r.DecodeBytes(yys530Slc, true, true) + yys530 := string(yys530Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys518 { + switch yys530 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -8102,9 +8366,9 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Path = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys518) - } // end switch yys518 - } // end for yyj518 + z.DecStructFieldNotFound(-1, yys530) + } // end switch yys530 + } // end for yyj530 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8112,16 +8376,16 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj520 int - var yyb520 bool - var yyhl520 bool = l >= 0 - yyj520++ - if yyhl520 { - yyb520 = yyj520 > l + var yyj532 int + var yyb532 bool + var yyhl532 bool = l >= 0 + yyj532++ + if yyhl532 { + yyb532 = yyj532 > l } else { - yyb520 = r.CheckBreak() + yyb532 = r.CheckBreak() } - if yyb520 { + if yyb532 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8132,17 +8396,17 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Path = string(r.DecodeString()) } for { - yyj520++ - if yyhl520 { - yyb520 = yyj520 > l + yyj532++ + if yyhl532 { + yyb532 = yyj532 > l } else { - yyb520 = r.CheckBreak() + yyb532 = r.CheckBreak() } - if yyb520 { + if yyb532 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj520-1, "") + z.DecStructFieldNotFound(yyj532-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8154,46 +8418,46 @@ func (x *EmptyDirVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym522 := z.EncBinary() - _ = yym522 + yym534 := z.EncBinary() + _ = yym534 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep523 := !z.EncBinary() - yy2arr523 := z.EncBasicHandle().StructToArray - var yyq523 [1]bool - _, _, _ = yysep523, yyq523, yy2arr523 - const yyr523 bool = false - yyq523[0] = x.Medium != "" - var yynn523 int - if yyr523 || yy2arr523 { + yysep535 := !z.EncBinary() + yy2arr535 := z.EncBasicHandle().StructToArray + var yyq535 [1]bool + _, _, _ = yysep535, yyq535, yy2arr535 + const yyr535 bool = false + yyq535[0] = x.Medium != "" + var yynn535 int + if yyr535 || yy2arr535 { r.EncodeArrayStart(1) } else { - yynn523 = 0 - for _, b := range yyq523 { + yynn535 = 0 + for _, b := range yyq535 { if b { - yynn523++ + yynn535++ } } - r.EncodeMapStart(yynn523) - yynn523 = 0 + r.EncodeMapStart(yynn535) + yynn535 = 0 } - if yyr523 || yy2arr523 { + if yyr535 || yy2arr535 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq523[0] { + if yyq535[0] { x.Medium.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq523[0] { + if yyq535[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("medium")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Medium.CodecEncodeSelf(e) } } - if yyr523 || yy2arr523 { + if yyr535 || yy2arr535 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8206,25 +8470,25 @@ func (x *EmptyDirVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym525 := z.DecBinary() - _ = yym525 + yym537 := z.DecBinary() + _ = yym537 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct526 := r.ContainerType() - if yyct526 == codecSelferValueTypeMap1234 { - yyl526 := r.ReadMapStart() - if yyl526 == 0 { + yyct538 := r.ContainerType() + if yyct538 == codecSelferValueTypeMap1234 { + yyl538 := r.ReadMapStart() + if yyl538 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl526, d) + x.codecDecodeSelfFromMap(yyl538, d) } - } else if yyct526 == codecSelferValueTypeArray1234 { - yyl526 := r.ReadArrayStart() - if yyl526 == 0 { + } else if yyct538 == codecSelferValueTypeArray1234 { + yyl538 := r.ReadArrayStart() + if yyl538 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl526, d) + x.codecDecodeSelfFromArray(yyl538, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8236,12 +8500,12 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys527Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys527Slc - var yyhl527 bool = l >= 0 - for yyj527 := 0; ; yyj527++ { - if yyhl527 { - if yyj527 >= l { + var yys539Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys539Slc + var yyhl539 bool = l >= 0 + for yyj539 := 0; ; yyj539++ { + if yyhl539 { + if yyj539 >= l { break } } else { @@ -8250,10 +8514,10 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys527Slc = r.DecodeBytes(yys527Slc, true, true) - yys527 := string(yys527Slc) + yys539Slc = r.DecodeBytes(yys539Slc, true, true) + yys539 := string(yys539Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys527 { + switch yys539 { case "medium": if r.TryDecodeAsNil() { x.Medium = "" @@ -8261,9 +8525,9 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Medium = StorageMedium(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys527) - } // end switch yys527 - } // end for yyj527 + z.DecStructFieldNotFound(-1, yys539) + } // end switch yys539 + } // end for yyj539 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8271,16 +8535,16 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj529 int - var yyb529 bool - var yyhl529 bool = l >= 0 - yyj529++ - if yyhl529 { - yyb529 = yyj529 > l + var yyj541 int + var yyb541 bool + var yyhl541 bool = l >= 0 + yyj541++ + if yyhl541 { + yyb541 = yyj541 > l } else { - yyb529 = r.CheckBreak() + yyb541 = r.CheckBreak() } - if yyb529 { + if yyb541 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8291,17 +8555,17 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Medium = StorageMedium(r.DecodeString()) } for { - yyj529++ - if yyhl529 { - yyb529 = yyj529 > l + yyj541++ + if yyhl541 { + yyb541 = yyj541 > l } else { - yyb529 = r.CheckBreak() + yyb541 = r.CheckBreak() } - if yyb529 { + if yyb541 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj529-1, "") + z.DecStructFieldNotFound(yyj541-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8310,8 +8574,8 @@ func (x StorageMedium) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym531 := z.EncBinary() - _ = yym531 + yym543 := z.EncBinary() + _ = yym543 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -8323,8 +8587,8 @@ func (x *StorageMedium) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym532 := z.DecBinary() - _ = yym532 + yym544 := z.DecBinary() + _ = yym544 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -8336,8 +8600,8 @@ func (x Protocol) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym533 := z.EncBinary() - _ = yym533 + yym545 := z.EncBinary() + _ = yym545 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -8349,8 +8613,8 @@ func (x *Protocol) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym534 := z.DecBinary() - _ = yym534 + yym546 := z.DecBinary() + _ = yym546 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -8365,36 +8629,36 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym535 := z.EncBinary() - _ = yym535 + yym547 := z.EncBinary() + _ = yym547 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep536 := !z.EncBinary() - yy2arr536 := z.EncBasicHandle().StructToArray - var yyq536 [4]bool - _, _, _ = yysep536, yyq536, yy2arr536 - const yyr536 bool = false - yyq536[1] = x.FSType != "" - yyq536[2] = x.Partition != 0 - yyq536[3] = x.ReadOnly != false - var yynn536 int - if yyr536 || yy2arr536 { + yysep548 := !z.EncBinary() + yy2arr548 := z.EncBasicHandle().StructToArray + var yyq548 [4]bool + _, _, _ = yysep548, yyq548, yy2arr548 + const yyr548 bool = false + yyq548[1] = x.FSType != "" + yyq548[2] = x.Partition != 0 + yyq548[3] = x.ReadOnly != false + var yynn548 int + if yyr548 || yy2arr548 { r.EncodeArrayStart(4) } else { - yynn536 = 1 - for _, b := range yyq536 { + yynn548 = 1 + for _, b := range yyq548 { if b { - yynn536++ + yynn548++ } } - r.EncodeMapStart(yynn536) - yynn536 = 0 + r.EncodeMapStart(yynn548) + yynn548 = 0 } - if yyr536 || yy2arr536 { + if yyr548 || yy2arr548 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym538 := z.EncBinary() - _ = yym538 + yym550 := z.EncBinary() + _ = yym550 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PDName)) @@ -8403,18 +8667,18 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("pdName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym539 := z.EncBinary() - _ = yym539 + yym551 := z.EncBinary() + _ = yym551 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PDName)) } } - if yyr536 || yy2arr536 { + if yyr548 || yy2arr548 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq536[1] { - yym541 := z.EncBinary() - _ = yym541 + if yyq548[1] { + yym553 := z.EncBinary() + _ = yym553 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -8423,23 +8687,23 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq536[1] { + if yyq548[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym542 := z.EncBinary() - _ = yym542 + yym554 := z.EncBinary() + _ = yym554 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr536 || yy2arr536 { + if yyr548 || yy2arr548 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq536[2] { - yym544 := z.EncBinary() - _ = yym544 + if yyq548[2] { + yym556 := z.EncBinary() + _ = yym556 if false { } else { r.EncodeInt(int64(x.Partition)) @@ -8448,23 +8712,23 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq536[2] { + if yyq548[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("partition")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym545 := z.EncBinary() - _ = yym545 + yym557 := z.EncBinary() + _ = yym557 if false { } else { r.EncodeInt(int64(x.Partition)) } } } - if yyr536 || yy2arr536 { + if yyr548 || yy2arr548 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq536[3] { - yym547 := z.EncBinary() - _ = yym547 + if yyq548[3] { + yym559 := z.EncBinary() + _ = yym559 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -8473,19 +8737,19 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq536[3] { + if yyq548[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym548 := z.EncBinary() - _ = yym548 + yym560 := z.EncBinary() + _ = yym560 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr536 || yy2arr536 { + if yyr548 || yy2arr548 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8498,25 +8762,25 @@ func (x *GCEPersistentDiskVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym549 := z.DecBinary() - _ = yym549 + yym561 := z.DecBinary() + _ = yym561 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct550 := r.ContainerType() - if yyct550 == codecSelferValueTypeMap1234 { - yyl550 := r.ReadMapStart() - if yyl550 == 0 { + yyct562 := r.ContainerType() + if yyct562 == codecSelferValueTypeMap1234 { + yyl562 := r.ReadMapStart() + if yyl562 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl550, d) + x.codecDecodeSelfFromMap(yyl562, d) } - } else if yyct550 == codecSelferValueTypeArray1234 { - yyl550 := r.ReadArrayStart() - if yyl550 == 0 { + } else if yyct562 == codecSelferValueTypeArray1234 { + yyl562 := r.ReadArrayStart() + if yyl562 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl550, d) + x.codecDecodeSelfFromArray(yyl562, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8528,12 +8792,12 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys551Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys551Slc - var yyhl551 bool = l >= 0 - for yyj551 := 0; ; yyj551++ { - if yyhl551 { - if yyj551 >= l { + var yys563Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys563Slc + var yyhl563 bool = l >= 0 + for yyj563 := 0; ; yyj563++ { + if yyhl563 { + if yyj563 >= l { break } } else { @@ -8542,10 +8806,10 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys551Slc = r.DecodeBytes(yys551Slc, true, true) - yys551 := string(yys551Slc) + yys563Slc = r.DecodeBytes(yys563Slc, true, true) + yys563 := string(yys563Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys551 { + switch yys563 { case "pdName": if r.TryDecodeAsNil() { x.PDName = "" @@ -8571,9 +8835,9 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys551) - } // end switch yys551 - } // end for yyj551 + z.DecStructFieldNotFound(-1, yys563) + } // end switch yys563 + } // end for yyj563 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8581,16 +8845,16 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj556 int - var yyb556 bool - var yyhl556 bool = l >= 0 - yyj556++ - if yyhl556 { - yyb556 = yyj556 > l + var yyj568 int + var yyb568 bool + var yyhl568 bool = l >= 0 + yyj568++ + if yyhl568 { + yyb568 = yyj568 > l } else { - yyb556 = r.CheckBreak() + yyb568 = r.CheckBreak() } - if yyb556 { + if yyb568 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8600,13 +8864,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.PDName = string(r.DecodeString()) } - yyj556++ - if yyhl556 { - yyb556 = yyj556 > l + yyj568++ + if yyhl568 { + yyb568 = yyj568 > l } else { - yyb556 = r.CheckBreak() + yyb568 = r.CheckBreak() } - if yyb556 { + if yyb568 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8616,13 +8880,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.FSType = string(r.DecodeString()) } - yyj556++ - if yyhl556 { - yyb556 = yyj556 > l + yyj568++ + if yyhl568 { + yyb568 = yyj568 > l } else { - yyb556 = r.CheckBreak() + yyb568 = r.CheckBreak() } - if yyb556 { + if yyb568 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8632,13 +8896,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.Partition = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj556++ - if yyhl556 { - yyb556 = yyj556 > l + yyj568++ + if yyhl568 { + yyb568 = yyj568 > l } else { - yyb556 = r.CheckBreak() + yyb568 = r.CheckBreak() } - if yyb556 { + if yyb568 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8649,17 +8913,17 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec x.ReadOnly = bool(r.DecodeBool()) } for { - yyj556++ - if yyhl556 { - yyb556 = yyj556 > l + yyj568++ + if yyhl568 { + yyb568 = yyj568 > l } else { - yyb556 = r.CheckBreak() + yyb568 = r.CheckBreak() } - if yyb556 { + if yyb568 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj556-1, "") + z.DecStructFieldNotFound(yyj568-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8671,40 +8935,40 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym561 := z.EncBinary() - _ = yym561 + yym573 := z.EncBinary() + _ = yym573 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep562 := !z.EncBinary() - yy2arr562 := z.EncBasicHandle().StructToArray - var yyq562 [6]bool - _, _, _ = yysep562, yyq562, yy2arr562 - const yyr562 bool = false - yyq562[0] = x.TargetPortal != "" - yyq562[1] = x.IQN != "" - yyq562[2] = x.Lun != 0 - yyq562[3] = x.ISCSIInterface != "" - yyq562[4] = x.FSType != "" - yyq562[5] = x.ReadOnly != false - var yynn562 int - if yyr562 || yy2arr562 { + yysep574 := !z.EncBinary() + yy2arr574 := z.EncBasicHandle().StructToArray + var yyq574 [6]bool + _, _, _ = yysep574, yyq574, yy2arr574 + const yyr574 bool = false + yyq574[0] = x.TargetPortal != "" + yyq574[1] = x.IQN != "" + yyq574[2] = x.Lun != 0 + yyq574[3] = x.ISCSIInterface != "" + yyq574[4] = x.FSType != "" + yyq574[5] = x.ReadOnly != false + var yynn574 int + if yyr574 || yy2arr574 { r.EncodeArrayStart(6) } else { - yynn562 = 0 - for _, b := range yyq562 { + yynn574 = 0 + for _, b := range yyq574 { if b { - yynn562++ + yynn574++ } } - r.EncodeMapStart(yynn562) - yynn562 = 0 + r.EncodeMapStart(yynn574) + yynn574 = 0 } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[0] { - yym564 := z.EncBinary() - _ = yym564 + if yyq574[0] { + yym576 := z.EncBinary() + _ = yym576 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TargetPortal)) @@ -8713,23 +8977,23 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq562[0] { + if yyq574[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("targetPortal")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym565 := z.EncBinary() - _ = yym565 + yym577 := z.EncBinary() + _ = yym577 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TargetPortal)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[1] { - yym567 := z.EncBinary() - _ = yym567 + if yyq574[1] { + yym579 := z.EncBinary() + _ = yym579 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IQN)) @@ -8738,23 +9002,23 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq562[1] { + if yyq574[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iqn")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym568 := z.EncBinary() - _ = yym568 + yym580 := z.EncBinary() + _ = yym580 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IQN)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[2] { - yym570 := z.EncBinary() - _ = yym570 + if yyq574[2] { + yym582 := z.EncBinary() + _ = yym582 if false { } else { r.EncodeInt(int64(x.Lun)) @@ -8763,23 +9027,23 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq562[2] { + if yyq574[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lun")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym571 := z.EncBinary() - _ = yym571 + yym583 := z.EncBinary() + _ = yym583 if false { } else { r.EncodeInt(int64(x.Lun)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[3] { - yym573 := z.EncBinary() - _ = yym573 + if yyq574[3] { + yym585 := z.EncBinary() + _ = yym585 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ISCSIInterface)) @@ -8788,23 +9052,23 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq562[3] { + if yyq574[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsiInterface")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym574 := z.EncBinary() - _ = yym574 + yym586 := z.EncBinary() + _ = yym586 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ISCSIInterface)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[4] { - yym576 := z.EncBinary() - _ = yym576 + if yyq574[4] { + yym588 := z.EncBinary() + _ = yym588 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -8813,23 +9077,23 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq562[4] { + if yyq574[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym577 := z.EncBinary() - _ = yym577 + yym589 := z.EncBinary() + _ = yym589 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq562[5] { - yym579 := z.EncBinary() - _ = yym579 + if yyq574[5] { + yym591 := z.EncBinary() + _ = yym591 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -8838,19 +9102,19 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq562[5] { + if yyq574[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym580 := z.EncBinary() - _ = yym580 + yym592 := z.EncBinary() + _ = yym592 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr562 || yy2arr562 { + if yyr574 || yy2arr574 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8863,25 +9127,25 @@ func (x *ISCSIVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym581 := z.DecBinary() - _ = yym581 + yym593 := z.DecBinary() + _ = yym593 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct582 := r.ContainerType() - if yyct582 == codecSelferValueTypeMap1234 { - yyl582 := r.ReadMapStart() - if yyl582 == 0 { + yyct594 := r.ContainerType() + if yyct594 == codecSelferValueTypeMap1234 { + yyl594 := r.ReadMapStart() + if yyl594 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl582, d) + x.codecDecodeSelfFromMap(yyl594, d) } - } else if yyct582 == codecSelferValueTypeArray1234 { - yyl582 := r.ReadArrayStart() - if yyl582 == 0 { + } else if yyct594 == codecSelferValueTypeArray1234 { + yyl594 := r.ReadArrayStart() + if yyl594 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl582, d) + x.codecDecodeSelfFromArray(yyl594, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8893,12 +9157,12 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys583Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys583Slc - var yyhl583 bool = l >= 0 - for yyj583 := 0; ; yyj583++ { - if yyhl583 { - if yyj583 >= l { + var yys595Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys595Slc + var yyhl595 bool = l >= 0 + for yyj595 := 0; ; yyj595++ { + if yyhl595 { + if yyj595 >= l { break } } else { @@ -8907,10 +9171,10 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys583Slc = r.DecodeBytes(yys583Slc, true, true) - yys583 := string(yys583Slc) + yys595Slc = r.DecodeBytes(yys595Slc, true, true) + yys595 := string(yys595Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys583 { + switch yys595 { case "targetPortal": if r.TryDecodeAsNil() { x.TargetPortal = "" @@ -8948,9 +9212,9 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys583) - } // end switch yys583 - } // end for yyj583 + z.DecStructFieldNotFound(-1, yys595) + } // end switch yys595 + } // end for yyj595 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8958,16 +9222,16 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj590 int - var yyb590 bool - var yyhl590 bool = l >= 0 - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + var yyj602 int + var yyb602 bool + var yyhl602 bool = l >= 0 + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8977,13 +9241,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.TargetPortal = string(r.DecodeString()) } - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8993,13 +9257,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.IQN = string(r.DecodeString()) } - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9009,13 +9273,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.Lun = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9025,13 +9289,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.ISCSIInterface = string(r.DecodeString()) } - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9041,13 +9305,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.FSType = string(r.DecodeString()) } - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9058,17 +9322,17 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder x.ReadOnly = bool(r.DecodeBool()) } for { - yyj590++ - if yyhl590 { - yyb590 = yyj590 > l + yyj602++ + if yyhl602 { + yyb602 = yyj602 > l } else { - yyb590 = r.CheckBreak() + yyb602 = r.CheckBreak() } - if yyb590 { + if yyb602 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj590-1, "") + z.DecStructFieldNotFound(yyj602-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9080,37 +9344,38 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym597 := z.EncBinary() - _ = yym597 + yym609 := z.EncBinary() + _ = yym609 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep598 := !z.EncBinary() - yy2arr598 := z.EncBasicHandle().StructToArray - var yyq598 [4]bool - _, _, _ = yysep598, yyq598, yy2arr598 - const yyr598 bool = false - yyq598[3] = x.ReadOnly != false - var yynn598 int - if yyr598 || yy2arr598 { + yysep610 := !z.EncBinary() + yy2arr610 := z.EncBasicHandle().StructToArray + var yyq610 [4]bool + _, _, _ = yysep610, yyq610, yy2arr610 + const yyr610 bool = false + yyq610[2] = x.FSType != "" + yyq610[3] = x.ReadOnly != false + var yynn610 int + if yyr610 || yy2arr610 { r.EncodeArrayStart(4) } else { - yynn598 = 3 - for _, b := range yyq598 { + yynn610 = 2 + for _, b := range yyq610 { if b { - yynn598++ + yynn610++ } } - r.EncodeMapStart(yynn598) - yynn598 = 0 + r.EncodeMapStart(yynn610) + yynn610 = 0 } - if yyr598 || yy2arr598 { + if yyr610 || yy2arr610 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TargetWWNs == nil { r.EncodeNil() } else { - yym600 := z.EncBinary() - _ = yym600 + yym612 := z.EncBinary() + _ = yym612 if false { } else { z.F.EncSliceStringV(x.TargetWWNs, false, e) @@ -9123,25 +9388,25 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.TargetWWNs == nil { r.EncodeNil() } else { - yym601 := z.EncBinary() - _ = yym601 + yym613 := z.EncBinary() + _ = yym613 if false { } else { z.F.EncSliceStringV(x.TargetWWNs, false, e) } } } - if yyr598 || yy2arr598 { + if yyr610 || yy2arr610 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Lun == nil { r.EncodeNil() } else { - yy603 := *x.Lun - yym604 := z.EncBinary() - _ = yym604 + yy615 := *x.Lun + yym616 := z.EncBinary() + _ = yym616 if false { } else { - r.EncodeInt(int64(yy603)) + r.EncodeInt(int64(yy615)) } } } else { @@ -9151,39 +9416,45 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.Lun == nil { r.EncodeNil() } else { - yy605 := *x.Lun - yym606 := z.EncBinary() - _ = yym606 + yy617 := *x.Lun + yym618 := z.EncBinary() + _ = yym618 if false { } else { - r.EncodeInt(int64(yy605)) + r.EncodeInt(int64(yy617)) } } } - if yyr598 || yy2arr598 { + if yyr610 || yy2arr610 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym608 := z.EncBinary() - _ = yym608 - if false { + if yyq610[2] { + yym620 := z.EncBinary() + _ = yym620 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + r.EncodeString(codecSelferC_UTF81234, "") } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fsType")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym609 := z.EncBinary() - _ = yym609 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + if yyq610[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fsType")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym621 := z.EncBinary() + _ = yym621 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } } - if yyr598 || yy2arr598 { + if yyr610 || yy2arr610 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq598[3] { - yym611 := z.EncBinary() - _ = yym611 + if yyq610[3] { + yym623 := z.EncBinary() + _ = yym623 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -9192,19 +9463,19 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq598[3] { + if yyq610[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym612 := z.EncBinary() - _ = yym612 + yym624 := z.EncBinary() + _ = yym624 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr598 || yy2arr598 { + if yyr610 || yy2arr610 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9217,25 +9488,25 @@ func (x *FCVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym613 := z.DecBinary() - _ = yym613 + yym625 := z.DecBinary() + _ = yym625 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct614 := r.ContainerType() - if yyct614 == codecSelferValueTypeMap1234 { - yyl614 := r.ReadMapStart() - if yyl614 == 0 { + yyct626 := r.ContainerType() + if yyct626 == codecSelferValueTypeMap1234 { + yyl626 := r.ReadMapStart() + if yyl626 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl614, d) + x.codecDecodeSelfFromMap(yyl626, d) } - } else if yyct614 == codecSelferValueTypeArray1234 { - yyl614 := r.ReadArrayStart() - if yyl614 == 0 { + } else if yyct626 == codecSelferValueTypeArray1234 { + yyl626 := r.ReadArrayStart() + if yyl626 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl614, d) + x.codecDecodeSelfFromArray(yyl626, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9247,12 +9518,12 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys615Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys615Slc - var yyhl615 bool = l >= 0 - for yyj615 := 0; ; yyj615++ { - if yyhl615 { - if yyj615 >= l { + var yys627Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys627Slc + var yyhl627 bool = l >= 0 + for yyj627 := 0; ; yyj627++ { + if yyhl627 { + if yyj627 >= l { break } } else { @@ -9261,20 +9532,20 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys615Slc = r.DecodeBytes(yys615Slc, true, true) - yys615 := string(yys615Slc) + yys627Slc = r.DecodeBytes(yys627Slc, true, true) + yys627 := string(yys627Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys615 { + switch yys627 { case "targetWWNs": if r.TryDecodeAsNil() { x.TargetWWNs = nil } else { - yyv616 := &x.TargetWWNs - yym617 := z.DecBinary() - _ = yym617 + yyv628 := &x.TargetWWNs + yym629 := z.DecBinary() + _ = yym629 if false { } else { - z.F.DecSliceStringX(yyv616, false, d) + z.F.DecSliceStringX(yyv628, false, d) } } case "lun": @@ -9286,8 +9557,8 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Lun == nil { x.Lun = new(int) } - yym619 := z.DecBinary() - _ = yym619 + yym631 := z.DecBinary() + _ = yym631 if false { } else { *((*int)(x.Lun)) = int(r.DecodeInt(codecSelferBitsize1234)) @@ -9306,9 +9577,9 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys615) - } // end switch yys615 - } // end for yyj615 + z.DecStructFieldNotFound(-1, yys627) + } // end switch yys627 + } // end for yyj627 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9316,16 +9587,16 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj622 int - var yyb622 bool - var yyhl622 bool = l >= 0 - yyj622++ - if yyhl622 { - yyb622 = yyj622 > l + var yyj634 int + var yyb634 bool + var yyhl634 bool = l >= 0 + yyj634++ + if yyhl634 { + yyb634 = yyj634 > l } else { - yyb622 = r.CheckBreak() + yyb634 = r.CheckBreak() } - if yyb622 { + if yyb634 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9333,21 +9604,21 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetWWNs = nil } else { - yyv623 := &x.TargetWWNs - yym624 := z.DecBinary() - _ = yym624 + yyv635 := &x.TargetWWNs + yym636 := z.DecBinary() + _ = yym636 if false { } else { - z.F.DecSliceStringX(yyv623, false, d) + z.F.DecSliceStringX(yyv635, false, d) } } - yyj622++ - if yyhl622 { - yyb622 = yyj622 > l + yyj634++ + if yyhl634 { + yyb634 = yyj634 > l } else { - yyb622 = r.CheckBreak() + yyb634 = r.CheckBreak() } - if yyb622 { + if yyb634 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9360,20 +9631,20 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Lun == nil { x.Lun = new(int) } - yym626 := z.DecBinary() - _ = yym626 + yym638 := z.DecBinary() + _ = yym638 if false { } else { *((*int)(x.Lun)) = int(r.DecodeInt(codecSelferBitsize1234)) } } - yyj622++ - if yyhl622 { - yyb622 = yyj622 > l + yyj634++ + if yyhl634 { + yyb634 = yyj634 > l } else { - yyb622 = r.CheckBreak() + yyb634 = r.CheckBreak() } - if yyb622 { + if yyb634 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9383,13 +9654,13 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.FSType = string(r.DecodeString()) } - yyj622++ - if yyhl622 { - yyb622 = yyj622 > l + yyj634++ + if yyhl634 { + yyb634 = yyj634 > l } else { - yyb622 = r.CheckBreak() + yyb634 = r.CheckBreak() } - if yyb622 { + if yyb634 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9400,17 +9671,17 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } for { - yyj622++ - if yyhl622 { - yyb622 = yyj622 > l + yyj634++ + if yyhl634 { + yyb634 = yyj634 > l } else { - yyb622 = r.CheckBreak() + yyb634 = r.CheckBreak() } - if yyb622 { + if yyb634 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj622-1, "") + z.DecStructFieldNotFound(yyj634-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9422,37 +9693,37 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym629 := z.EncBinary() - _ = yym629 + yym641 := z.EncBinary() + _ = yym641 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep630 := !z.EncBinary() - yy2arr630 := z.EncBasicHandle().StructToArray - var yyq630 [5]bool - _, _, _ = yysep630, yyq630, yy2arr630 - const yyr630 bool = false - yyq630[1] = x.FSType != "" - yyq630[2] = x.SecretRef != nil - yyq630[3] = x.ReadOnly != false - yyq630[4] = len(x.Options) != 0 - var yynn630 int - if yyr630 || yy2arr630 { + yysep642 := !z.EncBinary() + yy2arr642 := z.EncBasicHandle().StructToArray + var yyq642 [5]bool + _, _, _ = yysep642, yyq642, yy2arr642 + const yyr642 bool = false + yyq642[1] = x.FSType != "" + yyq642[2] = x.SecretRef != nil + yyq642[3] = x.ReadOnly != false + yyq642[4] = len(x.Options) != 0 + var yynn642 int + if yyr642 || yy2arr642 { r.EncodeArrayStart(5) } else { - yynn630 = 1 - for _, b := range yyq630 { + yynn642 = 1 + for _, b := range yyq642 { if b { - yynn630++ + yynn642++ } } - r.EncodeMapStart(yynn630) - yynn630 = 0 + r.EncodeMapStart(yynn642) + yynn642 = 0 } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym632 := z.EncBinary() - _ = yym632 + yym644 := z.EncBinary() + _ = yym644 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Driver)) @@ -9461,18 +9732,18 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("driver")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym633 := z.EncBinary() - _ = yym633 + yym645 := z.EncBinary() + _ = yym645 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Driver)) } } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq630[1] { - yym635 := z.EncBinary() - _ = yym635 + if yyq642[1] { + yym647 := z.EncBinary() + _ = yym647 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -9481,21 +9752,21 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq630[1] { + if yyq642[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym636 := z.EncBinary() - _ = yym636 + yym648 := z.EncBinary() + _ = yym648 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq630[2] { + if yyq642[2] { if x.SecretRef == nil { r.EncodeNil() } else { @@ -9505,7 +9776,7 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq630[2] { + if yyq642[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -9516,11 +9787,11 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq630[3] { - yym639 := z.EncBinary() - _ = yym639 + if yyq642[3] { + yym651 := z.EncBinary() + _ = yym651 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -9529,26 +9800,26 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq630[3] { + if yyq642[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym640 := z.EncBinary() - _ = yym640 + yym652 := z.EncBinary() + _ = yym652 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq630[4] { + if yyq642[4] { if x.Options == nil { r.EncodeNil() } else { - yym642 := z.EncBinary() - _ = yym642 + yym654 := z.EncBinary() + _ = yym654 if false { } else { z.F.EncMapStringStringV(x.Options, false, e) @@ -9558,15 +9829,15 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq630[4] { + if yyq642[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("options")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Options == nil { r.EncodeNil() } else { - yym643 := z.EncBinary() - _ = yym643 + yym655 := z.EncBinary() + _ = yym655 if false { } else { z.F.EncMapStringStringV(x.Options, false, e) @@ -9574,7 +9845,7 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr630 || yy2arr630 { + if yyr642 || yy2arr642 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9587,25 +9858,25 @@ func (x *FlexVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym644 := z.DecBinary() - _ = yym644 + yym656 := z.DecBinary() + _ = yym656 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct645 := r.ContainerType() - if yyct645 == codecSelferValueTypeMap1234 { - yyl645 := r.ReadMapStart() - if yyl645 == 0 { + yyct657 := r.ContainerType() + if yyct657 == codecSelferValueTypeMap1234 { + yyl657 := r.ReadMapStart() + if yyl657 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl645, d) + x.codecDecodeSelfFromMap(yyl657, d) } - } else if yyct645 == codecSelferValueTypeArray1234 { - yyl645 := r.ReadArrayStart() - if yyl645 == 0 { + } else if yyct657 == codecSelferValueTypeArray1234 { + yyl657 := r.ReadArrayStart() + if yyl657 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl645, d) + x.codecDecodeSelfFromArray(yyl657, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9617,12 +9888,12 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys646Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys646Slc - var yyhl646 bool = l >= 0 - for yyj646 := 0; ; yyj646++ { - if yyhl646 { - if yyj646 >= l { + var yys658Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys658Slc + var yyhl658 bool = l >= 0 + for yyj658 := 0; ; yyj658++ { + if yyhl658 { + if yyj658 >= l { break } } else { @@ -9631,10 +9902,10 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys646Slc = r.DecodeBytes(yys646Slc, true, true) - yys646 := string(yys646Slc) + yys658Slc = r.DecodeBytes(yys658Slc, true, true) + yys658 := string(yys658Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys646 { + switch yys658 { case "driver": if r.TryDecodeAsNil() { x.Driver = "" @@ -9668,18 +9939,18 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Options = nil } else { - yyv651 := &x.Options - yym652 := z.DecBinary() - _ = yym652 + yyv663 := &x.Options + yym664 := z.DecBinary() + _ = yym664 if false { } else { - z.F.DecMapStringStringX(yyv651, false, d) + z.F.DecMapStringStringX(yyv663, false, d) } } default: - z.DecStructFieldNotFound(-1, yys646) - } // end switch yys646 - } // end for yyj646 + z.DecStructFieldNotFound(-1, yys658) + } // end switch yys658 + } // end for yyj658 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9687,16 +9958,16 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj653 int - var yyb653 bool - var yyhl653 bool = l >= 0 - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + var yyj665 int + var yyb665 bool + var yyhl665 bool = l >= 0 + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9706,13 +9977,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Driver = string(r.DecodeString()) } - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9722,13 +9993,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.FSType = string(r.DecodeString()) } - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9743,13 +10014,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SecretRef.CodecDecodeSelf(d) } - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9759,13 +10030,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ReadOnly = bool(r.DecodeBool()) } - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9773,26 +10044,26 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Options = nil } else { - yyv658 := &x.Options - yym659 := z.DecBinary() - _ = yym659 + yyv670 := &x.Options + yym671 := z.DecBinary() + _ = yym671 if false { } else { - z.F.DecMapStringStringX(yyv658, false, d) + z.F.DecMapStringStringX(yyv670, false, d) } } for { - yyj653++ - if yyhl653 { - yyb653 = yyj653 > l + yyj665++ + if yyhl665 { + yyb665 = yyj665 > l } else { - yyb653 = r.CheckBreak() + yyb665 = r.CheckBreak() } - if yyb653 { + if yyb665 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj653-1, "") + z.DecStructFieldNotFound(yyj665-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9804,36 +10075,36 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) if x == nil { r.EncodeNil() } else { - yym660 := z.EncBinary() - _ = yym660 + yym672 := z.EncBinary() + _ = yym672 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep661 := !z.EncBinary() - yy2arr661 := z.EncBasicHandle().StructToArray - var yyq661 [4]bool - _, _, _ = yysep661, yyq661, yy2arr661 - const yyr661 bool = false - yyq661[1] = x.FSType != "" - yyq661[2] = x.Partition != 0 - yyq661[3] = x.ReadOnly != false - var yynn661 int - if yyr661 || yy2arr661 { + yysep673 := !z.EncBinary() + yy2arr673 := z.EncBasicHandle().StructToArray + var yyq673 [4]bool + _, _, _ = yysep673, yyq673, yy2arr673 + const yyr673 bool = false + yyq673[1] = x.FSType != "" + yyq673[2] = x.Partition != 0 + yyq673[3] = x.ReadOnly != false + var yynn673 int + if yyr673 || yy2arr673 { r.EncodeArrayStart(4) } else { - yynn661 = 1 - for _, b := range yyq661 { + yynn673 = 1 + for _, b := range yyq673 { if b { - yynn661++ + yynn673++ } } - r.EncodeMapStart(yynn661) - yynn661 = 0 + r.EncodeMapStart(yynn673) + yynn673 = 0 } - if yyr661 || yy2arr661 { + if yyr673 || yy2arr673 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym663 := z.EncBinary() - _ = yym663 + yym675 := z.EncBinary() + _ = yym675 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) @@ -9842,18 +10113,18 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym664 := z.EncBinary() - _ = yym664 + yym676 := z.EncBinary() + _ = yym676 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) } } - if yyr661 || yy2arr661 { + if yyr673 || yy2arr673 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq661[1] { - yym666 := z.EncBinary() - _ = yym666 + if yyq673[1] { + yym678 := z.EncBinary() + _ = yym678 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -9862,23 +10133,23 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq661[1] { + if yyq673[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym667 := z.EncBinary() - _ = yym667 + yym679 := z.EncBinary() + _ = yym679 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr661 || yy2arr661 { + if yyr673 || yy2arr673 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq661[2] { - yym669 := z.EncBinary() - _ = yym669 + if yyq673[2] { + yym681 := z.EncBinary() + _ = yym681 if false { } else { r.EncodeInt(int64(x.Partition)) @@ -9887,23 +10158,23 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) r.EncodeInt(0) } } else { - if yyq661[2] { + if yyq673[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("partition")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym670 := z.EncBinary() - _ = yym670 + yym682 := z.EncBinary() + _ = yym682 if false { } else { r.EncodeInt(int64(x.Partition)) } } } - if yyr661 || yy2arr661 { + if yyr673 || yy2arr673 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq661[3] { - yym672 := z.EncBinary() - _ = yym672 + if yyq673[3] { + yym684 := z.EncBinary() + _ = yym684 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -9912,19 +10183,19 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) r.EncodeBool(false) } } else { - if yyq661[3] { + if yyq673[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym673 := z.EncBinary() - _ = yym673 + yym685 := z.EncBinary() + _ = yym685 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr661 || yy2arr661 { + if yyr673 || yy2arr673 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9937,25 +10208,25 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym674 := z.DecBinary() - _ = yym674 + yym686 := z.DecBinary() + _ = yym686 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct675 := r.ContainerType() - if yyct675 == codecSelferValueTypeMap1234 { - yyl675 := r.ReadMapStart() - if yyl675 == 0 { + yyct687 := r.ContainerType() + if yyct687 == codecSelferValueTypeMap1234 { + yyl687 := r.ReadMapStart() + if yyl687 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl675, d) + x.codecDecodeSelfFromMap(yyl687, d) } - } else if yyct675 == codecSelferValueTypeArray1234 { - yyl675 := r.ReadArrayStart() - if yyl675 == 0 { + } else if yyct687 == codecSelferValueTypeArray1234 { + yyl687 := r.ReadArrayStart() + if yyl687 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl675, d) + x.codecDecodeSelfFromArray(yyl687, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9967,12 +10238,12 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys676Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys676Slc - var yyhl676 bool = l >= 0 - for yyj676 := 0; ; yyj676++ { - if yyhl676 { - if yyj676 >= l { + var yys688Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys688Slc + var yyhl688 bool = l >= 0 + for yyj688 := 0; ; yyj688++ { + if yyhl688 { + if yyj688 >= l { break } } else { @@ -9981,10 +10252,10 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys676Slc = r.DecodeBytes(yys676Slc, true, true) - yys676 := string(yys676Slc) + yys688Slc = r.DecodeBytes(yys688Slc, true, true) + yys688 := string(yys688Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys676 { + switch yys688 { case "volumeID": if r.TryDecodeAsNil() { x.VolumeID = "" @@ -10010,9 +10281,9 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys676) - } // end switch yys676 - } // end for yyj676 + z.DecStructFieldNotFound(-1, yys688) + } // end switch yys688 + } // end for yyj688 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10020,16 +10291,16 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj681 int - var yyb681 bool - var yyhl681 bool = l >= 0 - yyj681++ - if yyhl681 { - yyb681 = yyj681 > l + var yyj693 int + var yyb693 bool + var yyhl693 bool = l >= 0 + yyj693++ + if yyhl693 { + yyb693 = yyj693 > l } else { - yyb681 = r.CheckBreak() + yyb693 = r.CheckBreak() } - if yyb681 { + if yyb693 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10039,13 +10310,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.VolumeID = string(r.DecodeString()) } - yyj681++ - if yyhl681 { - yyb681 = yyj681 > l + yyj693++ + if yyhl693 { + yyb693 = yyj693 > l } else { - yyb681 = r.CheckBreak() + yyb693 = r.CheckBreak() } - if yyb681 { + if yyb693 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10055,13 +10326,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.FSType = string(r.DecodeString()) } - yyj681++ - if yyhl681 { - yyb681 = yyj681 > l + yyj693++ + if yyhl693 { + yyb693 = yyj693 > l } else { - yyb681 = r.CheckBreak() + yyb693 = r.CheckBreak() } - if yyb681 { + if yyb693 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10071,13 +10342,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.Partition = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj681++ - if yyhl681 { - yyb681 = yyj681 > l + yyj693++ + if yyhl693 { + yyb693 = yyj693 > l } else { - yyb681 = r.CheckBreak() + yyb693 = r.CheckBreak() } - if yyb681 { + if yyb693 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10088,17 +10359,17 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co x.ReadOnly = bool(r.DecodeBool()) } for { - yyj681++ - if yyhl681 { - yyb681 = yyj681 > l + yyj693++ + if yyhl693 { + yyb693 = yyj693 > l } else { - yyb681 = r.CheckBreak() + yyb693 = r.CheckBreak() } - if yyb681 { + if yyb693 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj681-1, "") + z.DecStructFieldNotFound(yyj693-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10110,35 +10381,35 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym686 := z.EncBinary() - _ = yym686 + yym698 := z.EncBinary() + _ = yym698 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep687 := !z.EncBinary() - yy2arr687 := z.EncBasicHandle().StructToArray - var yyq687 [3]bool - _, _, _ = yysep687, yyq687, yy2arr687 - const yyr687 bool = false - yyq687[1] = x.Revision != "" - yyq687[2] = x.Directory != "" - var yynn687 int - if yyr687 || yy2arr687 { + yysep699 := !z.EncBinary() + yy2arr699 := z.EncBasicHandle().StructToArray + var yyq699 [3]bool + _, _, _ = yysep699, yyq699, yy2arr699 + const yyr699 bool = false + yyq699[1] = x.Revision != "" + yyq699[2] = x.Directory != "" + var yynn699 int + if yyr699 || yy2arr699 { r.EncodeArrayStart(3) } else { - yynn687 = 1 - for _, b := range yyq687 { + yynn699 = 1 + for _, b := range yyq699 { if b { - yynn687++ + yynn699++ } } - r.EncodeMapStart(yynn687) - yynn687 = 0 + r.EncodeMapStart(yynn699) + yynn699 = 0 } - if yyr687 || yy2arr687 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym689 := z.EncBinary() - _ = yym689 + yym701 := z.EncBinary() + _ = yym701 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Repository)) @@ -10147,18 +10418,18 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("repository")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym690 := z.EncBinary() - _ = yym690 + yym702 := z.EncBinary() + _ = yym702 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Repository)) } } - if yyr687 || yy2arr687 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq687[1] { - yym692 := z.EncBinary() - _ = yym692 + if yyq699[1] { + yym704 := z.EncBinary() + _ = yym704 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Revision)) @@ -10167,23 +10438,23 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq687[1] { + if yyq699[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("revision")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym693 := z.EncBinary() - _ = yym693 + yym705 := z.EncBinary() + _ = yym705 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Revision)) } } } - if yyr687 || yy2arr687 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq687[2] { - yym695 := z.EncBinary() - _ = yym695 + if yyq699[2] { + yym707 := z.EncBinary() + _ = yym707 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Directory)) @@ -10192,19 +10463,19 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq687[2] { + if yyq699[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("directory")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym696 := z.EncBinary() - _ = yym696 + yym708 := z.EncBinary() + _ = yym708 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Directory)) } } } - if yyr687 || yy2arr687 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10217,25 +10488,25 @@ func (x *GitRepoVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym697 := z.DecBinary() - _ = yym697 + yym709 := z.DecBinary() + _ = yym709 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct698 := r.ContainerType() - if yyct698 == codecSelferValueTypeMap1234 { - yyl698 := r.ReadMapStart() - if yyl698 == 0 { + yyct710 := r.ContainerType() + if yyct710 == codecSelferValueTypeMap1234 { + yyl710 := r.ReadMapStart() + if yyl710 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl698, d) + x.codecDecodeSelfFromMap(yyl710, d) } - } else if yyct698 == codecSelferValueTypeArray1234 { - yyl698 := r.ReadArrayStart() - if yyl698 == 0 { + } else if yyct710 == codecSelferValueTypeArray1234 { + yyl710 := r.ReadArrayStart() + if yyl710 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl698, d) + x.codecDecodeSelfFromArray(yyl710, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10247,12 +10518,12 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys699Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys699Slc - var yyhl699 bool = l >= 0 - for yyj699 := 0; ; yyj699++ { - if yyhl699 { - if yyj699 >= l { + var yys711Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys711Slc + var yyhl711 bool = l >= 0 + for yyj711 := 0; ; yyj711++ { + if yyhl711 { + if yyj711 >= l { break } } else { @@ -10261,10 +10532,10 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys699Slc = r.DecodeBytes(yys699Slc, true, true) - yys699 := string(yys699Slc) + yys711Slc = r.DecodeBytes(yys711Slc, true, true) + yys711 := string(yys711Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys699 { + switch yys711 { case "repository": if r.TryDecodeAsNil() { x.Repository = "" @@ -10284,9 +10555,9 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.Directory = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys699) - } // end switch yys699 - } // end for yyj699 + z.DecStructFieldNotFound(-1, yys711) + } // end switch yys711 + } // end for yyj711 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10294,16 +10565,16 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj703 int - var yyb703 bool - var yyhl703 bool = l >= 0 - yyj703++ - if yyhl703 { - yyb703 = yyj703 > l + var yyj715 int + var yyb715 bool + var yyhl715 bool = l >= 0 + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb703 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb703 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10313,13 +10584,13 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Repository = string(r.DecodeString()) } - yyj703++ - if yyhl703 { - yyb703 = yyj703 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb703 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb703 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10329,13 +10600,13 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Revision = string(r.DecodeString()) } - yyj703++ - if yyhl703 { - yyb703 = yyj703 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb703 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb703 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10346,17 +10617,17 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod x.Directory = string(r.DecodeString()) } for { - yyj703++ - if yyhl703 { - yyb703 = yyj703 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb703 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb703 { + if yyb715 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj703-1, "") + z.DecStructFieldNotFound(yyj715-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10368,35 +10639,35 @@ func (x *SecretVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym707 := z.EncBinary() - _ = yym707 + yym719 := z.EncBinary() + _ = yym719 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep708 := !z.EncBinary() - yy2arr708 := z.EncBasicHandle().StructToArray - var yyq708 [1]bool - _, _, _ = yysep708, yyq708, yy2arr708 - const yyr708 bool = false - yyq708[0] = x.SecretName != "" - var yynn708 int - if yyr708 || yy2arr708 { + yysep720 := !z.EncBinary() + yy2arr720 := z.EncBasicHandle().StructToArray + var yyq720 [1]bool + _, _, _ = yysep720, yyq720, yy2arr720 + const yyr720 bool = false + yyq720[0] = x.SecretName != "" + var yynn720 int + if yyr720 || yy2arr720 { r.EncodeArrayStart(1) } else { - yynn708 = 0 - for _, b := range yyq708 { + yynn720 = 0 + for _, b := range yyq720 { if b { - yynn708++ + yynn720++ } } - r.EncodeMapStart(yynn708) - yynn708 = 0 + r.EncodeMapStart(yynn720) + yynn720 = 0 } - if yyr708 || yy2arr708 { + if yyr720 || yy2arr720 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq708[0] { - yym710 := z.EncBinary() - _ = yym710 + if yyq720[0] { + yym722 := z.EncBinary() + _ = yym722 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) @@ -10405,19 +10676,19 @@ func (x *SecretVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq708[0] { + if yyq720[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym711 := z.EncBinary() - _ = yym711 + yym723 := z.EncBinary() + _ = yym723 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) } } } - if yyr708 || yy2arr708 { + if yyr720 || yy2arr720 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10430,25 +10701,25 @@ func (x *SecretVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym712 := z.DecBinary() - _ = yym712 + yym724 := z.DecBinary() + _ = yym724 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct713 := r.ContainerType() - if yyct713 == codecSelferValueTypeMap1234 { - yyl713 := r.ReadMapStart() - if yyl713 == 0 { + yyct725 := r.ContainerType() + if yyct725 == codecSelferValueTypeMap1234 { + yyl725 := r.ReadMapStart() + if yyl725 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl713, d) + x.codecDecodeSelfFromMap(yyl725, d) } - } else if yyct713 == codecSelferValueTypeArray1234 { - yyl713 := r.ReadArrayStart() - if yyl713 == 0 { + } else if yyct725 == codecSelferValueTypeArray1234 { + yyl725 := r.ReadArrayStart() + if yyl725 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl713, d) + x.codecDecodeSelfFromArray(yyl725, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10460,12 +10731,12 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys714Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys714Slc - var yyhl714 bool = l >= 0 - for yyj714 := 0; ; yyj714++ { - if yyhl714 { - if yyj714 >= l { + var yys726Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys726Slc + var yyhl726 bool = l >= 0 + for yyj726 := 0; ; yyj726++ { + if yyhl726 { + if yyj726 >= l { break } } else { @@ -10474,10 +10745,10 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys714Slc = r.DecodeBytes(yys714Slc, true, true) - yys714 := string(yys714Slc) + yys726Slc = r.DecodeBytes(yys726Slc, true, true) + yys726 := string(yys726Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys714 { + switch yys726 { case "secretName": if r.TryDecodeAsNil() { x.SecretName = "" @@ -10485,9 +10756,9 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.SecretName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys714) - } // end switch yys714 - } // end for yyj714 + z.DecStructFieldNotFound(-1, yys726) + } // end switch yys726 + } // end for yyj726 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10495,16 +10766,16 @@ func (x *SecretVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj716 int - var yyb716 bool - var yyhl716 bool = l >= 0 - yyj716++ - if yyhl716 { - yyb716 = yyj716 > l + var yyj728 int + var yyb728 bool + var yyhl728 bool = l >= 0 + yyj728++ + if yyhl728 { + yyb728 = yyj728 > l } else { - yyb716 = r.CheckBreak() + yyb728 = r.CheckBreak() } - if yyb716 { + if yyb728 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10515,17 +10786,17 @@ func (x *SecretVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.SecretName = string(r.DecodeString()) } for { - yyj716++ - if yyhl716 { - yyb716 = yyj716 > l + yyj728++ + if yyhl728 { + yyb728 = yyj728 > l } else { - yyb716 = r.CheckBreak() + yyb728 = r.CheckBreak() } - if yyb716 { + if yyb728 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj716-1, "") + z.DecStructFieldNotFound(yyj728-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10537,34 +10808,34 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym718 := z.EncBinary() - _ = yym718 + yym730 := z.EncBinary() + _ = yym730 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep719 := !z.EncBinary() - yy2arr719 := z.EncBasicHandle().StructToArray - var yyq719 [3]bool - _, _, _ = yysep719, yyq719, yy2arr719 - const yyr719 bool = false - yyq719[2] = x.ReadOnly != false - var yynn719 int - if yyr719 || yy2arr719 { + yysep731 := !z.EncBinary() + yy2arr731 := z.EncBasicHandle().StructToArray + var yyq731 [3]bool + _, _, _ = yysep731, yyq731, yy2arr731 + const yyr731 bool = false + yyq731[2] = x.ReadOnly != false + var yynn731 int + if yyr731 || yy2arr731 { r.EncodeArrayStart(3) } else { - yynn719 = 2 - for _, b := range yyq719 { + yynn731 = 2 + for _, b := range yyq731 { if b { - yynn719++ + yynn731++ } } - r.EncodeMapStart(yynn719) - yynn719 = 0 + r.EncodeMapStart(yynn731) + yynn731 = 0 } - if yyr719 || yy2arr719 { + if yyr731 || yy2arr731 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym721 := z.EncBinary() - _ = yym721 + yym733 := z.EncBinary() + _ = yym733 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Server)) @@ -10573,17 +10844,17 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("server")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym722 := z.EncBinary() - _ = yym722 + yym734 := z.EncBinary() + _ = yym734 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Server)) } } - if yyr719 || yy2arr719 { + if yyr731 || yy2arr731 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym724 := z.EncBinary() - _ = yym724 + yym736 := z.EncBinary() + _ = yym736 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -10592,18 +10863,18 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym725 := z.EncBinary() - _ = yym725 + yym737 := z.EncBinary() + _ = yym737 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr719 || yy2arr719 { + if yyr731 || yy2arr731 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq719[2] { - yym727 := z.EncBinary() - _ = yym727 + if yyq731[2] { + yym739 := z.EncBinary() + _ = yym739 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -10612,19 +10883,19 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq719[2] { + if yyq731[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym728 := z.EncBinary() - _ = yym728 + yym740 := z.EncBinary() + _ = yym740 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr719 || yy2arr719 { + if yyr731 || yy2arr731 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10637,25 +10908,25 @@ func (x *NFSVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym729 := z.DecBinary() - _ = yym729 + yym741 := z.DecBinary() + _ = yym741 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct730 := r.ContainerType() - if yyct730 == codecSelferValueTypeMap1234 { - yyl730 := r.ReadMapStart() - if yyl730 == 0 { + yyct742 := r.ContainerType() + if yyct742 == codecSelferValueTypeMap1234 { + yyl742 := r.ReadMapStart() + if yyl742 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl730, d) + x.codecDecodeSelfFromMap(yyl742, d) } - } else if yyct730 == codecSelferValueTypeArray1234 { - yyl730 := r.ReadArrayStart() - if yyl730 == 0 { + } else if yyct742 == codecSelferValueTypeArray1234 { + yyl742 := r.ReadArrayStart() + if yyl742 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl730, d) + x.codecDecodeSelfFromArray(yyl742, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10667,12 +10938,12 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys731Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys731Slc - var yyhl731 bool = l >= 0 - for yyj731 := 0; ; yyj731++ { - if yyhl731 { - if yyj731 >= l { + var yys743Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys743Slc + var yyhl743 bool = l >= 0 + for yyj743 := 0; ; yyj743++ { + if yyhl743 { + if yyj743 >= l { break } } else { @@ -10681,10 +10952,10 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys731Slc = r.DecodeBytes(yys731Slc, true, true) - yys731 := string(yys731Slc) + yys743Slc = r.DecodeBytes(yys743Slc, true, true) + yys743 := string(yys743Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys731 { + switch yys743 { case "server": if r.TryDecodeAsNil() { x.Server = "" @@ -10704,9 +10975,9 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys731) - } // end switch yys731 - } // end for yyj731 + z.DecStructFieldNotFound(-1, yys743) + } // end switch yys743 + } // end for yyj743 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10714,16 +10985,16 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj735 int - var yyb735 bool - var yyhl735 bool = l >= 0 - yyj735++ - if yyhl735 { - yyb735 = yyj735 > l + var yyj747 int + var yyb747 bool + var yyhl747 bool = l >= 0 + yyj747++ + if yyhl747 { + yyb747 = yyj747 > l } else { - yyb735 = r.CheckBreak() + yyb747 = r.CheckBreak() } - if yyb735 { + if yyb747 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10733,13 +11004,13 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Server = string(r.DecodeString()) } - yyj735++ - if yyhl735 { - yyb735 = yyj735 > l + yyj747++ + if yyhl747 { + yyb747 = yyj747 > l } else { - yyb735 = r.CheckBreak() + yyb747 = r.CheckBreak() } - if yyb735 { + if yyb747 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10749,13 +11020,13 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } - yyj735++ - if yyhl735 { - yyb735 = yyj735 > l + yyj747++ + if yyhl747 { + yyb747 = yyj747 > l } else { - yyb735 = r.CheckBreak() + yyb747 = r.CheckBreak() } - if yyb735 { + if yyb747 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10766,17 +11037,17 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } for { - yyj735++ - if yyhl735 { - yyb735 = yyj735 > l + yyj747++ + if yyhl747 { + yyb747 = yyj747 > l } else { - yyb735 = r.CheckBreak() + yyb747 = r.CheckBreak() } - if yyb735 { + if yyb747 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj735-1, "") + z.DecStructFieldNotFound(yyj747-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10788,34 +11059,34 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym739 := z.EncBinary() - _ = yym739 + yym751 := z.EncBinary() + _ = yym751 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep740 := !z.EncBinary() - yy2arr740 := z.EncBasicHandle().StructToArray - var yyq740 [3]bool - _, _, _ = yysep740, yyq740, yy2arr740 - const yyr740 bool = false - yyq740[2] = x.ReadOnly != false - var yynn740 int - if yyr740 || yy2arr740 { + yysep752 := !z.EncBinary() + yy2arr752 := z.EncBasicHandle().StructToArray + var yyq752 [3]bool + _, _, _ = yysep752, yyq752, yy2arr752 + const yyr752 bool = false + yyq752[2] = x.ReadOnly != false + var yynn752 int + if yyr752 || yy2arr752 { r.EncodeArrayStart(3) } else { - yynn740 = 2 - for _, b := range yyq740 { + yynn752 = 2 + for _, b := range yyq752 { if b { - yynn740++ + yynn752++ } } - r.EncodeMapStart(yynn740) - yynn740 = 0 + r.EncodeMapStart(yynn752) + yynn752 = 0 } - if yyr740 || yy2arr740 { + if yyr752 || yy2arr752 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym742 := z.EncBinary() - _ = yym742 + yym754 := z.EncBinary() + _ = yym754 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.EndpointsName)) @@ -10824,17 +11095,17 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("endpoints")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym743 := z.EncBinary() - _ = yym743 + yym755 := z.EncBinary() + _ = yym755 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.EndpointsName)) } } - if yyr740 || yy2arr740 { + if yyr752 || yy2arr752 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym745 := z.EncBinary() - _ = yym745 + yym757 := z.EncBinary() + _ = yym757 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -10843,18 +11114,18 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym746 := z.EncBinary() - _ = yym746 + yym758 := z.EncBinary() + _ = yym758 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr740 || yy2arr740 { + if yyr752 || yy2arr752 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq740[2] { - yym748 := z.EncBinary() - _ = yym748 + if yyq752[2] { + yym760 := z.EncBinary() + _ = yym760 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -10863,19 +11134,19 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq740[2] { + if yyq752[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym749 := z.EncBinary() - _ = yym749 + yym761 := z.EncBinary() + _ = yym761 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr740 || yy2arr740 { + if yyr752 || yy2arr752 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10888,25 +11159,25 @@ func (x *GlusterfsVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym750 := z.DecBinary() - _ = yym750 + yym762 := z.DecBinary() + _ = yym762 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct751 := r.ContainerType() - if yyct751 == codecSelferValueTypeMap1234 { - yyl751 := r.ReadMapStart() - if yyl751 == 0 { + yyct763 := r.ContainerType() + if yyct763 == codecSelferValueTypeMap1234 { + yyl763 := r.ReadMapStart() + if yyl763 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl751, d) + x.codecDecodeSelfFromMap(yyl763, d) } - } else if yyct751 == codecSelferValueTypeArray1234 { - yyl751 := r.ReadArrayStart() - if yyl751 == 0 { + } else if yyct763 == codecSelferValueTypeArray1234 { + yyl763 := r.ReadArrayStart() + if yyl763 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl751, d) + x.codecDecodeSelfFromArray(yyl763, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10918,12 +11189,12 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys752Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys752Slc - var yyhl752 bool = l >= 0 - for yyj752 := 0; ; yyj752++ { - if yyhl752 { - if yyj752 >= l { + var yys764Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys764Slc + var yyhl764 bool = l >= 0 + for yyj764 := 0; ; yyj764++ { + if yyhl764 { + if yyj764 >= l { break } } else { @@ -10932,10 +11203,10 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys752Slc = r.DecodeBytes(yys752Slc, true, true) - yys752 := string(yys752Slc) + yys764Slc = r.DecodeBytes(yys764Slc, true, true) + yys764 := string(yys764Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys752 { + switch yys764 { case "endpoints": if r.TryDecodeAsNil() { x.EndpointsName = "" @@ -10955,9 +11226,9 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys752) - } // end switch yys752 - } // end for yyj752 + z.DecStructFieldNotFound(-1, yys764) + } // end switch yys764 + } // end for yyj764 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10965,16 +11236,16 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj756 int - var yyb756 bool - var yyhl756 bool = l >= 0 - yyj756++ - if yyhl756 { - yyb756 = yyj756 > l + var yyj768 int + var yyb768 bool + var yyhl768 bool = l >= 0 + yyj768++ + if yyhl768 { + yyb768 = yyj768 > l } else { - yyb756 = r.CheckBreak() + yyb768 = r.CheckBreak() } - if yyb756 { + if yyb768 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10984,13 +11255,13 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.EndpointsName = string(r.DecodeString()) } - yyj756++ - if yyhl756 { - yyb756 = yyj756 > l + yyj768++ + if yyhl768 { + yyb768 = yyj768 > l } else { - yyb756 = r.CheckBreak() + yyb768 = r.CheckBreak() } - if yyb756 { + if yyb768 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11000,13 +11271,13 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Path = string(r.DecodeString()) } - yyj756++ - if yyhl756 { - yyb756 = yyj756 > l + yyj768++ + if yyhl768 { + yyb768 = yyj768 > l } else { - yyb756 = r.CheckBreak() + yyb768 = r.CheckBreak() } - if yyb756 { + if yyb768 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11017,17 +11288,17 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec x.ReadOnly = bool(r.DecodeBool()) } for { - yyj756++ - if yyhl756 { - yyb756 = yyj756 > l + yyj768++ + if yyhl768 { + yyb768 = yyj768 > l } else { - yyb756 = r.CheckBreak() + yyb768 = r.CheckBreak() } - if yyb756 { + if yyb768 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj756-1, "") + z.DecStructFieldNotFound(yyj768-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11039,38 +11310,38 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym760 := z.EncBinary() - _ = yym760 + yym772 := z.EncBinary() + _ = yym772 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep761 := !z.EncBinary() - yy2arr761 := z.EncBasicHandle().StructToArray - var yyq761 [8]bool - _, _, _ = yysep761, yyq761, yy2arr761 - const yyr761 bool = false - yyq761[2] = x.FSType != "" - yyq761[7] = x.ReadOnly != false - var yynn761 int - if yyr761 || yy2arr761 { + yysep773 := !z.EncBinary() + yy2arr773 := z.EncBasicHandle().StructToArray + var yyq773 [8]bool + _, _, _ = yysep773, yyq773, yy2arr773 + const yyr773 bool = false + yyq773[2] = x.FSType != "" + yyq773[7] = x.ReadOnly != false + var yynn773 int + if yyr773 || yy2arr773 { r.EncodeArrayStart(8) } else { - yynn761 = 6 - for _, b := range yyq761 { + yynn773 = 6 + for _, b := range yyq773 { if b { - yynn761++ + yynn773++ } } - r.EncodeMapStart(yynn761) - yynn761 = 0 + r.EncodeMapStart(yynn773) + yynn773 = 0 } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.CephMonitors == nil { r.EncodeNil() } else { - yym763 := z.EncBinary() - _ = yym763 + yym775 := z.EncBinary() + _ = yym775 if false { } else { z.F.EncSliceStringV(x.CephMonitors, false, e) @@ -11083,18 +11354,18 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.CephMonitors == nil { r.EncodeNil() } else { - yym764 := z.EncBinary() - _ = yym764 + yym776 := z.EncBinary() + _ = yym776 if false { } else { z.F.EncSliceStringV(x.CephMonitors, false, e) } } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym766 := z.EncBinary() - _ = yym766 + yym778 := z.EncBinary() + _ = yym778 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDImage)) @@ -11103,18 +11374,18 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym767 := z.EncBinary() - _ = yym767 + yym779 := z.EncBinary() + _ = yym779 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDImage)) } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq761[2] { - yym769 := z.EncBinary() - _ = yym769 + if yyq773[2] { + yym781 := z.EncBinary() + _ = yym781 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -11123,22 +11394,22 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq761[2] { + if yyq773[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym770 := z.EncBinary() - _ = yym770 + yym782 := z.EncBinary() + _ = yym782 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym772 := z.EncBinary() - _ = yym772 + yym784 := z.EncBinary() + _ = yym784 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDPool)) @@ -11147,17 +11418,17 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("pool")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym773 := z.EncBinary() - _ = yym773 + yym785 := z.EncBinary() + _ = yym785 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDPool)) } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym775 := z.EncBinary() - _ = yym775 + yym787 := z.EncBinary() + _ = yym787 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RadosUser)) @@ -11166,17 +11437,17 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym776 := z.EncBinary() - _ = yym776 + yym788 := z.EncBinary() + _ = yym788 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RadosUser)) } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym778 := z.EncBinary() - _ = yym778 + yym790 := z.EncBinary() + _ = yym790 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Keyring)) @@ -11185,14 +11456,14 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("keyring")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym779 := z.EncBinary() - _ = yym779 + yym791 := z.EncBinary() + _ = yym791 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Keyring)) } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.SecretRef == nil { r.EncodeNil() @@ -11209,11 +11480,11 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { x.SecretRef.CodecEncodeSelf(e) } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq761[7] { - yym782 := z.EncBinary() - _ = yym782 + if yyq773[7] { + yym794 := z.EncBinary() + _ = yym794 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -11222,19 +11493,19 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq761[7] { + if yyq773[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym783 := z.EncBinary() - _ = yym783 + yym795 := z.EncBinary() + _ = yym795 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr761 || yy2arr761 { + if yyr773 || yy2arr773 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11247,25 +11518,25 @@ func (x *RBDVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym784 := z.DecBinary() - _ = yym784 + yym796 := z.DecBinary() + _ = yym796 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct785 := r.ContainerType() - if yyct785 == codecSelferValueTypeMap1234 { - yyl785 := r.ReadMapStart() - if yyl785 == 0 { + yyct797 := r.ContainerType() + if yyct797 == codecSelferValueTypeMap1234 { + yyl797 := r.ReadMapStart() + if yyl797 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl785, d) + x.codecDecodeSelfFromMap(yyl797, d) } - } else if yyct785 == codecSelferValueTypeArray1234 { - yyl785 := r.ReadArrayStart() - if yyl785 == 0 { + } else if yyct797 == codecSelferValueTypeArray1234 { + yyl797 := r.ReadArrayStart() + if yyl797 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl785, d) + x.codecDecodeSelfFromArray(yyl797, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11277,12 +11548,12 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys786Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys786Slc - var yyhl786 bool = l >= 0 - for yyj786 := 0; ; yyj786++ { - if yyhl786 { - if yyj786 >= l { + var yys798Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys798Slc + var yyhl798 bool = l >= 0 + for yyj798 := 0; ; yyj798++ { + if yyhl798 { + if yyj798 >= l { break } } else { @@ -11291,20 +11562,20 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys786Slc = r.DecodeBytes(yys786Slc, true, true) - yys786 := string(yys786Slc) + yys798Slc = r.DecodeBytes(yys798Slc, true, true) + yys798 := string(yys798Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys786 { + switch yys798 { case "monitors": if r.TryDecodeAsNil() { x.CephMonitors = nil } else { - yyv787 := &x.CephMonitors - yym788 := z.DecBinary() - _ = yym788 + yyv799 := &x.CephMonitors + yym800 := z.DecBinary() + _ = yym800 if false { } else { - z.F.DecSliceStringX(yyv787, false, d) + z.F.DecSliceStringX(yyv799, false, d) } } case "image": @@ -11355,9 +11626,9 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys786) - } // end switch yys786 - } // end for yyj786 + z.DecStructFieldNotFound(-1, yys798) + } // end switch yys798 + } // end for yyj798 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11365,16 +11636,16 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj796 int - var yyb796 bool - var yyhl796 bool = l >= 0 - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + var yyj808 int + var yyb808 bool + var yyhl808 bool = l >= 0 + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11382,21 +11653,21 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.CephMonitors = nil } else { - yyv797 := &x.CephMonitors - yym798 := z.DecBinary() - _ = yym798 + yyv809 := &x.CephMonitors + yym810 := z.DecBinary() + _ = yym810 if false { } else { - z.F.DecSliceStringX(yyv797, false, d) + z.F.DecSliceStringX(yyv809, false, d) } } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11406,13 +11677,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RBDImage = string(r.DecodeString()) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11422,13 +11693,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.FSType = string(r.DecodeString()) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11438,13 +11709,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RBDPool = string(r.DecodeString()) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11454,13 +11725,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RadosUser = string(r.DecodeString()) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11470,13 +11741,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Keyring = string(r.DecodeString()) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11491,13 +11762,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SecretRef.CodecDecodeSelf(d) } - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11508,17 +11779,17 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } for { - yyj796++ - if yyhl796 { - yyb796 = yyj796 > l + yyj808++ + if yyhl808 { + yyb808 = yyj808 > l } else { - yyb796 = r.CheckBreak() + yyb808 = r.CheckBreak() } - if yyb796 { + if yyb808 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj796-1, "") + z.DecStructFieldNotFound(yyj808-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11530,35 +11801,35 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym806 := z.EncBinary() - _ = yym806 + yym818 := z.EncBinary() + _ = yym818 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep807 := !z.EncBinary() - yy2arr807 := z.EncBasicHandle().StructToArray - var yyq807 [3]bool - _, _, _ = yysep807, yyq807, yy2arr807 - const yyr807 bool = false - yyq807[1] = x.FSType != "" - yyq807[2] = x.ReadOnly != false - var yynn807 int - if yyr807 || yy2arr807 { + yysep819 := !z.EncBinary() + yy2arr819 := z.EncBasicHandle().StructToArray + var yyq819 [3]bool + _, _, _ = yysep819, yyq819, yy2arr819 + const yyr819 bool = false + yyq819[1] = x.FSType != "" + yyq819[2] = x.ReadOnly != false + var yynn819 int + if yyr819 || yy2arr819 { r.EncodeArrayStart(3) } else { - yynn807 = 1 - for _, b := range yyq807 { + yynn819 = 1 + for _, b := range yyq819 { if b { - yynn807++ + yynn819++ } } - r.EncodeMapStart(yynn807) - yynn807 = 0 + r.EncodeMapStart(yynn819) + yynn819 = 0 } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym809 := z.EncBinary() - _ = yym809 + yym821 := z.EncBinary() + _ = yym821 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) @@ -11567,18 +11838,18 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym810 := z.EncBinary() - _ = yym810 + yym822 := z.EncBinary() + _ = yym822 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq807[1] { - yym812 := z.EncBinary() - _ = yym812 + if yyq819[1] { + yym824 := z.EncBinary() + _ = yym824 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -11587,23 +11858,23 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq807[1] { + if yyq819[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym813 := z.EncBinary() - _ = yym813 + yym825 := z.EncBinary() + _ = yym825 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq807[2] { - yym815 := z.EncBinary() - _ = yym815 + if yyq819[2] { + yym827 := z.EncBinary() + _ = yym827 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -11612,19 +11883,19 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq807[2] { + if yyq819[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym816 := z.EncBinary() - _ = yym816 + yym828 := z.EncBinary() + _ = yym828 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11637,25 +11908,25 @@ func (x *CinderVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym817 := z.DecBinary() - _ = yym817 + yym829 := z.DecBinary() + _ = yym829 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct818 := r.ContainerType() - if yyct818 == codecSelferValueTypeMap1234 { - yyl818 := r.ReadMapStart() - if yyl818 == 0 { + yyct830 := r.ContainerType() + if yyct830 == codecSelferValueTypeMap1234 { + yyl830 := r.ReadMapStart() + if yyl830 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl818, d) + x.codecDecodeSelfFromMap(yyl830, d) } - } else if yyct818 == codecSelferValueTypeArray1234 { - yyl818 := r.ReadArrayStart() - if yyl818 == 0 { + } else if yyct830 == codecSelferValueTypeArray1234 { + yyl830 := r.ReadArrayStart() + if yyl830 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl818, d) + x.codecDecodeSelfFromArray(yyl830, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11667,12 +11938,12 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys819Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys819Slc - var yyhl819 bool = l >= 0 - for yyj819 := 0; ; yyj819++ { - if yyhl819 { - if yyj819 >= l { + var yys831Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys831Slc + var yyhl831 bool = l >= 0 + for yyj831 := 0; ; yyj831++ { + if yyhl831 { + if yyj831 >= l { break } } else { @@ -11681,10 +11952,10 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys819Slc = r.DecodeBytes(yys819Slc, true, true) - yys819 := string(yys819Slc) + yys831Slc = r.DecodeBytes(yys831Slc, true, true) + yys831 := string(yys831Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys819 { + switch yys831 { case "volumeID": if r.TryDecodeAsNil() { x.VolumeID = "" @@ -11704,9 +11975,9 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys819) - } // end switch yys819 - } // end for yyj819 + z.DecStructFieldNotFound(-1, yys831) + } // end switch yys831 + } // end for yyj831 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11714,16 +11985,16 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj823 int - var yyb823 bool - var yyhl823 bool = l >= 0 - yyj823++ - if yyhl823 { - yyb823 = yyj823 > l + var yyj835 int + var yyb835 bool + var yyhl835 bool = l >= 0 + yyj835++ + if yyhl835 { + yyb835 = yyj835 > l } else { - yyb823 = r.CheckBreak() + yyb835 = r.CheckBreak() } - if yyb823 { + if yyb835 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11733,13 +12004,13 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.VolumeID = string(r.DecodeString()) } - yyj823++ - if yyhl823 { - yyb823 = yyj823 > l + yyj835++ + if yyhl835 { + yyb835 = yyj835 > l } else { - yyb823 = r.CheckBreak() + yyb835 = r.CheckBreak() } - if yyb823 { + if yyb835 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11749,13 +12020,13 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.FSType = string(r.DecodeString()) } - yyj823++ - if yyhl823 { - yyb823 = yyj823 > l + yyj835++ + if yyhl835 { + yyb835 = yyj835 > l } else { - yyb823 = r.CheckBreak() + yyb835 = r.CheckBreak() } - if yyb823 { + if yyb835 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11766,17 +12037,17 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.ReadOnly = bool(r.DecodeBool()) } for { - yyj823++ - if yyhl823 { - yyb823 = yyj823 > l + yyj835++ + if yyhl835 { + yyb835 = yyj835 > l } else { - yyb823 = r.CheckBreak() + yyb835 = r.CheckBreak() } - if yyb823 { + if yyb835 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj823-1, "") + z.DecStructFieldNotFound(yyj835-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11788,41 +12059,41 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym827 := z.EncBinary() - _ = yym827 + yym839 := z.EncBinary() + _ = yym839 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep828 := !z.EncBinary() - yy2arr828 := z.EncBasicHandle().StructToArray - var yyq828 [6]bool - _, _, _ = yysep828, yyq828, yy2arr828 - const yyr828 bool = false - yyq828[1] = x.Path != "" - yyq828[2] = x.User != "" - yyq828[3] = x.SecretFile != "" - yyq828[4] = x.SecretRef != nil - yyq828[5] = x.ReadOnly != false - var yynn828 int - if yyr828 || yy2arr828 { + yysep840 := !z.EncBinary() + yy2arr840 := z.EncBasicHandle().StructToArray + var yyq840 [6]bool + _, _, _ = yysep840, yyq840, yy2arr840 + const yyr840 bool = false + yyq840[1] = x.Path != "" + yyq840[2] = x.User != "" + yyq840[3] = x.SecretFile != "" + yyq840[4] = x.SecretRef != nil + yyq840[5] = x.ReadOnly != false + var yynn840 int + if yyr840 || yy2arr840 { r.EncodeArrayStart(6) } else { - yynn828 = 1 - for _, b := range yyq828 { + yynn840 = 1 + for _, b := range yyq840 { if b { - yynn828++ + yynn840++ } } - r.EncodeMapStart(yynn828) - yynn828 = 0 + r.EncodeMapStart(yynn840) + yynn840 = 0 } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Monitors == nil { r.EncodeNil() } else { - yym830 := z.EncBinary() - _ = yym830 + yym842 := z.EncBinary() + _ = yym842 if false { } else { z.F.EncSliceStringV(x.Monitors, false, e) @@ -11835,19 +12106,19 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.Monitors == nil { r.EncodeNil() } else { - yym831 := z.EncBinary() - _ = yym831 + yym843 := z.EncBinary() + _ = yym843 if false { } else { z.F.EncSliceStringV(x.Monitors, false, e) } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[1] { - yym833 := z.EncBinary() - _ = yym833 + if yyq840[1] { + yym845 := z.EncBinary() + _ = yym845 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -11856,23 +12127,23 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq828[1] { + if yyq840[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym834 := z.EncBinary() - _ = yym834 + yym846 := z.EncBinary() + _ = yym846 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[2] { - yym836 := z.EncBinary() - _ = yym836 + if yyq840[2] { + yym848 := z.EncBinary() + _ = yym848 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) @@ -11881,23 +12152,23 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq828[2] { + if yyq840[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym837 := z.EncBinary() - _ = yym837 + yym849 := z.EncBinary() + _ = yym849 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[3] { - yym839 := z.EncBinary() - _ = yym839 + if yyq840[3] { + yym851 := z.EncBinary() + _ = yym851 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretFile)) @@ -11906,21 +12177,21 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq828[3] { + if yyq840[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym840 := z.EncBinary() - _ = yym840 + yym852 := z.EncBinary() + _ = yym852 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretFile)) } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[4] { + if yyq840[4] { if x.SecretRef == nil { r.EncodeNil() } else { @@ -11930,7 +12201,7 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq828[4] { + if yyq840[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -11941,11 +12212,11 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[5] { - yym843 := z.EncBinary() - _ = yym843 + if yyq840[5] { + yym855 := z.EncBinary() + _ = yym855 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -11954,19 +12225,19 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq828[5] { + if yyq840[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym844 := z.EncBinary() - _ = yym844 + yym856 := z.EncBinary() + _ = yym856 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr828 || yy2arr828 { + if yyr840 || yy2arr840 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11979,25 +12250,25 @@ func (x *CephFSVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym845 := z.DecBinary() - _ = yym845 + yym857 := z.DecBinary() + _ = yym857 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct846 := r.ContainerType() - if yyct846 == codecSelferValueTypeMap1234 { - yyl846 := r.ReadMapStart() - if yyl846 == 0 { + yyct858 := r.ContainerType() + if yyct858 == codecSelferValueTypeMap1234 { + yyl858 := r.ReadMapStart() + if yyl858 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl846, d) + x.codecDecodeSelfFromMap(yyl858, d) } - } else if yyct846 == codecSelferValueTypeArray1234 { - yyl846 := r.ReadArrayStart() - if yyl846 == 0 { + } else if yyct858 == codecSelferValueTypeArray1234 { + yyl858 := r.ReadArrayStart() + if yyl858 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl846, d) + x.codecDecodeSelfFromArray(yyl858, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12009,12 +12280,12 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys847Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys847Slc - var yyhl847 bool = l >= 0 - for yyj847 := 0; ; yyj847++ { - if yyhl847 { - if yyj847 >= l { + var yys859Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys859Slc + var yyhl859 bool = l >= 0 + for yyj859 := 0; ; yyj859++ { + if yyhl859 { + if yyj859 >= l { break } } else { @@ -12023,20 +12294,20 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys847Slc = r.DecodeBytes(yys847Slc, true, true) - yys847 := string(yys847Slc) + yys859Slc = r.DecodeBytes(yys859Slc, true, true) + yys859 := string(yys859Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys847 { + switch yys859 { case "monitors": if r.TryDecodeAsNil() { x.Monitors = nil } else { - yyv848 := &x.Monitors - yym849 := z.DecBinary() - _ = yym849 + yyv860 := &x.Monitors + yym861 := z.DecBinary() + _ = yym861 if false { } else { - z.F.DecSliceStringX(yyv848, false, d) + z.F.DecSliceStringX(yyv860, false, d) } } case "path": @@ -12075,9 +12346,9 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys847) - } // end switch yys847 - } // end for yyj847 + z.DecStructFieldNotFound(-1, yys859) + } // end switch yys859 + } // end for yyj859 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12085,16 +12356,16 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj855 int - var yyb855 bool - var yyhl855 bool = l >= 0 - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + var yyj867 int + var yyb867 bool + var yyhl867 bool = l >= 0 + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12102,21 +12373,21 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Monitors = nil } else { - yyv856 := &x.Monitors - yym857 := z.DecBinary() - _ = yym857 + yyv868 := &x.Monitors + yym869 := z.DecBinary() + _ = yym869 if false { } else { - z.F.DecSliceStringX(yyv856, false, d) + z.F.DecSliceStringX(yyv868, false, d) } } - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12126,13 +12397,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Path = string(r.DecodeString()) } - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12142,13 +12413,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.User = string(r.DecodeString()) } - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12158,13 +12429,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.SecretFile = string(r.DecodeString()) } - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12179,13 +12450,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } x.SecretRef.CodecDecodeSelf(d) } - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12196,17 +12467,17 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.ReadOnly = bool(r.DecodeBool()) } for { - yyj855++ - if yyhl855 { - yyb855 = yyj855 > l + yyj867++ + if yyhl867 { + yyb867 = yyj867 > l } else { - yyb855 = r.CheckBreak() + yyb867 = r.CheckBreak() } - if yyb855 { + if yyb867 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj855-1, "") + z.DecStructFieldNotFound(yyj867-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12218,33 +12489,33 @@ func (x *FlockerVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym863 := z.EncBinary() - _ = yym863 + yym875 := z.EncBinary() + _ = yym875 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep864 := !z.EncBinary() - yy2arr864 := z.EncBasicHandle().StructToArray - var yyq864 [1]bool - _, _, _ = yysep864, yyq864, yy2arr864 - const yyr864 bool = false - var yynn864 int - if yyr864 || yy2arr864 { + yysep876 := !z.EncBinary() + yy2arr876 := z.EncBasicHandle().StructToArray + var yyq876 [1]bool + _, _, _ = yysep876, yyq876, yy2arr876 + const yyr876 bool = false + var yynn876 int + if yyr876 || yy2arr876 { r.EncodeArrayStart(1) } else { - yynn864 = 1 - for _, b := range yyq864 { + yynn876 = 1 + for _, b := range yyq876 { if b { - yynn864++ + yynn876++ } } - r.EncodeMapStart(yynn864) - yynn864 = 0 + r.EncodeMapStart(yynn876) + yynn876 = 0 } - if yyr864 || yy2arr864 { + if yyr876 || yy2arr876 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym866 := z.EncBinary() - _ = yym866 + yym878 := z.EncBinary() + _ = yym878 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DatasetName)) @@ -12253,14 +12524,14 @@ func (x *FlockerVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("datasetName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym867 := z.EncBinary() - _ = yym867 + yym879 := z.EncBinary() + _ = yym879 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DatasetName)) } } - if yyr864 || yy2arr864 { + if yyr876 || yy2arr876 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12273,25 +12544,25 @@ func (x *FlockerVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym868 := z.DecBinary() - _ = yym868 + yym880 := z.DecBinary() + _ = yym880 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct869 := r.ContainerType() - if yyct869 == codecSelferValueTypeMap1234 { - yyl869 := r.ReadMapStart() - if yyl869 == 0 { + yyct881 := r.ContainerType() + if yyct881 == codecSelferValueTypeMap1234 { + yyl881 := r.ReadMapStart() + if yyl881 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl869, d) + x.codecDecodeSelfFromMap(yyl881, d) } - } else if yyct869 == codecSelferValueTypeArray1234 { - yyl869 := r.ReadArrayStart() - if yyl869 == 0 { + } else if yyct881 == codecSelferValueTypeArray1234 { + yyl881 := r.ReadArrayStart() + if yyl881 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl869, d) + x.codecDecodeSelfFromArray(yyl881, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12303,12 +12574,12 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys870Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys870Slc - var yyhl870 bool = l >= 0 - for yyj870 := 0; ; yyj870++ { - if yyhl870 { - if yyj870 >= l { + var yys882Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys882Slc + var yyhl882 bool = l >= 0 + for yyj882 := 0; ; yyj882++ { + if yyhl882 { + if yyj882 >= l { break } } else { @@ -12317,10 +12588,10 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys870Slc = r.DecodeBytes(yys870Slc, true, true) - yys870 := string(yys870Slc) + yys882Slc = r.DecodeBytes(yys882Slc, true, true) + yys882 := string(yys882Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys870 { + switch yys882 { case "datasetName": if r.TryDecodeAsNil() { x.DatasetName = "" @@ -12328,196 +12599,13 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.DatasetName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys870) - } // end switch yys870 - } // end for yyj870 + z.DecStructFieldNotFound(-1, yys882) + } // end switch yys882 + } // end for yyj882 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } func (x *FlockerVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj872 int - var yyb872 bool - var yyhl872 bool = l >= 0 - yyj872++ - if yyhl872 { - yyb872 = yyj872 > l - } else { - yyb872 = r.CheckBreak() - } - if yyb872 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.DatasetName = "" - } else { - x.DatasetName = string(r.DecodeString()) - } - for { - yyj872++ - if yyhl872 { - yyb872 = yyj872 > l - } else { - yyb872 = r.CheckBreak() - } - if yyb872 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj872-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *DownwardAPIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym874 := z.EncBinary() - _ = yym874 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep875 := !z.EncBinary() - yy2arr875 := z.EncBasicHandle().StructToArray - var yyq875 [1]bool - _, _, _ = yysep875, yyq875, yy2arr875 - const yyr875 bool = false - yyq875[0] = len(x.Items) != 0 - var yynn875 int - if yyr875 || yy2arr875 { - r.EncodeArrayStart(1) - } else { - yynn875 = 0 - for _, b := range yyq875 { - if b { - yynn875++ - } - } - r.EncodeMapStart(yynn875) - yynn875 = 0 - } - if yyr875 || yy2arr875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq875[0] { - if x.Items == nil { - r.EncodeNil() - } else { - yym877 := z.EncBinary() - _ = yym877 - if false { - } else { - h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq875[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym878 := z.EncBinary() - _ = yym878 - if false { - } else { - h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) - } - } - } - } - if yyr875 || yy2arr875 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *DownwardAPIVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym879 := z.DecBinary() - _ = yym879 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct880 := r.ContainerType() - if yyct880 == codecSelferValueTypeMap1234 { - yyl880 := r.ReadMapStart() - if yyl880 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl880, d) - } - } else if yyct880 == codecSelferValueTypeArray1234 { - yyl880 := r.ReadArrayStart() - if yyl880 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl880, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *DownwardAPIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys881Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys881Slc - var yyhl881 bool = l >= 0 - for yyj881 := 0; ; yyj881++ { - if yyhl881 { - if yyj881 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys881Slc = r.DecodeBytes(yys881Slc, true, true) - yys881 := string(yys881Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys881 { - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv882 := &x.Items - yym883 := z.DecBinary() - _ = yym883 - if false { - } else { - h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv882), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys881) - } // end switch yys881 - } // end for yyj881 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -12536,15 +12624,9 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.D } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Items = nil + x.DatasetName = "" } else { - yyv885 := &x.Items - yym886 := z.DecBinary() - _ = yym886 - if false { - } else { - h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv885), d) - } + x.DatasetName = string(r.DecodeString()) } for { yyj884++ @@ -12562,6 +12644,195 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.D z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } +func (x *DownwardAPIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym886 := z.EncBinary() + _ = yym886 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep887 := !z.EncBinary() + yy2arr887 := z.EncBasicHandle().StructToArray + var yyq887 [1]bool + _, _, _ = yysep887, yyq887, yy2arr887 + const yyr887 bool = false + yyq887[0] = len(x.Items) != 0 + var yynn887 int + if yyr887 || yy2arr887 { + r.EncodeArrayStart(1) + } else { + yynn887 = 0 + for _, b := range yyq887 { + if b { + yynn887++ + } + } + r.EncodeMapStart(yynn887) + yynn887 = 0 + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq887[0] { + if x.Items == nil { + r.EncodeNil() + } else { + yym889 := z.EncBinary() + _ = yym889 + if false { + } else { + h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq887[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym890 := z.EncBinary() + _ = yym890 + if false { + } else { + h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) + } + } + } + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *DownwardAPIVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym891 := z.DecBinary() + _ = yym891 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct892 := r.ContainerType() + if yyct892 == codecSelferValueTypeMap1234 { + yyl892 := r.ReadMapStart() + if yyl892 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl892, d) + } + } else if yyct892 == codecSelferValueTypeArray1234 { + yyl892 := r.ReadArrayStart() + if yyl892 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl892, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *DownwardAPIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys893Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys893Slc + var yyhl893 bool = l >= 0 + for yyj893 := 0; ; yyj893++ { + if yyhl893 { + if yyj893 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys893Slc = r.DecodeBytes(yys893Slc, true, true) + yys893 := string(yys893Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys893 { + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv894 := &x.Items + yym895 := z.DecBinary() + _ = yym895 + if false { + } else { + h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv894), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys893) + } // end switch yys893 + } // end for yyj893 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj896 int + var yyb896 bool + var yyhl896 bool = l >= 0 + yyj896++ + if yyhl896 { + yyb896 = yyj896 > l + } else { + yyb896 = r.CheckBreak() + } + if yyb896 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv897 := &x.Items + yym898 := z.DecBinary() + _ = yym898 + if false { + } else { + h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv897), d) + } + } + for { + yyj896++ + if yyhl896 { + yyb896 = yyj896 > l + } else { + yyb896 = r.CheckBreak() + } + if yyb896 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj896-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + func (x *DownwardAPIVolumeFile) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -12569,33 +12840,33 @@ func (x *DownwardAPIVolumeFile) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym887 := z.EncBinary() - _ = yym887 + yym899 := z.EncBinary() + _ = yym899 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep888 := !z.EncBinary() - yy2arr888 := z.EncBasicHandle().StructToArray - var yyq888 [2]bool - _, _, _ = yysep888, yyq888, yy2arr888 - const yyr888 bool = false - var yynn888 int - if yyr888 || yy2arr888 { + yysep900 := !z.EncBinary() + yy2arr900 := z.EncBasicHandle().StructToArray + var yyq900 [2]bool + _, _, _ = yysep900, yyq900, yy2arr900 + const yyr900 bool = false + var yynn900 int + if yyr900 || yy2arr900 { r.EncodeArrayStart(2) } else { - yynn888 = 2 - for _, b := range yyq888 { + yynn900 = 2 + for _, b := range yyq900 { if b { - yynn888++ + yynn900++ } } - r.EncodeMapStart(yynn888) - yynn888 = 0 + r.EncodeMapStart(yynn900) + yynn900 = 0 } - if yyr888 || yy2arr888 { + if yyr900 || yy2arr900 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym890 := z.EncBinary() - _ = yym890 + yym902 := z.EncBinary() + _ = yym902 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -12604,25 +12875,25 @@ func (x *DownwardAPIVolumeFile) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym891 := z.EncBinary() - _ = yym891 + yym903 := z.EncBinary() + _ = yym903 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr888 || yy2arr888 { + if yyr900 || yy2arr900 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy893 := &x.FieldRef - yy893.CodecEncodeSelf(e) + yy905 := &x.FieldRef + yy905.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy894 := &x.FieldRef - yy894.CodecEncodeSelf(e) + yy906 := &x.FieldRef + yy906.CodecEncodeSelf(e) } - if yyr888 || yy2arr888 { + if yyr900 || yy2arr900 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12635,25 +12906,25 @@ func (x *DownwardAPIVolumeFile) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym895 := z.DecBinary() - _ = yym895 + yym907 := z.DecBinary() + _ = yym907 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct896 := r.ContainerType() - if yyct896 == codecSelferValueTypeMap1234 { - yyl896 := r.ReadMapStart() - if yyl896 == 0 { + yyct908 := r.ContainerType() + if yyct908 == codecSelferValueTypeMap1234 { + yyl908 := r.ReadMapStart() + if yyl908 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl896, d) + x.codecDecodeSelfFromMap(yyl908, d) } - } else if yyct896 == codecSelferValueTypeArray1234 { - yyl896 := r.ReadArrayStart() - if yyl896 == 0 { + } else if yyct908 == codecSelferValueTypeArray1234 { + yyl908 := r.ReadArrayStart() + if yyl908 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl896, d) + x.codecDecodeSelfFromArray(yyl908, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12665,12 +12936,12 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys897Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys897Slc - var yyhl897 bool = l >= 0 - for yyj897 := 0; ; yyj897++ { - if yyhl897 { - if yyj897 >= l { + var yys909Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys909Slc + var yyhl909 bool = l >= 0 + for yyj909 := 0; ; yyj909++ { + if yyhl909 { + if yyj909 >= l { break } } else { @@ -12679,10 +12950,10 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys897Slc = r.DecodeBytes(yys897Slc, true, true) - yys897 := string(yys897Slc) + yys909Slc = r.DecodeBytes(yys909Slc, true, true) + yys909 := string(yys909Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys897 { + switch yys909 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -12693,13 +12964,13 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.FieldRef = ObjectFieldSelector{} } else { - yyv899 := &x.FieldRef - yyv899.CodecDecodeSelf(d) + yyv911 := &x.FieldRef + yyv911.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys897) - } // end switch yys897 - } // end for yyj897 + z.DecStructFieldNotFound(-1, yys909) + } // end switch yys909 + } // end for yyj909 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12707,16 +12978,16 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj900 int - var yyb900 bool - var yyhl900 bool = l >= 0 - yyj900++ - if yyhl900 { - yyb900 = yyj900 > l + var yyj912 int + var yyb912 bool + var yyhl912 bool = l >= 0 + yyj912++ + if yyhl912 { + yyb912 = yyj912 > l } else { - yyb900 = r.CheckBreak() + yyb912 = r.CheckBreak() } - if yyb900 { + if yyb912 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12726,13 +12997,13 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Path = string(r.DecodeString()) } - yyj900++ - if yyhl900 { - yyb900 = yyj900 > l + yyj912++ + if yyhl912 { + yyb912 = yyj912 > l } else { - yyb900 = r.CheckBreak() + yyb912 = r.CheckBreak() } - if yyb900 { + if yyb912 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12740,21 +13011,272 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.FieldRef = ObjectFieldSelector{} } else { - yyv902 := &x.FieldRef - yyv902.CodecDecodeSelf(d) + yyv914 := &x.FieldRef + yyv914.CodecDecodeSelf(d) } for { - yyj900++ - if yyhl900 { - yyb900 = yyj900 > l + yyj912++ + if yyhl912 { + yyb912 = yyj912 > l } else { - yyb900 = r.CheckBreak() + yyb912 = r.CheckBreak() } - if yyb900 { + if yyb912 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj900-1, "") + z.DecStructFieldNotFound(yyj912-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *AzureFileVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym915 := z.EncBinary() + _ = yym915 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep916 := !z.EncBinary() + yy2arr916 := z.EncBasicHandle().StructToArray + var yyq916 [3]bool + _, _, _ = yysep916, yyq916, yy2arr916 + const yyr916 bool = false + yyq916[2] = x.ReadOnly != false + var yynn916 int + if yyr916 || yy2arr916 { + r.EncodeArrayStart(3) + } else { + yynn916 = 2 + for _, b := range yyq916 { + if b { + yynn916++ + } + } + r.EncodeMapStart(yynn916) + yynn916 = 0 + } + if yyr916 || yy2arr916 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym918 := z.EncBinary() + _ = yym918 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("secretName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym919 := z.EncBinary() + _ = yym919 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } + if yyr916 || yy2arr916 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym921 := z.EncBinary() + _ = yym921 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ShareName)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("shareName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym922 := z.EncBinary() + _ = yym922 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ShareName)) + } + } + if yyr916 || yy2arr916 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq916[2] { + yym924 := z.EncBinary() + _ = yym924 + if false { + } else { + r.EncodeBool(bool(x.ReadOnly)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq916[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("readOnly")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym925 := z.EncBinary() + _ = yym925 + if false { + } else { + r.EncodeBool(bool(x.ReadOnly)) + } + } + } + if yyr916 || yy2arr916 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *AzureFileVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym926 := z.DecBinary() + _ = yym926 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct927 := r.ContainerType() + if yyct927 == codecSelferValueTypeMap1234 { + yyl927 := r.ReadMapStart() + if yyl927 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl927, d) + } + } else if yyct927 == codecSelferValueTypeArray1234 { + yyl927 := r.ReadArrayStart() + if yyl927 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl927, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *AzureFileVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys928Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys928Slc + var yyhl928 bool = l >= 0 + for yyj928 := 0; ; yyj928++ { + if yyhl928 { + if yyj928 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys928Slc = r.DecodeBytes(yys928Slc, true, true) + yys928 := string(yys928Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys928 { + case "secretName": + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + case "shareName": + if r.TryDecodeAsNil() { + x.ShareName = "" + } else { + x.ShareName = string(r.DecodeString()) + } + case "readOnly": + if r.TryDecodeAsNil() { + x.ReadOnly = false + } else { + x.ReadOnly = bool(r.DecodeBool()) + } + default: + z.DecStructFieldNotFound(-1, yys928) + } // end switch yys928 + } // end for yyj928 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *AzureFileVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj932 int + var yyb932 bool + var yyhl932 bool = l >= 0 + yyj932++ + if yyhl932 { + yyb932 = yyj932 > l + } else { + yyb932 = r.CheckBreak() + } + if yyb932 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + yyj932++ + if yyhl932 { + yyb932 = yyj932 > l + } else { + yyb932 = r.CheckBreak() + } + if yyb932 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ShareName = "" + } else { + x.ShareName = string(r.DecodeString()) + } + yyj932++ + if yyhl932 { + yyb932 = yyj932 > l + } else { + yyb932 = r.CheckBreak() + } + if yyb932 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ReadOnly = false + } else { + x.ReadOnly = bool(r.DecodeBool()) + } + for { + yyj932++ + if yyhl932 { + yyb932 = yyj932 > l + } else { + yyb932 = r.CheckBreak() + } + if yyb932 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj932-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12766,38 +13288,38 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym903 := z.EncBinary() - _ = yym903 + yym936 := z.EncBinary() + _ = yym936 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep904 := !z.EncBinary() - yy2arr904 := z.EncBasicHandle().StructToArray - var yyq904 [5]bool - _, _, _ = yysep904, yyq904, yy2arr904 - const yyr904 bool = false - yyq904[0] = x.Name != "" - yyq904[1] = x.HostPort != 0 - yyq904[3] = x.Protocol != "" - yyq904[4] = x.HostIP != "" - var yynn904 int - if yyr904 || yy2arr904 { + yysep937 := !z.EncBinary() + yy2arr937 := z.EncBasicHandle().StructToArray + var yyq937 [5]bool + _, _, _ = yysep937, yyq937, yy2arr937 + const yyr937 bool = false + yyq937[0] = x.Name != "" + yyq937[1] = x.HostPort != 0 + yyq937[3] = x.Protocol != "" + yyq937[4] = x.HostIP != "" + var yynn937 int + if yyr937 || yy2arr937 { r.EncodeArrayStart(5) } else { - yynn904 = 1 - for _, b := range yyq904 { + yynn937 = 1 + for _, b := range yyq937 { if b { - yynn904++ + yynn937++ } } - r.EncodeMapStart(yynn904) - yynn904 = 0 + r.EncodeMapStart(yynn937) + yynn937 = 0 } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq904[0] { - yym906 := z.EncBinary() - _ = yym906 + if yyq937[0] { + yym939 := z.EncBinary() + _ = yym939 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -12806,23 +13328,23 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq904[0] { + if yyq937[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym907 := z.EncBinary() - _ = yym907 + yym940 := z.EncBinary() + _ = yym940 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq904[1] { - yym909 := z.EncBinary() - _ = yym909 + if yyq937[1] { + yym942 := z.EncBinary() + _ = yym942 if false { } else { r.EncodeInt(int64(x.HostPort)) @@ -12831,22 +13353,22 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq904[1] { + if yyq937[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym910 := z.EncBinary() - _ = yym910 + yym943 := z.EncBinary() + _ = yym943 if false { } else { r.EncodeInt(int64(x.HostPort)) } } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym912 := z.EncBinary() - _ = yym912 + yym945 := z.EncBinary() + _ = yym945 if false { } else { r.EncodeInt(int64(x.ContainerPort)) @@ -12855,33 +13377,33 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym913 := z.EncBinary() - _ = yym913 + yym946 := z.EncBinary() + _ = yym946 if false { } else { r.EncodeInt(int64(x.ContainerPort)) } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq904[3] { + if yyq937[3] { x.Protocol.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq904[3] { + if yyq937[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("protocol")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq904[4] { - yym916 := z.EncBinary() - _ = yym916 + if yyq937[4] { + yym949 := z.EncBinary() + _ = yym949 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) @@ -12890,19 +13412,19 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq904[4] { + if yyq937[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym917 := z.EncBinary() - _ = yym917 + yym950 := z.EncBinary() + _ = yym950 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) } } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12915,25 +13437,25 @@ func (x *ContainerPort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym918 := z.DecBinary() - _ = yym918 + yym951 := z.DecBinary() + _ = yym951 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct919 := r.ContainerType() - if yyct919 == codecSelferValueTypeMap1234 { - yyl919 := r.ReadMapStart() - if yyl919 == 0 { + yyct952 := r.ContainerType() + if yyct952 == codecSelferValueTypeMap1234 { + yyl952 := r.ReadMapStart() + if yyl952 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl919, d) + x.codecDecodeSelfFromMap(yyl952, d) } - } else if yyct919 == codecSelferValueTypeArray1234 { - yyl919 := r.ReadArrayStart() - if yyl919 == 0 { + } else if yyct952 == codecSelferValueTypeArray1234 { + yyl952 := r.ReadArrayStart() + if yyl952 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl919, d) + x.codecDecodeSelfFromArray(yyl952, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12945,12 +13467,12 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys920Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys920Slc - var yyhl920 bool = l >= 0 - for yyj920 := 0; ; yyj920++ { - if yyhl920 { - if yyj920 >= l { + var yys953Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys953Slc + var yyhl953 bool = l >= 0 + for yyj953 := 0; ; yyj953++ { + if yyhl953 { + if yyj953 >= l { break } } else { @@ -12959,10 +13481,10 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys920Slc = r.DecodeBytes(yys920Slc, true, true) - yys920 := string(yys920Slc) + yys953Slc = r.DecodeBytes(yys953Slc, true, true) + yys953 := string(yys953Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys920 { + switch yys953 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -12994,9 +13516,9 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HostIP = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys920) - } // end switch yys920 - } // end for yyj920 + z.DecStructFieldNotFound(-1, yys953) + } // end switch yys953 + } // end for yyj953 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13004,16 +13526,16 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj926 int - var yyb926 bool - var yyhl926 bool = l >= 0 - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + var yyj959 int + var yyb959 bool + var yyhl959 bool = l >= 0 + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13023,13 +13545,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13039,13 +13561,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostPort = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13055,13 +13577,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ContainerPort = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13071,13 +13593,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Protocol = Protocol(r.DecodeString()) } - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13088,17 +13610,17 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.HostIP = string(r.DecodeString()) } for { - yyj926++ - if yyhl926 { - yyb926 = yyj926 > l + yyj959++ + if yyhl959 { + yyb959 = yyj959 > l } else { - yyb926 = r.CheckBreak() + yyb959 = r.CheckBreak() } - if yyb926 { + if yyb959 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj926-1, "") + z.DecStructFieldNotFound(yyj959-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13110,34 +13632,34 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym932 := z.EncBinary() - _ = yym932 + yym965 := z.EncBinary() + _ = yym965 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep933 := !z.EncBinary() - yy2arr933 := z.EncBasicHandle().StructToArray - var yyq933 [3]bool - _, _, _ = yysep933, yyq933, yy2arr933 - const yyr933 bool = false - yyq933[1] = x.ReadOnly != false - var yynn933 int - if yyr933 || yy2arr933 { + yysep966 := !z.EncBinary() + yy2arr966 := z.EncBasicHandle().StructToArray + var yyq966 [3]bool + _, _, _ = yysep966, yyq966, yy2arr966 + const yyr966 bool = false + yyq966[1] = x.ReadOnly != false + var yynn966 int + if yyr966 || yy2arr966 { r.EncodeArrayStart(3) } else { - yynn933 = 2 - for _, b := range yyq933 { + yynn966 = 2 + for _, b := range yyq966 { if b { - yynn933++ + yynn966++ } } - r.EncodeMapStart(yynn933) - yynn933 = 0 + r.EncodeMapStart(yynn966) + yynn966 = 0 } - if yyr933 || yy2arr933 { + if yyr966 || yy2arr966 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym935 := z.EncBinary() - _ = yym935 + yym968 := z.EncBinary() + _ = yym968 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -13146,18 +13668,18 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym936 := z.EncBinary() - _ = yym936 + yym969 := z.EncBinary() + _ = yym969 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr933 || yy2arr933 { + if yyr966 || yy2arr966 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq933[1] { - yym938 := z.EncBinary() - _ = yym938 + if yyq966[1] { + yym971 := z.EncBinary() + _ = yym971 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -13166,22 +13688,22 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq933[1] { + if yyq966[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym939 := z.EncBinary() - _ = yym939 + yym972 := z.EncBinary() + _ = yym972 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr933 || yy2arr933 { + if yyr966 || yy2arr966 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym941 := z.EncBinary() - _ = yym941 + yym974 := z.EncBinary() + _ = yym974 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MountPath)) @@ -13190,14 +13712,14 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("mountPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym942 := z.EncBinary() - _ = yym942 + yym975 := z.EncBinary() + _ = yym975 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MountPath)) } } - if yyr933 || yy2arr933 { + if yyr966 || yy2arr966 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13210,25 +13732,25 @@ func (x *VolumeMount) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym943 := z.DecBinary() - _ = yym943 + yym976 := z.DecBinary() + _ = yym976 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct944 := r.ContainerType() - if yyct944 == codecSelferValueTypeMap1234 { - yyl944 := r.ReadMapStart() - if yyl944 == 0 { + yyct977 := r.ContainerType() + if yyct977 == codecSelferValueTypeMap1234 { + yyl977 := r.ReadMapStart() + if yyl977 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl944, d) + x.codecDecodeSelfFromMap(yyl977, d) } - } else if yyct944 == codecSelferValueTypeArray1234 { - yyl944 := r.ReadArrayStart() - if yyl944 == 0 { + } else if yyct977 == codecSelferValueTypeArray1234 { + yyl977 := r.ReadArrayStart() + if yyl977 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl944, d) + x.codecDecodeSelfFromArray(yyl977, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13240,12 +13762,12 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys945Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys945Slc - var yyhl945 bool = l >= 0 - for yyj945 := 0; ; yyj945++ { - if yyhl945 { - if yyj945 >= l { + var yys978Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys978Slc + var yyhl978 bool = l >= 0 + for yyj978 := 0; ; yyj978++ { + if yyhl978 { + if yyj978 >= l { break } } else { @@ -13254,10 +13776,10 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys945Slc = r.DecodeBytes(yys945Slc, true, true) - yys945 := string(yys945Slc) + yys978Slc = r.DecodeBytes(yys978Slc, true, true) + yys978 := string(yys978Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys945 { + switch yys978 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -13277,9 +13799,9 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.MountPath = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys945) - } // end switch yys945 - } // end for yyj945 + z.DecStructFieldNotFound(-1, yys978) + } // end switch yys978 + } // end for yyj978 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13287,16 +13809,16 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj949 int - var yyb949 bool - var yyhl949 bool = l >= 0 - yyj949++ - if yyhl949 { - yyb949 = yyj949 > l + var yyj982 int + var yyb982 bool + var yyhl982 bool = l >= 0 + yyj982++ + if yyhl982 { + yyb982 = yyj982 > l } else { - yyb949 = r.CheckBreak() + yyb982 = r.CheckBreak() } - if yyb949 { + if yyb982 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13306,13 +13828,13 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj949++ - if yyhl949 { - yyb949 = yyj949 > l + yyj982++ + if yyhl982 { + yyb982 = yyj982 > l } else { - yyb949 = r.CheckBreak() + yyb982 = r.CheckBreak() } - if yyb949 { + if yyb982 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13322,13 +13844,13 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ReadOnly = bool(r.DecodeBool()) } - yyj949++ - if yyhl949 { - yyb949 = yyj949 > l + yyj982++ + if yyhl982 { + yyb982 = yyj982 > l } else { - yyb949 = r.CheckBreak() + yyb982 = r.CheckBreak() } - if yyb949 { + if yyb982 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13339,17 +13861,17 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.MountPath = string(r.DecodeString()) } for { - yyj949++ - if yyhl949 { - yyb949 = yyj949 > l + yyj982++ + if yyhl982 { + yyb982 = yyj982 > l } else { - yyb949 = r.CheckBreak() + yyb982 = r.CheckBreak() } - if yyb949 { + if yyb982 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj949-1, "") + z.DecStructFieldNotFound(yyj982-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13361,35 +13883,35 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym953 := z.EncBinary() - _ = yym953 + yym986 := z.EncBinary() + _ = yym986 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep954 := !z.EncBinary() - yy2arr954 := z.EncBasicHandle().StructToArray - var yyq954 [3]bool - _, _, _ = yysep954, yyq954, yy2arr954 - const yyr954 bool = false - yyq954[1] = x.Value != "" - yyq954[2] = x.ValueFrom != nil - var yynn954 int - if yyr954 || yy2arr954 { + yysep987 := !z.EncBinary() + yy2arr987 := z.EncBasicHandle().StructToArray + var yyq987 [3]bool + _, _, _ = yysep987, yyq987, yy2arr987 + const yyr987 bool = false + yyq987[1] = x.Value != "" + yyq987[2] = x.ValueFrom != nil + var yynn987 int + if yyr987 || yy2arr987 { r.EncodeArrayStart(3) } else { - yynn954 = 1 - for _, b := range yyq954 { + yynn987 = 1 + for _, b := range yyq987 { if b { - yynn954++ + yynn987++ } } - r.EncodeMapStart(yynn954) - yynn954 = 0 + r.EncodeMapStart(yynn987) + yynn987 = 0 } - if yyr954 || yy2arr954 { + if yyr987 || yy2arr987 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym956 := z.EncBinary() - _ = yym956 + yym989 := z.EncBinary() + _ = yym989 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -13398,18 +13920,18 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym957 := z.EncBinary() - _ = yym957 + yym990 := z.EncBinary() + _ = yym990 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr954 || yy2arr954 { + if yyr987 || yy2arr987 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq954[1] { - yym959 := z.EncBinary() - _ = yym959 + if yyq987[1] { + yym992 := z.EncBinary() + _ = yym992 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Value)) @@ -13418,21 +13940,21 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq954[1] { + if yyq987[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("value")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym960 := z.EncBinary() - _ = yym960 + yym993 := z.EncBinary() + _ = yym993 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Value)) } } } - if yyr954 || yy2arr954 { + if yyr987 || yy2arr987 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq954[2] { + if yyq987[2] { if x.ValueFrom == nil { r.EncodeNil() } else { @@ -13442,7 +13964,7 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq954[2] { + if yyq987[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("valueFrom")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13453,7 +13975,7 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr954 || yy2arr954 { + if yyr987 || yy2arr987 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13466,25 +13988,25 @@ func (x *EnvVar) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym962 := z.DecBinary() - _ = yym962 + yym995 := z.DecBinary() + _ = yym995 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct963 := r.ContainerType() - if yyct963 == codecSelferValueTypeMap1234 { - yyl963 := r.ReadMapStart() - if yyl963 == 0 { + yyct996 := r.ContainerType() + if yyct996 == codecSelferValueTypeMap1234 { + yyl996 := r.ReadMapStart() + if yyl996 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl963, d) + x.codecDecodeSelfFromMap(yyl996, d) } - } else if yyct963 == codecSelferValueTypeArray1234 { - yyl963 := r.ReadArrayStart() - if yyl963 == 0 { + } else if yyct996 == codecSelferValueTypeArray1234 { + yyl996 := r.ReadArrayStart() + if yyl996 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl963, d) + x.codecDecodeSelfFromArray(yyl996, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13496,12 +14018,12 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys964Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys964Slc - var yyhl964 bool = l >= 0 - for yyj964 := 0; ; yyj964++ { - if yyhl964 { - if yyj964 >= l { + var yys997Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys997Slc + var yyhl997 bool = l >= 0 + for yyj997 := 0; ; yyj997++ { + if yyhl997 { + if yyj997 >= l { break } } else { @@ -13510,10 +14032,10 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys964Slc = r.DecodeBytes(yys964Slc, true, true) - yys964 := string(yys964Slc) + yys997Slc = r.DecodeBytes(yys997Slc, true, true) + yys997 := string(yys997Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys964 { + switch yys997 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -13538,9 +14060,9 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ValueFrom.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys964) - } // end switch yys964 - } // end for yyj964 + z.DecStructFieldNotFound(-1, yys997) + } // end switch yys997 + } // end for yyj997 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13548,16 +14070,16 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj968 int - var yyb968 bool - var yyhl968 bool = l >= 0 - yyj968++ - if yyhl968 { - yyb968 = yyj968 > l + var yyj1001 int + var yyb1001 bool + var yyhl1001 bool = l >= 0 + yyj1001++ + if yyhl1001 { + yyb1001 = yyj1001 > l } else { - yyb968 = r.CheckBreak() + yyb1001 = r.CheckBreak() } - if yyb968 { + if yyb1001 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13567,13 +14089,13 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj968++ - if yyhl968 { - yyb968 = yyj968 > l + yyj1001++ + if yyhl1001 { + yyb1001 = yyj1001 > l } else { - yyb968 = r.CheckBreak() + yyb1001 = r.CheckBreak() } - if yyb968 { + if yyb1001 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13583,13 +14105,13 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Value = string(r.DecodeString()) } - yyj968++ - if yyhl968 { - yyb968 = yyj968 > l + yyj1001++ + if yyhl1001 { + yyb1001 = yyj1001 > l } else { - yyb968 = r.CheckBreak() + yyb1001 = r.CheckBreak() } - if yyb968 { + if yyb1001 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13605,17 +14127,17 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.ValueFrom.CodecDecodeSelf(d) } for { - yyj968++ - if yyhl968 { - yyb968 = yyj968 > l + yyj1001++ + if yyhl1001 { + yyb1001 = yyj1001 > l } else { - yyb968 = r.CheckBreak() + yyb1001 = r.CheckBreak() } - if yyb968 { + if yyb1001 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj968-1, "") + z.DecStructFieldNotFound(yyj1001-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13627,35 +14149,35 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym972 := z.EncBinary() - _ = yym972 + yym1005 := z.EncBinary() + _ = yym1005 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep973 := !z.EncBinary() - yy2arr973 := z.EncBasicHandle().StructToArray - var yyq973 [3]bool - _, _, _ = yysep973, yyq973, yy2arr973 - const yyr973 bool = false - yyq973[0] = x.FieldRef != nil - yyq973[1] = x.ConfigMapKeyRef != nil - yyq973[2] = x.SecretKeyRef != nil - var yynn973 int - if yyr973 || yy2arr973 { + yysep1006 := !z.EncBinary() + yy2arr1006 := z.EncBasicHandle().StructToArray + var yyq1006 [3]bool + _, _, _ = yysep1006, yyq1006, yy2arr1006 + const yyr1006 bool = false + yyq1006[0] = x.FieldRef != nil + yyq1006[1] = x.ConfigMapKeyRef != nil + yyq1006[2] = x.SecretKeyRef != nil + var yynn1006 int + if yyr1006 || yy2arr1006 { r.EncodeArrayStart(3) } else { - yynn973 = 0 - for _, b := range yyq973 { + yynn1006 = 0 + for _, b := range yyq1006 { if b { - yynn973++ + yynn1006++ } } - r.EncodeMapStart(yynn973) - yynn973 = 0 + r.EncodeMapStart(yynn1006) + yynn1006 = 0 } - if yyr973 || yy2arr973 { + if yyr1006 || yy2arr1006 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq973[0] { + if yyq1006[0] { if x.FieldRef == nil { r.EncodeNil() } else { @@ -13665,7 +14187,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq973[0] { + if yyq1006[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13676,9 +14198,9 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr973 || yy2arr973 { + if yyr1006 || yy2arr1006 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq973[1] { + if yyq1006[1] { if x.ConfigMapKeyRef == nil { r.EncodeNil() } else { @@ -13688,7 +14210,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq973[1] { + if yyq1006[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("configMapKeyRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13699,9 +14221,9 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr973 || yy2arr973 { + if yyr1006 || yy2arr1006 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq973[2] { + if yyq1006[2] { if x.SecretKeyRef == nil { r.EncodeNil() } else { @@ -13711,7 +14233,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq973[2] { + if yyq1006[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretKeyRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13722,7 +14244,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr973 || yy2arr973 { + if yyr1006 || yy2arr1006 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13735,25 +14257,25 @@ func (x *EnvVarSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym977 := z.DecBinary() - _ = yym977 + yym1010 := z.DecBinary() + _ = yym1010 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct978 := r.ContainerType() - if yyct978 == codecSelferValueTypeMap1234 { - yyl978 := r.ReadMapStart() - if yyl978 == 0 { + yyct1011 := r.ContainerType() + if yyct1011 == codecSelferValueTypeMap1234 { + yyl1011 := r.ReadMapStart() + if yyl1011 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl978, d) + x.codecDecodeSelfFromMap(yyl1011, d) } - } else if yyct978 == codecSelferValueTypeArray1234 { - yyl978 := r.ReadArrayStart() - if yyl978 == 0 { + } else if yyct1011 == codecSelferValueTypeArray1234 { + yyl1011 := r.ReadArrayStart() + if yyl1011 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl978, d) + x.codecDecodeSelfFromArray(yyl1011, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13765,12 +14287,12 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys979Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys979Slc - var yyhl979 bool = l >= 0 - for yyj979 := 0; ; yyj979++ { - if yyhl979 { - if yyj979 >= l { + var yys1012Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1012Slc + var yyhl1012 bool = l >= 0 + for yyj1012 := 0; ; yyj1012++ { + if yyhl1012 { + if yyj1012 >= l { break } } else { @@ -13779,10 +14301,10 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys979Slc = r.DecodeBytes(yys979Slc, true, true) - yys979 := string(yys979Slc) + yys1012Slc = r.DecodeBytes(yys1012Slc, true, true) + yys1012 := string(yys1012Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys979 { + switch yys1012 { case "fieldRef": if r.TryDecodeAsNil() { if x.FieldRef != nil { @@ -13817,450 +14339,13 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.SecretKeyRef.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys979) - } // end switch yys979 - } // end for yyj979 + z.DecStructFieldNotFound(-1, yys1012) + } // end switch yys1012 + } // end for yyj1012 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } func (x *EnvVarSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj983 int - var yyb983 bool - var yyhl983 bool = l >= 0 - yyj983++ - if yyhl983 { - yyb983 = yyj983 > l - } else { - yyb983 = r.CheckBreak() - } - if yyb983 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.FieldRef != nil { - x.FieldRef = nil - } - } else { - if x.FieldRef == nil { - x.FieldRef = new(ObjectFieldSelector) - } - x.FieldRef.CodecDecodeSelf(d) - } - yyj983++ - if yyhl983 { - yyb983 = yyj983 > l - } else { - yyb983 = r.CheckBreak() - } - if yyb983 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.ConfigMapKeyRef != nil { - x.ConfigMapKeyRef = nil - } - } else { - if x.ConfigMapKeyRef == nil { - x.ConfigMapKeyRef = new(ConfigMapKeySelector) - } - x.ConfigMapKeyRef.CodecDecodeSelf(d) - } - yyj983++ - if yyhl983 { - yyb983 = yyj983 > l - } else { - yyb983 = r.CheckBreak() - } - if yyb983 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SecretKeyRef != nil { - x.SecretKeyRef = nil - } - } else { - if x.SecretKeyRef == nil { - x.SecretKeyRef = new(SecretKeySelector) - } - x.SecretKeyRef.CodecDecodeSelf(d) - } - for { - yyj983++ - if yyhl983 { - yyb983 = yyj983 > l - } else { - yyb983 = r.CheckBreak() - } - if yyb983 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj983-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ObjectFieldSelector) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym987 := z.EncBinary() - _ = yym987 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep988 := !z.EncBinary() - yy2arr988 := z.EncBasicHandle().StructToArray - var yyq988 [2]bool - _, _, _ = yysep988, yyq988, yy2arr988 - const yyr988 bool = false - var yynn988 int - if yyr988 || yy2arr988 { - r.EncodeArrayStart(2) - } else { - yynn988 = 2 - for _, b := range yyq988 { - if b { - yynn988++ - } - } - r.EncodeMapStart(yynn988) - yynn988 = 0 - } - if yyr988 || yy2arr988 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym990 := z.EncBinary() - _ = yym990 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym991 := z.EncBinary() - _ = yym991 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - if yyr988 || yy2arr988 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym993 := z.EncBinary() - _ = yym993 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym994 := z.EncBinary() - _ = yym994 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) - } - } - if yyr988 || yy2arr988 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ObjectFieldSelector) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym995 := z.DecBinary() - _ = yym995 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct996 := r.ContainerType() - if yyct996 == codecSelferValueTypeMap1234 { - yyl996 := r.ReadMapStart() - if yyl996 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl996, d) - } - } else if yyct996 == codecSelferValueTypeArray1234 { - yyl996 := r.ReadArrayStart() - if yyl996 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl996, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ObjectFieldSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys997Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys997Slc - var yyhl997 bool = l >= 0 - for yyj997 := 0; ; yyj997++ { - if yyhl997 { - if yyj997 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys997Slc = r.DecodeBytes(yys997Slc, true, true) - yys997 := string(yys997Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys997 { - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "fieldPath": - if r.TryDecodeAsNil() { - x.FieldPath = "" - } else { - x.FieldPath = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys997) - } // end switch yys997 - } // end for yyj997 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ObjectFieldSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1000 int - var yyb1000 bool - var yyhl1000 bool = l >= 0 - yyj1000++ - if yyhl1000 { - yyb1000 = yyj1000 > l - } else { - yyb1000 = r.CheckBreak() - } - if yyb1000 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj1000++ - if yyhl1000 { - yyb1000 = yyj1000 > l - } else { - yyb1000 = r.CheckBreak() - } - if yyb1000 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FieldPath = "" - } else { - x.FieldPath = string(r.DecodeString()) - } - for { - yyj1000++ - if yyhl1000 { - yyb1000 = yyj1000 > l - } else { - yyb1000 = r.CheckBreak() - } - if yyb1000 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1000-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ConfigMapKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1003 := z.EncBinary() - _ = yym1003 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1004 := !z.EncBinary() - yy2arr1004 := z.EncBasicHandle().StructToArray - var yyq1004 [2]bool - _, _, _ = yysep1004, yyq1004, yy2arr1004 - const yyr1004 bool = false - var yynn1004 int - if yyr1004 || yy2arr1004 { - r.EncodeArrayStart(2) - } else { - yynn1004 = 2 - for _, b := range yyq1004 { - if b { - yynn1004++ - } - } - r.EncodeMapStart(yynn1004) - yynn1004 = 0 - } - if yyr1004 || yy2arr1004 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1006 := z.EncBinary() - _ = yym1006 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1007 := z.EncBinary() - _ = yym1007 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } - if yyr1004 || yy2arr1004 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1009 := z.EncBinary() - _ = yym1009 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("key")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1010 := z.EncBinary() - _ = yym1010 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } - if yyr1004 || yy2arr1004 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ConfigMapKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1011 := z.DecBinary() - _ = yym1011 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1012 := r.ContainerType() - if yyct1012 == codecSelferValueTypeMap1234 { - yyl1012 := r.ReadMapStart() - if yyl1012 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1012, d) - } - } else if yyct1012 == codecSelferValueTypeArray1234 { - yyl1012 := r.ReadArrayStart() - if yyl1012 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1012, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ConfigMapKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1013Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1013Slc - var yyhl1013 bool = l >= 0 - for yyj1013 := 0; ; yyj1013++ { - if yyhl1013 { - if yyj1013 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1013Slc = r.DecodeBytes(yys1013Slc, true, true) - yys1013 := string(yys1013Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1013 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - case "key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - x.Key = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys1013) - } // end switch yys1013 - } // end for yyj1013 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -14279,9 +14364,14 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Name = "" + if x.FieldRef != nil { + x.FieldRef = nil + } } else { - x.Name = string(r.DecodeString()) + if x.FieldRef == nil { + x.FieldRef = new(ObjectFieldSelector) + } + x.FieldRef.CodecDecodeSelf(d) } yyj1016++ if yyhl1016 { @@ -14295,9 +14385,35 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Key = "" + if x.ConfigMapKeyRef != nil { + x.ConfigMapKeyRef = nil + } } else { - x.Key = string(r.DecodeString()) + if x.ConfigMapKeyRef == nil { + x.ConfigMapKeyRef = new(ConfigMapKeySelector) + } + x.ConfigMapKeyRef.CodecDecodeSelf(d) + } + yyj1016++ + if yyhl1016 { + yyb1016 = yyj1016 > l + } else { + yyb1016 = r.CheckBreak() + } + if yyb1016 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SecretKeyRef != nil { + x.SecretKeyRef = nil + } + } else { + if x.SecretKeyRef == nil { + x.SecretKeyRef = new(SecretKeySelector) + } + x.SecretKeyRef.CodecDecodeSelf(d) } for { yyj1016++ @@ -14315,59 +14431,243 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *ObjectFieldSelector) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym1019 := z.EncBinary() - _ = yym1019 + yym1020 := z.EncBinary() + _ = yym1020 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1020 := !z.EncBinary() - yy2arr1020 := z.EncBasicHandle().StructToArray - var yyq1020 [2]bool - _, _, _ = yysep1020, yyq1020, yy2arr1020 - const yyr1020 bool = false - var yynn1020 int - if yyr1020 || yy2arr1020 { + yysep1021 := !z.EncBinary() + yy2arr1021 := z.EncBasicHandle().StructToArray + var yyq1021 [2]bool + _, _, _ = yysep1021, yyq1021, yy2arr1021 + const yyr1021 bool = false + var yynn1021 int + if yyr1021 || yy2arr1021 { r.EncodeArrayStart(2) } else { - yynn1020 = 2 - for _, b := range yyq1020 { + yynn1021 = 2 + for _, b := range yyq1021 { if b { - yynn1020++ + yynn1021++ } } - r.EncodeMapStart(yynn1020) - yynn1020 = 0 + r.EncodeMapStart(yynn1021) + yynn1021 = 0 } - if yyr1020 || yy2arr1020 { + if yyr1021 || yy2arr1021 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1022 := z.EncBinary() - _ = yym1022 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) yym1023 := z.EncBinary() _ = yym1023 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1024 := z.EncBinary() + _ = yym1024 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } - if yyr1020 || yy2arr1020 { + if yyr1021 || yy2arr1021 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1025 := z.EncBinary() - _ = yym1025 + yym1026 := z.EncBinary() + _ = yym1026 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1027 := z.EncBinary() + _ = yym1027 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) + } + } + if yyr1021 || yy2arr1021 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ObjectFieldSelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1028 := z.DecBinary() + _ = yym1028 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1029 := r.ContainerType() + if yyct1029 == codecSelferValueTypeMap1234 { + yyl1029 := r.ReadMapStart() + if yyl1029 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1029, d) + } + } else if yyct1029 == codecSelferValueTypeArray1234 { + yyl1029 := r.ReadArrayStart() + if yyl1029 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1029, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ObjectFieldSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1030Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1030Slc + var yyhl1030 bool = l >= 0 + for yyj1030 := 0; ; yyj1030++ { + if yyhl1030 { + if yyj1030 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1030Slc = r.DecodeBytes(yys1030Slc, true, true) + yys1030 := string(yys1030Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1030 { + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + case "fieldPath": + if r.TryDecodeAsNil() { + x.FieldPath = "" + } else { + x.FieldPath = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1030) + } // end switch yys1030 + } // end for yyj1030 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ObjectFieldSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1033 int + var yyb1033 bool + var yyhl1033 bool = l >= 0 + yyj1033++ + if yyhl1033 { + yyb1033 = yyj1033 > l + } else { + yyb1033 = r.CheckBreak() + } + if yyb1033 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + yyj1033++ + if yyhl1033 { + yyb1033 = yyj1033 > l + } else { + yyb1033 = r.CheckBreak() + } + if yyb1033 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FieldPath = "" + } else { + x.FieldPath = string(r.DecodeString()) + } + for { + yyj1033++ + if yyhl1033 { + yyb1033 = yyj1033 > l + } else { + yyb1033 = r.CheckBreak() + } + if yyb1033 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1033-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ConfigMapKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1036 := z.EncBinary() + _ = yym1036 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1037 := !z.EncBinary() + yy2arr1037 := z.EncBasicHandle().StructToArray + var yyq1037 [2]bool + _, _, _ = yysep1037, yyq1037, yy2arr1037 + const yyr1037 bool = false + var yynn1037 int + if yyr1037 || yy2arr1037 { + r.EncodeArrayStart(2) + } else { + yynn1037 = 2 + for _, b := range yyq1037 { + if b { + yynn1037++ + } + } + r.EncodeMapStart(yynn1037) + yynn1037 = 0 + } + if yyr1037 || yy2arr1037 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1039 := z.EncBinary() + _ = yym1039 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) @@ -14376,14 +14676,236 @@ func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("key")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1026 := z.EncBinary() - _ = yym1026 + yym1040 := z.EncBinary() + _ = yym1040 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) } } - if yyr1020 || yy2arr1020 { + if yyr1037 || yy2arr1037 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1042 := z.EncBinary() + _ = yym1042 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1043 := z.EncBinary() + _ = yym1043 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + if yyr1037 || yy2arr1037 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ConfigMapKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1044 := z.DecBinary() + _ = yym1044 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1045 := r.ContainerType() + if yyct1045 == codecSelferValueTypeMap1234 { + yyl1045 := r.ReadMapStart() + if yyl1045 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1045, d) + } + } else if yyct1045 == codecSelferValueTypeArray1234 { + yyl1045 := r.ReadArrayStart() + if yyl1045 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1045, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ConfigMapKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1046Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1046Slc + var yyhl1046 bool = l >= 0 + for yyj1046 := 0; ; yyj1046++ { + if yyhl1046 { + if yyj1046 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1046Slc = r.DecodeBytes(yys1046Slc, true, true) + yys1046 := string(yys1046Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1046 { + case "key": + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + case "Name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1046) + } // end switch yys1046 + } // end for yyj1046 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1049 int + var yyb1049 bool + var yyhl1049 bool = l >= 0 + yyj1049++ + if yyhl1049 { + yyb1049 = yyj1049 > l + } else { + yyb1049 = r.CheckBreak() + } + if yyb1049 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + yyj1049++ + if yyhl1049 { + yyb1049 = yyj1049 > l + } else { + yyb1049 = r.CheckBreak() + } + if yyb1049 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + for { + yyj1049++ + if yyhl1049 { + yyb1049 = yyj1049 > l + } else { + yyb1049 = r.CheckBreak() + } + if yyb1049 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1049-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1052 := z.EncBinary() + _ = yym1052 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1053 := !z.EncBinary() + yy2arr1053 := z.EncBasicHandle().StructToArray + var yyq1053 [2]bool + _, _, _ = yysep1053, yyq1053, yy2arr1053 + const yyr1053 bool = false + var yynn1053 int + if yyr1053 || yy2arr1053 { + r.EncodeArrayStart(2) + } else { + yynn1053 = 2 + for _, b := range yyq1053 { + if b { + yynn1053++ + } + } + r.EncodeMapStart(yynn1053) + yynn1053 = 0 + } + if yyr1053 || yy2arr1053 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1055 := z.EncBinary() + _ = yym1055 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("key")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1056 := z.EncBinary() + _ = yym1056 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } + if yyr1053 || yy2arr1053 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1058 := z.EncBinary() + _ = yym1058 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1059 := z.EncBinary() + _ = yym1059 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + if yyr1053 || yy2arr1053 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14396,25 +14918,25 @@ func (x *SecretKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1027 := z.DecBinary() - _ = yym1027 + yym1060 := z.DecBinary() + _ = yym1060 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1028 := r.ContainerType() - if yyct1028 == codecSelferValueTypeMap1234 { - yyl1028 := r.ReadMapStart() - if yyl1028 == 0 { + yyct1061 := r.ContainerType() + if yyct1061 == codecSelferValueTypeMap1234 { + yyl1061 := r.ReadMapStart() + if yyl1061 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1028, d) + x.codecDecodeSelfFromMap(yyl1061, d) } - } else if yyct1028 == codecSelferValueTypeArray1234 { - yyl1028 := r.ReadArrayStart() - if yyl1028 == 0 { + } else if yyct1061 == codecSelferValueTypeArray1234 { + yyl1061 := r.ReadArrayStart() + if yyl1061 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1028, d) + x.codecDecodeSelfFromArray(yyl1061, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14426,12 +14948,12 @@ func (x *SecretKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1029Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1029Slc - var yyhl1029 bool = l >= 0 - for yyj1029 := 0; ; yyj1029++ { - if yyhl1029 { - if yyj1029 >= l { + var yys1062Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1062Slc + var yyhl1062 bool = l >= 0 + for yyj1062 := 0; ; yyj1062++ { + if yyhl1062 { + if yyj1062 >= l { break } } else { @@ -14440,26 +14962,26 @@ func (x *SecretKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1029Slc = r.DecodeBytes(yys1029Slc, true, true) - yys1029 := string(yys1029Slc) + yys1062Slc = r.DecodeBytes(yys1062Slc, true, true) + yys1062 := string(yys1062Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1029 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } + switch yys1062 { case "key": if r.TryDecodeAsNil() { x.Key = "" } else { x.Key = string(r.DecodeString()) } + case "Name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } default: - z.DecStructFieldNotFound(-1, yys1029) - } // end switch yys1029 - } // end for yyj1029 + z.DecStructFieldNotFound(-1, yys1062) + } // end switch yys1062 + } // end for yyj1062 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14467,32 +14989,16 @@ func (x *SecretKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1032 int - var yyb1032 bool - var yyhl1032 bool = l >= 0 - yyj1032++ - if yyhl1032 { - yyb1032 = yyj1032 > l + var yyj1065 int + var yyb1065 bool + var yyhl1065 bool = l >= 0 + yyj1065++ + if yyhl1065 { + yyb1065 = yyj1065 > l } else { - yyb1032 = r.CheckBreak() + yyb1065 = r.CheckBreak() } - if yyb1032 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - yyj1032++ - if yyhl1032 { - yyb1032 = yyj1032 > l - } else { - yyb1032 = r.CheckBreak() - } - if yyb1032 { + if yyb1065 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14502,18 +15008,237 @@ func (x *SecretKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.Key = string(r.DecodeString()) } + yyj1065++ + if yyhl1065 { + yyb1065 = yyj1065 > l + } else { + yyb1065 = r.CheckBreak() + } + if yyb1065 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } for { - yyj1032++ - if yyhl1032 { - yyb1032 = yyj1032 > l + yyj1065++ + if yyhl1065 { + yyb1065 = yyj1065 > l } else { - yyb1032 = r.CheckBreak() + yyb1065 = r.CheckBreak() } - if yyb1032 { + if yyb1065 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1032-1, "") + z.DecStructFieldNotFound(yyj1065-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *HTTPHeader) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1068 := z.EncBinary() + _ = yym1068 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1069 := !z.EncBinary() + yy2arr1069 := z.EncBasicHandle().StructToArray + var yyq1069 [2]bool + _, _, _ = yysep1069, yyq1069, yy2arr1069 + const yyr1069 bool = false + var yynn1069 int + if yyr1069 || yy2arr1069 { + r.EncodeArrayStart(2) + } else { + yynn1069 = 2 + for _, b := range yyq1069 { + if b { + yynn1069++ + } + } + r.EncodeMapStart(yynn1069) + yynn1069 = 0 + } + if yyr1069 || yy2arr1069 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1071 := z.EncBinary() + _ = yym1071 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1072 := z.EncBinary() + _ = yym1072 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + if yyr1069 || yy2arr1069 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1074 := z.EncBinary() + _ = yym1074 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Value)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("value")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1075 := z.EncBinary() + _ = yym1075 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Value)) + } + } + if yyr1069 || yy2arr1069 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HTTPHeader) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1076 := z.DecBinary() + _ = yym1076 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1077 := r.ContainerType() + if yyct1077 == codecSelferValueTypeMap1234 { + yyl1077 := r.ReadMapStart() + if yyl1077 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1077, d) + } + } else if yyct1077 == codecSelferValueTypeArray1234 { + yyl1077 := r.ReadArrayStart() + if yyl1077 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1077, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HTTPHeader) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1078Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1078Slc + var yyhl1078 bool = l >= 0 + for yyj1078 := 0; ; yyj1078++ { + if yyhl1078 { + if yyj1078 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1078Slc = r.DecodeBytes(yys1078Slc, true, true) + yys1078 := string(yys1078Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1078 { + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + case "value": + if r.TryDecodeAsNil() { + x.Value = "" + } else { + x.Value = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1078) + } // end switch yys1078 + } // end for yyj1078 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HTTPHeader) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1081 int + var yyb1081 bool + var yyhl1081 bool = l >= 0 + yyj1081++ + if yyhl1081 { + yyb1081 = yyj1081 > l + } else { + yyb1081 = r.CheckBreak() + } + if yyb1081 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + yyj1081++ + if yyhl1081 { + yyb1081 = yyj1081 > l + } else { + yyb1081 = r.CheckBreak() + } + if yyb1081 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Value = "" + } else { + x.Value = string(r.DecodeString()) + } + for { + yyj1081++ + if yyhl1081 { + yyb1081 = yyj1081 > l + } else { + yyb1081 = r.CheckBreak() + } + if yyb1081 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1081-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14525,38 +15250,39 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1035 := z.EncBinary() - _ = yym1035 + yym1084 := z.EncBinary() + _ = yym1084 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1036 := !z.EncBinary() - yy2arr1036 := z.EncBasicHandle().StructToArray - var yyq1036 [4]bool - _, _, _ = yysep1036, yyq1036, yy2arr1036 - const yyr1036 bool = false - yyq1036[0] = x.Path != "" - yyq1036[1] = true - yyq1036[2] = x.Host != "" - yyq1036[3] = x.Scheme != "" - var yynn1036 int - if yyr1036 || yy2arr1036 { - r.EncodeArrayStart(4) + yysep1085 := !z.EncBinary() + yy2arr1085 := z.EncBasicHandle().StructToArray + var yyq1085 [5]bool + _, _, _ = yysep1085, yyq1085, yy2arr1085 + const yyr1085 bool = false + yyq1085[0] = x.Path != "" + yyq1085[1] = true + yyq1085[2] = x.Host != "" + yyq1085[3] = x.Scheme != "" + yyq1085[4] = len(x.HTTPHeaders) != 0 + var yynn1085 int + if yyr1085 || yy2arr1085 { + r.EncodeArrayStart(5) } else { - yynn1036 = 0 - for _, b := range yyq1036 { + yynn1085 = 0 + for _, b := range yyq1085 { if b { - yynn1036++ + yynn1085++ } } - r.EncodeMapStart(yynn1036) - yynn1036 = 0 + r.EncodeMapStart(yynn1085) + yynn1085 = 0 } - if yyr1036 || yy2arr1036 { + if yyr1085 || yy2arr1085 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1036[0] { - yym1038 := z.EncBinary() - _ = yym1038 + if yyq1085[0] { + yym1087 := z.EncBinary() + _ = yym1087 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -14565,56 +15291,56 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1036[0] { + if yyq1085[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1039 := z.EncBinary() - _ = yym1039 + yym1088 := z.EncBinary() + _ = yym1088 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } } - if yyr1036 || yy2arr1036 { + if yyr1085 || yy2arr1085 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1036[1] { - yy1041 := &x.Port - yym1042 := z.EncBinary() - _ = yym1042 + if yyq1085[1] { + yy1090 := &x.Port + yym1091 := z.EncBinary() + _ = yym1091 if false { - } else if z.HasExtensions() && z.EncExt(yy1041) { - } else if !yym1042 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1041) + } else if z.HasExtensions() && z.EncExt(yy1090) { + } else if !yym1091 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1090) } else { - z.EncFallback(yy1041) + z.EncFallback(yy1090) } } else { r.EncodeNil() } } else { - if yyq1036[1] { + if yyq1085[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1043 := &x.Port - yym1044 := z.EncBinary() - _ = yym1044 + yy1092 := &x.Port + yym1093 := z.EncBinary() + _ = yym1093 if false { - } else if z.HasExtensions() && z.EncExt(yy1043) { - } else if !yym1044 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1043) + } else if z.HasExtensions() && z.EncExt(yy1092) { + } else if !yym1093 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1092) } else { - z.EncFallback(yy1043) + z.EncFallback(yy1092) } } } - if yyr1036 || yy2arr1036 { + if yyr1085 || yy2arr1085 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1036[2] { - yym1046 := z.EncBinary() - _ = yym1046 + if yyq1085[2] { + yym1095 := z.EncBinary() + _ = yym1095 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) @@ -14623,34 +15349,67 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1036[2] { + if yyq1085[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("host")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1047 := z.EncBinary() - _ = yym1047 + yym1096 := z.EncBinary() + _ = yym1096 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) } } } - if yyr1036 || yy2arr1036 { + if yyr1085 || yy2arr1085 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1036[3] { + if yyq1085[3] { x.Scheme.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1036[3] { + if yyq1085[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("scheme")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Scheme.CodecEncodeSelf(e) } } - if yyr1036 || yy2arr1036 { + if yyr1085 || yy2arr1085 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1085[4] { + if x.HTTPHeaders == nil { + r.EncodeNil() + } else { + yym1099 := z.EncBinary() + _ = yym1099 + if false { + } else { + h.encSliceHTTPHeader(([]HTTPHeader)(x.HTTPHeaders), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1085[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("httpHeaders")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.HTTPHeaders == nil { + r.EncodeNil() + } else { + yym1100 := z.EncBinary() + _ = yym1100 + if false { + } else { + h.encSliceHTTPHeader(([]HTTPHeader)(x.HTTPHeaders), e) + } + } + } + } + if yyr1085 || yy2arr1085 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14663,25 +15422,25 @@ func (x *HTTPGetAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1049 := z.DecBinary() - _ = yym1049 + yym1101 := z.DecBinary() + _ = yym1101 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1050 := r.ContainerType() - if yyct1050 == codecSelferValueTypeMap1234 { - yyl1050 := r.ReadMapStart() - if yyl1050 == 0 { + yyct1102 := r.ContainerType() + if yyct1102 == codecSelferValueTypeMap1234 { + yyl1102 := r.ReadMapStart() + if yyl1102 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1050, d) + x.codecDecodeSelfFromMap(yyl1102, d) } - } else if yyct1050 == codecSelferValueTypeArray1234 { - yyl1050 := r.ReadArrayStart() - if yyl1050 == 0 { + } else if yyct1102 == codecSelferValueTypeArray1234 { + yyl1102 := r.ReadArrayStart() + if yyl1102 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1050, d) + x.codecDecodeSelfFromArray(yyl1102, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14693,12 +15452,12 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1051Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1051Slc - var yyhl1051 bool = l >= 0 - for yyj1051 := 0; ; yyj1051++ { - if yyhl1051 { - if yyj1051 >= l { + var yys1103Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1103Slc + var yyhl1103 bool = l >= 0 + for yyj1103 := 0; ; yyj1103++ { + if yyhl1103 { + if yyj1103 >= l { break } } else { @@ -14707,10 +15466,10 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1051Slc = r.DecodeBytes(yys1051Slc, true, true) - yys1051 := string(yys1051Slc) + yys1103Slc = r.DecodeBytes(yys1103Slc, true, true) + yys1103 := string(yys1103Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1051 { + switch yys1103 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -14721,15 +15480,15 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1053 := &x.Port - yym1054 := z.DecBinary() - _ = yym1054 + yyv1105 := &x.Port + yym1106 := z.DecBinary() + _ = yym1106 if false { - } else if z.HasExtensions() && z.DecExt(yyv1053) { - } else if !yym1054 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1053) + } else if z.HasExtensions() && z.DecExt(yyv1105) { + } else if !yym1106 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1105) } else { - z.DecFallback(yyv1053, false) + z.DecFallback(yyv1105, false) } } case "host": @@ -14744,10 +15503,22 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Scheme = URIScheme(r.DecodeString()) } + case "httpHeaders": + if r.TryDecodeAsNil() { + x.HTTPHeaders = nil + } else { + yyv1109 := &x.HTTPHeaders + yym1110 := z.DecBinary() + _ = yym1110 + if false { + } else { + h.decSliceHTTPHeader((*[]HTTPHeader)(yyv1109), d) + } + } default: - z.DecStructFieldNotFound(-1, yys1051) - } // end switch yys1051 - } // end for yyj1051 + z.DecStructFieldNotFound(-1, yys1103) + } // end switch yys1103 + } // end for yyj1103 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14755,16 +15526,16 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1057 int - var yyb1057 bool - var yyhl1057 bool = l >= 0 - yyj1057++ - if yyhl1057 { - yyb1057 = yyj1057 > l + var yyj1111 int + var yyb1111 bool + var yyhl1111 bool = l >= 0 + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l } else { - yyb1057 = r.CheckBreak() + yyb1111 = r.CheckBreak() } - if yyb1057 { + if yyb1111 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14774,13 +15545,13 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Path = string(r.DecodeString()) } - yyj1057++ - if yyhl1057 { - yyb1057 = yyj1057 > l + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l } else { - yyb1057 = r.CheckBreak() + yyb1111 = r.CheckBreak() } - if yyb1057 { + if yyb1111 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14788,24 +15559,24 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1059 := &x.Port - yym1060 := z.DecBinary() - _ = yym1060 + yyv1113 := &x.Port + yym1114 := z.DecBinary() + _ = yym1114 if false { - } else if z.HasExtensions() && z.DecExt(yyv1059) { - } else if !yym1060 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1059) + } else if z.HasExtensions() && z.DecExt(yyv1113) { + } else if !yym1114 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1113) } else { - z.DecFallback(yyv1059, false) + z.DecFallback(yyv1113, false) } } - yyj1057++ - if yyhl1057 { - yyb1057 = yyj1057 > l + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l } else { - yyb1057 = r.CheckBreak() + yyb1111 = r.CheckBreak() } - if yyb1057 { + if yyb1111 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14815,13 +15586,13 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Host = string(r.DecodeString()) } - yyj1057++ - if yyhl1057 { - yyb1057 = yyj1057 > l + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l } else { - yyb1057 = r.CheckBreak() + yyb1111 = r.CheckBreak() } - if yyb1057 { + if yyb1111 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14831,18 +15602,40 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Scheme = URIScheme(r.DecodeString()) } - for { - yyj1057++ - if yyhl1057 { - yyb1057 = yyj1057 > l + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l + } else { + yyb1111 = r.CheckBreak() + } + if yyb1111 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HTTPHeaders = nil + } else { + yyv1117 := &x.HTTPHeaders + yym1118 := z.DecBinary() + _ = yym1118 + if false { } else { - yyb1057 = r.CheckBreak() + h.decSliceHTTPHeader((*[]HTTPHeader)(yyv1117), d) } - if yyb1057 { + } + for { + yyj1111++ + if yyhl1111 { + yyb1111 = yyj1111 > l + } else { + yyb1111 = r.CheckBreak() + } + if yyb1111 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1057-1, "") + z.DecStructFieldNotFound(yyj1111-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14851,8 +15644,8 @@ func (x URIScheme) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1063 := z.EncBinary() - _ = yym1063 + yym1119 := z.EncBinary() + _ = yym1119 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -14864,8 +15657,8 @@ func (x *URIScheme) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1064 := z.DecBinary() - _ = yym1064 + yym1120 := z.DecBinary() + _ = yym1120 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -14880,64 +15673,64 @@ func (x *TCPSocketAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1065 := z.EncBinary() - _ = yym1065 + yym1121 := z.EncBinary() + _ = yym1121 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1066 := !z.EncBinary() - yy2arr1066 := z.EncBasicHandle().StructToArray - var yyq1066 [1]bool - _, _, _ = yysep1066, yyq1066, yy2arr1066 - const yyr1066 bool = false - yyq1066[0] = true - var yynn1066 int - if yyr1066 || yy2arr1066 { + yysep1122 := !z.EncBinary() + yy2arr1122 := z.EncBasicHandle().StructToArray + var yyq1122 [1]bool + _, _, _ = yysep1122, yyq1122, yy2arr1122 + const yyr1122 bool = false + yyq1122[0] = true + var yynn1122 int + if yyr1122 || yy2arr1122 { r.EncodeArrayStart(1) } else { - yynn1066 = 0 - for _, b := range yyq1066 { + yynn1122 = 0 + for _, b := range yyq1122 { if b { - yynn1066++ + yynn1122++ } } - r.EncodeMapStart(yynn1066) - yynn1066 = 0 + r.EncodeMapStart(yynn1122) + yynn1122 = 0 } - if yyr1066 || yy2arr1066 { + if yyr1122 || yy2arr1122 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1066[0] { - yy1068 := &x.Port - yym1069 := z.EncBinary() - _ = yym1069 + if yyq1122[0] { + yy1124 := &x.Port + yym1125 := z.EncBinary() + _ = yym1125 if false { - } else if z.HasExtensions() && z.EncExt(yy1068) { - } else if !yym1069 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1068) + } else if z.HasExtensions() && z.EncExt(yy1124) { + } else if !yym1125 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1124) } else { - z.EncFallback(yy1068) + z.EncFallback(yy1124) } } else { r.EncodeNil() } } else { - if yyq1066[0] { + if yyq1122[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1070 := &x.Port - yym1071 := z.EncBinary() - _ = yym1071 + yy1126 := &x.Port + yym1127 := z.EncBinary() + _ = yym1127 if false { - } else if z.HasExtensions() && z.EncExt(yy1070) { - } else if !yym1071 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1070) + } else if z.HasExtensions() && z.EncExt(yy1126) { + } else if !yym1127 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1126) } else { - z.EncFallback(yy1070) + z.EncFallback(yy1126) } } } - if yyr1066 || yy2arr1066 { + if yyr1122 || yy2arr1122 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14950,25 +15743,25 @@ func (x *TCPSocketAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1072 := z.DecBinary() - _ = yym1072 + yym1128 := z.DecBinary() + _ = yym1128 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1073 := r.ContainerType() - if yyct1073 == codecSelferValueTypeMap1234 { - yyl1073 := r.ReadMapStart() - if yyl1073 == 0 { + yyct1129 := r.ContainerType() + if yyct1129 == codecSelferValueTypeMap1234 { + yyl1129 := r.ReadMapStart() + if yyl1129 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1073, d) + x.codecDecodeSelfFromMap(yyl1129, d) } - } else if yyct1073 == codecSelferValueTypeArray1234 { - yyl1073 := r.ReadArrayStart() - if yyl1073 == 0 { + } else if yyct1129 == codecSelferValueTypeArray1234 { + yyl1129 := r.ReadArrayStart() + if yyl1129 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1073, d) + x.codecDecodeSelfFromArray(yyl1129, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14980,12 +15773,12 @@ func (x *TCPSocketAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1074Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1074Slc - var yyhl1074 bool = l >= 0 - for yyj1074 := 0; ; yyj1074++ { - if yyhl1074 { - if yyj1074 >= l { + var yys1130Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1130Slc + var yyhl1130 bool = l >= 0 + for yyj1130 := 0; ; yyj1130++ { + if yyhl1130 { + if yyj1130 >= l { break } } else { @@ -14994,29 +15787,29 @@ func (x *TCPSocketAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1074Slc = r.DecodeBytes(yys1074Slc, true, true) - yys1074 := string(yys1074Slc) + yys1130Slc = r.DecodeBytes(yys1130Slc, true, true) + yys1130 := string(yys1130Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1074 { + switch yys1130 { case "port": if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1075 := &x.Port - yym1076 := z.DecBinary() - _ = yym1076 + yyv1131 := &x.Port + yym1132 := z.DecBinary() + _ = yym1132 if false { - } else if z.HasExtensions() && z.DecExt(yyv1075) { - } else if !yym1076 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1075) + } else if z.HasExtensions() && z.DecExt(yyv1131) { + } else if !yym1132 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1131) } else { - z.DecFallback(yyv1075, false) + z.DecFallback(yyv1131, false) } } default: - z.DecStructFieldNotFound(-1, yys1074) - } // end switch yys1074 - } // end for yyj1074 + z.DecStructFieldNotFound(-1, yys1130) + } // end switch yys1130 + } // end for yyj1130 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15024,16 +15817,16 @@ func (x *TCPSocketAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1077 int - var yyb1077 bool - var yyhl1077 bool = l >= 0 - yyj1077++ - if yyhl1077 { - yyb1077 = yyj1077 > l + var yyj1133 int + var yyb1133 bool + var yyhl1133 bool = l >= 0 + yyj1133++ + if yyhl1133 { + yyb1133 = yyj1133 > l } else { - yyb1077 = r.CheckBreak() + yyb1133 = r.CheckBreak() } - if yyb1077 { + if yyb1133 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15041,29 +15834,29 @@ func (x *TCPSocketAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1078 := &x.Port - yym1079 := z.DecBinary() - _ = yym1079 + yyv1134 := &x.Port + yym1135 := z.DecBinary() + _ = yym1135 if false { - } else if z.HasExtensions() && z.DecExt(yyv1078) { - } else if !yym1079 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1078) + } else if z.HasExtensions() && z.DecExt(yyv1134) { + } else if !yym1135 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1134) } else { - z.DecFallback(yyv1078, false) + z.DecFallback(yyv1134, false) } } for { - yyj1077++ - if yyhl1077 { - yyb1077 = yyj1077 > l + yyj1133++ + if yyhl1133 { + yyb1133 = yyj1133 > l } else { - yyb1077 = r.CheckBreak() + yyb1133 = r.CheckBreak() } - if yyb1077 { + if yyb1133 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1077-1, "") + z.DecStructFieldNotFound(yyj1133-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15075,38 +15868,38 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1080 := z.EncBinary() - _ = yym1080 + yym1136 := z.EncBinary() + _ = yym1136 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1081 := !z.EncBinary() - yy2arr1081 := z.EncBasicHandle().StructToArray - var yyq1081 [1]bool - _, _, _ = yysep1081, yyq1081, yy2arr1081 - const yyr1081 bool = false - yyq1081[0] = len(x.Command) != 0 - var yynn1081 int - if yyr1081 || yy2arr1081 { + yysep1137 := !z.EncBinary() + yy2arr1137 := z.EncBasicHandle().StructToArray + var yyq1137 [1]bool + _, _, _ = yysep1137, yyq1137, yy2arr1137 + const yyr1137 bool = false + yyq1137[0] = len(x.Command) != 0 + var yynn1137 int + if yyr1137 || yy2arr1137 { r.EncodeArrayStart(1) } else { - yynn1081 = 0 - for _, b := range yyq1081 { + yynn1137 = 0 + for _, b := range yyq1137 { if b { - yynn1081++ + yynn1137++ } } - r.EncodeMapStart(yynn1081) - yynn1081 = 0 + r.EncodeMapStart(yynn1137) + yynn1137 = 0 } - if yyr1081 || yy2arr1081 { + if yyr1137 || yy2arr1137 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1081[0] { + if yyq1137[0] { if x.Command == nil { r.EncodeNil() } else { - yym1083 := z.EncBinary() - _ = yym1083 + yym1139 := z.EncBinary() + _ = yym1139 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -15116,15 +15909,15 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1081[0] { + if yyq1137[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("command")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Command == nil { r.EncodeNil() } else { - yym1084 := z.EncBinary() - _ = yym1084 + yym1140 := z.EncBinary() + _ = yym1140 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -15132,7 +15925,7 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1081 || yy2arr1081 { + if yyr1137 || yy2arr1137 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15145,25 +15938,25 @@ func (x *ExecAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1085 := z.DecBinary() - _ = yym1085 + yym1141 := z.DecBinary() + _ = yym1141 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1086 := r.ContainerType() - if yyct1086 == codecSelferValueTypeMap1234 { - yyl1086 := r.ReadMapStart() - if yyl1086 == 0 { + yyct1142 := r.ContainerType() + if yyct1142 == codecSelferValueTypeMap1234 { + yyl1142 := r.ReadMapStart() + if yyl1142 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1086, d) + x.codecDecodeSelfFromMap(yyl1142, d) } - } else if yyct1086 == codecSelferValueTypeArray1234 { - yyl1086 := r.ReadArrayStart() - if yyl1086 == 0 { + } else if yyct1142 == codecSelferValueTypeArray1234 { + yyl1142 := r.ReadArrayStart() + if yyl1142 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1086, d) + x.codecDecodeSelfFromArray(yyl1142, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15175,12 +15968,12 @@ func (x *ExecAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1087Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1087Slc - var yyhl1087 bool = l >= 0 - for yyj1087 := 0; ; yyj1087++ { - if yyhl1087 { - if yyj1087 >= l { + var yys1143Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1143Slc + var yyhl1143 bool = l >= 0 + for yyj1143 := 0; ; yyj1143++ { + if yyhl1143 { + if yyj1143 >= l { break } } else { @@ -15189,26 +15982,26 @@ func (x *ExecAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1087Slc = r.DecodeBytes(yys1087Slc, true, true) - yys1087 := string(yys1087Slc) + yys1143Slc = r.DecodeBytes(yys1143Slc, true, true) + yys1143 := string(yys1143Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1087 { + switch yys1143 { case "command": if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1088 := &x.Command - yym1089 := z.DecBinary() - _ = yym1089 + yyv1144 := &x.Command + yym1145 := z.DecBinary() + _ = yym1145 if false { } else { - z.F.DecSliceStringX(yyv1088, false, d) + z.F.DecSliceStringX(yyv1144, false, d) } } default: - z.DecStructFieldNotFound(-1, yys1087) - } // end switch yys1087 - } // end for yyj1087 + z.DecStructFieldNotFound(-1, yys1143) + } // end switch yys1143 + } // end for yyj1143 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15216,16 +16009,16 @@ func (x *ExecAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1090 int - var yyb1090 bool - var yyhl1090 bool = l >= 0 - yyj1090++ - if yyhl1090 { - yyb1090 = yyj1090 > l + var yyj1146 int + var yyb1146 bool + var yyhl1146 bool = l >= 0 + yyj1146++ + if yyhl1146 { + yyb1146 = yyj1146 > l } else { - yyb1090 = r.CheckBreak() + yyb1146 = r.CheckBreak() } - if yyb1090 { + if yyb1146 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15233,26 +16026,26 @@ func (x *ExecAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1091 := &x.Command - yym1092 := z.DecBinary() - _ = yym1092 + yyv1147 := &x.Command + yym1148 := z.DecBinary() + _ = yym1148 if false { } else { - z.F.DecSliceStringX(yyv1091, false, d) + z.F.DecSliceStringX(yyv1147, false, d) } } for { - yyj1090++ - if yyhl1090 { - yyb1090 = yyj1090 > l + yyj1146++ + if yyhl1146 { + yyb1146 = yyj1146 > l } else { - yyb1090 = r.CheckBreak() + yyb1146 = r.CheckBreak() } - if yyb1090 { + if yyb1146 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1090-1, "") + z.DecStructFieldNotFound(yyj1146-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15264,153 +16057,42 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1093 := z.EncBinary() - _ = yym1093 + yym1149 := z.EncBinary() + _ = yym1149 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1094 := !z.EncBinary() - yy2arr1094 := z.EncBasicHandle().StructToArray - var yyq1094 [8]bool - _, _, _ = yysep1094, yyq1094, yy2arr1094 - const yyr1094 bool = false - yyq1094[0] = x.Handler.Exec != nil && x.Exec != nil - yyq1094[1] = x.Handler.HTTPGet != nil && x.HTTPGet != nil - yyq1094[2] = x.Handler.TCPSocket != nil && x.TCPSocket != nil - yyq1094[3] = x.InitialDelaySeconds != 0 - yyq1094[4] = x.TimeoutSeconds != 0 - yyq1094[5] = x.PeriodSeconds != 0 - yyq1094[6] = x.SuccessThreshold != 0 - yyq1094[7] = x.FailureThreshold != 0 - var yynn1094 int - if yyr1094 || yy2arr1094 { + yysep1150 := !z.EncBinary() + yy2arr1150 := z.EncBasicHandle().StructToArray + var yyq1150 [8]bool + _, _, _ = yysep1150, yyq1150, yy2arr1150 + const yyr1150 bool = false + yyq1150[0] = x.InitialDelaySeconds != 0 + yyq1150[1] = x.TimeoutSeconds != 0 + yyq1150[2] = x.PeriodSeconds != 0 + yyq1150[3] = x.SuccessThreshold != 0 + yyq1150[4] = x.FailureThreshold != 0 + yyq1150[5] = x.Handler.Exec != nil && x.Exec != nil + yyq1150[6] = x.Handler.HTTPGet != nil && x.HTTPGet != nil + yyq1150[7] = x.Handler.TCPSocket != nil && x.TCPSocket != nil + var yynn1150 int + if yyr1150 || yy2arr1150 { r.EncodeArrayStart(8) } else { - yynn1094 = 0 - for _, b := range yyq1094 { + yynn1150 = 0 + for _, b := range yyq1150 { if b { - yynn1094++ + yynn1150++ } } - r.EncodeMapStart(yynn1094) - yynn1094 = 0 + r.EncodeMapStart(yynn1150) + yynn1150 = 0 } - var yyn1095 bool - if x.Handler.Exec == nil { - yyn1095 = true - goto LABEL1095 - } - LABEL1095: - if yyr1094 || yy2arr1094 { - if yyn1095 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[0] { - if x.Exec == nil { - r.EncodeNil() - } else { - x.Exec.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1094[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("exec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1095 { - r.EncodeNil() - } else { - if x.Exec == nil { - r.EncodeNil() - } else { - x.Exec.CodecEncodeSelf(e) - } - } - } - } - var yyn1096 bool - if x.Handler.HTTPGet == nil { - yyn1096 = true - goto LABEL1096 - } - LABEL1096: - if yyr1094 || yy2arr1094 { - if yyn1096 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[1] { - if x.HTTPGet == nil { - r.EncodeNil() - } else { - x.HTTPGet.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1094[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("httpGet")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1096 { - r.EncodeNil() - } else { - if x.HTTPGet == nil { - r.EncodeNil() - } else { - x.HTTPGet.CodecEncodeSelf(e) - } - } - } - } - var yyn1097 bool - if x.Handler.TCPSocket == nil { - yyn1097 = true - goto LABEL1097 - } - LABEL1097: - if yyr1094 || yy2arr1094 { - if yyn1097 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[2] { - if x.TCPSocket == nil { - r.EncodeNil() - } else { - x.TCPSocket.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1094[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1097 { - r.EncodeNil() - } else { - if x.TCPSocket == nil { - r.EncodeNil() - } else { - x.TCPSocket.CodecEncodeSelf(e) - } - } - } - } - if yyr1094 || yy2arr1094 { + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[3] { - yym1099 := z.EncBinary() - _ = yym1099 + if yyq1150[0] { + yym1152 := z.EncBinary() + _ = yym1152 if false { } else { r.EncodeInt(int64(x.InitialDelaySeconds)) @@ -15419,23 +16101,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1094[3] { + if yyq1150[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("initialDelaySeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1100 := z.EncBinary() - _ = yym1100 + yym1153 := z.EncBinary() + _ = yym1153 if false { } else { r.EncodeInt(int64(x.InitialDelaySeconds)) } } } - if yyr1094 || yy2arr1094 { + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[4] { - yym1102 := z.EncBinary() - _ = yym1102 + if yyq1150[1] { + yym1155 := z.EncBinary() + _ = yym1155 if false { } else { r.EncodeInt(int64(x.TimeoutSeconds)) @@ -15444,23 +16126,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1094[4] { + if yyq1150[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1103 := z.EncBinary() - _ = yym1103 + yym1156 := z.EncBinary() + _ = yym1156 if false { } else { r.EncodeInt(int64(x.TimeoutSeconds)) } } } - if yyr1094 || yy2arr1094 { + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[5] { - yym1105 := z.EncBinary() - _ = yym1105 + if yyq1150[2] { + yym1158 := z.EncBinary() + _ = yym1158 if false { } else { r.EncodeInt(int64(x.PeriodSeconds)) @@ -15469,23 +16151,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1094[5] { + if yyq1150[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("periodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1106 := z.EncBinary() - _ = yym1106 + yym1159 := z.EncBinary() + _ = yym1159 if false { } else { r.EncodeInt(int64(x.PeriodSeconds)) } } } - if yyr1094 || yy2arr1094 { + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[6] { - yym1108 := z.EncBinary() - _ = yym1108 + if yyq1150[3] { + yym1161 := z.EncBinary() + _ = yym1161 if false { } else { r.EncodeInt(int64(x.SuccessThreshold)) @@ -15494,23 +16176,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1094[6] { + if yyq1150[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("successThreshold")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1109 := z.EncBinary() - _ = yym1109 + yym1162 := z.EncBinary() + _ = yym1162 if false { } else { r.EncodeInt(int64(x.SuccessThreshold)) } } } - if yyr1094 || yy2arr1094 { + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1094[7] { - yym1111 := z.EncBinary() - _ = yym1111 + if yyq1150[4] { + yym1164 := z.EncBinary() + _ = yym1164 if false { } else { r.EncodeInt(int64(x.FailureThreshold)) @@ -15519,19 +16201,130 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1094[7] { + if yyq1150[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("failureThreshold")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1112 := z.EncBinary() - _ = yym1112 + yym1165 := z.EncBinary() + _ = yym1165 if false { } else { r.EncodeInt(int64(x.FailureThreshold)) } } } - if yyr1094 || yy2arr1094 { + var yyn1166 bool + if x.Handler.Exec == nil { + yyn1166 = true + goto LABEL1166 + } + LABEL1166: + if yyr1150 || yy2arr1150 { + if yyn1166 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1150[5] { + if x.Exec == nil { + r.EncodeNil() + } else { + x.Exec.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1150[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("exec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1166 { + r.EncodeNil() + } else { + if x.Exec == nil { + r.EncodeNil() + } else { + x.Exec.CodecEncodeSelf(e) + } + } + } + } + var yyn1167 bool + if x.Handler.HTTPGet == nil { + yyn1167 = true + goto LABEL1167 + } + LABEL1167: + if yyr1150 || yy2arr1150 { + if yyn1167 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1150[6] { + if x.HTTPGet == nil { + r.EncodeNil() + } else { + x.HTTPGet.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1150[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("httpGet")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1167 { + r.EncodeNil() + } else { + if x.HTTPGet == nil { + r.EncodeNil() + } else { + x.HTTPGet.CodecEncodeSelf(e) + } + } + } + } + var yyn1168 bool + if x.Handler.TCPSocket == nil { + yyn1168 = true + goto LABEL1168 + } + LABEL1168: + if yyr1150 || yy2arr1150 { + if yyn1168 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1150[7] { + if x.TCPSocket == nil { + r.EncodeNil() + } else { + x.TCPSocket.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1150[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1168 { + r.EncodeNil() + } else { + if x.TCPSocket == nil { + r.EncodeNil() + } else { + x.TCPSocket.CodecEncodeSelf(e) + } + } + } + } + if yyr1150 || yy2arr1150 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15544,25 +16337,25 @@ func (x *Probe) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1113 := z.DecBinary() - _ = yym1113 + yym1169 := z.DecBinary() + _ = yym1169 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1114 := r.ContainerType() - if yyct1114 == codecSelferValueTypeMap1234 { - yyl1114 := r.ReadMapStart() - if yyl1114 == 0 { + yyct1170 := r.ContainerType() + if yyct1170 == codecSelferValueTypeMap1234 { + yyl1170 := r.ReadMapStart() + if yyl1170 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1114, d) + x.codecDecodeSelfFromMap(yyl1170, d) } - } else if yyct1114 == codecSelferValueTypeArray1234 { - yyl1114 := r.ReadArrayStart() - if yyl1114 == 0 { + } else if yyct1170 == codecSelferValueTypeArray1234 { + yyl1170 := r.ReadArrayStart() + if yyl1170 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1114, d) + x.codecDecodeSelfFromArray(yyl1170, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15574,12 +16367,12 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1115Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1115Slc - var yyhl1115 bool = l >= 0 - for yyj1115 := 0; ; yyj1115++ { - if yyhl1115 { - if yyj1115 >= l { + var yys1171Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1171Slc + var yyhl1171 bool = l >= 0 + for yyj1171 := 0; ; yyj1171++ { + if yyhl1171 { + if yyj1171 >= l { break } } else { @@ -15588,10 +16381,40 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1115Slc = r.DecodeBytes(yys1115Slc, true, true) - yys1115 := string(yys1115Slc) + yys1171Slc = r.DecodeBytes(yys1171Slc, true, true) + yys1171 := string(yys1171Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1115 { + switch yys1171 { + case "initialDelaySeconds": + if r.TryDecodeAsNil() { + x.InitialDelaySeconds = 0 + } else { + x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "timeoutSeconds": + if r.TryDecodeAsNil() { + x.TimeoutSeconds = 0 + } else { + x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "periodSeconds": + if r.TryDecodeAsNil() { + x.PeriodSeconds = 0 + } else { + x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "successThreshold": + if r.TryDecodeAsNil() { + x.SuccessThreshold = 0 + } else { + x.SuccessThreshold = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "failureThreshold": + if r.TryDecodeAsNil() { + x.FailureThreshold = 0 + } else { + x.FailureThreshold = int(r.DecodeInt(codecSelferBitsize1234)) + } case "exec": if x.Handler.Exec == nil { x.Handler.Exec = new(ExecAction) @@ -15634,40 +16457,10 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.TCPSocket.CodecDecodeSelf(d) } - case "initialDelaySeconds": - if r.TryDecodeAsNil() { - x.InitialDelaySeconds = 0 - } else { - x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "timeoutSeconds": - if r.TryDecodeAsNil() { - x.TimeoutSeconds = 0 - } else { - x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "periodSeconds": - if r.TryDecodeAsNil() { - x.PeriodSeconds = 0 - } else { - x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "successThreshold": - if r.TryDecodeAsNil() { - x.SuccessThreshold = 0 - } else { - x.SuccessThreshold = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "failureThreshold": - if r.TryDecodeAsNil() { - x.FailureThreshold = 0 - } else { - x.FailureThreshold = int(r.DecodeInt(codecSelferBitsize1234)) - } default: - z.DecStructFieldNotFound(-1, yys1115) - } // end switch yys1115 - } // end for yyj1115 + z.DecStructFieldNotFound(-1, yys1171) + } // end switch yys1171 + } // end for yyj1171 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15675,19 +16468,99 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1124 int - var yyb1124 bool - var yyhl1124 bool = l >= 0 + var yyj1180 int + var yyb1180 bool + var yyhl1180 bool = l >= 0 + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l + } else { + yyb1180 = r.CheckBreak() + } + if yyb1180 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.InitialDelaySeconds = 0 + } else { + x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l + } else { + yyb1180 = r.CheckBreak() + } + if yyb1180 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TimeoutSeconds = 0 + } else { + x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l + } else { + yyb1180 = r.CheckBreak() + } + if yyb1180 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PeriodSeconds = 0 + } else { + x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l + } else { + yyb1180 = r.CheckBreak() + } + if yyb1180 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SuccessThreshold = 0 + } else { + x.SuccessThreshold = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l + } else { + yyb1180 = r.CheckBreak() + } + if yyb1180 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FailureThreshold = 0 + } else { + x.FailureThreshold = int(r.DecodeInt(codecSelferBitsize1234)) + } if x.Handler.Exec == nil { x.Handler.Exec = new(ExecAction) } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l } else { - yyb1124 = r.CheckBreak() + yyb1180 = r.CheckBreak() } - if yyb1124 { + if yyb1180 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15705,13 +16578,13 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Handler.HTTPGet == nil { x.Handler.HTTPGet = new(HTTPGetAction) } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l } else { - yyb1124 = r.CheckBreak() + yyb1180 = r.CheckBreak() } - if yyb1124 { + if yyb1180 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15729,13 +16602,13 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Handler.TCPSocket == nil { x.Handler.TCPSocket = new(TCPSocketAction) } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l } else { - yyb1124 = r.CheckBreak() + yyb1180 = r.CheckBreak() } - if yyb1124 { + if yyb1180 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15750,98 +16623,18 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.TCPSocket.CodecDecodeSelf(d) } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l - } else { - yyb1124 = r.CheckBreak() - } - if yyb1124 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.InitialDelaySeconds = 0 - } else { - x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l - } else { - yyb1124 = r.CheckBreak() - } - if yyb1124 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TimeoutSeconds = 0 - } else { - x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l - } else { - yyb1124 = r.CheckBreak() - } - if yyb1124 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PeriodSeconds = 0 - } else { - x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l - } else { - yyb1124 = r.CheckBreak() - } - if yyb1124 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.SuccessThreshold = 0 - } else { - x.SuccessThreshold = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l - } else { - yyb1124 = r.CheckBreak() - } - if yyb1124 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FailureThreshold = 0 - } else { - x.FailureThreshold = int(r.DecodeInt(codecSelferBitsize1234)) - } for { - yyj1124++ - if yyhl1124 { - yyb1124 = yyj1124 > l + yyj1180++ + if yyhl1180 { + yyb1180 = yyj1180 > l } else { - yyb1124 = r.CheckBreak() + yyb1180 = r.CheckBreak() } - if yyb1124 { + if yyb1180 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1124-1, "") + z.DecStructFieldNotFound(yyj1180-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15850,8 +16643,8 @@ func (x PullPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1133 := z.EncBinary() - _ = yym1133 + yym1189 := z.EncBinary() + _ = yym1189 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -15863,8 +16656,8 @@ func (x *PullPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1134 := z.DecBinary() - _ = yym1134 + yym1190 := z.DecBinary() + _ = yym1190 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -15876,8 +16669,8 @@ func (x Capability) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1135 := z.EncBinary() - _ = yym1135 + yym1191 := z.EncBinary() + _ = yym1191 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -15889,8 +16682,8 @@ func (x *Capability) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1136 := z.DecBinary() - _ = yym1136 + yym1192 := z.DecBinary() + _ = yym1192 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -15905,39 +16698,39 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1137 := z.EncBinary() - _ = yym1137 + yym1193 := z.EncBinary() + _ = yym1193 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1138 := !z.EncBinary() - yy2arr1138 := z.EncBasicHandle().StructToArray - var yyq1138 [2]bool - _, _, _ = yysep1138, yyq1138, yy2arr1138 - const yyr1138 bool = false - yyq1138[0] = len(x.Add) != 0 - yyq1138[1] = len(x.Drop) != 0 - var yynn1138 int - if yyr1138 || yy2arr1138 { + yysep1194 := !z.EncBinary() + yy2arr1194 := z.EncBasicHandle().StructToArray + var yyq1194 [2]bool + _, _, _ = yysep1194, yyq1194, yy2arr1194 + const yyr1194 bool = false + yyq1194[0] = len(x.Add) != 0 + yyq1194[1] = len(x.Drop) != 0 + var yynn1194 int + if yyr1194 || yy2arr1194 { r.EncodeArrayStart(2) } else { - yynn1138 = 0 - for _, b := range yyq1138 { + yynn1194 = 0 + for _, b := range yyq1194 { if b { - yynn1138++ + yynn1194++ } } - r.EncodeMapStart(yynn1138) - yynn1138 = 0 + r.EncodeMapStart(yynn1194) + yynn1194 = 0 } - if yyr1138 || yy2arr1138 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1138[0] { + if yyq1194[0] { if x.Add == nil { r.EncodeNil() } else { - yym1140 := z.EncBinary() - _ = yym1140 + yym1196 := z.EncBinary() + _ = yym1196 if false { } else { h.encSliceCapability(([]Capability)(x.Add), e) @@ -15947,15 +16740,15 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1138[0] { + if yyq1194[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("add")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Add == nil { r.EncodeNil() } else { - yym1141 := z.EncBinary() - _ = yym1141 + yym1197 := z.EncBinary() + _ = yym1197 if false { } else { h.encSliceCapability(([]Capability)(x.Add), e) @@ -15963,14 +16756,14 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1138 || yy2arr1138 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1138[1] { + if yyq1194[1] { if x.Drop == nil { r.EncodeNil() } else { - yym1143 := z.EncBinary() - _ = yym1143 + yym1199 := z.EncBinary() + _ = yym1199 if false { } else { h.encSliceCapability(([]Capability)(x.Drop), e) @@ -15980,15 +16773,15 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1138[1] { + if yyq1194[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("drop")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Drop == nil { r.EncodeNil() } else { - yym1144 := z.EncBinary() - _ = yym1144 + yym1200 := z.EncBinary() + _ = yym1200 if false { } else { h.encSliceCapability(([]Capability)(x.Drop), e) @@ -15996,7 +16789,7 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1138 || yy2arr1138 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16009,25 +16802,25 @@ func (x *Capabilities) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1145 := z.DecBinary() - _ = yym1145 + yym1201 := z.DecBinary() + _ = yym1201 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1146 := r.ContainerType() - if yyct1146 == codecSelferValueTypeMap1234 { - yyl1146 := r.ReadMapStart() - if yyl1146 == 0 { + yyct1202 := r.ContainerType() + if yyct1202 == codecSelferValueTypeMap1234 { + yyl1202 := r.ReadMapStart() + if yyl1202 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1146, d) + x.codecDecodeSelfFromMap(yyl1202, d) } - } else if yyct1146 == codecSelferValueTypeArray1234 { - yyl1146 := r.ReadArrayStart() - if yyl1146 == 0 { + } else if yyct1202 == codecSelferValueTypeArray1234 { + yyl1202 := r.ReadArrayStart() + if yyl1202 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1146, d) + x.codecDecodeSelfFromArray(yyl1202, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16039,12 +16832,12 @@ func (x *Capabilities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1147Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1147Slc - var yyhl1147 bool = l >= 0 - for yyj1147 := 0; ; yyj1147++ { - if yyhl1147 { - if yyj1147 >= l { + var yys1203Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1203Slc + var yyhl1203 bool = l >= 0 + for yyj1203 := 0; ; yyj1203++ { + if yyhl1203 { + if yyj1203 >= l { break } } else { @@ -16053,38 +16846,38 @@ func (x *Capabilities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1147Slc = r.DecodeBytes(yys1147Slc, true, true) - yys1147 := string(yys1147Slc) + yys1203Slc = r.DecodeBytes(yys1203Slc, true, true) + yys1203 := string(yys1203Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1147 { + switch yys1203 { case "add": if r.TryDecodeAsNil() { x.Add = nil } else { - yyv1148 := &x.Add - yym1149 := z.DecBinary() - _ = yym1149 + yyv1204 := &x.Add + yym1205 := z.DecBinary() + _ = yym1205 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1148), d) + h.decSliceCapability((*[]Capability)(yyv1204), d) } } case "drop": if r.TryDecodeAsNil() { x.Drop = nil } else { - yyv1150 := &x.Drop - yym1151 := z.DecBinary() - _ = yym1151 + yyv1206 := &x.Drop + yym1207 := z.DecBinary() + _ = yym1207 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1150), d) + h.decSliceCapability((*[]Capability)(yyv1206), d) } } default: - z.DecStructFieldNotFound(-1, yys1147) - } // end switch yys1147 - } // end for yyj1147 + z.DecStructFieldNotFound(-1, yys1203) + } // end switch yys1203 + } // end for yyj1203 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16092,16 +16885,16 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1152 int - var yyb1152 bool - var yyhl1152 bool = l >= 0 - yyj1152++ - if yyhl1152 { - yyb1152 = yyj1152 > l + var yyj1208 int + var yyb1208 bool + var yyhl1208 bool = l >= 0 + yyj1208++ + if yyhl1208 { + yyb1208 = yyj1208 > l } else { - yyb1152 = r.CheckBreak() + yyb1208 = r.CheckBreak() } - if yyb1152 { + if yyb1208 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16109,21 +16902,21 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Add = nil } else { - yyv1153 := &x.Add - yym1154 := z.DecBinary() - _ = yym1154 + yyv1209 := &x.Add + yym1210 := z.DecBinary() + _ = yym1210 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1153), d) + h.decSliceCapability((*[]Capability)(yyv1209), d) } } - yyj1152++ - if yyhl1152 { - yyb1152 = yyj1152 > l + yyj1208++ + if yyhl1208 { + yyb1208 = yyj1208 > l } else { - yyb1152 = r.CheckBreak() + yyb1208 = r.CheckBreak() } - if yyb1152 { + if yyb1208 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16131,26 +16924,26 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Drop = nil } else { - yyv1155 := &x.Drop - yym1156 := z.DecBinary() - _ = yym1156 + yyv1211 := &x.Drop + yym1212 := z.DecBinary() + _ = yym1212 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1155), d) + h.decSliceCapability((*[]Capability)(yyv1211), d) } } for { - yyj1152++ - if yyhl1152 { - yyb1152 = yyj1152 > l + yyj1208++ + if yyhl1208 { + yyb1208 = yyj1208 > l } else { - yyb1152 = r.CheckBreak() + yyb1208 = r.CheckBreak() } - if yyb1152 { + if yyb1208 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1152-1, "") + z.DecStructFieldNotFound(yyj1208-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16162,34 +16955,34 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1157 := z.EncBinary() - _ = yym1157 + yym1213 := z.EncBinary() + _ = yym1213 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1158 := !z.EncBinary() - yy2arr1158 := z.EncBasicHandle().StructToArray - var yyq1158 [2]bool - _, _, _ = yysep1158, yyq1158, yy2arr1158 - const yyr1158 bool = false - yyq1158[0] = len(x.Limits) != 0 - yyq1158[1] = len(x.Requests) != 0 - var yynn1158 int - if yyr1158 || yy2arr1158 { + yysep1214 := !z.EncBinary() + yy2arr1214 := z.EncBasicHandle().StructToArray + var yyq1214 [2]bool + _, _, _ = yysep1214, yyq1214, yy2arr1214 + const yyr1214 bool = false + yyq1214[0] = len(x.Limits) != 0 + yyq1214[1] = len(x.Requests) != 0 + var yynn1214 int + if yyr1214 || yy2arr1214 { r.EncodeArrayStart(2) } else { - yynn1158 = 0 - for _, b := range yyq1158 { + yynn1214 = 0 + for _, b := range yyq1214 { if b { - yynn1158++ + yynn1214++ } } - r.EncodeMapStart(yynn1158) - yynn1158 = 0 + r.EncodeMapStart(yynn1214) + yynn1214 = 0 } - if yyr1158 || yy2arr1158 { + if yyr1214 || yy2arr1214 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1158[0] { + if yyq1214[0] { if x.Limits == nil { r.EncodeNil() } else { @@ -16199,7 +16992,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1158[0] { + if yyq1214[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("limits")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16210,9 +17003,9 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1158 || yy2arr1158 { + if yyr1214 || yy2arr1214 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1158[1] { + if yyq1214[1] { if x.Requests == nil { r.EncodeNil() } else { @@ -16222,7 +17015,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1158[1] { + if yyq1214[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("requests")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16233,7 +17026,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1158 || yy2arr1158 { + if yyr1214 || yy2arr1214 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16246,25 +17039,25 @@ func (x *ResourceRequirements) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1161 := z.DecBinary() - _ = yym1161 + yym1217 := z.DecBinary() + _ = yym1217 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1162 := r.ContainerType() - if yyct1162 == codecSelferValueTypeMap1234 { - yyl1162 := r.ReadMapStart() - if yyl1162 == 0 { + yyct1218 := r.ContainerType() + if yyct1218 == codecSelferValueTypeMap1234 { + yyl1218 := r.ReadMapStart() + if yyl1218 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1162, d) + x.codecDecodeSelfFromMap(yyl1218, d) } - } else if yyct1162 == codecSelferValueTypeArray1234 { - yyl1162 := r.ReadArrayStart() - if yyl1162 == 0 { + } else if yyct1218 == codecSelferValueTypeArray1234 { + yyl1218 := r.ReadArrayStart() + if yyl1218 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1162, d) + x.codecDecodeSelfFromArray(yyl1218, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16276,12 +17069,12 @@ func (x *ResourceRequirements) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1163Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1163Slc - var yyhl1163 bool = l >= 0 - for yyj1163 := 0; ; yyj1163++ { - if yyhl1163 { - if yyj1163 >= l { + var yys1219Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1219Slc + var yyhl1219 bool = l >= 0 + for yyj1219 := 0; ; yyj1219++ { + if yyhl1219 { + if yyj1219 >= l { break } } else { @@ -16290,28 +17083,28 @@ func (x *ResourceRequirements) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1163Slc = r.DecodeBytes(yys1163Slc, true, true) - yys1163 := string(yys1163Slc) + yys1219Slc = r.DecodeBytes(yys1219Slc, true, true) + yys1219 := string(yys1219Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1163 { + switch yys1219 { case "limits": if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv1164 := &x.Limits - yyv1164.CodecDecodeSelf(d) + yyv1220 := &x.Limits + yyv1220.CodecDecodeSelf(d) } case "requests": if r.TryDecodeAsNil() { x.Requests = nil } else { - yyv1165 := &x.Requests - yyv1165.CodecDecodeSelf(d) + yyv1221 := &x.Requests + yyv1221.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1163) - } // end switch yys1163 - } // end for yyj1163 + z.DecStructFieldNotFound(-1, yys1219) + } // end switch yys1219 + } // end for yyj1219 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16319,16 +17112,16 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1166 int - var yyb1166 bool - var yyhl1166 bool = l >= 0 - yyj1166++ - if yyhl1166 { - yyb1166 = yyj1166 > l + var yyj1222 int + var yyb1222 bool + var yyhl1222 bool = l >= 0 + yyj1222++ + if yyhl1222 { + yyb1222 = yyj1222 > l } else { - yyb1166 = r.CheckBreak() + yyb1222 = r.CheckBreak() } - if yyb1166 { + if yyb1222 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16336,16 +17129,16 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv1167 := &x.Limits - yyv1167.CodecDecodeSelf(d) + yyv1223 := &x.Limits + yyv1223.CodecDecodeSelf(d) } - yyj1166++ - if yyhl1166 { - yyb1166 = yyj1166 > l + yyj1222++ + if yyhl1222 { + yyb1222 = yyj1222 > l } else { - yyb1166 = r.CheckBreak() + yyb1222 = r.CheckBreak() } - if yyb1166 { + if yyb1222 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16353,21 +17146,21 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Requests = nil } else { - yyv1168 := &x.Requests - yyv1168.CodecDecodeSelf(d) + yyv1224 := &x.Requests + yyv1224.CodecDecodeSelf(d) } for { - yyj1166++ - if yyhl1166 { - yyb1166 = yyj1166 > l + yyj1222++ + if yyhl1222 { + yyb1222 = yyj1222 > l } else { - yyb1166 = r.CheckBreak() + yyb1222 = r.CheckBreak() } - if yyb1166 { + if yyb1222 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1166-1, "") + z.DecStructFieldNotFound(yyj1222-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16379,48 +17172,48 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1169 := z.EncBinary() - _ = yym1169 + yym1225 := z.EncBinary() + _ = yym1225 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1170 := !z.EncBinary() - yy2arr1170 := z.EncBasicHandle().StructToArray - var yyq1170 [18]bool - _, _, _ = yysep1170, yyq1170, yy2arr1170 - const yyr1170 bool = false - yyq1170[2] = len(x.Command) != 0 - yyq1170[3] = len(x.Args) != 0 - yyq1170[4] = x.WorkingDir != "" - yyq1170[5] = len(x.Ports) != 0 - yyq1170[6] = len(x.Env) != 0 - yyq1170[7] = true - yyq1170[8] = len(x.VolumeMounts) != 0 - yyq1170[9] = x.LivenessProbe != nil - yyq1170[10] = x.ReadinessProbe != nil - yyq1170[11] = x.Lifecycle != nil - yyq1170[12] = x.TerminationMessagePath != "" - yyq1170[14] = x.SecurityContext != nil - yyq1170[15] = x.Stdin != false - yyq1170[16] = x.StdinOnce != false - yyq1170[17] = x.TTY != false - var yynn1170 int - if yyr1170 || yy2arr1170 { + yysep1226 := !z.EncBinary() + yy2arr1226 := z.EncBasicHandle().StructToArray + var yyq1226 [18]bool + _, _, _ = yysep1226, yyq1226, yy2arr1226 + const yyr1226 bool = false + yyq1226[2] = len(x.Command) != 0 + yyq1226[3] = len(x.Args) != 0 + yyq1226[4] = x.WorkingDir != "" + yyq1226[5] = len(x.Ports) != 0 + yyq1226[6] = len(x.Env) != 0 + yyq1226[7] = true + yyq1226[8] = len(x.VolumeMounts) != 0 + yyq1226[9] = x.LivenessProbe != nil + yyq1226[10] = x.ReadinessProbe != nil + yyq1226[11] = x.Lifecycle != nil + yyq1226[12] = x.TerminationMessagePath != "" + yyq1226[14] = x.SecurityContext != nil + yyq1226[15] = x.Stdin != false + yyq1226[16] = x.StdinOnce != false + yyq1226[17] = x.TTY != false + var yynn1226 int + if yyr1226 || yy2arr1226 { r.EncodeArrayStart(18) } else { - yynn1170 = 3 - for _, b := range yyq1170 { + yynn1226 = 3 + for _, b := range yyq1226 { if b { - yynn1170++ + yynn1226++ } } - r.EncodeMapStart(yynn1170) - yynn1170 = 0 + r.EncodeMapStart(yynn1226) + yynn1226 = 0 } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1172 := z.EncBinary() - _ = yym1172 + yym1228 := z.EncBinary() + _ = yym1228 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -16429,17 +17222,17 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1173 := z.EncBinary() - _ = yym1173 + yym1229 := z.EncBinary() + _ = yym1229 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1175 := z.EncBinary() - _ = yym1175 + yym1231 := z.EncBinary() + _ = yym1231 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) @@ -16448,21 +17241,21 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1176 := z.EncBinary() - _ = yym1176 + yym1232 := z.EncBinary() + _ = yym1232 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[2] { + if yyq1226[2] { if x.Command == nil { r.EncodeNil() } else { - yym1178 := z.EncBinary() - _ = yym1178 + yym1234 := z.EncBinary() + _ = yym1234 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -16472,15 +17265,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[2] { + if yyq1226[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("command")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Command == nil { r.EncodeNil() } else { - yym1179 := z.EncBinary() - _ = yym1179 + yym1235 := z.EncBinary() + _ = yym1235 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -16488,14 +17281,14 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[3] { + if yyq1226[3] { if x.Args == nil { r.EncodeNil() } else { - yym1181 := z.EncBinary() - _ = yym1181 + yym1237 := z.EncBinary() + _ = yym1237 if false { } else { z.F.EncSliceStringV(x.Args, false, e) @@ -16505,15 +17298,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[3] { + if yyq1226[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("args")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Args == nil { r.EncodeNil() } else { - yym1182 := z.EncBinary() - _ = yym1182 + yym1238 := z.EncBinary() + _ = yym1238 if false { } else { z.F.EncSliceStringV(x.Args, false, e) @@ -16521,11 +17314,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[4] { - yym1184 := z.EncBinary() - _ = yym1184 + if yyq1226[4] { + yym1240 := z.EncBinary() + _ = yym1240 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.WorkingDir)) @@ -16534,26 +17327,26 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1170[4] { + if yyq1226[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("workingDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1185 := z.EncBinary() - _ = yym1185 + yym1241 := z.EncBinary() + _ = yym1241 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.WorkingDir)) } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[5] { + if yyq1226[5] { if x.Ports == nil { r.EncodeNil() } else { - yym1187 := z.EncBinary() - _ = yym1187 + yym1243 := z.EncBinary() + _ = yym1243 if false { } else { h.encSliceContainerPort(([]ContainerPort)(x.Ports), e) @@ -16563,15 +17356,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[5] { + if yyq1226[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ports")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Ports == nil { r.EncodeNil() } else { - yym1188 := z.EncBinary() - _ = yym1188 + yym1244 := z.EncBinary() + _ = yym1244 if false { } else { h.encSliceContainerPort(([]ContainerPort)(x.Ports), e) @@ -16579,14 +17372,14 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[6] { + if yyq1226[6] { if x.Env == nil { r.EncodeNil() } else { - yym1190 := z.EncBinary() - _ = yym1190 + yym1246 := z.EncBinary() + _ = yym1246 if false { } else { h.encSliceEnvVar(([]EnvVar)(x.Env), e) @@ -16596,15 +17389,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[6] { + if yyq1226[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("env")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Env == nil { r.EncodeNil() } else { - yym1191 := z.EncBinary() - _ = yym1191 + yym1247 := z.EncBinary() + _ = yym1247 if false { } else { h.encSliceEnvVar(([]EnvVar)(x.Env), e) @@ -16612,31 +17405,31 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[7] { - yy1193 := &x.Resources - yy1193.CodecEncodeSelf(e) + if yyq1226[7] { + yy1249 := &x.Resources + yy1249.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1170[7] { + if yyq1226[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1194 := &x.Resources - yy1194.CodecEncodeSelf(e) + yy1250 := &x.Resources + yy1250.CodecEncodeSelf(e) } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[8] { + if yyq1226[8] { if x.VolumeMounts == nil { r.EncodeNil() } else { - yym1196 := z.EncBinary() - _ = yym1196 + yym1252 := z.EncBinary() + _ = yym1252 if false { } else { h.encSliceVolumeMount(([]VolumeMount)(x.VolumeMounts), e) @@ -16646,15 +17439,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[8] { + if yyq1226[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeMounts")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.VolumeMounts == nil { r.EncodeNil() } else { - yym1197 := z.EncBinary() - _ = yym1197 + yym1253 := z.EncBinary() + _ = yym1253 if false { } else { h.encSliceVolumeMount(([]VolumeMount)(x.VolumeMounts), e) @@ -16662,9 +17455,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[9] { + if yyq1226[9] { if x.LivenessProbe == nil { r.EncodeNil() } else { @@ -16674,7 +17467,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[9] { + if yyq1226[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("livenessProbe")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16685,9 +17478,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[10] { + if yyq1226[10] { if x.ReadinessProbe == nil { r.EncodeNil() } else { @@ -16697,7 +17490,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[10] { + if yyq1226[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readinessProbe")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16708,9 +17501,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[11] { + if yyq1226[11] { if x.Lifecycle == nil { r.EncodeNil() } else { @@ -16720,7 +17513,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[11] { + if yyq1226[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lifecycle")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16731,11 +17524,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[12] { - yym1202 := z.EncBinary() - _ = yym1202 + if yyq1226[12] { + yym1258 := z.EncBinary() + _ = yym1258 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TerminationMessagePath)) @@ -16744,19 +17537,19 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1170[12] { + if yyq1226[12] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminationMessagePath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1203 := z.EncBinary() - _ = yym1203 + yym1259 := z.EncBinary() + _ = yym1259 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TerminationMessagePath)) } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.ImagePullPolicy.CodecEncodeSelf(e) } else { @@ -16765,9 +17558,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.ImagePullPolicy.CodecEncodeSelf(e) } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[14] { + if yyq1226[14] { if x.SecurityContext == nil { r.EncodeNil() } else { @@ -16777,7 +17570,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1170[14] { + if yyq1226[14] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("securityContext")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16788,11 +17581,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[15] { - yym1207 := z.EncBinary() - _ = yym1207 + if yyq1226[15] { + yym1263 := z.EncBinary() + _ = yym1263 if false { } else { r.EncodeBool(bool(x.Stdin)) @@ -16801,23 +17594,23 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1170[15] { + if yyq1226[15] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("stdin")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1208 := z.EncBinary() - _ = yym1208 + yym1264 := z.EncBinary() + _ = yym1264 if false { } else { r.EncodeBool(bool(x.Stdin)) } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[16] { - yym1210 := z.EncBinary() - _ = yym1210 + if yyq1226[16] { + yym1266 := z.EncBinary() + _ = yym1266 if false { } else { r.EncodeBool(bool(x.StdinOnce)) @@ -16826,23 +17619,23 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1170[16] { + if yyq1226[16] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("stdinOnce")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1211 := z.EncBinary() - _ = yym1211 + yym1267 := z.EncBinary() + _ = yym1267 if false { } else { r.EncodeBool(bool(x.StdinOnce)) } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1170[17] { - yym1213 := z.EncBinary() - _ = yym1213 + if yyq1226[17] { + yym1269 := z.EncBinary() + _ = yym1269 if false { } else { r.EncodeBool(bool(x.TTY)) @@ -16851,19 +17644,19 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1170[17] { + if yyq1226[17] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tty")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1214 := z.EncBinary() - _ = yym1214 + yym1270 := z.EncBinary() + _ = yym1270 if false { } else { r.EncodeBool(bool(x.TTY)) } } } - if yyr1170 || yy2arr1170 { + if yyr1226 || yy2arr1226 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16876,25 +17669,25 @@ func (x *Container) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1215 := z.DecBinary() - _ = yym1215 + yym1271 := z.DecBinary() + _ = yym1271 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1216 := r.ContainerType() - if yyct1216 == codecSelferValueTypeMap1234 { - yyl1216 := r.ReadMapStart() - if yyl1216 == 0 { + yyct1272 := r.ContainerType() + if yyct1272 == codecSelferValueTypeMap1234 { + yyl1272 := r.ReadMapStart() + if yyl1272 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1216, d) + x.codecDecodeSelfFromMap(yyl1272, d) } - } else if yyct1216 == codecSelferValueTypeArray1234 { - yyl1216 := r.ReadArrayStart() - if yyl1216 == 0 { + } else if yyct1272 == codecSelferValueTypeArray1234 { + yyl1272 := r.ReadArrayStart() + if yyl1272 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1216, d) + x.codecDecodeSelfFromArray(yyl1272, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16906,12 +17699,12 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1217Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1217Slc - var yyhl1217 bool = l >= 0 - for yyj1217 := 0; ; yyj1217++ { - if yyhl1217 { - if yyj1217 >= l { + var yys1273Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1273Slc + var yyhl1273 bool = l >= 0 + for yyj1273 := 0; ; yyj1273++ { + if yyhl1273 { + if yyj1273 >= l { break } } else { @@ -16920,10 +17713,10 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1217Slc = r.DecodeBytes(yys1217Slc, true, true) - yys1217 := string(yys1217Slc) + yys1273Slc = r.DecodeBytes(yys1273Slc, true, true) + yys1273 := string(yys1273Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1217 { + switch yys1273 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -16940,24 +17733,24 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1220 := &x.Command - yym1221 := z.DecBinary() - _ = yym1221 + yyv1276 := &x.Command + yym1277 := z.DecBinary() + _ = yym1277 if false { } else { - z.F.DecSliceStringX(yyv1220, false, d) + z.F.DecSliceStringX(yyv1276, false, d) } } case "args": if r.TryDecodeAsNil() { x.Args = nil } else { - yyv1222 := &x.Args - yym1223 := z.DecBinary() - _ = yym1223 + yyv1278 := &x.Args + yym1279 := z.DecBinary() + _ = yym1279 if false { } else { - z.F.DecSliceStringX(yyv1222, false, d) + z.F.DecSliceStringX(yyv1278, false, d) } } case "workingDir": @@ -16970,43 +17763,43 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1225 := &x.Ports - yym1226 := z.DecBinary() - _ = yym1226 + yyv1281 := &x.Ports + yym1282 := z.DecBinary() + _ = yym1282 if false { } else { - h.decSliceContainerPort((*[]ContainerPort)(yyv1225), d) + h.decSliceContainerPort((*[]ContainerPort)(yyv1281), d) } } case "env": if r.TryDecodeAsNil() { x.Env = nil } else { - yyv1227 := &x.Env - yym1228 := z.DecBinary() - _ = yym1228 + yyv1283 := &x.Env + yym1284 := z.DecBinary() + _ = yym1284 if false { } else { - h.decSliceEnvVar((*[]EnvVar)(yyv1227), d) + h.decSliceEnvVar((*[]EnvVar)(yyv1283), d) } } case "resources": if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv1229 := &x.Resources - yyv1229.CodecDecodeSelf(d) + yyv1285 := &x.Resources + yyv1285.CodecDecodeSelf(d) } case "volumeMounts": if r.TryDecodeAsNil() { x.VolumeMounts = nil } else { - yyv1230 := &x.VolumeMounts - yym1231 := z.DecBinary() - _ = yym1231 + yyv1286 := &x.VolumeMounts + yym1287 := z.DecBinary() + _ = yym1287 if false { } else { - h.decSliceVolumeMount((*[]VolumeMount)(yyv1230), d) + h.decSliceVolumeMount((*[]VolumeMount)(yyv1286), d) } } case "livenessProbe": @@ -17084,9 +17877,9 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TTY = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys1217) - } // end switch yys1217 - } // end for yyj1217 + z.DecStructFieldNotFound(-1, yys1273) + } // end switch yys1273 + } // end for yyj1273 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17094,16 +17887,16 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1241 int - var yyb1241 bool - var yyhl1241 bool = l >= 0 - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + var yyj1297 int + var yyb1297 bool + var yyhl1297 bool = l >= 0 + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17113,13 +17906,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17129,13 +17922,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Image = string(r.DecodeString()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17143,21 +17936,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1244 := &x.Command - yym1245 := z.DecBinary() - _ = yym1245 + yyv1300 := &x.Command + yym1301 := z.DecBinary() + _ = yym1301 if false { } else { - z.F.DecSliceStringX(yyv1244, false, d) + z.F.DecSliceStringX(yyv1300, false, d) } } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17165,21 +17958,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Args = nil } else { - yyv1246 := &x.Args - yym1247 := z.DecBinary() - _ = yym1247 + yyv1302 := &x.Args + yym1303 := z.DecBinary() + _ = yym1303 if false { } else { - z.F.DecSliceStringX(yyv1246, false, d) + z.F.DecSliceStringX(yyv1302, false, d) } } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17189,13 +17982,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.WorkingDir = string(r.DecodeString()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17203,21 +17996,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1249 := &x.Ports - yym1250 := z.DecBinary() - _ = yym1250 + yyv1305 := &x.Ports + yym1306 := z.DecBinary() + _ = yym1306 if false { } else { - h.decSliceContainerPort((*[]ContainerPort)(yyv1249), d) + h.decSliceContainerPort((*[]ContainerPort)(yyv1305), d) } } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17225,21 +18018,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Env = nil } else { - yyv1251 := &x.Env - yym1252 := z.DecBinary() - _ = yym1252 + yyv1307 := &x.Env + yym1308 := z.DecBinary() + _ = yym1308 if false { } else { - h.decSliceEnvVar((*[]EnvVar)(yyv1251), d) + h.decSliceEnvVar((*[]EnvVar)(yyv1307), d) } } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17247,16 +18040,16 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv1253 := &x.Resources - yyv1253.CodecDecodeSelf(d) + yyv1309 := &x.Resources + yyv1309.CodecDecodeSelf(d) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17264,21 +18057,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.VolumeMounts = nil } else { - yyv1254 := &x.VolumeMounts - yym1255 := z.DecBinary() - _ = yym1255 + yyv1310 := &x.VolumeMounts + yym1311 := z.DecBinary() + _ = yym1311 if false { } else { - h.decSliceVolumeMount((*[]VolumeMount)(yyv1254), d) + h.decSliceVolumeMount((*[]VolumeMount)(yyv1310), d) } } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17293,13 +18086,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.LivenessProbe.CodecDecodeSelf(d) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17314,13 +18107,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.ReadinessProbe.CodecDecodeSelf(d) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17335,13 +18128,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Lifecycle.CodecDecodeSelf(d) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17351,13 +18144,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.TerminationMessagePath = string(r.DecodeString()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17367,13 +18160,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ImagePullPolicy = PullPolicy(r.DecodeString()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17388,13 +18181,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.SecurityContext.CodecDecodeSelf(d) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17404,13 +18197,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Stdin = bool(r.DecodeBool()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17420,13 +18213,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.StdinOnce = bool(r.DecodeBool()) } - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17437,17 +18230,17 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.TTY = bool(r.DecodeBool()) } for { - yyj1241++ - if yyhl1241 { - yyb1241 = yyj1241 > l + yyj1297++ + if yyhl1297 { + yyb1297 = yyj1297 > l } else { - yyb1241 = r.CheckBreak() + yyb1297 = r.CheckBreak() } - if yyb1241 { + if yyb1297 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1241-1, "") + z.DecStructFieldNotFound(yyj1297-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17459,35 +18252,35 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1265 := z.EncBinary() - _ = yym1265 + yym1321 := z.EncBinary() + _ = yym1321 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1266 := !z.EncBinary() - yy2arr1266 := z.EncBasicHandle().StructToArray - var yyq1266 [3]bool - _, _, _ = yysep1266, yyq1266, yy2arr1266 - const yyr1266 bool = false - yyq1266[0] = x.Exec != nil - yyq1266[1] = x.HTTPGet != nil - yyq1266[2] = x.TCPSocket != nil - var yynn1266 int - if yyr1266 || yy2arr1266 { + yysep1322 := !z.EncBinary() + yy2arr1322 := z.EncBasicHandle().StructToArray + var yyq1322 [3]bool + _, _, _ = yysep1322, yyq1322, yy2arr1322 + const yyr1322 bool = false + yyq1322[0] = x.Exec != nil + yyq1322[1] = x.HTTPGet != nil + yyq1322[2] = x.TCPSocket != nil + var yynn1322 int + if yyr1322 || yy2arr1322 { r.EncodeArrayStart(3) } else { - yynn1266 = 0 - for _, b := range yyq1266 { + yynn1322 = 0 + for _, b := range yyq1322 { if b { - yynn1266++ + yynn1322++ } } - r.EncodeMapStart(yynn1266) - yynn1266 = 0 + r.EncodeMapStart(yynn1322) + yynn1322 = 0 } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1266[0] { + if yyq1322[0] { if x.Exec == nil { r.EncodeNil() } else { @@ -17497,7 +18290,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1266[0] { + if yyq1322[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("exec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17508,9 +18301,9 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1266[1] { + if yyq1322[1] { if x.HTTPGet == nil { r.EncodeNil() } else { @@ -17520,7 +18313,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1266[1] { + if yyq1322[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("httpGet")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17531,9 +18324,9 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1266[2] { + if yyq1322[2] { if x.TCPSocket == nil { r.EncodeNil() } else { @@ -17543,7 +18336,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1266[2] { + if yyq1322[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17554,7 +18347,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17567,25 +18360,25 @@ func (x *Handler) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1270 := z.DecBinary() - _ = yym1270 + yym1326 := z.DecBinary() + _ = yym1326 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1271 := r.ContainerType() - if yyct1271 == codecSelferValueTypeMap1234 { - yyl1271 := r.ReadMapStart() - if yyl1271 == 0 { + yyct1327 := r.ContainerType() + if yyct1327 == codecSelferValueTypeMap1234 { + yyl1327 := r.ReadMapStart() + if yyl1327 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1271, d) + x.codecDecodeSelfFromMap(yyl1327, d) } - } else if yyct1271 == codecSelferValueTypeArray1234 { - yyl1271 := r.ReadArrayStart() - if yyl1271 == 0 { + } else if yyct1327 == codecSelferValueTypeArray1234 { + yyl1327 := r.ReadArrayStart() + if yyl1327 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1271, d) + x.codecDecodeSelfFromArray(yyl1327, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17597,12 +18390,12 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1272Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1272Slc - var yyhl1272 bool = l >= 0 - for yyj1272 := 0; ; yyj1272++ { - if yyhl1272 { - if yyj1272 >= l { + var yys1328Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1328Slc + var yyhl1328 bool = l >= 0 + for yyj1328 := 0; ; yyj1328++ { + if yyhl1328 { + if yyj1328 >= l { break } } else { @@ -17611,10 +18404,10 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1272Slc = r.DecodeBytes(yys1272Slc, true, true) - yys1272 := string(yys1272Slc) + yys1328Slc = r.DecodeBytes(yys1328Slc, true, true) + yys1328 := string(yys1328Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1272 { + switch yys1328 { case "exec": if r.TryDecodeAsNil() { if x.Exec != nil { @@ -17649,9 +18442,9 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TCPSocket.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1272) - } // end switch yys1272 - } // end for yyj1272 + z.DecStructFieldNotFound(-1, yys1328) + } // end switch yys1328 + } // end for yyj1328 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17659,16 +18452,16 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1276 int - var yyb1276 bool - var yyhl1276 bool = l >= 0 - yyj1276++ - if yyhl1276 { - yyb1276 = yyj1276 > l + var yyj1332 int + var yyb1332 bool + var yyhl1332 bool = l >= 0 + yyj1332++ + if yyhl1332 { + yyb1332 = yyj1332 > l } else { - yyb1276 = r.CheckBreak() + yyb1332 = r.CheckBreak() } - if yyb1276 { + if yyb1332 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17683,13 +18476,13 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Exec.CodecDecodeSelf(d) } - yyj1276++ - if yyhl1276 { - yyb1276 = yyj1276 > l + yyj1332++ + if yyhl1332 { + yyb1332 = yyj1332 > l } else { - yyb1276 = r.CheckBreak() + yyb1332 = r.CheckBreak() } - if yyb1276 { + if yyb1332 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17704,13 +18497,13 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.HTTPGet.CodecDecodeSelf(d) } - yyj1276++ - if yyhl1276 { - yyb1276 = yyj1276 > l + yyj1332++ + if yyhl1332 { + yyb1332 = yyj1332 > l } else { - yyb1276 = r.CheckBreak() + yyb1332 = r.CheckBreak() } - if yyb1276 { + if yyb1332 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17726,17 +18519,17 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.TCPSocket.CodecDecodeSelf(d) } for { - yyj1276++ - if yyhl1276 { - yyb1276 = yyj1276 > l + yyj1332++ + if yyhl1332 { + yyb1332 = yyj1332 > l } else { - yyb1276 = r.CheckBreak() + yyb1332 = r.CheckBreak() } - if yyb1276 { + if yyb1332 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1276-1, "") + z.DecStructFieldNotFound(yyj1332-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17748,34 +18541,34 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1280 := z.EncBinary() - _ = yym1280 + yym1336 := z.EncBinary() + _ = yym1336 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1281 := !z.EncBinary() - yy2arr1281 := z.EncBasicHandle().StructToArray - var yyq1281 [2]bool - _, _, _ = yysep1281, yyq1281, yy2arr1281 - const yyr1281 bool = false - yyq1281[0] = x.PostStart != nil - yyq1281[1] = x.PreStop != nil - var yynn1281 int - if yyr1281 || yy2arr1281 { + yysep1337 := !z.EncBinary() + yy2arr1337 := z.EncBasicHandle().StructToArray + var yyq1337 [2]bool + _, _, _ = yysep1337, yyq1337, yy2arr1337 + const yyr1337 bool = false + yyq1337[0] = x.PostStart != nil + yyq1337[1] = x.PreStop != nil + var yynn1337 int + if yyr1337 || yy2arr1337 { r.EncodeArrayStart(2) } else { - yynn1281 = 0 - for _, b := range yyq1281 { + yynn1337 = 0 + for _, b := range yyq1337 { if b { - yynn1281++ + yynn1337++ } } - r.EncodeMapStart(yynn1281) - yynn1281 = 0 + r.EncodeMapStart(yynn1337) + yynn1337 = 0 } - if yyr1281 || yy2arr1281 { + if yyr1337 || yy2arr1337 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1281[0] { + if yyq1337[0] { if x.PostStart == nil { r.EncodeNil() } else { @@ -17785,7 +18578,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1281[0] { + if yyq1337[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("postStart")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17796,9 +18589,9 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1281 || yy2arr1281 { + if yyr1337 || yy2arr1337 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1281[1] { + if yyq1337[1] { if x.PreStop == nil { r.EncodeNil() } else { @@ -17808,7 +18601,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1281[1] { + if yyq1337[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("preStop")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17819,7 +18612,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1281 || yy2arr1281 { + if yyr1337 || yy2arr1337 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17832,25 +18625,25 @@ func (x *Lifecycle) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1284 := z.DecBinary() - _ = yym1284 + yym1340 := z.DecBinary() + _ = yym1340 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1285 := r.ContainerType() - if yyct1285 == codecSelferValueTypeMap1234 { - yyl1285 := r.ReadMapStart() - if yyl1285 == 0 { + yyct1341 := r.ContainerType() + if yyct1341 == codecSelferValueTypeMap1234 { + yyl1341 := r.ReadMapStart() + if yyl1341 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1285, d) + x.codecDecodeSelfFromMap(yyl1341, d) } - } else if yyct1285 == codecSelferValueTypeArray1234 { - yyl1285 := r.ReadArrayStart() - if yyl1285 == 0 { + } else if yyct1341 == codecSelferValueTypeArray1234 { + yyl1341 := r.ReadArrayStart() + if yyl1341 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1285, d) + x.codecDecodeSelfFromArray(yyl1341, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17862,12 +18655,12 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1286Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1286Slc - var yyhl1286 bool = l >= 0 - for yyj1286 := 0; ; yyj1286++ { - if yyhl1286 { - if yyj1286 >= l { + var yys1342Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1342Slc + var yyhl1342 bool = l >= 0 + for yyj1342 := 0; ; yyj1342++ { + if yyhl1342 { + if yyj1342 >= l { break } } else { @@ -17876,10 +18669,10 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1286Slc = r.DecodeBytes(yys1286Slc, true, true) - yys1286 := string(yys1286Slc) + yys1342Slc = r.DecodeBytes(yys1342Slc, true, true) + yys1342 := string(yys1342Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1286 { + switch yys1342 { case "postStart": if r.TryDecodeAsNil() { if x.PostStart != nil { @@ -17903,9 +18696,9 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.PreStop.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1286) - } // end switch yys1286 - } // end for yyj1286 + z.DecStructFieldNotFound(-1, yys1342) + } // end switch yys1342 + } // end for yyj1342 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17913,16 +18706,16 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1289 int - var yyb1289 bool - var yyhl1289 bool = l >= 0 - yyj1289++ - if yyhl1289 { - yyb1289 = yyj1289 > l + var yyj1345 int + var yyb1345 bool + var yyhl1345 bool = l >= 0 + yyj1345++ + if yyhl1345 { + yyb1345 = yyj1345 > l } else { - yyb1289 = r.CheckBreak() + yyb1345 = r.CheckBreak() } - if yyb1289 { + if yyb1345 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17937,13 +18730,13 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.PostStart.CodecDecodeSelf(d) } - yyj1289++ - if yyhl1289 { - yyb1289 = yyj1289 > l + yyj1345++ + if yyhl1345 { + yyb1345 = yyj1345 > l } else { - yyb1289 = r.CheckBreak() + yyb1345 = r.CheckBreak() } - if yyb1289 { + if yyb1345 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17959,17 +18752,17 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.PreStop.CodecDecodeSelf(d) } for { - yyj1289++ - if yyhl1289 { - yyb1289 = yyj1289 > l + yyj1345++ + if yyhl1345 { + yyb1345 = yyj1345 > l } else { - yyb1289 = r.CheckBreak() + yyb1345 = r.CheckBreak() } - if yyb1289 { + if yyb1345 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1289-1, "") + z.DecStructFieldNotFound(yyj1345-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17978,8 +18771,8 @@ func (x ConditionStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1292 := z.EncBinary() - _ = yym1292 + yym1348 := z.EncBinary() + _ = yym1348 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -17991,8 +18784,8 @@ func (x *ConditionStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1293 := z.DecBinary() - _ = yym1293 + yym1349 := z.DecBinary() + _ = yym1349 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -18007,36 +18800,36 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1294 := z.EncBinary() - _ = yym1294 + yym1350 := z.EncBinary() + _ = yym1350 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1295 := !z.EncBinary() - yy2arr1295 := z.EncBasicHandle().StructToArray - var yyq1295 [2]bool - _, _, _ = yysep1295, yyq1295, yy2arr1295 - const yyr1295 bool = false - yyq1295[0] = x.Reason != "" - yyq1295[1] = x.Message != "" - var yynn1295 int - if yyr1295 || yy2arr1295 { + yysep1351 := !z.EncBinary() + yy2arr1351 := z.EncBasicHandle().StructToArray + var yyq1351 [2]bool + _, _, _ = yysep1351, yyq1351, yy2arr1351 + const yyr1351 bool = false + yyq1351[0] = x.Reason != "" + yyq1351[1] = x.Message != "" + var yynn1351 int + if yyr1351 || yy2arr1351 { r.EncodeArrayStart(2) } else { - yynn1295 = 0 - for _, b := range yyq1295 { + yynn1351 = 0 + for _, b := range yyq1351 { if b { - yynn1295++ + yynn1351++ } } - r.EncodeMapStart(yynn1295) - yynn1295 = 0 + r.EncodeMapStart(yynn1351) + yynn1351 = 0 } - if yyr1295 || yy2arr1295 { + if yyr1351 || yy2arr1351 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1295[0] { - yym1297 := z.EncBinary() - _ = yym1297 + if yyq1351[0] { + yym1353 := z.EncBinary() + _ = yym1353 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -18045,23 +18838,23 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1295[0] { + if yyq1351[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1298 := z.EncBinary() - _ = yym1298 + yym1354 := z.EncBinary() + _ = yym1354 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1295 || yy2arr1295 { + if yyr1351 || yy2arr1351 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1295[1] { - yym1300 := z.EncBinary() - _ = yym1300 + if yyq1351[1] { + yym1356 := z.EncBinary() + _ = yym1356 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -18070,19 +18863,19 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1295[1] { + if yyq1351[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1301 := z.EncBinary() - _ = yym1301 + yym1357 := z.EncBinary() + _ = yym1357 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1295 || yy2arr1295 { + if yyr1351 || yy2arr1351 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -18095,25 +18888,25 @@ func (x *ContainerStateWaiting) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1302 := z.DecBinary() - _ = yym1302 + yym1358 := z.DecBinary() + _ = yym1358 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1303 := r.ContainerType() - if yyct1303 == codecSelferValueTypeMap1234 { - yyl1303 := r.ReadMapStart() - if yyl1303 == 0 { + yyct1359 := r.ContainerType() + if yyct1359 == codecSelferValueTypeMap1234 { + yyl1359 := r.ReadMapStart() + if yyl1359 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1303, d) + x.codecDecodeSelfFromMap(yyl1359, d) } - } else if yyct1303 == codecSelferValueTypeArray1234 { - yyl1303 := r.ReadArrayStart() - if yyl1303 == 0 { + } else if yyct1359 == codecSelferValueTypeArray1234 { + yyl1359 := r.ReadArrayStart() + if yyl1359 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1303, d) + x.codecDecodeSelfFromArray(yyl1359, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -18125,12 +18918,12 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1304Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1304Slc - var yyhl1304 bool = l >= 0 - for yyj1304 := 0; ; yyj1304++ { - if yyhl1304 { - if yyj1304 >= l { + var yys1360Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1360Slc + var yyhl1360 bool = l >= 0 + for yyj1360 := 0; ; yyj1360++ { + if yyhl1360 { + if yyj1360 >= l { break } } else { @@ -18139,10 +18932,10 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1304Slc = r.DecodeBytes(yys1304Slc, true, true) - yys1304 := string(yys1304Slc) + yys1360Slc = r.DecodeBytes(yys1360Slc, true, true) + yys1360 := string(yys1360Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1304 { + switch yys1360 { case "reason": if r.TryDecodeAsNil() { x.Reason = "" @@ -18156,9 +18949,9 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1304) - } // end switch yys1304 - } // end for yyj1304 + z.DecStructFieldNotFound(-1, yys1360) + } // end switch yys1360 + } // end for yyj1360 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -18166,16 +18959,16 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1307 int - var yyb1307 bool - var yyhl1307 bool = l >= 0 - yyj1307++ - if yyhl1307 { - yyb1307 = yyj1307 > l + var yyj1363 int + var yyb1363 bool + var yyhl1363 bool = l >= 0 + yyj1363++ + if yyhl1363 { + yyb1363 = yyj1363 > l } else { - yyb1307 = r.CheckBreak() + yyb1363 = r.CheckBreak() } - if yyb1307 { + if yyb1363 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18185,13 +18978,13 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Reason = string(r.DecodeString()) } - yyj1307++ - if yyhl1307 { - yyb1307 = yyj1307 > l + yyj1363++ + if yyhl1363 { + yyb1363 = yyj1363 > l } else { - yyb1307 = r.CheckBreak() + yyb1363 = r.CheckBreak() } - if yyb1307 { + if yyb1363 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18202,17 +18995,17 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec x.Message = string(r.DecodeString()) } for { - yyj1307++ - if yyhl1307 { - yyb1307 = yyj1307 > l + yyj1363++ + if yyhl1363 { + yyb1363 = yyj1363 > l } else { - yyb1307 = r.CheckBreak() + yyb1363 = r.CheckBreak() } - if yyb1307 { + if yyb1363 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1307-1, "") + z.DecStructFieldNotFound(yyj1363-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18224,68 +19017,68 @@ func (x *ContainerStateRunning) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1310 := z.EncBinary() - _ = yym1310 + yym1366 := z.EncBinary() + _ = yym1366 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1311 := !z.EncBinary() - yy2arr1311 := z.EncBasicHandle().StructToArray - var yyq1311 [1]bool - _, _, _ = yysep1311, yyq1311, yy2arr1311 - const yyr1311 bool = false - yyq1311[0] = true - var yynn1311 int - if yyr1311 || yy2arr1311 { + yysep1367 := !z.EncBinary() + yy2arr1367 := z.EncBasicHandle().StructToArray + var yyq1367 [1]bool + _, _, _ = yysep1367, yyq1367, yy2arr1367 + const yyr1367 bool = false + yyq1367[0] = true + var yynn1367 int + if yyr1367 || yy2arr1367 { r.EncodeArrayStart(1) } else { - yynn1311 = 0 - for _, b := range yyq1311 { + yynn1367 = 0 + for _, b := range yyq1367 { if b { - yynn1311++ + yynn1367++ } } - r.EncodeMapStart(yynn1311) - yynn1311 = 0 + r.EncodeMapStart(yynn1367) + yynn1367 = 0 } - if yyr1311 || yy2arr1311 { + if yyr1367 || yy2arr1367 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1311[0] { - yy1313 := &x.StartedAt - yym1314 := z.EncBinary() - _ = yym1314 + if yyq1367[0] { + yy1369 := &x.StartedAt + yym1370 := z.EncBinary() + _ = yym1370 if false { - } else if z.HasExtensions() && z.EncExt(yy1313) { - } else if yym1314 { - z.EncBinaryMarshal(yy1313) - } else if !yym1314 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1313) + } else if z.HasExtensions() && z.EncExt(yy1369) { + } else if yym1370 { + z.EncBinaryMarshal(yy1369) + } else if !yym1370 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1369) } else { - z.EncFallback(yy1313) + z.EncFallback(yy1369) } } else { r.EncodeNil() } } else { - if yyq1311[0] { + if yyq1367[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1315 := &x.StartedAt - yym1316 := z.EncBinary() - _ = yym1316 + yy1371 := &x.StartedAt + yym1372 := z.EncBinary() + _ = yym1372 if false { - } else if z.HasExtensions() && z.EncExt(yy1315) { - } else if yym1316 { - z.EncBinaryMarshal(yy1315) - } else if !yym1316 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1315) + } else if z.HasExtensions() && z.EncExt(yy1371) { + } else if yym1372 { + z.EncBinaryMarshal(yy1371) + } else if !yym1372 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1371) } else { - z.EncFallback(yy1315) + z.EncFallback(yy1371) } } } - if yyr1311 || yy2arr1311 { + if yyr1367 || yy2arr1367 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -18298,25 +19091,25 @@ func (x *ContainerStateRunning) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1317 := z.DecBinary() - _ = yym1317 + yym1373 := z.DecBinary() + _ = yym1373 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1318 := r.ContainerType() - if yyct1318 == codecSelferValueTypeMap1234 { - yyl1318 := r.ReadMapStart() - if yyl1318 == 0 { + yyct1374 := r.ContainerType() + if yyct1374 == codecSelferValueTypeMap1234 { + yyl1374 := r.ReadMapStart() + if yyl1374 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1318, d) + x.codecDecodeSelfFromMap(yyl1374, d) } - } else if yyct1318 == codecSelferValueTypeArray1234 { - yyl1318 := r.ReadArrayStart() - if yyl1318 == 0 { + } else if yyct1374 == codecSelferValueTypeArray1234 { + yyl1374 := r.ReadArrayStart() + if yyl1374 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1318, d) + x.codecDecodeSelfFromArray(yyl1374, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -18328,12 +19121,12 @@ func (x *ContainerStateRunning) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1319Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1319Slc - var yyhl1319 bool = l >= 0 - for yyj1319 := 0; ; yyj1319++ { - if yyhl1319 { - if yyj1319 >= l { + var yys1375Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1375Slc + var yyhl1375 bool = l >= 0 + for yyj1375 := 0; ; yyj1375++ { + if yyhl1375 { + if yyj1375 >= l { break } } else { @@ -18342,31 +19135,31 @@ func (x *ContainerStateRunning) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1319Slc = r.DecodeBytes(yys1319Slc, true, true) - yys1319 := string(yys1319Slc) + yys1375Slc = r.DecodeBytes(yys1375Slc, true, true) + yys1375 := string(yys1375Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1319 { + switch yys1375 { case "startedAt": if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1320 := &x.StartedAt - yym1321 := z.DecBinary() - _ = yym1321 + yyv1376 := &x.StartedAt + yym1377 := z.DecBinary() + _ = yym1377 if false { - } else if z.HasExtensions() && z.DecExt(yyv1320) { - } else if yym1321 { - z.DecBinaryUnmarshal(yyv1320) - } else if !yym1321 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1320) + } else if z.HasExtensions() && z.DecExt(yyv1376) { + } else if yym1377 { + z.DecBinaryUnmarshal(yyv1376) + } else if !yym1377 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1376) } else { - z.DecFallback(yyv1320, false) + z.DecFallback(yyv1376, false) } } default: - z.DecStructFieldNotFound(-1, yys1319) - } // end switch yys1319 - } // end for yyj1319 + z.DecStructFieldNotFound(-1, yys1375) + } // end switch yys1375 + } // end for yyj1375 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -18374,16 +19167,16 @@ func (x *ContainerStateRunning) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1322 int - var yyb1322 bool - var yyhl1322 bool = l >= 0 - yyj1322++ - if yyhl1322 { - yyb1322 = yyj1322 > l + var yyj1378 int + var yyb1378 bool + var yyhl1378 bool = l >= 0 + yyj1378++ + if yyhl1378 { + yyb1378 = yyj1378 > l } else { - yyb1322 = r.CheckBreak() + yyb1378 = r.CheckBreak() } - if yyb1322 { + if yyb1378 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18391,31 +19184,31 @@ func (x *ContainerStateRunning) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1323 := &x.StartedAt - yym1324 := z.DecBinary() - _ = yym1324 + yyv1379 := &x.StartedAt + yym1380 := z.DecBinary() + _ = yym1380 if false { - } else if z.HasExtensions() && z.DecExt(yyv1323) { - } else if yym1324 { - z.DecBinaryUnmarshal(yyv1323) - } else if !yym1324 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1323) + } else if z.HasExtensions() && z.DecExt(yyv1379) { + } else if yym1380 { + z.DecBinaryUnmarshal(yyv1379) + } else if !yym1380 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1379) } else { - z.DecFallback(yyv1323, false) + z.DecFallback(yyv1379, false) } } for { - yyj1322++ - if yyhl1322 { - yyb1322 = yyj1322 > l + yyj1378++ + if yyhl1378 { + yyb1378 = yyj1378 > l } else { - yyb1322 = r.CheckBreak() + yyb1378 = r.CheckBreak() } - if yyb1322 { + if yyb1378 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1322-1, "") + z.DecStructFieldNotFound(yyj1378-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18427,39 +19220,39 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1325 := z.EncBinary() - _ = yym1325 + yym1381 := z.EncBinary() + _ = yym1381 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1326 := !z.EncBinary() - yy2arr1326 := z.EncBasicHandle().StructToArray - var yyq1326 [7]bool - _, _, _ = yysep1326, yyq1326, yy2arr1326 - const yyr1326 bool = false - yyq1326[1] = x.Signal != 0 - yyq1326[2] = x.Reason != "" - yyq1326[3] = x.Message != "" - yyq1326[4] = true - yyq1326[5] = true - yyq1326[6] = x.ContainerID != "" - var yynn1326 int - if yyr1326 || yy2arr1326 { + yysep1382 := !z.EncBinary() + yy2arr1382 := z.EncBasicHandle().StructToArray + var yyq1382 [7]bool + _, _, _ = yysep1382, yyq1382, yy2arr1382 + const yyr1382 bool = false + yyq1382[1] = x.Signal != 0 + yyq1382[2] = x.Reason != "" + yyq1382[3] = x.Message != "" + yyq1382[4] = true + yyq1382[5] = true + yyq1382[6] = x.ContainerID != "" + var yynn1382 int + if yyr1382 || yy2arr1382 { r.EncodeArrayStart(7) } else { - yynn1326 = 1 - for _, b := range yyq1326 { + yynn1382 = 1 + for _, b := range yyq1382 { if b { - yynn1326++ + yynn1382++ } } - r.EncodeMapStart(yynn1326) - yynn1326 = 0 + r.EncodeMapStart(yynn1382) + yynn1382 = 0 } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1328 := z.EncBinary() - _ = yym1328 + yym1384 := z.EncBinary() + _ = yym1384 if false { } else { r.EncodeInt(int64(x.ExitCode)) @@ -18468,18 +19261,18 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("exitCode")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1329 := z.EncBinary() - _ = yym1329 + yym1385 := z.EncBinary() + _ = yym1385 if false { } else { r.EncodeInt(int64(x.ExitCode)) } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[1] { - yym1331 := z.EncBinary() - _ = yym1331 + if yyq1382[1] { + yym1387 := z.EncBinary() + _ = yym1387 if false { } else { r.EncodeInt(int64(x.Signal)) @@ -18488,23 +19281,23 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1326[1] { + if yyq1382[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("signal")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1332 := z.EncBinary() - _ = yym1332 + yym1388 := z.EncBinary() + _ = yym1388 if false { } else { r.EncodeInt(int64(x.Signal)) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[2] { - yym1334 := z.EncBinary() - _ = yym1334 + if yyq1382[2] { + yym1390 := z.EncBinary() + _ = yym1390 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -18513,23 +19306,23 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1326[2] { + if yyq1382[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1335 := z.EncBinary() - _ = yym1335 + yym1391 := z.EncBinary() + _ = yym1391 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[3] { - yym1337 := z.EncBinary() - _ = yym1337 + if yyq1382[3] { + yym1393 := z.EncBinary() + _ = yym1393 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -18538,97 +19331,97 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1326[3] { + if yyq1382[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1338 := z.EncBinary() - _ = yym1338 + yym1394 := z.EncBinary() + _ = yym1394 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[4] { - yy1340 := &x.StartedAt - yym1341 := z.EncBinary() - _ = yym1341 + if yyq1382[4] { + yy1396 := &x.StartedAt + yym1397 := z.EncBinary() + _ = yym1397 if false { - } else if z.HasExtensions() && z.EncExt(yy1340) { - } else if yym1341 { - z.EncBinaryMarshal(yy1340) - } else if !yym1341 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1340) + } else if z.HasExtensions() && z.EncExt(yy1396) { + } else if yym1397 { + z.EncBinaryMarshal(yy1396) + } else if !yym1397 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1396) } else { - z.EncFallback(yy1340) + z.EncFallback(yy1396) } } else { r.EncodeNil() } } else { - if yyq1326[4] { + if yyq1382[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1342 := &x.StartedAt - yym1343 := z.EncBinary() - _ = yym1343 + yy1398 := &x.StartedAt + yym1399 := z.EncBinary() + _ = yym1399 if false { - } else if z.HasExtensions() && z.EncExt(yy1342) { - } else if yym1343 { - z.EncBinaryMarshal(yy1342) - } else if !yym1343 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1342) + } else if z.HasExtensions() && z.EncExt(yy1398) { + } else if yym1399 { + z.EncBinaryMarshal(yy1398) + } else if !yym1399 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1398) } else { - z.EncFallback(yy1342) + z.EncFallback(yy1398) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[5] { - yy1345 := &x.FinishedAt - yym1346 := z.EncBinary() - _ = yym1346 + if yyq1382[5] { + yy1401 := &x.FinishedAt + yym1402 := z.EncBinary() + _ = yym1402 if false { - } else if z.HasExtensions() && z.EncExt(yy1345) { - } else if yym1346 { - z.EncBinaryMarshal(yy1345) - } else if !yym1346 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1345) + } else if z.HasExtensions() && z.EncExt(yy1401) { + } else if yym1402 { + z.EncBinaryMarshal(yy1401) + } else if !yym1402 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1401) } else { - z.EncFallback(yy1345) + z.EncFallback(yy1401) } } else { r.EncodeNil() } } else { - if yyq1326[5] { + if yyq1382[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("finishedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1347 := &x.FinishedAt - yym1348 := z.EncBinary() - _ = yym1348 + yy1403 := &x.FinishedAt + yym1404 := z.EncBinary() + _ = yym1404 if false { - } else if z.HasExtensions() && z.EncExt(yy1347) { - } else if yym1348 { - z.EncBinaryMarshal(yy1347) - } else if !yym1348 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1347) + } else if z.HasExtensions() && z.EncExt(yy1403) { + } else if yym1404 { + z.EncBinaryMarshal(yy1403) + } else if !yym1404 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1403) } else { - z.EncFallback(yy1347) + z.EncFallback(yy1403) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1326[6] { - yym1350 := z.EncBinary() - _ = yym1350 + if yyq1382[6] { + yym1406 := z.EncBinary() + _ = yym1406 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) @@ -18637,19 +19430,19 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1326[6] { + if yyq1382[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1351 := z.EncBinary() - _ = yym1351 + yym1407 := z.EncBinary() + _ = yym1407 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) } } } - if yyr1326 || yy2arr1326 { + if yyr1382 || yy2arr1382 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -18662,25 +19455,25 @@ func (x *ContainerStateTerminated) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1352 := z.DecBinary() - _ = yym1352 + yym1408 := z.DecBinary() + _ = yym1408 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1353 := r.ContainerType() - if yyct1353 == codecSelferValueTypeMap1234 { - yyl1353 := r.ReadMapStart() - if yyl1353 == 0 { + yyct1409 := r.ContainerType() + if yyct1409 == codecSelferValueTypeMap1234 { + yyl1409 := r.ReadMapStart() + if yyl1409 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1353, d) + x.codecDecodeSelfFromMap(yyl1409, d) } - } else if yyct1353 == codecSelferValueTypeArray1234 { - yyl1353 := r.ReadArrayStart() - if yyl1353 == 0 { + } else if yyct1409 == codecSelferValueTypeArray1234 { + yyl1409 := r.ReadArrayStart() + if yyl1409 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1353, d) + x.codecDecodeSelfFromArray(yyl1409, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -18692,12 +19485,12 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1354Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1354Slc - var yyhl1354 bool = l >= 0 - for yyj1354 := 0; ; yyj1354++ { - if yyhl1354 { - if yyj1354 >= l { + var yys1410Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1410Slc + var yyhl1410 bool = l >= 0 + for yyj1410 := 0; ; yyj1410++ { + if yyhl1410 { + if yyj1410 >= l { break } } else { @@ -18706,10 +19499,10 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1354Slc = r.DecodeBytes(yys1354Slc, true, true) - yys1354 := string(yys1354Slc) + yys1410Slc = r.DecodeBytes(yys1410Slc, true, true) + yys1410 := string(yys1410Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1354 { + switch yys1410 { case "exitCode": if r.TryDecodeAsNil() { x.ExitCode = 0 @@ -18738,34 +19531,34 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1359 := &x.StartedAt - yym1360 := z.DecBinary() - _ = yym1360 + yyv1415 := &x.StartedAt + yym1416 := z.DecBinary() + _ = yym1416 if false { - } else if z.HasExtensions() && z.DecExt(yyv1359) { - } else if yym1360 { - z.DecBinaryUnmarshal(yyv1359) - } else if !yym1360 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1359) + } else if z.HasExtensions() && z.DecExt(yyv1415) { + } else if yym1416 { + z.DecBinaryUnmarshal(yyv1415) + } else if !yym1416 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1415) } else { - z.DecFallback(yyv1359, false) + z.DecFallback(yyv1415, false) } } case "finishedAt": if r.TryDecodeAsNil() { x.FinishedAt = pkg2_unversioned.Time{} } else { - yyv1361 := &x.FinishedAt - yym1362 := z.DecBinary() - _ = yym1362 + yyv1417 := &x.FinishedAt + yym1418 := z.DecBinary() + _ = yym1418 if false { - } else if z.HasExtensions() && z.DecExt(yyv1361) { - } else if yym1362 { - z.DecBinaryUnmarshal(yyv1361) - } else if !yym1362 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1361) + } else if z.HasExtensions() && z.DecExt(yyv1417) { + } else if yym1418 { + z.DecBinaryUnmarshal(yyv1417) + } else if !yym1418 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1417) } else { - z.DecFallback(yyv1361, false) + z.DecFallback(yyv1417, false) } } case "containerID": @@ -18775,9 +19568,9 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De x.ContainerID = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1354) - } // end switch yys1354 - } // end for yyj1354 + z.DecStructFieldNotFound(-1, yys1410) + } // end switch yys1410 + } // end for yyj1410 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -18785,16 +19578,16 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1364 int - var yyb1364 bool - var yyhl1364 bool = l >= 0 - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + var yyj1420 int + var yyb1420 bool + var yyhl1420 bool = l >= 0 + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18804,13 +19597,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.ExitCode = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18820,13 +19613,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Signal = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18836,13 +19629,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Reason = string(r.DecodeString()) } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18852,13 +19645,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Message = string(r.DecodeString()) } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18866,26 +19659,26 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1369 := &x.StartedAt - yym1370 := z.DecBinary() - _ = yym1370 + yyv1425 := &x.StartedAt + yym1426 := z.DecBinary() + _ = yym1426 if false { - } else if z.HasExtensions() && z.DecExt(yyv1369) { - } else if yym1370 { - z.DecBinaryUnmarshal(yyv1369) - } else if !yym1370 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1369) + } else if z.HasExtensions() && z.DecExt(yyv1425) { + } else if yym1426 { + z.DecBinaryUnmarshal(yyv1425) + } else if !yym1426 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1425) } else { - z.DecFallback(yyv1369, false) + z.DecFallback(yyv1425, false) } } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18893,26 +19686,26 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. if r.TryDecodeAsNil() { x.FinishedAt = pkg2_unversioned.Time{} } else { - yyv1371 := &x.FinishedAt - yym1372 := z.DecBinary() - _ = yym1372 + yyv1427 := &x.FinishedAt + yym1428 := z.DecBinary() + _ = yym1428 if false { - } else if z.HasExtensions() && z.DecExt(yyv1371) { - } else if yym1372 { - z.DecBinaryUnmarshal(yyv1371) - } else if !yym1372 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1371) + } else if z.HasExtensions() && z.DecExt(yyv1427) { + } else if yym1428 { + z.DecBinaryUnmarshal(yyv1427) + } else if !yym1428 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1427) } else { - z.DecFallback(yyv1371, false) + z.DecFallback(yyv1427, false) } } - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18923,17 +19716,17 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. x.ContainerID = string(r.DecodeString()) } for { - yyj1364++ - if yyhl1364 { - yyb1364 = yyj1364 > l + yyj1420++ + if yyhl1420 { + yyb1420 = yyj1420 > l } else { - yyb1364 = r.CheckBreak() + yyb1420 = r.CheckBreak() } - if yyb1364 { + if yyb1420 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1364-1, "") + z.DecStructFieldNotFound(yyj1420-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18945,35 +19738,35 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1374 := z.EncBinary() - _ = yym1374 + yym1430 := z.EncBinary() + _ = yym1430 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1375 := !z.EncBinary() - yy2arr1375 := z.EncBasicHandle().StructToArray - var yyq1375 [3]bool - _, _, _ = yysep1375, yyq1375, yy2arr1375 - const yyr1375 bool = false - yyq1375[0] = x.Waiting != nil - yyq1375[1] = x.Running != nil - yyq1375[2] = x.Terminated != nil - var yynn1375 int - if yyr1375 || yy2arr1375 { + yysep1431 := !z.EncBinary() + yy2arr1431 := z.EncBasicHandle().StructToArray + var yyq1431 [3]bool + _, _, _ = yysep1431, yyq1431, yy2arr1431 + const yyr1431 bool = false + yyq1431[0] = x.Waiting != nil + yyq1431[1] = x.Running != nil + yyq1431[2] = x.Terminated != nil + var yynn1431 int + if yyr1431 || yy2arr1431 { r.EncodeArrayStart(3) } else { - yynn1375 = 0 - for _, b := range yyq1375 { + yynn1431 = 0 + for _, b := range yyq1431 { if b { - yynn1375++ + yynn1431++ } } - r.EncodeMapStart(yynn1375) - yynn1375 = 0 + r.EncodeMapStart(yynn1431) + yynn1431 = 0 } - if yyr1375 || yy2arr1375 { + if yyr1431 || yy2arr1431 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1375[0] { + if yyq1431[0] { if x.Waiting == nil { r.EncodeNil() } else { @@ -18983,7 +19776,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1375[0] { + if yyq1431[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("waiting")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -18994,9 +19787,9 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1375 || yy2arr1375 { + if yyr1431 || yy2arr1431 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1375[1] { + if yyq1431[1] { if x.Running == nil { r.EncodeNil() } else { @@ -19006,7 +19799,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1375[1] { + if yyq1431[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("running")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -19017,9 +19810,9 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1375 || yy2arr1375 { + if yyr1431 || yy2arr1431 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1375[2] { + if yyq1431[2] { if x.Terminated == nil { r.EncodeNil() } else { @@ -19029,7 +19822,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1375[2] { + if yyq1431[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminated")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -19040,7 +19833,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1375 || yy2arr1375 { + if yyr1431 || yy2arr1431 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -19053,25 +19846,25 @@ func (x *ContainerState) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1379 := z.DecBinary() - _ = yym1379 + yym1435 := z.DecBinary() + _ = yym1435 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1380 := r.ContainerType() - if yyct1380 == codecSelferValueTypeMap1234 { - yyl1380 := r.ReadMapStart() - if yyl1380 == 0 { + yyct1436 := r.ContainerType() + if yyct1436 == codecSelferValueTypeMap1234 { + yyl1436 := r.ReadMapStart() + if yyl1436 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1380, d) + x.codecDecodeSelfFromMap(yyl1436, d) } - } else if yyct1380 == codecSelferValueTypeArray1234 { - yyl1380 := r.ReadArrayStart() - if yyl1380 == 0 { + } else if yyct1436 == codecSelferValueTypeArray1234 { + yyl1436 := r.ReadArrayStart() + if yyl1436 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1380, d) + x.codecDecodeSelfFromArray(yyl1436, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -19083,12 +19876,12 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1381Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1381Slc - var yyhl1381 bool = l >= 0 - for yyj1381 := 0; ; yyj1381++ { - if yyhl1381 { - if yyj1381 >= l { + var yys1437Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1437Slc + var yyhl1437 bool = l >= 0 + for yyj1437 := 0; ; yyj1437++ { + if yyhl1437 { + if yyj1437 >= l { break } } else { @@ -19097,10 +19890,10 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1381Slc = r.DecodeBytes(yys1381Slc, true, true) - yys1381 := string(yys1381Slc) + yys1437Slc = r.DecodeBytes(yys1437Slc, true, true) + yys1437 := string(yys1437Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1381 { + switch yys1437 { case "waiting": if r.TryDecodeAsNil() { if x.Waiting != nil { @@ -19135,9 +19928,9 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Terminated.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1381) - } // end switch yys1381 - } // end for yyj1381 + z.DecStructFieldNotFound(-1, yys1437) + } // end switch yys1437 + } // end for yyj1437 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -19145,16 +19938,16 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1385 int - var yyb1385 bool - var yyhl1385 bool = l >= 0 - yyj1385++ - if yyhl1385 { - yyb1385 = yyj1385 > l + var yyj1441 int + var yyb1441 bool + var yyhl1441 bool = l >= 0 + yyj1441++ + if yyhl1441 { + yyb1441 = yyj1441 > l } else { - yyb1385 = r.CheckBreak() + yyb1441 = r.CheckBreak() } - if yyb1385 { + if yyb1441 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19169,13 +19962,13 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Waiting.CodecDecodeSelf(d) } - yyj1385++ - if yyhl1385 { - yyb1385 = yyj1385 > l + yyj1441++ + if yyhl1441 { + yyb1441 = yyj1441 > l } else { - yyb1385 = r.CheckBreak() + yyb1441 = r.CheckBreak() } - if yyb1385 { + if yyb1441 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19190,13 +19983,13 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Running.CodecDecodeSelf(d) } - yyj1385++ - if yyhl1385 { - yyb1385 = yyj1385 > l + yyj1441++ + if yyhl1441 { + yyb1441 = yyj1441 > l } else { - yyb1385 = r.CheckBreak() + yyb1441 = r.CheckBreak() } - if yyb1385 { + if yyb1441 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19212,17 +20005,17 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Terminated.CodecDecodeSelf(d) } for { - yyj1385++ - if yyhl1385 { - yyb1385 = yyj1385 > l + yyj1441++ + if yyhl1441 { + yyb1441 = yyj1441 > l } else { - yyb1385 = r.CheckBreak() + yyb1441 = r.CheckBreak() } - if yyb1385 { + if yyb1441 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1385-1, "") + z.DecStructFieldNotFound(yyj1441-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19234,36 +20027,36 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1389 := z.EncBinary() - _ = yym1389 + yym1445 := z.EncBinary() + _ = yym1445 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1390 := !z.EncBinary() - yy2arr1390 := z.EncBasicHandle().StructToArray - var yyq1390 [8]bool - _, _, _ = yysep1390, yyq1390, yy2arr1390 - const yyr1390 bool = false - yyq1390[1] = true - yyq1390[2] = true - yyq1390[7] = x.ContainerID != "" - var yynn1390 int - if yyr1390 || yy2arr1390 { + yysep1446 := !z.EncBinary() + yy2arr1446 := z.EncBasicHandle().StructToArray + var yyq1446 [8]bool + _, _, _ = yysep1446, yyq1446, yy2arr1446 + const yyr1446 bool = false + yyq1446[1] = true + yyq1446[2] = true + yyq1446[7] = x.ContainerID != "" + var yynn1446 int + if yyr1446 || yy2arr1446 { r.EncodeArrayStart(8) } else { - yynn1390 = 5 - for _, b := range yyq1390 { + yynn1446 = 5 + for _, b := range yyq1446 { if b { - yynn1390++ + yynn1446++ } } - r.EncodeMapStart(yynn1390) - yynn1390 = 0 + r.EncodeMapStart(yynn1446) + yynn1446 = 0 } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1392 := z.EncBinary() - _ = yym1392 + yym1448 := z.EncBinary() + _ = yym1448 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -19272,51 +20065,51 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1393 := z.EncBinary() - _ = yym1393 + yym1449 := z.EncBinary() + _ = yym1449 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1390[1] { - yy1395 := &x.State - yy1395.CodecEncodeSelf(e) + if yyq1446[1] { + yy1451 := &x.State + yy1451.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1390[1] { + if yyq1446[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("state")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1396 := &x.State - yy1396.CodecEncodeSelf(e) + yy1452 := &x.State + yy1452.CodecEncodeSelf(e) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1390[2] { - yy1398 := &x.LastTerminationState - yy1398.CodecEncodeSelf(e) + if yyq1446[2] { + yy1454 := &x.LastTerminationState + yy1454.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1390[2] { + if yyq1446[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastState")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1399 := &x.LastTerminationState - yy1399.CodecEncodeSelf(e) + yy1455 := &x.LastTerminationState + yy1455.CodecEncodeSelf(e) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1401 := z.EncBinary() - _ = yym1401 + yym1457 := z.EncBinary() + _ = yym1457 if false { } else { r.EncodeBool(bool(x.Ready)) @@ -19325,17 +20118,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ready")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1402 := z.EncBinary() - _ = yym1402 + yym1458 := z.EncBinary() + _ = yym1458 if false { } else { r.EncodeBool(bool(x.Ready)) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1404 := z.EncBinary() - _ = yym1404 + yym1460 := z.EncBinary() + _ = yym1460 if false { } else { r.EncodeInt(int64(x.RestartCount)) @@ -19344,17 +20137,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("restartCount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1405 := z.EncBinary() - _ = yym1405 + yym1461 := z.EncBinary() + _ = yym1461 if false { } else { r.EncodeInt(int64(x.RestartCount)) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1407 := z.EncBinary() - _ = yym1407 + yym1463 := z.EncBinary() + _ = yym1463 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) @@ -19363,17 +20156,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1408 := z.EncBinary() - _ = yym1408 + yym1464 := z.EncBinary() + _ = yym1464 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1410 := z.EncBinary() - _ = yym1410 + yym1466 := z.EncBinary() + _ = yym1466 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ImageID)) @@ -19382,18 +20175,18 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imageID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1411 := z.EncBinary() - _ = yym1411 + yym1467 := z.EncBinary() + _ = yym1467 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ImageID)) } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1390[7] { - yym1413 := z.EncBinary() - _ = yym1413 + if yyq1446[7] { + yym1469 := z.EncBinary() + _ = yym1469 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) @@ -19402,19 +20195,19 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1390[7] { + if yyq1446[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1414 := z.EncBinary() - _ = yym1414 + yym1470 := z.EncBinary() + _ = yym1470 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) } } } - if yyr1390 || yy2arr1390 { + if yyr1446 || yy2arr1446 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -19427,25 +20220,25 @@ func (x *ContainerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1415 := z.DecBinary() - _ = yym1415 + yym1471 := z.DecBinary() + _ = yym1471 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1416 := r.ContainerType() - if yyct1416 == codecSelferValueTypeMap1234 { - yyl1416 := r.ReadMapStart() - if yyl1416 == 0 { + yyct1472 := r.ContainerType() + if yyct1472 == codecSelferValueTypeMap1234 { + yyl1472 := r.ReadMapStart() + if yyl1472 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1416, d) + x.codecDecodeSelfFromMap(yyl1472, d) } - } else if yyct1416 == codecSelferValueTypeArray1234 { - yyl1416 := r.ReadArrayStart() - if yyl1416 == 0 { + } else if yyct1472 == codecSelferValueTypeArray1234 { + yyl1472 := r.ReadArrayStart() + if yyl1472 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1416, d) + x.codecDecodeSelfFromArray(yyl1472, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -19457,12 +20250,12 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1417Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1417Slc - var yyhl1417 bool = l >= 0 - for yyj1417 := 0; ; yyj1417++ { - if yyhl1417 { - if yyj1417 >= l { + var yys1473Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1473Slc + var yyhl1473 bool = l >= 0 + for yyj1473 := 0; ; yyj1473++ { + if yyhl1473 { + if yyj1473 >= l { break } } else { @@ -19471,10 +20264,10 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1417Slc = r.DecodeBytes(yys1417Slc, true, true) - yys1417 := string(yys1417Slc) + yys1473Slc = r.DecodeBytes(yys1473Slc, true, true) + yys1473 := string(yys1473Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1417 { + switch yys1473 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -19485,15 +20278,15 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.State = ContainerState{} } else { - yyv1419 := &x.State - yyv1419.CodecDecodeSelf(d) + yyv1475 := &x.State + yyv1475.CodecDecodeSelf(d) } case "lastState": if r.TryDecodeAsNil() { x.LastTerminationState = ContainerState{} } else { - yyv1420 := &x.LastTerminationState - yyv1420.CodecDecodeSelf(d) + yyv1476 := &x.LastTerminationState + yyv1476.CodecDecodeSelf(d) } case "ready": if r.TryDecodeAsNil() { @@ -19526,9 +20319,9 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ContainerID = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1417) - } // end switch yys1417 - } // end for yyj1417 + z.DecStructFieldNotFound(-1, yys1473) + } // end switch yys1473 + } // end for yyj1473 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -19536,16 +20329,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1426 int - var yyb1426 bool - var yyhl1426 bool = l >= 0 - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + var yyj1482 int + var yyb1482 bool + var yyhl1482 bool = l >= 0 + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19555,13 +20348,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Name = string(r.DecodeString()) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19569,16 +20362,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.State = ContainerState{} } else { - yyv1428 := &x.State - yyv1428.CodecDecodeSelf(d) + yyv1484 := &x.State + yyv1484.CodecDecodeSelf(d) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19586,16 +20379,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.LastTerminationState = ContainerState{} } else { - yyv1429 := &x.LastTerminationState - yyv1429.CodecDecodeSelf(d) + yyv1485 := &x.LastTerminationState + yyv1485.CodecDecodeSelf(d) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19605,13 +20398,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Ready = bool(r.DecodeBool()) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19621,13 +20414,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RestartCount = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19637,13 +20430,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Image = string(r.DecodeString()) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19653,13 +20446,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ImageID = string(r.DecodeString()) } - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19670,17 +20463,17 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ContainerID = string(r.DecodeString()) } for { - yyj1426++ - if yyhl1426 { - yyb1426 = yyj1426 > l + yyj1482++ + if yyhl1482 { + yyb1482 = yyj1482 > l } else { - yyb1426 = r.CheckBreak() + yyb1482 = r.CheckBreak() } - if yyb1426 { + if yyb1482 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1426-1, "") + z.DecStructFieldNotFound(yyj1482-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19689,8 +20482,8 @@ func (x PodPhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1435 := z.EncBinary() - _ = yym1435 + yym1491 := z.EncBinary() + _ = yym1491 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19702,8 +20495,8 @@ func (x *PodPhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1436 := z.DecBinary() - _ = yym1436 + yym1492 := z.DecBinary() + _ = yym1492 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19715,8 +20508,8 @@ func (x PodConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1437 := z.EncBinary() - _ = yym1437 + yym1493 := z.EncBinary() + _ = yym1493 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19728,8 +20521,8 @@ func (x *PodConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1438 := z.DecBinary() - _ = yym1438 + yym1494 := z.DecBinary() + _ = yym1494 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19744,34 +20537,34 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1439 := z.EncBinary() - _ = yym1439 + yym1495 := z.EncBinary() + _ = yym1495 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1440 := !z.EncBinary() - yy2arr1440 := z.EncBasicHandle().StructToArray - var yyq1440 [6]bool - _, _, _ = yysep1440, yyq1440, yy2arr1440 - const yyr1440 bool = false - yyq1440[2] = true - yyq1440[3] = true - yyq1440[4] = x.Reason != "" - yyq1440[5] = x.Message != "" - var yynn1440 int - if yyr1440 || yy2arr1440 { + yysep1496 := !z.EncBinary() + yy2arr1496 := z.EncBasicHandle().StructToArray + var yyq1496 [6]bool + _, _, _ = yysep1496, yyq1496, yy2arr1496 + const yyr1496 bool = false + yyq1496[2] = true + yyq1496[3] = true + yyq1496[4] = x.Reason != "" + yyq1496[5] = x.Message != "" + var yynn1496 int + if yyr1496 || yy2arr1496 { r.EncodeArrayStart(6) } else { - yynn1440 = 2 - for _, b := range yyq1440 { + yynn1496 = 2 + for _, b := range yyq1496 { if b { - yynn1440++ + yynn1496++ } } - r.EncodeMapStart(yynn1440) - yynn1440 = 0 + r.EncodeMapStart(yynn1496) + yynn1496 = 0 } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -19780,7 +20573,7 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -19789,85 +20582,85 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1440[2] { - yy1444 := &x.LastProbeTime - yym1445 := z.EncBinary() - _ = yym1445 + if yyq1496[2] { + yy1500 := &x.LastProbeTime + yym1501 := z.EncBinary() + _ = yym1501 if false { - } else if z.HasExtensions() && z.EncExt(yy1444) { - } else if yym1445 { - z.EncBinaryMarshal(yy1444) - } else if !yym1445 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1444) + } else if z.HasExtensions() && z.EncExt(yy1500) { + } else if yym1501 { + z.EncBinaryMarshal(yy1500) + } else if !yym1501 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1500) } else { - z.EncFallback(yy1444) + z.EncFallback(yy1500) } } else { r.EncodeNil() } } else { - if yyq1440[2] { + if yyq1496[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1446 := &x.LastProbeTime - yym1447 := z.EncBinary() - _ = yym1447 + yy1502 := &x.LastProbeTime + yym1503 := z.EncBinary() + _ = yym1503 if false { - } else if z.HasExtensions() && z.EncExt(yy1446) { - } else if yym1447 { - z.EncBinaryMarshal(yy1446) - } else if !yym1447 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1446) + } else if z.HasExtensions() && z.EncExt(yy1502) { + } else if yym1503 { + z.EncBinaryMarshal(yy1502) + } else if !yym1503 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1502) } else { - z.EncFallback(yy1446) + z.EncFallback(yy1502) } } } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1440[3] { - yy1449 := &x.LastTransitionTime - yym1450 := z.EncBinary() - _ = yym1450 + if yyq1496[3] { + yy1505 := &x.LastTransitionTime + yym1506 := z.EncBinary() + _ = yym1506 if false { - } else if z.HasExtensions() && z.EncExt(yy1449) { - } else if yym1450 { - z.EncBinaryMarshal(yy1449) - } else if !yym1450 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1449) + } else if z.HasExtensions() && z.EncExt(yy1505) { + } else if yym1506 { + z.EncBinaryMarshal(yy1505) + } else if !yym1506 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1505) } else { - z.EncFallback(yy1449) + z.EncFallback(yy1505) } } else { r.EncodeNil() } } else { - if yyq1440[3] { + if yyq1496[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1451 := &x.LastTransitionTime - yym1452 := z.EncBinary() - _ = yym1452 + yy1507 := &x.LastTransitionTime + yym1508 := z.EncBinary() + _ = yym1508 if false { - } else if z.HasExtensions() && z.EncExt(yy1451) { - } else if yym1452 { - z.EncBinaryMarshal(yy1451) - } else if !yym1452 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1451) + } else if z.HasExtensions() && z.EncExt(yy1507) { + } else if yym1508 { + z.EncBinaryMarshal(yy1507) + } else if !yym1508 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1507) } else { - z.EncFallback(yy1451) + z.EncFallback(yy1507) } } } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1440[4] { - yym1454 := z.EncBinary() - _ = yym1454 + if yyq1496[4] { + yym1510 := z.EncBinary() + _ = yym1510 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -19876,23 +20669,23 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1440[4] { + if yyq1496[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1455 := z.EncBinary() - _ = yym1455 + yym1511 := z.EncBinary() + _ = yym1511 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1440[5] { - yym1457 := z.EncBinary() - _ = yym1457 + if yyq1496[5] { + yym1513 := z.EncBinary() + _ = yym1513 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -19901,19 +20694,19 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1440[5] { + if yyq1496[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1458 := z.EncBinary() - _ = yym1458 + yym1514 := z.EncBinary() + _ = yym1514 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1440 || yy2arr1440 { + if yyr1496 || yy2arr1496 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -19926,25 +20719,25 @@ func (x *PodCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1459 := z.DecBinary() - _ = yym1459 + yym1515 := z.DecBinary() + _ = yym1515 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1460 := r.ContainerType() - if yyct1460 == codecSelferValueTypeMap1234 { - yyl1460 := r.ReadMapStart() - if yyl1460 == 0 { + yyct1516 := r.ContainerType() + if yyct1516 == codecSelferValueTypeMap1234 { + yyl1516 := r.ReadMapStart() + if yyl1516 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1460, d) + x.codecDecodeSelfFromMap(yyl1516, d) } - } else if yyct1460 == codecSelferValueTypeArray1234 { - yyl1460 := r.ReadArrayStart() - if yyl1460 == 0 { + } else if yyct1516 == codecSelferValueTypeArray1234 { + yyl1516 := r.ReadArrayStart() + if yyl1516 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1460, d) + x.codecDecodeSelfFromArray(yyl1516, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -19956,12 +20749,12 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1461Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1461Slc - var yyhl1461 bool = l >= 0 - for yyj1461 := 0; ; yyj1461++ { - if yyhl1461 { - if yyj1461 >= l { + var yys1517Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1517Slc + var yyhl1517 bool = l >= 0 + for yyj1517 := 0; ; yyj1517++ { + if yyhl1517 { + if yyj1517 >= l { break } } else { @@ -19970,10 +20763,10 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1461Slc = r.DecodeBytes(yys1461Slc, true, true) - yys1461 := string(yys1461Slc) + yys1517Slc = r.DecodeBytes(yys1517Slc, true, true) + yys1517 := string(yys1517Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1461 { + switch yys1517 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -19990,34 +20783,34 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg2_unversioned.Time{} } else { - yyv1464 := &x.LastProbeTime - yym1465 := z.DecBinary() - _ = yym1465 + yyv1520 := &x.LastProbeTime + yym1521 := z.DecBinary() + _ = yym1521 if false { - } else if z.HasExtensions() && z.DecExt(yyv1464) { - } else if yym1465 { - z.DecBinaryUnmarshal(yyv1464) - } else if !yym1465 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1464) + } else if z.HasExtensions() && z.DecExt(yyv1520) { + } else if yym1521 { + z.DecBinaryUnmarshal(yyv1520) + } else if !yym1521 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1520) } else { - z.DecFallback(yyv1464, false) + z.DecFallback(yyv1520, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv1466 := &x.LastTransitionTime - yym1467 := z.DecBinary() - _ = yym1467 + yyv1522 := &x.LastTransitionTime + yym1523 := z.DecBinary() + _ = yym1523 if false { - } else if z.HasExtensions() && z.DecExt(yyv1466) { - } else if yym1467 { - z.DecBinaryUnmarshal(yyv1466) - } else if !yym1467 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1466) + } else if z.HasExtensions() && z.DecExt(yyv1522) { + } else if yym1523 { + z.DecBinaryUnmarshal(yyv1522) + } else if !yym1523 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1522) } else { - z.DecFallback(yyv1466, false) + z.DecFallback(yyv1522, false) } } case "reason": @@ -20033,9 +20826,9 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1461) - } // end switch yys1461 - } // end for yyj1461 + z.DecStructFieldNotFound(-1, yys1517) + } // end switch yys1517 + } // end for yyj1517 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -20043,16 +20836,16 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1470 int - var yyb1470 bool - var yyhl1470 bool = l >= 0 - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + var yyj1526 int + var yyb1526 bool + var yyhl1526 bool = l >= 0 + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20062,13 +20855,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = PodConditionType(r.DecodeString()) } - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20078,13 +20871,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20092,26 +20885,26 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg2_unversioned.Time{} } else { - yyv1473 := &x.LastProbeTime - yym1474 := z.DecBinary() - _ = yym1474 + yyv1529 := &x.LastProbeTime + yym1530 := z.DecBinary() + _ = yym1530 if false { - } else if z.HasExtensions() && z.DecExt(yyv1473) { - } else if yym1474 { - z.DecBinaryUnmarshal(yyv1473) - } else if !yym1474 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1473) + } else if z.HasExtensions() && z.DecExt(yyv1529) { + } else if yym1530 { + z.DecBinaryUnmarshal(yyv1529) + } else if !yym1530 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1529) } else { - z.DecFallback(yyv1473, false) + z.DecFallback(yyv1529, false) } } - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20119,26 +20912,26 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv1475 := &x.LastTransitionTime - yym1476 := z.DecBinary() - _ = yym1476 + yyv1531 := &x.LastTransitionTime + yym1532 := z.DecBinary() + _ = yym1532 if false { - } else if z.HasExtensions() && z.DecExt(yyv1475) { - } else if yym1476 { - z.DecBinaryUnmarshal(yyv1475) - } else if !yym1476 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1475) + } else if z.HasExtensions() && z.DecExt(yyv1531) { + } else if yym1532 { + z.DecBinaryUnmarshal(yyv1531) + } else if !yym1532 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1531) } else { - z.DecFallback(yyv1475, false) + z.DecFallback(yyv1531, false) } } - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20148,13 +20941,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20165,17 +20958,17 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj1470++ - if yyhl1470 { - yyb1470 = yyj1470 > l + yyj1526++ + if yyhl1526 { + yyb1526 = yyj1526 > l } else { - yyb1470 = r.CheckBreak() + yyb1526 = r.CheckBreak() } - if yyb1470 { + if yyb1526 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1470-1, "") + z.DecStructFieldNotFound(yyj1526-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -20184,8 +20977,8 @@ func (x RestartPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1479 := z.EncBinary() - _ = yym1479 + yym1535 := z.EncBinary() + _ = yym1535 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -20197,8 +20990,8 @@ func (x *RestartPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1480 := z.DecBinary() - _ = yym1480 + yym1536 := z.DecBinary() + _ = yym1536 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -20213,118 +21006,68 @@ func (x *PodList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1481 := z.EncBinary() - _ = yym1481 + yym1537 := z.EncBinary() + _ = yym1537 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1482 := !z.EncBinary() - yy2arr1482 := z.EncBasicHandle().StructToArray - var yyq1482 [4]bool - _, _, _ = yysep1482, yyq1482, yy2arr1482 - const yyr1482 bool = false - yyq1482[0] = x.Kind != "" - yyq1482[1] = x.APIVersion != "" - yyq1482[2] = true - var yynn1482 int - if yyr1482 || yy2arr1482 { + yysep1538 := !z.EncBinary() + yy2arr1538 := z.EncBasicHandle().StructToArray + var yyq1538 [4]bool + _, _, _ = yysep1538, yyq1538, yy2arr1538 + const yyr1538 bool = false + yyq1538[0] = true + yyq1538[2] = x.Kind != "" + yyq1538[3] = x.APIVersion != "" + var yynn1538 int + if yyr1538 || yy2arr1538 { r.EncodeArrayStart(4) } else { - yynn1482 = 1 - for _, b := range yyq1482 { + yynn1538 = 1 + for _, b := range yyq1538 { if b { - yynn1482++ + yynn1538++ } } - r.EncodeMapStart(yynn1482) - yynn1482 = 0 + r.EncodeMapStart(yynn1538) + yynn1538 = 0 } - if yyr1482 || yy2arr1482 { + if yyr1538 || yy2arr1538 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1482[0] { - yym1484 := z.EncBinary() - _ = yym1484 + if yyq1538[0] { + yy1540 := &x.ListMeta + yym1541 := z.EncBinary() + _ = yym1541 if false { + } else if z.HasExtensions() && z.EncExt(yy1540) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1482[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1485 := z.EncBinary() - _ = yym1485 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1482 || yy2arr1482 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1482[1] { - yym1487 := z.EncBinary() - _ = yym1487 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1482[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1488 := z.EncBinary() - _ = yym1488 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1482 || yy2arr1482 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1482[2] { - yy1490 := &x.ListMeta - yym1491 := z.EncBinary() - _ = yym1491 - if false { - } else if z.HasExtensions() && z.EncExt(yy1490) { - } else { - z.EncFallback(yy1490) + z.EncFallback(yy1540) } } else { r.EncodeNil() } } else { - if yyq1482[2] { + if yyq1538[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1492 := &x.ListMeta - yym1493 := z.EncBinary() - _ = yym1493 + yy1542 := &x.ListMeta + yym1543 := z.EncBinary() + _ = yym1543 if false { - } else if z.HasExtensions() && z.EncExt(yy1492) { + } else if z.HasExtensions() && z.EncExt(yy1542) { } else { - z.EncFallback(yy1492) + z.EncFallback(yy1542) } } } - if yyr1482 || yy2arr1482 { + if yyr1538 || yy2arr1538 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1495 := z.EncBinary() - _ = yym1495 + yym1545 := z.EncBinary() + _ = yym1545 if false { } else { h.encSlicePod(([]Pod)(x.Items), e) @@ -20337,15 +21080,65 @@ func (x *PodList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1496 := z.EncBinary() - _ = yym1496 + yym1546 := z.EncBinary() + _ = yym1546 if false { } else { h.encSlicePod(([]Pod)(x.Items), e) } } } - if yyr1482 || yy2arr1482 { + if yyr1538 || yy2arr1538 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1538[2] { + yym1548 := z.EncBinary() + _ = yym1548 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1538[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1549 := z.EncBinary() + _ = yym1549 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1538 || yy2arr1538 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1538[3] { + yym1551 := z.EncBinary() + _ = yym1551 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1538[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1552 := z.EncBinary() + _ = yym1552 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1538 || yy2arr1538 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -20358,25 +21151,25 @@ func (x *PodList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1497 := z.DecBinary() - _ = yym1497 + yym1553 := z.DecBinary() + _ = yym1553 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1498 := r.ContainerType() - if yyct1498 == codecSelferValueTypeMap1234 { - yyl1498 := r.ReadMapStart() - if yyl1498 == 0 { + yyct1554 := r.ContainerType() + if yyct1554 == codecSelferValueTypeMap1234 { + yyl1554 := r.ReadMapStart() + if yyl1554 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1498, d) + x.codecDecodeSelfFromMap(yyl1554, d) } - } else if yyct1498 == codecSelferValueTypeArray1234 { - yyl1498 := r.ReadArrayStart() - if yyl1498 == 0 { + } else if yyct1554 == codecSelferValueTypeArray1234 { + yyl1554 := r.ReadArrayStart() + if yyl1554 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1498, d) + x.codecDecodeSelfFromArray(yyl1554, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -20388,12 +21181,12 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1499Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1499Slc - var yyhl1499 bool = l >= 0 - for yyj1499 := 0; ; yyj1499++ { - if yyhl1499 { - if yyj1499 >= l { + var yys1555Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1555Slc + var yyhl1555 bool = l >= 0 + for yyj1555 := 0; ; yyj1555++ { + if yyhl1555 { + if yyj1555 >= l { break } } else { @@ -20402,10 +21195,35 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1499Slc = r.DecodeBytes(yys1499Slc, true, true) - yys1499 := string(yys1499Slc) + yys1555Slc = r.DecodeBytes(yys1555Slc, true, true) + yys1555 := string(yys1555Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1499 { + switch yys1555 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1556 := &x.ListMeta + yym1557 := z.DecBinary() + _ = yym1557 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1556) { + } else { + z.DecFallback(yyv1556, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1558 := &x.Items + yym1559 := z.DecBinary() + _ = yym1559 + if false { + } else { + h.decSlicePod((*[]Pod)(yyv1558), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -20418,35 +21236,10 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1502 := &x.ListMeta - yym1503 := z.DecBinary() - _ = yym1503 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1502) { - } else { - z.DecFallback(yyv1502, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1504 := &x.Items - yym1505 := z.DecBinary() - _ = yym1505 - if false { - } else { - h.decSlicePod((*[]Pod)(yyv1504), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1499) - } // end switch yys1499 - } // end for yyj1499 + z.DecStructFieldNotFound(-1, yys1555) + } // end switch yys1555 + } // end for yyj1555 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -20454,16 +21247,61 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1506 int - var yyb1506 bool - var yyhl1506 bool = l >= 0 - yyj1506++ - if yyhl1506 { - yyb1506 = yyj1506 > l + var yyj1562 int + var yyb1562 bool + var yyhl1562 bool = l >= 0 + yyj1562++ + if yyhl1562 { + yyb1562 = yyj1562 > l } else { - yyb1506 = r.CheckBreak() + yyb1562 = r.CheckBreak() } - if yyb1506 { + if yyb1562 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1563 := &x.ListMeta + yym1564 := z.DecBinary() + _ = yym1564 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1563) { + } else { + z.DecFallback(yyv1563, false) + } + } + yyj1562++ + if yyhl1562 { + yyb1562 = yyj1562 > l + } else { + yyb1562 = r.CheckBreak() + } + if yyb1562 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1565 := &x.Items + yym1566 := z.DecBinary() + _ = yym1566 + if false { + } else { + h.decSlicePod((*[]Pod)(yyv1565), d) + } + } + yyj1562++ + if yyhl1562 { + yyb1562 = yyj1562 > l + } else { + yyb1562 = r.CheckBreak() + } + if yyb1562 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20473,13 +21311,13 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1506++ - if yyhl1506 { - yyb1506 = yyj1506 > l + yyj1562++ + if yyhl1562 { + yyb1562 = yyj1562 > l } else { - yyb1506 = r.CheckBreak() + yyb1562 = r.CheckBreak() } - if yyb1506 { + if yyb1562 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20489,63 +21327,18 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1506++ - if yyhl1506 { - yyb1506 = yyj1506 > l - } else { - yyb1506 = r.CheckBreak() - } - if yyb1506 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1509 := &x.ListMeta - yym1510 := z.DecBinary() - _ = yym1510 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1509) { - } else { - z.DecFallback(yyv1509, false) - } - } - yyj1506++ - if yyhl1506 { - yyb1506 = yyj1506 > l - } else { - yyb1506 = r.CheckBreak() - } - if yyb1506 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1511 := &x.Items - yym1512 := z.DecBinary() - _ = yym1512 - if false { - } else { - h.decSlicePod((*[]Pod)(yyv1511), d) - } - } for { - yyj1506++ - if yyhl1506 { - yyb1506 = yyj1506 > l + yyj1562++ + if yyhl1562 { + yyb1562 = yyj1562 > l } else { - yyb1506 = r.CheckBreak() + yyb1562 = r.CheckBreak() } - if yyb1506 { + if yyb1562 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1506-1, "") + z.DecStructFieldNotFound(yyj1562-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -20554,8 +21347,8 @@ func (x DNSPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1513 := z.EncBinary() - _ = yym1513 + yym1569 := z.EncBinary() + _ = yym1569 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -20567,8 +21360,8 @@ func (x *DNSPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1514 := z.DecBinary() - _ = yym1514 + yym1570 := z.DecBinary() + _ = yym1570 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -20576,6 +21369,1332 @@ func (x *DNSPolicy) CodecDecodeSelf(d *codec1978.Decoder) { } } +func (x *NodeSelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1571 := z.EncBinary() + _ = yym1571 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1572 := !z.EncBinary() + yy2arr1572 := z.EncBasicHandle().StructToArray + var yyq1572 [1]bool + _, _, _ = yysep1572, yyq1572, yy2arr1572 + const yyr1572 bool = false + var yynn1572 int + if yyr1572 || yy2arr1572 { + r.EncodeArrayStart(1) + } else { + yynn1572 = 1 + for _, b := range yyq1572 { + if b { + yynn1572++ + } + } + r.EncodeMapStart(yynn1572) + yynn1572 = 0 + } + if yyr1572 || yy2arr1572 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.NodeSelectorTerms == nil { + r.EncodeNil() + } else { + yym1574 := z.EncBinary() + _ = yym1574 + if false { + } else { + h.encSliceNodeSelectorTerm(([]NodeSelectorTerm)(x.NodeSelectorTerms), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nodeSelectorTerms")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.NodeSelectorTerms == nil { + r.EncodeNil() + } else { + yym1575 := z.EncBinary() + _ = yym1575 + if false { + } else { + h.encSliceNodeSelectorTerm(([]NodeSelectorTerm)(x.NodeSelectorTerms), e) + } + } + } + if yyr1572 || yy2arr1572 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1576 := z.DecBinary() + _ = yym1576 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1577 := r.ContainerType() + if yyct1577 == codecSelferValueTypeMap1234 { + yyl1577 := r.ReadMapStart() + if yyl1577 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1577, d) + } + } else if yyct1577 == codecSelferValueTypeArray1234 { + yyl1577 := r.ReadArrayStart() + if yyl1577 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1577, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1578Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1578Slc + var yyhl1578 bool = l >= 0 + for yyj1578 := 0; ; yyj1578++ { + if yyhl1578 { + if yyj1578 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1578Slc = r.DecodeBytes(yys1578Slc, true, true) + yys1578 := string(yys1578Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1578 { + case "nodeSelectorTerms": + if r.TryDecodeAsNil() { + x.NodeSelectorTerms = nil + } else { + yyv1579 := &x.NodeSelectorTerms + yym1580 := z.DecBinary() + _ = yym1580 + if false { + } else { + h.decSliceNodeSelectorTerm((*[]NodeSelectorTerm)(yyv1579), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1578) + } // end switch yys1578 + } // end for yyj1578 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1581 int + var yyb1581 bool + var yyhl1581 bool = l >= 0 + yyj1581++ + if yyhl1581 { + yyb1581 = yyj1581 > l + } else { + yyb1581 = r.CheckBreak() + } + if yyb1581 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.NodeSelectorTerms = nil + } else { + yyv1582 := &x.NodeSelectorTerms + yym1583 := z.DecBinary() + _ = yym1583 + if false { + } else { + h.decSliceNodeSelectorTerm((*[]NodeSelectorTerm)(yyv1582), d) + } + } + for { + yyj1581++ + if yyhl1581 { + yyb1581 = yyj1581 > l + } else { + yyb1581 = r.CheckBreak() + } + if yyb1581 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1581-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeSelectorTerm) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1584 := z.EncBinary() + _ = yym1584 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1585 := !z.EncBinary() + yy2arr1585 := z.EncBasicHandle().StructToArray + var yyq1585 [1]bool + _, _, _ = yysep1585, yyq1585, yy2arr1585 + const yyr1585 bool = false + var yynn1585 int + if yyr1585 || yy2arr1585 { + r.EncodeArrayStart(1) + } else { + yynn1585 = 1 + for _, b := range yyq1585 { + if b { + yynn1585++ + } + } + r.EncodeMapStart(yynn1585) + yynn1585 = 0 + } + if yyr1585 || yy2arr1585 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.MatchExpressions == nil { + r.EncodeNil() + } else { + yym1587 := z.EncBinary() + _ = yym1587 + if false { + } else { + h.encSliceNodeSelectorRequirement(([]NodeSelectorRequirement)(x.MatchExpressions), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("matchExpressions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.MatchExpressions == nil { + r.EncodeNil() + } else { + yym1588 := z.EncBinary() + _ = yym1588 + if false { + } else { + h.encSliceNodeSelectorRequirement(([]NodeSelectorRequirement)(x.MatchExpressions), e) + } + } + } + if yyr1585 || yy2arr1585 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelectorTerm) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1589 := z.DecBinary() + _ = yym1589 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1590 := r.ContainerType() + if yyct1590 == codecSelferValueTypeMap1234 { + yyl1590 := r.ReadMapStart() + if yyl1590 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1590, d) + } + } else if yyct1590 == codecSelferValueTypeArray1234 { + yyl1590 := r.ReadArrayStart() + if yyl1590 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1590, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelectorTerm) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1591Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1591Slc + var yyhl1591 bool = l >= 0 + for yyj1591 := 0; ; yyj1591++ { + if yyhl1591 { + if yyj1591 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1591Slc = r.DecodeBytes(yys1591Slc, true, true) + yys1591 := string(yys1591Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1591 { + case "matchExpressions": + if r.TryDecodeAsNil() { + x.MatchExpressions = nil + } else { + yyv1592 := &x.MatchExpressions + yym1593 := z.DecBinary() + _ = yym1593 + if false { + } else { + h.decSliceNodeSelectorRequirement((*[]NodeSelectorRequirement)(yyv1592), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1591) + } // end switch yys1591 + } // end for yyj1591 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelectorTerm) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1594 int + var yyb1594 bool + var yyhl1594 bool = l >= 0 + yyj1594++ + if yyhl1594 { + yyb1594 = yyj1594 > l + } else { + yyb1594 = r.CheckBreak() + } + if yyb1594 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.MatchExpressions = nil + } else { + yyv1595 := &x.MatchExpressions + yym1596 := z.DecBinary() + _ = yym1596 + if false { + } else { + h.decSliceNodeSelectorRequirement((*[]NodeSelectorRequirement)(yyv1595), d) + } + } + for { + yyj1594++ + if yyhl1594 { + yyb1594 = yyj1594 > l + } else { + yyb1594 = r.CheckBreak() + } + if yyb1594 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1594-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1597 := z.EncBinary() + _ = yym1597 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1598 := !z.EncBinary() + yy2arr1598 := z.EncBasicHandle().StructToArray + var yyq1598 [3]bool + _, _, _ = yysep1598, yyq1598, yy2arr1598 + const yyr1598 bool = false + yyq1598[2] = len(x.Values) != 0 + var yynn1598 int + if yyr1598 || yy2arr1598 { + r.EncodeArrayStart(3) + } else { + yynn1598 = 2 + for _, b := range yyq1598 { + if b { + yynn1598++ + } + } + r.EncodeMapStart(yynn1598) + yynn1598 = 0 + } + if yyr1598 || yy2arr1598 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1600 := z.EncBinary() + _ = yym1600 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("key")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1601 := z.EncBinary() + _ = yym1601 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } + if yyr1598 || yy2arr1598 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + x.Operator.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("operator")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Operator.CodecEncodeSelf(e) + } + if yyr1598 || yy2arr1598 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1598[2] { + if x.Values == nil { + r.EncodeNil() + } else { + yym1604 := z.EncBinary() + _ = yym1604 + if false { + } else { + z.F.EncSliceStringV(x.Values, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1598[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("values")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Values == nil { + r.EncodeNil() + } else { + yym1605 := z.EncBinary() + _ = yym1605 + if false { + } else { + z.F.EncSliceStringV(x.Values, false, e) + } + } + } + } + if yyr1598 || yy2arr1598 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelectorRequirement) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1606 := z.DecBinary() + _ = yym1606 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1607 := r.ContainerType() + if yyct1607 == codecSelferValueTypeMap1234 { + yyl1607 := r.ReadMapStart() + if yyl1607 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1607, d) + } + } else if yyct1607 == codecSelferValueTypeArray1234 { + yyl1607 := r.ReadArrayStart() + if yyl1607 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1607, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1608Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1608Slc + var yyhl1608 bool = l >= 0 + for yyj1608 := 0; ; yyj1608++ { + if yyhl1608 { + if yyj1608 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1608Slc = r.DecodeBytes(yys1608Slc, true, true) + yys1608 := string(yys1608Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1608 { + case "key": + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + case "operator": + if r.TryDecodeAsNil() { + x.Operator = "" + } else { + x.Operator = NodeSelectorOperator(r.DecodeString()) + } + case "values": + if r.TryDecodeAsNil() { + x.Values = nil + } else { + yyv1611 := &x.Values + yym1612 := z.DecBinary() + _ = yym1612 + if false { + } else { + z.F.DecSliceStringX(yyv1611, false, d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1608) + } // end switch yys1608 + } // end for yyj1608 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1613 int + var yyb1613 bool + var yyhl1613 bool = l >= 0 + yyj1613++ + if yyhl1613 { + yyb1613 = yyj1613 > l + } else { + yyb1613 = r.CheckBreak() + } + if yyb1613 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + yyj1613++ + if yyhl1613 { + yyb1613 = yyj1613 > l + } else { + yyb1613 = r.CheckBreak() + } + if yyb1613 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Operator = "" + } else { + x.Operator = NodeSelectorOperator(r.DecodeString()) + } + yyj1613++ + if yyhl1613 { + yyb1613 = yyj1613 > l + } else { + yyb1613 = r.CheckBreak() + } + if yyb1613 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Values = nil + } else { + yyv1616 := &x.Values + yym1617 := z.DecBinary() + _ = yym1617 + if false { + } else { + z.F.DecSliceStringX(yyv1616, false, d) + } + } + for { + yyj1613++ + if yyhl1613 { + yyb1613 = yyj1613 > l + } else { + yyb1613 = r.CheckBreak() + } + if yyb1613 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1613-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x NodeSelectorOperator) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1618 := z.EncBinary() + _ = yym1618 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *NodeSelectorOperator) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1619 := z.DecBinary() + _ = yym1619 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *Affinity) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1620 := z.EncBinary() + _ = yym1620 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1621 := !z.EncBinary() + yy2arr1621 := z.EncBasicHandle().StructToArray + var yyq1621 [1]bool + _, _, _ = yysep1621, yyq1621, yy2arr1621 + const yyr1621 bool = false + yyq1621[0] = x.NodeAffinity != nil + var yynn1621 int + if yyr1621 || yy2arr1621 { + r.EncodeArrayStart(1) + } else { + yynn1621 = 0 + for _, b := range yyq1621 { + if b { + yynn1621++ + } + } + r.EncodeMapStart(yynn1621) + yynn1621 = 0 + } + if yyr1621 || yy2arr1621 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1621[0] { + if x.NodeAffinity == nil { + r.EncodeNil() + } else { + x.NodeAffinity.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1621[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nodeAffinity")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.NodeAffinity == nil { + r.EncodeNil() + } else { + x.NodeAffinity.CodecEncodeSelf(e) + } + } + } + if yyr1621 || yy2arr1621 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Affinity) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1623 := z.DecBinary() + _ = yym1623 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1624 := r.ContainerType() + if yyct1624 == codecSelferValueTypeMap1234 { + yyl1624 := r.ReadMapStart() + if yyl1624 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1624, d) + } + } else if yyct1624 == codecSelferValueTypeArray1234 { + yyl1624 := r.ReadArrayStart() + if yyl1624 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1624, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Affinity) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1625Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1625Slc + var yyhl1625 bool = l >= 0 + for yyj1625 := 0; ; yyj1625++ { + if yyhl1625 { + if yyj1625 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1625Slc = r.DecodeBytes(yys1625Slc, true, true) + yys1625 := string(yys1625Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1625 { + case "nodeAffinity": + if r.TryDecodeAsNil() { + if x.NodeAffinity != nil { + x.NodeAffinity = nil + } + } else { + if x.NodeAffinity == nil { + x.NodeAffinity = new(NodeAffinity) + } + x.NodeAffinity.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1625) + } // end switch yys1625 + } // end for yyj1625 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Affinity) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1627 int + var yyb1627 bool + var yyhl1627 bool = l >= 0 + yyj1627++ + if yyhl1627 { + yyb1627 = yyj1627 > l + } else { + yyb1627 = r.CheckBreak() + } + if yyb1627 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.NodeAffinity != nil { + x.NodeAffinity = nil + } + } else { + if x.NodeAffinity == nil { + x.NodeAffinity = new(NodeAffinity) + } + x.NodeAffinity.CodecDecodeSelf(d) + } + for { + yyj1627++ + if yyhl1627 { + yyb1627 = yyj1627 > l + } else { + yyb1627 = r.CheckBreak() + } + if yyb1627 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1627-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeAffinity) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1629 := z.EncBinary() + _ = yym1629 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1630 := !z.EncBinary() + yy2arr1630 := z.EncBasicHandle().StructToArray + var yyq1630 [3]bool + _, _, _ = yysep1630, yyq1630, yy2arr1630 + const yyr1630 bool = false + yyq1630[0] = x.RequiredDuringSchedulingRequiredDuringExecution != nil + yyq1630[1] = x.RequiredDuringSchedulingIgnoredDuringExecution != nil + yyq1630[2] = len(x.PreferredDuringSchedulingIgnoredDuringExecution) != 0 + var yynn1630 int + if yyr1630 || yy2arr1630 { + r.EncodeArrayStart(3) + } else { + yynn1630 = 0 + for _, b := range yyq1630 { + if b { + yynn1630++ + } + } + r.EncodeMapStart(yynn1630) + yynn1630 = 0 + } + if yyr1630 || yy2arr1630 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1630[0] { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingRequiredDuringExecution.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1630[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("requiredDuringSchedulingRequiredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingRequiredDuringExecution.CodecEncodeSelf(e) + } + } + } + if yyr1630 || yy2arr1630 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1630[1] { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1630[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("requiredDuringSchedulingIgnoredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecEncodeSelf(e) + } + } + } + if yyr1630 || yy2arr1630 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1630[2] { + if x.PreferredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + yym1634 := z.EncBinary() + _ = yym1634 + if false { + } else { + h.encSlicePreferredSchedulingTerm(([]PreferredSchedulingTerm)(x.PreferredDuringSchedulingIgnoredDuringExecution), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1630[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("preferredDuringSchedulingIgnoredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.PreferredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + yym1635 := z.EncBinary() + _ = yym1635 + if false { + } else { + h.encSlicePreferredSchedulingTerm(([]PreferredSchedulingTerm)(x.PreferredDuringSchedulingIgnoredDuringExecution), e) + } + } + } + } + if yyr1630 || yy2arr1630 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeAffinity) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1636 := z.DecBinary() + _ = yym1636 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1637 := r.ContainerType() + if yyct1637 == codecSelferValueTypeMap1234 { + yyl1637 := r.ReadMapStart() + if yyl1637 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1637, d) + } + } else if yyct1637 == codecSelferValueTypeArray1234 { + yyl1637 := r.ReadArrayStart() + if yyl1637 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1637, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeAffinity) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1638Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1638Slc + var yyhl1638 bool = l >= 0 + for yyj1638 := 0; ; yyj1638++ { + if yyhl1638 { + if yyj1638 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1638Slc = r.DecodeBytes(yys1638Slc, true, true) + yys1638 := string(yys1638Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1638 { + case "requiredDuringSchedulingRequiredDuringExecution": + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingRequiredDuringExecution != nil { + x.RequiredDuringSchedulingRequiredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + x.RequiredDuringSchedulingRequiredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingRequiredDuringExecution.CodecDecodeSelf(d) + } + case "requiredDuringSchedulingIgnoredDuringExecution": + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingIgnoredDuringExecution != nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecDecodeSelf(d) + } + case "preferredDuringSchedulingIgnoredDuringExecution": + if r.TryDecodeAsNil() { + x.PreferredDuringSchedulingIgnoredDuringExecution = nil + } else { + yyv1641 := &x.PreferredDuringSchedulingIgnoredDuringExecution + yym1642 := z.DecBinary() + _ = yym1642 + if false { + } else { + h.decSlicePreferredSchedulingTerm((*[]PreferredSchedulingTerm)(yyv1641), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1638) + } // end switch yys1638 + } // end for yyj1638 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeAffinity) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1643 int + var yyb1643 bool + var yyhl1643 bool = l >= 0 + yyj1643++ + if yyhl1643 { + yyb1643 = yyj1643 > l + } else { + yyb1643 = r.CheckBreak() + } + if yyb1643 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingRequiredDuringExecution != nil { + x.RequiredDuringSchedulingRequiredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + x.RequiredDuringSchedulingRequiredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingRequiredDuringExecution.CodecDecodeSelf(d) + } + yyj1643++ + if yyhl1643 { + yyb1643 = yyj1643 > l + } else { + yyb1643 = r.CheckBreak() + } + if yyb1643 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingIgnoredDuringExecution != nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecDecodeSelf(d) + } + yyj1643++ + if yyhl1643 { + yyb1643 = yyj1643 > l + } else { + yyb1643 = r.CheckBreak() + } + if yyb1643 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PreferredDuringSchedulingIgnoredDuringExecution = nil + } else { + yyv1646 := &x.PreferredDuringSchedulingIgnoredDuringExecution + yym1647 := z.DecBinary() + _ = yym1647 + if false { + } else { + h.decSlicePreferredSchedulingTerm((*[]PreferredSchedulingTerm)(yyv1646), d) + } + } + for { + yyj1643++ + if yyhl1643 { + yyb1643 = yyj1643 > l + } else { + yyb1643 = r.CheckBreak() + } + if yyb1643 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1643-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PreferredSchedulingTerm) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1648 := z.EncBinary() + _ = yym1648 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1649 := !z.EncBinary() + yy2arr1649 := z.EncBasicHandle().StructToArray + var yyq1649 [2]bool + _, _, _ = yysep1649, yyq1649, yy2arr1649 + const yyr1649 bool = false + var yynn1649 int + if yyr1649 || yy2arr1649 { + r.EncodeArrayStart(2) + } else { + yynn1649 = 2 + for _, b := range yyq1649 { + if b { + yynn1649++ + } + } + r.EncodeMapStart(yynn1649) + yynn1649 = 0 + } + if yyr1649 || yy2arr1649 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1651 := z.EncBinary() + _ = yym1651 + if false { + } else { + r.EncodeInt(int64(x.Weight)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("weight")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1652 := z.EncBinary() + _ = yym1652 + if false { + } else { + r.EncodeInt(int64(x.Weight)) + } + } + if yyr1649 || yy2arr1649 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1654 := &x.Preference + yy1654.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("preference")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1655 := &x.Preference + yy1655.CodecEncodeSelf(e) + } + if yyr1649 || yy2arr1649 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PreferredSchedulingTerm) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1656 := z.DecBinary() + _ = yym1656 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1657 := r.ContainerType() + if yyct1657 == codecSelferValueTypeMap1234 { + yyl1657 := r.ReadMapStart() + if yyl1657 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1657, d) + } + } else if yyct1657 == codecSelferValueTypeArray1234 { + yyl1657 := r.ReadArrayStart() + if yyl1657 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1657, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PreferredSchedulingTerm) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1658Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1658Slc + var yyhl1658 bool = l >= 0 + for yyj1658 := 0; ; yyj1658++ { + if yyhl1658 { + if yyj1658 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1658Slc = r.DecodeBytes(yys1658Slc, true, true) + yys1658 := string(yys1658Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1658 { + case "weight": + if r.TryDecodeAsNil() { + x.Weight = 0 + } else { + x.Weight = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "preference": + if r.TryDecodeAsNil() { + x.Preference = NodeSelectorTerm{} + } else { + yyv1660 := &x.Preference + yyv1660.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1658) + } // end switch yys1658 + } // end for yyj1658 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PreferredSchedulingTerm) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1661 int + var yyb1661 bool + var yyhl1661 bool = l >= 0 + yyj1661++ + if yyhl1661 { + yyb1661 = yyj1661 > l + } else { + yyb1661 = r.CheckBreak() + } + if yyb1661 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Weight = 0 + } else { + x.Weight = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1661++ + if yyhl1661 { + yyb1661 = yyj1661 > l + } else { + yyb1661 = r.CheckBreak() + } + if yyb1661 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Preference = NodeSelectorTerm{} + } else { + yyv1663 := &x.Preference + yyv1663.CodecDecodeSelf(d) + } + for { + yyj1661++ + if yyhl1661 { + yyb1661 = yyj1661 > l + } else { + yyb1661 = r.CheckBreak() + } + if yyb1661 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1661-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -20583,44 +22702,44 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1515 := z.EncBinary() - _ = yym1515 + yym1664 := z.EncBinary() + _ = yym1664 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1516 := !z.EncBinary() - yy2arr1516 := z.EncBasicHandle().StructToArray - var yyq1516 [11]bool - _, _, _ = yysep1516, yyq1516, yy2arr1516 - const yyr1516 bool = false - yyq1516[2] = x.RestartPolicy != "" - yyq1516[3] = x.TerminationGracePeriodSeconds != nil - yyq1516[4] = x.ActiveDeadlineSeconds != nil - yyq1516[5] = x.DNSPolicy != "" - yyq1516[6] = len(x.NodeSelector) != 0 - yyq1516[8] = x.NodeName != "" - yyq1516[9] = x.SecurityContext != nil - yyq1516[10] = len(x.ImagePullSecrets) != 0 - var yynn1516 int - if yyr1516 || yy2arr1516 { + yysep1665 := !z.EncBinary() + yy2arr1665 := z.EncBasicHandle().StructToArray + var yyq1665 [11]bool + _, _, _ = yysep1665, yyq1665, yy2arr1665 + const yyr1665 bool = false + yyq1665[2] = x.RestartPolicy != "" + yyq1665[3] = x.TerminationGracePeriodSeconds != nil + yyq1665[4] = x.ActiveDeadlineSeconds != nil + yyq1665[5] = x.DNSPolicy != "" + yyq1665[6] = len(x.NodeSelector) != 0 + yyq1665[8] = x.NodeName != "" + yyq1665[9] = x.SecurityContext != nil + yyq1665[10] = len(x.ImagePullSecrets) != 0 + var yynn1665 int + if yyr1665 || yy2arr1665 { r.EncodeArrayStart(11) } else { - yynn1516 = 3 - for _, b := range yyq1516 { + yynn1665 = 3 + for _, b := range yyq1665 { if b { - yynn1516++ + yynn1665++ } } - r.EncodeMapStart(yynn1516) - yynn1516 = 0 + r.EncodeMapStart(yynn1665) + yynn1665 = 0 } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Volumes == nil { r.EncodeNil() } else { - yym1518 := z.EncBinary() - _ = yym1518 + yym1667 := z.EncBinary() + _ = yym1667 if false { } else { h.encSliceVolume(([]Volume)(x.Volumes), e) @@ -20633,21 +22752,21 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Volumes == nil { r.EncodeNil() } else { - yym1519 := z.EncBinary() - _ = yym1519 + yym1668 := z.EncBinary() + _ = yym1668 if false { } else { h.encSliceVolume(([]Volume)(x.Volumes), e) } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Containers == nil { r.EncodeNil() } else { - yym1521 := z.EncBinary() - _ = yym1521 + yym1670 := z.EncBinary() + _ = yym1670 if false { } else { h.encSliceContainer(([]Container)(x.Containers), e) @@ -20660,122 +22779,122 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Containers == nil { r.EncodeNil() } else { - yym1522 := z.EncBinary() - _ = yym1522 + yym1671 := z.EncBinary() + _ = yym1671 if false { } else { h.encSliceContainer(([]Container)(x.Containers), e) } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[2] { + if yyq1665[2] { x.RestartPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1516[2] { + if yyq1665[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("restartPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.RestartPolicy.CodecEncodeSelf(e) } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[3] { + if yyq1665[3] { if x.TerminationGracePeriodSeconds == nil { r.EncodeNil() } else { - yy1525 := *x.TerminationGracePeriodSeconds - yym1526 := z.EncBinary() - _ = yym1526 + yy1674 := *x.TerminationGracePeriodSeconds + yym1675 := z.EncBinary() + _ = yym1675 if false { } else { - r.EncodeInt(int64(yy1525)) + r.EncodeInt(int64(yy1674)) } } } else { r.EncodeNil() } } else { - if yyq1516[3] { + if yyq1665[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminationGracePeriodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.TerminationGracePeriodSeconds == nil { r.EncodeNil() } else { - yy1527 := *x.TerminationGracePeriodSeconds - yym1528 := z.EncBinary() - _ = yym1528 + yy1676 := *x.TerminationGracePeriodSeconds + yym1677 := z.EncBinary() + _ = yym1677 if false { } else { - r.EncodeInt(int64(yy1527)) + r.EncodeInt(int64(yy1676)) } } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[4] { + if yyq1665[4] { if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy1530 := *x.ActiveDeadlineSeconds - yym1531 := z.EncBinary() - _ = yym1531 + yy1679 := *x.ActiveDeadlineSeconds + yym1680 := z.EncBinary() + _ = yym1680 if false { } else { - r.EncodeInt(int64(yy1530)) + r.EncodeInt(int64(yy1679)) } } } else { r.EncodeNil() } } else { - if yyq1516[4] { + if yyq1665[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("activeDeadlineSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy1532 := *x.ActiveDeadlineSeconds - yym1533 := z.EncBinary() - _ = yym1533 + yy1681 := *x.ActiveDeadlineSeconds + yym1682 := z.EncBinary() + _ = yym1682 if false { } else { - r.EncodeInt(int64(yy1532)) + r.EncodeInt(int64(yy1681)) } } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[5] { + if yyq1665[5] { x.DNSPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1516[5] { + if yyq1665[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("dnsPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.DNSPolicy.CodecEncodeSelf(e) } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[6] { + if yyq1665[6] { if x.NodeSelector == nil { r.EncodeNil() } else { - yym1536 := z.EncBinary() - _ = yym1536 + yym1685 := z.EncBinary() + _ = yym1685 if false { } else { z.F.EncMapStringStringV(x.NodeSelector, false, e) @@ -20785,15 +22904,15 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1516[6] { + if yyq1665[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeSelector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.NodeSelector == nil { r.EncodeNil() } else { - yym1537 := z.EncBinary() - _ = yym1537 + yym1686 := z.EncBinary() + _ = yym1686 if false { } else { z.F.EncMapStringStringV(x.NodeSelector, false, e) @@ -20801,10 +22920,10 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1539 := z.EncBinary() - _ = yym1539 + yym1688 := z.EncBinary() + _ = yym1688 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountName)) @@ -20813,18 +22932,18 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceAccountName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1540 := z.EncBinary() - _ = yym1540 + yym1689 := z.EncBinary() + _ = yym1689 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountName)) } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[8] { - yym1542 := z.EncBinary() - _ = yym1542 + if yyq1665[8] { + yym1691 := z.EncBinary() + _ = yym1691 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeName)) @@ -20833,21 +22952,21 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1516[8] { + if yyq1665[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1543 := z.EncBinary() - _ = yym1543 + yym1692 := z.EncBinary() + _ = yym1692 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeName)) } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[9] { + if yyq1665[9] { if x.SecurityContext == nil { r.EncodeNil() } else { @@ -20857,7 +22976,7 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1516[9] { + if yyq1665[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("securityContext")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -20868,14 +22987,14 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1516[10] { + if yyq1665[10] { if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym1546 := z.EncBinary() - _ = yym1546 + yym1695 := z.EncBinary() + _ = yym1695 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -20885,15 +23004,15 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1516[10] { + if yyq1665[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imagePullSecrets")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym1547 := z.EncBinary() - _ = yym1547 + yym1696 := z.EncBinary() + _ = yym1696 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -20901,7 +23020,7 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1516 || yy2arr1516 { + if yyr1665 || yy2arr1665 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -20914,25 +23033,25 @@ func (x *PodSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1548 := z.DecBinary() - _ = yym1548 + yym1697 := z.DecBinary() + _ = yym1697 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1549 := r.ContainerType() - if yyct1549 == codecSelferValueTypeMap1234 { - yyl1549 := r.ReadMapStart() - if yyl1549 == 0 { + yyct1698 := r.ContainerType() + if yyct1698 == codecSelferValueTypeMap1234 { + yyl1698 := r.ReadMapStart() + if yyl1698 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1549, d) + x.codecDecodeSelfFromMap(yyl1698, d) } - } else if yyct1549 == codecSelferValueTypeArray1234 { - yyl1549 := r.ReadArrayStart() - if yyl1549 == 0 { + } else if yyct1698 == codecSelferValueTypeArray1234 { + yyl1698 := r.ReadArrayStart() + if yyl1698 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1549, d) + x.codecDecodeSelfFromArray(yyl1698, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -20944,12 +23063,12 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1550Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1550Slc - var yyhl1550 bool = l >= 0 - for yyj1550 := 0; ; yyj1550++ { - if yyhl1550 { - if yyj1550 >= l { + var yys1699Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1699Slc + var yyhl1699 bool = l >= 0 + for yyj1699 := 0; ; yyj1699++ { + if yyhl1699 { + if yyj1699 >= l { break } } else { @@ -20958,32 +23077,32 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1550Slc = r.DecodeBytes(yys1550Slc, true, true) - yys1550 := string(yys1550Slc) + yys1699Slc = r.DecodeBytes(yys1699Slc, true, true) + yys1699 := string(yys1699Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1550 { + switch yys1699 { case "volumes": if r.TryDecodeAsNil() { x.Volumes = nil } else { - yyv1551 := &x.Volumes - yym1552 := z.DecBinary() - _ = yym1552 + yyv1700 := &x.Volumes + yym1701 := z.DecBinary() + _ = yym1701 if false { } else { - h.decSliceVolume((*[]Volume)(yyv1551), d) + h.decSliceVolume((*[]Volume)(yyv1700), d) } } case "containers": if r.TryDecodeAsNil() { x.Containers = nil } else { - yyv1553 := &x.Containers - yym1554 := z.DecBinary() - _ = yym1554 + yyv1702 := &x.Containers + yym1703 := z.DecBinary() + _ = yym1703 if false { } else { - h.decSliceContainer((*[]Container)(yyv1553), d) + h.decSliceContainer((*[]Container)(yyv1702), d) } } case "restartPolicy": @@ -21001,8 +23120,8 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TerminationGracePeriodSeconds == nil { x.TerminationGracePeriodSeconds = new(int64) } - yym1557 := z.DecBinary() - _ = yym1557 + yym1706 := z.DecBinary() + _ = yym1706 if false { } else { *((*int64)(x.TerminationGracePeriodSeconds)) = int64(r.DecodeInt(64)) @@ -21017,8 +23136,8 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym1559 := z.DecBinary() - _ = yym1559 + yym1708 := z.DecBinary() + _ = yym1708 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) @@ -21034,12 +23153,12 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeSelector = nil } else { - yyv1561 := &x.NodeSelector - yym1562 := z.DecBinary() - _ = yym1562 + yyv1710 := &x.NodeSelector + yym1711 := z.DecBinary() + _ = yym1711 if false { } else { - z.F.DecMapStringStringX(yyv1561, false, d) + z.F.DecMapStringStringX(yyv1710, false, d) } } case "serviceAccountName": @@ -21069,18 +23188,18 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ImagePullSecrets = nil } else { - yyv1566 := &x.ImagePullSecrets - yym1567 := z.DecBinary() - _ = yym1567 + yyv1715 := &x.ImagePullSecrets + yym1716 := z.DecBinary() + _ = yym1716 if false { } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1566), d) + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1715), d) } } default: - z.DecStructFieldNotFound(-1, yys1550) - } // end switch yys1550 - } // end for yyj1550 + z.DecStructFieldNotFound(-1, yys1699) + } // end switch yys1699 + } // end for yyj1699 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -21088,16 +23207,16 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1568 int - var yyb1568 bool - var yyhl1568 bool = l >= 0 - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + var yyj1717 int + var yyb1717 bool + var yyhl1717 bool = l >= 0 + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21105,21 +23224,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Volumes = nil } else { - yyv1569 := &x.Volumes - yym1570 := z.DecBinary() - _ = yym1570 + yyv1718 := &x.Volumes + yym1719 := z.DecBinary() + _ = yym1719 if false { } else { - h.decSliceVolume((*[]Volume)(yyv1569), d) + h.decSliceVolume((*[]Volume)(yyv1718), d) } } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21127,21 +23246,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Containers = nil } else { - yyv1571 := &x.Containers - yym1572 := z.DecBinary() - _ = yym1572 + yyv1720 := &x.Containers + yym1721 := z.DecBinary() + _ = yym1721 if false { } else { - h.decSliceContainer((*[]Container)(yyv1571), d) + h.decSliceContainer((*[]Container)(yyv1720), d) } } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21151,13 +23270,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.RestartPolicy = RestartPolicy(r.DecodeString()) } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21170,20 +23289,20 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.TerminationGracePeriodSeconds == nil { x.TerminationGracePeriodSeconds = new(int64) } - yym1575 := z.DecBinary() - _ = yym1575 + yym1724 := z.DecBinary() + _ = yym1724 if false { } else { *((*int64)(x.TerminationGracePeriodSeconds)) = int64(r.DecodeInt(64)) } } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21196,20 +23315,20 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym1577 := z.DecBinary() - _ = yym1577 + yym1726 := z.DecBinary() + _ = yym1726 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) } } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21219,13 +23338,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.DNSPolicy = DNSPolicy(r.DecodeString()) } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21233,21 +23352,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeSelector = nil } else { - yyv1579 := &x.NodeSelector - yym1580 := z.DecBinary() - _ = yym1580 + yyv1728 := &x.NodeSelector + yym1729 := z.DecBinary() + _ = yym1729 if false { } else { - z.F.DecMapStringStringX(yyv1579, false, d) + z.F.DecMapStringStringX(yyv1728, false, d) } } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21257,13 +23376,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ServiceAccountName = string(r.DecodeString()) } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21273,13 +23392,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.NodeName = string(r.DecodeString()) } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21294,13 +23413,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.SecurityContext.CodecDecodeSelf(d) } - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21308,26 +23427,26 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ImagePullSecrets = nil } else { - yyv1584 := &x.ImagePullSecrets - yym1585 := z.DecBinary() - _ = yym1585 + yyv1733 := &x.ImagePullSecrets + yym1734 := z.DecBinary() + _ = yym1734 if false { } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1584), d) + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1733), d) } } for { - yyj1568++ - if yyhl1568 { - yyb1568 = yyj1568 > l + yyj1717++ + if yyhl1717 { + yyb1717 = yyj1717 > l } else { - yyb1568 = r.CheckBreak() + yyb1717 = r.CheckBreak() } - if yyb1568 { + if yyb1717 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1568-1, "") + z.DecStructFieldNotFound(yyj1717-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -21339,42 +23458,42 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1586 := z.EncBinary() - _ = yym1586 + yym1735 := z.EncBinary() + _ = yym1735 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1587 := !z.EncBinary() - yy2arr1587 := z.EncBasicHandle().StructToArray - var yyq1587 [8]bool - _, _, _ = yysep1587, yyq1587, yy2arr1587 - const yyr1587 bool = false - yyq1587[0] = x.HostNetwork != false - yyq1587[1] = x.HostPID != false - yyq1587[2] = x.HostIPC != false - yyq1587[3] = x.SELinuxOptions != nil - yyq1587[4] = x.RunAsUser != nil - yyq1587[5] = x.RunAsNonRoot != nil - yyq1587[6] = len(x.SupplementalGroups) != 0 - yyq1587[7] = x.FSGroup != nil - var yynn1587 int - if yyr1587 || yy2arr1587 { + yysep1736 := !z.EncBinary() + yy2arr1736 := z.EncBasicHandle().StructToArray + var yyq1736 [8]bool + _, _, _ = yysep1736, yyq1736, yy2arr1736 + const yyr1736 bool = false + yyq1736[0] = x.HostNetwork != false + yyq1736[1] = x.HostPID != false + yyq1736[2] = x.HostIPC != false + yyq1736[3] = x.SELinuxOptions != nil + yyq1736[4] = x.RunAsUser != nil + yyq1736[5] = x.RunAsNonRoot != nil + yyq1736[6] = len(x.SupplementalGroups) != 0 + yyq1736[7] = x.FSGroup != nil + var yynn1736 int + if yyr1736 || yy2arr1736 { r.EncodeArrayStart(8) } else { - yynn1587 = 0 - for _, b := range yyq1587 { + yynn1736 = 0 + for _, b := range yyq1736 { if b { - yynn1587++ + yynn1736++ } } - r.EncodeMapStart(yynn1587) - yynn1587 = 0 + r.EncodeMapStart(yynn1736) + yynn1736 = 0 } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[0] { - yym1589 := z.EncBinary() - _ = yym1589 + if yyq1736[0] { + yym1738 := z.EncBinary() + _ = yym1738 if false { } else { r.EncodeBool(bool(x.HostNetwork)) @@ -21383,23 +23502,23 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1587[0] { + if yyq1736[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostNetwork")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1590 := z.EncBinary() - _ = yym1590 + yym1739 := z.EncBinary() + _ = yym1739 if false { } else { r.EncodeBool(bool(x.HostNetwork)) } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[1] { - yym1592 := z.EncBinary() - _ = yym1592 + if yyq1736[1] { + yym1741 := z.EncBinary() + _ = yym1741 if false { } else { r.EncodeBool(bool(x.HostPID)) @@ -21408,23 +23527,23 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1587[1] { + if yyq1736[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1593 := z.EncBinary() - _ = yym1593 + yym1742 := z.EncBinary() + _ = yym1742 if false { } else { r.EncodeBool(bool(x.HostPID)) } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[2] { - yym1595 := z.EncBinary() - _ = yym1595 + if yyq1736[2] { + yym1744 := z.EncBinary() + _ = yym1744 if false { } else { r.EncodeBool(bool(x.HostIPC)) @@ -21433,21 +23552,21 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1587[2] { + if yyq1736[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIPC")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1596 := z.EncBinary() - _ = yym1596 + yym1745 := z.EncBinary() + _ = yym1745 if false { } else { r.EncodeBool(bool(x.HostIPC)) } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[3] { + if yyq1736[3] { if x.SELinuxOptions == nil { r.EncodeNil() } else { @@ -21457,7 +23576,7 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1587[3] { + if yyq1736[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -21468,84 +23587,84 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[4] { + if yyq1736[4] { if x.RunAsUser == nil { r.EncodeNil() } else { - yy1599 := *x.RunAsUser - yym1600 := z.EncBinary() - _ = yym1600 + yy1748 := *x.RunAsUser + yym1749 := z.EncBinary() + _ = yym1749 if false { } else { - r.EncodeInt(int64(yy1599)) + r.EncodeInt(int64(yy1748)) } } } else { r.EncodeNil() } } else { - if yyq1587[4] { + if yyq1736[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsUser == nil { r.EncodeNil() } else { - yy1601 := *x.RunAsUser - yym1602 := z.EncBinary() - _ = yym1602 + yy1750 := *x.RunAsUser + yym1751 := z.EncBinary() + _ = yym1751 if false { } else { - r.EncodeInt(int64(yy1601)) + r.EncodeInt(int64(yy1750)) } } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[5] { + if yyq1736[5] { if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy1604 := *x.RunAsNonRoot - yym1605 := z.EncBinary() - _ = yym1605 + yy1753 := *x.RunAsNonRoot + yym1754 := z.EncBinary() + _ = yym1754 if false { } else { - r.EncodeBool(bool(yy1604)) + r.EncodeBool(bool(yy1753)) } } } else { r.EncodeNil() } } else { - if yyq1587[5] { + if yyq1736[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsNonRoot")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy1606 := *x.RunAsNonRoot - yym1607 := z.EncBinary() - _ = yym1607 + yy1755 := *x.RunAsNonRoot + yym1756 := z.EncBinary() + _ = yym1756 if false { } else { - r.EncodeBool(bool(yy1606)) + r.EncodeBool(bool(yy1755)) } } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[6] { + if yyq1736[6] { if x.SupplementalGroups == nil { r.EncodeNil() } else { - yym1609 := z.EncBinary() - _ = yym1609 + yym1758 := z.EncBinary() + _ = yym1758 if false { } else { z.F.EncSliceInt64V(x.SupplementalGroups, false, e) @@ -21555,15 +23674,15 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1587[6] { + if yyq1736[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("supplementalGroups")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.SupplementalGroups == nil { r.EncodeNil() } else { - yym1610 := z.EncBinary() - _ = yym1610 + yym1759 := z.EncBinary() + _ = yym1759 if false { } else { z.F.EncSliceInt64V(x.SupplementalGroups, false, e) @@ -21571,42 +23690,42 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1587[7] { + if yyq1736[7] { if x.FSGroup == nil { r.EncodeNil() } else { - yy1612 := *x.FSGroup - yym1613 := z.EncBinary() - _ = yym1613 + yy1761 := *x.FSGroup + yym1762 := z.EncBinary() + _ = yym1762 if false { } else { - r.EncodeInt(int64(yy1612)) + r.EncodeInt(int64(yy1761)) } } } else { r.EncodeNil() } } else { - if yyq1587[7] { + if yyq1736[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsGroup")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.FSGroup == nil { r.EncodeNil() } else { - yy1614 := *x.FSGroup - yym1615 := z.EncBinary() - _ = yym1615 + yy1763 := *x.FSGroup + yym1764 := z.EncBinary() + _ = yym1764 if false { } else { - r.EncodeInt(int64(yy1614)) + r.EncodeInt(int64(yy1763)) } } } } - if yyr1587 || yy2arr1587 { + if yyr1736 || yy2arr1736 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -21619,25 +23738,25 @@ func (x *PodSecurityContext) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1616 := z.DecBinary() - _ = yym1616 + yym1765 := z.DecBinary() + _ = yym1765 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1617 := r.ContainerType() - if yyct1617 == codecSelferValueTypeMap1234 { - yyl1617 := r.ReadMapStart() - if yyl1617 == 0 { + yyct1766 := r.ContainerType() + if yyct1766 == codecSelferValueTypeMap1234 { + yyl1766 := r.ReadMapStart() + if yyl1766 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1617, d) + x.codecDecodeSelfFromMap(yyl1766, d) } - } else if yyct1617 == codecSelferValueTypeArray1234 { - yyl1617 := r.ReadArrayStart() - if yyl1617 == 0 { + } else if yyct1766 == codecSelferValueTypeArray1234 { + yyl1766 := r.ReadArrayStart() + if yyl1766 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1617, d) + x.codecDecodeSelfFromArray(yyl1766, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -21649,12 +23768,12 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1618Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1618Slc - var yyhl1618 bool = l >= 0 - for yyj1618 := 0; ; yyj1618++ { - if yyhl1618 { - if yyj1618 >= l { + var yys1767Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1767Slc + var yyhl1767 bool = l >= 0 + for yyj1767 := 0; ; yyj1767++ { + if yyhl1767 { + if yyj1767 >= l { break } } else { @@ -21663,10 +23782,10 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1618Slc = r.DecodeBytes(yys1618Slc, true, true) - yys1618 := string(yys1618Slc) + yys1767Slc = r.DecodeBytes(yys1767Slc, true, true) + yys1767 := string(yys1767Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1618 { + switch yys1767 { case "hostNetwork": if r.TryDecodeAsNil() { x.HostNetwork = false @@ -21705,8 +23824,8 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym1624 := z.DecBinary() - _ = yym1624 + yym1773 := z.DecBinary() + _ = yym1773 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) @@ -21721,8 +23840,8 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym1626 := z.DecBinary() - _ = yym1626 + yym1775 := z.DecBinary() + _ = yym1775 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() @@ -21732,12 +23851,12 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.SupplementalGroups = nil } else { - yyv1627 := &x.SupplementalGroups - yym1628 := z.DecBinary() - _ = yym1628 + yyv1776 := &x.SupplementalGroups + yym1777 := z.DecBinary() + _ = yym1777 if false { } else { - z.F.DecSliceInt64X(yyv1627, false, d) + z.F.DecSliceInt64X(yyv1776, false, d) } } case "fsGroup": @@ -21749,17 +23868,17 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.FSGroup == nil { x.FSGroup = new(int64) } - yym1630 := z.DecBinary() - _ = yym1630 + yym1779 := z.DecBinary() + _ = yym1779 if false { } else { *((*int64)(x.FSGroup)) = int64(r.DecodeInt(64)) } } default: - z.DecStructFieldNotFound(-1, yys1618) - } // end switch yys1618 - } // end for yyj1618 + z.DecStructFieldNotFound(-1, yys1767) + } // end switch yys1767 + } // end for yyj1767 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -21767,16 +23886,16 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1631 int - var yyb1631 bool - var yyhl1631 bool = l >= 0 - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + var yyj1780 int + var yyb1780 bool + var yyhl1780 bool = l >= 0 + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21786,13 +23905,13 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.HostNetwork = bool(r.DecodeBool()) } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21802,13 +23921,13 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.HostPID = bool(r.DecodeBool()) } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21818,13 +23937,13 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.HostIPC = bool(r.DecodeBool()) } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21839,13 +23958,13 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode } x.SELinuxOptions.CodecDecodeSelf(d) } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21858,20 +23977,20 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym1637 := z.DecBinary() - _ = yym1637 + yym1786 := z.DecBinary() + _ = yym1786 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) } } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21884,20 +24003,20 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym1639 := z.DecBinary() - _ = yym1639 + yym1788 := z.DecBinary() + _ = yym1788 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21905,21 +24024,21 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.SupplementalGroups = nil } else { - yyv1640 := &x.SupplementalGroups - yym1641 := z.DecBinary() - _ = yym1641 + yyv1789 := &x.SupplementalGroups + yym1790 := z.DecBinary() + _ = yym1790 if false { } else { - z.F.DecSliceInt64X(yyv1640, false, d) + z.F.DecSliceInt64X(yyv1789, false, d) } } - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21932,25 +24051,25 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.FSGroup == nil { x.FSGroup = new(int64) } - yym1643 := z.DecBinary() - _ = yym1643 + yym1792 := z.DecBinary() + _ = yym1792 if false { } else { *((*int64)(x.FSGroup)) = int64(r.DecodeInt(64)) } } for { - yyj1631++ - if yyhl1631 { - yyb1631 = yyj1631 > l + yyj1780++ + if yyhl1780 { + yyb1780 = yyj1780 > l } else { - yyb1631 = r.CheckBreak() + yyb1780 = r.CheckBreak() } - if yyb1631 { + if yyb1780 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1631-1, "") + z.DecStructFieldNotFound(yyj1780-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -21962,60 +24081,60 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1644 := z.EncBinary() - _ = yym1644 + yym1793 := z.EncBinary() + _ = yym1793 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1645 := !z.EncBinary() - yy2arr1645 := z.EncBasicHandle().StructToArray - var yyq1645 [8]bool - _, _, _ = yysep1645, yyq1645, yy2arr1645 - const yyr1645 bool = false - yyq1645[0] = x.Phase != "" - yyq1645[1] = len(x.Conditions) != 0 - yyq1645[2] = x.Message != "" - yyq1645[3] = x.Reason != "" - yyq1645[4] = x.HostIP != "" - yyq1645[5] = x.PodIP != "" - yyq1645[6] = x.StartTime != nil - yyq1645[7] = len(x.ContainerStatuses) != 0 - var yynn1645 int - if yyr1645 || yy2arr1645 { + yysep1794 := !z.EncBinary() + yy2arr1794 := z.EncBasicHandle().StructToArray + var yyq1794 [8]bool + _, _, _ = yysep1794, yyq1794, yy2arr1794 + const yyr1794 bool = false + yyq1794[0] = x.Phase != "" + yyq1794[1] = len(x.Conditions) != 0 + yyq1794[2] = x.Message != "" + yyq1794[3] = x.Reason != "" + yyq1794[4] = x.HostIP != "" + yyq1794[5] = x.PodIP != "" + yyq1794[6] = x.StartTime != nil + yyq1794[7] = len(x.ContainerStatuses) != 0 + var yynn1794 int + if yyr1794 || yy2arr1794 { r.EncodeArrayStart(8) } else { - yynn1645 = 0 - for _, b := range yyq1645 { + yynn1794 = 0 + for _, b := range yyq1794 { if b { - yynn1645++ + yynn1794++ } } - r.EncodeMapStart(yynn1645) - yynn1645 = 0 + r.EncodeMapStart(yynn1794) + yynn1794 = 0 } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[0] { + if yyq1794[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1645[0] { + if yyq1794[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[1] { + if yyq1794[1] { if x.Conditions == nil { r.EncodeNil() } else { - yym1648 := z.EncBinary() - _ = yym1648 + yym1797 := z.EncBinary() + _ = yym1797 if false { } else { h.encSlicePodCondition(([]PodCondition)(x.Conditions), e) @@ -22025,15 +24144,15 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1645[1] { + if yyq1794[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym1649 := z.EncBinary() - _ = yym1649 + yym1798 := z.EncBinary() + _ = yym1798 if false { } else { h.encSlicePodCondition(([]PodCondition)(x.Conditions), e) @@ -22041,11 +24160,11 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[2] { - yym1651 := z.EncBinary() - _ = yym1651 + if yyq1794[2] { + yym1800 := z.EncBinary() + _ = yym1800 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -22054,23 +24173,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1645[2] { + if yyq1794[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1652 := z.EncBinary() - _ = yym1652 + yym1801 := z.EncBinary() + _ = yym1801 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[3] { - yym1654 := z.EncBinary() - _ = yym1654 + if yyq1794[3] { + yym1803 := z.EncBinary() + _ = yym1803 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -22079,23 +24198,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1645[3] { + if yyq1794[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1655 := z.EncBinary() - _ = yym1655 + yym1804 := z.EncBinary() + _ = yym1804 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[4] { - yym1657 := z.EncBinary() - _ = yym1657 + if yyq1794[4] { + yym1806 := z.EncBinary() + _ = yym1806 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) @@ -22104,23 +24223,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1645[4] { + if yyq1794[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1658 := z.EncBinary() - _ = yym1658 + yym1807 := z.EncBinary() + _ = yym1807 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[5] { - yym1660 := z.EncBinary() - _ = yym1660 + if yyq1794[5] { + yym1809 := z.EncBinary() + _ = yym1809 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodIP)) @@ -22129,31 +24248,31 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1645[5] { + if yyq1794[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1661 := z.EncBinary() - _ = yym1661 + yym1810 := z.EncBinary() + _ = yym1810 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodIP)) } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[6] { + if yyq1794[6] { if x.StartTime == nil { r.EncodeNil() } else { - yym1663 := z.EncBinary() - _ = yym1663 + yym1812 := z.EncBinary() + _ = yym1812 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym1663 { + } else if yym1812 { z.EncBinaryMarshal(x.StartTime) - } else if !yym1663 && z.IsJSONHandle() { + } else if !yym1812 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -22163,20 +24282,20 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1645[6] { + if yyq1794[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.StartTime == nil { r.EncodeNil() } else { - yym1664 := z.EncBinary() - _ = yym1664 + yym1813 := z.EncBinary() + _ = yym1813 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym1664 { + } else if yym1813 { z.EncBinaryMarshal(x.StartTime) - } else if !yym1664 && z.IsJSONHandle() { + } else if !yym1813 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -22184,14 +24303,14 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1645[7] { + if yyq1794[7] { if x.ContainerStatuses == nil { r.EncodeNil() } else { - yym1666 := z.EncBinary() - _ = yym1666 + yym1815 := z.EncBinary() + _ = yym1815 if false { } else { h.encSliceContainerStatus(([]ContainerStatus)(x.ContainerStatuses), e) @@ -22201,15 +24320,15 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1645[7] { + if yyq1794[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerStatuses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ContainerStatuses == nil { r.EncodeNil() } else { - yym1667 := z.EncBinary() - _ = yym1667 + yym1816 := z.EncBinary() + _ = yym1816 if false { } else { h.encSliceContainerStatus(([]ContainerStatus)(x.ContainerStatuses), e) @@ -22217,7 +24336,7 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1645 || yy2arr1645 { + if yyr1794 || yy2arr1794 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22230,25 +24349,25 @@ func (x *PodStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1668 := z.DecBinary() - _ = yym1668 + yym1817 := z.DecBinary() + _ = yym1817 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1669 := r.ContainerType() - if yyct1669 == codecSelferValueTypeMap1234 { - yyl1669 := r.ReadMapStart() - if yyl1669 == 0 { + yyct1818 := r.ContainerType() + if yyct1818 == codecSelferValueTypeMap1234 { + yyl1818 := r.ReadMapStart() + if yyl1818 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1669, d) + x.codecDecodeSelfFromMap(yyl1818, d) } - } else if yyct1669 == codecSelferValueTypeArray1234 { - yyl1669 := r.ReadArrayStart() - if yyl1669 == 0 { + } else if yyct1818 == codecSelferValueTypeArray1234 { + yyl1818 := r.ReadArrayStart() + if yyl1818 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1669, d) + x.codecDecodeSelfFromArray(yyl1818, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22260,12 +24379,12 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1670Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1670Slc - var yyhl1670 bool = l >= 0 - for yyj1670 := 0; ; yyj1670++ { - if yyhl1670 { - if yyj1670 >= l { + var yys1819Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1819Slc + var yyhl1819 bool = l >= 0 + for yyj1819 := 0; ; yyj1819++ { + if yyhl1819 { + if yyj1819 >= l { break } } else { @@ -22274,10 +24393,10 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1670Slc = r.DecodeBytes(yys1670Slc, true, true) - yys1670 := string(yys1670Slc) + yys1819Slc = r.DecodeBytes(yys1819Slc, true, true) + yys1819 := string(yys1819Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1670 { + switch yys1819 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -22288,12 +24407,12 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv1672 := &x.Conditions - yym1673 := z.DecBinary() - _ = yym1673 + yyv1821 := &x.Conditions + yym1822 := z.DecBinary() + _ = yym1822 if false { } else { - h.decSlicePodCondition((*[]PodCondition)(yyv1672), d) + h.decSlicePodCondition((*[]PodCondition)(yyv1821), d) } } case "message": @@ -22329,13 +24448,13 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg2_unversioned.Time) } - yym1679 := z.DecBinary() - _ = yym1679 + yym1828 := z.DecBinary() + _ = yym1828 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym1679 { + } else if yym1828 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym1679 && z.IsJSONHandle() { + } else if !yym1828 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) @@ -22345,18 +24464,18 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ContainerStatuses = nil } else { - yyv1680 := &x.ContainerStatuses - yym1681 := z.DecBinary() - _ = yym1681 + yyv1829 := &x.ContainerStatuses + yym1830 := z.DecBinary() + _ = yym1830 if false { } else { - h.decSliceContainerStatus((*[]ContainerStatus)(yyv1680), d) + h.decSliceContainerStatus((*[]ContainerStatus)(yyv1829), d) } } default: - z.DecStructFieldNotFound(-1, yys1670) - } // end switch yys1670 - } // end for yyj1670 + z.DecStructFieldNotFound(-1, yys1819) + } // end switch yys1819 + } // end for yyj1819 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22364,16 +24483,16 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1682 int - var yyb1682 bool - var yyhl1682 bool = l >= 0 - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + var yyj1831 int + var yyb1831 bool + var yyhl1831 bool = l >= 0 + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22383,13 +24502,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Phase = PodPhase(r.DecodeString()) } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22397,21 +24516,21 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv1684 := &x.Conditions - yym1685 := z.DecBinary() - _ = yym1685 + yyv1833 := &x.Conditions + yym1834 := z.DecBinary() + _ = yym1834 if false { } else { - h.decSlicePodCondition((*[]PodCondition)(yyv1684), d) + h.decSlicePodCondition((*[]PodCondition)(yyv1833), d) } } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22421,13 +24540,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Message = string(r.DecodeString()) } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22437,13 +24556,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22453,13 +24572,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostIP = string(r.DecodeString()) } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22469,13 +24588,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.PodIP = string(r.DecodeString()) } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22488,25 +24607,25 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg2_unversioned.Time) } - yym1691 := z.DecBinary() - _ = yym1691 + yym1840 := z.DecBinary() + _ = yym1840 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym1691 { + } else if yym1840 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym1691 && z.IsJSONHandle() { + } else if !yym1840 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) } } - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22514,26 +24633,26 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ContainerStatuses = nil } else { - yyv1692 := &x.ContainerStatuses - yym1693 := z.DecBinary() - _ = yym1693 + yyv1841 := &x.ContainerStatuses + yym1842 := z.DecBinary() + _ = yym1842 if false { } else { - h.decSliceContainerStatus((*[]ContainerStatus)(yyv1692), d) + h.decSliceContainerStatus((*[]ContainerStatus)(yyv1841), d) } } for { - yyj1682++ - if yyhl1682 { - yyb1682 = yyj1682 > l + yyj1831++ + if yyhl1831 { + yyb1831 = yyj1831 > l } else { - yyb1682 = r.CheckBreak() + yyb1831 = r.CheckBreak() } - if yyb1682 { + if yyb1831 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1682-1, "") + z.DecStructFieldNotFound(yyj1831-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -22545,118 +24664,118 @@ func (x *PodStatusResult) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1694 := z.EncBinary() - _ = yym1694 + yym1843 := z.EncBinary() + _ = yym1843 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1695 := !z.EncBinary() - yy2arr1695 := z.EncBasicHandle().StructToArray - var yyq1695 [4]bool - _, _, _ = yysep1695, yyq1695, yy2arr1695 - const yyr1695 bool = false - yyq1695[0] = x.Kind != "" - yyq1695[1] = x.APIVersion != "" - yyq1695[2] = true - yyq1695[3] = true - var yynn1695 int - if yyr1695 || yy2arr1695 { + yysep1844 := !z.EncBinary() + yy2arr1844 := z.EncBasicHandle().StructToArray + var yyq1844 [4]bool + _, _, _ = yysep1844, yyq1844, yy2arr1844 + const yyr1844 bool = false + yyq1844[0] = true + yyq1844[1] = true + yyq1844[2] = x.Kind != "" + yyq1844[3] = x.APIVersion != "" + var yynn1844 int + if yyr1844 || yy2arr1844 { r.EncodeArrayStart(4) } else { - yynn1695 = 0 - for _, b := range yyq1695 { + yynn1844 = 0 + for _, b := range yyq1844 { if b { - yynn1695++ + yynn1844++ } } - r.EncodeMapStart(yynn1695) - yynn1695 = 0 + r.EncodeMapStart(yynn1844) + yynn1844 = 0 } - if yyr1695 || yy2arr1695 { + if yyr1844 || yy2arr1844 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1695[0] { - yym1697 := z.EncBinary() - _ = yym1697 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1695[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1698 := z.EncBinary() - _ = yym1698 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1695 || yy2arr1695 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1695[1] { - yym1700 := z.EncBinary() - _ = yym1700 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1695[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1701 := z.EncBinary() - _ = yym1701 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1695 || yy2arr1695 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1695[2] { - yy1703 := &x.ObjectMeta - yy1703.CodecEncodeSelf(e) + if yyq1844[0] { + yy1846 := &x.ObjectMeta + yy1846.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1695[2] { + if yyq1844[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1704 := &x.ObjectMeta - yy1704.CodecEncodeSelf(e) + yy1847 := &x.ObjectMeta + yy1847.CodecEncodeSelf(e) } } - if yyr1695 || yy2arr1695 { + if yyr1844 || yy2arr1844 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1695[3] { - yy1706 := &x.Status - yy1706.CodecEncodeSelf(e) + if yyq1844[1] { + yy1849 := &x.Status + yy1849.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1695[3] { + if yyq1844[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1707 := &x.Status - yy1707.CodecEncodeSelf(e) + yy1850 := &x.Status + yy1850.CodecEncodeSelf(e) } } - if yyr1695 || yy2arr1695 { + if yyr1844 || yy2arr1844 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1844[2] { + yym1852 := z.EncBinary() + _ = yym1852 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1844[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1853 := z.EncBinary() + _ = yym1853 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1844 || yy2arr1844 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1844[3] { + yym1855 := z.EncBinary() + _ = yym1855 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1844[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1856 := z.EncBinary() + _ = yym1856 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1844 || yy2arr1844 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22669,25 +24788,25 @@ func (x *PodStatusResult) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1708 := z.DecBinary() - _ = yym1708 + yym1857 := z.DecBinary() + _ = yym1857 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1709 := r.ContainerType() - if yyct1709 == codecSelferValueTypeMap1234 { - yyl1709 := r.ReadMapStart() - if yyl1709 == 0 { + yyct1858 := r.ContainerType() + if yyct1858 == codecSelferValueTypeMap1234 { + yyl1858 := r.ReadMapStart() + if yyl1858 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1709, d) + x.codecDecodeSelfFromMap(yyl1858, d) } - } else if yyct1709 == codecSelferValueTypeArray1234 { - yyl1709 := r.ReadArrayStart() - if yyl1709 == 0 { + } else if yyct1858 == codecSelferValueTypeArray1234 { + yyl1858 := r.ReadArrayStart() + if yyl1858 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1709, d) + x.codecDecodeSelfFromArray(yyl1858, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22699,12 +24818,12 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1710Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1710Slc - var yyhl1710 bool = l >= 0 - for yyj1710 := 0; ; yyj1710++ { - if yyhl1710 { - if yyj1710 >= l { + var yys1859Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1859Slc + var yyhl1859 bool = l >= 0 + for yyj1859 := 0; ; yyj1859++ { + if yyhl1859 { + if yyj1859 >= l { break } } else { @@ -22713,10 +24832,24 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1710Slc = r.DecodeBytes(yys1710Slc, true, true) - yys1710 := string(yys1710Slc) + yys1859Slc = r.DecodeBytes(yys1859Slc, true, true) + yys1859 := string(yys1859Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1710 { + switch yys1859 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1860 := &x.ObjectMeta + yyv1860.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1861 := &x.Status + yyv1861.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -22729,24 +24862,10 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1713 := &x.ObjectMeta - yyv1713.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1714 := &x.Status - yyv1714.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1710) - } // end switch yys1710 - } // end for yyj1710 + z.DecStructFieldNotFound(-1, yys1859) + } // end switch yys1859 + } // end for yyj1859 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22754,16 +24873,50 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1715 int - var yyb1715 bool - var yyhl1715 bool = l >= 0 - yyj1715++ - if yyhl1715 { - yyb1715 = yyj1715 > l + var yyj1864 int + var yyb1864 bool + var yyhl1864 bool = l >= 0 + yyj1864++ + if yyhl1864 { + yyb1864 = yyj1864 > l } else { - yyb1715 = r.CheckBreak() + yyb1864 = r.CheckBreak() } - if yyb1715 { + if yyb1864 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1865 := &x.ObjectMeta + yyv1865.CodecDecodeSelf(d) + } + yyj1864++ + if yyhl1864 { + yyb1864 = yyj1864 > l + } else { + yyb1864 = r.CheckBreak() + } + if yyb1864 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1866 := &x.Status + yyv1866.CodecDecodeSelf(d) + } + yyj1864++ + if yyhl1864 { + yyb1864 = yyj1864 > l + } else { + yyb1864 = r.CheckBreak() + } + if yyb1864 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22773,13 +24926,13 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj1715++ - if yyhl1715 { - yyb1715 = yyj1715 > l + yyj1864++ + if yyhl1864 { + yyb1864 = yyj1864 > l } else { - yyb1715 = r.CheckBreak() + yyb1864 = r.CheckBreak() } - if yyb1715 { + if yyb1864 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22789,52 +24942,18 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj1715++ - if yyhl1715 { - yyb1715 = yyj1715 > l - } else { - yyb1715 = r.CheckBreak() - } - if yyb1715 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1718 := &x.ObjectMeta - yyv1718.CodecDecodeSelf(d) - } - yyj1715++ - if yyhl1715 { - yyb1715 = yyj1715 > l - } else { - yyb1715 = r.CheckBreak() - } - if yyb1715 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1719 := &x.Status - yyv1719.CodecDecodeSelf(d) - } for { - yyj1715++ - if yyhl1715 { - yyb1715 = yyj1715 > l + yyj1864++ + if yyhl1864 { + yyb1864 = yyj1864 > l } else { - yyb1715 = r.CheckBreak() + yyb1864 = r.CheckBreak() } - if yyb1715 { + if yyb1864 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1715-1, "") + z.DecStructFieldNotFound(yyj1864-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -22846,136 +24965,136 @@ func (x *Pod) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1720 := z.EncBinary() - _ = yym1720 + yym1869 := z.EncBinary() + _ = yym1869 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1721 := !z.EncBinary() - yy2arr1721 := z.EncBasicHandle().StructToArray - var yyq1721 [5]bool - _, _, _ = yysep1721, yyq1721, yy2arr1721 - const yyr1721 bool = false - yyq1721[0] = x.Kind != "" - yyq1721[1] = x.APIVersion != "" - yyq1721[2] = true - yyq1721[3] = true - yyq1721[4] = true - var yynn1721 int - if yyr1721 || yy2arr1721 { + yysep1870 := !z.EncBinary() + yy2arr1870 := z.EncBasicHandle().StructToArray + var yyq1870 [5]bool + _, _, _ = yysep1870, yyq1870, yy2arr1870 + const yyr1870 bool = false + yyq1870[0] = true + yyq1870[1] = true + yyq1870[2] = true + yyq1870[3] = x.Kind != "" + yyq1870[4] = x.APIVersion != "" + var yynn1870 int + if yyr1870 || yy2arr1870 { r.EncodeArrayStart(5) } else { - yynn1721 = 0 - for _, b := range yyq1721 { + yynn1870 = 0 + for _, b := range yyq1870 { if b { - yynn1721++ + yynn1870++ } } - r.EncodeMapStart(yynn1721) - yynn1721 = 0 + r.EncodeMapStart(yynn1870) + yynn1870 = 0 } - if yyr1721 || yy2arr1721 { + if yyr1870 || yy2arr1870 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1721[0] { - yym1723 := z.EncBinary() - _ = yym1723 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1721[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1724 := z.EncBinary() - _ = yym1724 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1721 || yy2arr1721 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1721[1] { - yym1726 := z.EncBinary() - _ = yym1726 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1721[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1727 := z.EncBinary() - _ = yym1727 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1721 || yy2arr1721 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1721[2] { - yy1729 := &x.ObjectMeta - yy1729.CodecEncodeSelf(e) + if yyq1870[0] { + yy1872 := &x.ObjectMeta + yy1872.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1721[2] { + if yyq1870[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1730 := &x.ObjectMeta - yy1730.CodecEncodeSelf(e) + yy1873 := &x.ObjectMeta + yy1873.CodecEncodeSelf(e) } } - if yyr1721 || yy2arr1721 { + if yyr1870 || yy2arr1870 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1721[3] { - yy1732 := &x.Spec - yy1732.CodecEncodeSelf(e) + if yyq1870[1] { + yy1875 := &x.Spec + yy1875.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1721[3] { + if yyq1870[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1733 := &x.Spec - yy1733.CodecEncodeSelf(e) + yy1876 := &x.Spec + yy1876.CodecEncodeSelf(e) } } - if yyr1721 || yy2arr1721 { + if yyr1870 || yy2arr1870 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1721[4] { - yy1735 := &x.Status - yy1735.CodecEncodeSelf(e) + if yyq1870[2] { + yy1878 := &x.Status + yy1878.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1721[4] { + if yyq1870[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1736 := &x.Status - yy1736.CodecEncodeSelf(e) + yy1879 := &x.Status + yy1879.CodecEncodeSelf(e) } } - if yyr1721 || yy2arr1721 { + if yyr1870 || yy2arr1870 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1870[3] { + yym1881 := z.EncBinary() + _ = yym1881 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1870[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1882 := z.EncBinary() + _ = yym1882 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1870 || yy2arr1870 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1870[4] { + yym1884 := z.EncBinary() + _ = yym1884 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1870[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1885 := z.EncBinary() + _ = yym1885 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1870 || yy2arr1870 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22988,25 +25107,25 @@ func (x *Pod) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1737 := z.DecBinary() - _ = yym1737 + yym1886 := z.DecBinary() + _ = yym1886 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1738 := r.ContainerType() - if yyct1738 == codecSelferValueTypeMap1234 { - yyl1738 := r.ReadMapStart() - if yyl1738 == 0 { + yyct1887 := r.ContainerType() + if yyct1887 == codecSelferValueTypeMap1234 { + yyl1887 := r.ReadMapStart() + if yyl1887 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1738, d) + x.codecDecodeSelfFromMap(yyl1887, d) } - } else if yyct1738 == codecSelferValueTypeArray1234 { - yyl1738 := r.ReadArrayStart() - if yyl1738 == 0 { + } else if yyct1887 == codecSelferValueTypeArray1234 { + yyl1887 := r.ReadArrayStart() + if yyl1887 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1738, d) + x.codecDecodeSelfFromArray(yyl1887, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23018,12 +25137,12 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1739Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1739Slc - var yyhl1739 bool = l >= 0 - for yyj1739 := 0; ; yyj1739++ { - if yyhl1739 { - if yyj1739 >= l { + var yys1888Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1888Slc + var yyhl1888 bool = l >= 0 + for yyj1888 := 0; ; yyj1888++ { + if yyhl1888 { + if yyj1888 >= l { break } } else { @@ -23032,10 +25151,31 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1739Slc = r.DecodeBytes(yys1739Slc, true, true) - yys1739 := string(yys1739Slc) + yys1888Slc = r.DecodeBytes(yys1888Slc, true, true) + yys1888 := string(yys1888Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1739 { + switch yys1888 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1889 := &x.ObjectMeta + yyv1889.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PodSpec{} + } else { + yyv1890 := &x.Spec + yyv1890.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1891 := &x.Status + yyv1891.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -23048,31 +25188,10 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1742 := &x.ObjectMeta - yyv1742.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PodSpec{} - } else { - yyv1743 := &x.Spec - yyv1743.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1744 := &x.Status - yyv1744.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1739) - } // end switch yys1739 - } // end for yyj1739 + z.DecStructFieldNotFound(-1, yys1888) + } // end switch yys1888 + } // end for yyj1888 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23080,16 +25199,67 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1745 int - var yyb1745 bool - var yyhl1745 bool = l >= 0 - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l + var yyj1894 int + var yyb1894 bool + var yyhl1894 bool = l >= 0 + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l } else { - yyb1745 = r.CheckBreak() + yyb1894 = r.CheckBreak() } - if yyb1745 { + if yyb1894 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1895 := &x.ObjectMeta + yyv1895.CodecDecodeSelf(d) + } + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l + } else { + yyb1894 = r.CheckBreak() + } + if yyb1894 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PodSpec{} + } else { + yyv1896 := &x.Spec + yyv1896.CodecDecodeSelf(d) + } + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l + } else { + yyb1894 = r.CheckBreak() + } + if yyb1894 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1897 := &x.Status + yyv1897.CodecDecodeSelf(d) + } + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l + } else { + yyb1894 = r.CheckBreak() + } + if yyb1894 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23099,13 +25269,13 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l } else { - yyb1745 = r.CheckBreak() + yyb1894 = r.CheckBreak() } - if yyb1745 { + if yyb1894 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23115,69 +25285,18 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l - } else { - yyb1745 = r.CheckBreak() - } - if yyb1745 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1748 := &x.ObjectMeta - yyv1748.CodecDecodeSelf(d) - } - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l - } else { - yyb1745 = r.CheckBreak() - } - if yyb1745 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PodSpec{} - } else { - yyv1749 := &x.Spec - yyv1749.CodecDecodeSelf(d) - } - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l - } else { - yyb1745 = r.CheckBreak() - } - if yyb1745 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1750 := &x.Status - yyv1750.CodecDecodeSelf(d) - } for { - yyj1745++ - if yyhl1745 { - yyb1745 = yyj1745 > l + yyj1894++ + if yyhl1894 { + yyb1894 = yyj1894 > l } else { - yyb1745 = r.CheckBreak() + yyb1894 = r.CheckBreak() } - if yyb1745 { + if yyb1894 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1745-1, "") + z.DecStructFieldNotFound(yyj1894-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23189,66 +25308,66 @@ func (x *PodTemplateSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1751 := z.EncBinary() - _ = yym1751 + yym1900 := z.EncBinary() + _ = yym1900 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1752 := !z.EncBinary() - yy2arr1752 := z.EncBasicHandle().StructToArray - var yyq1752 [2]bool - _, _, _ = yysep1752, yyq1752, yy2arr1752 - const yyr1752 bool = false - yyq1752[0] = true - yyq1752[1] = true - var yynn1752 int - if yyr1752 || yy2arr1752 { + yysep1901 := !z.EncBinary() + yy2arr1901 := z.EncBasicHandle().StructToArray + var yyq1901 [2]bool + _, _, _ = yysep1901, yyq1901, yy2arr1901 + const yyr1901 bool = false + yyq1901[0] = true + yyq1901[1] = true + var yynn1901 int + if yyr1901 || yy2arr1901 { r.EncodeArrayStart(2) } else { - yynn1752 = 0 - for _, b := range yyq1752 { + yynn1901 = 0 + for _, b := range yyq1901 { if b { - yynn1752++ + yynn1901++ } } - r.EncodeMapStart(yynn1752) - yynn1752 = 0 + r.EncodeMapStart(yynn1901) + yynn1901 = 0 } - if yyr1752 || yy2arr1752 { + if yyr1901 || yy2arr1901 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1752[0] { - yy1754 := &x.ObjectMeta - yy1754.CodecEncodeSelf(e) + if yyq1901[0] { + yy1903 := &x.ObjectMeta + yy1903.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1752[0] { + if yyq1901[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1755 := &x.ObjectMeta - yy1755.CodecEncodeSelf(e) + yy1904 := &x.ObjectMeta + yy1904.CodecEncodeSelf(e) } } - if yyr1752 || yy2arr1752 { + if yyr1901 || yy2arr1901 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1752[1] { - yy1757 := &x.Spec - yy1757.CodecEncodeSelf(e) + if yyq1901[1] { + yy1906 := &x.Spec + yy1906.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1752[1] { + if yyq1901[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1758 := &x.Spec - yy1758.CodecEncodeSelf(e) + yy1907 := &x.Spec + yy1907.CodecEncodeSelf(e) } } - if yyr1752 || yy2arr1752 { + if yyr1901 || yy2arr1901 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23261,25 +25380,25 @@ func (x *PodTemplateSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1759 := z.DecBinary() - _ = yym1759 + yym1908 := z.DecBinary() + _ = yym1908 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1760 := r.ContainerType() - if yyct1760 == codecSelferValueTypeMap1234 { - yyl1760 := r.ReadMapStart() - if yyl1760 == 0 { + yyct1909 := r.ContainerType() + if yyct1909 == codecSelferValueTypeMap1234 { + yyl1909 := r.ReadMapStart() + if yyl1909 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1760, d) + x.codecDecodeSelfFromMap(yyl1909, d) } - } else if yyct1760 == codecSelferValueTypeArray1234 { - yyl1760 := r.ReadArrayStart() - if yyl1760 == 0 { + } else if yyct1909 == codecSelferValueTypeArray1234 { + yyl1909 := r.ReadArrayStart() + if yyl1909 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1760, d) + x.codecDecodeSelfFromArray(yyl1909, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23291,12 +25410,12 @@ func (x *PodTemplateSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1761Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1761Slc - var yyhl1761 bool = l >= 0 - for yyj1761 := 0; ; yyj1761++ { - if yyhl1761 { - if yyj1761 >= l { + var yys1910Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1910Slc + var yyhl1910 bool = l >= 0 + for yyj1910 := 0; ; yyj1910++ { + if yyhl1910 { + if yyj1910 >= l { break } } else { @@ -23305,28 +25424,28 @@ func (x *PodTemplateSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1761Slc = r.DecodeBytes(yys1761Slc, true, true) - yys1761 := string(yys1761Slc) + yys1910Slc = r.DecodeBytes(yys1910Slc, true, true) + yys1910 := string(yys1910Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1761 { + switch yys1910 { case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv1762 := &x.ObjectMeta - yyv1762.CodecDecodeSelf(d) + yyv1911 := &x.ObjectMeta + yyv1911.CodecDecodeSelf(d) } case "spec": if r.TryDecodeAsNil() { x.Spec = PodSpec{} } else { - yyv1763 := &x.Spec - yyv1763.CodecDecodeSelf(d) + yyv1912 := &x.Spec + yyv1912.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1761) - } // end switch yys1761 - } // end for yyj1761 + z.DecStructFieldNotFound(-1, yys1910) + } // end switch yys1910 + } // end for yyj1910 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23334,16 +25453,16 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1764 int - var yyb1764 bool - var yyhl1764 bool = l >= 0 - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + var yyj1913 int + var yyb1913 bool + var yyhl1913 bool = l >= 0 + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23351,16 +25470,16 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv1765 := &x.ObjectMeta - yyv1765.CodecDecodeSelf(d) + yyv1914 := &x.ObjectMeta + yyv1914.CodecDecodeSelf(d) } - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23368,21 +25487,21 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Spec = PodSpec{} } else { - yyv1766 := &x.Spec - yyv1766.CodecDecodeSelf(d) + yyv1915 := &x.Spec + yyv1915.CodecDecodeSelf(d) } for { - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1764-1, "") + z.DecStructFieldNotFound(yyj1913-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23394,118 +25513,118 @@ func (x *PodTemplate) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1767 := z.EncBinary() - _ = yym1767 + yym1916 := z.EncBinary() + _ = yym1916 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1768 := !z.EncBinary() - yy2arr1768 := z.EncBasicHandle().StructToArray - var yyq1768 [4]bool - _, _, _ = yysep1768, yyq1768, yy2arr1768 - const yyr1768 bool = false - yyq1768[0] = x.Kind != "" - yyq1768[1] = x.APIVersion != "" - yyq1768[2] = true - yyq1768[3] = true - var yynn1768 int - if yyr1768 || yy2arr1768 { + yysep1917 := !z.EncBinary() + yy2arr1917 := z.EncBasicHandle().StructToArray + var yyq1917 [4]bool + _, _, _ = yysep1917, yyq1917, yy2arr1917 + const yyr1917 bool = false + yyq1917[0] = true + yyq1917[1] = true + yyq1917[2] = x.Kind != "" + yyq1917[3] = x.APIVersion != "" + var yynn1917 int + if yyr1917 || yy2arr1917 { r.EncodeArrayStart(4) } else { - yynn1768 = 0 - for _, b := range yyq1768 { + yynn1917 = 0 + for _, b := range yyq1917 { if b { - yynn1768++ + yynn1917++ } } - r.EncodeMapStart(yynn1768) - yynn1768 = 0 + r.EncodeMapStart(yynn1917) + yynn1917 = 0 } - if yyr1768 || yy2arr1768 { + if yyr1917 || yy2arr1917 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1768[0] { - yym1770 := z.EncBinary() - _ = yym1770 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1768[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1771 := z.EncBinary() - _ = yym1771 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1768 || yy2arr1768 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1768[1] { - yym1773 := z.EncBinary() - _ = yym1773 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1768[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1774 := z.EncBinary() - _ = yym1774 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1768 || yy2arr1768 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1768[2] { - yy1776 := &x.ObjectMeta - yy1776.CodecEncodeSelf(e) + if yyq1917[0] { + yy1919 := &x.ObjectMeta + yy1919.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1768[2] { + if yyq1917[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1777 := &x.ObjectMeta - yy1777.CodecEncodeSelf(e) + yy1920 := &x.ObjectMeta + yy1920.CodecEncodeSelf(e) } } - if yyr1768 || yy2arr1768 { + if yyr1917 || yy2arr1917 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1768[3] { - yy1779 := &x.Template - yy1779.CodecEncodeSelf(e) + if yyq1917[1] { + yy1922 := &x.Template + yy1922.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1768[3] { + if yyq1917[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1780 := &x.Template - yy1780.CodecEncodeSelf(e) + yy1923 := &x.Template + yy1923.CodecEncodeSelf(e) } } - if yyr1768 || yy2arr1768 { + if yyr1917 || yy2arr1917 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1917[2] { + yym1925 := z.EncBinary() + _ = yym1925 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1917[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1926 := z.EncBinary() + _ = yym1926 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1917 || yy2arr1917 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1917[3] { + yym1928 := z.EncBinary() + _ = yym1928 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1917[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1929 := z.EncBinary() + _ = yym1929 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1917 || yy2arr1917 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23518,25 +25637,25 @@ func (x *PodTemplate) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1781 := z.DecBinary() - _ = yym1781 + yym1930 := z.DecBinary() + _ = yym1930 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1782 := r.ContainerType() - if yyct1782 == codecSelferValueTypeMap1234 { - yyl1782 := r.ReadMapStart() - if yyl1782 == 0 { + yyct1931 := r.ContainerType() + if yyct1931 == codecSelferValueTypeMap1234 { + yyl1931 := r.ReadMapStart() + if yyl1931 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1782, d) + x.codecDecodeSelfFromMap(yyl1931, d) } - } else if yyct1782 == codecSelferValueTypeArray1234 { - yyl1782 := r.ReadArrayStart() - if yyl1782 == 0 { + } else if yyct1931 == codecSelferValueTypeArray1234 { + yyl1931 := r.ReadArrayStart() + if yyl1931 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1782, d) + x.codecDecodeSelfFromArray(yyl1931, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23548,12 +25667,12 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1783Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1783Slc - var yyhl1783 bool = l >= 0 - for yyj1783 := 0; ; yyj1783++ { - if yyhl1783 { - if yyj1783 >= l { + var yys1932Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1932Slc + var yyhl1932 bool = l >= 0 + for yyj1932 := 0; ; yyj1932++ { + if yyhl1932 { + if yyj1932 >= l { break } } else { @@ -23562,10 +25681,24 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1783Slc = r.DecodeBytes(yys1783Slc, true, true) - yys1783 := string(yys1783Slc) + yys1932Slc = r.DecodeBytes(yys1932Slc, true, true) + yys1932 := string(yys1932Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1783 { + switch yys1932 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1933 := &x.ObjectMeta + yyv1933.CodecDecodeSelf(d) + } + case "template": + if r.TryDecodeAsNil() { + x.Template = PodTemplateSpec{} + } else { + yyv1934 := &x.Template + yyv1934.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -23578,24 +25711,10 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1786 := &x.ObjectMeta - yyv1786.CodecDecodeSelf(d) - } - case "template": - if r.TryDecodeAsNil() { - x.Template = PodTemplateSpec{} - } else { - yyv1787 := &x.Template - yyv1787.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1783) - } // end switch yys1783 - } // end for yyj1783 + z.DecStructFieldNotFound(-1, yys1932) + } // end switch yys1932 + } // end for yyj1932 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23603,16 +25722,50 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1788 int - var yyb1788 bool - var yyhl1788 bool = l >= 0 - yyj1788++ - if yyhl1788 { - yyb1788 = yyj1788 > l + var yyj1937 int + var yyb1937 bool + var yyhl1937 bool = l >= 0 + yyj1937++ + if yyhl1937 { + yyb1937 = yyj1937 > l } else { - yyb1788 = r.CheckBreak() + yyb1937 = r.CheckBreak() } - if yyb1788 { + if yyb1937 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1938 := &x.ObjectMeta + yyv1938.CodecDecodeSelf(d) + } + yyj1937++ + if yyhl1937 { + yyb1937 = yyj1937 > l + } else { + yyb1937 = r.CheckBreak() + } + if yyb1937 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Template = PodTemplateSpec{} + } else { + yyv1939 := &x.Template + yyv1939.CodecDecodeSelf(d) + } + yyj1937++ + if yyhl1937 { + yyb1937 = yyj1937 > l + } else { + yyb1937 = r.CheckBreak() + } + if yyb1937 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23622,13 +25775,13 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1788++ - if yyhl1788 { - yyb1788 = yyj1788 > l + yyj1937++ + if yyhl1937 { + yyb1937 = yyj1937 > l } else { - yyb1788 = r.CheckBreak() + yyb1937 = r.CheckBreak() } - if yyb1788 { + if yyb1937 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23638,52 +25791,18 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1788++ - if yyhl1788 { - yyb1788 = yyj1788 > l - } else { - yyb1788 = r.CheckBreak() - } - if yyb1788 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1791 := &x.ObjectMeta - yyv1791.CodecDecodeSelf(d) - } - yyj1788++ - if yyhl1788 { - yyb1788 = yyj1788 > l - } else { - yyb1788 = r.CheckBreak() - } - if yyb1788 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Template = PodTemplateSpec{} - } else { - yyv1792 := &x.Template - yyv1792.CodecDecodeSelf(d) - } for { - yyj1788++ - if yyhl1788 { - yyb1788 = yyj1788 > l + yyj1937++ + if yyhl1937 { + yyb1937 = yyj1937 > l } else { - yyb1788 = r.CheckBreak() + yyb1937 = r.CheckBreak() } - if yyb1788 { + if yyb1937 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1788-1, "") + z.DecStructFieldNotFound(yyj1937-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23695,118 +25814,68 @@ func (x *PodTemplateList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1793 := z.EncBinary() - _ = yym1793 + yym1942 := z.EncBinary() + _ = yym1942 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1794 := !z.EncBinary() - yy2arr1794 := z.EncBasicHandle().StructToArray - var yyq1794 [4]bool - _, _, _ = yysep1794, yyq1794, yy2arr1794 - const yyr1794 bool = false - yyq1794[0] = x.Kind != "" - yyq1794[1] = x.APIVersion != "" - yyq1794[2] = true - var yynn1794 int - if yyr1794 || yy2arr1794 { + yysep1943 := !z.EncBinary() + yy2arr1943 := z.EncBasicHandle().StructToArray + var yyq1943 [4]bool + _, _, _ = yysep1943, yyq1943, yy2arr1943 + const yyr1943 bool = false + yyq1943[0] = true + yyq1943[2] = x.Kind != "" + yyq1943[3] = x.APIVersion != "" + var yynn1943 int + if yyr1943 || yy2arr1943 { r.EncodeArrayStart(4) } else { - yynn1794 = 1 - for _, b := range yyq1794 { + yynn1943 = 1 + for _, b := range yyq1943 { if b { - yynn1794++ + yynn1943++ } } - r.EncodeMapStart(yynn1794) - yynn1794 = 0 + r.EncodeMapStart(yynn1943) + yynn1943 = 0 } - if yyr1794 || yy2arr1794 { + if yyr1943 || yy2arr1943 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1794[0] { - yym1796 := z.EncBinary() - _ = yym1796 + if yyq1943[0] { + yy1945 := &x.ListMeta + yym1946 := z.EncBinary() + _ = yym1946 if false { + } else if z.HasExtensions() && z.EncExt(yy1945) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1794[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1797 := z.EncBinary() - _ = yym1797 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1794 || yy2arr1794 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1794[1] { - yym1799 := z.EncBinary() - _ = yym1799 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1794[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1800 := z.EncBinary() - _ = yym1800 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1794 || yy2arr1794 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1794[2] { - yy1802 := &x.ListMeta - yym1803 := z.EncBinary() - _ = yym1803 - if false { - } else if z.HasExtensions() && z.EncExt(yy1802) { - } else { - z.EncFallback(yy1802) + z.EncFallback(yy1945) } } else { r.EncodeNil() } } else { - if yyq1794[2] { + if yyq1943[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1804 := &x.ListMeta - yym1805 := z.EncBinary() - _ = yym1805 + yy1947 := &x.ListMeta + yym1948 := z.EncBinary() + _ = yym1948 if false { - } else if z.HasExtensions() && z.EncExt(yy1804) { + } else if z.HasExtensions() && z.EncExt(yy1947) { } else { - z.EncFallback(yy1804) + z.EncFallback(yy1947) } } } - if yyr1794 || yy2arr1794 { + if yyr1943 || yy2arr1943 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1807 := z.EncBinary() - _ = yym1807 + yym1950 := z.EncBinary() + _ = yym1950 if false { } else { h.encSlicePodTemplate(([]PodTemplate)(x.Items), e) @@ -23819,15 +25888,65 @@ func (x *PodTemplateList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1808 := z.EncBinary() - _ = yym1808 + yym1951 := z.EncBinary() + _ = yym1951 if false { } else { h.encSlicePodTemplate(([]PodTemplate)(x.Items), e) } } } - if yyr1794 || yy2arr1794 { + if yyr1943 || yy2arr1943 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1943[2] { + yym1953 := z.EncBinary() + _ = yym1953 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1943[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1954 := z.EncBinary() + _ = yym1954 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1943 || yy2arr1943 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1943[3] { + yym1956 := z.EncBinary() + _ = yym1956 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1943[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1957 := z.EncBinary() + _ = yym1957 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1943 || yy2arr1943 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23840,25 +25959,25 @@ func (x *PodTemplateList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1809 := z.DecBinary() - _ = yym1809 + yym1958 := z.DecBinary() + _ = yym1958 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1810 := r.ContainerType() - if yyct1810 == codecSelferValueTypeMap1234 { - yyl1810 := r.ReadMapStart() - if yyl1810 == 0 { + yyct1959 := r.ContainerType() + if yyct1959 == codecSelferValueTypeMap1234 { + yyl1959 := r.ReadMapStart() + if yyl1959 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1810, d) + x.codecDecodeSelfFromMap(yyl1959, d) } - } else if yyct1810 == codecSelferValueTypeArray1234 { - yyl1810 := r.ReadArrayStart() - if yyl1810 == 0 { + } else if yyct1959 == codecSelferValueTypeArray1234 { + yyl1959 := r.ReadArrayStart() + if yyl1959 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1810, d) + x.codecDecodeSelfFromArray(yyl1959, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23870,12 +25989,12 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1811Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1811Slc - var yyhl1811 bool = l >= 0 - for yyj1811 := 0; ; yyj1811++ { - if yyhl1811 { - if yyj1811 >= l { + var yys1960Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1960Slc + var yyhl1960 bool = l >= 0 + for yyj1960 := 0; ; yyj1960++ { + if yyhl1960 { + if yyj1960 >= l { break } } else { @@ -23884,10 +26003,35 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1811Slc = r.DecodeBytes(yys1811Slc, true, true) - yys1811 := string(yys1811Slc) + yys1960Slc = r.DecodeBytes(yys1960Slc, true, true) + yys1960 := string(yys1960Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1811 { + switch yys1960 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1961 := &x.ListMeta + yym1962 := z.DecBinary() + _ = yym1962 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1961) { + } else { + z.DecFallback(yyv1961, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1963 := &x.Items + yym1964 := z.DecBinary() + _ = yym1964 + if false { + } else { + h.decSlicePodTemplate((*[]PodTemplate)(yyv1963), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -23900,35 +26044,10 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1814 := &x.ListMeta - yym1815 := z.DecBinary() - _ = yym1815 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1814) { - } else { - z.DecFallback(yyv1814, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1816 := &x.Items - yym1817 := z.DecBinary() - _ = yym1817 - if false { - } else { - h.decSlicePodTemplate((*[]PodTemplate)(yyv1816), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1811) - } // end switch yys1811 - } // end for yyj1811 + z.DecStructFieldNotFound(-1, yys1960) + } // end switch yys1960 + } // end for yyj1960 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23936,16 +26055,61 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1818 int - var yyb1818 bool - var yyhl1818 bool = l >= 0 - yyj1818++ - if yyhl1818 { - yyb1818 = yyj1818 > l + var yyj1967 int + var yyb1967 bool + var yyhl1967 bool = l >= 0 + yyj1967++ + if yyhl1967 { + yyb1967 = yyj1967 > l } else { - yyb1818 = r.CheckBreak() + yyb1967 = r.CheckBreak() } - if yyb1818 { + if yyb1967 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1968 := &x.ListMeta + yym1969 := z.DecBinary() + _ = yym1969 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1968) { + } else { + z.DecFallback(yyv1968, false) + } + } + yyj1967++ + if yyhl1967 { + yyb1967 = yyj1967 > l + } else { + yyb1967 = r.CheckBreak() + } + if yyb1967 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1970 := &x.Items + yym1971 := z.DecBinary() + _ = yym1971 + if false { + } else { + h.decSlicePodTemplate((*[]PodTemplate)(yyv1970), d) + } + } + yyj1967++ + if yyhl1967 { + yyb1967 = yyj1967 > l + } else { + yyb1967 = r.CheckBreak() + } + if yyb1967 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23955,13 +26119,13 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj1818++ - if yyhl1818 { - yyb1818 = yyj1818 > l + yyj1967++ + if yyhl1967 { + yyb1967 = yyj1967 > l } else { - yyb1818 = r.CheckBreak() + yyb1967 = r.CheckBreak() } - if yyb1818 { + if yyb1967 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23971,63 +26135,18 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj1818++ - if yyhl1818 { - yyb1818 = yyj1818 > l - } else { - yyb1818 = r.CheckBreak() - } - if yyb1818 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1821 := &x.ListMeta - yym1822 := z.DecBinary() - _ = yym1822 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1821) { - } else { - z.DecFallback(yyv1821, false) - } - } - yyj1818++ - if yyhl1818 { - yyb1818 = yyj1818 > l - } else { - yyb1818 = r.CheckBreak() - } - if yyb1818 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1823 := &x.Items - yym1824 := z.DecBinary() - _ = yym1824 - if false { - } else { - h.decSlicePodTemplate((*[]PodTemplate)(yyv1823), d) - } - } for { - yyj1818++ - if yyhl1818 { - yyb1818 = yyj1818 > l + yyj1967++ + if yyhl1967 { + yyb1967 = yyj1967 > l } else { - yyb1818 = r.CheckBreak() + yyb1967 = r.CheckBreak() } - if yyb1818 { + if yyb1967 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1818-1, "") + z.DecStructFieldNotFound(yyj1967-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24039,34 +26158,34 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1825 := z.EncBinary() - _ = yym1825 + yym1974 := z.EncBinary() + _ = yym1974 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1826 := !z.EncBinary() - yy2arr1826 := z.EncBasicHandle().StructToArray - var yyq1826 [3]bool - _, _, _ = yysep1826, yyq1826, yy2arr1826 - const yyr1826 bool = false - yyq1826[2] = x.Template != nil - var yynn1826 int - if yyr1826 || yy2arr1826 { + yysep1975 := !z.EncBinary() + yy2arr1975 := z.EncBasicHandle().StructToArray + var yyq1975 [3]bool + _, _, _ = yysep1975, yyq1975, yy2arr1975 + const yyr1975 bool = false + yyq1975[2] = x.Template != nil + var yynn1975 int + if yyr1975 || yy2arr1975 { r.EncodeArrayStart(3) } else { - yynn1826 = 2 - for _, b := range yyq1826 { + yynn1975 = 2 + for _, b := range yyq1975 { if b { - yynn1826++ + yynn1975++ } } - r.EncodeMapStart(yynn1826) - yynn1826 = 0 + r.EncodeMapStart(yynn1975) + yynn1975 = 0 } - if yyr1826 || yy2arr1826 { + if yyr1975 || yy2arr1975 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1828 := z.EncBinary() - _ = yym1828 + yym1977 := z.EncBinary() + _ = yym1977 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -24075,20 +26194,20 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1829 := z.EncBinary() - _ = yym1829 + yym1978 := z.EncBinary() + _ = yym1978 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1826 || yy2arr1826 { + if yyr1975 || yy2arr1975 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Selector == nil { r.EncodeNil() } else { - yym1831 := z.EncBinary() - _ = yym1831 + yym1980 := z.EncBinary() + _ = yym1980 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -24101,17 +26220,17 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Selector == nil { r.EncodeNil() } else { - yym1832 := z.EncBinary() - _ = yym1832 + yym1981 := z.EncBinary() + _ = yym1981 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) } } } - if yyr1826 || yy2arr1826 { + if yyr1975 || yy2arr1975 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1826[2] { + if yyq1975[2] { if x.Template == nil { r.EncodeNil() } else { @@ -24121,7 +26240,7 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1826[2] { + if yyq1975[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -24132,7 +26251,7 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1826 || yy2arr1826 { + if yyr1975 || yy2arr1975 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24145,25 +26264,25 @@ func (x *ReplicationControllerSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1834 := z.DecBinary() - _ = yym1834 + yym1983 := z.DecBinary() + _ = yym1983 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1835 := r.ContainerType() - if yyct1835 == codecSelferValueTypeMap1234 { - yyl1835 := r.ReadMapStart() - if yyl1835 == 0 { + yyct1984 := r.ContainerType() + if yyct1984 == codecSelferValueTypeMap1234 { + yyl1984 := r.ReadMapStart() + if yyl1984 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1835, d) + x.codecDecodeSelfFromMap(yyl1984, d) } - } else if yyct1835 == codecSelferValueTypeArray1234 { - yyl1835 := r.ReadArrayStart() - if yyl1835 == 0 { + } else if yyct1984 == codecSelferValueTypeArray1234 { + yyl1984 := r.ReadArrayStart() + if yyl1984 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1835, d) + x.codecDecodeSelfFromArray(yyl1984, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24175,12 +26294,12 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1836Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1836Slc - var yyhl1836 bool = l >= 0 - for yyj1836 := 0; ; yyj1836++ { - if yyhl1836 { - if yyj1836 >= l { + var yys1985Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1985Slc + var yyhl1985 bool = l >= 0 + for yyj1985 := 0; ; yyj1985++ { + if yyhl1985 { + if yyj1985 >= l { break } } else { @@ -24189,10 +26308,10 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1836Slc = r.DecodeBytes(yys1836Slc, true, true) - yys1836 := string(yys1836Slc) + yys1985Slc = r.DecodeBytes(yys1985Slc, true, true) + yys1985 := string(yys1985Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1836 { + switch yys1985 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -24203,12 +26322,12 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1838 := &x.Selector - yym1839 := z.DecBinary() - _ = yym1839 + yyv1987 := &x.Selector + yym1988 := z.DecBinary() + _ = yym1988 if false { } else { - z.F.DecMapStringStringX(yyv1838, false, d) + z.F.DecMapStringStringX(yyv1987, false, d) } } case "template": @@ -24223,9 +26342,9 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D x.Template.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1836) - } // end switch yys1836 - } // end for yyj1836 + z.DecStructFieldNotFound(-1, yys1985) + } // end switch yys1985 + } // end for yyj1985 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24233,16 +26352,16 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1841 int - var yyb1841 bool - var yyhl1841 bool = l >= 0 - yyj1841++ - if yyhl1841 { - yyb1841 = yyj1841 > l + var yyj1990 int + var yyb1990 bool + var yyhl1990 bool = l >= 0 + yyj1990++ + if yyhl1990 { + yyb1990 = yyj1990 > l } else { - yyb1841 = r.CheckBreak() + yyb1990 = r.CheckBreak() } - if yyb1841 { + if yyb1990 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24252,13 +26371,13 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.Replicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1841++ - if yyhl1841 { - yyb1841 = yyj1841 > l + yyj1990++ + if yyhl1990 { + yyb1990 = yyj1990 > l } else { - yyb1841 = r.CheckBreak() + yyb1990 = r.CheckBreak() } - if yyb1841 { + if yyb1990 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24266,21 +26385,21 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1843 := &x.Selector - yym1844 := z.DecBinary() - _ = yym1844 + yyv1992 := &x.Selector + yym1993 := z.DecBinary() + _ = yym1993 if false { } else { - z.F.DecMapStringStringX(yyv1843, false, d) + z.F.DecMapStringStringX(yyv1992, false, d) } } - yyj1841++ - if yyhl1841 { - yyb1841 = yyj1841 > l + yyj1990++ + if yyhl1990 { + yyb1990 = yyj1990 > l } else { - yyb1841 = r.CheckBreak() + yyb1990 = r.CheckBreak() } - if yyb1841 { + if yyb1990 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24296,17 +26415,17 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 x.Template.CodecDecodeSelf(d) } for { - yyj1841++ - if yyhl1841 { - yyb1841 = yyj1841 > l + yyj1990++ + if yyhl1990 { + yyb1990 = yyj1990 > l } else { - yyb1841 = r.CheckBreak() + yyb1990 = r.CheckBreak() } - if yyb1841 { + if yyb1990 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1841-1, "") + z.DecStructFieldNotFound(yyj1990-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24318,34 +26437,34 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1846 := z.EncBinary() - _ = yym1846 + yym1995 := z.EncBinary() + _ = yym1995 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1847 := !z.EncBinary() - yy2arr1847 := z.EncBasicHandle().StructToArray - var yyq1847 [2]bool - _, _, _ = yysep1847, yyq1847, yy2arr1847 - const yyr1847 bool = false - yyq1847[1] = x.ObservedGeneration != 0 - var yynn1847 int - if yyr1847 || yy2arr1847 { + yysep1996 := !z.EncBinary() + yy2arr1996 := z.EncBasicHandle().StructToArray + var yyq1996 [2]bool + _, _, _ = yysep1996, yyq1996, yy2arr1996 + const yyr1996 bool = false + yyq1996[1] = x.ObservedGeneration != 0 + var yynn1996 int + if yyr1996 || yy2arr1996 { r.EncodeArrayStart(2) } else { - yynn1847 = 1 - for _, b := range yyq1847 { + yynn1996 = 1 + for _, b := range yyq1996 { if b { - yynn1847++ + yynn1996++ } } - r.EncodeMapStart(yynn1847) - yynn1847 = 0 + r.EncodeMapStart(yynn1996) + yynn1996 = 0 } - if yyr1847 || yy2arr1847 { + if yyr1996 || yy2arr1996 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1849 := z.EncBinary() - _ = yym1849 + yym1998 := z.EncBinary() + _ = yym1998 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -24354,18 +26473,18 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1850 := z.EncBinary() - _ = yym1850 + yym1999 := z.EncBinary() + _ = yym1999 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1847 || yy2arr1847 { + if yyr1996 || yy2arr1996 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1847[1] { - yym1852 := z.EncBinary() - _ = yym1852 + if yyq1996[1] { + yym2001 := z.EncBinary() + _ = yym2001 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) @@ -24374,19 +26493,19 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1847[1] { + if yyq1996[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("observedGeneration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1853 := z.EncBinary() - _ = yym1853 + yym2002 := z.EncBinary() + _ = yym2002 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) } } } - if yyr1847 || yy2arr1847 { + if yyr1996 || yy2arr1996 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24399,25 +26518,25 @@ func (x *ReplicationControllerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1854 := z.DecBinary() - _ = yym1854 + yym2003 := z.DecBinary() + _ = yym2003 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1855 := r.ContainerType() - if yyct1855 == codecSelferValueTypeMap1234 { - yyl1855 := r.ReadMapStart() - if yyl1855 == 0 { + yyct2004 := r.ContainerType() + if yyct2004 == codecSelferValueTypeMap1234 { + yyl2004 := r.ReadMapStart() + if yyl2004 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1855, d) + x.codecDecodeSelfFromMap(yyl2004, d) } - } else if yyct1855 == codecSelferValueTypeArray1234 { - yyl1855 := r.ReadArrayStart() - if yyl1855 == 0 { + } else if yyct2004 == codecSelferValueTypeArray1234 { + yyl2004 := r.ReadArrayStart() + if yyl2004 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1855, d) + x.codecDecodeSelfFromArray(yyl2004, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24429,12 +26548,12 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1856Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1856Slc - var yyhl1856 bool = l >= 0 - for yyj1856 := 0; ; yyj1856++ { - if yyhl1856 { - if yyj1856 >= l { + var yys2005Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2005Slc + var yyhl2005 bool = l >= 0 + for yyj2005 := 0; ; yyj2005++ { + if yyhl2005 { + if yyj2005 >= l { break } } else { @@ -24443,10 +26562,10 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1856Slc = r.DecodeBytes(yys1856Slc, true, true) - yys1856 := string(yys1856Slc) + yys2005Slc = r.DecodeBytes(yys2005Slc, true, true) + yys2005 := string(yys2005Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1856 { + switch yys2005 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -24460,9 +26579,9 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 x.ObservedGeneration = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys1856) - } // end switch yys1856 - } // end for yyj1856 + z.DecStructFieldNotFound(-1, yys2005) + } // end switch yys2005 + } // end for yyj2005 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24470,16 +26589,16 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1859 int - var yyb1859 bool - var yyhl1859 bool = l >= 0 - yyj1859++ - if yyhl1859 { - yyb1859 = yyj1859 > l + var yyj2008 int + var yyb2008 bool + var yyhl2008 bool = l >= 0 + yyj2008++ + if yyhl2008 { + yyb2008 = yyj2008 > l } else { - yyb1859 = r.CheckBreak() + yyb2008 = r.CheckBreak() } - if yyb1859 { + if yyb2008 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24489,13 +26608,13 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 } else { x.Replicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1859++ - if yyhl1859 { - yyb1859 = yyj1859 > l + yyj2008++ + if yyhl2008 { + yyb2008 = yyj2008 > l } else { - yyb1859 = r.CheckBreak() + yyb2008 = r.CheckBreak() } - if yyb1859 { + if yyb2008 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24506,17 +26625,17 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 x.ObservedGeneration = int64(r.DecodeInt(64)) } for { - yyj1859++ - if yyhl1859 { - yyb1859 = yyj1859 > l + yyj2008++ + if yyhl2008 { + yyb2008 = yyj2008 > l } else { - yyb1859 = r.CheckBreak() + yyb2008 = r.CheckBreak() } - if yyb1859 { + if yyb2008 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1859-1, "") + z.DecStructFieldNotFound(yyj2008-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24528,136 +26647,136 @@ func (x *ReplicationController) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1862 := z.EncBinary() - _ = yym1862 + yym2011 := z.EncBinary() + _ = yym2011 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1863 := !z.EncBinary() - yy2arr1863 := z.EncBasicHandle().StructToArray - var yyq1863 [5]bool - _, _, _ = yysep1863, yyq1863, yy2arr1863 - const yyr1863 bool = false - yyq1863[0] = x.Kind != "" - yyq1863[1] = x.APIVersion != "" - yyq1863[2] = true - yyq1863[3] = true - yyq1863[4] = true - var yynn1863 int - if yyr1863 || yy2arr1863 { + yysep2012 := !z.EncBinary() + yy2arr2012 := z.EncBasicHandle().StructToArray + var yyq2012 [5]bool + _, _, _ = yysep2012, yyq2012, yy2arr2012 + const yyr2012 bool = false + yyq2012[0] = true + yyq2012[1] = true + yyq2012[2] = true + yyq2012[3] = x.Kind != "" + yyq2012[4] = x.APIVersion != "" + var yynn2012 int + if yyr2012 || yy2arr2012 { r.EncodeArrayStart(5) } else { - yynn1863 = 0 - for _, b := range yyq1863 { + yynn2012 = 0 + for _, b := range yyq2012 { if b { - yynn1863++ + yynn2012++ } } - r.EncodeMapStart(yynn1863) - yynn1863 = 0 + r.EncodeMapStart(yynn2012) + yynn2012 = 0 } - if yyr1863 || yy2arr1863 { + if yyr2012 || yy2arr2012 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1863[0] { - yym1865 := z.EncBinary() - _ = yym1865 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1863[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1866 := z.EncBinary() - _ = yym1866 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1863 || yy2arr1863 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1863[1] { - yym1868 := z.EncBinary() - _ = yym1868 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1863[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1869 := z.EncBinary() - _ = yym1869 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1863 || yy2arr1863 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1863[2] { - yy1871 := &x.ObjectMeta - yy1871.CodecEncodeSelf(e) + if yyq2012[0] { + yy2014 := &x.ObjectMeta + yy2014.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1863[2] { + if yyq2012[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1872 := &x.ObjectMeta - yy1872.CodecEncodeSelf(e) + yy2015 := &x.ObjectMeta + yy2015.CodecEncodeSelf(e) } } - if yyr1863 || yy2arr1863 { + if yyr2012 || yy2arr2012 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1863[3] { - yy1874 := &x.Spec - yy1874.CodecEncodeSelf(e) + if yyq2012[1] { + yy2017 := &x.Spec + yy2017.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1863[3] { + if yyq2012[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1875 := &x.Spec - yy1875.CodecEncodeSelf(e) + yy2018 := &x.Spec + yy2018.CodecEncodeSelf(e) } } - if yyr1863 || yy2arr1863 { + if yyr2012 || yy2arr2012 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1863[4] { - yy1877 := &x.Status - yy1877.CodecEncodeSelf(e) + if yyq2012[2] { + yy2020 := &x.Status + yy2020.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1863[4] { + if yyq2012[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1878 := &x.Status - yy1878.CodecEncodeSelf(e) + yy2021 := &x.Status + yy2021.CodecEncodeSelf(e) } } - if yyr1863 || yy2arr1863 { + if yyr2012 || yy2arr2012 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2012[3] { + yym2023 := z.EncBinary() + _ = yym2023 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2012[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2024 := z.EncBinary() + _ = yym2024 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2012 || yy2arr2012 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2012[4] { + yym2026 := z.EncBinary() + _ = yym2026 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2012[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2027 := z.EncBinary() + _ = yym2027 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2012 || yy2arr2012 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24670,25 +26789,25 @@ func (x *ReplicationController) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1879 := z.DecBinary() - _ = yym1879 + yym2028 := z.DecBinary() + _ = yym2028 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1880 := r.ContainerType() - if yyct1880 == codecSelferValueTypeMap1234 { - yyl1880 := r.ReadMapStart() - if yyl1880 == 0 { + yyct2029 := r.ContainerType() + if yyct2029 == codecSelferValueTypeMap1234 { + yyl2029 := r.ReadMapStart() + if yyl2029 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1880, d) + x.codecDecodeSelfFromMap(yyl2029, d) } - } else if yyct1880 == codecSelferValueTypeArray1234 { - yyl1880 := r.ReadArrayStart() - if yyl1880 == 0 { + } else if yyct2029 == codecSelferValueTypeArray1234 { + yyl2029 := r.ReadArrayStart() + if yyl2029 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1880, d) + x.codecDecodeSelfFromArray(yyl2029, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24700,12 +26819,12 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1881Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1881Slc - var yyhl1881 bool = l >= 0 - for yyj1881 := 0; ; yyj1881++ { - if yyhl1881 { - if yyj1881 >= l { + var yys2030Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2030Slc + var yyhl2030 bool = l >= 0 + for yyj2030 := 0; ; yyj2030++ { + if yyhl2030 { + if yyj2030 >= l { break } } else { @@ -24714,10 +26833,31 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1881Slc = r.DecodeBytes(yys1881Slc, true, true) - yys1881 := string(yys1881Slc) + yys2030Slc = r.DecodeBytes(yys2030Slc, true, true) + yys2030 := string(yys2030Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1881 { + switch yys2030 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2031 := &x.ObjectMeta + yyv2031.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ReplicationControllerSpec{} + } else { + yyv2032 := &x.Spec + yyv2032.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ReplicationControllerStatus{} + } else { + yyv2033 := &x.Status + yyv2033.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -24730,31 +26870,10 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1884 := &x.ObjectMeta - yyv1884.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ReplicationControllerSpec{} - } else { - yyv1885 := &x.Spec - yyv1885.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ReplicationControllerStatus{} - } else { - yyv1886 := &x.Status - yyv1886.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1881) - } // end switch yys1881 - } // end for yyj1881 + z.DecStructFieldNotFound(-1, yys2030) + } // end switch yys2030 + } // end for yyj2030 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24762,16 +26881,67 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1887 int - var yyb1887 bool - var yyhl1887 bool = l >= 0 - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l + var yyj2036 int + var yyb2036 bool + var yyhl2036 bool = l >= 0 + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l } else { - yyb1887 = r.CheckBreak() + yyb2036 = r.CheckBreak() } - if yyb1887 { + if yyb2036 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2037 := &x.ObjectMeta + yyv2037.CodecDecodeSelf(d) + } + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l + } else { + yyb2036 = r.CheckBreak() + } + if yyb2036 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ReplicationControllerSpec{} + } else { + yyv2038 := &x.Spec + yyv2038.CodecDecodeSelf(d) + } + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l + } else { + yyb2036 = r.CheckBreak() + } + if yyb2036 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ReplicationControllerStatus{} + } else { + yyv2039 := &x.Status + yyv2039.CodecDecodeSelf(d) + } + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l + } else { + yyb2036 = r.CheckBreak() + } + if yyb2036 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24781,13 +26951,13 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l } else { - yyb1887 = r.CheckBreak() + yyb2036 = r.CheckBreak() } - if yyb1887 { + if yyb2036 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24797,69 +26967,18 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l - } else { - yyb1887 = r.CheckBreak() - } - if yyb1887 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1890 := &x.ObjectMeta - yyv1890.CodecDecodeSelf(d) - } - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l - } else { - yyb1887 = r.CheckBreak() - } - if yyb1887 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ReplicationControllerSpec{} - } else { - yyv1891 := &x.Spec - yyv1891.CodecDecodeSelf(d) - } - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l - } else { - yyb1887 = r.CheckBreak() - } - if yyb1887 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ReplicationControllerStatus{} - } else { - yyv1892 := &x.Status - yyv1892.CodecDecodeSelf(d) - } for { - yyj1887++ - if yyhl1887 { - yyb1887 = yyj1887 > l + yyj2036++ + if yyhl2036 { + yyb2036 = yyj2036 > l } else { - yyb1887 = r.CheckBreak() + yyb2036 = r.CheckBreak() } - if yyb1887 { + if yyb2036 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1887-1, "") + z.DecStructFieldNotFound(yyj2036-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24871,118 +26990,68 @@ func (x *ReplicationControllerList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1893 := z.EncBinary() - _ = yym1893 + yym2042 := z.EncBinary() + _ = yym2042 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1894 := !z.EncBinary() - yy2arr1894 := z.EncBasicHandle().StructToArray - var yyq1894 [4]bool - _, _, _ = yysep1894, yyq1894, yy2arr1894 - const yyr1894 bool = false - yyq1894[0] = x.Kind != "" - yyq1894[1] = x.APIVersion != "" - yyq1894[2] = true - var yynn1894 int - if yyr1894 || yy2arr1894 { + yysep2043 := !z.EncBinary() + yy2arr2043 := z.EncBasicHandle().StructToArray + var yyq2043 [4]bool + _, _, _ = yysep2043, yyq2043, yy2arr2043 + const yyr2043 bool = false + yyq2043[0] = true + yyq2043[2] = x.Kind != "" + yyq2043[3] = x.APIVersion != "" + var yynn2043 int + if yyr2043 || yy2arr2043 { r.EncodeArrayStart(4) } else { - yynn1894 = 1 - for _, b := range yyq1894 { + yynn2043 = 1 + for _, b := range yyq2043 { if b { - yynn1894++ + yynn2043++ } } - r.EncodeMapStart(yynn1894) - yynn1894 = 0 + r.EncodeMapStart(yynn2043) + yynn2043 = 0 } - if yyr1894 || yy2arr1894 { + if yyr2043 || yy2arr2043 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1894[0] { - yym1896 := z.EncBinary() - _ = yym1896 + if yyq2043[0] { + yy2045 := &x.ListMeta + yym2046 := z.EncBinary() + _ = yym2046 if false { + } else if z.HasExtensions() && z.EncExt(yy2045) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1894[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1897 := z.EncBinary() - _ = yym1897 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1894 || yy2arr1894 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1894[1] { - yym1899 := z.EncBinary() - _ = yym1899 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1894[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1900 := z.EncBinary() - _ = yym1900 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1894 || yy2arr1894 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1894[2] { - yy1902 := &x.ListMeta - yym1903 := z.EncBinary() - _ = yym1903 - if false { - } else if z.HasExtensions() && z.EncExt(yy1902) { - } else { - z.EncFallback(yy1902) + z.EncFallback(yy2045) } } else { r.EncodeNil() } } else { - if yyq1894[2] { + if yyq2043[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1904 := &x.ListMeta - yym1905 := z.EncBinary() - _ = yym1905 + yy2047 := &x.ListMeta + yym2048 := z.EncBinary() + _ = yym2048 if false { - } else if z.HasExtensions() && z.EncExt(yy1904) { + } else if z.HasExtensions() && z.EncExt(yy2047) { } else { - z.EncFallback(yy1904) + z.EncFallback(yy2047) } } } - if yyr1894 || yy2arr1894 { + if yyr2043 || yy2arr2043 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1907 := z.EncBinary() - _ = yym1907 + yym2050 := z.EncBinary() + _ = yym2050 if false { } else { h.encSliceReplicationController(([]ReplicationController)(x.Items), e) @@ -24995,15 +27064,65 @@ func (x *ReplicationControllerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1908 := z.EncBinary() - _ = yym1908 + yym2051 := z.EncBinary() + _ = yym2051 if false { } else { h.encSliceReplicationController(([]ReplicationController)(x.Items), e) } } } - if yyr1894 || yy2arr1894 { + if yyr2043 || yy2arr2043 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2043[2] { + yym2053 := z.EncBinary() + _ = yym2053 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2043[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2054 := z.EncBinary() + _ = yym2054 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2043 || yy2arr2043 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2043[3] { + yym2056 := z.EncBinary() + _ = yym2056 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2043[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2057 := z.EncBinary() + _ = yym2057 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2043 || yy2arr2043 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25016,25 +27135,25 @@ func (x *ReplicationControllerList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1909 := z.DecBinary() - _ = yym1909 + yym2058 := z.DecBinary() + _ = yym2058 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1910 := r.ContainerType() - if yyct1910 == codecSelferValueTypeMap1234 { - yyl1910 := r.ReadMapStart() - if yyl1910 == 0 { + yyct2059 := r.ContainerType() + if yyct2059 == codecSelferValueTypeMap1234 { + yyl2059 := r.ReadMapStart() + if yyl2059 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1910, d) + x.codecDecodeSelfFromMap(yyl2059, d) } - } else if yyct1910 == codecSelferValueTypeArray1234 { - yyl1910 := r.ReadArrayStart() - if yyl1910 == 0 { + } else if yyct2059 == codecSelferValueTypeArray1234 { + yyl2059 := r.ReadArrayStart() + if yyl2059 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1910, d) + x.codecDecodeSelfFromArray(yyl2059, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25046,12 +27165,12 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1911Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1911Slc - var yyhl1911 bool = l >= 0 - for yyj1911 := 0; ; yyj1911++ { - if yyhl1911 { - if yyj1911 >= l { + var yys2060Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2060Slc + var yyhl2060 bool = l >= 0 + for yyj2060 := 0; ; yyj2060++ { + if yyhl2060 { + if yyj2060 >= l { break } } else { @@ -25060,10 +27179,35 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1911Slc = r.DecodeBytes(yys1911Slc, true, true) - yys1911 := string(yys1911Slc) + yys2060Slc = r.DecodeBytes(yys2060Slc, true, true) + yys2060 := string(yys2060Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1911 { + switch yys2060 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2061 := &x.ListMeta + yym2062 := z.DecBinary() + _ = yym2062 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2061) { + } else { + z.DecFallback(yyv2061, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2063 := &x.Items + yym2064 := z.DecBinary() + _ = yym2064 + if false { + } else { + h.decSliceReplicationController((*[]ReplicationController)(yyv2063), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -25076,35 +27220,10 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1914 := &x.ListMeta - yym1915 := z.DecBinary() - _ = yym1915 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1914) { - } else { - z.DecFallback(yyv1914, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1916 := &x.Items - yym1917 := z.DecBinary() - _ = yym1917 - if false { - } else { - h.decSliceReplicationController((*[]ReplicationController)(yyv1916), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1911) - } // end switch yys1911 - } // end for yyj1911 + z.DecStructFieldNotFound(-1, yys2060) + } // end switch yys2060 + } // end for yyj2060 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25112,16 +27231,61 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1918 int - var yyb1918 bool - var yyhl1918 bool = l >= 0 - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l + var yyj2067 int + var yyb2067 bool + var yyhl2067 bool = l >= 0 + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l } else { - yyb1918 = r.CheckBreak() + yyb2067 = r.CheckBreak() } - if yyb1918 { + if yyb2067 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2068 := &x.ListMeta + yym2069 := z.DecBinary() + _ = yym2069 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2068) { + } else { + z.DecFallback(yyv2068, false) + } + } + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l + } else { + yyb2067 = r.CheckBreak() + } + if yyb2067 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2070 := &x.Items + yym2071 := z.DecBinary() + _ = yym2071 + if false { + } else { + h.decSliceReplicationController((*[]ReplicationController)(yyv2070), d) + } + } + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l + } else { + yyb2067 = r.CheckBreak() + } + if yyb2067 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25131,13 +27295,13 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.Kind = string(r.DecodeString()) } - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l } else { - yyb1918 = r.CheckBreak() + yyb2067 = r.CheckBreak() } - if yyb1918 { + if yyb2067 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25147,63 +27311,18 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l - } else { - yyb1918 = r.CheckBreak() - } - if yyb1918 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1921 := &x.ListMeta - yym1922 := z.DecBinary() - _ = yym1922 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1921) { - } else { - z.DecFallback(yyv1921, false) - } - } - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l - } else { - yyb1918 = r.CheckBreak() - } - if yyb1918 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1923 := &x.Items - yym1924 := z.DecBinary() - _ = yym1924 - if false { - } else { - h.decSliceReplicationController((*[]ReplicationController)(yyv1923), d) - } - } for { - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l } else { - yyb1918 = r.CheckBreak() + yyb2067 = r.CheckBreak() } - if yyb1918 { + if yyb2067 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1918-1, "") + z.DecStructFieldNotFound(yyj2067-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25215,118 +27334,68 @@ func (x *ServiceList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1925 := z.EncBinary() - _ = yym1925 + yym2074 := z.EncBinary() + _ = yym2074 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1926 := !z.EncBinary() - yy2arr1926 := z.EncBasicHandle().StructToArray - var yyq1926 [4]bool - _, _, _ = yysep1926, yyq1926, yy2arr1926 - const yyr1926 bool = false - yyq1926[0] = x.Kind != "" - yyq1926[1] = x.APIVersion != "" - yyq1926[2] = true - var yynn1926 int - if yyr1926 || yy2arr1926 { + yysep2075 := !z.EncBinary() + yy2arr2075 := z.EncBasicHandle().StructToArray + var yyq2075 [4]bool + _, _, _ = yysep2075, yyq2075, yy2arr2075 + const yyr2075 bool = false + yyq2075[0] = true + yyq2075[2] = x.Kind != "" + yyq2075[3] = x.APIVersion != "" + var yynn2075 int + if yyr2075 || yy2arr2075 { r.EncodeArrayStart(4) } else { - yynn1926 = 1 - for _, b := range yyq1926 { + yynn2075 = 1 + for _, b := range yyq2075 { if b { - yynn1926++ + yynn2075++ } } - r.EncodeMapStart(yynn1926) - yynn1926 = 0 + r.EncodeMapStart(yynn2075) + yynn2075 = 0 } - if yyr1926 || yy2arr1926 { + if yyr2075 || yy2arr2075 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1926[0] { - yym1928 := z.EncBinary() - _ = yym1928 + if yyq2075[0] { + yy2077 := &x.ListMeta + yym2078 := z.EncBinary() + _ = yym2078 if false { + } else if z.HasExtensions() && z.EncExt(yy2077) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1926[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1929 := z.EncBinary() - _ = yym1929 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1926 || yy2arr1926 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1926[1] { - yym1931 := z.EncBinary() - _ = yym1931 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1926[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1932 := z.EncBinary() - _ = yym1932 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1926 || yy2arr1926 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1926[2] { - yy1934 := &x.ListMeta - yym1935 := z.EncBinary() - _ = yym1935 - if false { - } else if z.HasExtensions() && z.EncExt(yy1934) { - } else { - z.EncFallback(yy1934) + z.EncFallback(yy2077) } } else { r.EncodeNil() } } else { - if yyq1926[2] { + if yyq2075[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1936 := &x.ListMeta - yym1937 := z.EncBinary() - _ = yym1937 + yy2079 := &x.ListMeta + yym2080 := z.EncBinary() + _ = yym2080 if false { - } else if z.HasExtensions() && z.EncExt(yy1936) { + } else if z.HasExtensions() && z.EncExt(yy2079) { } else { - z.EncFallback(yy1936) + z.EncFallback(yy2079) } } } - if yyr1926 || yy2arr1926 { + if yyr2075 || yy2arr2075 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1939 := z.EncBinary() - _ = yym1939 + yym2082 := z.EncBinary() + _ = yym2082 if false { } else { h.encSliceService(([]Service)(x.Items), e) @@ -25339,15 +27408,65 @@ func (x *ServiceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1940 := z.EncBinary() - _ = yym1940 + yym2083 := z.EncBinary() + _ = yym2083 if false { } else { h.encSliceService(([]Service)(x.Items), e) } } } - if yyr1926 || yy2arr1926 { + if yyr2075 || yy2arr2075 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2075[2] { + yym2085 := z.EncBinary() + _ = yym2085 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2075[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2086 := z.EncBinary() + _ = yym2086 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2075 || yy2arr2075 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2075[3] { + yym2088 := z.EncBinary() + _ = yym2088 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2075[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2089 := z.EncBinary() + _ = yym2089 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2075 || yy2arr2075 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25360,25 +27479,25 @@ func (x *ServiceList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1941 := z.DecBinary() - _ = yym1941 + yym2090 := z.DecBinary() + _ = yym2090 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1942 := r.ContainerType() - if yyct1942 == codecSelferValueTypeMap1234 { - yyl1942 := r.ReadMapStart() - if yyl1942 == 0 { + yyct2091 := r.ContainerType() + if yyct2091 == codecSelferValueTypeMap1234 { + yyl2091 := r.ReadMapStart() + if yyl2091 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1942, d) + x.codecDecodeSelfFromMap(yyl2091, d) } - } else if yyct1942 == codecSelferValueTypeArray1234 { - yyl1942 := r.ReadArrayStart() - if yyl1942 == 0 { + } else if yyct2091 == codecSelferValueTypeArray1234 { + yyl2091 := r.ReadArrayStart() + if yyl2091 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1942, d) + x.codecDecodeSelfFromArray(yyl2091, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25390,12 +27509,12 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1943Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1943Slc - var yyhl1943 bool = l >= 0 - for yyj1943 := 0; ; yyj1943++ { - if yyhl1943 { - if yyj1943 >= l { + var yys2092Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2092Slc + var yyhl2092 bool = l >= 0 + for yyj2092 := 0; ; yyj2092++ { + if yyhl2092 { + if yyj2092 >= l { break } } else { @@ -25404,10 +27523,35 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1943Slc = r.DecodeBytes(yys1943Slc, true, true) - yys1943 := string(yys1943Slc) + yys2092Slc = r.DecodeBytes(yys2092Slc, true, true) + yys2092 := string(yys2092Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1943 { + switch yys2092 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2093 := &x.ListMeta + yym2094 := z.DecBinary() + _ = yym2094 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2093) { + } else { + z.DecFallback(yyv2093, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2095 := &x.Items + yym2096 := z.DecBinary() + _ = yym2096 + if false { + } else { + h.decSliceService((*[]Service)(yyv2095), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -25420,35 +27564,10 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1946 := &x.ListMeta - yym1947 := z.DecBinary() - _ = yym1947 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1946) { - } else { - z.DecFallback(yyv1946, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1948 := &x.Items - yym1949 := z.DecBinary() - _ = yym1949 - if false { - } else { - h.decSliceService((*[]Service)(yyv1948), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1943) - } // end switch yys1943 - } // end for yyj1943 + z.DecStructFieldNotFound(-1, yys2092) + } // end switch yys2092 + } // end for yyj2092 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25456,16 +27575,61 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1950 int - var yyb1950 bool - var yyhl1950 bool = l >= 0 - yyj1950++ - if yyhl1950 { - yyb1950 = yyj1950 > l + var yyj2099 int + var yyb2099 bool + var yyhl2099 bool = l >= 0 + yyj2099++ + if yyhl2099 { + yyb2099 = yyj2099 > l } else { - yyb1950 = r.CheckBreak() + yyb2099 = r.CheckBreak() } - if yyb1950 { + if yyb2099 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2100 := &x.ListMeta + yym2101 := z.DecBinary() + _ = yym2101 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2100) { + } else { + z.DecFallback(yyv2100, false) + } + } + yyj2099++ + if yyhl2099 { + yyb2099 = yyj2099 > l + } else { + yyb2099 = r.CheckBreak() + } + if yyb2099 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2102 := &x.Items + yym2103 := z.DecBinary() + _ = yym2103 + if false { + } else { + h.decSliceService((*[]Service)(yyv2102), d) + } + } + yyj2099++ + if yyhl2099 { + yyb2099 = yyj2099 > l + } else { + yyb2099 = r.CheckBreak() + } + if yyb2099 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25475,13 +27639,13 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1950++ - if yyhl1950 { - yyb1950 = yyj1950 > l + yyj2099++ + if yyhl2099 { + yyb2099 = yyj2099 > l } else { - yyb1950 = r.CheckBreak() + yyb2099 = r.CheckBreak() } - if yyb1950 { + if yyb2099 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25491,63 +27655,18 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1950++ - if yyhl1950 { - yyb1950 = yyj1950 > l - } else { - yyb1950 = r.CheckBreak() - } - if yyb1950 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1953 := &x.ListMeta - yym1954 := z.DecBinary() - _ = yym1954 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1953) { - } else { - z.DecFallback(yyv1953, false) - } - } - yyj1950++ - if yyhl1950 { - yyb1950 = yyj1950 > l - } else { - yyb1950 = r.CheckBreak() - } - if yyb1950 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1955 := &x.Items - yym1956 := z.DecBinary() - _ = yym1956 - if false { - } else { - h.decSliceService((*[]Service)(yyv1955), d) - } - } for { - yyj1950++ - if yyhl1950 { - yyb1950 = yyj1950 > l + yyj2099++ + if yyhl2099 { + yyb2099 = yyj2099 > l } else { - yyb1950 = r.CheckBreak() + yyb2099 = r.CheckBreak() } - if yyb1950 { + if yyb2099 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1950-1, "") + z.DecStructFieldNotFound(yyj2099-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25556,8 +27675,8 @@ func (x ServiceAffinity) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1957 := z.EncBinary() - _ = yym1957 + yym2106 := z.EncBinary() + _ = yym2106 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -25569,8 +27688,8 @@ func (x *ServiceAffinity) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1958 := z.DecBinary() - _ = yym1958 + yym2107 := z.DecBinary() + _ = yym2107 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -25582,8 +27701,8 @@ func (x ServiceType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1959 := z.EncBinary() - _ = yym1959 + yym2108 := z.EncBinary() + _ = yym2108 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -25595,8 +27714,8 @@ func (x *ServiceType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1960 := z.DecBinary() - _ = yym1960 + yym2109 := z.DecBinary() + _ = yym2109 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -25611,48 +27730,48 @@ func (x *ServiceStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1961 := z.EncBinary() - _ = yym1961 + yym2110 := z.EncBinary() + _ = yym2110 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1962 := !z.EncBinary() - yy2arr1962 := z.EncBasicHandle().StructToArray - var yyq1962 [1]bool - _, _, _ = yysep1962, yyq1962, yy2arr1962 - const yyr1962 bool = false - yyq1962[0] = true - var yynn1962 int - if yyr1962 || yy2arr1962 { + yysep2111 := !z.EncBinary() + yy2arr2111 := z.EncBasicHandle().StructToArray + var yyq2111 [1]bool + _, _, _ = yysep2111, yyq2111, yy2arr2111 + const yyr2111 bool = false + yyq2111[0] = true + var yynn2111 int + if yyr2111 || yy2arr2111 { r.EncodeArrayStart(1) } else { - yynn1962 = 0 - for _, b := range yyq1962 { + yynn2111 = 0 + for _, b := range yyq2111 { if b { - yynn1962++ + yynn2111++ } } - r.EncodeMapStart(yynn1962) - yynn1962 = 0 + r.EncodeMapStart(yynn2111) + yynn2111 = 0 } - if yyr1962 || yy2arr1962 { + if yyr2111 || yy2arr2111 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1962[0] { - yy1964 := &x.LoadBalancer - yy1964.CodecEncodeSelf(e) + if yyq2111[0] { + yy2113 := &x.LoadBalancer + yy2113.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1962[0] { + if yyq2111[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1965 := &x.LoadBalancer - yy1965.CodecEncodeSelf(e) + yy2114 := &x.LoadBalancer + yy2114.CodecEncodeSelf(e) } } - if yyr1962 || yy2arr1962 { + if yyr2111 || yy2arr2111 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25665,25 +27784,25 @@ func (x *ServiceStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1966 := z.DecBinary() - _ = yym1966 + yym2115 := z.DecBinary() + _ = yym2115 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1967 := r.ContainerType() - if yyct1967 == codecSelferValueTypeMap1234 { - yyl1967 := r.ReadMapStart() - if yyl1967 == 0 { + yyct2116 := r.ContainerType() + if yyct2116 == codecSelferValueTypeMap1234 { + yyl2116 := r.ReadMapStart() + if yyl2116 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1967, d) + x.codecDecodeSelfFromMap(yyl2116, d) } - } else if yyct1967 == codecSelferValueTypeArray1234 { - yyl1967 := r.ReadArrayStart() - if yyl1967 == 0 { + } else if yyct2116 == codecSelferValueTypeArray1234 { + yyl2116 := r.ReadArrayStart() + if yyl2116 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1967, d) + x.codecDecodeSelfFromArray(yyl2116, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25695,12 +27814,12 @@ func (x *ServiceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1968Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1968Slc - var yyhl1968 bool = l >= 0 - for yyj1968 := 0; ; yyj1968++ { - if yyhl1968 { - if yyj1968 >= l { + var yys2117Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2117Slc + var yyhl2117 bool = l >= 0 + for yyj2117 := 0; ; yyj2117++ { + if yyhl2117 { + if yyj2117 >= l { break } } else { @@ -25709,21 +27828,21 @@ func (x *ServiceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1968Slc = r.DecodeBytes(yys1968Slc, true, true) - yys1968 := string(yys1968Slc) + yys2117Slc = r.DecodeBytes(yys2117Slc, true, true) + yys2117 := string(yys2117Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1968 { + switch yys2117 { case "loadBalancer": if r.TryDecodeAsNil() { x.LoadBalancer = LoadBalancerStatus{} } else { - yyv1969 := &x.LoadBalancer - yyv1969.CodecDecodeSelf(d) + yyv2118 := &x.LoadBalancer + yyv2118.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1968) - } // end switch yys1968 - } // end for yyj1968 + z.DecStructFieldNotFound(-1, yys2117) + } // end switch yys2117 + } // end for yyj2117 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25731,16 +27850,16 @@ func (x *ServiceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1970 int - var yyb1970 bool - var yyhl1970 bool = l >= 0 - yyj1970++ - if yyhl1970 { - yyb1970 = yyj1970 > l + var yyj2119 int + var yyb2119 bool + var yyhl2119 bool = l >= 0 + yyj2119++ + if yyhl2119 { + yyb2119 = yyj2119 > l } else { - yyb1970 = r.CheckBreak() + yyb2119 = r.CheckBreak() } - if yyb1970 { + if yyb2119 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25748,21 +27867,21 @@ func (x *ServiceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LoadBalancer = LoadBalancerStatus{} } else { - yyv1971 := &x.LoadBalancer - yyv1971.CodecDecodeSelf(d) + yyv2120 := &x.LoadBalancer + yyv2120.CodecDecodeSelf(d) } for { - yyj1970++ - if yyhl1970 { - yyb1970 = yyj1970 > l + yyj2119++ + if yyhl2119 { + yyb2119 = yyj2119 > l } else { - yyb1970 = r.CheckBreak() + yyb2119 = r.CheckBreak() } - if yyb1970 { + if yyb2119 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1970-1, "") + z.DecStructFieldNotFound(yyj2119-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25774,38 +27893,38 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1972 := z.EncBinary() - _ = yym1972 + yym2121 := z.EncBinary() + _ = yym2121 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1973 := !z.EncBinary() - yy2arr1973 := z.EncBasicHandle().StructToArray - var yyq1973 [1]bool - _, _, _ = yysep1973, yyq1973, yy2arr1973 - const yyr1973 bool = false - yyq1973[0] = len(x.Ingress) != 0 - var yynn1973 int - if yyr1973 || yy2arr1973 { + yysep2122 := !z.EncBinary() + yy2arr2122 := z.EncBasicHandle().StructToArray + var yyq2122 [1]bool + _, _, _ = yysep2122, yyq2122, yy2arr2122 + const yyr2122 bool = false + yyq2122[0] = len(x.Ingress) != 0 + var yynn2122 int + if yyr2122 || yy2arr2122 { r.EncodeArrayStart(1) } else { - yynn1973 = 0 - for _, b := range yyq1973 { + yynn2122 = 0 + for _, b := range yyq2122 { if b { - yynn1973++ + yynn2122++ } } - r.EncodeMapStart(yynn1973) - yynn1973 = 0 + r.EncodeMapStart(yynn2122) + yynn2122 = 0 } - if yyr1973 || yy2arr1973 { + if yyr2122 || yy2arr2122 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1973[0] { + if yyq2122[0] { if x.Ingress == nil { r.EncodeNil() } else { - yym1975 := z.EncBinary() - _ = yym1975 + yym2124 := z.EncBinary() + _ = yym2124 if false { } else { h.encSliceLoadBalancerIngress(([]LoadBalancerIngress)(x.Ingress), e) @@ -25815,15 +27934,15 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1973[0] { + if yyq2122[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ingress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Ingress == nil { r.EncodeNil() } else { - yym1976 := z.EncBinary() - _ = yym1976 + yym2125 := z.EncBinary() + _ = yym2125 if false { } else { h.encSliceLoadBalancerIngress(([]LoadBalancerIngress)(x.Ingress), e) @@ -25831,7 +27950,7 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1973 || yy2arr1973 { + if yyr2122 || yy2arr2122 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25844,25 +27963,25 @@ func (x *LoadBalancerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1977 := z.DecBinary() - _ = yym1977 + yym2126 := z.DecBinary() + _ = yym2126 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1978 := r.ContainerType() - if yyct1978 == codecSelferValueTypeMap1234 { - yyl1978 := r.ReadMapStart() - if yyl1978 == 0 { + yyct2127 := r.ContainerType() + if yyct2127 == codecSelferValueTypeMap1234 { + yyl2127 := r.ReadMapStart() + if yyl2127 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1978, d) + x.codecDecodeSelfFromMap(yyl2127, d) } - } else if yyct1978 == codecSelferValueTypeArray1234 { - yyl1978 := r.ReadArrayStart() - if yyl1978 == 0 { + } else if yyct2127 == codecSelferValueTypeArray1234 { + yyl2127 := r.ReadArrayStart() + if yyl2127 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1978, d) + x.codecDecodeSelfFromArray(yyl2127, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25874,12 +27993,12 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1979Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1979Slc - var yyhl1979 bool = l >= 0 - for yyj1979 := 0; ; yyj1979++ { - if yyhl1979 { - if yyj1979 >= l { + var yys2128Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2128Slc + var yyhl2128 bool = l >= 0 + for yyj2128 := 0; ; yyj2128++ { + if yyhl2128 { + if yyj2128 >= l { break } } else { @@ -25888,26 +28007,26 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1979Slc = r.DecodeBytes(yys1979Slc, true, true) - yys1979 := string(yys1979Slc) + yys2128Slc = r.DecodeBytes(yys2128Slc, true, true) + yys2128 := string(yys2128Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1979 { + switch yys2128 { case "ingress": if r.TryDecodeAsNil() { x.Ingress = nil } else { - yyv1980 := &x.Ingress - yym1981 := z.DecBinary() - _ = yym1981 + yyv2129 := &x.Ingress + yym2130 := z.DecBinary() + _ = yym2130 if false { } else { - h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv1980), d) + h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv2129), d) } } default: - z.DecStructFieldNotFound(-1, yys1979) - } // end switch yys1979 - } // end for yyj1979 + z.DecStructFieldNotFound(-1, yys2128) + } // end switch yys2128 + } // end for yyj2128 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25915,16 +28034,16 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1982 int - var yyb1982 bool - var yyhl1982 bool = l >= 0 - yyj1982++ - if yyhl1982 { - yyb1982 = yyj1982 > l + var yyj2131 int + var yyb2131 bool + var yyhl2131 bool = l >= 0 + yyj2131++ + if yyhl2131 { + yyb2131 = yyj2131 > l } else { - yyb1982 = r.CheckBreak() + yyb2131 = r.CheckBreak() } - if yyb1982 { + if yyb2131 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25932,26 +28051,26 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Ingress = nil } else { - yyv1983 := &x.Ingress - yym1984 := z.DecBinary() - _ = yym1984 + yyv2132 := &x.Ingress + yym2133 := z.DecBinary() + _ = yym2133 if false { } else { - h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv1983), d) + h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv2132), d) } } for { - yyj1982++ - if yyhl1982 { - yyb1982 = yyj1982 > l + yyj2131++ + if yyhl2131 { + yyb2131 = yyj2131 > l } else { - yyb1982 = r.CheckBreak() + yyb2131 = r.CheckBreak() } - if yyb1982 { + if yyb2131 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1982-1, "") + z.DecStructFieldNotFound(yyj2131-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25963,36 +28082,36 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1985 := z.EncBinary() - _ = yym1985 + yym2134 := z.EncBinary() + _ = yym2134 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1986 := !z.EncBinary() - yy2arr1986 := z.EncBasicHandle().StructToArray - var yyq1986 [2]bool - _, _, _ = yysep1986, yyq1986, yy2arr1986 - const yyr1986 bool = false - yyq1986[0] = x.IP != "" - yyq1986[1] = x.Hostname != "" - var yynn1986 int - if yyr1986 || yy2arr1986 { + yysep2135 := !z.EncBinary() + yy2arr2135 := z.EncBasicHandle().StructToArray + var yyq2135 [2]bool + _, _, _ = yysep2135, yyq2135, yy2arr2135 + const yyr2135 bool = false + yyq2135[0] = x.IP != "" + yyq2135[1] = x.Hostname != "" + var yynn2135 int + if yyr2135 || yy2arr2135 { r.EncodeArrayStart(2) } else { - yynn1986 = 0 - for _, b := range yyq1986 { + yynn2135 = 0 + for _, b := range yyq2135 { if b { - yynn1986++ + yynn2135++ } } - r.EncodeMapStart(yynn1986) - yynn1986 = 0 + r.EncodeMapStart(yynn2135) + yynn2135 = 0 } - if yyr1986 || yy2arr1986 { + if yyr2135 || yy2arr2135 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1986[0] { - yym1988 := z.EncBinary() - _ = yym1988 + if yyq2135[0] { + yym2137 := z.EncBinary() + _ = yym2137 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) @@ -26001,23 +28120,23 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1986[0] { + if yyq2135[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ip")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1989 := z.EncBinary() - _ = yym1989 + yym2138 := z.EncBinary() + _ = yym2138 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) } } } - if yyr1986 || yy2arr1986 { + if yyr2135 || yy2arr2135 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1986[1] { - yym1991 := z.EncBinary() - _ = yym1991 + if yyq2135[1] { + yym2140 := z.EncBinary() + _ = yym2140 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Hostname)) @@ -26026,19 +28145,19 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1986[1] { + if yyq2135[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostname")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1992 := z.EncBinary() - _ = yym1992 + yym2141 := z.EncBinary() + _ = yym2141 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Hostname)) } } } - if yyr1986 || yy2arr1986 { + if yyr2135 || yy2arr2135 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26051,25 +28170,25 @@ func (x *LoadBalancerIngress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1993 := z.DecBinary() - _ = yym1993 + yym2142 := z.DecBinary() + _ = yym2142 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1994 := r.ContainerType() - if yyct1994 == codecSelferValueTypeMap1234 { - yyl1994 := r.ReadMapStart() - if yyl1994 == 0 { + yyct2143 := r.ContainerType() + if yyct2143 == codecSelferValueTypeMap1234 { + yyl2143 := r.ReadMapStart() + if yyl2143 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1994, d) + x.codecDecodeSelfFromMap(yyl2143, d) } - } else if yyct1994 == codecSelferValueTypeArray1234 { - yyl1994 := r.ReadArrayStart() - if yyl1994 == 0 { + } else if yyct2143 == codecSelferValueTypeArray1234 { + yyl2143 := r.ReadArrayStart() + if yyl2143 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1994, d) + x.codecDecodeSelfFromArray(yyl2143, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26081,12 +28200,12 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1995Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1995Slc - var yyhl1995 bool = l >= 0 - for yyj1995 := 0; ; yyj1995++ { - if yyhl1995 { - if yyj1995 >= l { + var yys2144Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2144Slc + var yyhl2144 bool = l >= 0 + for yyj2144 := 0; ; yyj2144++ { + if yyhl2144 { + if yyj2144 >= l { break } } else { @@ -26095,10 +28214,10 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1995Slc = r.DecodeBytes(yys1995Slc, true, true) - yys1995 := string(yys1995Slc) + yys2144Slc = r.DecodeBytes(yys2144Slc, true, true) + yys2144 := string(yys2144Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1995 { + switch yys2144 { case "ip": if r.TryDecodeAsNil() { x.IP = "" @@ -26112,9 +28231,9 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.Hostname = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1995) - } // end switch yys1995 - } // end for yyj1995 + z.DecStructFieldNotFound(-1, yys2144) + } // end switch yys2144 + } // end for yyj2144 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -26122,16 +28241,16 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1998 int - var yyb1998 bool - var yyhl1998 bool = l >= 0 - yyj1998++ - if yyhl1998 { - yyb1998 = yyj1998 > l + var yyj2147 int + var yyb2147 bool + var yyhl2147 bool = l >= 0 + yyj2147++ + if yyhl2147 { + yyb2147 = yyj2147 > l } else { - yyb1998 = r.CheckBreak() + yyb2147 = r.CheckBreak() } - if yyb1998 { + if yyb2147 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26141,13 +28260,13 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.IP = string(r.DecodeString()) } - yyj1998++ - if yyhl1998 { - yyb1998 = yyj1998 > l + yyj2147++ + if yyhl2147 { + yyb2147 = yyj2147 > l } else { - yyb1998 = r.CheckBreak() + yyb2147 = r.CheckBreak() } - if yyb1998 { + if yyb2147 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26158,17 +28277,17 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod x.Hostname = string(r.DecodeString()) } for { - yyj1998++ - if yyhl1998 { - yyb1998 = yyj1998 > l + yyj2147++ + if yyhl2147 { + yyb2147 = yyj2147 > l } else { - yyb1998 = r.CheckBreak() + yyb2147 = r.CheckBreak() } - if yyb1998 { + if yyb2147 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1998-1, "") + z.DecStructFieldNotFound(yyj2147-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -26180,56 +28299,56 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2001 := z.EncBinary() - _ = yym2001 + yym2150 := z.EncBinary() + _ = yym2150 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2002 := !z.EncBinary() - yy2arr2002 := z.EncBasicHandle().StructToArray - var yyq2002 [7]bool - _, _, _ = yysep2002, yyq2002, yy2arr2002 - const yyr2002 bool = false - yyq2002[0] = x.Type != "" - yyq2002[3] = x.ClusterIP != "" - yyq2002[4] = len(x.ExternalIPs) != 0 - yyq2002[5] = x.LoadBalancerIP != "" - yyq2002[6] = x.SessionAffinity != "" - var yynn2002 int - if yyr2002 || yy2arr2002 { + yysep2151 := !z.EncBinary() + yy2arr2151 := z.EncBasicHandle().StructToArray + var yyq2151 [7]bool + _, _, _ = yysep2151, yyq2151, yy2arr2151 + const yyr2151 bool = false + yyq2151[0] = x.Type != "" + yyq2151[3] = x.ClusterIP != "" + yyq2151[4] = len(x.ExternalIPs) != 0 + yyq2151[5] = x.LoadBalancerIP != "" + yyq2151[6] = x.SessionAffinity != "" + var yynn2151 int + if yyr2151 || yy2arr2151 { r.EncodeArrayStart(7) } else { - yynn2002 = 2 - for _, b := range yyq2002 { + yynn2151 = 2 + for _, b := range yyq2151 { if b { - yynn2002++ + yynn2151++ } } - r.EncodeMapStart(yynn2002) - yynn2002 = 0 + r.EncodeMapStart(yynn2151) + yynn2151 = 0 } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2002[0] { + if yyq2151[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2002[0] { + if yyq2151[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Ports == nil { r.EncodeNil() } else { - yym2005 := z.EncBinary() - _ = yym2005 + yym2154 := z.EncBinary() + _ = yym2154 if false { } else { h.encSliceServicePort(([]ServicePort)(x.Ports), e) @@ -26242,21 +28361,21 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Ports == nil { r.EncodeNil() } else { - yym2006 := z.EncBinary() - _ = yym2006 + yym2155 := z.EncBinary() + _ = yym2155 if false { } else { h.encSliceServicePort(([]ServicePort)(x.Ports), e) } } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Selector == nil { r.EncodeNil() } else { - yym2008 := z.EncBinary() - _ = yym2008 + yym2157 := z.EncBinary() + _ = yym2157 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -26269,19 +28388,19 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Selector == nil { r.EncodeNil() } else { - yym2009 := z.EncBinary() - _ = yym2009 + yym2158 := z.EncBinary() + _ = yym2158 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) } } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2002[3] { - yym2011 := z.EncBinary() - _ = yym2011 + if yyq2151[3] { + yym2160 := z.EncBinary() + _ = yym2160 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterIP)) @@ -26290,26 +28409,26 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2002[3] { + if yyq2151[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("clusterIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2012 := z.EncBinary() - _ = yym2012 + yym2161 := z.EncBinary() + _ = yym2161 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterIP)) } } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2002[4] { + if yyq2151[4] { if x.ExternalIPs == nil { r.EncodeNil() } else { - yym2014 := z.EncBinary() - _ = yym2014 + yym2163 := z.EncBinary() + _ = yym2163 if false { } else { z.F.EncSliceStringV(x.ExternalIPs, false, e) @@ -26319,15 +28438,15 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2002[4] { + if yyq2151[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("externalIPs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ExternalIPs == nil { r.EncodeNil() } else { - yym2015 := z.EncBinary() - _ = yym2015 + yym2164 := z.EncBinary() + _ = yym2164 if false { } else { z.F.EncSliceStringV(x.ExternalIPs, false, e) @@ -26335,11 +28454,11 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2002[5] { - yym2017 := z.EncBinary() - _ = yym2017 + if yyq2151[5] { + yym2166 := z.EncBinary() + _ = yym2166 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.LoadBalancerIP)) @@ -26348,34 +28467,34 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2002[5] { + if yyq2151[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancerIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2018 := z.EncBinary() - _ = yym2018 + yym2167 := z.EncBinary() + _ = yym2167 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.LoadBalancerIP)) } } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2002[6] { + if yyq2151[6] { x.SessionAffinity.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2002[6] { + if yyq2151[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("sessionAffinity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.SessionAffinity.CodecEncodeSelf(e) } } - if yyr2002 || yy2arr2002 { + if yyr2151 || yy2arr2151 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26388,25 +28507,25 @@ func (x *ServiceSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2020 := z.DecBinary() - _ = yym2020 + yym2169 := z.DecBinary() + _ = yym2169 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2021 := r.ContainerType() - if yyct2021 == codecSelferValueTypeMap1234 { - yyl2021 := r.ReadMapStart() - if yyl2021 == 0 { + yyct2170 := r.ContainerType() + if yyct2170 == codecSelferValueTypeMap1234 { + yyl2170 := r.ReadMapStart() + if yyl2170 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2021, d) + x.codecDecodeSelfFromMap(yyl2170, d) } - } else if yyct2021 == codecSelferValueTypeArray1234 { - yyl2021 := r.ReadArrayStart() - if yyl2021 == 0 { + } else if yyct2170 == codecSelferValueTypeArray1234 { + yyl2170 := r.ReadArrayStart() + if yyl2170 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2021, d) + x.codecDecodeSelfFromArray(yyl2170, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26418,12 +28537,12 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2022Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2022Slc - var yyhl2022 bool = l >= 0 - for yyj2022 := 0; ; yyj2022++ { - if yyhl2022 { - if yyj2022 >= l { + var yys2171Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2171Slc + var yyhl2171 bool = l >= 0 + for yyj2171 := 0; ; yyj2171++ { + if yyhl2171 { + if yyj2171 >= l { break } } else { @@ -26432,10 +28551,10 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2022Slc = r.DecodeBytes(yys2022Slc, true, true) - yys2022 := string(yys2022Slc) + yys2171Slc = r.DecodeBytes(yys2171Slc, true, true) + yys2171 := string(yys2171Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2022 { + switch yys2171 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -26446,24 +28565,24 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2024 := &x.Ports - yym2025 := z.DecBinary() - _ = yym2025 + yyv2173 := &x.Ports + yym2174 := z.DecBinary() + _ = yym2174 if false { } else { - h.decSliceServicePort((*[]ServicePort)(yyv2024), d) + h.decSliceServicePort((*[]ServicePort)(yyv2173), d) } } case "selector": if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv2026 := &x.Selector - yym2027 := z.DecBinary() - _ = yym2027 + yyv2175 := &x.Selector + yym2176 := z.DecBinary() + _ = yym2176 if false { } else { - z.F.DecMapStringStringX(yyv2026, false, d) + z.F.DecMapStringStringX(yyv2175, false, d) } } case "clusterIP": @@ -26476,12 +28595,12 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ExternalIPs = nil } else { - yyv2029 := &x.ExternalIPs - yym2030 := z.DecBinary() - _ = yym2030 + yyv2178 := &x.ExternalIPs + yym2179 := z.DecBinary() + _ = yym2179 if false { } else { - z.F.DecSliceStringX(yyv2029, false, d) + z.F.DecSliceStringX(yyv2178, false, d) } } case "loadBalancerIP": @@ -26497,9 +28616,9 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.SessionAffinity = ServiceAffinity(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2022) - } // end switch yys2022 - } // end for yyj2022 + z.DecStructFieldNotFound(-1, yys2171) + } // end switch yys2171 + } // end for yyj2171 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -26507,16 +28626,16 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2033 int - var yyb2033 bool - var yyhl2033 bool = l >= 0 - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + var yyj2182 int + var yyb2182 bool + var yyhl2182 bool = l >= 0 + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26526,13 +28645,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = ServiceType(r.DecodeString()) } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26540,21 +28659,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2035 := &x.Ports - yym2036 := z.DecBinary() - _ = yym2036 + yyv2184 := &x.Ports + yym2185 := z.DecBinary() + _ = yym2185 if false { } else { - h.decSliceServicePort((*[]ServicePort)(yyv2035), d) + h.decSliceServicePort((*[]ServicePort)(yyv2184), d) } } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26562,21 +28681,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv2037 := &x.Selector - yym2038 := z.DecBinary() - _ = yym2038 + yyv2186 := &x.Selector + yym2187 := z.DecBinary() + _ = yym2187 if false { } else { - z.F.DecMapStringStringX(yyv2037, false, d) + z.F.DecMapStringStringX(yyv2186, false, d) } } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26586,13 +28705,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ClusterIP = string(r.DecodeString()) } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26600,21 +28719,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ExternalIPs = nil } else { - yyv2040 := &x.ExternalIPs - yym2041 := z.DecBinary() - _ = yym2041 + yyv2189 := &x.ExternalIPs + yym2190 := z.DecBinary() + _ = yym2190 if false { } else { - z.F.DecSliceStringX(yyv2040, false, d) + z.F.DecSliceStringX(yyv2189, false, d) } } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26624,13 +28743,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.LoadBalancerIP = string(r.DecodeString()) } - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26641,17 +28760,17 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.SessionAffinity = ServiceAffinity(r.DecodeString()) } for { - yyj2033++ - if yyhl2033 { - yyb2033 = yyj2033 > l + yyj2182++ + if yyhl2182 { + yyb2182 = yyj2182 > l } else { - yyb2033 = r.CheckBreak() + yyb2182 = r.CheckBreak() } - if yyb2033 { + if yyb2182 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2033-1, "") + z.DecStructFieldNotFound(yyj2182-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -26663,33 +28782,33 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2044 := z.EncBinary() - _ = yym2044 + yym2193 := z.EncBinary() + _ = yym2193 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2045 := !z.EncBinary() - yy2arr2045 := z.EncBasicHandle().StructToArray - var yyq2045 [5]bool - _, _, _ = yysep2045, yyq2045, yy2arr2045 - const yyr2045 bool = false - var yynn2045 int - if yyr2045 || yy2arr2045 { + yysep2194 := !z.EncBinary() + yy2arr2194 := z.EncBasicHandle().StructToArray + var yyq2194 [5]bool + _, _, _ = yysep2194, yyq2194, yy2arr2194 + const yyr2194 bool = false + var yynn2194 int + if yyr2194 || yy2arr2194 { r.EncodeArrayStart(5) } else { - yynn2045 = 5 - for _, b := range yyq2045 { + yynn2194 = 5 + for _, b := range yyq2194 { if b { - yynn2045++ + yynn2194++ } } - r.EncodeMapStart(yynn2045) - yynn2045 = 0 + r.EncodeMapStart(yynn2194) + yynn2194 = 0 } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2047 := z.EncBinary() - _ = yym2047 + yym2196 := z.EncBinary() + _ = yym2196 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -26698,14 +28817,14 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2048 := z.EncBinary() - _ = yym2048 + yym2197 := z.EncBinary() + _ = yym2197 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Protocol.CodecEncodeSelf(e) } else { @@ -26714,10 +28833,10 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2051 := z.EncBinary() - _ = yym2051 + yym2200 := z.EncBinary() + _ = yym2200 if false { } else { r.EncodeInt(int64(x.Port)) @@ -26726,44 +28845,44 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2052 := z.EncBinary() - _ = yym2052 + yym2201 := z.EncBinary() + _ = yym2201 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy2054 := &x.TargetPort - yym2055 := z.EncBinary() - _ = yym2055 + yy2203 := &x.TargetPort + yym2204 := z.EncBinary() + _ = yym2204 if false { - } else if z.HasExtensions() && z.EncExt(yy2054) { - } else if !yym2055 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2054) + } else if z.HasExtensions() && z.EncExt(yy2203) { + } else if !yym2204 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2203) } else { - z.EncFallback(yy2054) + z.EncFallback(yy2203) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("targetPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2056 := &x.TargetPort - yym2057 := z.EncBinary() - _ = yym2057 + yy2205 := &x.TargetPort + yym2206 := z.EncBinary() + _ = yym2206 if false { - } else if z.HasExtensions() && z.EncExt(yy2056) { - } else if !yym2057 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2056) + } else if z.HasExtensions() && z.EncExt(yy2205) { + } else if !yym2206 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2205) } else { - z.EncFallback(yy2056) + z.EncFallback(yy2205) } } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2059 := z.EncBinary() - _ = yym2059 + yym2208 := z.EncBinary() + _ = yym2208 if false { } else { r.EncodeInt(int64(x.NodePort)) @@ -26772,14 +28891,14 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodePort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2060 := z.EncBinary() - _ = yym2060 + yym2209 := z.EncBinary() + _ = yym2209 if false { } else { r.EncodeInt(int64(x.NodePort)) } } - if yyr2045 || yy2arr2045 { + if yyr2194 || yy2arr2194 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26792,25 +28911,25 @@ func (x *ServicePort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2061 := z.DecBinary() - _ = yym2061 + yym2210 := z.DecBinary() + _ = yym2210 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2062 := r.ContainerType() - if yyct2062 == codecSelferValueTypeMap1234 { - yyl2062 := r.ReadMapStart() - if yyl2062 == 0 { + yyct2211 := r.ContainerType() + if yyct2211 == codecSelferValueTypeMap1234 { + yyl2211 := r.ReadMapStart() + if yyl2211 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2062, d) + x.codecDecodeSelfFromMap(yyl2211, d) } - } else if yyct2062 == codecSelferValueTypeArray1234 { - yyl2062 := r.ReadArrayStart() - if yyl2062 == 0 { + } else if yyct2211 == codecSelferValueTypeArray1234 { + yyl2211 := r.ReadArrayStart() + if yyl2211 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2062, d) + x.codecDecodeSelfFromArray(yyl2211, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26822,12 +28941,12 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2063Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2063Slc - var yyhl2063 bool = l >= 0 - for yyj2063 := 0; ; yyj2063++ { - if yyhl2063 { - if yyj2063 >= l { + var yys2212Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2212Slc + var yyhl2212 bool = l >= 0 + for yyj2212 := 0; ; yyj2212++ { + if yyhl2212 { + if yyj2212 >= l { break } } else { @@ -26836,10 +28955,10 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2063Slc = r.DecodeBytes(yys2063Slc, true, true) - yys2063 := string(yys2063Slc) + yys2212Slc = r.DecodeBytes(yys2212Slc, true, true) + yys2212 := string(yys2212Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2063 { + switch yys2212 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -26862,15 +28981,15 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetPort = pkg5_intstr.IntOrString{} } else { - yyv2067 := &x.TargetPort - yym2068 := z.DecBinary() - _ = yym2068 + yyv2216 := &x.TargetPort + yym2217 := z.DecBinary() + _ = yym2217 if false { - } else if z.HasExtensions() && z.DecExt(yyv2067) { - } else if !yym2068 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2067) + } else if z.HasExtensions() && z.DecExt(yyv2216) { + } else if !yym2217 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2216) } else { - z.DecFallback(yyv2067, false) + z.DecFallback(yyv2216, false) } } case "nodePort": @@ -26880,9 +28999,9 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.NodePort = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys2063) - } // end switch yys2063 - } // end for yyj2063 + z.DecStructFieldNotFound(-1, yys2212) + } // end switch yys2212 + } // end for yyj2212 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -26890,16 +29009,16 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2070 int - var yyb2070 bool - var yyhl2070 bool = l >= 0 - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + var yyj2219 int + var yyb2219 bool + var yyhl2219 bool = l >= 0 + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26909,13 +29028,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26925,13 +29044,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Protocol = Protocol(r.DecodeString()) } - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26941,13 +29060,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Port = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26955,24 +29074,24 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetPort = pkg5_intstr.IntOrString{} } else { - yyv2074 := &x.TargetPort - yym2075 := z.DecBinary() - _ = yym2075 + yyv2223 := &x.TargetPort + yym2224 := z.DecBinary() + _ = yym2224 if false { - } else if z.HasExtensions() && z.DecExt(yyv2074) { - } else if !yym2075 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2074) + } else if z.HasExtensions() && z.DecExt(yyv2223) { + } else if !yym2224 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2223) } else { - z.DecFallback(yyv2074, false) + z.DecFallback(yyv2223, false) } } - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26983,17 +29102,17 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.NodePort = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj2070++ - if yyhl2070 { - yyb2070 = yyj2070 > l + yyj2219++ + if yyhl2219 { + yyb2219 = yyj2219 > l } else { - yyb2070 = r.CheckBreak() + yyb2219 = r.CheckBreak() } - if yyb2070 { + if yyb2219 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2070-1, "") + z.DecStructFieldNotFound(yyj2219-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27005,136 +29124,136 @@ func (x *Service) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2077 := z.EncBinary() - _ = yym2077 + yym2226 := z.EncBinary() + _ = yym2226 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2078 := !z.EncBinary() - yy2arr2078 := z.EncBasicHandle().StructToArray - var yyq2078 [5]bool - _, _, _ = yysep2078, yyq2078, yy2arr2078 - const yyr2078 bool = false - yyq2078[0] = x.Kind != "" - yyq2078[1] = x.APIVersion != "" - yyq2078[2] = true - yyq2078[3] = true - yyq2078[4] = true - var yynn2078 int - if yyr2078 || yy2arr2078 { + yysep2227 := !z.EncBinary() + yy2arr2227 := z.EncBasicHandle().StructToArray + var yyq2227 [5]bool + _, _, _ = yysep2227, yyq2227, yy2arr2227 + const yyr2227 bool = false + yyq2227[0] = true + yyq2227[1] = true + yyq2227[2] = true + yyq2227[3] = x.Kind != "" + yyq2227[4] = x.APIVersion != "" + var yynn2227 int + if yyr2227 || yy2arr2227 { r.EncodeArrayStart(5) } else { - yynn2078 = 0 - for _, b := range yyq2078 { + yynn2227 = 0 + for _, b := range yyq2227 { if b { - yynn2078++ + yynn2227++ } } - r.EncodeMapStart(yynn2078) - yynn2078 = 0 + r.EncodeMapStart(yynn2227) + yynn2227 = 0 } - if yyr2078 || yy2arr2078 { + if yyr2227 || yy2arr2227 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2078[0] { - yym2080 := z.EncBinary() - _ = yym2080 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2078[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2081 := z.EncBinary() - _ = yym2081 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2078 || yy2arr2078 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2078[1] { - yym2083 := z.EncBinary() - _ = yym2083 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2078[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2084 := z.EncBinary() - _ = yym2084 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2078 || yy2arr2078 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2078[2] { - yy2086 := &x.ObjectMeta - yy2086.CodecEncodeSelf(e) + if yyq2227[0] { + yy2229 := &x.ObjectMeta + yy2229.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2078[2] { + if yyq2227[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2087 := &x.ObjectMeta - yy2087.CodecEncodeSelf(e) + yy2230 := &x.ObjectMeta + yy2230.CodecEncodeSelf(e) } } - if yyr2078 || yy2arr2078 { + if yyr2227 || yy2arr2227 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2078[3] { - yy2089 := &x.Spec - yy2089.CodecEncodeSelf(e) + if yyq2227[1] { + yy2232 := &x.Spec + yy2232.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2078[3] { + if yyq2227[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2090 := &x.Spec - yy2090.CodecEncodeSelf(e) + yy2233 := &x.Spec + yy2233.CodecEncodeSelf(e) } } - if yyr2078 || yy2arr2078 { + if yyr2227 || yy2arr2227 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2078[4] { - yy2092 := &x.Status - yy2092.CodecEncodeSelf(e) + if yyq2227[2] { + yy2235 := &x.Status + yy2235.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2078[4] { + if yyq2227[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2093 := &x.Status - yy2093.CodecEncodeSelf(e) + yy2236 := &x.Status + yy2236.CodecEncodeSelf(e) } } - if yyr2078 || yy2arr2078 { + if yyr2227 || yy2arr2227 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2227[3] { + yym2238 := z.EncBinary() + _ = yym2238 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2227[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2239 := z.EncBinary() + _ = yym2239 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2227 || yy2arr2227 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2227[4] { + yym2241 := z.EncBinary() + _ = yym2241 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2227[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2242 := z.EncBinary() + _ = yym2242 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2227 || yy2arr2227 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -27147,25 +29266,25 @@ func (x *Service) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2094 := z.DecBinary() - _ = yym2094 + yym2243 := z.DecBinary() + _ = yym2243 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2095 := r.ContainerType() - if yyct2095 == codecSelferValueTypeMap1234 { - yyl2095 := r.ReadMapStart() - if yyl2095 == 0 { + yyct2244 := r.ContainerType() + if yyct2244 == codecSelferValueTypeMap1234 { + yyl2244 := r.ReadMapStart() + if yyl2244 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2095, d) + x.codecDecodeSelfFromMap(yyl2244, d) } - } else if yyct2095 == codecSelferValueTypeArray1234 { - yyl2095 := r.ReadArrayStart() - if yyl2095 == 0 { + } else if yyct2244 == codecSelferValueTypeArray1234 { + yyl2244 := r.ReadArrayStart() + if yyl2244 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2095, d) + x.codecDecodeSelfFromArray(yyl2244, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -27177,12 +29296,12 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2096Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2096Slc - var yyhl2096 bool = l >= 0 - for yyj2096 := 0; ; yyj2096++ { - if yyhl2096 { - if yyj2096 >= l { + var yys2245Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2245Slc + var yyhl2245 bool = l >= 0 + for yyj2245 := 0; ; yyj2245++ { + if yyhl2245 { + if yyj2245 >= l { break } } else { @@ -27191,10 +29310,31 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2096Slc = r.DecodeBytes(yys2096Slc, true, true) - yys2096 := string(yys2096Slc) + yys2245Slc = r.DecodeBytes(yys2245Slc, true, true) + yys2245 := string(yys2245Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2096 { + switch yys2245 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2246 := &x.ObjectMeta + yyv2246.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ServiceSpec{} + } else { + yyv2247 := &x.Spec + yyv2247.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ServiceStatus{} + } else { + yyv2248 := &x.Status + yyv2248.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27207,31 +29347,10 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2099 := &x.ObjectMeta - yyv2099.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ServiceSpec{} - } else { - yyv2100 := &x.Spec - yyv2100.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ServiceStatus{} - } else { - yyv2101 := &x.Status - yyv2101.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys2096) - } // end switch yys2096 - } // end for yyj2096 + z.DecStructFieldNotFound(-1, yys2245) + } // end switch yys2245 + } // end for yyj2245 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27239,16 +29358,67 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2102 int - var yyb2102 bool - var yyhl2102 bool = l >= 0 - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l + var yyj2251 int + var yyb2251 bool + var yyhl2251 bool = l >= 0 + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l } else { - yyb2102 = r.CheckBreak() + yyb2251 = r.CheckBreak() } - if yyb2102 { + if yyb2251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2252 := &x.ObjectMeta + yyv2252.CodecDecodeSelf(d) + } + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l + } else { + yyb2251 = r.CheckBreak() + } + if yyb2251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ServiceSpec{} + } else { + yyv2253 := &x.Spec + yyv2253.CodecDecodeSelf(d) + } + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l + } else { + yyb2251 = r.CheckBreak() + } + if yyb2251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ServiceStatus{} + } else { + yyv2254 := &x.Status + yyv2254.CodecDecodeSelf(d) + } + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l + } else { + yyb2251 = r.CheckBreak() + } + if yyb2251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27258,13 +29428,13 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l } else { - yyb2102 = r.CheckBreak() + yyb2251 = r.CheckBreak() } - if yyb2102 { + if yyb2251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27274,69 +29444,18 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l - } else { - yyb2102 = r.CheckBreak() - } - if yyb2102 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2105 := &x.ObjectMeta - yyv2105.CodecDecodeSelf(d) - } - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l - } else { - yyb2102 = r.CheckBreak() - } - if yyb2102 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ServiceSpec{} - } else { - yyv2106 := &x.Spec - yyv2106.CodecDecodeSelf(d) - } - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l - } else { - yyb2102 = r.CheckBreak() - } - if yyb2102 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ServiceStatus{} - } else { - yyv2107 := &x.Status - yyv2107.CodecDecodeSelf(d) - } for { - yyj2102++ - if yyhl2102 { - yyb2102 = yyj2102 > l + yyj2251++ + if yyhl2251 { + yyb2251 = yyj2251 > l } else { - yyb2102 = r.CheckBreak() + yyb2251 = r.CheckBreak() } - if yyb2102 { + if yyb2251 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2102-1, "") + z.DecStructFieldNotFound(yyj2251-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27348,107 +29467,57 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2108 := z.EncBinary() - _ = yym2108 + yym2257 := z.EncBinary() + _ = yym2257 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2109 := !z.EncBinary() - yy2arr2109 := z.EncBasicHandle().StructToArray - var yyq2109 [5]bool - _, _, _ = yysep2109, yyq2109, yy2arr2109 - const yyr2109 bool = false - yyq2109[0] = x.Kind != "" - yyq2109[1] = x.APIVersion != "" - yyq2109[2] = true - yyq2109[4] = len(x.ImagePullSecrets) != 0 - var yynn2109 int - if yyr2109 || yy2arr2109 { + yysep2258 := !z.EncBinary() + yy2arr2258 := z.EncBasicHandle().StructToArray + var yyq2258 [5]bool + _, _, _ = yysep2258, yyq2258, yy2arr2258 + const yyr2258 bool = false + yyq2258[0] = true + yyq2258[2] = len(x.ImagePullSecrets) != 0 + yyq2258[3] = x.Kind != "" + yyq2258[4] = x.APIVersion != "" + var yynn2258 int + if yyr2258 || yy2arr2258 { r.EncodeArrayStart(5) } else { - yynn2109 = 1 - for _, b := range yyq2109 { + yynn2258 = 1 + for _, b := range yyq2258 { if b { - yynn2109++ + yynn2258++ } } - r.EncodeMapStart(yynn2109) - yynn2109 = 0 + r.EncodeMapStart(yynn2258) + yynn2258 = 0 } - if yyr2109 || yy2arr2109 { + if yyr2258 || yy2arr2258 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2109[0] { - yym2111 := z.EncBinary() - _ = yym2111 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2109[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2112 := z.EncBinary() - _ = yym2112 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2109 || yy2arr2109 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2109[1] { - yym2114 := z.EncBinary() - _ = yym2114 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2109[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2115 := z.EncBinary() - _ = yym2115 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2109 || yy2arr2109 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2109[2] { - yy2117 := &x.ObjectMeta - yy2117.CodecEncodeSelf(e) + if yyq2258[0] { + yy2260 := &x.ObjectMeta + yy2260.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2109[2] { + if yyq2258[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2118 := &x.ObjectMeta - yy2118.CodecEncodeSelf(e) + yy2261 := &x.ObjectMeta + yy2261.CodecEncodeSelf(e) } } - if yyr2109 || yy2arr2109 { + if yyr2258 || yy2arr2258 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Secrets == nil { r.EncodeNil() } else { - yym2120 := z.EncBinary() - _ = yym2120 + yym2263 := z.EncBinary() + _ = yym2263 if false { } else { h.encSliceObjectReference(([]ObjectReference)(x.Secrets), e) @@ -27461,22 +29530,22 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { if x.Secrets == nil { r.EncodeNil() } else { - yym2121 := z.EncBinary() - _ = yym2121 + yym2264 := z.EncBinary() + _ = yym2264 if false { } else { h.encSliceObjectReference(([]ObjectReference)(x.Secrets), e) } } } - if yyr2109 || yy2arr2109 { + if yyr2258 || yy2arr2258 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2109[4] { + if yyq2258[2] { if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym2123 := z.EncBinary() - _ = yym2123 + yym2266 := z.EncBinary() + _ = yym2266 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -27486,15 +29555,15 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2109[4] { + if yyq2258[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imagePullSecrets")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym2124 := z.EncBinary() - _ = yym2124 + yym2267 := z.EncBinary() + _ = yym2267 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -27502,7 +29571,57 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2109 || yy2arr2109 { + if yyr2258 || yy2arr2258 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2258[3] { + yym2269 := z.EncBinary() + _ = yym2269 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2258[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2270 := z.EncBinary() + _ = yym2270 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2258 || yy2arr2258 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2258[4] { + yym2272 := z.EncBinary() + _ = yym2272 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2258[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2273 := z.EncBinary() + _ = yym2273 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2258 || yy2arr2258 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -27515,25 +29634,25 @@ func (x *ServiceAccount) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2125 := z.DecBinary() - _ = yym2125 + yym2274 := z.DecBinary() + _ = yym2274 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2126 := r.ContainerType() - if yyct2126 == codecSelferValueTypeMap1234 { - yyl2126 := r.ReadMapStart() - if yyl2126 == 0 { + yyct2275 := r.ContainerType() + if yyct2275 == codecSelferValueTypeMap1234 { + yyl2275 := r.ReadMapStart() + if yyl2275 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2126, d) + x.codecDecodeSelfFromMap(yyl2275, d) } - } else if yyct2126 == codecSelferValueTypeArray1234 { - yyl2126 := r.ReadArrayStart() - if yyl2126 == 0 { + } else if yyct2275 == codecSelferValueTypeArray1234 { + yyl2275 := r.ReadArrayStart() + if yyl2275 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2126, d) + x.codecDecodeSelfFromArray(yyl2275, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -27545,12 +29664,12 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2127Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2127Slc - var yyhl2127 bool = l >= 0 - for yyj2127 := 0; ; yyj2127++ { - if yyhl2127 { - if yyj2127 >= l { + var yys2276Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2276Slc + var yyhl2276 bool = l >= 0 + for yyj2276 := 0; ; yyj2276++ { + if yyhl2276 { + if yyj2276 >= l { break } } else { @@ -27559,10 +29678,41 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2127Slc = r.DecodeBytes(yys2127Slc, true, true) - yys2127 := string(yys2127Slc) + yys2276Slc = r.DecodeBytes(yys2276Slc, true, true) + yys2276 := string(yys2276Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2127 { + switch yys2276 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2277 := &x.ObjectMeta + yyv2277.CodecDecodeSelf(d) + } + case "secrets": + if r.TryDecodeAsNil() { + x.Secrets = nil + } else { + yyv2278 := &x.Secrets + yym2279 := z.DecBinary() + _ = yym2279 + if false { + } else { + h.decSliceObjectReference((*[]ObjectReference)(yyv2278), d) + } + } + case "imagePullSecrets": + if r.TryDecodeAsNil() { + x.ImagePullSecrets = nil + } else { + yyv2280 := &x.ImagePullSecrets + yym2281 := z.DecBinary() + _ = yym2281 + if false { + } else { + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2280), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27575,41 +29725,10 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2130 := &x.ObjectMeta - yyv2130.CodecDecodeSelf(d) - } - case "secrets": - if r.TryDecodeAsNil() { - x.Secrets = nil - } else { - yyv2131 := &x.Secrets - yym2132 := z.DecBinary() - _ = yym2132 - if false { - } else { - h.decSliceObjectReference((*[]ObjectReference)(yyv2131), d) - } - } - case "imagePullSecrets": - if r.TryDecodeAsNil() { - x.ImagePullSecrets = nil - } else { - yyv2133 := &x.ImagePullSecrets - yym2134 := z.DecBinary() - _ = yym2134 - if false { - } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2133), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2127) - } // end switch yys2127 - } // end for yyj2127 + z.DecStructFieldNotFound(-1, yys2276) + } // end switch yys2276 + } // end for yyj2276 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27617,16 +29736,77 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2135 int - var yyb2135 bool - var yyhl2135 bool = l >= 0 - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l + var yyj2284 int + var yyb2284 bool + var yyhl2284 bool = l >= 0 + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l } else { - yyb2135 = r.CheckBreak() + yyb2284 = r.CheckBreak() } - if yyb2135 { + if yyb2284 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2285 := &x.ObjectMeta + yyv2285.CodecDecodeSelf(d) + } + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l + } else { + yyb2284 = r.CheckBreak() + } + if yyb2284 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Secrets = nil + } else { + yyv2286 := &x.Secrets + yym2287 := z.DecBinary() + _ = yym2287 + if false { + } else { + h.decSliceObjectReference((*[]ObjectReference)(yyv2286), d) + } + } + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l + } else { + yyb2284 = r.CheckBreak() + } + if yyb2284 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ImagePullSecrets = nil + } else { + yyv2288 := &x.ImagePullSecrets + yym2289 := z.DecBinary() + _ = yym2289 + if false { + } else { + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2288), d) + } + } + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l + } else { + yyb2284 = r.CheckBreak() + } + if yyb2284 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27636,13 +29816,13 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l } else { - yyb2135 = r.CheckBreak() + yyb2284 = r.CheckBreak() } - if yyb2135 { + if yyb2284 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27652,79 +29832,18 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l - } else { - yyb2135 = r.CheckBreak() - } - if yyb2135 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2138 := &x.ObjectMeta - yyv2138.CodecDecodeSelf(d) - } - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l - } else { - yyb2135 = r.CheckBreak() - } - if yyb2135 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Secrets = nil - } else { - yyv2139 := &x.Secrets - yym2140 := z.DecBinary() - _ = yym2140 - if false { - } else { - h.decSliceObjectReference((*[]ObjectReference)(yyv2139), d) - } - } - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l - } else { - yyb2135 = r.CheckBreak() - } - if yyb2135 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ImagePullSecrets = nil - } else { - yyv2141 := &x.ImagePullSecrets - yym2142 := z.DecBinary() - _ = yym2142 - if false { - } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2141), d) - } - } for { - yyj2135++ - if yyhl2135 { - yyb2135 = yyj2135 > l + yyj2284++ + if yyhl2284 { + yyb2284 = yyj2284 > l } else { - yyb2135 = r.CheckBreak() + yyb2284 = r.CheckBreak() } - if yyb2135 { + if yyb2284 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2135-1, "") + z.DecStructFieldNotFound(yyj2284-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27736,118 +29855,68 @@ func (x *ServiceAccountList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2143 := z.EncBinary() - _ = yym2143 + yym2292 := z.EncBinary() + _ = yym2292 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2144 := !z.EncBinary() - yy2arr2144 := z.EncBasicHandle().StructToArray - var yyq2144 [4]bool - _, _, _ = yysep2144, yyq2144, yy2arr2144 - const yyr2144 bool = false - yyq2144[0] = x.Kind != "" - yyq2144[1] = x.APIVersion != "" - yyq2144[2] = true - var yynn2144 int - if yyr2144 || yy2arr2144 { + yysep2293 := !z.EncBinary() + yy2arr2293 := z.EncBasicHandle().StructToArray + var yyq2293 [4]bool + _, _, _ = yysep2293, yyq2293, yy2arr2293 + const yyr2293 bool = false + yyq2293[0] = true + yyq2293[2] = x.Kind != "" + yyq2293[3] = x.APIVersion != "" + var yynn2293 int + if yyr2293 || yy2arr2293 { r.EncodeArrayStart(4) } else { - yynn2144 = 1 - for _, b := range yyq2144 { + yynn2293 = 1 + for _, b := range yyq2293 { if b { - yynn2144++ + yynn2293++ } } - r.EncodeMapStart(yynn2144) - yynn2144 = 0 + r.EncodeMapStart(yynn2293) + yynn2293 = 0 } - if yyr2144 || yy2arr2144 { + if yyr2293 || yy2arr2293 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2144[0] { - yym2146 := z.EncBinary() - _ = yym2146 + if yyq2293[0] { + yy2295 := &x.ListMeta + yym2296 := z.EncBinary() + _ = yym2296 if false { + } else if z.HasExtensions() && z.EncExt(yy2295) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2144[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2147 := z.EncBinary() - _ = yym2147 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2144 || yy2arr2144 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2144[1] { - yym2149 := z.EncBinary() - _ = yym2149 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2144[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2150 := z.EncBinary() - _ = yym2150 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2144 || yy2arr2144 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2144[2] { - yy2152 := &x.ListMeta - yym2153 := z.EncBinary() - _ = yym2153 - if false { - } else if z.HasExtensions() && z.EncExt(yy2152) { - } else { - z.EncFallback(yy2152) + z.EncFallback(yy2295) } } else { r.EncodeNil() } } else { - if yyq2144[2] { + if yyq2293[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2154 := &x.ListMeta - yym2155 := z.EncBinary() - _ = yym2155 + yy2297 := &x.ListMeta + yym2298 := z.EncBinary() + _ = yym2298 if false { - } else if z.HasExtensions() && z.EncExt(yy2154) { + } else if z.HasExtensions() && z.EncExt(yy2297) { } else { - z.EncFallback(yy2154) + z.EncFallback(yy2297) } } } - if yyr2144 || yy2arr2144 { + if yyr2293 || yy2arr2293 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym2157 := z.EncBinary() - _ = yym2157 + yym2300 := z.EncBinary() + _ = yym2300 if false { } else { h.encSliceServiceAccount(([]ServiceAccount)(x.Items), e) @@ -27860,15 +29929,65 @@ func (x *ServiceAccountList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym2158 := z.EncBinary() - _ = yym2158 + yym2301 := z.EncBinary() + _ = yym2301 if false { } else { h.encSliceServiceAccount(([]ServiceAccount)(x.Items), e) } } } - if yyr2144 || yy2arr2144 { + if yyr2293 || yy2arr2293 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2293[2] { + yym2303 := z.EncBinary() + _ = yym2303 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2293[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2304 := z.EncBinary() + _ = yym2304 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2293 || yy2arr2293 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2293[3] { + yym2306 := z.EncBinary() + _ = yym2306 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2293[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2307 := z.EncBinary() + _ = yym2307 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2293 || yy2arr2293 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -27881,25 +30000,25 @@ func (x *ServiceAccountList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2159 := z.DecBinary() - _ = yym2159 + yym2308 := z.DecBinary() + _ = yym2308 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2160 := r.ContainerType() - if yyct2160 == codecSelferValueTypeMap1234 { - yyl2160 := r.ReadMapStart() - if yyl2160 == 0 { + yyct2309 := r.ContainerType() + if yyct2309 == codecSelferValueTypeMap1234 { + yyl2309 := r.ReadMapStart() + if yyl2309 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2160, d) + x.codecDecodeSelfFromMap(yyl2309, d) } - } else if yyct2160 == codecSelferValueTypeArray1234 { - yyl2160 := r.ReadArrayStart() - if yyl2160 == 0 { + } else if yyct2309 == codecSelferValueTypeArray1234 { + yyl2309 := r.ReadArrayStart() + if yyl2309 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2160, d) + x.codecDecodeSelfFromArray(yyl2309, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -27911,12 +30030,12 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2161Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2161Slc - var yyhl2161 bool = l >= 0 - for yyj2161 := 0; ; yyj2161++ { - if yyhl2161 { - if yyj2161 >= l { + var yys2310Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2310Slc + var yyhl2310 bool = l >= 0 + for yyj2310 := 0; ; yyj2310++ { + if yyhl2310 { + if yyj2310 >= l { break } } else { @@ -27925,10 +30044,35 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2161Slc = r.DecodeBytes(yys2161Slc, true, true) - yys2161 := string(yys2161Slc) + yys2310Slc = r.DecodeBytes(yys2310Slc, true, true) + yys2310 := string(yys2310Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2161 { + switch yys2310 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2311 := &x.ListMeta + yym2312 := z.DecBinary() + _ = yym2312 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2311) { + } else { + z.DecFallback(yyv2311, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2313 := &x.Items + yym2314 := z.DecBinary() + _ = yym2314 + if false { + } else { + h.decSliceServiceAccount((*[]ServiceAccount)(yyv2313), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27941,35 +30085,10 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2164 := &x.ListMeta - yym2165 := z.DecBinary() - _ = yym2165 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2164) { - } else { - z.DecFallback(yyv2164, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2166 := &x.Items - yym2167 := z.DecBinary() - _ = yym2167 - if false { - } else { - h.decSliceServiceAccount((*[]ServiceAccount)(yyv2166), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2161) - } // end switch yys2161 - } // end for yyj2161 + z.DecStructFieldNotFound(-1, yys2310) + } // end switch yys2310 + } // end for yyj2310 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27977,16 +30096,61 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2168 int - var yyb2168 bool - var yyhl2168 bool = l >= 0 - yyj2168++ - if yyhl2168 { - yyb2168 = yyj2168 > l + var yyj2317 int + var yyb2317 bool + var yyhl2317 bool = l >= 0 + yyj2317++ + if yyhl2317 { + yyb2317 = yyj2317 > l } else { - yyb2168 = r.CheckBreak() + yyb2317 = r.CheckBreak() } - if yyb2168 { + if yyb2317 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2318 := &x.ListMeta + yym2319 := z.DecBinary() + _ = yym2319 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2318) { + } else { + z.DecFallback(yyv2318, false) + } + } + yyj2317++ + if yyhl2317 { + yyb2317 = yyj2317 > l + } else { + yyb2317 = r.CheckBreak() + } + if yyb2317 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2320 := &x.Items + yym2321 := z.DecBinary() + _ = yym2321 + if false { + } else { + h.decSliceServiceAccount((*[]ServiceAccount)(yyv2320), d) + } + } + yyj2317++ + if yyhl2317 { + yyb2317 = yyj2317 > l + } else { + yyb2317 = r.CheckBreak() + } + if yyb2317 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27996,13 +30160,13 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Kind = string(r.DecodeString()) } - yyj2168++ - if yyhl2168 { - yyb2168 = yyj2168 > l + yyj2317++ + if yyhl2317 { + yyb2317 = yyj2317 > l } else { - yyb2168 = r.CheckBreak() + yyb2317 = r.CheckBreak() } - if yyb2168 { + if yyb2317 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28012,63 +30176,18 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.APIVersion = string(r.DecodeString()) } - yyj2168++ - if yyhl2168 { - yyb2168 = yyj2168 > l - } else { - yyb2168 = r.CheckBreak() - } - if yyb2168 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2171 := &x.ListMeta - yym2172 := z.DecBinary() - _ = yym2172 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2171) { - } else { - z.DecFallback(yyv2171, false) - } - } - yyj2168++ - if yyhl2168 { - yyb2168 = yyj2168 > l - } else { - yyb2168 = r.CheckBreak() - } - if yyb2168 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2173 := &x.Items - yym2174 := z.DecBinary() - _ = yym2174 - if false { - } else { - h.decSliceServiceAccount((*[]ServiceAccount)(yyv2173), d) - } - } for { - yyj2168++ - if yyhl2168 { - yyb2168 = yyj2168 > l + yyj2317++ + if yyhl2317 { + yyb2317 = yyj2317 > l } else { - yyb2168 = r.CheckBreak() + yyb2317 = r.CheckBreak() } - if yyb2168 { + if yyb2317 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2168-1, "") + z.DecStructFieldNotFound(yyj2317-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28080,106 +30199,56 @@ func (x *Endpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2175 := z.EncBinary() - _ = yym2175 + yym2324 := z.EncBinary() + _ = yym2324 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2176 := !z.EncBinary() - yy2arr2176 := z.EncBasicHandle().StructToArray - var yyq2176 [4]bool - _, _, _ = yysep2176, yyq2176, yy2arr2176 - const yyr2176 bool = false - yyq2176[0] = x.Kind != "" - yyq2176[1] = x.APIVersion != "" - yyq2176[2] = true - var yynn2176 int - if yyr2176 || yy2arr2176 { + yysep2325 := !z.EncBinary() + yy2arr2325 := z.EncBasicHandle().StructToArray + var yyq2325 [4]bool + _, _, _ = yysep2325, yyq2325, yy2arr2325 + const yyr2325 bool = false + yyq2325[0] = true + yyq2325[2] = x.Kind != "" + yyq2325[3] = x.APIVersion != "" + var yynn2325 int + if yyr2325 || yy2arr2325 { r.EncodeArrayStart(4) } else { - yynn2176 = 1 - for _, b := range yyq2176 { + yynn2325 = 1 + for _, b := range yyq2325 { if b { - yynn2176++ + yynn2325++ } } - r.EncodeMapStart(yynn2176) - yynn2176 = 0 + r.EncodeMapStart(yynn2325) + yynn2325 = 0 } - if yyr2176 || yy2arr2176 { + if yyr2325 || yy2arr2325 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2176[0] { - yym2178 := z.EncBinary() - _ = yym2178 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2176[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2179 := z.EncBinary() - _ = yym2179 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2176 || yy2arr2176 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2176[1] { - yym2181 := z.EncBinary() - _ = yym2181 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2176[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2182 := z.EncBinary() - _ = yym2182 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2176 || yy2arr2176 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2176[2] { - yy2184 := &x.ObjectMeta - yy2184.CodecEncodeSelf(e) + if yyq2325[0] { + yy2327 := &x.ObjectMeta + yy2327.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2176[2] { + if yyq2325[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2185 := &x.ObjectMeta - yy2185.CodecEncodeSelf(e) + yy2328 := &x.ObjectMeta + yy2328.CodecEncodeSelf(e) } } - if yyr2176 || yy2arr2176 { + if yyr2325 || yy2arr2325 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Subsets == nil { r.EncodeNil() } else { - yym2187 := z.EncBinary() - _ = yym2187 + yym2330 := z.EncBinary() + _ = yym2330 if false { } else { h.encSliceEndpointSubset(([]EndpointSubset)(x.Subsets), e) @@ -28192,15 +30261,65 @@ func (x *Endpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x.Subsets == nil { r.EncodeNil() } else { - yym2188 := z.EncBinary() - _ = yym2188 + yym2331 := z.EncBinary() + _ = yym2331 if false { } else { h.encSliceEndpointSubset(([]EndpointSubset)(x.Subsets), e) } } } - if yyr2176 || yy2arr2176 { + if yyr2325 || yy2arr2325 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2325[2] { + yym2333 := z.EncBinary() + _ = yym2333 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2325[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2334 := z.EncBinary() + _ = yym2334 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2325 || yy2arr2325 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2325[3] { + yym2336 := z.EncBinary() + _ = yym2336 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2325[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2337 := z.EncBinary() + _ = yym2337 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2325 || yy2arr2325 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28213,25 +30332,25 @@ func (x *Endpoints) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2189 := z.DecBinary() - _ = yym2189 + yym2338 := z.DecBinary() + _ = yym2338 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2190 := r.ContainerType() - if yyct2190 == codecSelferValueTypeMap1234 { - yyl2190 := r.ReadMapStart() - if yyl2190 == 0 { + yyct2339 := r.ContainerType() + if yyct2339 == codecSelferValueTypeMap1234 { + yyl2339 := r.ReadMapStart() + if yyl2339 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2190, d) + x.codecDecodeSelfFromMap(yyl2339, d) } - } else if yyct2190 == codecSelferValueTypeArray1234 { - yyl2190 := r.ReadArrayStart() - if yyl2190 == 0 { + } else if yyct2339 == codecSelferValueTypeArray1234 { + yyl2339 := r.ReadArrayStart() + if yyl2339 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2190, d) + x.codecDecodeSelfFromArray(yyl2339, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28243,12 +30362,12 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2191Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2191Slc - var yyhl2191 bool = l >= 0 - for yyj2191 := 0; ; yyj2191++ { - if yyhl2191 { - if yyj2191 >= l { + var yys2340Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2340Slc + var yyhl2340 bool = l >= 0 + for yyj2340 := 0; ; yyj2340++ { + if yyhl2340 { + if yyj2340 >= l { break } } else { @@ -28257,10 +30376,29 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2191Slc = r.DecodeBytes(yys2191Slc, true, true) - yys2191 := string(yys2191Slc) + yys2340Slc = r.DecodeBytes(yys2340Slc, true, true) + yys2340 := string(yys2340Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2191 { + switch yys2340 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2341 := &x.ObjectMeta + yyv2341.CodecDecodeSelf(d) + } + case "Subsets": + if r.TryDecodeAsNil() { + x.Subsets = nil + } else { + yyv2342 := &x.Subsets + yym2343 := z.DecBinary() + _ = yym2343 + if false { + } else { + h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2342), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -28273,29 +30411,10 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2194 := &x.ObjectMeta - yyv2194.CodecDecodeSelf(d) - } - case "Subsets": - if r.TryDecodeAsNil() { - x.Subsets = nil - } else { - yyv2195 := &x.Subsets - yym2196 := z.DecBinary() - _ = yym2196 - if false { - } else { - h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2195), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2191) - } // end switch yys2191 - } // end for yyj2191 + z.DecStructFieldNotFound(-1, yys2340) + } // end switch yys2340 + } // end for yyj2340 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28303,16 +30422,55 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2197 int - var yyb2197 bool - var yyhl2197 bool = l >= 0 - yyj2197++ - if yyhl2197 { - yyb2197 = yyj2197 > l + var yyj2346 int + var yyb2346 bool + var yyhl2346 bool = l >= 0 + yyj2346++ + if yyhl2346 { + yyb2346 = yyj2346 > l } else { - yyb2197 = r.CheckBreak() + yyb2346 = r.CheckBreak() } - if yyb2197 { + if yyb2346 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2347 := &x.ObjectMeta + yyv2347.CodecDecodeSelf(d) + } + yyj2346++ + if yyhl2346 { + yyb2346 = yyj2346 > l + } else { + yyb2346 = r.CheckBreak() + } + if yyb2346 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Subsets = nil + } else { + yyv2348 := &x.Subsets + yym2349 := z.DecBinary() + _ = yym2349 + if false { + } else { + h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2348), d) + } + } + yyj2346++ + if yyhl2346 { + yyb2346 = yyj2346 > l + } else { + yyb2346 = r.CheckBreak() + } + if yyb2346 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28322,13 +30480,13 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2197++ - if yyhl2197 { - yyb2197 = yyj2197 > l + yyj2346++ + if yyhl2346 { + yyb2346 = yyj2346 > l } else { - yyb2197 = r.CheckBreak() + yyb2346 = r.CheckBreak() } - if yyb2197 { + if yyb2346 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28338,57 +30496,18 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2197++ - if yyhl2197 { - yyb2197 = yyj2197 > l - } else { - yyb2197 = r.CheckBreak() - } - if yyb2197 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2200 := &x.ObjectMeta - yyv2200.CodecDecodeSelf(d) - } - yyj2197++ - if yyhl2197 { - yyb2197 = yyj2197 > l - } else { - yyb2197 = r.CheckBreak() - } - if yyb2197 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Subsets = nil - } else { - yyv2201 := &x.Subsets - yym2202 := z.DecBinary() - _ = yym2202 - if false { - } else { - h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2201), d) - } - } for { - yyj2197++ - if yyhl2197 { - yyb2197 = yyj2197 > l + yyj2346++ + if yyhl2346 { + yyb2346 = yyj2346 > l } else { - yyb2197 = r.CheckBreak() + yyb2346 = r.CheckBreak() } - if yyb2197 { + if yyb2346 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2197-1, "") + z.DecStructFieldNotFound(yyj2346-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28400,36 +30519,36 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2203 := z.EncBinary() - _ = yym2203 + yym2352 := z.EncBinary() + _ = yym2352 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2204 := !z.EncBinary() - yy2arr2204 := z.EncBasicHandle().StructToArray - var yyq2204 [3]bool - _, _, _ = yysep2204, yyq2204, yy2arr2204 - const yyr2204 bool = false - var yynn2204 int - if yyr2204 || yy2arr2204 { + yysep2353 := !z.EncBinary() + yy2arr2353 := z.EncBasicHandle().StructToArray + var yyq2353 [3]bool + _, _, _ = yysep2353, yyq2353, yy2arr2353 + const yyr2353 bool = false + var yynn2353 int + if yyr2353 || yy2arr2353 { r.EncodeArrayStart(3) } else { - yynn2204 = 3 - for _, b := range yyq2204 { + yynn2353 = 3 + for _, b := range yyq2353 { if b { - yynn2204++ + yynn2353++ } } - r.EncodeMapStart(yynn2204) - yynn2204 = 0 + r.EncodeMapStart(yynn2353) + yynn2353 = 0 } - if yyr2204 || yy2arr2204 { + if yyr2353 || yy2arr2353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Addresses == nil { r.EncodeNil() } else { - yym2206 := z.EncBinary() - _ = yym2206 + yym2355 := z.EncBinary() + _ = yym2355 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.Addresses), e) @@ -28442,21 +30561,21 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { if x.Addresses == nil { r.EncodeNil() } else { - yym2207 := z.EncBinary() - _ = yym2207 + yym2356 := z.EncBinary() + _ = yym2356 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.Addresses), e) } } } - if yyr2204 || yy2arr2204 { + if yyr2353 || yy2arr2353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.NotReadyAddresses == nil { r.EncodeNil() } else { - yym2209 := z.EncBinary() - _ = yym2209 + yym2358 := z.EncBinary() + _ = yym2358 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.NotReadyAddresses), e) @@ -28469,21 +30588,21 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { if x.NotReadyAddresses == nil { r.EncodeNil() } else { - yym2210 := z.EncBinary() - _ = yym2210 + yym2359 := z.EncBinary() + _ = yym2359 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.NotReadyAddresses), e) } } } - if yyr2204 || yy2arr2204 { + if yyr2353 || yy2arr2353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Ports == nil { r.EncodeNil() } else { - yym2212 := z.EncBinary() - _ = yym2212 + yym2361 := z.EncBinary() + _ = yym2361 if false { } else { h.encSliceEndpointPort(([]EndpointPort)(x.Ports), e) @@ -28496,15 +30615,15 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { if x.Ports == nil { r.EncodeNil() } else { - yym2213 := z.EncBinary() - _ = yym2213 + yym2362 := z.EncBinary() + _ = yym2362 if false { } else { h.encSliceEndpointPort(([]EndpointPort)(x.Ports), e) } } } - if yyr2204 || yy2arr2204 { + if yyr2353 || yy2arr2353 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28517,25 +30636,25 @@ func (x *EndpointSubset) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2214 := z.DecBinary() - _ = yym2214 + yym2363 := z.DecBinary() + _ = yym2363 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2215 := r.ContainerType() - if yyct2215 == codecSelferValueTypeMap1234 { - yyl2215 := r.ReadMapStart() - if yyl2215 == 0 { + yyct2364 := r.ContainerType() + if yyct2364 == codecSelferValueTypeMap1234 { + yyl2364 := r.ReadMapStart() + if yyl2364 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2215, d) + x.codecDecodeSelfFromMap(yyl2364, d) } - } else if yyct2215 == codecSelferValueTypeArray1234 { - yyl2215 := r.ReadArrayStart() - if yyl2215 == 0 { + } else if yyct2364 == codecSelferValueTypeArray1234 { + yyl2364 := r.ReadArrayStart() + if yyl2364 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2215, d) + x.codecDecodeSelfFromArray(yyl2364, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28547,12 +30666,12 @@ func (x *EndpointSubset) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2216Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2216Slc - var yyhl2216 bool = l >= 0 - for yyj2216 := 0; ; yyj2216++ { - if yyhl2216 { - if yyj2216 >= l { + var yys2365Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2365Slc + var yyhl2365 bool = l >= 0 + for yyj2365 := 0; ; yyj2365++ { + if yyhl2365 { + if yyj2365 >= l { break } } else { @@ -28561,50 +30680,50 @@ func (x *EndpointSubset) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2216Slc = r.DecodeBytes(yys2216Slc, true, true) - yys2216 := string(yys2216Slc) + yys2365Slc = r.DecodeBytes(yys2365Slc, true, true) + yys2365 := string(yys2365Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2216 { + switch yys2365 { case "Addresses": if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2217 := &x.Addresses - yym2218 := z.DecBinary() - _ = yym2218 + yyv2366 := &x.Addresses + yym2367 := z.DecBinary() + _ = yym2367 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2217), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2366), d) } } case "NotReadyAddresses": if r.TryDecodeAsNil() { x.NotReadyAddresses = nil } else { - yyv2219 := &x.NotReadyAddresses - yym2220 := z.DecBinary() - _ = yym2220 + yyv2368 := &x.NotReadyAddresses + yym2369 := z.DecBinary() + _ = yym2369 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2219), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2368), d) } } case "Ports": if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2221 := &x.Ports - yym2222 := z.DecBinary() - _ = yym2222 + yyv2370 := &x.Ports + yym2371 := z.DecBinary() + _ = yym2371 if false { } else { - h.decSliceEndpointPort((*[]EndpointPort)(yyv2221), d) + h.decSliceEndpointPort((*[]EndpointPort)(yyv2370), d) } } default: - z.DecStructFieldNotFound(-1, yys2216) - } // end switch yys2216 - } // end for yyj2216 + z.DecStructFieldNotFound(-1, yys2365) + } // end switch yys2365 + } // end for yyj2365 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28612,16 +30731,16 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2223 int - var yyb2223 bool - var yyhl2223 bool = l >= 0 - yyj2223++ - if yyhl2223 { - yyb2223 = yyj2223 > l + var yyj2372 int + var yyb2372 bool + var yyhl2372 bool = l >= 0 + yyj2372++ + if yyhl2372 { + yyb2372 = yyj2372 > l } else { - yyb2223 = r.CheckBreak() + yyb2372 = r.CheckBreak() } - if yyb2223 { + if yyb2372 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28629,21 +30748,21 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2224 := &x.Addresses - yym2225 := z.DecBinary() - _ = yym2225 + yyv2373 := &x.Addresses + yym2374 := z.DecBinary() + _ = yym2374 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2224), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2373), d) } } - yyj2223++ - if yyhl2223 { - yyb2223 = yyj2223 > l + yyj2372++ + if yyhl2372 { + yyb2372 = yyj2372 > l } else { - yyb2223 = r.CheckBreak() + yyb2372 = r.CheckBreak() } - if yyb2223 { + if yyb2372 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28651,21 +30770,21 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NotReadyAddresses = nil } else { - yyv2226 := &x.NotReadyAddresses - yym2227 := z.DecBinary() - _ = yym2227 + yyv2375 := &x.NotReadyAddresses + yym2376 := z.DecBinary() + _ = yym2376 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2226), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2375), d) } } - yyj2223++ - if yyhl2223 { - yyb2223 = yyj2223 > l + yyj2372++ + if yyhl2372 { + yyb2372 = yyj2372 > l } else { - yyb2223 = r.CheckBreak() + yyb2372 = r.CheckBreak() } - if yyb2223 { + if yyb2372 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28673,26 +30792,26 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2228 := &x.Ports - yym2229 := z.DecBinary() - _ = yym2229 + yyv2377 := &x.Ports + yym2378 := z.DecBinary() + _ = yym2378 if false { } else { - h.decSliceEndpointPort((*[]EndpointPort)(yyv2228), d) + h.decSliceEndpointPort((*[]EndpointPort)(yyv2377), d) } } for { - yyj2223++ - if yyhl2223 { - yyb2223 = yyj2223 > l + yyj2372++ + if yyhl2372 { + yyb2372 = yyj2372 > l } else { - yyb2223 = r.CheckBreak() + yyb2372 = r.CheckBreak() } - if yyb2223 { + if yyb2372 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2223-1, "") + z.DecStructFieldNotFound(yyj2372-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28704,33 +30823,33 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2230 := z.EncBinary() - _ = yym2230 + yym2379 := z.EncBinary() + _ = yym2379 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2231 := !z.EncBinary() - yy2arr2231 := z.EncBasicHandle().StructToArray - var yyq2231 [2]bool - _, _, _ = yysep2231, yyq2231, yy2arr2231 - const yyr2231 bool = false - var yynn2231 int - if yyr2231 || yy2arr2231 { + yysep2380 := !z.EncBinary() + yy2arr2380 := z.EncBasicHandle().StructToArray + var yyq2380 [2]bool + _, _, _ = yysep2380, yyq2380, yy2arr2380 + const yyr2380 bool = false + var yynn2380 int + if yyr2380 || yy2arr2380 { r.EncodeArrayStart(2) } else { - yynn2231 = 2 - for _, b := range yyq2231 { + yynn2380 = 2 + for _, b := range yyq2380 { if b { - yynn2231++ + yynn2380++ } } - r.EncodeMapStart(yynn2231) - yynn2231 = 0 + r.EncodeMapStart(yynn2380) + yynn2380 = 0 } - if yyr2231 || yy2arr2231 { + if yyr2380 || yy2arr2380 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2233 := z.EncBinary() - _ = yym2233 + yym2382 := z.EncBinary() + _ = yym2382 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) @@ -28739,14 +30858,14 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("IP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2234 := z.EncBinary() - _ = yym2234 + yym2383 := z.EncBinary() + _ = yym2383 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) } } - if yyr2231 || yy2arr2231 { + if yyr2380 || yy2arr2380 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TargetRef == nil { r.EncodeNil() @@ -28763,7 +30882,7 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { x.TargetRef.CodecEncodeSelf(e) } } - if yyr2231 || yy2arr2231 { + if yyr2380 || yy2arr2380 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28776,25 +30895,25 @@ func (x *EndpointAddress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2236 := z.DecBinary() - _ = yym2236 + yym2385 := z.DecBinary() + _ = yym2385 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2237 := r.ContainerType() - if yyct2237 == codecSelferValueTypeMap1234 { - yyl2237 := r.ReadMapStart() - if yyl2237 == 0 { + yyct2386 := r.ContainerType() + if yyct2386 == codecSelferValueTypeMap1234 { + yyl2386 := r.ReadMapStart() + if yyl2386 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2237, d) + x.codecDecodeSelfFromMap(yyl2386, d) } - } else if yyct2237 == codecSelferValueTypeArray1234 { - yyl2237 := r.ReadArrayStart() - if yyl2237 == 0 { + } else if yyct2386 == codecSelferValueTypeArray1234 { + yyl2386 := r.ReadArrayStart() + if yyl2386 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2237, d) + x.codecDecodeSelfFromArray(yyl2386, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28806,12 +30925,12 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2238Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2238Slc - var yyhl2238 bool = l >= 0 - for yyj2238 := 0; ; yyj2238++ { - if yyhl2238 { - if yyj2238 >= l { + var yys2387Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2387Slc + var yyhl2387 bool = l >= 0 + for yyj2387 := 0; ; yyj2387++ { + if yyhl2387 { + if yyj2387 >= l { break } } else { @@ -28820,10 +30939,10 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2238Slc = r.DecodeBytes(yys2238Slc, true, true) - yys2238 := string(yys2238Slc) + yys2387Slc = r.DecodeBytes(yys2387Slc, true, true) + yys2387 := string(yys2387Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2238 { + switch yys2387 { case "IP": if r.TryDecodeAsNil() { x.IP = "" @@ -28842,9 +30961,9 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TargetRef.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys2238) - } // end switch yys2238 - } // end for yyj2238 + z.DecStructFieldNotFound(-1, yys2387) + } // end switch yys2387 + } // end for yyj2387 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28852,16 +30971,16 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2241 int - var yyb2241 bool - var yyhl2241 bool = l >= 0 - yyj2241++ - if yyhl2241 { - yyb2241 = yyj2241 > l + var yyj2390 int + var yyb2390 bool + var yyhl2390 bool = l >= 0 + yyj2390++ + if yyhl2390 { + yyb2390 = yyj2390 > l } else { - yyb2241 = r.CheckBreak() + yyb2390 = r.CheckBreak() } - if yyb2241 { + if yyb2390 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28871,13 +30990,13 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.IP = string(r.DecodeString()) } - yyj2241++ - if yyhl2241 { - yyb2241 = yyj2241 > l + yyj2390++ + if yyhl2390 { + yyb2390 = yyj2390 > l } else { - yyb2241 = r.CheckBreak() + yyb2390 = r.CheckBreak() } - if yyb2241 { + if yyb2390 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28893,17 +31012,17 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.TargetRef.CodecDecodeSelf(d) } for { - yyj2241++ - if yyhl2241 { - yyb2241 = yyj2241 > l + yyj2390++ + if yyhl2390 { + yyb2390 = yyj2390 > l } else { - yyb2241 = r.CheckBreak() + yyb2390 = r.CheckBreak() } - if yyb2241 { + if yyb2390 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2241-1, "") + z.DecStructFieldNotFound(yyj2390-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28915,33 +31034,33 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2244 := z.EncBinary() - _ = yym2244 + yym2393 := z.EncBinary() + _ = yym2393 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2245 := !z.EncBinary() - yy2arr2245 := z.EncBasicHandle().StructToArray - var yyq2245 [3]bool - _, _, _ = yysep2245, yyq2245, yy2arr2245 - const yyr2245 bool = false - var yynn2245 int - if yyr2245 || yy2arr2245 { + yysep2394 := !z.EncBinary() + yy2arr2394 := z.EncBasicHandle().StructToArray + var yyq2394 [3]bool + _, _, _ = yysep2394, yyq2394, yy2arr2394 + const yyr2394 bool = false + var yynn2394 int + if yyr2394 || yy2arr2394 { r.EncodeArrayStart(3) } else { - yynn2245 = 3 - for _, b := range yyq2245 { + yynn2394 = 3 + for _, b := range yyq2394 { if b { - yynn2245++ + yynn2394++ } } - r.EncodeMapStart(yynn2245) - yynn2245 = 0 + r.EncodeMapStart(yynn2394) + yynn2394 = 0 } - if yyr2245 || yy2arr2245 { + if yyr2394 || yy2arr2394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2247 := z.EncBinary() - _ = yym2247 + yym2396 := z.EncBinary() + _ = yym2396 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -28950,17 +31069,17 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2248 := z.EncBinary() - _ = yym2248 + yym2397 := z.EncBinary() + _ = yym2397 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr2245 || yy2arr2245 { + if yyr2394 || yy2arr2394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2250 := z.EncBinary() - _ = yym2250 + yym2399 := z.EncBinary() + _ = yym2399 if false { } else { r.EncodeInt(int64(x.Port)) @@ -28969,14 +31088,14 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2251 := z.EncBinary() - _ = yym2251 + yym2400 := z.EncBinary() + _ = yym2400 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2245 || yy2arr2245 { + if yyr2394 || yy2arr2394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Protocol.CodecEncodeSelf(e) } else { @@ -28985,7 +31104,7 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } - if yyr2245 || yy2arr2245 { + if yyr2394 || yy2arr2394 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28998,25 +31117,25 @@ func (x *EndpointPort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2253 := z.DecBinary() - _ = yym2253 + yym2402 := z.DecBinary() + _ = yym2402 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2254 := r.ContainerType() - if yyct2254 == codecSelferValueTypeMap1234 { - yyl2254 := r.ReadMapStart() - if yyl2254 == 0 { + yyct2403 := r.ContainerType() + if yyct2403 == codecSelferValueTypeMap1234 { + yyl2403 := r.ReadMapStart() + if yyl2403 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2254, d) + x.codecDecodeSelfFromMap(yyl2403, d) } - } else if yyct2254 == codecSelferValueTypeArray1234 { - yyl2254 := r.ReadArrayStart() - if yyl2254 == 0 { + } else if yyct2403 == codecSelferValueTypeArray1234 { + yyl2403 := r.ReadArrayStart() + if yyl2403 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2254, d) + x.codecDecodeSelfFromArray(yyl2403, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29028,12 +31147,12 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2255Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2255Slc - var yyhl2255 bool = l >= 0 - for yyj2255 := 0; ; yyj2255++ { - if yyhl2255 { - if yyj2255 >= l { + var yys2404Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2404Slc + var yyhl2404 bool = l >= 0 + for yyj2404 := 0; ; yyj2404++ { + if yyhl2404 { + if yyj2404 >= l { break } } else { @@ -29042,10 +31161,10 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2255Slc = r.DecodeBytes(yys2255Slc, true, true) - yys2255 := string(yys2255Slc) + yys2404Slc = r.DecodeBytes(yys2404Slc, true, true) + yys2404 := string(yys2404Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2255 { + switch yys2404 { case "Name": if r.TryDecodeAsNil() { x.Name = "" @@ -29065,9 +31184,9 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Protocol = Protocol(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2255) - } // end switch yys2255 - } // end for yyj2255 + z.DecStructFieldNotFound(-1, yys2404) + } // end switch yys2404 + } // end for yyj2404 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29075,16 +31194,16 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2259 int - var yyb2259 bool - var yyhl2259 bool = l >= 0 - yyj2259++ - if yyhl2259 { - yyb2259 = yyj2259 > l + var yyj2408 int + var yyb2408 bool + var yyhl2408 bool = l >= 0 + yyj2408++ + if yyhl2408 { + yyb2408 = yyj2408 > l } else { - yyb2259 = r.CheckBreak() + yyb2408 = r.CheckBreak() } - if yyb2259 { + if yyb2408 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29094,13 +31213,13 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj2259++ - if yyhl2259 { - yyb2259 = yyj2259 > l + yyj2408++ + if yyhl2408 { + yyb2408 = yyj2408 > l } else { - yyb2259 = r.CheckBreak() + yyb2408 = r.CheckBreak() } - if yyb2259 { + if yyb2408 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29110,13 +31229,13 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Port = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj2259++ - if yyhl2259 { - yyb2259 = yyj2259 > l + yyj2408++ + if yyhl2408 { + yyb2408 = yyj2408 > l } else { - yyb2259 = r.CheckBreak() + yyb2408 = r.CheckBreak() } - if yyb2259 { + if yyb2408 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29127,17 +31246,17 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Protocol = Protocol(r.DecodeString()) } for { - yyj2259++ - if yyhl2259 { - yyb2259 = yyj2259 > l + yyj2408++ + if yyhl2408 { + yyb2408 = yyj2408 > l } else { - yyb2259 = r.CheckBreak() + yyb2408 = r.CheckBreak() } - if yyb2259 { + if yyb2408 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2259-1, "") + z.DecStructFieldNotFound(yyj2408-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29149,118 +31268,68 @@ func (x *EndpointsList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2263 := z.EncBinary() - _ = yym2263 + yym2412 := z.EncBinary() + _ = yym2412 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2264 := !z.EncBinary() - yy2arr2264 := z.EncBasicHandle().StructToArray - var yyq2264 [4]bool - _, _, _ = yysep2264, yyq2264, yy2arr2264 - const yyr2264 bool = false - yyq2264[0] = x.Kind != "" - yyq2264[1] = x.APIVersion != "" - yyq2264[2] = true - var yynn2264 int - if yyr2264 || yy2arr2264 { + yysep2413 := !z.EncBinary() + yy2arr2413 := z.EncBasicHandle().StructToArray + var yyq2413 [4]bool + _, _, _ = yysep2413, yyq2413, yy2arr2413 + const yyr2413 bool = false + yyq2413[0] = true + yyq2413[2] = x.Kind != "" + yyq2413[3] = x.APIVersion != "" + var yynn2413 int + if yyr2413 || yy2arr2413 { r.EncodeArrayStart(4) } else { - yynn2264 = 1 - for _, b := range yyq2264 { + yynn2413 = 1 + for _, b := range yyq2413 { if b { - yynn2264++ + yynn2413++ } } - r.EncodeMapStart(yynn2264) - yynn2264 = 0 + r.EncodeMapStart(yynn2413) + yynn2413 = 0 } - if yyr2264 || yy2arr2264 { + if yyr2413 || yy2arr2413 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2264[0] { - yym2266 := z.EncBinary() - _ = yym2266 + if yyq2413[0] { + yy2415 := &x.ListMeta + yym2416 := z.EncBinary() + _ = yym2416 if false { + } else if z.HasExtensions() && z.EncExt(yy2415) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2264[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2267 := z.EncBinary() - _ = yym2267 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2264 || yy2arr2264 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2264[1] { - yym2269 := z.EncBinary() - _ = yym2269 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2264[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2270 := z.EncBinary() - _ = yym2270 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2264 || yy2arr2264 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2264[2] { - yy2272 := &x.ListMeta - yym2273 := z.EncBinary() - _ = yym2273 - if false { - } else if z.HasExtensions() && z.EncExt(yy2272) { - } else { - z.EncFallback(yy2272) + z.EncFallback(yy2415) } } else { r.EncodeNil() } } else { - if yyq2264[2] { + if yyq2413[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2274 := &x.ListMeta - yym2275 := z.EncBinary() - _ = yym2275 + yy2417 := &x.ListMeta + yym2418 := z.EncBinary() + _ = yym2418 if false { - } else if z.HasExtensions() && z.EncExt(yy2274) { + } else if z.HasExtensions() && z.EncExt(yy2417) { } else { - z.EncFallback(yy2274) + z.EncFallback(yy2417) } } } - if yyr2264 || yy2arr2264 { + if yyr2413 || yy2arr2413 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym2277 := z.EncBinary() - _ = yym2277 + yym2420 := z.EncBinary() + _ = yym2420 if false { } else { h.encSliceEndpoints(([]Endpoints)(x.Items), e) @@ -29273,15 +31342,65 @@ func (x *EndpointsList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym2278 := z.EncBinary() - _ = yym2278 + yym2421 := z.EncBinary() + _ = yym2421 if false { } else { h.encSliceEndpoints(([]Endpoints)(x.Items), e) } } } - if yyr2264 || yy2arr2264 { + if yyr2413 || yy2arr2413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2413[2] { + yym2423 := z.EncBinary() + _ = yym2423 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2413[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2424 := z.EncBinary() + _ = yym2424 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2413 || yy2arr2413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2413[3] { + yym2426 := z.EncBinary() + _ = yym2426 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2413[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2427 := z.EncBinary() + _ = yym2427 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2413 || yy2arr2413 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29294,25 +31413,25 @@ func (x *EndpointsList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2279 := z.DecBinary() - _ = yym2279 + yym2428 := z.DecBinary() + _ = yym2428 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2280 := r.ContainerType() - if yyct2280 == codecSelferValueTypeMap1234 { - yyl2280 := r.ReadMapStart() - if yyl2280 == 0 { + yyct2429 := r.ContainerType() + if yyct2429 == codecSelferValueTypeMap1234 { + yyl2429 := r.ReadMapStart() + if yyl2429 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2280, d) + x.codecDecodeSelfFromMap(yyl2429, d) } - } else if yyct2280 == codecSelferValueTypeArray1234 { - yyl2280 := r.ReadArrayStart() - if yyl2280 == 0 { + } else if yyct2429 == codecSelferValueTypeArray1234 { + yyl2429 := r.ReadArrayStart() + if yyl2429 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2280, d) + x.codecDecodeSelfFromArray(yyl2429, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29324,12 +31443,12 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2281Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2281Slc - var yyhl2281 bool = l >= 0 - for yyj2281 := 0; ; yyj2281++ { - if yyhl2281 { - if yyj2281 >= l { + var yys2430Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2430Slc + var yyhl2430 bool = l >= 0 + for yyj2430 := 0; ; yyj2430++ { + if yyhl2430 { + if yyj2430 >= l { break } } else { @@ -29338,10 +31457,35 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2281Slc = r.DecodeBytes(yys2281Slc, true, true) - yys2281 := string(yys2281Slc) + yys2430Slc = r.DecodeBytes(yys2430Slc, true, true) + yys2430 := string(yys2430Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2281 { + switch yys2430 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2431 := &x.ListMeta + yym2432 := z.DecBinary() + _ = yym2432 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2431) { + } else { + z.DecFallback(yyv2431, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2433 := &x.Items + yym2434 := z.DecBinary() + _ = yym2434 + if false { + } else { + h.decSliceEndpoints((*[]Endpoints)(yyv2433), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -29354,35 +31498,10 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2284 := &x.ListMeta - yym2285 := z.DecBinary() - _ = yym2285 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2284) { - } else { - z.DecFallback(yyv2284, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2286 := &x.Items - yym2287 := z.DecBinary() - _ = yym2287 - if false { - } else { - h.decSliceEndpoints((*[]Endpoints)(yyv2286), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2281) - } // end switch yys2281 - } // end for yyj2281 + z.DecStructFieldNotFound(-1, yys2430) + } // end switch yys2430 + } // end for yyj2430 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29390,16 +31509,61 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2288 int - var yyb2288 bool - var yyhl2288 bool = l >= 0 - yyj2288++ - if yyhl2288 { - yyb2288 = yyj2288 > l + var yyj2437 int + var yyb2437 bool + var yyhl2437 bool = l >= 0 + yyj2437++ + if yyhl2437 { + yyb2437 = yyj2437 > l } else { - yyb2288 = r.CheckBreak() + yyb2437 = r.CheckBreak() } - if yyb2288 { + if yyb2437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2438 := &x.ListMeta + yym2439 := z.DecBinary() + _ = yym2439 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2438) { + } else { + z.DecFallback(yyv2438, false) + } + } + yyj2437++ + if yyhl2437 { + yyb2437 = yyj2437 > l + } else { + yyb2437 = r.CheckBreak() + } + if yyb2437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2440 := &x.Items + yym2441 := z.DecBinary() + _ = yym2441 + if false { + } else { + h.decSliceEndpoints((*[]Endpoints)(yyv2440), d) + } + } + yyj2437++ + if yyhl2437 { + yyb2437 = yyj2437 > l + } else { + yyb2437 = r.CheckBreak() + } + if yyb2437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29409,13 +31573,13 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2288++ - if yyhl2288 { - yyb2288 = yyj2288 > l + yyj2437++ + if yyhl2437 { + yyb2437 = yyj2437 > l } else { - yyb2288 = r.CheckBreak() + yyb2437 = r.CheckBreak() } - if yyb2288 { + if yyb2437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29425,63 +31589,18 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2288++ - if yyhl2288 { - yyb2288 = yyj2288 > l - } else { - yyb2288 = r.CheckBreak() - } - if yyb2288 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2291 := &x.ListMeta - yym2292 := z.DecBinary() - _ = yym2292 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2291) { - } else { - z.DecFallback(yyv2291, false) - } - } - yyj2288++ - if yyhl2288 { - yyb2288 = yyj2288 > l - } else { - yyb2288 = r.CheckBreak() - } - if yyb2288 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2293 := &x.Items - yym2294 := z.DecBinary() - _ = yym2294 - if false { - } else { - h.decSliceEndpoints((*[]Endpoints)(yyv2293), d) - } - } for { - yyj2288++ - if yyhl2288 { - yyb2288 = yyj2288 > l + yyj2437++ + if yyhl2437 { + yyb2437 = yyj2437 > l } else { - yyb2288 = r.CheckBreak() + yyb2437 = r.CheckBreak() } - if yyb2288 { + if yyb2437 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2288-1, "") + z.DecStructFieldNotFound(yyj2437-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29493,38 +31612,38 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2295 := z.EncBinary() - _ = yym2295 + yym2444 := z.EncBinary() + _ = yym2444 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2296 := !z.EncBinary() - yy2arr2296 := z.EncBasicHandle().StructToArray - var yyq2296 [4]bool - _, _, _ = yysep2296, yyq2296, yy2arr2296 - const yyr2296 bool = false - yyq2296[0] = x.PodCIDR != "" - yyq2296[1] = x.ExternalID != "" - yyq2296[2] = x.ProviderID != "" - yyq2296[3] = x.Unschedulable != false - var yynn2296 int - if yyr2296 || yy2arr2296 { + yysep2445 := !z.EncBinary() + yy2arr2445 := z.EncBasicHandle().StructToArray + var yyq2445 [4]bool + _, _, _ = yysep2445, yyq2445, yy2arr2445 + const yyr2445 bool = false + yyq2445[0] = x.PodCIDR != "" + yyq2445[1] = x.ExternalID != "" + yyq2445[2] = x.ProviderID != "" + yyq2445[3] = x.Unschedulable != false + var yynn2445 int + if yyr2445 || yy2arr2445 { r.EncodeArrayStart(4) } else { - yynn2296 = 0 - for _, b := range yyq2296 { + yynn2445 = 0 + for _, b := range yyq2445 { if b { - yynn2296++ + yynn2445++ } } - r.EncodeMapStart(yynn2296) - yynn2296 = 0 + r.EncodeMapStart(yynn2445) + yynn2445 = 0 } - if yyr2296 || yy2arr2296 { + if yyr2445 || yy2arr2445 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2296[0] { - yym2298 := z.EncBinary() - _ = yym2298 + if yyq2445[0] { + yym2447 := z.EncBinary() + _ = yym2447 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) @@ -29533,23 +31652,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2296[0] { + if yyq2445[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2299 := z.EncBinary() - _ = yym2299 + yym2448 := z.EncBinary() + _ = yym2448 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) } } } - if yyr2296 || yy2arr2296 { + if yyr2445 || yy2arr2445 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2296[1] { - yym2301 := z.EncBinary() - _ = yym2301 + if yyq2445[1] { + yym2450 := z.EncBinary() + _ = yym2450 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ExternalID)) @@ -29558,23 +31677,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2296[1] { + if yyq2445[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("externalID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2302 := z.EncBinary() - _ = yym2302 + yym2451 := z.EncBinary() + _ = yym2451 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ExternalID)) } } } - if yyr2296 || yy2arr2296 { + if yyr2445 || yy2arr2445 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2296[2] { - yym2304 := z.EncBinary() - _ = yym2304 + if yyq2445[2] { + yym2453 := z.EncBinary() + _ = yym2453 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ProviderID)) @@ -29583,23 +31702,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2296[2] { + if yyq2445[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("providerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2305 := z.EncBinary() - _ = yym2305 + yym2454 := z.EncBinary() + _ = yym2454 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ProviderID)) } } } - if yyr2296 || yy2arr2296 { + if yyr2445 || yy2arr2445 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2296[3] { - yym2307 := z.EncBinary() - _ = yym2307 + if yyq2445[3] { + yym2456 := z.EncBinary() + _ = yym2456 if false { } else { r.EncodeBool(bool(x.Unschedulable)) @@ -29608,19 +31727,19 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq2296[3] { + if yyq2445[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("unschedulable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2308 := z.EncBinary() - _ = yym2308 + yym2457 := z.EncBinary() + _ = yym2457 if false { } else { r.EncodeBool(bool(x.Unschedulable)) } } } - if yyr2296 || yy2arr2296 { + if yyr2445 || yy2arr2445 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29633,25 +31752,25 @@ func (x *NodeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2309 := z.DecBinary() - _ = yym2309 + yym2458 := z.DecBinary() + _ = yym2458 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2310 := r.ContainerType() - if yyct2310 == codecSelferValueTypeMap1234 { - yyl2310 := r.ReadMapStart() - if yyl2310 == 0 { + yyct2459 := r.ContainerType() + if yyct2459 == codecSelferValueTypeMap1234 { + yyl2459 := r.ReadMapStart() + if yyl2459 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2310, d) + x.codecDecodeSelfFromMap(yyl2459, d) } - } else if yyct2310 == codecSelferValueTypeArray1234 { - yyl2310 := r.ReadArrayStart() - if yyl2310 == 0 { + } else if yyct2459 == codecSelferValueTypeArray1234 { + yyl2459 := r.ReadArrayStart() + if yyl2459 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2310, d) + x.codecDecodeSelfFromArray(yyl2459, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29663,12 +31782,12 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2311Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2311Slc - var yyhl2311 bool = l >= 0 - for yyj2311 := 0; ; yyj2311++ { - if yyhl2311 { - if yyj2311 >= l { + var yys2460Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2460Slc + var yyhl2460 bool = l >= 0 + for yyj2460 := 0; ; yyj2460++ { + if yyhl2460 { + if yyj2460 >= l { break } } else { @@ -29677,10 +31796,10 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2311Slc = r.DecodeBytes(yys2311Slc, true, true) - yys2311 := string(yys2311Slc) + yys2460Slc = r.DecodeBytes(yys2460Slc, true, true) + yys2460 := string(yys2460Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2311 { + switch yys2460 { case "podCIDR": if r.TryDecodeAsNil() { x.PodCIDR = "" @@ -29706,9 +31825,9 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Unschedulable = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys2311) - } // end switch yys2311 - } // end for yyj2311 + z.DecStructFieldNotFound(-1, yys2460) + } // end switch yys2460 + } // end for yyj2460 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29716,16 +31835,16 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2316 int - var yyb2316 bool - var yyhl2316 bool = l >= 0 - yyj2316++ - if yyhl2316 { - yyb2316 = yyj2316 > l + var yyj2465 int + var yyb2465 bool + var yyhl2465 bool = l >= 0 + yyj2465++ + if yyhl2465 { + yyb2465 = yyj2465 > l } else { - yyb2316 = r.CheckBreak() + yyb2465 = r.CheckBreak() } - if yyb2316 { + if yyb2465 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29735,13 +31854,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.PodCIDR = string(r.DecodeString()) } - yyj2316++ - if yyhl2316 { - yyb2316 = yyj2316 > l + yyj2465++ + if yyhl2465 { + yyb2465 = yyj2465 > l } else { - yyb2316 = r.CheckBreak() + yyb2465 = r.CheckBreak() } - if yyb2316 { + if yyb2465 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29751,13 +31870,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ExternalID = string(r.DecodeString()) } - yyj2316++ - if yyhl2316 { - yyb2316 = yyj2316 > l + yyj2465++ + if yyhl2465 { + yyb2465 = yyj2465 > l } else { - yyb2316 = r.CheckBreak() + yyb2465 = r.CheckBreak() } - if yyb2316 { + if yyb2465 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29767,13 +31886,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ProviderID = string(r.DecodeString()) } - yyj2316++ - if yyhl2316 { - yyb2316 = yyj2316 > l + yyj2465++ + if yyhl2465 { + yyb2465 = yyj2465 > l } else { - yyb2316 = r.CheckBreak() + yyb2465 = r.CheckBreak() } - if yyb2316 { + if yyb2465 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29784,17 +31903,17 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Unschedulable = bool(r.DecodeBool()) } for { - yyj2316++ - if yyhl2316 { - yyb2316 = yyj2316 > l + yyj2465++ + if yyhl2465 { + yyb2465 = yyj2465 > l } else { - yyb2316 = r.CheckBreak() + yyb2465 = r.CheckBreak() } - if yyb2316 { + if yyb2465 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2316-1, "") + z.DecStructFieldNotFound(yyj2465-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29806,33 +31925,33 @@ func (x *DaemonEndpoint) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2321 := z.EncBinary() - _ = yym2321 + yym2470 := z.EncBinary() + _ = yym2470 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2322 := !z.EncBinary() - yy2arr2322 := z.EncBasicHandle().StructToArray - var yyq2322 [1]bool - _, _, _ = yysep2322, yyq2322, yy2arr2322 - const yyr2322 bool = false - var yynn2322 int - if yyr2322 || yy2arr2322 { + yysep2471 := !z.EncBinary() + yy2arr2471 := z.EncBasicHandle().StructToArray + var yyq2471 [1]bool + _, _, _ = yysep2471, yyq2471, yy2arr2471 + const yyr2471 bool = false + var yynn2471 int + if yyr2471 || yy2arr2471 { r.EncodeArrayStart(1) } else { - yynn2322 = 1 - for _, b := range yyq2322 { + yynn2471 = 1 + for _, b := range yyq2471 { if b { - yynn2322++ + yynn2471++ } } - r.EncodeMapStart(yynn2322) - yynn2322 = 0 + r.EncodeMapStart(yynn2471) + yynn2471 = 0 } - if yyr2322 || yy2arr2322 { + if yyr2471 || yy2arr2471 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2324 := z.EncBinary() - _ = yym2324 + yym2473 := z.EncBinary() + _ = yym2473 if false { } else { r.EncodeInt(int64(x.Port)) @@ -29841,14 +31960,14 @@ func (x *DaemonEndpoint) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2325 := z.EncBinary() - _ = yym2325 + yym2474 := z.EncBinary() + _ = yym2474 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2322 || yy2arr2322 { + if yyr2471 || yy2arr2471 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29861,25 +31980,25 @@ func (x *DaemonEndpoint) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2326 := z.DecBinary() - _ = yym2326 + yym2475 := z.DecBinary() + _ = yym2475 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2327 := r.ContainerType() - if yyct2327 == codecSelferValueTypeMap1234 { - yyl2327 := r.ReadMapStart() - if yyl2327 == 0 { + yyct2476 := r.ContainerType() + if yyct2476 == codecSelferValueTypeMap1234 { + yyl2476 := r.ReadMapStart() + if yyl2476 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2327, d) + x.codecDecodeSelfFromMap(yyl2476, d) } - } else if yyct2327 == codecSelferValueTypeArray1234 { - yyl2327 := r.ReadArrayStart() - if yyl2327 == 0 { + } else if yyct2476 == codecSelferValueTypeArray1234 { + yyl2476 := r.ReadArrayStart() + if yyl2476 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2327, d) + x.codecDecodeSelfFromArray(yyl2476, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29891,12 +32010,12 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2328Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2328Slc - var yyhl2328 bool = l >= 0 - for yyj2328 := 0; ; yyj2328++ { - if yyhl2328 { - if yyj2328 >= l { + var yys2477Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2477Slc + var yyhl2477 bool = l >= 0 + for yyj2477 := 0; ; yyj2477++ { + if yyhl2477 { + if yyj2477 >= l { break } } else { @@ -29905,10 +32024,10 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2328Slc = r.DecodeBytes(yys2328Slc, true, true) - yys2328 := string(yys2328Slc) + yys2477Slc = r.DecodeBytes(yys2477Slc, true, true) + yys2477 := string(yys2477Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2328 { + switch yys2477 { case "Port": if r.TryDecodeAsNil() { x.Port = 0 @@ -29916,9 +32035,9 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Port = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys2328) - } // end switch yys2328 - } // end for yyj2328 + z.DecStructFieldNotFound(-1, yys2477) + } // end switch yys2477 + } // end for yyj2477 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29926,16 +32045,16 @@ func (x *DaemonEndpoint) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2330 int - var yyb2330 bool - var yyhl2330 bool = l >= 0 - yyj2330++ - if yyhl2330 { - yyb2330 = yyj2330 > l + var yyj2479 int + var yyb2479 bool + var yyhl2479 bool = l >= 0 + yyj2479++ + if yyhl2479 { + yyb2479 = yyj2479 > l } else { - yyb2330 = r.CheckBreak() + yyb2479 = r.CheckBreak() } - if yyb2330 { + if yyb2479 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29946,17 +32065,17 @@ func (x *DaemonEndpoint) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Port = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj2330++ - if yyhl2330 { - yyb2330 = yyj2330 > l + yyj2479++ + if yyhl2479 { + yyb2479 = yyj2479 > l } else { - yyb2330 = r.CheckBreak() + yyb2479 = r.CheckBreak() } - if yyb2330 { + if yyb2479 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2330-1, "") + z.DecStructFieldNotFound(yyj2479-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29968,48 +32087,48 @@ func (x *NodeDaemonEndpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2332 := z.EncBinary() - _ = yym2332 + yym2481 := z.EncBinary() + _ = yym2481 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2333 := !z.EncBinary() - yy2arr2333 := z.EncBasicHandle().StructToArray - var yyq2333 [1]bool - _, _, _ = yysep2333, yyq2333, yy2arr2333 - const yyr2333 bool = false - yyq2333[0] = true - var yynn2333 int - if yyr2333 || yy2arr2333 { + yysep2482 := !z.EncBinary() + yy2arr2482 := z.EncBasicHandle().StructToArray + var yyq2482 [1]bool + _, _, _ = yysep2482, yyq2482, yy2arr2482 + const yyr2482 bool = false + yyq2482[0] = true + var yynn2482 int + if yyr2482 || yy2arr2482 { r.EncodeArrayStart(1) } else { - yynn2333 = 0 - for _, b := range yyq2333 { + yynn2482 = 0 + for _, b := range yyq2482 { if b { - yynn2333++ + yynn2482++ } } - r.EncodeMapStart(yynn2333) - yynn2333 = 0 + r.EncodeMapStart(yynn2482) + yynn2482 = 0 } - if yyr2333 || yy2arr2333 { + if yyr2482 || yy2arr2482 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2333[0] { - yy2335 := &x.KubeletEndpoint - yy2335.CodecEncodeSelf(e) + if yyq2482[0] { + yy2484 := &x.KubeletEndpoint + yy2484.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2333[0] { + if yyq2482[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeletEndpoint")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2336 := &x.KubeletEndpoint - yy2336.CodecEncodeSelf(e) + yy2485 := &x.KubeletEndpoint + yy2485.CodecEncodeSelf(e) } } - if yyr2333 || yy2arr2333 { + if yyr2482 || yy2arr2482 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -30022,25 +32141,25 @@ func (x *NodeDaemonEndpoints) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2337 := z.DecBinary() - _ = yym2337 + yym2486 := z.DecBinary() + _ = yym2486 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2338 := r.ContainerType() - if yyct2338 == codecSelferValueTypeMap1234 { - yyl2338 := r.ReadMapStart() - if yyl2338 == 0 { + yyct2487 := r.ContainerType() + if yyct2487 == codecSelferValueTypeMap1234 { + yyl2487 := r.ReadMapStart() + if yyl2487 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2338, d) + x.codecDecodeSelfFromMap(yyl2487, d) } - } else if yyct2338 == codecSelferValueTypeArray1234 { - yyl2338 := r.ReadArrayStart() - if yyl2338 == 0 { + } else if yyct2487 == codecSelferValueTypeArray1234 { + yyl2487 := r.ReadArrayStart() + if yyl2487 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2338, d) + x.codecDecodeSelfFromArray(yyl2487, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -30052,12 +32171,12 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2339Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2339Slc - var yyhl2339 bool = l >= 0 - for yyj2339 := 0; ; yyj2339++ { - if yyhl2339 { - if yyj2339 >= l { + var yys2488Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2488Slc + var yyhl2488 bool = l >= 0 + for yyj2488 := 0; ; yyj2488++ { + if yyhl2488 { + if yyj2488 >= l { break } } else { @@ -30066,21 +32185,21 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2339Slc = r.DecodeBytes(yys2339Slc, true, true) - yys2339 := string(yys2339Slc) + yys2488Slc = r.DecodeBytes(yys2488Slc, true, true) + yys2488 := string(yys2488Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2339 { + switch yys2488 { case "kubeletEndpoint": if r.TryDecodeAsNil() { x.KubeletEndpoint = DaemonEndpoint{} } else { - yyv2340 := &x.KubeletEndpoint - yyv2340.CodecDecodeSelf(d) + yyv2489 := &x.KubeletEndpoint + yyv2489.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys2339) - } // end switch yys2339 - } // end for yyj2339 + z.DecStructFieldNotFound(-1, yys2488) + } // end switch yys2488 + } // end for yyj2488 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -30088,16 +32207,16 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2341 int - var yyb2341 bool - var yyhl2341 bool = l >= 0 - yyj2341++ - if yyhl2341 { - yyb2341 = yyj2341 > l + var yyj2490 int + var yyb2490 bool + var yyhl2490 bool = l >= 0 + yyj2490++ + if yyhl2490 { + yyb2490 = yyj2490 > l } else { - yyb2341 = r.CheckBreak() + yyb2490 = r.CheckBreak() } - if yyb2341 { + if yyb2490 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30105,21 +32224,21 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.KubeletEndpoint = DaemonEndpoint{} } else { - yyv2342 := &x.KubeletEndpoint - yyv2342.CodecDecodeSelf(d) + yyv2491 := &x.KubeletEndpoint + yyv2491.CodecDecodeSelf(d) } for { - yyj2341++ - if yyhl2341 { - yyb2341 = yyj2341 > l + yyj2490++ + if yyhl2490 { + yyb2490 = yyj2490 > l } else { - yyb2341 = r.CheckBreak() + yyb2490 = r.CheckBreak() } - if yyb2341 { + if yyb2490 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2341-1, "") + z.DecStructFieldNotFound(yyj2490-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -30131,33 +32250,33 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2343 := z.EncBinary() - _ = yym2343 + yym2492 := z.EncBinary() + _ = yym2492 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2344 := !z.EncBinary() - yy2arr2344 := z.EncBasicHandle().StructToArray - var yyq2344 [8]bool - _, _, _ = yysep2344, yyq2344, yy2arr2344 - const yyr2344 bool = false - var yynn2344 int - if yyr2344 || yy2arr2344 { + yysep2493 := !z.EncBinary() + yy2arr2493 := z.EncBasicHandle().StructToArray + var yyq2493 [8]bool + _, _, _ = yysep2493, yyq2493, yy2arr2493 + const yyr2493 bool = false + var yynn2493 int + if yyr2493 || yy2arr2493 { r.EncodeArrayStart(8) } else { - yynn2344 = 8 - for _, b := range yyq2344 { + yynn2493 = 8 + for _, b := range yyq2493 { if b { - yynn2344++ + yynn2493++ } } - r.EncodeMapStart(yynn2344) - yynn2344 = 0 + r.EncodeMapStart(yynn2493) + yynn2493 = 0 } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2346 := z.EncBinary() - _ = yym2346 + yym2495 := z.EncBinary() + _ = yym2495 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MachineID)) @@ -30166,17 +32285,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("machineID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2347 := z.EncBinary() - _ = yym2347 + yym2496 := z.EncBinary() + _ = yym2496 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MachineID)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2349 := z.EncBinary() - _ = yym2349 + yym2498 := z.EncBinary() + _ = yym2498 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemUUID)) @@ -30185,17 +32304,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("systemUUID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2350 := z.EncBinary() - _ = yym2350 + yym2499 := z.EncBinary() + _ = yym2499 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemUUID)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2352 := z.EncBinary() - _ = yym2352 + yym2501 := z.EncBinary() + _ = yym2501 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BootID)) @@ -30204,17 +32323,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("bootID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2353 := z.EncBinary() - _ = yym2353 + yym2502 := z.EncBinary() + _ = yym2502 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BootID)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2355 := z.EncBinary() - _ = yym2355 + yym2504 := z.EncBinary() + _ = yym2504 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KernelVersion)) @@ -30223,17 +32342,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kernelVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2356 := z.EncBinary() - _ = yym2356 + yym2505 := z.EncBinary() + _ = yym2505 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KernelVersion)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2358 := z.EncBinary() - _ = yym2358 + yym2507 := z.EncBinary() + _ = yym2507 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.OSImage)) @@ -30242,17 +32361,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("osImage")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2359 := z.EncBinary() - _ = yym2359 + yym2508 := z.EncBinary() + _ = yym2508 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.OSImage)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2361 := z.EncBinary() - _ = yym2361 + yym2510 := z.EncBinary() + _ = yym2510 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntimeVersion)) @@ -30261,17 +32380,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerRuntimeVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2362 := z.EncBinary() - _ = yym2362 + yym2511 := z.EncBinary() + _ = yym2511 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntimeVersion)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2364 := z.EncBinary() - _ = yym2364 + yym2513 := z.EncBinary() + _ = yym2513 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeletVersion)) @@ -30280,17 +32399,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeletVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2365 := z.EncBinary() - _ = yym2365 + yym2514 := z.EncBinary() + _ = yym2514 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeletVersion)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2367 := z.EncBinary() - _ = yym2367 + yym2516 := z.EncBinary() + _ = yym2516 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeProxyVersion)) @@ -30299,14 +32418,14 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeProxyVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2368 := z.EncBinary() - _ = yym2368 + yym2517 := z.EncBinary() + _ = yym2517 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeProxyVersion)) } } - if yyr2344 || yy2arr2344 { + if yyr2493 || yy2arr2493 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -30319,25 +32438,25 @@ func (x *NodeSystemInfo) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2369 := z.DecBinary() - _ = yym2369 + yym2518 := z.DecBinary() + _ = yym2518 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2370 := r.ContainerType() - if yyct2370 == codecSelferValueTypeMap1234 { - yyl2370 := r.ReadMapStart() - if yyl2370 == 0 { + yyct2519 := r.ContainerType() + if yyct2519 == codecSelferValueTypeMap1234 { + yyl2519 := r.ReadMapStart() + if yyl2519 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2370, d) + x.codecDecodeSelfFromMap(yyl2519, d) } - } else if yyct2370 == codecSelferValueTypeArray1234 { - yyl2370 := r.ReadArrayStart() - if yyl2370 == 0 { + } else if yyct2519 == codecSelferValueTypeArray1234 { + yyl2519 := r.ReadArrayStart() + if yyl2519 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2370, d) + x.codecDecodeSelfFromArray(yyl2519, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -30349,12 +32468,12 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2371Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2371Slc - var yyhl2371 bool = l >= 0 - for yyj2371 := 0; ; yyj2371++ { - if yyhl2371 { - if yyj2371 >= l { + var yys2520Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2520Slc + var yyhl2520 bool = l >= 0 + for yyj2520 := 0; ; yyj2520++ { + if yyhl2520 { + if yyj2520 >= l { break } } else { @@ -30363,10 +32482,10 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2371Slc = r.DecodeBytes(yys2371Slc, true, true) - yys2371 := string(yys2371Slc) + yys2520Slc = r.DecodeBytes(yys2520Slc, true, true) + yys2520 := string(yys2520Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2371 { + switch yys2520 { case "machineID": if r.TryDecodeAsNil() { x.MachineID = "" @@ -30416,9 +32535,9 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.KubeProxyVersion = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2371) - } // end switch yys2371 - } // end for yyj2371 + z.DecStructFieldNotFound(-1, yys2520) + } // end switch yys2520 + } // end for yyj2520 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -30426,16 +32545,16 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2380 int - var yyb2380 bool - var yyhl2380 bool = l >= 0 - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + var yyj2529 int + var yyb2529 bool + var yyhl2529 bool = l >= 0 + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30445,13 +32564,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.MachineID = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30461,13 +32580,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.SystemUUID = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30477,13 +32596,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.BootID = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30493,13 +32612,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.KernelVersion = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30509,13 +32628,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.OSImage = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30525,13 +32644,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ContainerRuntimeVersion = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30541,13 +32660,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.KubeletVersion = string(r.DecodeString()) } - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30558,17 +32677,17 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.KubeProxyVersion = string(r.DecodeString()) } for { - yyj2380++ - if yyhl2380 { - yyb2380 = yyj2380 > l + yyj2529++ + if yyhl2529 { + yyb2529 = yyj2529 > l } else { - yyb2380 = r.CheckBreak() + yyb2529 = r.CheckBreak() } - if yyb2380 { + if yyb2529 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2380-1, "") + z.DecStructFieldNotFound(yyj2529-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -30580,39 +32699,39 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2389 := z.EncBinary() - _ = yym2389 + yym2538 := z.EncBinary() + _ = yym2538 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2390 := !z.EncBinary() - yy2arr2390 := z.EncBasicHandle().StructToArray - var yyq2390 [8]bool - _, _, _ = yysep2390, yyq2390, yy2arr2390 - const yyr2390 bool = false - yyq2390[0] = len(x.Capacity) != 0 - yyq2390[1] = len(x.Allocatable) != 0 - yyq2390[2] = x.Phase != "" - yyq2390[3] = len(x.Conditions) != 0 - yyq2390[4] = len(x.Addresses) != 0 - yyq2390[5] = true - yyq2390[6] = true - var yynn2390 int - if yyr2390 || yy2arr2390 { + yysep2539 := !z.EncBinary() + yy2arr2539 := z.EncBasicHandle().StructToArray + var yyq2539 [8]bool + _, _, _ = yysep2539, yyq2539, yy2arr2539 + const yyr2539 bool = false + yyq2539[0] = len(x.Capacity) != 0 + yyq2539[1] = len(x.Allocatable) != 0 + yyq2539[2] = x.Phase != "" + yyq2539[3] = len(x.Conditions) != 0 + yyq2539[4] = len(x.Addresses) != 0 + yyq2539[5] = true + yyq2539[6] = true + var yynn2539 int + if yyr2539 || yy2arr2539 { r.EncodeArrayStart(8) } else { - yynn2390 = 1 - for _, b := range yyq2390 { + yynn2539 = 1 + for _, b := range yyq2539 { if b { - yynn2390++ + yynn2539++ } } - r.EncodeMapStart(yynn2390) - yynn2390 = 0 + r.EncodeMapStart(yynn2539) + yynn2539 = 0 } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[0] { + if yyq2539[0] { if x.Capacity == nil { r.EncodeNil() } else { @@ -30622,7 +32741,7 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2390[0] { + if yyq2539[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -30633,9 +32752,9 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[1] { + if yyq2539[1] { if x.Allocatable == nil { r.EncodeNil() } else { @@ -30645,7 +32764,7 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2390[1] { + if yyq2539[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("allocatable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -30656,29 +32775,29 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[2] { + if yyq2539[2] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2390[2] { + if yyq2539[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[3] { + if yyq2539[3] { if x.Conditions == nil { r.EncodeNil() } else { - yym2395 := z.EncBinary() - _ = yym2395 + yym2544 := z.EncBinary() + _ = yym2544 if false { } else { h.encSliceNodeCondition(([]NodeCondition)(x.Conditions), e) @@ -30688,15 +32807,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2390[3] { + if yyq2539[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym2396 := z.EncBinary() - _ = yym2396 + yym2545 := z.EncBinary() + _ = yym2545 if false { } else { h.encSliceNodeCondition(([]NodeCondition)(x.Conditions), e) @@ -30704,14 +32823,14 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[4] { + if yyq2539[4] { if x.Addresses == nil { r.EncodeNil() } else { - yym2398 := z.EncBinary() - _ = yym2398 + yym2547 := z.EncBinary() + _ = yym2547 if false { } else { h.encSliceNodeAddress(([]NodeAddress)(x.Addresses), e) @@ -30721,15 +32840,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2390[4] { + if yyq2539[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("addresses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Addresses == nil { r.EncodeNil() } else { - yym2399 := z.EncBinary() - _ = yym2399 + yym2548 := z.EncBinary() + _ = yym2548 if false { } else { h.encSliceNodeAddress(([]NodeAddress)(x.Addresses), e) @@ -30737,47 +32856,47 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[5] { - yy2401 := &x.DaemonEndpoints - yy2401.CodecEncodeSelf(e) + if yyq2539[5] { + yy2550 := &x.DaemonEndpoints + yy2550.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2390[5] { + if yyq2539[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("daemonEndpoints")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2402 := &x.DaemonEndpoints - yy2402.CodecEncodeSelf(e) + yy2551 := &x.DaemonEndpoints + yy2551.CodecEncodeSelf(e) } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2390[6] { - yy2404 := &x.NodeInfo - yy2404.CodecEncodeSelf(e) + if yyq2539[6] { + yy2553 := &x.NodeInfo + yy2553.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2390[6] { + if yyq2539[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeInfo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2405 := &x.NodeInfo - yy2405.CodecEncodeSelf(e) + yy2554 := &x.NodeInfo + yy2554.CodecEncodeSelf(e) } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Images == nil { r.EncodeNil() } else { - yym2407 := z.EncBinary() - _ = yym2407 + yym2556 := z.EncBinary() + _ = yym2556 if false { } else { h.encSliceContainerImage(([]ContainerImage)(x.Images), e) @@ -30790,15 +32909,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x.Images == nil { r.EncodeNil() } else { - yym2408 := z.EncBinary() - _ = yym2408 + yym2557 := z.EncBinary() + _ = yym2557 if false { } else { h.encSliceContainerImage(([]ContainerImage)(x.Images), e) } } } - if yyr2390 || yy2arr2390 { + if yyr2539 || yy2arr2539 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -30811,25 +32930,25 @@ func (x *NodeStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2409 := z.DecBinary() - _ = yym2409 + yym2558 := z.DecBinary() + _ = yym2558 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2410 := r.ContainerType() - if yyct2410 == codecSelferValueTypeMap1234 { - yyl2410 := r.ReadMapStart() - if yyl2410 == 0 { + yyct2559 := r.ContainerType() + if yyct2559 == codecSelferValueTypeMap1234 { + yyl2559 := r.ReadMapStart() + if yyl2559 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2410, d) + x.codecDecodeSelfFromMap(yyl2559, d) } - } else if yyct2410 == codecSelferValueTypeArray1234 { - yyl2410 := r.ReadArrayStart() - if yyl2410 == 0 { + } else if yyct2559 == codecSelferValueTypeArray1234 { + yyl2559 := r.ReadArrayStart() + if yyl2559 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2410, d) + x.codecDecodeSelfFromArray(yyl2559, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -30841,12 +32960,12 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2411Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2411Slc - var yyhl2411 bool = l >= 0 - for yyj2411 := 0; ; yyj2411++ { - if yyhl2411 { - if yyj2411 >= l { + var yys2560Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2560Slc + var yyhl2560 bool = l >= 0 + for yyj2560 := 0; ; yyj2560++ { + if yyhl2560 { + if yyj2560 >= l { break } } else { @@ -30855,23 +32974,23 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2411Slc = r.DecodeBytes(yys2411Slc, true, true) - yys2411 := string(yys2411Slc) + yys2560Slc = r.DecodeBytes(yys2560Slc, true, true) + yys2560 := string(yys2560Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2411 { + switch yys2560 { case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2412 := &x.Capacity - yyv2412.CodecDecodeSelf(d) + yyv2561 := &x.Capacity + yyv2561.CodecDecodeSelf(d) } case "allocatable": if r.TryDecodeAsNil() { x.Allocatable = nil } else { - yyv2413 := &x.Allocatable - yyv2413.CodecDecodeSelf(d) + yyv2562 := &x.Allocatable + yyv2562.CodecDecodeSelf(d) } case "phase": if r.TryDecodeAsNil() { @@ -30883,56 +33002,56 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv2415 := &x.Conditions - yym2416 := z.DecBinary() - _ = yym2416 + yyv2564 := &x.Conditions + yym2565 := z.DecBinary() + _ = yym2565 if false { } else { - h.decSliceNodeCondition((*[]NodeCondition)(yyv2415), d) + h.decSliceNodeCondition((*[]NodeCondition)(yyv2564), d) } } case "addresses": if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2417 := &x.Addresses - yym2418 := z.DecBinary() - _ = yym2418 + yyv2566 := &x.Addresses + yym2567 := z.DecBinary() + _ = yym2567 if false { } else { - h.decSliceNodeAddress((*[]NodeAddress)(yyv2417), d) + h.decSliceNodeAddress((*[]NodeAddress)(yyv2566), d) } } case "daemonEndpoints": if r.TryDecodeAsNil() { x.DaemonEndpoints = NodeDaemonEndpoints{} } else { - yyv2419 := &x.DaemonEndpoints - yyv2419.CodecDecodeSelf(d) + yyv2568 := &x.DaemonEndpoints + yyv2568.CodecDecodeSelf(d) } case "nodeInfo": if r.TryDecodeAsNil() { x.NodeInfo = NodeSystemInfo{} } else { - yyv2420 := &x.NodeInfo - yyv2420.CodecDecodeSelf(d) + yyv2569 := &x.NodeInfo + yyv2569.CodecDecodeSelf(d) } case "images": if r.TryDecodeAsNil() { x.Images = nil } else { - yyv2421 := &x.Images - yym2422 := z.DecBinary() - _ = yym2422 + yyv2570 := &x.Images + yym2571 := z.DecBinary() + _ = yym2571 if false { } else { - h.decSliceContainerImage((*[]ContainerImage)(yyv2421), d) + h.decSliceContainerImage((*[]ContainerImage)(yyv2570), d) } } default: - z.DecStructFieldNotFound(-1, yys2411) - } // end switch yys2411 - } // end for yyj2411 + z.DecStructFieldNotFound(-1, yys2560) + } // end switch yys2560 + } // end for yyj2560 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -30940,16 +33059,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2423 int - var yyb2423 bool - var yyhl2423 bool = l >= 0 - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + var yyj2572 int + var yyb2572 bool + var yyhl2572 bool = l >= 0 + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30957,16 +33076,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2424 := &x.Capacity - yyv2424.CodecDecodeSelf(d) + yyv2573 := &x.Capacity + yyv2573.CodecDecodeSelf(d) } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30974,16 +33093,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Allocatable = nil } else { - yyv2425 := &x.Allocatable - yyv2425.CodecDecodeSelf(d) + yyv2574 := &x.Allocatable + yyv2574.CodecDecodeSelf(d) } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30993,13 +33112,13 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Phase = NodePhase(r.DecodeString()) } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31007,21 +33126,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv2427 := &x.Conditions - yym2428 := z.DecBinary() - _ = yym2428 + yyv2576 := &x.Conditions + yym2577 := z.DecBinary() + _ = yym2577 if false { } else { - h.decSliceNodeCondition((*[]NodeCondition)(yyv2427), d) + h.decSliceNodeCondition((*[]NodeCondition)(yyv2576), d) } } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31029,21 +33148,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2429 := &x.Addresses - yym2430 := z.DecBinary() - _ = yym2430 + yyv2578 := &x.Addresses + yym2579 := z.DecBinary() + _ = yym2579 if false { } else { - h.decSliceNodeAddress((*[]NodeAddress)(yyv2429), d) + h.decSliceNodeAddress((*[]NodeAddress)(yyv2578), d) } } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31051,16 +33170,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.DaemonEndpoints = NodeDaemonEndpoints{} } else { - yyv2431 := &x.DaemonEndpoints - yyv2431.CodecDecodeSelf(d) + yyv2580 := &x.DaemonEndpoints + yyv2580.CodecDecodeSelf(d) } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31068,16 +33187,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeInfo = NodeSystemInfo{} } else { - yyv2432 := &x.NodeInfo - yyv2432.CodecDecodeSelf(d) + yyv2581 := &x.NodeInfo + yyv2581.CodecDecodeSelf(d) } - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31085,26 +33204,26 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Images = nil } else { - yyv2433 := &x.Images - yym2434 := z.DecBinary() - _ = yym2434 + yyv2582 := &x.Images + yym2583 := z.DecBinary() + _ = yym2583 if false { } else { - h.decSliceContainerImage((*[]ContainerImage)(yyv2433), d) + h.decSliceContainerImage((*[]ContainerImage)(yyv2582), d) } } for { - yyj2423++ - if yyhl2423 { - yyb2423 = yyj2423 > l + yyj2572++ + if yyhl2572 { + yyb2572 = yyj2572 > l } else { - yyb2423 = r.CheckBreak() + yyb2572 = r.CheckBreak() } - if yyb2423 { + if yyb2572 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2423-1, "") + z.DecStructFieldNotFound(yyj2572-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31116,37 +33235,37 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2435 := z.EncBinary() - _ = yym2435 + yym2584 := z.EncBinary() + _ = yym2584 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2436 := !z.EncBinary() - yy2arr2436 := z.EncBasicHandle().StructToArray - var yyq2436 [2]bool - _, _, _ = yysep2436, yyq2436, yy2arr2436 - const yyr2436 bool = false - yyq2436[1] = x.Size != 0 - var yynn2436 int - if yyr2436 || yy2arr2436 { + yysep2585 := !z.EncBinary() + yy2arr2585 := z.EncBasicHandle().StructToArray + var yyq2585 [2]bool + _, _, _ = yysep2585, yyq2585, yy2arr2585 + const yyr2585 bool = false + yyq2585[1] = x.Size != 0 + var yynn2585 int + if yyr2585 || yy2arr2585 { r.EncodeArrayStart(2) } else { - yynn2436 = 1 - for _, b := range yyq2436 { + yynn2585 = 1 + for _, b := range yyq2585 { if b { - yynn2436++ + yynn2585++ } } - r.EncodeMapStart(yynn2436) - yynn2436 = 0 + r.EncodeMapStart(yynn2585) + yynn2585 = 0 } - if yyr2436 || yy2arr2436 { + if yyr2585 || yy2arr2585 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.RepoTags == nil { r.EncodeNil() } else { - yym2438 := z.EncBinary() - _ = yym2438 + yym2587 := z.EncBinary() + _ = yym2587 if false { } else { z.F.EncSliceStringV(x.RepoTags, false, e) @@ -31159,19 +33278,19 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { if x.RepoTags == nil { r.EncodeNil() } else { - yym2439 := z.EncBinary() - _ = yym2439 + yym2588 := z.EncBinary() + _ = yym2588 if false { } else { z.F.EncSliceStringV(x.RepoTags, false, e) } } } - if yyr2436 || yy2arr2436 { + if yyr2585 || yy2arr2585 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2436[1] { - yym2441 := z.EncBinary() - _ = yym2441 + if yyq2585[1] { + yym2590 := z.EncBinary() + _ = yym2590 if false { } else { r.EncodeInt(int64(x.Size)) @@ -31180,19 +33299,19 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq2436[1] { + if yyq2585[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("size")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2442 := z.EncBinary() - _ = yym2442 + yym2591 := z.EncBinary() + _ = yym2591 if false { } else { r.EncodeInt(int64(x.Size)) } } } - if yyr2436 || yy2arr2436 { + if yyr2585 || yy2arr2585 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31205,25 +33324,25 @@ func (x *ContainerImage) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2443 := z.DecBinary() - _ = yym2443 + yym2592 := z.DecBinary() + _ = yym2592 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2444 := r.ContainerType() - if yyct2444 == codecSelferValueTypeMap1234 { - yyl2444 := r.ReadMapStart() - if yyl2444 == 0 { + yyct2593 := r.ContainerType() + if yyct2593 == codecSelferValueTypeMap1234 { + yyl2593 := r.ReadMapStart() + if yyl2593 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2444, d) + x.codecDecodeSelfFromMap(yyl2593, d) } - } else if yyct2444 == codecSelferValueTypeArray1234 { - yyl2444 := r.ReadArrayStart() - if yyl2444 == 0 { + } else if yyct2593 == codecSelferValueTypeArray1234 { + yyl2593 := r.ReadArrayStart() + if yyl2593 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2444, d) + x.codecDecodeSelfFromArray(yyl2593, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31235,12 +33354,12 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2445Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2445Slc - var yyhl2445 bool = l >= 0 - for yyj2445 := 0; ; yyj2445++ { - if yyhl2445 { - if yyj2445 >= l { + var yys2594Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2594Slc + var yyhl2594 bool = l >= 0 + for yyj2594 := 0; ; yyj2594++ { + if yyhl2594 { + if yyj2594 >= l { break } } else { @@ -31249,20 +33368,20 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2445Slc = r.DecodeBytes(yys2445Slc, true, true) - yys2445 := string(yys2445Slc) + yys2594Slc = r.DecodeBytes(yys2594Slc, true, true) + yys2594 := string(yys2594Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2445 { + switch yys2594 { case "repoTags": if r.TryDecodeAsNil() { x.RepoTags = nil } else { - yyv2446 := &x.RepoTags - yym2447 := z.DecBinary() - _ = yym2447 + yyv2595 := &x.RepoTags + yym2596 := z.DecBinary() + _ = yym2596 if false { } else { - z.F.DecSliceStringX(yyv2446, false, d) + z.F.DecSliceStringX(yyv2595, false, d) } } case "size": @@ -31272,9 +33391,9 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Size = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys2445) - } // end switch yys2445 - } // end for yyj2445 + z.DecStructFieldNotFound(-1, yys2594) + } // end switch yys2594 + } // end for yyj2594 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -31282,16 +33401,16 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2449 int - var yyb2449 bool - var yyhl2449 bool = l >= 0 - yyj2449++ - if yyhl2449 { - yyb2449 = yyj2449 > l + var yyj2598 int + var yyb2598 bool + var yyhl2598 bool = l >= 0 + yyj2598++ + if yyhl2598 { + yyb2598 = yyj2598 > l } else { - yyb2449 = r.CheckBreak() + yyb2598 = r.CheckBreak() } - if yyb2449 { + if yyb2598 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31299,21 +33418,21 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.RepoTags = nil } else { - yyv2450 := &x.RepoTags - yym2451 := z.DecBinary() - _ = yym2451 + yyv2599 := &x.RepoTags + yym2600 := z.DecBinary() + _ = yym2600 if false { } else { - z.F.DecSliceStringX(yyv2450, false, d) + z.F.DecSliceStringX(yyv2599, false, d) } } - yyj2449++ - if yyhl2449 { - yyb2449 = yyj2449 > l + yyj2598++ + if yyhl2598 { + yyb2598 = yyj2598 > l } else { - yyb2449 = r.CheckBreak() + yyb2598 = r.CheckBreak() } - if yyb2449 { + if yyb2598 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31324,17 +33443,17 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Size = int64(r.DecodeInt(64)) } for { - yyj2449++ - if yyhl2449 { - yyb2449 = yyj2449 > l + yyj2598++ + if yyhl2598 { + yyb2598 = yyj2598 > l } else { - yyb2449 = r.CheckBreak() + yyb2598 = r.CheckBreak() } - if yyb2449 { + if yyb2598 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2449-1, "") + z.DecStructFieldNotFound(yyj2598-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31343,8 +33462,8 @@ func (x NodePhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2453 := z.EncBinary() - _ = yym2453 + yym2602 := z.EncBinary() + _ = yym2602 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31356,8 +33475,8 @@ func (x *NodePhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2454 := z.DecBinary() - _ = yym2454 + yym2603 := z.DecBinary() + _ = yym2603 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31369,8 +33488,8 @@ func (x NodeConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2455 := z.EncBinary() - _ = yym2455 + yym2604 := z.EncBinary() + _ = yym2604 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31382,8 +33501,8 @@ func (x *NodeConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2456 := z.DecBinary() - _ = yym2456 + yym2605 := z.DecBinary() + _ = yym2605 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31398,34 +33517,34 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2457 := z.EncBinary() - _ = yym2457 + yym2606 := z.EncBinary() + _ = yym2606 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2458 := !z.EncBinary() - yy2arr2458 := z.EncBasicHandle().StructToArray - var yyq2458 [6]bool - _, _, _ = yysep2458, yyq2458, yy2arr2458 - const yyr2458 bool = false - yyq2458[2] = true - yyq2458[3] = true - yyq2458[4] = x.Reason != "" - yyq2458[5] = x.Message != "" - var yynn2458 int - if yyr2458 || yy2arr2458 { + yysep2607 := !z.EncBinary() + yy2arr2607 := z.EncBasicHandle().StructToArray + var yyq2607 [6]bool + _, _, _ = yysep2607, yyq2607, yy2arr2607 + const yyr2607 bool = false + yyq2607[2] = true + yyq2607[3] = true + yyq2607[4] = x.Reason != "" + yyq2607[5] = x.Message != "" + var yynn2607 int + if yyr2607 || yy2arr2607 { r.EncodeArrayStart(6) } else { - yynn2458 = 2 - for _, b := range yyq2458 { + yynn2607 = 2 + for _, b := range yyq2607 { if b { - yynn2458++ + yynn2607++ } } - r.EncodeMapStart(yynn2458) - yynn2458 = 0 + r.EncodeMapStart(yynn2607) + yynn2607 = 0 } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -31434,7 +33553,7 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -31443,85 +33562,85 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2458[2] { - yy2462 := &x.LastHeartbeatTime - yym2463 := z.EncBinary() - _ = yym2463 + if yyq2607[2] { + yy2611 := &x.LastHeartbeatTime + yym2612 := z.EncBinary() + _ = yym2612 if false { - } else if z.HasExtensions() && z.EncExt(yy2462) { - } else if yym2463 { - z.EncBinaryMarshal(yy2462) - } else if !yym2463 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2462) + } else if z.HasExtensions() && z.EncExt(yy2611) { + } else if yym2612 { + z.EncBinaryMarshal(yy2611) + } else if !yym2612 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2611) } else { - z.EncFallback(yy2462) + z.EncFallback(yy2611) } } else { r.EncodeNil() } } else { - if yyq2458[2] { + if yyq2607[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastHeartbeatTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2464 := &x.LastHeartbeatTime - yym2465 := z.EncBinary() - _ = yym2465 + yy2613 := &x.LastHeartbeatTime + yym2614 := z.EncBinary() + _ = yym2614 if false { - } else if z.HasExtensions() && z.EncExt(yy2464) { - } else if yym2465 { - z.EncBinaryMarshal(yy2464) - } else if !yym2465 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2464) + } else if z.HasExtensions() && z.EncExt(yy2613) { + } else if yym2614 { + z.EncBinaryMarshal(yy2613) + } else if !yym2614 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2613) } else { - z.EncFallback(yy2464) + z.EncFallback(yy2613) } } } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2458[3] { - yy2467 := &x.LastTransitionTime - yym2468 := z.EncBinary() - _ = yym2468 + if yyq2607[3] { + yy2616 := &x.LastTransitionTime + yym2617 := z.EncBinary() + _ = yym2617 if false { - } else if z.HasExtensions() && z.EncExt(yy2467) { - } else if yym2468 { - z.EncBinaryMarshal(yy2467) - } else if !yym2468 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2467) + } else if z.HasExtensions() && z.EncExt(yy2616) { + } else if yym2617 { + z.EncBinaryMarshal(yy2616) + } else if !yym2617 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2616) } else { - z.EncFallback(yy2467) + z.EncFallback(yy2616) } } else { r.EncodeNil() } } else { - if yyq2458[3] { + if yyq2607[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2469 := &x.LastTransitionTime - yym2470 := z.EncBinary() - _ = yym2470 + yy2618 := &x.LastTransitionTime + yym2619 := z.EncBinary() + _ = yym2619 if false { - } else if z.HasExtensions() && z.EncExt(yy2469) { - } else if yym2470 { - z.EncBinaryMarshal(yy2469) - } else if !yym2470 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2469) + } else if z.HasExtensions() && z.EncExt(yy2618) { + } else if yym2619 { + z.EncBinaryMarshal(yy2618) + } else if !yym2619 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2618) } else { - z.EncFallback(yy2469) + z.EncFallback(yy2618) } } } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2458[4] { - yym2472 := z.EncBinary() - _ = yym2472 + if yyq2607[4] { + yym2621 := z.EncBinary() + _ = yym2621 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -31530,23 +33649,23 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2458[4] { + if yyq2607[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2473 := z.EncBinary() - _ = yym2473 + yym2622 := z.EncBinary() + _ = yym2622 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2458[5] { - yym2475 := z.EncBinary() - _ = yym2475 + if yyq2607[5] { + yym2624 := z.EncBinary() + _ = yym2624 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -31555,19 +33674,19 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2458[5] { + if yyq2607[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2476 := z.EncBinary() - _ = yym2476 + yym2625 := z.EncBinary() + _ = yym2625 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr2458 || yy2arr2458 { + if yyr2607 || yy2arr2607 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31580,25 +33699,25 @@ func (x *NodeCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2477 := z.DecBinary() - _ = yym2477 + yym2626 := z.DecBinary() + _ = yym2626 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2478 := r.ContainerType() - if yyct2478 == codecSelferValueTypeMap1234 { - yyl2478 := r.ReadMapStart() - if yyl2478 == 0 { + yyct2627 := r.ContainerType() + if yyct2627 == codecSelferValueTypeMap1234 { + yyl2627 := r.ReadMapStart() + if yyl2627 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2478, d) + x.codecDecodeSelfFromMap(yyl2627, d) } - } else if yyct2478 == codecSelferValueTypeArray1234 { - yyl2478 := r.ReadArrayStart() - if yyl2478 == 0 { + } else if yyct2627 == codecSelferValueTypeArray1234 { + yyl2627 := r.ReadArrayStart() + if yyl2627 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2478, d) + x.codecDecodeSelfFromArray(yyl2627, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31610,12 +33729,12 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2479Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2479Slc - var yyhl2479 bool = l >= 0 - for yyj2479 := 0; ; yyj2479++ { - if yyhl2479 { - if yyj2479 >= l { + var yys2628Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2628Slc + var yyhl2628 bool = l >= 0 + for yyj2628 := 0; ; yyj2628++ { + if yyhl2628 { + if yyj2628 >= l { break } } else { @@ -31624,10 +33743,10 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2479Slc = r.DecodeBytes(yys2479Slc, true, true) - yys2479 := string(yys2479Slc) + yys2628Slc = r.DecodeBytes(yys2628Slc, true, true) + yys2628 := string(yys2628Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2479 { + switch yys2628 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -31644,34 +33763,34 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastHeartbeatTime = pkg2_unversioned.Time{} } else { - yyv2482 := &x.LastHeartbeatTime - yym2483 := z.DecBinary() - _ = yym2483 + yyv2631 := &x.LastHeartbeatTime + yym2632 := z.DecBinary() + _ = yym2632 if false { - } else if z.HasExtensions() && z.DecExt(yyv2482) { - } else if yym2483 { - z.DecBinaryUnmarshal(yyv2482) - } else if !yym2483 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2482) + } else if z.HasExtensions() && z.DecExt(yyv2631) { + } else if yym2632 { + z.DecBinaryUnmarshal(yyv2631) + } else if !yym2632 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2631) } else { - z.DecFallback(yyv2482, false) + z.DecFallback(yyv2631, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv2484 := &x.LastTransitionTime - yym2485 := z.DecBinary() - _ = yym2485 + yyv2633 := &x.LastTransitionTime + yym2634 := z.DecBinary() + _ = yym2634 if false { - } else if z.HasExtensions() && z.DecExt(yyv2484) { - } else if yym2485 { - z.DecBinaryUnmarshal(yyv2484) - } else if !yym2485 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2484) + } else if z.HasExtensions() && z.DecExt(yyv2633) { + } else if yym2634 { + z.DecBinaryUnmarshal(yyv2633) + } else if !yym2634 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2633) } else { - z.DecFallback(yyv2484, false) + z.DecFallback(yyv2633, false) } } case "reason": @@ -31687,9 +33806,9 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2479) - } // end switch yys2479 - } // end for yyj2479 + z.DecStructFieldNotFound(-1, yys2628) + } // end switch yys2628 + } // end for yyj2628 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -31697,16 +33816,16 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2488 int - var yyb2488 bool - var yyhl2488 bool = l >= 0 - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + var yyj2637 int + var yyb2637 bool + var yyhl2637 bool = l >= 0 + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31716,13 +33835,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = NodeConditionType(r.DecodeString()) } - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31732,13 +33851,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31746,26 +33865,26 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastHeartbeatTime = pkg2_unversioned.Time{} } else { - yyv2491 := &x.LastHeartbeatTime - yym2492 := z.DecBinary() - _ = yym2492 + yyv2640 := &x.LastHeartbeatTime + yym2641 := z.DecBinary() + _ = yym2641 if false { - } else if z.HasExtensions() && z.DecExt(yyv2491) { - } else if yym2492 { - z.DecBinaryUnmarshal(yyv2491) - } else if !yym2492 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2491) + } else if z.HasExtensions() && z.DecExt(yyv2640) { + } else if yym2641 { + z.DecBinaryUnmarshal(yyv2640) + } else if !yym2641 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2640) } else { - z.DecFallback(yyv2491, false) + z.DecFallback(yyv2640, false) } } - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31773,26 +33892,26 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv2493 := &x.LastTransitionTime - yym2494 := z.DecBinary() - _ = yym2494 + yyv2642 := &x.LastTransitionTime + yym2643 := z.DecBinary() + _ = yym2643 if false { - } else if z.HasExtensions() && z.DecExt(yyv2493) { - } else if yym2494 { - z.DecBinaryUnmarshal(yyv2493) - } else if !yym2494 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2493) + } else if z.HasExtensions() && z.DecExt(yyv2642) { + } else if yym2643 { + z.DecBinaryUnmarshal(yyv2642) + } else if !yym2643 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2642) } else { - z.DecFallback(yyv2493, false) + z.DecFallback(yyv2642, false) } } - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31802,13 +33921,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31819,17 +33938,17 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj2488++ - if yyhl2488 { - yyb2488 = yyj2488 > l + yyj2637++ + if yyhl2637 { + yyb2637 = yyj2637 > l } else { - yyb2488 = r.CheckBreak() + yyb2637 = r.CheckBreak() } - if yyb2488 { + if yyb2637 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2488-1, "") + z.DecStructFieldNotFound(yyj2637-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31838,8 +33957,8 @@ func (x NodeAddressType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2497 := z.EncBinary() - _ = yym2497 + yym2646 := z.EncBinary() + _ = yym2646 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31851,8 +33970,8 @@ func (x *NodeAddressType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2498 := z.DecBinary() - _ = yym2498 + yym2647 := z.DecBinary() + _ = yym2647 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31867,30 +33986,30 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2499 := z.EncBinary() - _ = yym2499 + yym2648 := z.EncBinary() + _ = yym2648 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2500 := !z.EncBinary() - yy2arr2500 := z.EncBasicHandle().StructToArray - var yyq2500 [2]bool - _, _, _ = yysep2500, yyq2500, yy2arr2500 - const yyr2500 bool = false - var yynn2500 int - if yyr2500 || yy2arr2500 { + yysep2649 := !z.EncBinary() + yy2arr2649 := z.EncBasicHandle().StructToArray + var yyq2649 [2]bool + _, _, _ = yysep2649, yyq2649, yy2arr2649 + const yyr2649 bool = false + var yynn2649 int + if yyr2649 || yy2arr2649 { r.EncodeArrayStart(2) } else { - yynn2500 = 2 - for _, b := range yyq2500 { + yynn2649 = 2 + for _, b := range yyq2649 { if b { - yynn2500++ + yynn2649++ } } - r.EncodeMapStart(yynn2500) - yynn2500 = 0 + r.EncodeMapStart(yynn2649) + yynn2649 = 0 } - if yyr2500 || yy2arr2500 { + if yyr2649 || yy2arr2649 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -31899,10 +34018,10 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr2500 || yy2arr2500 { + if yyr2649 || yy2arr2649 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2503 := z.EncBinary() - _ = yym2503 + yym2652 := z.EncBinary() + _ = yym2652 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) @@ -31911,14 +34030,14 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("address")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2504 := z.EncBinary() - _ = yym2504 + yym2653 := z.EncBinary() + _ = yym2653 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) } } - if yyr2500 || yy2arr2500 { + if yyr2649 || yy2arr2649 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31931,25 +34050,25 @@ func (x *NodeAddress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2505 := z.DecBinary() - _ = yym2505 + yym2654 := z.DecBinary() + _ = yym2654 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2506 := r.ContainerType() - if yyct2506 == codecSelferValueTypeMap1234 { - yyl2506 := r.ReadMapStart() - if yyl2506 == 0 { + yyct2655 := r.ContainerType() + if yyct2655 == codecSelferValueTypeMap1234 { + yyl2655 := r.ReadMapStart() + if yyl2655 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2506, d) + x.codecDecodeSelfFromMap(yyl2655, d) } - } else if yyct2506 == codecSelferValueTypeArray1234 { - yyl2506 := r.ReadArrayStart() - if yyl2506 == 0 { + } else if yyct2655 == codecSelferValueTypeArray1234 { + yyl2655 := r.ReadArrayStart() + if yyl2655 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2506, d) + x.codecDecodeSelfFromArray(yyl2655, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31961,12 +34080,12 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2507Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2507Slc - var yyhl2507 bool = l >= 0 - for yyj2507 := 0; ; yyj2507++ { - if yyhl2507 { - if yyj2507 >= l { + var yys2656Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2656Slc + var yyhl2656 bool = l >= 0 + for yyj2656 := 0; ; yyj2656++ { + if yyhl2656 { + if yyj2656 >= l { break } } else { @@ -31975,10 +34094,10 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2507Slc = r.DecodeBytes(yys2507Slc, true, true) - yys2507 := string(yys2507Slc) + yys2656Slc = r.DecodeBytes(yys2656Slc, true, true) + yys2656 := string(yys2656Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2507 { + switch yys2656 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -31992,9 +34111,9 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Address = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2507) - } // end switch yys2507 - } // end for yyj2507 + z.DecStructFieldNotFound(-1, yys2656) + } // end switch yys2656 + } // end for yyj2656 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -32002,16 +34121,16 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2510 int - var yyb2510 bool - var yyhl2510 bool = l >= 0 - yyj2510++ - if yyhl2510 { - yyb2510 = yyj2510 > l + var yyj2659 int + var yyb2659 bool + var yyhl2659 bool = l >= 0 + yyj2659++ + if yyhl2659 { + yyb2659 = yyj2659 > l } else { - yyb2510 = r.CheckBreak() + yyb2659 = r.CheckBreak() } - if yyb2510 { + if yyb2659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -32021,13 +34140,13 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = NodeAddressType(r.DecodeString()) } - yyj2510++ - if yyhl2510 { - yyb2510 = yyj2510 > l + yyj2659++ + if yyhl2659 { + yyb2659 = yyj2659 > l } else { - yyb2510 = r.CheckBreak() + yyb2659 = r.CheckBreak() } - if yyb2510 { + if yyb2659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -32038,17 +34157,17 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Address = string(r.DecodeString()) } for { - yyj2510++ - if yyhl2510 { - yyb2510 = yyj2510 > l + yyj2659++ + if yyhl2659 { + yyb2659 = yyj2659 > l } else { - yyb2510 = r.CheckBreak() + yyb2659 = r.CheckBreak() } - if yyb2510 { + if yyb2659 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2510-1, "") + z.DecStructFieldNotFound(yyj2659-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -32060,33 +34179,33 @@ func (x *NodeResources) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2513 := z.EncBinary() - _ = yym2513 + yym2662 := z.EncBinary() + _ = yym2662 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2514 := !z.EncBinary() - yy2arr2514 := z.EncBasicHandle().StructToArray - var yyq2514 [1]bool - _, _, _ = yysep2514, yyq2514, yy2arr2514 - const yyr2514 bool = false - yyq2514[0] = len(x.Capacity) != 0 - var yynn2514 int - if yyr2514 || yy2arr2514 { + yysep2663 := !z.EncBinary() + yy2arr2663 := z.EncBasicHandle().StructToArray + var yyq2663 [1]bool + _, _, _ = yysep2663, yyq2663, yy2arr2663 + const yyr2663 bool = false + yyq2663[0] = len(x.Capacity) != 0 + var yynn2663 int + if yyr2663 || yy2arr2663 { r.EncodeArrayStart(1) } else { - yynn2514 = 0 - for _, b := range yyq2514 { + yynn2663 = 0 + for _, b := range yyq2663 { if b { - yynn2514++ + yynn2663++ } } - r.EncodeMapStart(yynn2514) - yynn2514 = 0 + r.EncodeMapStart(yynn2663) + yynn2663 = 0 } - if yyr2514 || yy2arr2514 { + if yyr2663 || yy2arr2663 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2514[0] { + if yyq2663[0] { if x.Capacity == nil { r.EncodeNil() } else { @@ -32096,7 +34215,7 @@ func (x *NodeResources) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2514[0] { + if yyq2663[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -32107,7 +34226,7 @@ func (x *NodeResources) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2514 || yy2arr2514 { + if yyr2663 || yy2arr2663 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -32120,25 +34239,25 @@ func (x *NodeResources) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2516 := z.DecBinary() - _ = yym2516 + yym2665 := z.DecBinary() + _ = yym2665 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2517 := r.ContainerType() - if yyct2517 == codecSelferValueTypeMap1234 { - yyl2517 := r.ReadMapStart() - if yyl2517 == 0 { + yyct2666 := r.ContainerType() + if yyct2666 == codecSelferValueTypeMap1234 { + yyl2666 := r.ReadMapStart() + if yyl2666 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2517, d) + x.codecDecodeSelfFromMap(yyl2666, d) } - } else if yyct2517 == codecSelferValueTypeArray1234 { - yyl2517 := r.ReadArrayStart() - if yyl2517 == 0 { + } else if yyct2666 == codecSelferValueTypeArray1234 { + yyl2666 := r.ReadArrayStart() + if yyl2666 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2517, d) + x.codecDecodeSelfFromArray(yyl2666, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -32150,12 +34269,12 @@ func (x *NodeResources) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2518Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2518Slc - var yyhl2518 bool = l >= 0 - for yyj2518 := 0; ; yyj2518++ { - if yyhl2518 { - if yyj2518 >= l { + var yys2667Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2667Slc + var yyhl2667 bool = l >= 0 + for yyj2667 := 0; ; yyj2667++ { + if yyhl2667 { + if yyj2667 >= l { break } } else { @@ -32164,21 +34283,21 @@ func (x *NodeResources) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2518Slc = r.DecodeBytes(yys2518Slc, true, true) - yys2518 := string(yys2518Slc) + yys2667Slc = r.DecodeBytes(yys2667Slc, true, true) + yys2667 := string(yys2667Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2518 { + switch yys2667 { case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2519 := &x.Capacity - yyv2519.CodecDecodeSelf(d) + yyv2668 := &x.Capacity + yyv2668.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys2518) - } // end switch yys2518 - } // end for yyj2518 + z.DecStructFieldNotFound(-1, yys2667) + } // end switch yys2667 + } // end for yyj2667 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -32186,16 +34305,16 @@ func (x *NodeResources) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2520 int - var yyb2520 bool - var yyhl2520 bool = l >= 0 - yyj2520++ - if yyhl2520 { - yyb2520 = yyj2520 > l + var yyj2669 int + var yyb2669 bool + var yyhl2669 bool = l >= 0 + yyj2669++ + if yyhl2669 { + yyb2669 = yyj2669 > l } else { - yyb2520 = r.CheckBreak() + yyb2669 = r.CheckBreak() } - if yyb2520 { + if yyb2669 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -32203,21 +34322,21 @@ func (x *NodeResources) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2521 := &x.Capacity - yyv2521.CodecDecodeSelf(d) + yyv2670 := &x.Capacity + yyv2670.CodecDecodeSelf(d) } for { - yyj2520++ - if yyhl2520 { - yyb2520 = yyj2520 > l + yyj2669++ + if yyhl2669 { + yyb2669 = yyj2669 > l } else { - yyb2520 = r.CheckBreak() + yyb2669 = r.CheckBreak() } - if yyb2520 { + if yyb2669 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2520-1, "") + z.DecStructFieldNotFound(yyj2669-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -32226,8 +34345,8 @@ func (x ResourceName) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2522 := z.EncBinary() - _ = yym2522 + yym2671 := z.EncBinary() + _ = yym2671 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -32239,8 +34358,8 @@ func (x *ResourceName) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2523 := z.DecBinary() - _ = yym2523 + yym2672 := z.DecBinary() + _ = yym2672 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -32255,8 +34374,8 @@ func (x ResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2524 := z.EncBinary() - _ = yym2524 + yym2673 := z.EncBinary() + _ = yym2673 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -32269,8 +34388,8 @@ func (x *ResourceList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2525 := z.DecBinary() - _ = yym2525 + yym2674 := z.DecBinary() + _ = yym2674 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -32285,136 +34404,136 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2526 := z.EncBinary() - _ = yym2526 + yym2675 := z.EncBinary() + _ = yym2675 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2527 := !z.EncBinary() - yy2arr2527 := z.EncBasicHandle().StructToArray - var yyq2527 [5]bool - _, _, _ = yysep2527, yyq2527, yy2arr2527 - const yyr2527 bool = false - yyq2527[0] = x.Kind != "" - yyq2527[1] = x.APIVersion != "" - yyq2527[2] = true - yyq2527[3] = true - yyq2527[4] = true - var yynn2527 int - if yyr2527 || yy2arr2527 { + yysep2676 := !z.EncBinary() + yy2arr2676 := z.EncBasicHandle().StructToArray + var yyq2676 [5]bool + _, _, _ = yysep2676, yyq2676, yy2arr2676 + const yyr2676 bool = false + yyq2676[0] = true + yyq2676[1] = true + yyq2676[2] = true + yyq2676[3] = x.Kind != "" + yyq2676[4] = x.APIVersion != "" + var yynn2676 int + if yyr2676 || yy2arr2676 { r.EncodeArrayStart(5) } else { - yynn2527 = 0 - for _, b := range yyq2527 { + yynn2676 = 0 + for _, b := range yyq2676 { if b { - yynn2527++ + yynn2676++ } } - r.EncodeMapStart(yynn2527) - yynn2527 = 0 + r.EncodeMapStart(yynn2676) + yynn2676 = 0 } - if yyr2527 || yy2arr2527 { + if yyr2676 || yy2arr2676 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2527[0] { - yym2529 := z.EncBinary() - _ = yym2529 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2527[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2530 := z.EncBinary() - _ = yym2530 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2527 || yy2arr2527 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2527[1] { - yym2532 := z.EncBinary() - _ = yym2532 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2527[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2533 := z.EncBinary() - _ = yym2533 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2527 || yy2arr2527 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2527[2] { - yy2535 := &x.ObjectMeta - yy2535.CodecEncodeSelf(e) + if yyq2676[0] { + yy2678 := &x.ObjectMeta + yy2678.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2527[2] { + if yyq2676[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2536 := &x.ObjectMeta - yy2536.CodecEncodeSelf(e) + yy2679 := &x.ObjectMeta + yy2679.CodecEncodeSelf(e) } } - if yyr2527 || yy2arr2527 { + if yyr2676 || yy2arr2676 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2527[3] { - yy2538 := &x.Spec - yy2538.CodecEncodeSelf(e) + if yyq2676[1] { + yy2681 := &x.Spec + yy2681.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2527[3] { + if yyq2676[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2539 := &x.Spec - yy2539.CodecEncodeSelf(e) + yy2682 := &x.Spec + yy2682.CodecEncodeSelf(e) } } - if yyr2527 || yy2arr2527 { + if yyr2676 || yy2arr2676 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2527[4] { - yy2541 := &x.Status - yy2541.CodecEncodeSelf(e) + if yyq2676[2] { + yy2684 := &x.Status + yy2684.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2527[4] { + if yyq2676[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2542 := &x.Status - yy2542.CodecEncodeSelf(e) + yy2685 := &x.Status + yy2685.CodecEncodeSelf(e) } } - if yyr2527 || yy2arr2527 { + if yyr2676 || yy2arr2676 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2676[3] { + yym2687 := z.EncBinary() + _ = yym2687 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2676[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2688 := z.EncBinary() + _ = yym2688 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2676 || yy2arr2676 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2676[4] { + yym2690 := z.EncBinary() + _ = yym2690 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2676[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2691 := z.EncBinary() + _ = yym2691 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2676 || yy2arr2676 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -32424,1748 +34543,6 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2543 := z.DecBinary() - _ = yym2543 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2544 := r.ContainerType() - if yyct2544 == codecSelferValueTypeMap1234 { - yyl2544 := r.ReadMapStart() - if yyl2544 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2544, d) - } - } else if yyct2544 == codecSelferValueTypeArray1234 { - yyl2544 := r.ReadArrayStart() - if yyl2544 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2544, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2545Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2545Slc - var yyhl2545 bool = l >= 0 - for yyj2545 := 0; ; yyj2545++ { - if yyhl2545 { - if yyj2545 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2545Slc = r.DecodeBytes(yys2545Slc, true, true) - yys2545 := string(yys2545Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2545 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2548 := &x.ObjectMeta - yyv2548.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = NodeSpec{} - } else { - yyv2549 := &x.Spec - yyv2549.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = NodeStatus{} - } else { - yyv2550 := &x.Status - yyv2550.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys2545) - } // end switch yys2545 - } // end for yyj2545 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2551 int - var yyb2551 bool - var yyhl2551 bool = l >= 0 - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2554 := &x.ObjectMeta - yyv2554.CodecDecodeSelf(d) - } - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = NodeSpec{} - } else { - yyv2555 := &x.Spec - yyv2555.CodecDecodeSelf(d) - } - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = NodeStatus{} - } else { - yyv2556 := &x.Status - yyv2556.CodecDecodeSelf(d) - } - for { - yyj2551++ - if yyhl2551 { - yyb2551 = yyj2551 > l - } else { - yyb2551 = r.CheckBreak() - } - if yyb2551 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2551-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NodeList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2557 := z.EncBinary() - _ = yym2557 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2558 := !z.EncBinary() - yy2arr2558 := z.EncBasicHandle().StructToArray - var yyq2558 [4]bool - _, _, _ = yysep2558, yyq2558, yy2arr2558 - const yyr2558 bool = false - yyq2558[0] = x.Kind != "" - yyq2558[1] = x.APIVersion != "" - yyq2558[2] = true - var yynn2558 int - if yyr2558 || yy2arr2558 { - r.EncodeArrayStart(4) - } else { - yynn2558 = 1 - for _, b := range yyq2558 { - if b { - yynn2558++ - } - } - r.EncodeMapStart(yynn2558) - yynn2558 = 0 - } - if yyr2558 || yy2arr2558 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2558[0] { - yym2560 := z.EncBinary() - _ = yym2560 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2558[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2561 := z.EncBinary() - _ = yym2561 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2558 || yy2arr2558 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2558[1] { - yym2563 := z.EncBinary() - _ = yym2563 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2558[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2564 := z.EncBinary() - _ = yym2564 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2558 || yy2arr2558 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2558[2] { - yy2566 := &x.ListMeta - yym2567 := z.EncBinary() - _ = yym2567 - if false { - } else if z.HasExtensions() && z.EncExt(yy2566) { - } else { - z.EncFallback(yy2566) - } - } else { - r.EncodeNil() - } - } else { - if yyq2558[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2568 := &x.ListMeta - yym2569 := z.EncBinary() - _ = yym2569 - if false { - } else if z.HasExtensions() && z.EncExt(yy2568) { - } else { - z.EncFallback(yy2568) - } - } - } - if yyr2558 || yy2arr2558 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2571 := z.EncBinary() - _ = yym2571 - if false { - } else { - h.encSliceNode(([]Node)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2572 := z.EncBinary() - _ = yym2572 - if false { - } else { - h.encSliceNode(([]Node)(x.Items), e) - } - } - } - if yyr2558 || yy2arr2558 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NodeList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2573 := z.DecBinary() - _ = yym2573 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2574 := r.ContainerType() - if yyct2574 == codecSelferValueTypeMap1234 { - yyl2574 := r.ReadMapStart() - if yyl2574 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2574, d) - } - } else if yyct2574 == codecSelferValueTypeArray1234 { - yyl2574 := r.ReadArrayStart() - if yyl2574 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2574, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NodeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2575Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2575Slc - var yyhl2575 bool = l >= 0 - for yyj2575 := 0; ; yyj2575++ { - if yyhl2575 { - if yyj2575 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2575Slc = r.DecodeBytes(yys2575Slc, true, true) - yys2575 := string(yys2575Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2575 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2578 := &x.ListMeta - yym2579 := z.DecBinary() - _ = yym2579 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2578) { - } else { - z.DecFallback(yyv2578, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2580 := &x.Items - yym2581 := z.DecBinary() - _ = yym2581 - if false { - } else { - h.decSliceNode((*[]Node)(yyv2580), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2575) - } // end switch yys2575 - } // end for yyj2575 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NodeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2582 int - var yyb2582 bool - var yyhl2582 bool = l >= 0 - yyj2582++ - if yyhl2582 { - yyb2582 = yyj2582 > l - } else { - yyb2582 = r.CheckBreak() - } - if yyb2582 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2582++ - if yyhl2582 { - yyb2582 = yyj2582 > l - } else { - yyb2582 = r.CheckBreak() - } - if yyb2582 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2582++ - if yyhl2582 { - yyb2582 = yyj2582 > l - } else { - yyb2582 = r.CheckBreak() - } - if yyb2582 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2585 := &x.ListMeta - yym2586 := z.DecBinary() - _ = yym2586 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2585) { - } else { - z.DecFallback(yyv2585, false) - } - } - yyj2582++ - if yyhl2582 { - yyb2582 = yyj2582 > l - } else { - yyb2582 = r.CheckBreak() - } - if yyb2582 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2587 := &x.Items - yym2588 := z.DecBinary() - _ = yym2588 - if false { - } else { - h.decSliceNode((*[]Node)(yyv2587), d) - } - } - for { - yyj2582++ - if yyhl2582 { - yyb2582 = yyj2582 > l - } else { - yyb2582 = r.CheckBreak() - } - if yyb2582 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2582-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NamespaceSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2589 := z.EncBinary() - _ = yym2589 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2590 := !z.EncBinary() - yy2arr2590 := z.EncBasicHandle().StructToArray - var yyq2590 [1]bool - _, _, _ = yysep2590, yyq2590, yy2arr2590 - const yyr2590 bool = false - var yynn2590 int - if yyr2590 || yy2arr2590 { - r.EncodeArrayStart(1) - } else { - yynn2590 = 1 - for _, b := range yyq2590 { - if b { - yynn2590++ - } - } - r.EncodeMapStart(yynn2590) - yynn2590 = 0 - } - if yyr2590 || yy2arr2590 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym2592 := z.EncBinary() - _ = yym2592 - if false { - } else { - h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Finalizers")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym2593 := z.EncBinary() - _ = yym2593 - if false { - } else { - h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) - } - } - } - if yyr2590 || yy2arr2590 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2594 := z.DecBinary() - _ = yym2594 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2595 := r.ContainerType() - if yyct2595 == codecSelferValueTypeMap1234 { - yyl2595 := r.ReadMapStart() - if yyl2595 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2595, d) - } - } else if yyct2595 == codecSelferValueTypeArray1234 { - yyl2595 := r.ReadArrayStart() - if yyl2595 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2595, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2596Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2596Slc - var yyhl2596 bool = l >= 0 - for yyj2596 := 0; ; yyj2596++ { - if yyhl2596 { - if yyj2596 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2596Slc = r.DecodeBytes(yys2596Slc, true, true) - yys2596 := string(yys2596Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2596 { - case "Finalizers": - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv2597 := &x.Finalizers - yym2598 := z.DecBinary() - _ = yym2598 - if false { - } else { - h.decSliceFinalizerName((*[]FinalizerName)(yyv2597), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2596) - } // end switch yys2596 - } // end for yyj2596 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2599 int - var yyb2599 bool - var yyhl2599 bool = l >= 0 - yyj2599++ - if yyhl2599 { - yyb2599 = yyj2599 > l - } else { - yyb2599 = r.CheckBreak() - } - if yyb2599 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv2600 := &x.Finalizers - yym2601 := z.DecBinary() - _ = yym2601 - if false { - } else { - h.decSliceFinalizerName((*[]FinalizerName)(yyv2600), d) - } - } - for { - yyj2599++ - if yyhl2599 { - yyb2599 = yyj2599 > l - } else { - yyb2599 = r.CheckBreak() - } - if yyb2599 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2599-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x FinalizerName) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym2602 := z.EncBinary() - _ = yym2602 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *FinalizerName) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2603 := z.DecBinary() - _ = yym2603 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *NamespaceStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2604 := z.EncBinary() - _ = yym2604 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2605 := !z.EncBinary() - yy2arr2605 := z.EncBasicHandle().StructToArray - var yyq2605 [1]bool - _, _, _ = yysep2605, yyq2605, yy2arr2605 - const yyr2605 bool = false - yyq2605[0] = x.Phase != "" - var yynn2605 int - if yyr2605 || yy2arr2605 { - r.EncodeArrayStart(1) - } else { - yynn2605 = 0 - for _, b := range yyq2605 { - if b { - yynn2605++ - } - } - r.EncodeMapStart(yynn2605) - yynn2605 = 0 - } - if yyr2605 || yy2arr2605 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2605[0] { - x.Phase.CodecEncodeSelf(e) - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2605[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("phase")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Phase.CodecEncodeSelf(e) - } - } - if yyr2605 || yy2arr2605 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2607 := z.DecBinary() - _ = yym2607 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2608 := r.ContainerType() - if yyct2608 == codecSelferValueTypeMap1234 { - yyl2608 := r.ReadMapStart() - if yyl2608 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2608, d) - } - } else if yyct2608 == codecSelferValueTypeArray1234 { - yyl2608 := r.ReadArrayStart() - if yyl2608 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2608, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2609Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2609Slc - var yyhl2609 bool = l >= 0 - for yyj2609 := 0; ; yyj2609++ { - if yyhl2609 { - if yyj2609 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2609Slc = r.DecodeBytes(yys2609Slc, true, true) - yys2609 := string(yys2609Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2609 { - case "phase": - if r.TryDecodeAsNil() { - x.Phase = "" - } else { - x.Phase = NamespacePhase(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys2609) - } // end switch yys2609 - } // end for yyj2609 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2611 int - var yyb2611 bool - var yyhl2611 bool = l >= 0 - yyj2611++ - if yyhl2611 { - yyb2611 = yyj2611 > l - } else { - yyb2611 = r.CheckBreak() - } - if yyb2611 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Phase = "" - } else { - x.Phase = NamespacePhase(r.DecodeString()) - } - for { - yyj2611++ - if yyhl2611 { - yyb2611 = yyj2611 > l - } else { - yyb2611 = r.CheckBreak() - } - if yyb2611 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2611-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x NamespacePhase) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym2613 := z.EncBinary() - _ = yym2613 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *NamespacePhase) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2614 := z.DecBinary() - _ = yym2614 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *Namespace) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2615 := z.EncBinary() - _ = yym2615 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2616 := !z.EncBinary() - yy2arr2616 := z.EncBasicHandle().StructToArray - var yyq2616 [5]bool - _, _, _ = yysep2616, yyq2616, yy2arr2616 - const yyr2616 bool = false - yyq2616[0] = x.Kind != "" - yyq2616[1] = x.APIVersion != "" - yyq2616[2] = true - yyq2616[3] = true - yyq2616[4] = true - var yynn2616 int - if yyr2616 || yy2arr2616 { - r.EncodeArrayStart(5) - } else { - yynn2616 = 0 - for _, b := range yyq2616 { - if b { - yynn2616++ - } - } - r.EncodeMapStart(yynn2616) - yynn2616 = 0 - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2616[0] { - yym2618 := z.EncBinary() - _ = yym2618 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2616[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2619 := z.EncBinary() - _ = yym2619 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2616[1] { - yym2621 := z.EncBinary() - _ = yym2621 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2616[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2622 := z.EncBinary() - _ = yym2622 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2616[2] { - yy2624 := &x.ObjectMeta - yy2624.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2616[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2625 := &x.ObjectMeta - yy2625.CodecEncodeSelf(e) - } - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2616[3] { - yy2627 := &x.Spec - yy2627.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2616[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2628 := &x.Spec - yy2628.CodecEncodeSelf(e) - } - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2616[4] { - yy2630 := &x.Status - yy2630.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2616[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2631 := &x.Status - yy2631.CodecEncodeSelf(e) - } - } - if yyr2616 || yy2arr2616 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Namespace) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2632 := z.DecBinary() - _ = yym2632 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2633 := r.ContainerType() - if yyct2633 == codecSelferValueTypeMap1234 { - yyl2633 := r.ReadMapStart() - if yyl2633 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2633, d) - } - } else if yyct2633 == codecSelferValueTypeArray1234 { - yyl2633 := r.ReadArrayStart() - if yyl2633 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2633, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Namespace) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2634Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2634Slc - var yyhl2634 bool = l >= 0 - for yyj2634 := 0; ; yyj2634++ { - if yyhl2634 { - if yyj2634 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2634Slc = r.DecodeBytes(yys2634Slc, true, true) - yys2634 := string(yys2634Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2634 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2637 := &x.ObjectMeta - yyv2637.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = NamespaceSpec{} - } else { - yyv2638 := &x.Spec - yyv2638.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = NamespaceStatus{} - } else { - yyv2639 := &x.Status - yyv2639.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys2634) - } // end switch yys2634 - } // end for yyj2634 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Namespace) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2640 int - var yyb2640 bool - var yyhl2640 bool = l >= 0 - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2643 := &x.ObjectMeta - yyv2643.CodecDecodeSelf(d) - } - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = NamespaceSpec{} - } else { - yyv2644 := &x.Spec - yyv2644.CodecDecodeSelf(d) - } - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = NamespaceStatus{} - } else { - yyv2645 := &x.Status - yyv2645.CodecDecodeSelf(d) - } - for { - yyj2640++ - if yyhl2640 { - yyb2640 = yyj2640 > l - } else { - yyb2640 = r.CheckBreak() - } - if yyb2640 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2640-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NamespaceList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2646 := z.EncBinary() - _ = yym2646 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2647 := !z.EncBinary() - yy2arr2647 := z.EncBasicHandle().StructToArray - var yyq2647 [4]bool - _, _, _ = yysep2647, yyq2647, yy2arr2647 - const yyr2647 bool = false - yyq2647[0] = x.Kind != "" - yyq2647[1] = x.APIVersion != "" - yyq2647[2] = true - var yynn2647 int - if yyr2647 || yy2arr2647 { - r.EncodeArrayStart(4) - } else { - yynn2647 = 1 - for _, b := range yyq2647 { - if b { - yynn2647++ - } - } - r.EncodeMapStart(yynn2647) - yynn2647 = 0 - } - if yyr2647 || yy2arr2647 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2647[0] { - yym2649 := z.EncBinary() - _ = yym2649 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2647[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2650 := z.EncBinary() - _ = yym2650 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2647 || yy2arr2647 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2647[1] { - yym2652 := z.EncBinary() - _ = yym2652 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2647[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2653 := z.EncBinary() - _ = yym2653 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2647 || yy2arr2647 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2647[2] { - yy2655 := &x.ListMeta - yym2656 := z.EncBinary() - _ = yym2656 - if false { - } else if z.HasExtensions() && z.EncExt(yy2655) { - } else { - z.EncFallback(yy2655) - } - } else { - r.EncodeNil() - } - } else { - if yyq2647[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2657 := &x.ListMeta - yym2658 := z.EncBinary() - _ = yym2658 - if false { - } else if z.HasExtensions() && z.EncExt(yy2657) { - } else { - z.EncFallback(yy2657) - } - } - } - if yyr2647 || yy2arr2647 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2660 := z.EncBinary() - _ = yym2660 - if false { - } else { - h.encSliceNamespace(([]Namespace)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2661 := z.EncBinary() - _ = yym2661 - if false { - } else { - h.encSliceNamespace(([]Namespace)(x.Items), e) - } - } - } - if yyr2647 || yy2arr2647 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2662 := z.DecBinary() - _ = yym2662 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2663 := r.ContainerType() - if yyct2663 == codecSelferValueTypeMap1234 { - yyl2663 := r.ReadMapStart() - if yyl2663 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2663, d) - } - } else if yyct2663 == codecSelferValueTypeArray1234 { - yyl2663 := r.ReadArrayStart() - if yyl2663 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2663, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2664Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2664Slc - var yyhl2664 bool = l >= 0 - for yyj2664 := 0; ; yyj2664++ { - if yyhl2664 { - if yyj2664 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2664Slc = r.DecodeBytes(yys2664Slc, true, true) - yys2664 := string(yys2664Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2664 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2667 := &x.ListMeta - yym2668 := z.DecBinary() - _ = yym2668 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2667) { - } else { - z.DecFallback(yyv2667, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2669 := &x.Items - yym2670 := z.DecBinary() - _ = yym2670 - if false { - } else { - h.decSliceNamespace((*[]Namespace)(yyv2669), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2664) - } // end switch yys2664 - } // end for yyj2664 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2671 int - var yyb2671 bool - var yyhl2671 bool = l >= 0 - yyj2671++ - if yyhl2671 { - yyb2671 = yyj2671 > l - } else { - yyb2671 = r.CheckBreak() - } - if yyb2671 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2671++ - if yyhl2671 { - yyb2671 = yyj2671 > l - } else { - yyb2671 = r.CheckBreak() - } - if yyb2671 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2671++ - if yyhl2671 { - yyb2671 = yyj2671 > l - } else { - yyb2671 = r.CheckBreak() - } - if yyb2671 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2674 := &x.ListMeta - yym2675 := z.DecBinary() - _ = yym2675 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2674) { - } else { - z.DecFallback(yyv2674, false) - } - } - yyj2671++ - if yyhl2671 { - yyb2671 = yyj2671 > l - } else { - yyb2671 = r.CheckBreak() - } - if yyb2671 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2676 := &x.Items - yym2677 := z.DecBinary() - _ = yym2677 - if false { - } else { - h.decSliceNamespace((*[]Namespace)(yyv2676), d) - } - } - for { - yyj2671++ - if yyhl2671 { - yyb2671 = yyj2671 > l - } else { - yyb2671 = r.CheckBreak() - } - if yyb2671 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2671-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Binding) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2678 := z.EncBinary() - _ = yym2678 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2679 := !z.EncBinary() - yy2arr2679 := z.EncBasicHandle().StructToArray - var yyq2679 [4]bool - _, _, _ = yysep2679, yyq2679, yy2arr2679 - const yyr2679 bool = false - yyq2679[0] = x.Kind != "" - yyq2679[1] = x.APIVersion != "" - yyq2679[2] = true - var yynn2679 int - if yyr2679 || yy2arr2679 { - r.EncodeArrayStart(4) - } else { - yynn2679 = 1 - for _, b := range yyq2679 { - if b { - yynn2679++ - } - } - r.EncodeMapStart(yynn2679) - yynn2679 = 0 - } - if yyr2679 || yy2arr2679 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2679[0] { - yym2681 := z.EncBinary() - _ = yym2681 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2679[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2682 := z.EncBinary() - _ = yym2682 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2679 || yy2arr2679 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2679[1] { - yym2684 := z.EncBinary() - _ = yym2684 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2679[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2685 := z.EncBinary() - _ = yym2685 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2679 || yy2arr2679 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2679[2] { - yy2687 := &x.ObjectMeta - yy2687.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2679[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2688 := &x.ObjectMeta - yy2688.CodecEncodeSelf(e) - } - } - if yyr2679 || yy2arr2679 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy2690 := &x.Target - yy2690.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("target")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2691 := &x.Target - yy2691.CodecEncodeSelf(e) - } - if yyr2679 || yy2arr2679 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -34195,7 +34572,7 @@ func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -34217,6 +34594,27 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys2694 := string(yys2694Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys2694 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2695 := &x.ObjectMeta + yyv2695.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = NodeSpec{} + } else { + yyv2696 := &x.Spec + yyv2696.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = NodeStatus{} + } else { + yyv2697 := &x.Status + yyv2697.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -34229,20 +34627,6 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2697 := &x.ObjectMeta - yyv2697.CodecDecodeSelf(d) - } - case "target": - if r.TryDecodeAsNil() { - x.Target = ObjectReference{} - } else { - yyv2698 := &x.Target - yyv2698.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys2694) } // end switch yys2694 @@ -34250,20 +34634,71 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2699 int - var yyb2699 bool - var yyhl2699 bool = l >= 0 - yyj2699++ - if yyhl2699 { - yyb2699 = yyj2699 > l + var yyj2700 int + var yyb2700 bool + var yyhl2700 bool = l >= 0 + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l } else { - yyb2699 = r.CheckBreak() + yyb2700 = r.CheckBreak() } - if yyb2699 { + if yyb2700 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2701 := &x.ObjectMeta + yyv2701.CodecDecodeSelf(d) + } + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l + } else { + yyb2700 = r.CheckBreak() + } + if yyb2700 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = NodeSpec{} + } else { + yyv2702 := &x.Spec + yyv2702.CodecDecodeSelf(d) + } + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l + } else { + yyb2700 = r.CheckBreak() + } + if yyb2700 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = NodeStatus{} + } else { + yyv2703 := &x.Status + yyv2703.CodecDecodeSelf(d) + } + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l + } else { + yyb2700 = r.CheckBreak() + } + if yyb2700 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34273,13 +34708,13 @@ func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2699++ - if yyhl2699 { - yyb2699 = yyj2699 > l + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l } else { - yyb2699 = r.CheckBreak() + yyb2700 = r.CheckBreak() } - if yyb2699 { + if yyb2700 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34289,168 +34724,162 @@ func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2699++ - if yyhl2699 { - yyb2699 = yyj2699 > l - } else { - yyb2699 = r.CheckBreak() - } - if yyb2699 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2702 := &x.ObjectMeta - yyv2702.CodecDecodeSelf(d) - } - yyj2699++ - if yyhl2699 { - yyb2699 = yyj2699 > l - } else { - yyb2699 = r.CheckBreak() - } - if yyb2699 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Target = ObjectReference{} - } else { - yyv2703 := &x.Target - yyv2703.CodecDecodeSelf(d) - } for { - yyj2699++ - if yyhl2699 { - yyb2699 = yyj2699 > l + yyj2700++ + if yyhl2700 { + yyb2700 = yyj2700 > l } else { - yyb2699 = r.CheckBreak() + yyb2700 = r.CheckBreak() } - if yyb2699 { + if yyb2700 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2699-1, "") + z.DecStructFieldNotFound(yyj2700-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *NodeList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym2704 := z.EncBinary() - _ = yym2704 + yym2706 := z.EncBinary() + _ = yym2706 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2705 := !z.EncBinary() - yy2arr2705 := z.EncBasicHandle().StructToArray - var yyq2705 [3]bool - _, _, _ = yysep2705, yyq2705, yy2arr2705 - const yyr2705 bool = false - yyq2705[0] = x.Kind != "" - yyq2705[1] = x.APIVersion != "" - var yynn2705 int - if yyr2705 || yy2arr2705 { - r.EncodeArrayStart(3) + yysep2707 := !z.EncBinary() + yy2arr2707 := z.EncBasicHandle().StructToArray + var yyq2707 [4]bool + _, _, _ = yysep2707, yyq2707, yy2arr2707 + const yyr2707 bool = false + yyq2707[0] = true + yyq2707[2] = x.Kind != "" + yyq2707[3] = x.APIVersion != "" + var yynn2707 int + if yyr2707 || yy2arr2707 { + r.EncodeArrayStart(4) } else { - yynn2705 = 1 - for _, b := range yyq2705 { + yynn2707 = 1 + for _, b := range yyq2707 { if b { - yynn2705++ + yynn2707++ } } - r.EncodeMapStart(yynn2705) - yynn2705 = 0 + r.EncodeMapStart(yynn2707) + yynn2707 = 0 } - if yyr2705 || yy2arr2705 { + if yyr2707 || yy2arr2707 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2705[0] { - yym2707 := z.EncBinary() - _ = yym2707 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2705[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2708 := z.EncBinary() - _ = yym2708 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2705 || yy2arr2705 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2705[1] { + if yyq2707[0] { + yy2709 := &x.ListMeta yym2710 := z.EncBinary() _ = yym2710 if false { + } else if z.HasExtensions() && z.EncExt(yy2709) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + z.EncFallback(yy2709) } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { - if yyq2705[1] { + if yyq2707[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2711 := z.EncBinary() - _ = yym2711 + yy2711 := &x.ListMeta + yym2712 := z.EncBinary() + _ = yym2712 if false { + } else if z.HasExtensions() && z.EncExt(yy2711) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + z.EncFallback(yy2711) } } } - if yyr2705 || yy2arr2705 { + if yyr2707 || yy2arr2707 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.GracePeriodSeconds == nil { + if x.Items == nil { r.EncodeNil() } else { - yy2713 := *x.GracePeriodSeconds yym2714 := z.EncBinary() _ = yym2714 if false { } else { - r.EncodeInt(int64(yy2713)) + h.encSliceNode(([]Node)(x.Items), e) } } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("gracePeriodSeconds")) + r.EncodeString(codecSelferC_UTF81234, string("items")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.GracePeriodSeconds == nil { + if x.Items == nil { r.EncodeNil() } else { - yy2715 := *x.GracePeriodSeconds - yym2716 := z.EncBinary() - _ = yym2716 + yym2715 := z.EncBinary() + _ = yym2715 if false { } else { - r.EncodeInt(int64(yy2715)) + h.encSliceNode(([]Node)(x.Items), e) } } } - if yyr2705 || yy2arr2705 { + if yyr2707 || yy2arr2707 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2707[2] { + yym2717 := z.EncBinary() + _ = yym2717 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2707[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2718 := z.EncBinary() + _ = yym2718 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2707 || yy2arr2707 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2707[3] { + yym2720 := z.EncBinary() + _ = yym2720 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2707[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2721 := z.EncBinary() + _ = yym2721 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2707 || yy2arr2707 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -34459,29 +34888,29 @@ func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *NodeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2717 := z.DecBinary() - _ = yym2717 + yym2722 := z.DecBinary() + _ = yym2722 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2718 := r.ContainerType() - if yyct2718 == codecSelferValueTypeMap1234 { - yyl2718 := r.ReadMapStart() - if yyl2718 == 0 { + yyct2723 := r.ContainerType() + if yyct2723 == codecSelferValueTypeMap1234 { + yyl2723 := r.ReadMapStart() + if yyl2723 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2718, d) + x.codecDecodeSelfFromMap(yyl2723, d) } - } else if yyct2718 == codecSelferValueTypeArray1234 { - yyl2718 := r.ReadArrayStart() - if yyl2718 == 0 { + } else if yyct2723 == codecSelferValueTypeArray1234 { + yyl2723 := r.ReadArrayStart() + if yyl2723 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2718, d) + x.codecDecodeSelfFromArray(yyl2723, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -34489,16 +34918,16 @@ func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *NodeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2719Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2719Slc - var yyhl2719 bool = l >= 0 - for yyj2719 := 0; ; yyj2719++ { - if yyhl2719 { - if yyj2719 >= l { + var yys2724Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2724Slc + var yyhl2724 bool = l >= 0 + for yyj2724 := 0; ; yyj2724++ { + if yyhl2724 { + if yyj2724 >= l { break } } else { @@ -34507,10 +34936,35 @@ func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2719Slc = r.DecodeBytes(yys2719Slc, true, true) - yys2719 := string(yys2719Slc) + yys2724Slc = r.DecodeBytes(yys2724Slc, true, true) + yys2724 := string(yys2724Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2719 { + switch yys2724 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2725 := &x.ListMeta + yym2726 := z.DecBinary() + _ = yym2726 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2725) { + } else { + z.DecFallback(yyv2725, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2727 := &x.Items + yym2728 := z.DecBinary() + _ = yym2728 + if false { + } else { + h.decSliceNode((*[]Node)(yyv2727), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -34523,43 +34977,72 @@ func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "gracePeriodSeconds": - if r.TryDecodeAsNil() { - if x.GracePeriodSeconds != nil { - x.GracePeriodSeconds = nil - } - } else { - if x.GracePeriodSeconds == nil { - x.GracePeriodSeconds = new(int64) - } - yym2723 := z.DecBinary() - _ = yym2723 - if false { - } else { - *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } default: - z.DecStructFieldNotFound(-1, yys2719) - } // end switch yys2719 - } // end for yyj2719 + z.DecStructFieldNotFound(-1, yys2724) + } // end switch yys2724 + } // end for yyj2724 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *NodeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2724 int - var yyb2724 bool - var yyhl2724 bool = l >= 0 - yyj2724++ - if yyhl2724 { - yyb2724 = yyj2724 > l + var yyj2731 int + var yyb2731 bool + var yyhl2731 bool = l >= 0 + yyj2731++ + if yyhl2731 { + yyb2731 = yyj2731 > l } else { - yyb2724 = r.CheckBreak() + yyb2731 = r.CheckBreak() } - if yyb2724 { + if yyb2731 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2732 := &x.ListMeta + yym2733 := z.DecBinary() + _ = yym2733 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2732) { + } else { + z.DecFallback(yyv2732, false) + } + } + yyj2731++ + if yyhl2731 { + yyb2731 = yyj2731 > l + } else { + yyb2731 = r.CheckBreak() + } + if yyb2731 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2734 := &x.Items + yym2735 := z.DecBinary() + _ = yym2735 + if false { + } else { + h.decSliceNode((*[]Node)(yyv2734), d) + } + } + yyj2731++ + if yyhl2731 { + yyb2731 = yyj2731 > l + } else { + yyb2731 = r.CheckBreak() + } + if yyb2731 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34569,13 +35052,13 @@ func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2724++ - if yyhl2724 { - yyb2724 = yyj2724 > l + yyj2731++ + if yyhl2731 { + yyb2731 = yyj2731 > l } else { - yyb2724 = r.CheckBreak() + yyb2731 = r.CheckBreak() } - if yyb2724 { + if yyb2731 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34585,169 +35068,80 @@ func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2724++ - if yyhl2724 { - yyb2724 = yyj2724 > l - } else { - yyb2724 = r.CheckBreak() - } - if yyb2724 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.GracePeriodSeconds != nil { - x.GracePeriodSeconds = nil - } - } else { - if x.GracePeriodSeconds == nil { - x.GracePeriodSeconds = new(int64) - } - yym2728 := z.DecBinary() - _ = yym2728 - if false { - } else { - *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } for { - yyj2724++ - if yyhl2724 { - yyb2724 = yyj2724 > l + yyj2731++ + if yyhl2731 { + yyb2731 = yyj2731 > l } else { - yyb2724 = r.CheckBreak() + yyb2731 = r.CheckBreak() } - if yyb2724 { + if yyb2731 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2724-1, "") + z.DecStructFieldNotFound(yyj2731-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *NamespaceSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym2729 := z.EncBinary() - _ = yym2729 + yym2738 := z.EncBinary() + _ = yym2738 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2730 := !z.EncBinary() - yy2arr2730 := z.EncBasicHandle().StructToArray - var yyq2730 [4]bool - _, _, _ = yysep2730, yyq2730, yy2arr2730 - const yyr2730 bool = false - yyq2730[0] = x.Kind != "" - yyq2730[1] = x.APIVersion != "" - var yynn2730 int - if yyr2730 || yy2arr2730 { - r.EncodeArrayStart(4) + yysep2739 := !z.EncBinary() + yy2arr2739 := z.EncBasicHandle().StructToArray + var yyq2739 [1]bool + _, _, _ = yysep2739, yyq2739, yy2arr2739 + const yyr2739 bool = false + var yynn2739 int + if yyr2739 || yy2arr2739 { + r.EncodeArrayStart(1) } else { - yynn2730 = 2 - for _, b := range yyq2730 { + yynn2739 = 1 + for _, b := range yyq2739 { if b { - yynn2730++ + yynn2739++ } } - r.EncodeMapStart(yynn2730) - yynn2730 = 0 + r.EncodeMapStart(yynn2739) + yynn2739 = 0 } - if yyr2730 || yy2arr2730 { + if yyr2739 || yy2arr2739 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2730[0] { - yym2732 := z.EncBinary() - _ = yym2732 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + if x.Finalizers == nil { + r.EncodeNil() } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2730[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2733 := z.EncBinary() - _ = yym2733 + yym2741 := z.EncBinary() + _ = yym2741 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) } } - } - if yyr2730 || yy2arr2730 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2730[1] { - yym2735 := z.EncBinary() - _ = yym2735 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2730[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2736 := z.EncBinary() - _ = yym2736 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2730 || yy2arr2730 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2738 := z.EncBinary() - _ = yym2738 - if false { - } else { - r.EncodeBool(bool(x.Export)) - } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("export")) + r.EncodeString(codecSelferC_UTF81234, string("Finalizers")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2739 := z.EncBinary() - _ = yym2739 - if false { + if x.Finalizers == nil { + r.EncodeNil() } else { - r.EncodeBool(bool(x.Export)) + yym2742 := z.EncBinary() + _ = yym2742 + if false { + } else { + h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) + } } } - if yyr2730 || yy2arr2730 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2741 := z.EncBinary() - _ = yym2741 - if false { - } else { - r.EncodeBool(bool(x.Exact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("exact")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2742 := z.EncBinary() - _ = yym2742 - if false { - } else { - r.EncodeBool(bool(x.Exact)) - } - } - if yyr2730 || yy2arr2730 { + if yyr2739 || yy2arr2739 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -34756,7 +35150,7 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *NamespaceSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -34786,7 +35180,7 @@ func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *NamespaceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -34808,6 +35202,499 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys2745 := string(yys2745Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys2745 { + case "Finalizers": + if r.TryDecodeAsNil() { + x.Finalizers = nil + } else { + yyv2746 := &x.Finalizers + yym2747 := z.DecBinary() + _ = yym2747 + if false { + } else { + h.decSliceFinalizerName((*[]FinalizerName)(yyv2746), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys2745) + } // end switch yys2745 + } // end for yyj2745 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2748 int + var yyb2748 bool + var yyhl2748 bool = l >= 0 + yyj2748++ + if yyhl2748 { + yyb2748 = yyj2748 > l + } else { + yyb2748 = r.CheckBreak() + } + if yyb2748 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Finalizers = nil + } else { + yyv2749 := &x.Finalizers + yym2750 := z.DecBinary() + _ = yym2750 + if false { + } else { + h.decSliceFinalizerName((*[]FinalizerName)(yyv2749), d) + } + } + for { + yyj2748++ + if yyhl2748 { + yyb2748 = yyj2748 > l + } else { + yyb2748 = r.CheckBreak() + } + if yyb2748 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2748-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x FinalizerName) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym2751 := z.EncBinary() + _ = yym2751 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *FinalizerName) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2752 := z.DecBinary() + _ = yym2752 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *NamespaceStatus) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2753 := z.EncBinary() + _ = yym2753 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2754 := !z.EncBinary() + yy2arr2754 := z.EncBasicHandle().StructToArray + var yyq2754 [1]bool + _, _, _ = yysep2754, yyq2754, yy2arr2754 + const yyr2754 bool = false + yyq2754[0] = x.Phase != "" + var yynn2754 int + if yyr2754 || yy2arr2754 { + r.EncodeArrayStart(1) + } else { + yynn2754 = 0 + for _, b := range yyq2754 { + if b { + yynn2754++ + } + } + r.EncodeMapStart(yynn2754) + yynn2754 = 0 + } + if yyr2754 || yy2arr2754 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2754[0] { + x.Phase.CodecEncodeSelf(e) + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2754[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("phase")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Phase.CodecEncodeSelf(e) + } + } + if yyr2754 || yy2arr2754 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NamespaceStatus) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2756 := z.DecBinary() + _ = yym2756 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2757 := r.ContainerType() + if yyct2757 == codecSelferValueTypeMap1234 { + yyl2757 := r.ReadMapStart() + if yyl2757 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2757, d) + } + } else if yyct2757 == codecSelferValueTypeArray1234 { + yyl2757 := r.ReadArrayStart() + if yyl2757 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2757, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NamespaceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2758Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2758Slc + var yyhl2758 bool = l >= 0 + for yyj2758 := 0; ; yyj2758++ { + if yyhl2758 { + if yyj2758 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2758Slc = r.DecodeBytes(yys2758Slc, true, true) + yys2758 := string(yys2758Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2758 { + case "phase": + if r.TryDecodeAsNil() { + x.Phase = "" + } else { + x.Phase = NamespacePhase(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys2758) + } // end switch yys2758 + } // end for yyj2758 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2760 int + var yyb2760 bool + var yyhl2760 bool = l >= 0 + yyj2760++ + if yyhl2760 { + yyb2760 = yyj2760 > l + } else { + yyb2760 = r.CheckBreak() + } + if yyb2760 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Phase = "" + } else { + x.Phase = NamespacePhase(r.DecodeString()) + } + for { + yyj2760++ + if yyhl2760 { + yyb2760 = yyj2760 > l + } else { + yyb2760 = r.CheckBreak() + } + if yyb2760 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2760-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x NamespacePhase) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym2762 := z.EncBinary() + _ = yym2762 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *NamespacePhase) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2763 := z.DecBinary() + _ = yym2763 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *Namespace) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2764 := z.EncBinary() + _ = yym2764 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2765 := !z.EncBinary() + yy2arr2765 := z.EncBasicHandle().StructToArray + var yyq2765 [5]bool + _, _, _ = yysep2765, yyq2765, yy2arr2765 + const yyr2765 bool = false + yyq2765[0] = true + yyq2765[1] = true + yyq2765[2] = true + yyq2765[3] = x.Kind != "" + yyq2765[4] = x.APIVersion != "" + var yynn2765 int + if yyr2765 || yy2arr2765 { + r.EncodeArrayStart(5) + } else { + yynn2765 = 0 + for _, b := range yyq2765 { + if b { + yynn2765++ + } + } + r.EncodeMapStart(yynn2765) + yynn2765 = 0 + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2765[0] { + yy2767 := &x.ObjectMeta + yy2767.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2765[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2768 := &x.ObjectMeta + yy2768.CodecEncodeSelf(e) + } + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2765[1] { + yy2770 := &x.Spec + yy2770.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2765[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2771 := &x.Spec + yy2771.CodecEncodeSelf(e) + } + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2765[2] { + yy2773 := &x.Status + yy2773.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2765[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2774 := &x.Status + yy2774.CodecEncodeSelf(e) + } + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2765[3] { + yym2776 := z.EncBinary() + _ = yym2776 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2765[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2777 := z.EncBinary() + _ = yym2777 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2765[4] { + yym2779 := z.EncBinary() + _ = yym2779 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2765[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2780 := z.EncBinary() + _ = yym2780 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2765 || yy2arr2765 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Namespace) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2781 := z.DecBinary() + _ = yym2781 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2782 := r.ContainerType() + if yyct2782 == codecSelferValueTypeMap1234 { + yyl2782 := r.ReadMapStart() + if yyl2782 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2782, d) + } + } else if yyct2782 == codecSelferValueTypeArray1234 { + yyl2782 := r.ReadArrayStart() + if yyl2782 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2782, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Namespace) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2783Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2783Slc + var yyhl2783 bool = l >= 0 + for yyj2783 := 0; ; yyj2783++ { + if yyhl2783 { + if yyj2783 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2783Slc = r.DecodeBytes(yys2783Slc, true, true) + yys2783 := string(yys2783Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2783 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2784 := &x.ObjectMeta + yyv2784.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = NamespaceSpec{} + } else { + yyv2785 := &x.Spec + yyv2785.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = NamespaceStatus{} + } else { + yyv2786 := &x.Status + yyv2786.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -34820,6 +35707,1226 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2783) + } // end switch yys2783 + } // end for yyj2783 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Namespace) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2789 int + var yyb2789 bool + var yyhl2789 bool = l >= 0 + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2790 := &x.ObjectMeta + yyv2790.CodecDecodeSelf(d) + } + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = NamespaceSpec{} + } else { + yyv2791 := &x.Spec + yyv2791.CodecDecodeSelf(d) + } + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = NamespaceStatus{} + } else { + yyv2792 := &x.Status + yyv2792.CodecDecodeSelf(d) + } + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2789++ + if yyhl2789 { + yyb2789 = yyj2789 > l + } else { + yyb2789 = r.CheckBreak() + } + if yyb2789 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2789-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NamespaceList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2795 := z.EncBinary() + _ = yym2795 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2796 := !z.EncBinary() + yy2arr2796 := z.EncBasicHandle().StructToArray + var yyq2796 [4]bool + _, _, _ = yysep2796, yyq2796, yy2arr2796 + const yyr2796 bool = false + yyq2796[0] = true + yyq2796[2] = x.Kind != "" + yyq2796[3] = x.APIVersion != "" + var yynn2796 int + if yyr2796 || yy2arr2796 { + r.EncodeArrayStart(4) + } else { + yynn2796 = 1 + for _, b := range yyq2796 { + if b { + yynn2796++ + } + } + r.EncodeMapStart(yynn2796) + yynn2796 = 0 + } + if yyr2796 || yy2arr2796 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2796[0] { + yy2798 := &x.ListMeta + yym2799 := z.EncBinary() + _ = yym2799 + if false { + } else if z.HasExtensions() && z.EncExt(yy2798) { + } else { + z.EncFallback(yy2798) + } + } else { + r.EncodeNil() + } + } else { + if yyq2796[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2800 := &x.ListMeta + yym2801 := z.EncBinary() + _ = yym2801 + if false { + } else if z.HasExtensions() && z.EncExt(yy2800) { + } else { + z.EncFallback(yy2800) + } + } + } + if yyr2796 || yy2arr2796 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2803 := z.EncBinary() + _ = yym2803 + if false { + } else { + h.encSliceNamespace(([]Namespace)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2804 := z.EncBinary() + _ = yym2804 + if false { + } else { + h.encSliceNamespace(([]Namespace)(x.Items), e) + } + } + } + if yyr2796 || yy2arr2796 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2796[2] { + yym2806 := z.EncBinary() + _ = yym2806 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2796[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2807 := z.EncBinary() + _ = yym2807 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2796 || yy2arr2796 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2796[3] { + yym2809 := z.EncBinary() + _ = yym2809 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2796[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2810 := z.EncBinary() + _ = yym2810 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2796 || yy2arr2796 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NamespaceList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2811 := z.DecBinary() + _ = yym2811 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2812 := r.ContainerType() + if yyct2812 == codecSelferValueTypeMap1234 { + yyl2812 := r.ReadMapStart() + if yyl2812 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2812, d) + } + } else if yyct2812 == codecSelferValueTypeArray1234 { + yyl2812 := r.ReadArrayStart() + if yyl2812 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2812, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NamespaceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2813Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2813Slc + var yyhl2813 bool = l >= 0 + for yyj2813 := 0; ; yyj2813++ { + if yyhl2813 { + if yyj2813 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2813Slc = r.DecodeBytes(yys2813Slc, true, true) + yys2813 := string(yys2813Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2813 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2814 := &x.ListMeta + yym2815 := z.DecBinary() + _ = yym2815 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2814) { + } else { + z.DecFallback(yyv2814, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2816 := &x.Items + yym2817 := z.DecBinary() + _ = yym2817 + if false { + } else { + h.decSliceNamespace((*[]Namespace)(yyv2816), 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, yys2813) + } // end switch yys2813 + } // end for yyj2813 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2820 int + var yyb2820 bool + var yyhl2820 bool = l >= 0 + yyj2820++ + if yyhl2820 { + yyb2820 = yyj2820 > l + } else { + yyb2820 = r.CheckBreak() + } + if yyb2820 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2821 := &x.ListMeta + yym2822 := z.DecBinary() + _ = yym2822 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2821) { + } else { + z.DecFallback(yyv2821, false) + } + } + yyj2820++ + if yyhl2820 { + yyb2820 = yyj2820 > l + } else { + yyb2820 = r.CheckBreak() + } + if yyb2820 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2823 := &x.Items + yym2824 := z.DecBinary() + _ = yym2824 + if false { + } else { + h.decSliceNamespace((*[]Namespace)(yyv2823), d) + } + } + yyj2820++ + if yyhl2820 { + yyb2820 = yyj2820 > l + } else { + yyb2820 = r.CheckBreak() + } + if yyb2820 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2820++ + if yyhl2820 { + yyb2820 = yyj2820 > l + } else { + yyb2820 = r.CheckBreak() + } + if yyb2820 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2820++ + if yyhl2820 { + yyb2820 = yyj2820 > l + } else { + yyb2820 = r.CheckBreak() + } + if yyb2820 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2820-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *Binding) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2827 := z.EncBinary() + _ = yym2827 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2828 := !z.EncBinary() + yy2arr2828 := z.EncBasicHandle().StructToArray + var yyq2828 [4]bool + _, _, _ = yysep2828, yyq2828, yy2arr2828 + const yyr2828 bool = false + yyq2828[0] = true + yyq2828[2] = x.Kind != "" + yyq2828[3] = x.APIVersion != "" + var yynn2828 int + if yyr2828 || yy2arr2828 { + r.EncodeArrayStart(4) + } else { + yynn2828 = 1 + for _, b := range yyq2828 { + if b { + yynn2828++ + } + } + r.EncodeMapStart(yynn2828) + yynn2828 = 0 + } + if yyr2828 || yy2arr2828 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2828[0] { + yy2830 := &x.ObjectMeta + yy2830.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2828[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2831 := &x.ObjectMeta + yy2831.CodecEncodeSelf(e) + } + } + if yyr2828 || yy2arr2828 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2833 := &x.Target + yy2833.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("target")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2834 := &x.Target + yy2834.CodecEncodeSelf(e) + } + if yyr2828 || yy2arr2828 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2828[2] { + yym2836 := z.EncBinary() + _ = yym2836 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2828[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2837 := z.EncBinary() + _ = yym2837 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2828 || yy2arr2828 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2828[3] { + yym2839 := z.EncBinary() + _ = yym2839 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2828[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2840 := z.EncBinary() + _ = yym2840 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2828 || yy2arr2828 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2841 := z.DecBinary() + _ = yym2841 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2842 := r.ContainerType() + if yyct2842 == codecSelferValueTypeMap1234 { + yyl2842 := r.ReadMapStart() + if yyl2842 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2842, d) + } + } else if yyct2842 == codecSelferValueTypeArray1234 { + yyl2842 := r.ReadArrayStart() + if yyl2842 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2842, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2843Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2843Slc + var yyhl2843 bool = l >= 0 + for yyj2843 := 0; ; yyj2843++ { + if yyhl2843 { + if yyj2843 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2843Slc = r.DecodeBytes(yys2843Slc, true, true) + yys2843 := string(yys2843Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2843 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2844 := &x.ObjectMeta + yyv2844.CodecDecodeSelf(d) + } + case "target": + if r.TryDecodeAsNil() { + x.Target = ObjectReference{} + } else { + yyv2845 := &x.Target + yyv2845.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, yys2843) + } // end switch yys2843 + } // end for yyj2843 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2848 int + var yyb2848 bool + var yyhl2848 bool = l >= 0 + yyj2848++ + if yyhl2848 { + yyb2848 = yyj2848 > l + } else { + yyb2848 = r.CheckBreak() + } + if yyb2848 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2849 := &x.ObjectMeta + yyv2849.CodecDecodeSelf(d) + } + yyj2848++ + if yyhl2848 { + yyb2848 = yyj2848 > l + } else { + yyb2848 = r.CheckBreak() + } + if yyb2848 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Target = ObjectReference{} + } else { + yyv2850 := &x.Target + yyv2850.CodecDecodeSelf(d) + } + yyj2848++ + if yyhl2848 { + yyb2848 = yyj2848 > l + } else { + yyb2848 = r.CheckBreak() + } + if yyb2848 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2848++ + if yyhl2848 { + yyb2848 = yyj2848 > l + } else { + yyb2848 = r.CheckBreak() + } + if yyb2848 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2848++ + if yyhl2848 { + yyb2848 = yyj2848 > l + } else { + yyb2848 = r.CheckBreak() + } + if yyb2848 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2848-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2853 := z.EncBinary() + _ = yym2853 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2854 := !z.EncBinary() + yy2arr2854 := z.EncBasicHandle().StructToArray + var yyq2854 [3]bool + _, _, _ = yysep2854, yyq2854, yy2arr2854 + const yyr2854 bool = false + yyq2854[1] = x.Kind != "" + yyq2854[2] = x.APIVersion != "" + var yynn2854 int + if yyr2854 || yy2arr2854 { + r.EncodeArrayStart(3) + } else { + yynn2854 = 1 + for _, b := range yyq2854 { + if b { + yynn2854++ + } + } + r.EncodeMapStart(yynn2854) + yynn2854 = 0 + } + if yyr2854 || yy2arr2854 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.GracePeriodSeconds == nil { + r.EncodeNil() + } else { + yy2856 := *x.GracePeriodSeconds + yym2857 := z.EncBinary() + _ = yym2857 + if false { + } else { + r.EncodeInt(int64(yy2856)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("gracePeriodSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.GracePeriodSeconds == nil { + r.EncodeNil() + } else { + yy2858 := *x.GracePeriodSeconds + yym2859 := z.EncBinary() + _ = yym2859 + if false { + } else { + r.EncodeInt(int64(yy2858)) + } + } + } + if yyr2854 || yy2arr2854 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2854[1] { + yym2861 := z.EncBinary() + _ = yym2861 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2854[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2862 := z.EncBinary() + _ = yym2862 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2854 || yy2arr2854 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2854[2] { + yym2864 := z.EncBinary() + _ = yym2864 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2854[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2865 := z.EncBinary() + _ = yym2865 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2854 || yy2arr2854 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2866 := z.DecBinary() + _ = yym2866 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2867 := r.ContainerType() + if yyct2867 == codecSelferValueTypeMap1234 { + yyl2867 := r.ReadMapStart() + if yyl2867 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2867, d) + } + } else if yyct2867 == codecSelferValueTypeArray1234 { + yyl2867 := r.ReadArrayStart() + if yyl2867 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2867, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2868Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2868Slc + var yyhl2868 bool = l >= 0 + for yyj2868 := 0; ; yyj2868++ { + if yyhl2868 { + if yyj2868 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2868Slc = r.DecodeBytes(yys2868Slc, true, true) + yys2868 := string(yys2868Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2868 { + case "gracePeriodSeconds": + if r.TryDecodeAsNil() { + if x.GracePeriodSeconds != nil { + x.GracePeriodSeconds = nil + } + } else { + if x.GracePeriodSeconds == nil { + x.GracePeriodSeconds = new(int64) + } + yym2870 := z.DecBinary() + _ = yym2870 + if false { + } else { + *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) + } + } + 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, yys2868) + } // end switch yys2868 + } // end for yyj2868 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2873 int + var yyb2873 bool + var yyhl2873 bool = l >= 0 + yyj2873++ + if yyhl2873 { + yyb2873 = yyj2873 > l + } else { + yyb2873 = r.CheckBreak() + } + if yyb2873 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.GracePeriodSeconds != nil { + x.GracePeriodSeconds = nil + } + } else { + if x.GracePeriodSeconds == nil { + x.GracePeriodSeconds = new(int64) + } + yym2875 := z.DecBinary() + _ = yym2875 + if false { + } else { + *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj2873++ + if yyhl2873 { + yyb2873 = yyj2873 > l + } else { + yyb2873 = r.CheckBreak() + } + if yyb2873 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2873++ + if yyhl2873 { + yyb2873 = yyj2873 > l + } else { + yyb2873 = r.CheckBreak() + } + if yyb2873 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2873++ + if yyhl2873 { + yyb2873 = yyj2873 > l + } else { + yyb2873 = r.CheckBreak() + } + if yyb2873 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2873-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2878 := z.EncBinary() + _ = yym2878 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2879 := !z.EncBinary() + yy2arr2879 := z.EncBasicHandle().StructToArray + var yyq2879 [4]bool + _, _, _ = yysep2879, yyq2879, yy2arr2879 + const yyr2879 bool = false + yyq2879[2] = x.Kind != "" + yyq2879[3] = x.APIVersion != "" + var yynn2879 int + if yyr2879 || yy2arr2879 { + r.EncodeArrayStart(4) + } else { + yynn2879 = 2 + for _, b := range yyq2879 { + if b { + yynn2879++ + } + } + r.EncodeMapStart(yynn2879) + yynn2879 = 0 + } + if yyr2879 || yy2arr2879 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2881 := z.EncBinary() + _ = yym2881 + if false { + } else { + r.EncodeBool(bool(x.Export)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("export")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2882 := z.EncBinary() + _ = yym2882 + if false { + } else { + r.EncodeBool(bool(x.Export)) + } + } + if yyr2879 || yy2arr2879 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2884 := z.EncBinary() + _ = yym2884 + if false { + } else { + r.EncodeBool(bool(x.Exact)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("exact")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2885 := z.EncBinary() + _ = yym2885 + if false { + } else { + r.EncodeBool(bool(x.Exact)) + } + } + if yyr2879 || yy2arr2879 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2879[2] { + yym2887 := z.EncBinary() + _ = yym2887 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2879[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2888 := z.EncBinary() + _ = yym2888 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2879 || yy2arr2879 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2879[3] { + yym2890 := z.EncBinary() + _ = yym2890 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2879[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2891 := z.EncBinary() + _ = yym2891 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2879 || yy2arr2879 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2892 := z.DecBinary() + _ = yym2892 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2893 := r.ContainerType() + if yyct2893 == codecSelferValueTypeMap1234 { + yyl2893 := r.ReadMapStart() + if yyl2893 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2893, d) + } + } else if yyct2893 == codecSelferValueTypeArray1234 { + yyl2893 := r.ReadArrayStart() + if yyl2893 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2893, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2894Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2894Slc + var yyhl2894 bool = l >= 0 + for yyj2894 := 0; ; yyj2894++ { + if yyhl2894 { + if yyj2894 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2894Slc = r.DecodeBytes(yys2894Slc, true, true) + yys2894 := string(yys2894Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2894 { case "export": if r.TryDecodeAsNil() { x.Export = false @@ -34832,10 +36939,22 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Exact = bool(r.DecodeBool()) } + 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, yys2745) - } // end switch yys2745 - } // end for yyj2745 + z.DecStructFieldNotFound(-1, yys2894) + } // end switch yys2894 + } // end for yyj2894 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -34843,48 +36962,16 @@ func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2750 int - var yyb2750 bool - var yyhl2750 bool = l >= 0 - yyj2750++ - if yyhl2750 { - yyb2750 = yyj2750 > l + var yyj2899 int + var yyb2899 bool + var yyhl2899 bool = l >= 0 + yyj2899++ + if yyhl2899 { + yyb2899 = yyj2899 > l } else { - yyb2750 = r.CheckBreak() + yyb2899 = r.CheckBreak() } - if yyb2750 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2750++ - if yyhl2750 { - yyb2750 = yyj2750 > l - } else { - yyb2750 = r.CheckBreak() - } - if yyb2750 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2750++ - if yyhl2750 { - yyb2750 = yyj2750 > l - } else { - yyb2750 = r.CheckBreak() - } - if yyb2750 { + if yyb2899 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34894,13 +36981,13 @@ func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Export = bool(r.DecodeBool()) } - yyj2750++ - if yyhl2750 { - yyb2750 = yyj2750 > l + yyj2899++ + if yyhl2899 { + yyb2899 = yyj2899 > l } else { - yyb2750 = r.CheckBreak() + yyb2899 = r.CheckBreak() } - if yyb2750 { + if yyb2899 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34910,18 +36997,50 @@ func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Exact = bool(r.DecodeBool()) } + yyj2899++ + if yyhl2899 { + yyb2899 = yyj2899 > l + } else { + yyb2899 = r.CheckBreak() + } + if yyb2899 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2899++ + if yyhl2899 { + yyb2899 = yyj2899 > l + } else { + yyb2899 = r.CheckBreak() + } + if yyb2899 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj2750++ - if yyhl2750 { - yyb2750 = yyj2750 > l + yyj2899++ + if yyhl2899 { + yyb2899 = yyj2899 > l } else { - yyb2750 = r.CheckBreak() + yyb2899 = r.CheckBreak() } - if yyb2750 { + if yyb2899 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2750-1, "") + z.DecStructFieldNotFound(yyj2899-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -34933,88 +37052,38 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2755 := z.EncBinary() - _ = yym2755 + yym2904 := z.EncBinary() + _ = yym2904 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2756 := !z.EncBinary() - yy2arr2756 := z.EncBasicHandle().StructToArray - var yyq2756 [7]bool - _, _, _ = yysep2756, yyq2756, yy2arr2756 - const yyr2756 bool = false - yyq2756[0] = x.Kind != "" - yyq2756[1] = x.APIVersion != "" - var yynn2756 int - if yyr2756 || yy2arr2756 { + yysep2905 := !z.EncBinary() + yy2arr2905 := z.EncBasicHandle().StructToArray + var yyq2905 [7]bool + _, _, _ = yysep2905, yyq2905, yy2arr2905 + const yyr2905 bool = false + yyq2905[5] = x.Kind != "" + yyq2905[6] = x.APIVersion != "" + var yynn2905 int + if yyr2905 || yy2arr2905 { r.EncodeArrayStart(7) } else { - yynn2756 = 5 - for _, b := range yyq2756 { + yynn2905 = 5 + for _, b := range yyq2905 { if b { - yynn2756++ + yynn2905++ } } - r.EncodeMapStart(yynn2756) - yynn2756 = 0 + r.EncodeMapStart(yynn2905) + yynn2905 = 0 } - if yyr2756 || yy2arr2756 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2756[0] { - yym2758 := z.EncBinary() - _ = yym2758 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2756[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2759 := z.EncBinary() - _ = yym2759 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2756 || yy2arr2756 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2756[1] { - yym2761 := z.EncBinary() - _ = yym2761 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2756[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2762 := z.EncBinary() - _ = yym2762 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.LabelSelector == nil { r.EncodeNil() } else { - yym2764 := z.EncBinary() - _ = yym2764 + yym2907 := z.EncBinary() + _ = yym2907 if false { } else if z.HasExtensions() && z.EncExt(x.LabelSelector) { } else { @@ -35028,8 +37097,8 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x.LabelSelector == nil { r.EncodeNil() } else { - yym2765 := z.EncBinary() - _ = yym2765 + yym2908 := z.EncBinary() + _ = yym2908 if false { } else if z.HasExtensions() && z.EncExt(x.LabelSelector) { } else { @@ -35037,13 +37106,13 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.FieldSelector == nil { r.EncodeNil() } else { - yym2767 := z.EncBinary() - _ = yym2767 + yym2910 := z.EncBinary() + _ = yym2910 if false { } else if z.HasExtensions() && z.EncExt(x.FieldSelector) { } else { @@ -35057,8 +37126,8 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x.FieldSelector == nil { r.EncodeNil() } else { - yym2768 := z.EncBinary() - _ = yym2768 + yym2911 := z.EncBinary() + _ = yym2911 if false { } else if z.HasExtensions() && z.EncExt(x.FieldSelector) { } else { @@ -35066,10 +37135,10 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2770 := z.EncBinary() - _ = yym2770 + yym2913 := z.EncBinary() + _ = yym2913 if false { } else { r.EncodeBool(bool(x.Watch)) @@ -35078,17 +37147,17 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Watch")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2771 := z.EncBinary() - _ = yym2771 + yym2914 := z.EncBinary() + _ = yym2914 if false { } else { r.EncodeBool(bool(x.Watch)) } } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2773 := z.EncBinary() - _ = yym2773 + yym2916 := z.EncBinary() + _ = yym2916 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) @@ -35097,24 +37166,24 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ResourceVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2774 := z.EncBinary() - _ = yym2774 + yym2917 := z.EncBinary() + _ = yym2917 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) } } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TimeoutSeconds == nil { r.EncodeNil() } else { - yy2776 := *x.TimeoutSeconds - yym2777 := z.EncBinary() - _ = yym2777 + yy2919 := *x.TimeoutSeconds + yym2920 := z.EncBinary() + _ = yym2920 if false { } else { - r.EncodeInt(int64(yy2776)) + r.EncodeInt(int64(yy2919)) } } } else { @@ -35124,16 +37193,66 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x.TimeoutSeconds == nil { r.EncodeNil() } else { - yy2778 := *x.TimeoutSeconds - yym2779 := z.EncBinary() - _ = yym2779 + yy2921 := *x.TimeoutSeconds + yym2922 := z.EncBinary() + _ = yym2922 if false { } else { - r.EncodeInt(int64(yy2778)) + r.EncodeInt(int64(yy2921)) } } } - if yyr2756 || yy2arr2756 { + if yyr2905 || yy2arr2905 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2905[5] { + yym2924 := z.EncBinary() + _ = yym2924 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2905[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2925 := z.EncBinary() + _ = yym2925 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2905 || yy2arr2905 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2905[6] { + yym2927 := z.EncBinary() + _ = yym2927 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2905[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2928 := z.EncBinary() + _ = yym2928 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2905 || yy2arr2905 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -35146,25 +37265,25 @@ func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2780 := z.DecBinary() - _ = yym2780 + yym2929 := z.DecBinary() + _ = yym2929 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2781 := r.ContainerType() - if yyct2781 == codecSelferValueTypeMap1234 { - yyl2781 := r.ReadMapStart() - if yyl2781 == 0 { + yyct2930 := r.ContainerType() + if yyct2930 == codecSelferValueTypeMap1234 { + yyl2930 := r.ReadMapStart() + if yyl2930 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2781, d) + x.codecDecodeSelfFromMap(yyl2930, d) } - } else if yyct2781 == codecSelferValueTypeArray1234 { - yyl2781 := r.ReadArrayStart() - if yyl2781 == 0 { + } else if yyct2930 == codecSelferValueTypeArray1234 { + yyl2930 := r.ReadArrayStart() + if yyl2930 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2781, d) + x.codecDecodeSelfFromArray(yyl2930, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -35176,12 +37295,12 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2782Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2782Slc - var yyhl2782 bool = l >= 0 - for yyj2782 := 0; ; yyj2782++ { - if yyhl2782 { - if yyj2782 >= l { + var yys2931Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2931Slc + var yyhl2931 bool = l >= 0 + for yyj2931 := 0; ; yyj2931++ { + if yyhl2931 { + if yyj2931 >= l { break } } else { @@ -35190,46 +37309,34 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2782Slc = r.DecodeBytes(yys2782Slc, true, true) - yys2782 := string(yys2782Slc) + yys2931Slc = r.DecodeBytes(yys2931Slc, true, true) + yys2931 := string(yys2931Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2782 { - 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()) - } + switch yys2931 { case "LabelSelector": if r.TryDecodeAsNil() { x.LabelSelector = nil } else { - yyv2785 := &x.LabelSelector - yym2786 := z.DecBinary() - _ = yym2786 + yyv2932 := &x.LabelSelector + yym2933 := z.DecBinary() + _ = yym2933 if false { - } else if z.HasExtensions() && z.DecExt(yyv2785) { + } else if z.HasExtensions() && z.DecExt(yyv2932) { } else { - z.DecFallback(yyv2785, true) + z.DecFallback(yyv2932, true) } } case "FieldSelector": if r.TryDecodeAsNil() { x.FieldSelector = nil } else { - yyv2787 := &x.FieldSelector - yym2788 := z.DecBinary() - _ = yym2788 + yyv2934 := &x.FieldSelector + yym2935 := z.DecBinary() + _ = yym2935 if false { - } else if z.HasExtensions() && z.DecExt(yyv2787) { + } else if z.HasExtensions() && z.DecExt(yyv2934) { } else { - z.DecFallback(yyv2787, true) + z.DecFallback(yyv2934, true) } } case "Watch": @@ -35253,522 +37360,13 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TimeoutSeconds == nil { x.TimeoutSeconds = new(int64) } - yym2792 := z.DecBinary() - _ = yym2792 + yym2939 := z.DecBinary() + _ = yym2939 if false { } else { *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) } } - default: - z.DecStructFieldNotFound(-1, yys2782) - } // end switch yys2782 - } // end for yyj2782 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2793 int - var yyb2793 bool - var yyhl2793 bool = l >= 0 - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LabelSelector = nil - } else { - yyv2796 := &x.LabelSelector - yym2797 := z.DecBinary() - _ = yym2797 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2796) { - } else { - z.DecFallback(yyv2796, true) - } - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FieldSelector = nil - } else { - yyv2798 := &x.FieldSelector - yym2799 := z.DecBinary() - _ = yym2799 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2798) { - } else { - z.DecFallback(yyv2798, true) - } - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Watch = false - } else { - x.Watch = bool(r.DecodeBool()) - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ResourceVersion = "" - } else { - x.ResourceVersion = string(r.DecodeString()) - } - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.TimeoutSeconds != nil { - x.TimeoutSeconds = nil - } - } else { - if x.TimeoutSeconds == nil { - x.TimeoutSeconds = new(int64) - } - yym2803 := z.DecBinary() - _ = yym2803 - if false { - } else { - *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) - } - } - for { - yyj2793++ - if yyhl2793 { - yyb2793 = yyj2793 > l - } else { - yyb2793 = r.CheckBreak() - } - if yyb2793 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2793-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodLogOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2804 := z.EncBinary() - _ = yym2804 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2805 := !z.EncBinary() - yy2arr2805 := z.EncBasicHandle().StructToArray - var yyq2805 [10]bool - _, _, _ = yysep2805, yyq2805, yy2arr2805 - const yyr2805 bool = false - yyq2805[0] = x.Kind != "" - yyq2805[1] = x.APIVersion != "" - var yynn2805 int - if yyr2805 || yy2arr2805 { - r.EncodeArrayStart(10) - } else { - yynn2805 = 8 - for _, b := range yyq2805 { - if b { - yynn2805++ - } - } - r.EncodeMapStart(yynn2805) - yynn2805 = 0 - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2805[0] { - yym2807 := z.EncBinary() - _ = yym2807 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2805[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2808 := z.EncBinary() - _ = yym2808 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2805[1] { - yym2810 := z.EncBinary() - _ = yym2810 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2805[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2811 := z.EncBinary() - _ = yym2811 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2813 := z.EncBinary() - _ = yym2813 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2814 := z.EncBinary() - _ = yym2814 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2816 := z.EncBinary() - _ = yym2816 - if false { - } else { - r.EncodeBool(bool(x.Follow)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Follow")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2817 := z.EncBinary() - _ = yym2817 - if false { - } else { - r.EncodeBool(bool(x.Follow)) - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2819 := z.EncBinary() - _ = yym2819 - if false { - } else { - r.EncodeBool(bool(x.Previous)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Previous")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2820 := z.EncBinary() - _ = yym2820 - if false { - } else { - r.EncodeBool(bool(x.Previous)) - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.SinceSeconds == nil { - r.EncodeNil() - } else { - yy2822 := *x.SinceSeconds - yym2823 := z.EncBinary() - _ = yym2823 - if false { - } else { - r.EncodeInt(int64(yy2822)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("SinceSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SinceSeconds == nil { - r.EncodeNil() - } else { - yy2824 := *x.SinceSeconds - yym2825 := z.EncBinary() - _ = yym2825 - if false { - } else { - r.EncodeInt(int64(yy2824)) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.SinceTime == nil { - r.EncodeNil() - } else { - yym2827 := z.EncBinary() - _ = yym2827 - if false { - } else if z.HasExtensions() && z.EncExt(x.SinceTime) { - } else if yym2827 { - z.EncBinaryMarshal(x.SinceTime) - } else if !yym2827 && z.IsJSONHandle() { - z.EncJSONMarshal(x.SinceTime) - } else { - z.EncFallback(x.SinceTime) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("SinceTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SinceTime == nil { - r.EncodeNil() - } else { - yym2828 := z.EncBinary() - _ = yym2828 - if false { - } else if z.HasExtensions() && z.EncExt(x.SinceTime) { - } else if yym2828 { - z.EncBinaryMarshal(x.SinceTime) - } else if !yym2828 && z.IsJSONHandle() { - z.EncJSONMarshal(x.SinceTime) - } else { - z.EncFallback(x.SinceTime) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2830 := z.EncBinary() - _ = yym2830 - if false { - } else { - r.EncodeBool(bool(x.Timestamps)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Timestamps")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2831 := z.EncBinary() - _ = yym2831 - if false { - } else { - r.EncodeBool(bool(x.Timestamps)) - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.TailLines == nil { - r.EncodeNil() - } else { - yy2833 := *x.TailLines - yym2834 := z.EncBinary() - _ = yym2834 - if false { - } else { - r.EncodeInt(int64(yy2833)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("TailLines")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.TailLines == nil { - r.EncodeNil() - } else { - yy2835 := *x.TailLines - yym2836 := z.EncBinary() - _ = yym2836 - if false { - } else { - r.EncodeInt(int64(yy2835)) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.LimitBytes == nil { - r.EncodeNil() - } else { - yy2838 := *x.LimitBytes - yym2839 := z.EncBinary() - _ = yym2839 - if false { - } else { - r.EncodeInt(int64(yy2838)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("LimitBytes")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.LimitBytes == nil { - r.EncodeNil() - } else { - yy2840 := *x.LimitBytes - yym2841 := z.EncBinary() - _ = yym2841 - if false { - } else { - r.EncodeInt(int64(yy2840)) - } - } - } - if yyr2805 || yy2arr2805 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodLogOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2842 := z.DecBinary() - _ = yym2842 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2843 := r.ContainerType() - if yyct2843 == codecSelferValueTypeMap1234 { - yyl2843 := r.ReadMapStart() - if yyl2843 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2843, d) - } - } else if yyct2843 == codecSelferValueTypeArray1234 { - yyl2843 := r.ReadArrayStart() - if yyl2843 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2843, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2844Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2844Slc - var yyhl2844 bool = l >= 0 - for yyj2844 := 0; ; yyj2844++ { - if yyhl2844 { - if yyj2844 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2844Slc = r.DecodeBytes(yys2844Slc, true, true) - yys2844 := string(yys2844Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2844 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -35781,6 +37379,515 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2931) + } // end switch yys2931 + } // end for yyj2931 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2942 int + var yyb2942 bool + var yyhl2942 bool = l >= 0 + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LabelSelector = nil + } else { + yyv2943 := &x.LabelSelector + yym2944 := z.DecBinary() + _ = yym2944 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2943) { + } else { + z.DecFallback(yyv2943, true) + } + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FieldSelector = nil + } else { + yyv2945 := &x.FieldSelector + yym2946 := z.DecBinary() + _ = yym2946 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2945) { + } else { + z.DecFallback(yyv2945, true) + } + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Watch = false + } else { + x.Watch = bool(r.DecodeBool()) + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ResourceVersion = "" + } else { + x.ResourceVersion = string(r.DecodeString()) + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.TimeoutSeconds != nil { + x.TimeoutSeconds = nil + } + } else { + if x.TimeoutSeconds == nil { + x.TimeoutSeconds = new(int64) + } + yym2950 := z.DecBinary() + _ = yym2950 + if false { + } else { + *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2942++ + if yyhl2942 { + yyb2942 = yyj2942 > l + } else { + yyb2942 = r.CheckBreak() + } + if yyb2942 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2942-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodLogOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2953 := z.EncBinary() + _ = yym2953 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2954 := !z.EncBinary() + yy2arr2954 := z.EncBasicHandle().StructToArray + var yyq2954 [10]bool + _, _, _ = yysep2954, yyq2954, yy2arr2954 + const yyr2954 bool = false + yyq2954[8] = x.Kind != "" + yyq2954[9] = x.APIVersion != "" + var yynn2954 int + if yyr2954 || yy2arr2954 { + r.EncodeArrayStart(10) + } else { + yynn2954 = 8 + for _, b := range yyq2954 { + if b { + yynn2954++ + } + } + r.EncodeMapStart(yynn2954) + yynn2954 = 0 + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2956 := z.EncBinary() + _ = yym2956 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2957 := z.EncBinary() + _ = yym2957 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2959 := z.EncBinary() + _ = yym2959 + if false { + } else { + r.EncodeBool(bool(x.Follow)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Follow")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2960 := z.EncBinary() + _ = yym2960 + if false { + } else { + r.EncodeBool(bool(x.Follow)) + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2962 := z.EncBinary() + _ = yym2962 + if false { + } else { + r.EncodeBool(bool(x.Previous)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Previous")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2963 := z.EncBinary() + _ = yym2963 + if false { + } else { + r.EncodeBool(bool(x.Previous)) + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.SinceSeconds == nil { + r.EncodeNil() + } else { + yy2965 := *x.SinceSeconds + yym2966 := z.EncBinary() + _ = yym2966 + if false { + } else { + r.EncodeInt(int64(yy2965)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("SinceSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SinceSeconds == nil { + r.EncodeNil() + } else { + yy2967 := *x.SinceSeconds + yym2968 := z.EncBinary() + _ = yym2968 + if false { + } else { + r.EncodeInt(int64(yy2967)) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.SinceTime == nil { + r.EncodeNil() + } else { + yym2970 := z.EncBinary() + _ = yym2970 + if false { + } else if z.HasExtensions() && z.EncExt(x.SinceTime) { + } else if yym2970 { + z.EncBinaryMarshal(x.SinceTime) + } else if !yym2970 && z.IsJSONHandle() { + z.EncJSONMarshal(x.SinceTime) + } else { + z.EncFallback(x.SinceTime) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("SinceTime")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SinceTime == nil { + r.EncodeNil() + } else { + yym2971 := z.EncBinary() + _ = yym2971 + if false { + } else if z.HasExtensions() && z.EncExt(x.SinceTime) { + } else if yym2971 { + z.EncBinaryMarshal(x.SinceTime) + } else if !yym2971 && z.IsJSONHandle() { + z.EncJSONMarshal(x.SinceTime) + } else { + z.EncFallback(x.SinceTime) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2973 := z.EncBinary() + _ = yym2973 + if false { + } else { + r.EncodeBool(bool(x.Timestamps)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Timestamps")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2974 := z.EncBinary() + _ = yym2974 + if false { + } else { + r.EncodeBool(bool(x.Timestamps)) + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.TailLines == nil { + r.EncodeNil() + } else { + yy2976 := *x.TailLines + yym2977 := z.EncBinary() + _ = yym2977 + if false { + } else { + r.EncodeInt(int64(yy2976)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("TailLines")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TailLines == nil { + r.EncodeNil() + } else { + yy2978 := *x.TailLines + yym2979 := z.EncBinary() + _ = yym2979 + if false { + } else { + r.EncodeInt(int64(yy2978)) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.LimitBytes == nil { + r.EncodeNil() + } else { + yy2981 := *x.LimitBytes + yym2982 := z.EncBinary() + _ = yym2982 + if false { + } else { + r.EncodeInt(int64(yy2981)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("LimitBytes")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.LimitBytes == nil { + r.EncodeNil() + } else { + yy2983 := *x.LimitBytes + yym2984 := z.EncBinary() + _ = yym2984 + if false { + } else { + r.EncodeInt(int64(yy2983)) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2954[8] { + yym2986 := z.EncBinary() + _ = yym2986 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2954[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2987 := z.EncBinary() + _ = yym2987 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2954[9] { + yym2989 := z.EncBinary() + _ = yym2989 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2954[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2990 := z.EncBinary() + _ = yym2990 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2954 || yy2arr2954 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodLogOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2991 := z.DecBinary() + _ = yym2991 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2992 := r.ContainerType() + if yyct2992 == codecSelferValueTypeMap1234 { + yyl2992 := r.ReadMapStart() + if yyl2992 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2992, d) + } + } else if yyct2992 == codecSelferValueTypeArray1234 { + yyl2992 := r.ReadArrayStart() + if yyl2992 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2992, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2993Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2993Slc + var yyhl2993 bool = l >= 0 + for yyj2993 := 0; ; yyj2993++ { + if yyhl2993 { + if yyj2993 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2993Slc = r.DecodeBytes(yys2993Slc, true, true) + yys2993 := string(yys2993Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2993 { case "Container": if r.TryDecodeAsNil() { x.Container = "" @@ -35808,8 +37915,8 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.SinceSeconds == nil { x.SinceSeconds = new(int64) } - yym2851 := z.DecBinary() - _ = yym2851 + yym2998 := z.DecBinary() + _ = yym2998 if false { } else { *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) @@ -35824,13 +37931,13 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.SinceTime == nil { x.SinceTime = new(pkg2_unversioned.Time) } - yym2853 := z.DecBinary() - _ = yym2853 + yym3000 := z.DecBinary() + _ = yym3000 if false { } else if z.HasExtensions() && z.DecExt(x.SinceTime) { - } else if yym2853 { + } else if yym3000 { z.DecBinaryUnmarshal(x.SinceTime) - } else if !yym2853 && z.IsJSONHandle() { + } else if !yym3000 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.SinceTime) } else { z.DecFallback(x.SinceTime, false) @@ -35851,8 +37958,8 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TailLines == nil { x.TailLines = new(int64) } - yym2856 := z.DecBinary() - _ = yym2856 + yym3003 := z.DecBinary() + _ = yym3003 if false { } else { *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) @@ -35867,521 +37974,13 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.LimitBytes == nil { x.LimitBytes = new(int64) } - yym2858 := z.DecBinary() - _ = yym2858 + yym3005 := z.DecBinary() + _ = yym3005 if false { } else { *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) } } - default: - z.DecStructFieldNotFound(-1, yys2844) - } // end switch yys2844 - } // end for yyj2844 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodLogOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2859 int - var yyb2859 bool - var yyhl2859 bool = l >= 0 - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Follow = false - } else { - x.Follow = bool(r.DecodeBool()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Previous = false - } else { - x.Previous = bool(r.DecodeBool()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SinceSeconds != nil { - x.SinceSeconds = nil - } - } else { - if x.SinceSeconds == nil { - x.SinceSeconds = new(int64) - } - yym2866 := z.DecBinary() - _ = yym2866 - if false { - } else { - *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) - } - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SinceTime != nil { - x.SinceTime = nil - } - } else { - if x.SinceTime == nil { - x.SinceTime = new(pkg2_unversioned.Time) - } - yym2868 := z.DecBinary() - _ = yym2868 - if false { - } else if z.HasExtensions() && z.DecExt(x.SinceTime) { - } else if yym2868 { - z.DecBinaryUnmarshal(x.SinceTime) - } else if !yym2868 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.SinceTime) - } else { - z.DecFallback(x.SinceTime, false) - } - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Timestamps = false - } else { - x.Timestamps = bool(r.DecodeBool()) - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.TailLines != nil { - x.TailLines = nil - } - } else { - if x.TailLines == nil { - x.TailLines = new(int64) - } - yym2871 := z.DecBinary() - _ = yym2871 - if false { - } else { - *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) - } - } - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.LimitBytes != nil { - x.LimitBytes = nil - } - } else { - if x.LimitBytes == nil { - x.LimitBytes = new(int64) - } - yym2873 := z.DecBinary() - _ = yym2873 - if false { - } else { - *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) - } - } - for { - yyj2859++ - if yyhl2859 { - yyb2859 = yyj2859 > l - } else { - yyb2859 = r.CheckBreak() - } - if yyb2859 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2859-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodAttachOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2874 := z.EncBinary() - _ = yym2874 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2875 := !z.EncBinary() - yy2arr2875 := z.EncBasicHandle().StructToArray - var yyq2875 [7]bool - _, _, _ = yysep2875, yyq2875, yy2arr2875 - const yyr2875 bool = false - yyq2875[0] = x.Kind != "" - yyq2875[1] = x.APIVersion != "" - yyq2875[2] = x.Stdin != false - yyq2875[3] = x.Stdout != false - yyq2875[4] = x.Stderr != false - yyq2875[5] = x.TTY != false - yyq2875[6] = x.Container != "" - var yynn2875 int - if yyr2875 || yy2arr2875 { - r.EncodeArrayStart(7) - } else { - yynn2875 = 0 - for _, b := range yyq2875 { - if b { - yynn2875++ - } - } - r.EncodeMapStart(yynn2875) - yynn2875 = 0 - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[0] { - yym2877 := z.EncBinary() - _ = yym2877 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2875[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2878 := z.EncBinary() - _ = yym2878 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[1] { - yym2880 := z.EncBinary() - _ = yym2880 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2875[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2881 := z.EncBinary() - _ = yym2881 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[2] { - yym2883 := z.EncBinary() - _ = yym2883 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2875[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdin")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2884 := z.EncBinary() - _ = yym2884 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[3] { - yym2886 := z.EncBinary() - _ = yym2886 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2875[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdout")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2887 := z.EncBinary() - _ = yym2887 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[4] { - yym2889 := z.EncBinary() - _ = yym2889 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2875[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stderr")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2890 := z.EncBinary() - _ = yym2890 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[5] { - yym2892 := z.EncBinary() - _ = yym2892 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2875[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tty")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2893 := z.EncBinary() - _ = yym2893 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2875[6] { - yym2895 := z.EncBinary() - _ = yym2895 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2875[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2896 := z.EncBinary() - _ = yym2896 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - } - if yyr2875 || yy2arr2875 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodAttachOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2897 := z.DecBinary() - _ = yym2897 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2898 := r.ContainerType() - if yyct2898 == codecSelferValueTypeMap1234 { - yyl2898 := r.ReadMapStart() - if yyl2898 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2898, d) - } - } else if yyct2898 == codecSelferValueTypeArray1234 { - yyl2898 := r.ReadArrayStart() - if yyl2898 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2898, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2899Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2899Slc - var yyhl2899 bool = l >= 0 - for yyj2899 := 0; ; yyj2899++ { - if yyhl2899 { - if yyj2899 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2899Slc = r.DecodeBytes(yys2899Slc, true, true) - yys2899 := string(yys2899Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2899 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -36394,6 +37993,514 @@ func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2993) + } // end switch yys2993 + } // end for yyj2993 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodLogOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3008 int + var yyb3008 bool + var yyhl3008 bool = l >= 0 + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Follow = false + } else { + x.Follow = bool(r.DecodeBool()) + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Previous = false + } else { + x.Previous = bool(r.DecodeBool()) + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SinceSeconds != nil { + x.SinceSeconds = nil + } + } else { + if x.SinceSeconds == nil { + x.SinceSeconds = new(int64) + } + yym3013 := z.DecBinary() + _ = yym3013 + if false { + } else { + *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SinceTime != nil { + x.SinceTime = nil + } + } else { + if x.SinceTime == nil { + x.SinceTime = new(pkg2_unversioned.Time) + } + yym3015 := z.DecBinary() + _ = yym3015 + if false { + } else if z.HasExtensions() && z.DecExt(x.SinceTime) { + } else if yym3015 { + z.DecBinaryUnmarshal(x.SinceTime) + } else if !yym3015 && z.IsJSONHandle() { + z.DecJSONUnmarshal(x.SinceTime) + } else { + z.DecFallback(x.SinceTime, false) + } + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Timestamps = false + } else { + x.Timestamps = bool(r.DecodeBool()) + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.TailLines != nil { + x.TailLines = nil + } + } else { + if x.TailLines == nil { + x.TailLines = new(int64) + } + yym3018 := z.DecBinary() + _ = yym3018 + if false { + } else { + *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) + } + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.LimitBytes != nil { + x.LimitBytes = nil + } + } else { + if x.LimitBytes == nil { + x.LimitBytes = new(int64) + } + yym3020 := z.DecBinary() + _ = yym3020 + if false { + } else { + *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) + } + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3008++ + if yyhl3008 { + yyb3008 = yyj3008 > l + } else { + yyb3008 = r.CheckBreak() + } + if yyb3008 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3008-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodAttachOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3023 := z.EncBinary() + _ = yym3023 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3024 := !z.EncBinary() + yy2arr3024 := z.EncBasicHandle().StructToArray + var yyq3024 [7]bool + _, _, _ = yysep3024, yyq3024, yy2arr3024 + const yyr3024 bool = false + yyq3024[0] = x.Stdin != false + yyq3024[1] = x.Stdout != false + yyq3024[2] = x.Stderr != false + yyq3024[3] = x.TTY != false + yyq3024[4] = x.Container != "" + yyq3024[5] = x.Kind != "" + yyq3024[6] = x.APIVersion != "" + var yynn3024 int + if yyr3024 || yy2arr3024 { + r.EncodeArrayStart(7) + } else { + yynn3024 = 0 + for _, b := range yyq3024 { + if b { + yynn3024++ + } + } + r.EncodeMapStart(yynn3024) + yynn3024 = 0 + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[0] { + yym3026 := z.EncBinary() + _ = yym3026 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3024[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdin")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3027 := z.EncBinary() + _ = yym3027 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[1] { + yym3029 := z.EncBinary() + _ = yym3029 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3024[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdout")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3030 := z.EncBinary() + _ = yym3030 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[2] { + yym3032 := z.EncBinary() + _ = yym3032 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3024[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stderr")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3033 := z.EncBinary() + _ = yym3033 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[3] { + yym3035 := z.EncBinary() + _ = yym3035 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3024[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tty")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3036 := z.EncBinary() + _ = yym3036 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[4] { + yym3038 := z.EncBinary() + _ = yym3038 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3024[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3039 := z.EncBinary() + _ = yym3039 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[5] { + yym3041 := z.EncBinary() + _ = yym3041 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3024[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3042 := z.EncBinary() + _ = yym3042 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3024[6] { + yym3044 := z.EncBinary() + _ = yym3044 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3024[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3045 := z.EncBinary() + _ = yym3045 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3024 || yy2arr3024 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodAttachOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3046 := z.DecBinary() + _ = yym3046 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3047 := r.ContainerType() + if yyct3047 == codecSelferValueTypeMap1234 { + yyl3047 := r.ReadMapStart() + if yyl3047 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3047, d) + } + } else if yyct3047 == codecSelferValueTypeArray1234 { + yyl3047 := r.ReadArrayStart() + if yyl3047 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3047, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3048Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3048Slc + var yyhl3048 bool = l >= 0 + for yyj3048 := 0; ; yyj3048++ { + if yyhl3048 { + if yyj3048 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3048Slc = r.DecodeBytes(yys3048Slc, true, true) + yys3048 := string(yys3048Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3048 { case "stdin": if r.TryDecodeAsNil() { x.Stdin = false @@ -36424,413 +38531,6 @@ func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Container = string(r.DecodeString()) } - default: - z.DecStructFieldNotFound(-1, yys2899) - } // end switch yys2899 - } // end for yyj2899 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodAttachOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2907 int - var yyb2907 bool - var yyhl2907 bool = l >= 0 - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdin = false - } else { - x.Stdin = bool(r.DecodeBool()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdout = false - } else { - x.Stdout = bool(r.DecodeBool()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stderr = false - } else { - x.Stderr = bool(r.DecodeBool()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TTY = false - } else { - x.TTY = bool(r.DecodeBool()) - } - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - for { - yyj2907++ - if yyhl2907 { - yyb2907 = yyj2907 > l - } else { - yyb2907 = r.CheckBreak() - } - if yyb2907 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2907-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodExecOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2915 := z.EncBinary() - _ = yym2915 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2916 := !z.EncBinary() - yy2arr2916 := z.EncBasicHandle().StructToArray - var yyq2916 [8]bool - _, _, _ = yysep2916, yyq2916, yy2arr2916 - const yyr2916 bool = false - yyq2916[0] = x.Kind != "" - yyq2916[1] = x.APIVersion != "" - var yynn2916 int - if yyr2916 || yy2arr2916 { - r.EncodeArrayStart(8) - } else { - yynn2916 = 6 - for _, b := range yyq2916 { - if b { - yynn2916++ - } - } - r.EncodeMapStart(yynn2916) - yynn2916 = 0 - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2916[0] { - yym2918 := z.EncBinary() - _ = yym2918 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2916[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2919 := z.EncBinary() - _ = yym2919 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2916[1] { - yym2921 := z.EncBinary() - _ = yym2921 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2916[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2922 := z.EncBinary() - _ = yym2922 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2924 := z.EncBinary() - _ = yym2924 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Stdin")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2925 := z.EncBinary() - _ = yym2925 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2927 := z.EncBinary() - _ = yym2927 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Stdout")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2928 := z.EncBinary() - _ = yym2928 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2930 := z.EncBinary() - _ = yym2930 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Stderr")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2931 := z.EncBinary() - _ = yym2931 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2933 := z.EncBinary() - _ = yym2933 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("TTY")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2934 := z.EncBinary() - _ = yym2934 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2936 := z.EncBinary() - _ = yym2936 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2937 := z.EncBinary() - _ = yym2937 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Command == nil { - r.EncodeNil() - } else { - yym2939 := z.EncBinary() - _ = yym2939 - if false { - } else { - z.F.EncSliceStringV(x.Command, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Command")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Command == nil { - r.EncodeNil() - } else { - yym2940 := z.EncBinary() - _ = yym2940 - if false { - } else { - z.F.EncSliceStringV(x.Command, false, e) - } - } - } - if yyr2916 || yy2arr2916 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodExecOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2941 := z.DecBinary() - _ = yym2941 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2942 := r.ContainerType() - if yyct2942 == codecSelferValueTypeMap1234 { - yyl2942 := r.ReadMapStart() - if yyl2942 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2942, d) - } - } else if yyct2942 == codecSelferValueTypeArray1234 { - yyl2942 := r.ReadArrayStart() - if yyl2942 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2942, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2943Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2943Slc - var yyhl2943 bool = l >= 0 - for yyj2943 := 0; ; yyj2943++ { - if yyhl2943 { - if yyj2943 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2943Slc = r.DecodeBytes(yys2943Slc, true, true) - yys2943 := string(yys2943Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2943 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -36843,6 +38543,413 @@ func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys3048) + } // end switch yys3048 + } // end for yyj3048 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodAttachOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3056 int + var yyb3056 bool + var yyhl3056 bool = l >= 0 + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdin = false + } else { + x.Stdin = bool(r.DecodeBool()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdout = false + } else { + x.Stdout = bool(r.DecodeBool()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stderr = false + } else { + x.Stderr = bool(r.DecodeBool()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TTY = false + } else { + x.TTY = bool(r.DecodeBool()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3056++ + if yyhl3056 { + yyb3056 = yyj3056 > l + } else { + yyb3056 = r.CheckBreak() + } + if yyb3056 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3056-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodExecOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3064 := z.EncBinary() + _ = yym3064 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3065 := !z.EncBinary() + yy2arr3065 := z.EncBasicHandle().StructToArray + var yyq3065 [8]bool + _, _, _ = yysep3065, yyq3065, yy2arr3065 + const yyr3065 bool = false + yyq3065[6] = x.Kind != "" + yyq3065[7] = x.APIVersion != "" + var yynn3065 int + if yyr3065 || yy2arr3065 { + r.EncodeArrayStart(8) + } else { + yynn3065 = 6 + for _, b := range yyq3065 { + if b { + yynn3065++ + } + } + r.EncodeMapStart(yynn3065) + yynn3065 = 0 + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3067 := z.EncBinary() + _ = yym3067 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Stdin")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3068 := z.EncBinary() + _ = yym3068 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3070 := z.EncBinary() + _ = yym3070 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Stdout")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3071 := z.EncBinary() + _ = yym3071 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3073 := z.EncBinary() + _ = yym3073 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Stderr")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3074 := z.EncBinary() + _ = yym3074 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3076 := z.EncBinary() + _ = yym3076 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("TTY")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3077 := z.EncBinary() + _ = yym3077 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3079 := z.EncBinary() + _ = yym3079 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3080 := z.EncBinary() + _ = yym3080 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Command == nil { + r.EncodeNil() + } else { + yym3082 := z.EncBinary() + _ = yym3082 + if false { + } else { + z.F.EncSliceStringV(x.Command, false, e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Command")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Command == nil { + r.EncodeNil() + } else { + yym3083 := z.EncBinary() + _ = yym3083 + if false { + } else { + z.F.EncSliceStringV(x.Command, false, e) + } + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3065[6] { + yym3085 := z.EncBinary() + _ = yym3085 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3065[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3086 := z.EncBinary() + _ = yym3086 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3065[7] { + yym3088 := z.EncBinary() + _ = yym3088 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3065[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3089 := z.EncBinary() + _ = yym3089 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3065 || yy2arr3065 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodExecOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3090 := z.DecBinary() + _ = yym3090 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3091 := r.ContainerType() + if yyct3091 == codecSelferValueTypeMap1234 { + yyl3091 := r.ReadMapStart() + if yyl3091 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3091, d) + } + } else if yyct3091 == codecSelferValueTypeArray1234 { + yyl3091 := r.ReadArrayStart() + if yyl3091 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3091, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3092Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3092Slc + var yyhl3092 bool = l >= 0 + for yyj3092 := 0; ; yyj3092++ { + if yyhl3092 { + if yyj3092 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3092Slc = r.DecodeBytes(yys3092Slc, true, true) + yys3092 := string(yys3092Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3092 { case "Stdin": if r.TryDecodeAsNil() { x.Stdin = false @@ -36877,340 +38984,14 @@ func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv2951 := &x.Command - yym2952 := z.DecBinary() - _ = yym2952 + yyv3098 := &x.Command + yym3099 := z.DecBinary() + _ = yym3099 if false { } else { - z.F.DecSliceStringX(yyv2951, false, d) + z.F.DecSliceStringX(yyv3098, false, d) } } - default: - z.DecStructFieldNotFound(-1, yys2943) - } // end switch yys2943 - } // end for yyj2943 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodExecOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2953 int - var yyb2953 bool - var yyhl2953 bool = l >= 0 - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdin = false - } else { - x.Stdin = bool(r.DecodeBool()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdout = false - } else { - x.Stdout = bool(r.DecodeBool()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stderr = false - } else { - x.Stderr = bool(r.DecodeBool()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TTY = false - } else { - x.TTY = bool(r.DecodeBool()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Command = nil - } else { - yyv2961 := &x.Command - yym2962 := z.DecBinary() - _ = yym2962 - if false { - } else { - z.F.DecSliceStringX(yyv2961, false, d) - } - } - for { - yyj2953++ - if yyhl2953 { - yyb2953 = yyj2953 > l - } else { - yyb2953 = r.CheckBreak() - } - if yyb2953 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2953-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodProxyOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2963 := z.EncBinary() - _ = yym2963 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2964 := !z.EncBinary() - yy2arr2964 := z.EncBasicHandle().StructToArray - var yyq2964 [3]bool - _, _, _ = yysep2964, yyq2964, yy2arr2964 - const yyr2964 bool = false - yyq2964[0] = x.Kind != "" - yyq2964[1] = x.APIVersion != "" - var yynn2964 int - if yyr2964 || yy2arr2964 { - r.EncodeArrayStart(3) - } else { - yynn2964 = 1 - for _, b := range yyq2964 { - if b { - yynn2964++ - } - } - r.EncodeMapStart(yynn2964) - yynn2964 = 0 - } - if yyr2964 || yy2arr2964 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2964[0] { - yym2966 := z.EncBinary() - _ = yym2966 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2964[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2967 := z.EncBinary() - _ = yym2967 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2964 || yy2arr2964 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2964[1] { - yym2969 := z.EncBinary() - _ = yym2969 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2964[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2970 := z.EncBinary() - _ = yym2970 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2964 || yy2arr2964 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2972 := z.EncBinary() - _ = yym2972 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Path")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2973 := z.EncBinary() - _ = yym2973 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } - if yyr2964 || yy2arr2964 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodProxyOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2974 := z.DecBinary() - _ = yym2974 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2975 := r.ContainerType() - if yyct2975 == codecSelferValueTypeMap1234 { - yyl2975 := r.ReadMapStart() - if yyl2975 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2975, d) - } - } else if yyct2975 == codecSelferValueTypeArray1234 { - yyl2975 := r.ReadArrayStart() - if yyl2975 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2975, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2976Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2976Slc - var yyhl2976 bool = l >= 0 - for yyj2976 := 0; ; yyj2976++ { - if yyhl2976 { - if yyj2976 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2976Slc = r.DecodeBytes(yys2976Slc, true, true) - yys2976 := string(yys2976Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2976 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -37223,33 +39004,129 @@ func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "Path": - if r.TryDecodeAsNil() { - x.Path = "" - } else { - x.Path = string(r.DecodeString()) - } default: - z.DecStructFieldNotFound(-1, yys2976) - } // end switch yys2976 - } // end for yyj2976 + z.DecStructFieldNotFound(-1, yys3092) + } // end switch yys3092 + } // end for yyj3092 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *PodExecOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2980 int - var yyb2980 bool - var yyhl2980 bool = l >= 0 - yyj2980++ - if yyhl2980 { - yyb2980 = yyj2980 > l + var yyj3102 int + var yyb3102 bool + var yyhl3102 bool = l >= 0 + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l } else { - yyb2980 = r.CheckBreak() + yyb3102 = r.CheckBreak() } - if yyb2980 { + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdin = false + } else { + x.Stdin = bool(r.DecodeBool()) + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdout = false + } else { + x.Stdout = bool(r.DecodeBool()) + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stderr = false + } else { + x.Stderr = bool(r.DecodeBool()) + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TTY = false + } else { + x.TTY = bool(r.DecodeBool()) + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Command = nil + } else { + yyv3108 := &x.Command + yym3109 := z.DecBinary() + _ = yym3109 + if false { + } else { + z.F.DecSliceStringX(yyv3108, false, d) + } + } + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37259,13 +39136,13 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj2980++ - if yyhl2980 { - yyb2980 = yyj2980 > l + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l } else { - yyb2980 = r.CheckBreak() + yyb3102 = r.CheckBreak() } - if yyb2980 { + if yyb3102 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37275,13 +39152,223 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj2980++ - if yyhl2980 { - yyb2980 = yyj2980 > l - } else { - yyb2980 = r.CheckBreak() + for { + yyj3102++ + if yyhl3102 { + yyb3102 = yyj3102 > l + } else { + yyb3102 = r.CheckBreak() + } + if yyb3102 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3102-1, "") } - if yyb2980 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodProxyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3112 := z.EncBinary() + _ = yym3112 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3113 := !z.EncBinary() + yy2arr3113 := z.EncBasicHandle().StructToArray + var yyq3113 [3]bool + _, _, _ = yysep3113, yyq3113, yy2arr3113 + const yyr3113 bool = false + yyq3113[1] = x.Kind != "" + yyq3113[2] = x.APIVersion != "" + var yynn3113 int + if yyr3113 || yy2arr3113 { + r.EncodeArrayStart(3) + } else { + yynn3113 = 1 + for _, b := range yyq3113 { + if b { + yynn3113++ + } + } + r.EncodeMapStart(yynn3113) + yynn3113 = 0 + } + if yyr3113 || yy2arr3113 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym3115 := z.EncBinary() + _ = yym3115 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("Path")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3116 := z.EncBinary() + _ = yym3116 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } + if yyr3113 || yy2arr3113 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3113[1] { + yym3118 := z.EncBinary() + _ = yym3118 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3113[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3119 := z.EncBinary() + _ = yym3119 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3113 || yy2arr3113 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3113[2] { + yym3121 := z.EncBinary() + _ = yym3121 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3113[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3122 := z.EncBinary() + _ = yym3122 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3113 || yy2arr3113 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodProxyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3123 := z.DecBinary() + _ = yym3123 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3124 := r.ContainerType() + if yyct3124 == codecSelferValueTypeMap1234 { + yyl3124 := r.ReadMapStart() + if yyl3124 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3124, d) + } + } else if yyct3124 == codecSelferValueTypeArray1234 { + yyl3124 := r.ReadArrayStart() + if yyl3124 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3124, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3125Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3125Slc + var yyhl3125 bool = l >= 0 + for yyj3125 := 0; ; yyj3125++ { + if yyhl3125 { + if yyj3125 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3125Slc = r.DecodeBytes(yys3125Slc, true, true) + yys3125 := string(yys3125Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3125 { + case "Path": + if r.TryDecodeAsNil() { + x.Path = "" + } else { + x.Path = string(r.DecodeString()) + } + 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, yys3125) + } // end switch yys3125 + } // end for yyj3125 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3129 int + var yyb3129 bool + var yyhl3129 bool = l >= 0 + yyj3129++ + if yyhl3129 { + yyb3129 = yyj3129 > l + } else { + yyb3129 = r.CheckBreak() + } + if yyb3129 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37291,18 +39378,50 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } + yyj3129++ + if yyhl3129 { + yyb3129 = yyj3129 > l + } else { + yyb3129 = r.CheckBreak() + } + if yyb3129 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3129++ + if yyhl3129 { + yyb3129 = yyj3129 > l + } else { + yyb3129 = r.CheckBreak() + } + if yyb3129 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj2980++ - if yyhl2980 { - yyb2980 = yyj2980 > l + yyj3129++ + if yyhl3129 { + yyb3129 = yyj3129 > l } else { - yyb2980 = r.CheckBreak() + yyb3129 = r.CheckBreak() } - if yyb2980 { + if yyb3129 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2980-1, "") + z.DecStructFieldNotFound(yyj3129-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37314,41 +39433,41 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2984 := z.EncBinary() - _ = yym2984 + yym3133 := z.EncBinary() + _ = yym3133 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2985 := !z.EncBinary() - yy2arr2985 := z.EncBasicHandle().StructToArray - var yyq2985 [7]bool - _, _, _ = yysep2985, yyq2985, yy2arr2985 - const yyr2985 bool = false - yyq2985[0] = x.Kind != "" - yyq2985[1] = x.Namespace != "" - yyq2985[2] = x.Name != "" - yyq2985[3] = x.UID != "" - yyq2985[4] = x.APIVersion != "" - yyq2985[5] = x.ResourceVersion != "" - yyq2985[6] = x.FieldPath != "" - var yynn2985 int - if yyr2985 || yy2arr2985 { + yysep3134 := !z.EncBinary() + yy2arr3134 := z.EncBasicHandle().StructToArray + var yyq3134 [7]bool + _, _, _ = yysep3134, yyq3134, yy2arr3134 + const yyr3134 bool = false + yyq3134[0] = x.Kind != "" + yyq3134[1] = x.Namespace != "" + yyq3134[2] = x.Name != "" + yyq3134[3] = x.UID != "" + yyq3134[4] = x.APIVersion != "" + yyq3134[5] = x.ResourceVersion != "" + yyq3134[6] = x.FieldPath != "" + var yynn3134 int + if yyr3134 || yy2arr3134 { r.EncodeArrayStart(7) } else { - yynn2985 = 0 - for _, b := range yyq2985 { + yynn3134 = 0 + for _, b := range yyq3134 { if b { - yynn2985++ + yynn3134++ } } - r.EncodeMapStart(yynn2985) - yynn2985 = 0 + r.EncodeMapStart(yynn3134) + yynn3134 = 0 } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[0] { - yym2987 := z.EncBinary() - _ = yym2987 + if yyq3134[0] { + yym3136 := z.EncBinary() + _ = yym3136 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -37357,23 +39476,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[0] { + if yyq3134[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2988 := z.EncBinary() - _ = yym2988 + yym3137 := z.EncBinary() + _ = yym3137 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[1] { - yym2990 := z.EncBinary() - _ = yym2990 + if yyq3134[1] { + yym3139 := z.EncBinary() + _ = yym3139 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) @@ -37382,23 +39501,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[1] { + if yyq3134[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("namespace")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2991 := z.EncBinary() - _ = yym2991 + yym3140 := z.EncBinary() + _ = yym3140 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[2] { - yym2993 := z.EncBinary() - _ = yym2993 + if yyq3134[2] { + yym3142 := z.EncBinary() + _ = yym3142 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -37407,23 +39526,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[2] { + if yyq3134[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2994 := z.EncBinary() - _ = yym2994 + yym3143 := z.EncBinary() + _ = yym3143 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[3] { - yym2996 := z.EncBinary() - _ = yym2996 + if yyq3134[3] { + yym3145 := z.EncBinary() + _ = yym3145 if false { } else if z.HasExtensions() && z.EncExt(x.UID) { } else { @@ -37433,12 +39552,12 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[3] { + if yyq3134[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("uid")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2997 := z.EncBinary() - _ = yym2997 + yym3146 := z.EncBinary() + _ = yym3146 if false { } else if z.HasExtensions() && z.EncExt(x.UID) { } else { @@ -37446,11 +39565,11 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[4] { - yym2999 := z.EncBinary() - _ = yym2999 + if yyq3134[4] { + yym3148 := z.EncBinary() + _ = yym3148 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -37459,23 +39578,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[4] { + if yyq3134[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3000 := z.EncBinary() - _ = yym3000 + yym3149 := z.EncBinary() + _ = yym3149 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[5] { - yym3002 := z.EncBinary() - _ = yym3002 + if yyq3134[5] { + yym3151 := z.EncBinary() + _ = yym3151 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) @@ -37484,23 +39603,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[5] { + if yyq3134[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3003 := z.EncBinary() - _ = yym3003 + yym3152 := z.EncBinary() + _ = yym3152 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2985[6] { - yym3005 := z.EncBinary() - _ = yym3005 + if yyq3134[6] { + yym3154 := z.EncBinary() + _ = yym3154 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) @@ -37509,19 +39628,19 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2985[6] { + if yyq3134[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3006 := z.EncBinary() - _ = yym3006 + yym3155 := z.EncBinary() + _ = yym3155 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) } } } - if yyr2985 || yy2arr2985 { + if yyr3134 || yy2arr3134 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -37534,25 +39653,25 @@ func (x *ObjectReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3007 := z.DecBinary() - _ = yym3007 + yym3156 := z.DecBinary() + _ = yym3156 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3008 := r.ContainerType() - if yyct3008 == codecSelferValueTypeMap1234 { - yyl3008 := r.ReadMapStart() - if yyl3008 == 0 { + yyct3157 := r.ContainerType() + if yyct3157 == codecSelferValueTypeMap1234 { + yyl3157 := r.ReadMapStart() + if yyl3157 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3008, d) + x.codecDecodeSelfFromMap(yyl3157, d) } - } else if yyct3008 == codecSelferValueTypeArray1234 { - yyl3008 := r.ReadArrayStart() - if yyl3008 == 0 { + } else if yyct3157 == codecSelferValueTypeArray1234 { + yyl3157 := r.ReadArrayStart() + if yyl3157 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3008, d) + x.codecDecodeSelfFromArray(yyl3157, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -37564,12 +39683,12 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3009Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3009Slc - var yyhl3009 bool = l >= 0 - for yyj3009 := 0; ; yyj3009++ { - if yyhl3009 { - if yyj3009 >= l { + var yys3158Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3158Slc + var yyhl3158 bool = l >= 0 + for yyj3158 := 0; ; yyj3158++ { + if yyhl3158 { + if yyj3158 >= l { break } } else { @@ -37578,10 +39697,10 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3009Slc = r.DecodeBytes(yys3009Slc, true, true) - yys3009 := string(yys3009Slc) + yys3158Slc = r.DecodeBytes(yys3158Slc, true, true) + yys3158 := string(yys3158Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3009 { + switch yys3158 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -37625,9 +39744,9 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.FieldPath = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3009) - } // end switch yys3009 - } // end for yyj3009 + z.DecStructFieldNotFound(-1, yys3158) + } // end switch yys3158 + } // end for yyj3158 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -37635,16 +39754,16 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3017 int - var yyb3017 bool - var yyhl3017 bool = l >= 0 - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + var yyj3166 int + var yyb3166 bool + var yyhl3166 bool = l >= 0 + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37654,13 +39773,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37670,13 +39789,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Namespace = string(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37686,13 +39805,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Name = string(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37702,13 +39821,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.UID = pkg1_types.UID(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37718,13 +39837,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37734,13 +39853,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ResourceVersion = string(r.DecodeString()) } - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37751,17 +39870,17 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.FieldPath = string(r.DecodeString()) } for { - yyj3017++ - if yyhl3017 { - yyb3017 = yyj3017 > l + yyj3166++ + if yyhl3166 { + yyb3166 = yyj3166 > l } else { - yyb3017 = r.CheckBreak() + yyb3166 = r.CheckBreak() } - if yyb3017 { + if yyb3166 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3017-1, "") + z.DecStructFieldNotFound(yyj3166-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37773,33 +39892,33 @@ func (x *LocalObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3025 := z.EncBinary() - _ = yym3025 + yym3174 := z.EncBinary() + _ = yym3174 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3026 := !z.EncBinary() - yy2arr3026 := z.EncBasicHandle().StructToArray - var yyq3026 [1]bool - _, _, _ = yysep3026, yyq3026, yy2arr3026 - const yyr3026 bool = false - var yynn3026 int - if yyr3026 || yy2arr3026 { + yysep3175 := !z.EncBinary() + yy2arr3175 := z.EncBasicHandle().StructToArray + var yyq3175 [1]bool + _, _, _ = yysep3175, yyq3175, yy2arr3175 + const yyr3175 bool = false + var yynn3175 int + if yyr3175 || yy2arr3175 { r.EncodeArrayStart(1) } else { - yynn3026 = 1 - for _, b := range yyq3026 { + yynn3175 = 1 + for _, b := range yyq3175 { if b { - yynn3026++ + yynn3175++ } } - r.EncodeMapStart(yynn3026) - yynn3026 = 0 + r.EncodeMapStart(yynn3175) + yynn3175 = 0 } - if yyr3026 || yy2arr3026 { + if yyr3175 || yy2arr3175 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym3028 := z.EncBinary() - _ = yym3028 + yym3177 := z.EncBinary() + _ = yym3177 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -37808,14 +39927,14 @@ func (x *LocalObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3029 := z.EncBinary() - _ = yym3029 + yym3178 := z.EncBinary() + _ = yym3178 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr3026 || yy2arr3026 { + if yyr3175 || yy2arr3175 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -37828,25 +39947,25 @@ func (x *LocalObjectReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3030 := z.DecBinary() - _ = yym3030 + yym3179 := z.DecBinary() + _ = yym3179 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3031 := r.ContainerType() - if yyct3031 == codecSelferValueTypeMap1234 { - yyl3031 := r.ReadMapStart() - if yyl3031 == 0 { + yyct3180 := r.ContainerType() + if yyct3180 == codecSelferValueTypeMap1234 { + yyl3180 := r.ReadMapStart() + if yyl3180 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3031, d) + x.codecDecodeSelfFromMap(yyl3180, d) } - } else if yyct3031 == codecSelferValueTypeArray1234 { - yyl3031 := r.ReadArrayStart() - if yyl3031 == 0 { + } else if yyct3180 == codecSelferValueTypeArray1234 { + yyl3180 := r.ReadArrayStart() + if yyl3180 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3031, d) + x.codecDecodeSelfFromArray(yyl3180, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -37858,12 +39977,12 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3032Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3032Slc - var yyhl3032 bool = l >= 0 - for yyj3032 := 0; ; yyj3032++ { - if yyhl3032 { - if yyj3032 >= l { + var yys3181Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3181Slc + var yyhl3181 bool = l >= 0 + for yyj3181 := 0; ; yyj3181++ { + if yyhl3181 { + if yyj3181 >= l { break } } else { @@ -37872,10 +39991,10 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3032Slc = r.DecodeBytes(yys3032Slc, true, true) - yys3032 := string(yys3032Slc) + yys3181Slc = r.DecodeBytes(yys3181Slc, true, true) + yys3181 := string(yys3181Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3032 { + switch yys3181 { case "Name": if r.TryDecodeAsNil() { x.Name = "" @@ -37883,9 +40002,9 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Name = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3032) - } // end switch yys3032 - } // end for yyj3032 + z.DecStructFieldNotFound(-1, yys3181) + } // end switch yys3181 + } // end for yyj3181 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -37893,16 +40012,16 @@ func (x *LocalObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3034 int - var yyb3034 bool - var yyhl3034 bool = l >= 0 - yyj3034++ - if yyhl3034 { - yyb3034 = yyj3034 > l + var yyj3183 int + var yyb3183 bool + var yyhl3183 bool = l >= 0 + yyj3183++ + if yyhl3183 { + yyb3183 = yyj3183 > l } else { - yyb3034 = r.CheckBreak() + yyb3183 = r.CheckBreak() } - if yyb3034 { + if yyb3183 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37913,17 +40032,17 @@ func (x *LocalObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Name = string(r.DecodeString()) } for { - yyj3034++ - if yyhl3034 { - yyb3034 = yyj3034 > l + yyj3183++ + if yyhl3183 { + yyb3183 = yyj3183 > l } else { - yyb3034 = r.CheckBreak() + yyb3183 = r.CheckBreak() } - if yyb3034 { + if yyb3183 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3034-1, "") + z.DecStructFieldNotFound(yyj3183-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37935,100 +40054,100 @@ func (x *SerializedReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3036 := z.EncBinary() - _ = yym3036 + yym3185 := z.EncBinary() + _ = yym3185 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3037 := !z.EncBinary() - yy2arr3037 := z.EncBasicHandle().StructToArray - var yyq3037 [3]bool - _, _, _ = yysep3037, yyq3037, yy2arr3037 - const yyr3037 bool = false - yyq3037[0] = x.Kind != "" - yyq3037[1] = x.APIVersion != "" - yyq3037[2] = true - var yynn3037 int - if yyr3037 || yy2arr3037 { + yysep3186 := !z.EncBinary() + yy2arr3186 := z.EncBasicHandle().StructToArray + var yyq3186 [3]bool + _, _, _ = yysep3186, yyq3186, yy2arr3186 + const yyr3186 bool = false + yyq3186[0] = true + yyq3186[1] = x.Kind != "" + yyq3186[2] = x.APIVersion != "" + var yynn3186 int + if yyr3186 || yy2arr3186 { r.EncodeArrayStart(3) } else { - yynn3037 = 0 - for _, b := range yyq3037 { + yynn3186 = 0 + for _, b := range yyq3186 { if b { - yynn3037++ + yynn3186++ } } - r.EncodeMapStart(yynn3037) - yynn3037 = 0 + r.EncodeMapStart(yynn3186) + yynn3186 = 0 } - if yyr3037 || yy2arr3037 { + if yyr3186 || yy2arr3186 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3037[0] { - yym3039 := z.EncBinary() - _ = yym3039 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3037[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3040 := z.EncBinary() - _ = yym3040 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3037 || yy2arr3037 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3037[1] { - yym3042 := z.EncBinary() - _ = yym3042 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3037[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3043 := z.EncBinary() - _ = yym3043 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3037 || yy2arr3037 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3037[2] { - yy3045 := &x.Reference - yy3045.CodecEncodeSelf(e) + if yyq3186[0] { + yy3188 := &x.Reference + yy3188.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3037[2] { + if yyq3186[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reference")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3046 := &x.Reference - yy3046.CodecEncodeSelf(e) + yy3189 := &x.Reference + yy3189.CodecEncodeSelf(e) } } - if yyr3037 || yy2arr3037 { + if yyr3186 || yy2arr3186 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3186[1] { + yym3191 := z.EncBinary() + _ = yym3191 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3186[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3192 := z.EncBinary() + _ = yym3192 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3186 || yy2arr3186 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3186[2] { + yym3194 := z.EncBinary() + _ = yym3194 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3186[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3195 := z.EncBinary() + _ = yym3195 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3186 || yy2arr3186 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -38041,25 +40160,25 @@ func (x *SerializedReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3047 := z.DecBinary() - _ = yym3047 + yym3196 := z.DecBinary() + _ = yym3196 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3048 := r.ContainerType() - if yyct3048 == codecSelferValueTypeMap1234 { - yyl3048 := r.ReadMapStart() - if yyl3048 == 0 { + yyct3197 := r.ContainerType() + if yyct3197 == codecSelferValueTypeMap1234 { + yyl3197 := r.ReadMapStart() + if yyl3197 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3048, d) + x.codecDecodeSelfFromMap(yyl3197, d) } - } else if yyct3048 == codecSelferValueTypeArray1234 { - yyl3048 := r.ReadArrayStart() - if yyl3048 == 0 { + } else if yyct3197 == codecSelferValueTypeArray1234 { + yyl3197 := r.ReadArrayStart() + if yyl3197 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3048, d) + x.codecDecodeSelfFromArray(yyl3197, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -38071,12 +40190,12 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3049Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3049Slc - var yyhl3049 bool = l >= 0 - for yyj3049 := 0; ; yyj3049++ { - if yyhl3049 { - if yyj3049 >= l { + var yys3198Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3198Slc + var yyhl3198 bool = l >= 0 + for yyj3198 := 0; ; yyj3198++ { + if yyhl3198 { + if yyj3198 >= l { break } } else { @@ -38085,10 +40204,17 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3049Slc = r.DecodeBytes(yys3049Slc, true, true) - yys3049 := string(yys3049Slc) + yys3198Slc = r.DecodeBytes(yys3198Slc, true, true) + yys3198 := string(yys3198Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3049 { + switch yys3198 { + case "reference": + if r.TryDecodeAsNil() { + x.Reference = ObjectReference{} + } else { + yyv3199 := &x.Reference + yyv3199.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -38101,17 +40227,10 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "reference": - if r.TryDecodeAsNil() { - x.Reference = ObjectReference{} - } else { - yyv3052 := &x.Reference - yyv3052.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys3049) - } // end switch yys3049 - } // end for yyj3049 + z.DecStructFieldNotFound(-1, yys3198) + } // end switch yys3198 + } // end for yyj3198 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -38119,16 +40238,33 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3053 int - var yyb3053 bool - var yyhl3053 bool = l >= 0 - yyj3053++ - if yyhl3053 { - yyb3053 = yyj3053 > l + var yyj3202 int + var yyb3202 bool + var yyhl3202 bool = l >= 0 + yyj3202++ + if yyhl3202 { + yyb3202 = yyj3202 > l } else { - yyb3053 = r.CheckBreak() + yyb3202 = r.CheckBreak() } - if yyb3053 { + if yyb3202 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Reference = ObjectReference{} + } else { + yyv3203 := &x.Reference + yyv3203.CodecDecodeSelf(d) + } + yyj3202++ + if yyhl3202 { + yyb3202 = yyj3202 > l + } else { + yyb3202 = r.CheckBreak() + } + if yyb3202 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38138,13 +40274,13 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj3053++ - if yyhl3053 { - yyb3053 = yyj3053 > l + yyj3202++ + if yyhl3202 { + yyb3202 = yyj3202 > l } else { - yyb3053 = r.CheckBreak() + yyb3202 = r.CheckBreak() } - if yyb3053 { + if yyb3202 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38154,35 +40290,18 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj3053++ - if yyhl3053 { - yyb3053 = yyj3053 > l - } else { - yyb3053 = r.CheckBreak() - } - if yyb3053 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reference = ObjectReference{} - } else { - yyv3056 := &x.Reference - yyv3056.CodecDecodeSelf(d) - } for { - yyj3053++ - if yyhl3053 { - yyb3053 = yyj3053 > l + yyj3202++ + if yyhl3202 { + yyb3202 = yyj3202 > l } else { - yyb3053 = r.CheckBreak() + yyb3202 = r.CheckBreak() } - if yyb3053 { + if yyb3202 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3053-1, "") + z.DecStructFieldNotFound(yyj3202-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -38194,36 +40313,36 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3057 := z.EncBinary() - _ = yym3057 + yym3206 := z.EncBinary() + _ = yym3206 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3058 := !z.EncBinary() - yy2arr3058 := z.EncBasicHandle().StructToArray - var yyq3058 [2]bool - _, _, _ = yysep3058, yyq3058, yy2arr3058 - const yyr3058 bool = false - yyq3058[0] = x.Component != "" - yyq3058[1] = x.Host != "" - var yynn3058 int - if yyr3058 || yy2arr3058 { + yysep3207 := !z.EncBinary() + yy2arr3207 := z.EncBasicHandle().StructToArray + var yyq3207 [2]bool + _, _, _ = yysep3207, yyq3207, yy2arr3207 + const yyr3207 bool = false + yyq3207[0] = x.Component != "" + yyq3207[1] = x.Host != "" + var yynn3207 int + if yyr3207 || yy2arr3207 { r.EncodeArrayStart(2) } else { - yynn3058 = 0 - for _, b := range yyq3058 { + yynn3207 = 0 + for _, b := range yyq3207 { if b { - yynn3058++ + yynn3207++ } } - r.EncodeMapStart(yynn3058) - yynn3058 = 0 + r.EncodeMapStart(yynn3207) + yynn3207 = 0 } - if yyr3058 || yy2arr3058 { + if yyr3207 || yy2arr3207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3058[0] { - yym3060 := z.EncBinary() - _ = yym3060 + if yyq3207[0] { + yym3209 := z.EncBinary() + _ = yym3209 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Component)) @@ -38232,23 +40351,23 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3058[0] { + if yyq3207[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("component")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3061 := z.EncBinary() - _ = yym3061 + yym3210 := z.EncBinary() + _ = yym3210 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Component)) } } } - if yyr3058 || yy2arr3058 { + if yyr3207 || yy2arr3207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3058[1] { - yym3063 := z.EncBinary() - _ = yym3063 + if yyq3207[1] { + yym3212 := z.EncBinary() + _ = yym3212 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) @@ -38257,19 +40376,19 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3058[1] { + if yyq3207[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("host")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3064 := z.EncBinary() - _ = yym3064 + yym3213 := z.EncBinary() + _ = yym3213 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) } } } - if yyr3058 || yy2arr3058 { + if yyr3207 || yy2arr3207 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -38282,25 +40401,25 @@ func (x *EventSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3065 := z.DecBinary() - _ = yym3065 + yym3214 := z.DecBinary() + _ = yym3214 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3066 := r.ContainerType() - if yyct3066 == codecSelferValueTypeMap1234 { - yyl3066 := r.ReadMapStart() - if yyl3066 == 0 { + yyct3215 := r.ContainerType() + if yyct3215 == codecSelferValueTypeMap1234 { + yyl3215 := r.ReadMapStart() + if yyl3215 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3066, d) + x.codecDecodeSelfFromMap(yyl3215, d) } - } else if yyct3066 == codecSelferValueTypeArray1234 { - yyl3066 := r.ReadArrayStart() - if yyl3066 == 0 { + } else if yyct3215 == codecSelferValueTypeArray1234 { + yyl3215 := r.ReadArrayStart() + if yyl3215 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3066, d) + x.codecDecodeSelfFromArray(yyl3215, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -38312,12 +40431,12 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3067Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3067Slc - var yyhl3067 bool = l >= 0 - for yyj3067 := 0; ; yyj3067++ { - if yyhl3067 { - if yyj3067 >= l { + var yys3216Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3216Slc + var yyhl3216 bool = l >= 0 + for yyj3216 := 0; ; yyj3216++ { + if yyhl3216 { + if yyj3216 >= l { break } } else { @@ -38326,10 +40445,10 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3067Slc = r.DecodeBytes(yys3067Slc, true, true) - yys3067 := string(yys3067Slc) + yys3216Slc = r.DecodeBytes(yys3216Slc, true, true) + yys3216 := string(yys3216Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3067 { + switch yys3216 { case "component": if r.TryDecodeAsNil() { x.Component = "" @@ -38343,9 +40462,9 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Host = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3067) - } // end switch yys3067 - } // end for yyj3067 + z.DecStructFieldNotFound(-1, yys3216) + } // end switch yys3216 + } // end for yyj3216 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -38353,16 +40472,16 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3070 int - var yyb3070 bool - var yyhl3070 bool = l >= 0 - yyj3070++ - if yyhl3070 { - yyb3070 = yyj3070 > l + var yyj3219 int + var yyb3219 bool + var yyhl3219 bool = l >= 0 + yyj3219++ + if yyhl3219 { + yyb3219 = yyj3219 > l } else { - yyb3070 = r.CheckBreak() + yyb3219 = r.CheckBreak() } - if yyb3070 { + if yyb3219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38372,13 +40491,13 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Component = string(r.DecodeString()) } - yyj3070++ - if yyhl3070 { - yyb3070 = yyj3070 > l + yyj3219++ + if yyhl3219 { + yyb3219 = yyj3219 > l } else { - yyb3070 = r.CheckBreak() + yyb3219 = r.CheckBreak() } - if yyb3070 { + if yyb3219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38389,17 +40508,17 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Host = string(r.DecodeString()) } for { - yyj3070++ - if yyhl3070 { - yyb3070 = yyj3070 > l + yyj3219++ + if yyhl3219 { + yyb3219 = yyj3219 > l } else { - yyb3070 = r.CheckBreak() + yyb3219 = r.CheckBreak() } - if yyb3070 { + if yyb3219 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3070-1, "") + z.DecStructFieldNotFound(yyj3219-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -38411,129 +40530,79 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3073 := z.EncBinary() - _ = yym3073 + yym3222 := z.EncBinary() + _ = yym3222 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3074 := !z.EncBinary() - yy2arr3074 := z.EncBasicHandle().StructToArray - var yyq3074 [11]bool - _, _, _ = yysep3074, yyq3074, yy2arr3074 - const yyr3074 bool = false - yyq3074[0] = x.Kind != "" - yyq3074[1] = x.APIVersion != "" - yyq3074[2] = true - yyq3074[3] = true - yyq3074[4] = x.Reason != "" - yyq3074[5] = x.Message != "" - yyq3074[6] = true - yyq3074[7] = true - yyq3074[8] = true - yyq3074[9] = x.Count != 0 - yyq3074[10] = x.Type != "" - var yynn3074 int - if yyr3074 || yy2arr3074 { + yysep3223 := !z.EncBinary() + yy2arr3223 := z.EncBasicHandle().StructToArray + var yyq3223 [11]bool + _, _, _ = yysep3223, yyq3223, yy2arr3223 + const yyr3223 bool = false + yyq3223[0] = true + yyq3223[1] = true + yyq3223[2] = x.Reason != "" + yyq3223[3] = x.Message != "" + yyq3223[4] = true + yyq3223[5] = true + yyq3223[6] = true + yyq3223[7] = x.Count != 0 + yyq3223[8] = x.Type != "" + yyq3223[9] = x.Kind != "" + yyq3223[10] = x.APIVersion != "" + var yynn3223 int + if yyr3223 || yy2arr3223 { r.EncodeArrayStart(11) } else { - yynn3074 = 0 - for _, b := range yyq3074 { + yynn3223 = 0 + for _, b := range yyq3223 { if b { - yynn3074++ + yynn3223++ } } - r.EncodeMapStart(yynn3074) - yynn3074 = 0 + r.EncodeMapStart(yynn3223) + yynn3223 = 0 } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[0] { - yym3076 := z.EncBinary() - _ = yym3076 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3074[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3077 := z.EncBinary() - _ = yym3077 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3074 || yy2arr3074 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[1] { - yym3079 := z.EncBinary() - _ = yym3079 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3074[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3080 := z.EncBinary() - _ = yym3080 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3074 || yy2arr3074 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[2] { - yy3082 := &x.ObjectMeta - yy3082.CodecEncodeSelf(e) + if yyq3223[0] { + yy3225 := &x.ObjectMeta + yy3225.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3074[2] { + if yyq3223[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3083 := &x.ObjectMeta - yy3083.CodecEncodeSelf(e) + yy3226 := &x.ObjectMeta + yy3226.CodecEncodeSelf(e) } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[3] { - yy3085 := &x.InvolvedObject - yy3085.CodecEncodeSelf(e) + if yyq3223[1] { + yy3228 := &x.InvolvedObject + yy3228.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3074[3] { + if yyq3223[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("involvedObject")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3086 := &x.InvolvedObject - yy3086.CodecEncodeSelf(e) + yy3229 := &x.InvolvedObject + yy3229.CodecEncodeSelf(e) } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[4] { - yym3088 := z.EncBinary() - _ = yym3088 + if yyq3223[2] { + yym3231 := z.EncBinary() + _ = yym3231 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -38542,23 +40611,23 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3074[4] { + if yyq3223[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3089 := z.EncBinary() - _ = yym3089 + yym3232 := z.EncBinary() + _ = yym3232 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[5] { - yym3091 := z.EncBinary() - _ = yym3091 + if yyq3223[3] { + yym3234 := z.EncBinary() + _ = yym3234 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -38567,114 +40636,114 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3074[5] { + if yyq3223[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3092 := z.EncBinary() - _ = yym3092 + yym3235 := z.EncBinary() + _ = yym3235 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[6] { - yy3094 := &x.Source - yy3094.CodecEncodeSelf(e) + if yyq3223[4] { + yy3237 := &x.Source + yy3237.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3074[6] { + if yyq3223[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("source")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3095 := &x.Source - yy3095.CodecEncodeSelf(e) + yy3238 := &x.Source + yy3238.CodecEncodeSelf(e) } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[7] { - yy3097 := &x.FirstTimestamp - yym3098 := z.EncBinary() - _ = yym3098 + if yyq3223[5] { + yy3240 := &x.FirstTimestamp + yym3241 := z.EncBinary() + _ = yym3241 if false { - } else if z.HasExtensions() && z.EncExt(yy3097) { - } else if yym3098 { - z.EncBinaryMarshal(yy3097) - } else if !yym3098 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3097) + } else if z.HasExtensions() && z.EncExt(yy3240) { + } else if yym3241 { + z.EncBinaryMarshal(yy3240) + } else if !yym3241 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3240) } else { - z.EncFallback(yy3097) + z.EncFallback(yy3240) } } else { r.EncodeNil() } } else { - if yyq3074[7] { + if yyq3223[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("firstTimestamp")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3099 := &x.FirstTimestamp - yym3100 := z.EncBinary() - _ = yym3100 + yy3242 := &x.FirstTimestamp + yym3243 := z.EncBinary() + _ = yym3243 if false { - } else if z.HasExtensions() && z.EncExt(yy3099) { - } else if yym3100 { - z.EncBinaryMarshal(yy3099) - } else if !yym3100 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3099) + } else if z.HasExtensions() && z.EncExt(yy3242) { + } else if yym3243 { + z.EncBinaryMarshal(yy3242) + } else if !yym3243 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3242) } else { - z.EncFallback(yy3099) + z.EncFallback(yy3242) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[8] { - yy3102 := &x.LastTimestamp - yym3103 := z.EncBinary() - _ = yym3103 + if yyq3223[6] { + yy3245 := &x.LastTimestamp + yym3246 := z.EncBinary() + _ = yym3246 if false { - } else if z.HasExtensions() && z.EncExt(yy3102) { - } else if yym3103 { - z.EncBinaryMarshal(yy3102) - } else if !yym3103 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3102) + } else if z.HasExtensions() && z.EncExt(yy3245) { + } else if yym3246 { + z.EncBinaryMarshal(yy3245) + } else if !yym3246 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3245) } else { - z.EncFallback(yy3102) + z.EncFallback(yy3245) } } else { r.EncodeNil() } } else { - if yyq3074[8] { + if yyq3223[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTimestamp")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3104 := &x.LastTimestamp - yym3105 := z.EncBinary() - _ = yym3105 + yy3247 := &x.LastTimestamp + yym3248 := z.EncBinary() + _ = yym3248 if false { - } else if z.HasExtensions() && z.EncExt(yy3104) { - } else if yym3105 { - z.EncBinaryMarshal(yy3104) - } else if !yym3105 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3104) + } else if z.HasExtensions() && z.EncExt(yy3247) { + } else if yym3248 { + z.EncBinaryMarshal(yy3247) + } else if !yym3248 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3247) } else { - z.EncFallback(yy3104) + z.EncFallback(yy3247) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[9] { - yym3107 := z.EncBinary() - _ = yym3107 + if yyq3223[7] { + yym3250 := z.EncBinary() + _ = yym3250 if false { } else { r.EncodeInt(int64(x.Count)) @@ -38683,23 +40752,23 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq3074[9] { + if yyq3223[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("count")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3108 := z.EncBinary() - _ = yym3108 + yym3251 := z.EncBinary() + _ = yym3251 if false { } else { r.EncodeInt(int64(x.Count)) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3074[10] { - yym3110 := z.EncBinary() - _ = yym3110 + if yyq3223[8] { + yym3253 := z.EncBinary() + _ = yym3253 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) @@ -38708,19 +40777,69 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3074[10] { + if yyq3223[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3111 := z.EncBinary() - _ = yym3111 + yym3254 := z.EncBinary() + _ = yym3254 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) } } } - if yyr3074 || yy2arr3074 { + if yyr3223 || yy2arr3223 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3223[9] { + yym3256 := z.EncBinary() + _ = yym3256 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3223[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3257 := z.EncBinary() + _ = yym3257 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3223 || yy2arr3223 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3223[10] { + yym3259 := z.EncBinary() + _ = yym3259 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3223[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3260 := z.EncBinary() + _ = yym3260 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3223 || yy2arr3223 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -38733,25 +40852,25 @@ func (x *Event) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3112 := z.DecBinary() - _ = yym3112 + yym3261 := z.DecBinary() + _ = yym3261 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3113 := r.ContainerType() - if yyct3113 == codecSelferValueTypeMap1234 { - yyl3113 := r.ReadMapStart() - if yyl3113 == 0 { + yyct3262 := r.ContainerType() + if yyct3262 == codecSelferValueTypeMap1234 { + yyl3262 := r.ReadMapStart() + if yyl3262 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3113, d) + x.codecDecodeSelfFromMap(yyl3262, d) } - } else if yyct3113 == codecSelferValueTypeArray1234 { - yyl3113 := r.ReadArrayStart() - if yyl3113 == 0 { + } else if yyct3262 == codecSelferValueTypeArray1234 { + yyl3262 := r.ReadArrayStart() + if yyl3262 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3113, d) + x.codecDecodeSelfFromArray(yyl3262, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -38763,12 +40882,12 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3114Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3114Slc - var yyhl3114 bool = l >= 0 - for yyj3114 := 0; ; yyj3114++ { - if yyhl3114 { - if yyj3114 >= l { + var yys3263Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3263Slc + var yyhl3263 bool = l >= 0 + for yyj3263 := 0; ; yyj3263++ { + if yyhl3263 { + if yyj3263 >= l { break } } else { @@ -38777,35 +40896,23 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3114Slc = r.DecodeBytes(yys3114Slc, true, true) - yys3114 := string(yys3114Slc) + yys3263Slc = r.DecodeBytes(yys3263Slc, true, true) + yys3263 := string(yys3263Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3114 { - 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()) - } + switch yys3263 { case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3117 := &x.ObjectMeta - yyv3117.CodecDecodeSelf(d) + yyv3264 := &x.ObjectMeta + yyv3264.CodecDecodeSelf(d) } case "involvedObject": if r.TryDecodeAsNil() { x.InvolvedObject = ObjectReference{} } else { - yyv3118 := &x.InvolvedObject - yyv3118.CodecDecodeSelf(d) + yyv3265 := &x.InvolvedObject + yyv3265.CodecDecodeSelf(d) } case "reason": if r.TryDecodeAsNil() { @@ -38823,41 +40930,41 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Source = EventSource{} } else { - yyv3121 := &x.Source - yyv3121.CodecDecodeSelf(d) + yyv3268 := &x.Source + yyv3268.CodecDecodeSelf(d) } case "firstTimestamp": if r.TryDecodeAsNil() { x.FirstTimestamp = pkg2_unversioned.Time{} } else { - yyv3122 := &x.FirstTimestamp - yym3123 := z.DecBinary() - _ = yym3123 + yyv3269 := &x.FirstTimestamp + yym3270 := z.DecBinary() + _ = yym3270 if false { - } else if z.HasExtensions() && z.DecExt(yyv3122) { - } else if yym3123 { - z.DecBinaryUnmarshal(yyv3122) - } else if !yym3123 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3122) + } else if z.HasExtensions() && z.DecExt(yyv3269) { + } else if yym3270 { + z.DecBinaryUnmarshal(yyv3269) + } else if !yym3270 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3269) } else { - z.DecFallback(yyv3122, false) + z.DecFallback(yyv3269, false) } } case "lastTimestamp": if r.TryDecodeAsNil() { x.LastTimestamp = pkg2_unversioned.Time{} } else { - yyv3124 := &x.LastTimestamp - yym3125 := z.DecBinary() - _ = yym3125 + yyv3271 := &x.LastTimestamp + yym3272 := z.DecBinary() + _ = yym3272 if false { - } else if z.HasExtensions() && z.DecExt(yyv3124) { - } else if yym3125 { - z.DecBinaryUnmarshal(yyv3124) - } else if !yym3125 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3124) + } else if z.HasExtensions() && z.DecExt(yyv3271) { + } else if yym3272 { + z.DecBinaryUnmarshal(yyv3271) + } else if !yym3272 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3271) } else { - z.DecFallback(yyv3124, false) + z.DecFallback(yyv3271, false) } } case "count": @@ -38872,10 +40979,22 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } + 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, yys3114) - } // end switch yys3114 - } // end for yyj3114 + z.DecStructFieldNotFound(-1, yys3263) + } // end switch yys3263 + } // end for yyj3263 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -38883,48 +41002,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3128 int - var yyb3128 bool - var yyhl3128 bool = l >= 0 - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + var yyj3277 int + var yyb3277 bool + var yyhl3277 bool = l >= 0 + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l - } else { - yyb3128 = r.CheckBreak() - } - if yyb3128 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l - } else { - yyb3128 = r.CheckBreak() - } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38932,16 +41019,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3131 := &x.ObjectMeta - yyv3131.CodecDecodeSelf(d) + yyv3278 := &x.ObjectMeta + yyv3278.CodecDecodeSelf(d) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38949,16 +41036,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.InvolvedObject = ObjectReference{} } else { - yyv3132 := &x.InvolvedObject - yyv3132.CodecDecodeSelf(d) + yyv3279 := &x.InvolvedObject + yyv3279.CodecDecodeSelf(d) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38968,13 +41055,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38984,13 +41071,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Message = string(r.DecodeString()) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38998,16 +41085,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Source = EventSource{} } else { - yyv3135 := &x.Source - yyv3135.CodecDecodeSelf(d) + yyv3282 := &x.Source + yyv3282.CodecDecodeSelf(d) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39015,26 +41102,26 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.FirstTimestamp = pkg2_unversioned.Time{} } else { - yyv3136 := &x.FirstTimestamp - yym3137 := z.DecBinary() - _ = yym3137 + yyv3283 := &x.FirstTimestamp + yym3284 := z.DecBinary() + _ = yym3284 if false { - } else if z.HasExtensions() && z.DecExt(yyv3136) { - } else if yym3137 { - z.DecBinaryUnmarshal(yyv3136) - } else if !yym3137 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3136) + } else if z.HasExtensions() && z.DecExt(yyv3283) { + } else if yym3284 { + z.DecBinaryUnmarshal(yyv3283) + } else if !yym3284 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3283) } else { - z.DecFallback(yyv3136, false) + z.DecFallback(yyv3283, false) } } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39042,26 +41129,26 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTimestamp = pkg2_unversioned.Time{} } else { - yyv3138 := &x.LastTimestamp - yym3139 := z.DecBinary() - _ = yym3139 + yyv3285 := &x.LastTimestamp + yym3286 := z.DecBinary() + _ = yym3286 if false { - } else if z.HasExtensions() && z.DecExt(yyv3138) { - } else if yym3139 { - z.DecBinaryUnmarshal(yyv3138) - } else if !yym3139 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3138) + } else if z.HasExtensions() && z.DecExt(yyv3285) { + } else if yym3286 { + z.DecBinaryUnmarshal(yyv3285) + } else if !yym3286 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3285) } else { - z.DecFallback(yyv3138, false) + z.DecFallback(yyv3285, false) } } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39071,13 +41158,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Count = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39087,18 +41174,50 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l + } else { + yyb3277 = r.CheckBreak() + } + if yyb3277 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l + } else { + yyb3277 = r.CheckBreak() + } + if yyb3277 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj3128++ - if yyhl3128 { - yyb3128 = yyj3128 > l + yyj3277++ + if yyhl3277 { + yyb3277 = yyj3277 > l } else { - yyb3128 = r.CheckBreak() + yyb3277 = r.CheckBreak() } - if yyb3128 { + if yyb3277 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3128-1, "") + z.DecStructFieldNotFound(yyj3277-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39110,118 +41229,68 @@ func (x *EventList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3142 := z.EncBinary() - _ = yym3142 + yym3291 := z.EncBinary() + _ = yym3291 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3143 := !z.EncBinary() - yy2arr3143 := z.EncBasicHandle().StructToArray - var yyq3143 [4]bool - _, _, _ = yysep3143, yyq3143, yy2arr3143 - const yyr3143 bool = false - yyq3143[0] = x.Kind != "" - yyq3143[1] = x.APIVersion != "" - yyq3143[2] = true - var yynn3143 int - if yyr3143 || yy2arr3143 { + yysep3292 := !z.EncBinary() + yy2arr3292 := z.EncBasicHandle().StructToArray + var yyq3292 [4]bool + _, _, _ = yysep3292, yyq3292, yy2arr3292 + const yyr3292 bool = false + yyq3292[0] = true + yyq3292[2] = x.Kind != "" + yyq3292[3] = x.APIVersion != "" + var yynn3292 int + if yyr3292 || yy2arr3292 { r.EncodeArrayStart(4) } else { - yynn3143 = 1 - for _, b := range yyq3143 { + yynn3292 = 1 + for _, b := range yyq3292 { if b { - yynn3143++ + yynn3292++ } } - r.EncodeMapStart(yynn3143) - yynn3143 = 0 + r.EncodeMapStart(yynn3292) + yynn3292 = 0 } - if yyr3143 || yy2arr3143 { + if yyr3292 || yy2arr3292 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3143[0] { - yym3145 := z.EncBinary() - _ = yym3145 + if yyq3292[0] { + yy3294 := &x.ListMeta + yym3295 := z.EncBinary() + _ = yym3295 if false { + } else if z.HasExtensions() && z.EncExt(yy3294) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3143[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3146 := z.EncBinary() - _ = yym3146 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3143 || yy2arr3143 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3143[1] { - yym3148 := z.EncBinary() - _ = yym3148 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3143[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3149 := z.EncBinary() - _ = yym3149 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3143 || yy2arr3143 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3143[2] { - yy3151 := &x.ListMeta - yym3152 := z.EncBinary() - _ = yym3152 - if false { - } else if z.HasExtensions() && z.EncExt(yy3151) { - } else { - z.EncFallback(yy3151) + z.EncFallback(yy3294) } } else { r.EncodeNil() } } else { - if yyq3143[2] { + if yyq3292[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3153 := &x.ListMeta - yym3154 := z.EncBinary() - _ = yym3154 + yy3296 := &x.ListMeta + yym3297 := z.EncBinary() + _ = yym3297 if false { - } else if z.HasExtensions() && z.EncExt(yy3153) { + } else if z.HasExtensions() && z.EncExt(yy3296) { } else { - z.EncFallback(yy3153) + z.EncFallback(yy3296) } } } - if yyr3143 || yy2arr3143 { + if yyr3292 || yy2arr3292 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3156 := z.EncBinary() - _ = yym3156 + yym3299 := z.EncBinary() + _ = yym3299 if false { } else { h.encSliceEvent(([]Event)(x.Items), e) @@ -39234,15 +41303,65 @@ func (x *EventList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3157 := z.EncBinary() - _ = yym3157 + yym3300 := z.EncBinary() + _ = yym3300 if false { } else { h.encSliceEvent(([]Event)(x.Items), e) } } } - if yyr3143 || yy2arr3143 { + if yyr3292 || yy2arr3292 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3292[2] { + yym3302 := z.EncBinary() + _ = yym3302 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3292[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3303 := z.EncBinary() + _ = yym3303 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3292 || yy2arr3292 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3292[3] { + yym3305 := z.EncBinary() + _ = yym3305 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3292[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3306 := z.EncBinary() + _ = yym3306 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3292 || yy2arr3292 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39255,25 +41374,25 @@ func (x *EventList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3158 := z.DecBinary() - _ = yym3158 + yym3307 := z.DecBinary() + _ = yym3307 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3159 := r.ContainerType() - if yyct3159 == codecSelferValueTypeMap1234 { - yyl3159 := r.ReadMapStart() - if yyl3159 == 0 { + yyct3308 := r.ContainerType() + if yyct3308 == codecSelferValueTypeMap1234 { + yyl3308 := r.ReadMapStart() + if yyl3308 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3159, d) + x.codecDecodeSelfFromMap(yyl3308, d) } - } else if yyct3159 == codecSelferValueTypeArray1234 { - yyl3159 := r.ReadArrayStart() - if yyl3159 == 0 { + } else if yyct3308 == codecSelferValueTypeArray1234 { + yyl3308 := r.ReadArrayStart() + if yyl3308 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3159, d) + x.codecDecodeSelfFromArray(yyl3308, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -39285,12 +41404,12 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3160Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3160Slc - var yyhl3160 bool = l >= 0 - for yyj3160 := 0; ; yyj3160++ { - if yyhl3160 { - if yyj3160 >= l { + var yys3309Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3309Slc + var yyhl3309 bool = l >= 0 + for yyj3309 := 0; ; yyj3309++ { + if yyhl3309 { + if yyj3309 >= l { break } } else { @@ -39299,10 +41418,35 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3160Slc = r.DecodeBytes(yys3160Slc, true, true) - yys3160 := string(yys3160Slc) + yys3309Slc = r.DecodeBytes(yys3309Slc, true, true) + yys3309 := string(yys3309Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3160 { + switch yys3309 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3310 := &x.ListMeta + yym3311 := z.DecBinary() + _ = yym3311 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3310) { + } else { + z.DecFallback(yyv3310, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3312 := &x.Items + yym3313 := z.DecBinary() + _ = yym3313 + if false { + } else { + h.decSliceEvent((*[]Event)(yyv3312), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -39315,35 +41459,10 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3163 := &x.ListMeta - yym3164 := z.DecBinary() - _ = yym3164 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3163) { - } else { - z.DecFallback(yyv3163, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3165 := &x.Items - yym3166 := z.DecBinary() - _ = yym3166 - if false { - } else { - h.decSliceEvent((*[]Event)(yyv3165), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3160) - } // end switch yys3160 - } // end for yyj3160 + z.DecStructFieldNotFound(-1, yys3309) + } // end switch yys3309 + } // end for yyj3309 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -39351,16 +41470,61 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3167 int - var yyb3167 bool - var yyhl3167 bool = l >= 0 - yyj3167++ - if yyhl3167 { - yyb3167 = yyj3167 > l + var yyj3316 int + var yyb3316 bool + var yyhl3316 bool = l >= 0 + yyj3316++ + if yyhl3316 { + yyb3316 = yyj3316 > l } else { - yyb3167 = r.CheckBreak() + yyb3316 = r.CheckBreak() } - if yyb3167 { + if yyb3316 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3317 := &x.ListMeta + yym3318 := z.DecBinary() + _ = yym3318 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3317) { + } else { + z.DecFallback(yyv3317, false) + } + } + yyj3316++ + if yyhl3316 { + yyb3316 = yyj3316 > l + } else { + yyb3316 = r.CheckBreak() + } + if yyb3316 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3319 := &x.Items + yym3320 := z.DecBinary() + _ = yym3320 + if false { + } else { + h.decSliceEvent((*[]Event)(yyv3319), d) + } + } + yyj3316++ + if yyhl3316 { + yyb3316 = yyj3316 > l + } else { + yyb3316 = r.CheckBreak() + } + if yyb3316 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39370,13 +41534,13 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3167++ - if yyhl3167 { - yyb3167 = yyj3167 > l + yyj3316++ + if yyhl3316 { + yyb3316 = yyj3316 > l } else { - yyb3167 = r.CheckBreak() + yyb3316 = r.CheckBreak() } - if yyb3167 { + if yyb3316 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39386,63 +41550,18 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3167++ - if yyhl3167 { - yyb3167 = yyj3167 > l - } else { - yyb3167 = r.CheckBreak() - } - if yyb3167 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3170 := &x.ListMeta - yym3171 := z.DecBinary() - _ = yym3171 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3170) { - } else { - z.DecFallback(yyv3170, false) - } - } - yyj3167++ - if yyhl3167 { - yyb3167 = yyj3167 > l - } else { - yyb3167 = r.CheckBreak() - } - if yyb3167 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3172 := &x.Items - yym3173 := z.DecBinary() - _ = yym3173 - if false { - } else { - h.decSliceEvent((*[]Event)(yyv3172), d) - } - } for { - yyj3167++ - if yyhl3167 { - yyb3167 = yyj3167 > l + yyj3316++ + if yyhl3316 { + yyb3316 = yyj3316 > l } else { - yyb3167 = r.CheckBreak() + yyb3316 = r.CheckBreak() } - if yyb3167 { + if yyb3316 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3167-1, "") + z.DecStructFieldNotFound(yyj3316-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39454,118 +41573,68 @@ func (x *List) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3174 := z.EncBinary() - _ = yym3174 + yym3323 := z.EncBinary() + _ = yym3323 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3175 := !z.EncBinary() - yy2arr3175 := z.EncBasicHandle().StructToArray - var yyq3175 [4]bool - _, _, _ = yysep3175, yyq3175, yy2arr3175 - const yyr3175 bool = false - yyq3175[0] = x.Kind != "" - yyq3175[1] = x.APIVersion != "" - yyq3175[2] = true - var yynn3175 int - if yyr3175 || yy2arr3175 { + yysep3324 := !z.EncBinary() + yy2arr3324 := z.EncBasicHandle().StructToArray + var yyq3324 [4]bool + _, _, _ = yysep3324, yyq3324, yy2arr3324 + const yyr3324 bool = false + yyq3324[0] = true + yyq3324[2] = x.Kind != "" + yyq3324[3] = x.APIVersion != "" + var yynn3324 int + if yyr3324 || yy2arr3324 { r.EncodeArrayStart(4) } else { - yynn3175 = 1 - for _, b := range yyq3175 { + yynn3324 = 1 + for _, b := range yyq3324 { if b { - yynn3175++ + yynn3324++ } } - r.EncodeMapStart(yynn3175) - yynn3175 = 0 + r.EncodeMapStart(yynn3324) + yynn3324 = 0 } - if yyr3175 || yy2arr3175 { + if yyr3324 || yy2arr3324 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3175[0] { - yym3177 := z.EncBinary() - _ = yym3177 + if yyq3324[0] { + yy3326 := &x.ListMeta + yym3327 := z.EncBinary() + _ = yym3327 if false { + } else if z.HasExtensions() && z.EncExt(yy3326) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3175[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3178 := z.EncBinary() - _ = yym3178 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3175 || yy2arr3175 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3175[1] { - yym3180 := z.EncBinary() - _ = yym3180 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3175[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3181 := z.EncBinary() - _ = yym3181 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3175 || yy2arr3175 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3175[2] { - yy3183 := &x.ListMeta - yym3184 := z.EncBinary() - _ = yym3184 - if false { - } else if z.HasExtensions() && z.EncExt(yy3183) { - } else { - z.EncFallback(yy3183) + z.EncFallback(yy3326) } } else { r.EncodeNil() } } else { - if yyq3175[2] { + if yyq3324[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3185 := &x.ListMeta - yym3186 := z.EncBinary() - _ = yym3186 + yy3328 := &x.ListMeta + yym3329 := z.EncBinary() + _ = yym3329 if false { - } else if z.HasExtensions() && z.EncExt(yy3185) { + } else if z.HasExtensions() && z.EncExt(yy3328) { } else { - z.EncFallback(yy3185) + z.EncFallback(yy3328) } } } - if yyr3175 || yy2arr3175 { + if yyr3324 || yy2arr3324 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3188 := z.EncBinary() - _ = yym3188 + yym3331 := z.EncBinary() + _ = yym3331 if false { } else { h.encSliceruntime_Object(([]pkg8_runtime.Object)(x.Items), e) @@ -39578,15 +41647,65 @@ func (x *List) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3189 := z.EncBinary() - _ = yym3189 + yym3332 := z.EncBinary() + _ = yym3332 if false { } else { h.encSliceruntime_Object(([]pkg8_runtime.Object)(x.Items), e) } } } - if yyr3175 || yy2arr3175 { + if yyr3324 || yy2arr3324 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3324[2] { + yym3334 := z.EncBinary() + _ = yym3334 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3324[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3335 := z.EncBinary() + _ = yym3335 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3324 || yy2arr3324 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3324[3] { + yym3337 := z.EncBinary() + _ = yym3337 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3324[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3338 := z.EncBinary() + _ = yym3338 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3324 || yy2arr3324 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39599,25 +41718,25 @@ func (x *List) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3190 := z.DecBinary() - _ = yym3190 + yym3339 := z.DecBinary() + _ = yym3339 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3191 := r.ContainerType() - if yyct3191 == codecSelferValueTypeMap1234 { - yyl3191 := r.ReadMapStart() - if yyl3191 == 0 { + yyct3340 := r.ContainerType() + if yyct3340 == codecSelferValueTypeMap1234 { + yyl3340 := r.ReadMapStart() + if yyl3340 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3191, d) + x.codecDecodeSelfFromMap(yyl3340, d) } - } else if yyct3191 == codecSelferValueTypeArray1234 { - yyl3191 := r.ReadArrayStart() - if yyl3191 == 0 { + } else if yyct3340 == codecSelferValueTypeArray1234 { + yyl3340 := r.ReadArrayStart() + if yyl3340 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3191, d) + x.codecDecodeSelfFromArray(yyl3340, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -39629,12 +41748,12 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3192Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3192Slc - var yyhl3192 bool = l >= 0 - for yyj3192 := 0; ; yyj3192++ { - if yyhl3192 { - if yyj3192 >= l { + var yys3341Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3341Slc + var yyhl3341 bool = l >= 0 + for yyj3341 := 0; ; yyj3341++ { + if yyhl3341 { + if yyj3341 >= l { break } } else { @@ -39643,10 +41762,35 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3192Slc = r.DecodeBytes(yys3192Slc, true, true) - yys3192 := string(yys3192Slc) + yys3341Slc = r.DecodeBytes(yys3341Slc, true, true) + yys3341 := string(yys3341Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3192 { + switch yys3341 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3342 := &x.ListMeta + yym3343 := z.DecBinary() + _ = yym3343 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3342) { + } else { + z.DecFallback(yyv3342, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3344 := &x.Items + yym3345 := z.DecBinary() + _ = yym3345 + if false { + } else { + h.decSliceruntime_Object((*[]pkg8_runtime.Object)(yyv3344), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -39659,35 +41803,10 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3195 := &x.ListMeta - yym3196 := z.DecBinary() - _ = yym3196 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3195) { - } else { - z.DecFallback(yyv3195, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3197 := &x.Items - yym3198 := z.DecBinary() - _ = yym3198 - if false { - } else { - h.decSliceruntime_Object((*[]pkg8_runtime.Object)(yyv3197), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3192) - } // end switch yys3192 - } // end for yyj3192 + z.DecStructFieldNotFound(-1, yys3341) + } // end switch yys3341 + } // end for yyj3341 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -39695,16 +41814,61 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3199 int - var yyb3199 bool - var yyhl3199 bool = l >= 0 - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + var yyj3348 int + var yyb3348 bool + var yyhl3348 bool = l >= 0 + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3349 := &x.ListMeta + yym3350 := z.DecBinary() + _ = yym3350 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3349) { + } else { + z.DecFallback(yyv3349, false) + } + } + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l + } else { + yyb3348 = r.CheckBreak() + } + if yyb3348 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3351 := &x.Items + yym3352 := z.DecBinary() + _ = yym3352 + if false { + } else { + h.decSliceruntime_Object((*[]pkg8_runtime.Object)(yyv3351), d) + } + } + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l + } else { + yyb3348 = r.CheckBreak() + } + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39714,13 +41878,13 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39730,63 +41894,18 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l - } else { - yyb3199 = r.CheckBreak() - } - if yyb3199 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3202 := &x.ListMeta - yym3203 := z.DecBinary() - _ = yym3203 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3202) { - } else { - z.DecFallback(yyv3202, false) - } - } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l - } else { - yyb3199 = r.CheckBreak() - } - if yyb3199 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3204 := &x.Items - yym3205 := z.DecBinary() - _ = yym3205 - if false { - } else { - h.decSliceruntime_Object((*[]pkg8_runtime.Object)(yyv3204), d) - } - } for { - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3199-1, "") + z.DecStructFieldNotFound(yyj3348-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39795,8 +41914,8 @@ func (x LimitType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym3206 := z.EncBinary() - _ = yym3206 + yym3355 := z.EncBinary() + _ = yym3355 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -39808,8 +41927,8 @@ func (x *LimitType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3207 := z.DecBinary() - _ = yym3207 + yym3356 := z.DecBinary() + _ = yym3356 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -39824,53 +41943,53 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3208 := z.EncBinary() - _ = yym3208 + yym3357 := z.EncBinary() + _ = yym3357 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3209 := !z.EncBinary() - yy2arr3209 := z.EncBasicHandle().StructToArray - var yyq3209 [6]bool - _, _, _ = yysep3209, yyq3209, yy2arr3209 - const yyr3209 bool = false - yyq3209[0] = x.Type != "" - yyq3209[1] = len(x.Max) != 0 - yyq3209[2] = len(x.Min) != 0 - yyq3209[3] = len(x.Default) != 0 - yyq3209[4] = len(x.DefaultRequest) != 0 - yyq3209[5] = len(x.MaxLimitRequestRatio) != 0 - var yynn3209 int - if yyr3209 || yy2arr3209 { + yysep3358 := !z.EncBinary() + yy2arr3358 := z.EncBasicHandle().StructToArray + var yyq3358 [6]bool + _, _, _ = yysep3358, yyq3358, yy2arr3358 + const yyr3358 bool = false + yyq3358[0] = x.Type != "" + yyq3358[1] = len(x.Max) != 0 + yyq3358[2] = len(x.Min) != 0 + yyq3358[3] = len(x.Default) != 0 + yyq3358[4] = len(x.DefaultRequest) != 0 + yyq3358[5] = len(x.MaxLimitRequestRatio) != 0 + var yynn3358 int + if yyr3358 || yy2arr3358 { r.EncodeArrayStart(6) } else { - yynn3209 = 0 - for _, b := range yyq3209 { + yynn3358 = 0 + for _, b := range yyq3358 { if b { - yynn3209++ + yynn3358++ } } - r.EncodeMapStart(yynn3209) - yynn3209 = 0 + r.EncodeMapStart(yynn3358) + yynn3358 = 0 } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[0] { + if yyq3358[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3209[0] { + if yyq3358[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[1] { + if yyq3358[1] { if x.Max == nil { r.EncodeNil() } else { @@ -39880,7 +41999,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3209[1] { + if yyq3358[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("max")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39891,9 +42010,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[2] { + if yyq3358[2] { if x.Min == nil { r.EncodeNil() } else { @@ -39903,7 +42022,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3209[2] { + if yyq3358[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("min")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39914,9 +42033,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[3] { + if yyq3358[3] { if x.Default == nil { r.EncodeNil() } else { @@ -39926,7 +42045,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3209[3] { + if yyq3358[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("default")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39937,9 +42056,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[4] { + if yyq3358[4] { if x.DefaultRequest == nil { r.EncodeNil() } else { @@ -39949,7 +42068,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3209[4] { + if yyq3358[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("defaultRequest")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39960,9 +42079,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3209[5] { + if yyq3358[5] { if x.MaxLimitRequestRatio == nil { r.EncodeNil() } else { @@ -39972,7 +42091,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3209[5] { + if yyq3358[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxLimitRequestRatio")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39983,7 +42102,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3209 || yy2arr3209 { + if yyr3358 || yy2arr3358 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39996,25 +42115,25 @@ func (x *LimitRangeItem) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3216 := z.DecBinary() - _ = yym3216 + yym3365 := z.DecBinary() + _ = yym3365 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3217 := r.ContainerType() - if yyct3217 == codecSelferValueTypeMap1234 { - yyl3217 := r.ReadMapStart() - if yyl3217 == 0 { + yyct3366 := r.ContainerType() + if yyct3366 == codecSelferValueTypeMap1234 { + yyl3366 := r.ReadMapStart() + if yyl3366 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3217, d) + x.codecDecodeSelfFromMap(yyl3366, d) } - } else if yyct3217 == codecSelferValueTypeArray1234 { - yyl3217 := r.ReadArrayStart() - if yyl3217 == 0 { + } else if yyct3366 == codecSelferValueTypeArray1234 { + yyl3366 := r.ReadArrayStart() + if yyl3366 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3217, d) + x.codecDecodeSelfFromArray(yyl3366, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -40026,12 +42145,12 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3218Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3218Slc - var yyhl3218 bool = l >= 0 - for yyj3218 := 0; ; yyj3218++ { - if yyhl3218 { - if yyj3218 >= l { + var yys3367Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3367Slc + var yyhl3367 bool = l >= 0 + for yyj3367 := 0; ; yyj3367++ { + if yyhl3367 { + if yyj3367 >= l { break } } else { @@ -40040,10 +42159,10 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3218Slc = r.DecodeBytes(yys3218Slc, true, true) - yys3218 := string(yys3218Slc) + yys3367Slc = r.DecodeBytes(yys3367Slc, true, true) + yys3367 := string(yys3367Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3218 { + switch yys3367 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -40054,41 +42173,41 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Max = nil } else { - yyv3220 := &x.Max - yyv3220.CodecDecodeSelf(d) + yyv3369 := &x.Max + yyv3369.CodecDecodeSelf(d) } case "min": if r.TryDecodeAsNil() { x.Min = nil } else { - yyv3221 := &x.Min - yyv3221.CodecDecodeSelf(d) + yyv3370 := &x.Min + yyv3370.CodecDecodeSelf(d) } case "default": if r.TryDecodeAsNil() { x.Default = nil } else { - yyv3222 := &x.Default - yyv3222.CodecDecodeSelf(d) + yyv3371 := &x.Default + yyv3371.CodecDecodeSelf(d) } case "defaultRequest": if r.TryDecodeAsNil() { x.DefaultRequest = nil } else { - yyv3223 := &x.DefaultRequest - yyv3223.CodecDecodeSelf(d) + yyv3372 := &x.DefaultRequest + yyv3372.CodecDecodeSelf(d) } case "maxLimitRequestRatio": if r.TryDecodeAsNil() { x.MaxLimitRequestRatio = nil } else { - yyv3224 := &x.MaxLimitRequestRatio - yyv3224.CodecDecodeSelf(d) + yyv3373 := &x.MaxLimitRequestRatio + yyv3373.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys3218) - } // end switch yys3218 - } // end for yyj3218 + z.DecStructFieldNotFound(-1, yys3367) + } // end switch yys3367 + } // end for yyj3367 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -40096,16 +42215,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3225 int - var yyb3225 bool - var yyhl3225 bool = l >= 0 - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + var yyj3374 int + var yyb3374 bool + var yyhl3374 bool = l >= 0 + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40115,13 +42234,13 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = LimitType(r.DecodeString()) } - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40129,16 +42248,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Max = nil } else { - yyv3227 := &x.Max - yyv3227.CodecDecodeSelf(d) + yyv3376 := &x.Max + yyv3376.CodecDecodeSelf(d) } - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40146,16 +42265,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Min = nil } else { - yyv3228 := &x.Min - yyv3228.CodecDecodeSelf(d) + yyv3377 := &x.Min + yyv3377.CodecDecodeSelf(d) } - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40163,16 +42282,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Default = nil } else { - yyv3229 := &x.Default - yyv3229.CodecDecodeSelf(d) + yyv3378 := &x.Default + yyv3378.CodecDecodeSelf(d) } - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40180,16 +42299,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.DefaultRequest = nil } else { - yyv3230 := &x.DefaultRequest - yyv3230.CodecDecodeSelf(d) + yyv3379 := &x.DefaultRequest + yyv3379.CodecDecodeSelf(d) } - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40197,21 +42316,21 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.MaxLimitRequestRatio = nil } else { - yyv3231 := &x.MaxLimitRequestRatio - yyv3231.CodecDecodeSelf(d) + yyv3380 := &x.MaxLimitRequestRatio + yyv3380.CodecDecodeSelf(d) } for { - yyj3225++ - if yyhl3225 { - yyb3225 = yyj3225 > l + yyj3374++ + if yyhl3374 { + yyb3374 = yyj3374 > l } else { - yyb3225 = r.CheckBreak() + yyb3374 = r.CheckBreak() } - if yyb3225 { + if yyb3374 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3225-1, "") + z.DecStructFieldNotFound(yyj3374-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -40223,36 +42342,36 @@ func (x *LimitRangeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3232 := z.EncBinary() - _ = yym3232 + yym3381 := z.EncBinary() + _ = yym3381 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3233 := !z.EncBinary() - yy2arr3233 := z.EncBasicHandle().StructToArray - var yyq3233 [1]bool - _, _, _ = yysep3233, yyq3233, yy2arr3233 - const yyr3233 bool = false - var yynn3233 int - if yyr3233 || yy2arr3233 { + yysep3382 := !z.EncBinary() + yy2arr3382 := z.EncBasicHandle().StructToArray + var yyq3382 [1]bool + _, _, _ = yysep3382, yyq3382, yy2arr3382 + const yyr3382 bool = false + var yynn3382 int + if yyr3382 || yy2arr3382 { r.EncodeArrayStart(1) } else { - yynn3233 = 1 - for _, b := range yyq3233 { + yynn3382 = 1 + for _, b := range yyq3382 { if b { - yynn3233++ + yynn3382++ } } - r.EncodeMapStart(yynn3233) - yynn3233 = 0 + r.EncodeMapStart(yynn3382) + yynn3382 = 0 } - if yyr3233 || yy2arr3233 { + if yyr3382 || yy2arr3382 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Limits == nil { r.EncodeNil() } else { - yym3235 := z.EncBinary() - _ = yym3235 + yym3384 := z.EncBinary() + _ = yym3384 if false { } else { h.encSliceLimitRangeItem(([]LimitRangeItem)(x.Limits), e) @@ -40265,15 +42384,15 @@ func (x *LimitRangeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Limits == nil { r.EncodeNil() } else { - yym3236 := z.EncBinary() - _ = yym3236 + yym3385 := z.EncBinary() + _ = yym3385 if false { } else { h.encSliceLimitRangeItem(([]LimitRangeItem)(x.Limits), e) } } } - if yyr3233 || yy2arr3233 { + if yyr3382 || yy2arr3382 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -40286,25 +42405,25 @@ func (x *LimitRangeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3237 := z.DecBinary() - _ = yym3237 + yym3386 := z.DecBinary() + _ = yym3386 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3238 := r.ContainerType() - if yyct3238 == codecSelferValueTypeMap1234 { - yyl3238 := r.ReadMapStart() - if yyl3238 == 0 { + yyct3387 := r.ContainerType() + if yyct3387 == codecSelferValueTypeMap1234 { + yyl3387 := r.ReadMapStart() + if yyl3387 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3238, d) + x.codecDecodeSelfFromMap(yyl3387, d) } - } else if yyct3238 == codecSelferValueTypeArray1234 { - yyl3238 := r.ReadArrayStart() - if yyl3238 == 0 { + } else if yyct3387 == codecSelferValueTypeArray1234 { + yyl3387 := r.ReadArrayStart() + if yyl3387 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3238, d) + x.codecDecodeSelfFromArray(yyl3387, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -40316,12 +42435,12 @@ func (x *LimitRangeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3239Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3239Slc - var yyhl3239 bool = l >= 0 - for yyj3239 := 0; ; yyj3239++ { - if yyhl3239 { - if yyj3239 >= l { + var yys3388Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3388Slc + var yyhl3388 bool = l >= 0 + for yyj3388 := 0; ; yyj3388++ { + if yyhl3388 { + if yyj3388 >= l { break } } else { @@ -40330,26 +42449,26 @@ func (x *LimitRangeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3239Slc = r.DecodeBytes(yys3239Slc, true, true) - yys3239 := string(yys3239Slc) + yys3388Slc = r.DecodeBytes(yys3388Slc, true, true) + yys3388 := string(yys3388Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3239 { + switch yys3388 { case "limits": if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv3240 := &x.Limits - yym3241 := z.DecBinary() - _ = yym3241 + yyv3389 := &x.Limits + yym3390 := z.DecBinary() + _ = yym3390 if false { } else { - h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3240), d) + h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3389), d) } } default: - z.DecStructFieldNotFound(-1, yys3239) - } // end switch yys3239 - } // end for yyj3239 + z.DecStructFieldNotFound(-1, yys3388) + } // end switch yys3388 + } // end for yyj3388 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -40357,16 +42476,16 @@ func (x *LimitRangeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3242 int - var yyb3242 bool - var yyhl3242 bool = l >= 0 - yyj3242++ - if yyhl3242 { - yyb3242 = yyj3242 > l + var yyj3391 int + var yyb3391 bool + var yyhl3391 bool = l >= 0 + yyj3391++ + if yyhl3391 { + yyb3391 = yyj3391 > l } else { - yyb3242 = r.CheckBreak() + yyb3391 = r.CheckBreak() } - if yyb3242 { + if yyb3391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40374,26 +42493,26 @@ func (x *LimitRangeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv3243 := &x.Limits - yym3244 := z.DecBinary() - _ = yym3244 + yyv3392 := &x.Limits + yym3393 := z.DecBinary() + _ = yym3393 if false { } else { - h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3243), d) + h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3392), d) } } for { - yyj3242++ - if yyhl3242 { - yyb3242 = yyj3242 > l + yyj3391++ + if yyhl3391 { + yyb3391 = yyj3391 > l } else { - yyb3242 = r.CheckBreak() + yyb3391 = r.CheckBreak() } - if yyb3242 { + if yyb3391 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3242-1, "") + z.DecStructFieldNotFound(yyj3391-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -40405,118 +42524,118 @@ func (x *LimitRange) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3245 := z.EncBinary() - _ = yym3245 + yym3394 := z.EncBinary() + _ = yym3394 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3246 := !z.EncBinary() - yy2arr3246 := z.EncBasicHandle().StructToArray - var yyq3246 [4]bool - _, _, _ = yysep3246, yyq3246, yy2arr3246 - const yyr3246 bool = false - yyq3246[0] = x.Kind != "" - yyq3246[1] = x.APIVersion != "" - yyq3246[2] = true - yyq3246[3] = true - var yynn3246 int - if yyr3246 || yy2arr3246 { + yysep3395 := !z.EncBinary() + yy2arr3395 := z.EncBasicHandle().StructToArray + var yyq3395 [4]bool + _, _, _ = yysep3395, yyq3395, yy2arr3395 + const yyr3395 bool = false + yyq3395[0] = true + yyq3395[1] = true + yyq3395[2] = x.Kind != "" + yyq3395[3] = x.APIVersion != "" + var yynn3395 int + if yyr3395 || yy2arr3395 { r.EncodeArrayStart(4) } else { - yynn3246 = 0 - for _, b := range yyq3246 { + yynn3395 = 0 + for _, b := range yyq3395 { if b { - yynn3246++ + yynn3395++ } } - r.EncodeMapStart(yynn3246) - yynn3246 = 0 + r.EncodeMapStart(yynn3395) + yynn3395 = 0 } - if yyr3246 || yy2arr3246 { + if yyr3395 || yy2arr3395 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[0] { - yym3248 := z.EncBinary() - _ = yym3248 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3246[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3249 := z.EncBinary() - _ = yym3249 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[1] { - yym3251 := z.EncBinary() - _ = yym3251 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3246[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3252 := z.EncBinary() - _ = yym3252 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[2] { - yy3254 := &x.ObjectMeta - yy3254.CodecEncodeSelf(e) + if yyq3395[0] { + yy3397 := &x.ObjectMeta + yy3397.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3246[2] { + if yyq3395[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3255 := &x.ObjectMeta - yy3255.CodecEncodeSelf(e) + yy3398 := &x.ObjectMeta + yy3398.CodecEncodeSelf(e) } } - if yyr3246 || yy2arr3246 { + if yyr3395 || yy2arr3395 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[3] { - yy3257 := &x.Spec - yy3257.CodecEncodeSelf(e) + if yyq3395[1] { + yy3400 := &x.Spec + yy3400.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3246[3] { + if yyq3395[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3258 := &x.Spec - yy3258.CodecEncodeSelf(e) + yy3401 := &x.Spec + yy3401.CodecEncodeSelf(e) } } - if yyr3246 || yy2arr3246 { + if yyr3395 || yy2arr3395 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3395[2] { + yym3403 := z.EncBinary() + _ = yym3403 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3395[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3404 := z.EncBinary() + _ = yym3404 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3395 || yy2arr3395 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3395[3] { + yym3406 := z.EncBinary() + _ = yym3406 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3395[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3407 := z.EncBinary() + _ = yym3407 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3395 || yy2arr3395 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -40529,25 +42648,25 @@ func (x *LimitRange) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3259 := z.DecBinary() - _ = yym3259 + yym3408 := z.DecBinary() + _ = yym3408 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3260 := r.ContainerType() - if yyct3260 == codecSelferValueTypeMap1234 { - yyl3260 := r.ReadMapStart() - if yyl3260 == 0 { + yyct3409 := r.ContainerType() + if yyct3409 == codecSelferValueTypeMap1234 { + yyl3409 := r.ReadMapStart() + if yyl3409 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3260, d) + x.codecDecodeSelfFromMap(yyl3409, d) } - } else if yyct3260 == codecSelferValueTypeArray1234 { - yyl3260 := r.ReadArrayStart() - if yyl3260 == 0 { + } else if yyct3409 == codecSelferValueTypeArray1234 { + yyl3409 := r.ReadArrayStart() + if yyl3409 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3260, d) + x.codecDecodeSelfFromArray(yyl3409, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -40559,12 +42678,12 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3261Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3261Slc - var yyhl3261 bool = l >= 0 - for yyj3261 := 0; ; yyj3261++ { - if yyhl3261 { - if yyj3261 >= l { + var yys3410Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3410Slc + var yyhl3410 bool = l >= 0 + for yyj3410 := 0; ; yyj3410++ { + if yyhl3410 { + if yyj3410 >= l { break } } else { @@ -40573,10 +42692,24 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3261Slc = r.DecodeBytes(yys3261Slc, true, true) - yys3261 := string(yys3261Slc) + yys3410Slc = r.DecodeBytes(yys3410Slc, true, true) + yys3410 := string(yys3410Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3261 { + switch yys3410 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3411 := &x.ObjectMeta + yyv3411.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = LimitRangeSpec{} + } else { + yyv3412 := &x.Spec + yyv3412.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -40589,24 +42722,10 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3264 := &x.ObjectMeta - yyv3264.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = LimitRangeSpec{} - } else { - yyv3265 := &x.Spec - yyv3265.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys3261) - } // end switch yys3261 - } // end for yyj3261 + z.DecStructFieldNotFound(-1, yys3410) + } // end switch yys3410 + } // end for yyj3410 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -40614,48 +42733,16 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3266 int - var yyb3266 bool - var yyhl3266 bool = l >= 0 - yyj3266++ - if yyhl3266 { - yyb3266 = yyj3266 > l + var yyj3415 int + var yyb3415 bool + var yyhl3415 bool = l >= 0 + yyj3415++ + if yyhl3415 { + yyb3415 = yyj3415 > l } else { - yyb3266 = r.CheckBreak() + yyb3415 = r.CheckBreak() } - if yyb3266 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3266++ - if yyhl3266 { - yyb3266 = yyj3266 > l - } else { - yyb3266 = r.CheckBreak() - } - if yyb3266 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3266++ - if yyhl3266 { - yyb3266 = yyj3266 > l - } else { - yyb3266 = r.CheckBreak() - } - if yyb3266 { + if yyb3415 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40663,16 +42750,16 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3269 := &x.ObjectMeta - yyv3269.CodecDecodeSelf(d) + yyv3416 := &x.ObjectMeta + yyv3416.CodecDecodeSelf(d) } - yyj3266++ - if yyhl3266 { - yyb3266 = yyj3266 > l + yyj3415++ + if yyhl3415 { + yyb3415 = yyj3415 > l } else { - yyb3266 = r.CheckBreak() + yyb3415 = r.CheckBreak() } - if yyb3266 { + if yyb3415 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40680,1834 +42767,58 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Spec = LimitRangeSpec{} } else { - yyv3270 := &x.Spec - yyv3270.CodecDecodeSelf(d) + yyv3417 := &x.Spec + yyv3417.CodecDecodeSelf(d) + } + yyj3415++ + if yyhl3415 { + yyb3415 = yyj3415 > l + } else { + yyb3415 = r.CheckBreak() + } + if yyb3415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3415++ + if yyhl3415 { + yyb3415 = yyj3415 > l + } else { + yyb3415 = r.CheckBreak() + } + if yyb3415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) } for { - yyj3266++ - if yyhl3266 { - yyb3266 = yyj3266 > l + yyj3415++ + if yyhl3415 { + yyb3415 = yyj3415 > l } else { - yyb3266 = r.CheckBreak() + yyb3415 = r.CheckBreak() } - if yyb3266 { + if yyb3415 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3266-1, "") + z.DecStructFieldNotFound(yyj3415-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } func (x *LimitRangeList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3271 := z.EncBinary() - _ = yym3271 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3272 := !z.EncBinary() - yy2arr3272 := z.EncBasicHandle().StructToArray - var yyq3272 [4]bool - _, _, _ = yysep3272, yyq3272, yy2arr3272 - const yyr3272 bool = false - yyq3272[0] = x.Kind != "" - yyq3272[1] = x.APIVersion != "" - yyq3272[2] = true - var yynn3272 int - if yyr3272 || yy2arr3272 { - r.EncodeArrayStart(4) - } else { - yynn3272 = 1 - for _, b := range yyq3272 { - if b { - yynn3272++ - } - } - r.EncodeMapStart(yynn3272) - yynn3272 = 0 - } - if yyr3272 || yy2arr3272 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3272[0] { - yym3274 := z.EncBinary() - _ = yym3274 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3272[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3275 := z.EncBinary() - _ = yym3275 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3272 || yy2arr3272 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3272[1] { - yym3277 := z.EncBinary() - _ = yym3277 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3272[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3278 := z.EncBinary() - _ = yym3278 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3272 || yy2arr3272 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3272[2] { - yy3280 := &x.ListMeta - yym3281 := z.EncBinary() - _ = yym3281 - if false { - } else if z.HasExtensions() && z.EncExt(yy3280) { - } else { - z.EncFallback(yy3280) - } - } else { - r.EncodeNil() - } - } else { - if yyq3272[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3282 := &x.ListMeta - yym3283 := z.EncBinary() - _ = yym3283 - if false { - } else if z.HasExtensions() && z.EncExt(yy3282) { - } else { - z.EncFallback(yy3282) - } - } - } - if yyr3272 || yy2arr3272 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3285 := z.EncBinary() - _ = yym3285 - if false { - } else { - h.encSliceLimitRange(([]LimitRange)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3286 := z.EncBinary() - _ = yym3286 - if false { - } else { - h.encSliceLimitRange(([]LimitRange)(x.Items), e) - } - } - } - if yyr3272 || yy2arr3272 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *LimitRangeList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3287 := z.DecBinary() - _ = yym3287 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3288 := r.ContainerType() - if yyct3288 == codecSelferValueTypeMap1234 { - yyl3288 := r.ReadMapStart() - if yyl3288 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3288, d) - } - } else if yyct3288 == codecSelferValueTypeArray1234 { - yyl3288 := r.ReadArrayStart() - if yyl3288 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3288, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *LimitRangeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3289Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3289Slc - var yyhl3289 bool = l >= 0 - for yyj3289 := 0; ; yyj3289++ { - if yyhl3289 { - if yyj3289 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3289Slc = r.DecodeBytes(yys3289Slc, true, true) - yys3289 := string(yys3289Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3289 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3292 := &x.ListMeta - yym3293 := z.DecBinary() - _ = yym3293 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3292) { - } else { - z.DecFallback(yyv3292, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3294 := &x.Items - yym3295 := z.DecBinary() - _ = yym3295 - if false { - } else { - h.decSliceLimitRange((*[]LimitRange)(yyv3294), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3289) - } // end switch yys3289 - } // end for yyj3289 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *LimitRangeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3296 int - var yyb3296 bool - var yyhl3296 bool = l >= 0 - yyj3296++ - if yyhl3296 { - yyb3296 = yyj3296 > l - } else { - yyb3296 = r.CheckBreak() - } - if yyb3296 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3296++ - if yyhl3296 { - yyb3296 = yyj3296 > l - } else { - yyb3296 = r.CheckBreak() - } - if yyb3296 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3296++ - if yyhl3296 { - yyb3296 = yyj3296 > l - } else { - yyb3296 = r.CheckBreak() - } - if yyb3296 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3299 := &x.ListMeta - yym3300 := z.DecBinary() - _ = yym3300 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3299) { - } else { - z.DecFallback(yyv3299, false) - } - } - yyj3296++ - if yyhl3296 { - yyb3296 = yyj3296 > l - } else { - yyb3296 = r.CheckBreak() - } - if yyb3296 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3301 := &x.Items - yym3302 := z.DecBinary() - _ = yym3302 - if false { - } else { - h.decSliceLimitRange((*[]LimitRange)(yyv3301), d) - } - } - for { - yyj3296++ - if yyhl3296 { - yyb3296 = yyj3296 > l - } else { - yyb3296 = r.CheckBreak() - } - if yyb3296 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3296-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3303 := z.EncBinary() - _ = yym3303 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3304 := !z.EncBinary() - yy2arr3304 := z.EncBasicHandle().StructToArray - var yyq3304 [1]bool - _, _, _ = yysep3304, yyq3304, yy2arr3304 - const yyr3304 bool = false - yyq3304[0] = len(x.Hard) != 0 - var yynn3304 int - if yyr3304 || yy2arr3304 { - r.EncodeArrayStart(1) - } else { - yynn3304 = 0 - for _, b := range yyq3304 { - if b { - yynn3304++ - } - } - r.EncodeMapStart(yynn3304) - yynn3304 = 0 - } - if yyr3304 || yy2arr3304 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3304[0] { - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3304[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hard")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } - } - if yyr3304 || yy2arr3304 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3306 := z.DecBinary() - _ = yym3306 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3307 := r.ContainerType() - if yyct3307 == codecSelferValueTypeMap1234 { - yyl3307 := r.ReadMapStart() - if yyl3307 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3307, d) - } - } else if yyct3307 == codecSelferValueTypeArray1234 { - yyl3307 := r.ReadArrayStart() - if yyl3307 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3307, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3308Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3308Slc - var yyhl3308 bool = l >= 0 - for yyj3308 := 0; ; yyj3308++ { - if yyhl3308 { - if yyj3308 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3308Slc = r.DecodeBytes(yys3308Slc, true, true) - yys3308 := string(yys3308Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3308 { - case "hard": - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3309 := &x.Hard - yyv3309.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3308) - } // end switch yys3308 - } // end for yyj3308 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3310 int - var yyb3310 bool - var yyhl3310 bool = l >= 0 - yyj3310++ - if yyhl3310 { - yyb3310 = yyj3310 > l - } else { - yyb3310 = r.CheckBreak() - } - if yyb3310 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3311 := &x.Hard - yyv3311.CodecDecodeSelf(d) - } - for { - yyj3310++ - if yyhl3310 { - yyb3310 = yyj3310 > l - } else { - yyb3310 = r.CheckBreak() - } - if yyb3310 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3310-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3312 := z.EncBinary() - _ = yym3312 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3313 := !z.EncBinary() - yy2arr3313 := z.EncBasicHandle().StructToArray - var yyq3313 [2]bool - _, _, _ = yysep3313, yyq3313, yy2arr3313 - const yyr3313 bool = false - yyq3313[0] = len(x.Hard) != 0 - yyq3313[1] = len(x.Used) != 0 - var yynn3313 int - if yyr3313 || yy2arr3313 { - r.EncodeArrayStart(2) - } else { - yynn3313 = 0 - for _, b := range yyq3313 { - if b { - yynn3313++ - } - } - r.EncodeMapStart(yynn3313) - yynn3313 = 0 - } - if yyr3313 || yy2arr3313 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3313[0] { - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3313[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hard")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } - } - if yyr3313 || yy2arr3313 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3313[1] { - if x.Used == nil { - r.EncodeNil() - } else { - x.Used.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3313[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("used")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Used == nil { - r.EncodeNil() - } else { - x.Used.CodecEncodeSelf(e) - } - } - } - if yyr3313 || yy2arr3313 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3316 := z.DecBinary() - _ = yym3316 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3317 := r.ContainerType() - if yyct3317 == codecSelferValueTypeMap1234 { - yyl3317 := r.ReadMapStart() - if yyl3317 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3317, d) - } - } else if yyct3317 == codecSelferValueTypeArray1234 { - yyl3317 := r.ReadArrayStart() - if yyl3317 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3317, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3318Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3318Slc - var yyhl3318 bool = l >= 0 - for yyj3318 := 0; ; yyj3318++ { - if yyhl3318 { - if yyj3318 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3318Slc = r.DecodeBytes(yys3318Slc, true, true) - yys3318 := string(yys3318Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3318 { - case "hard": - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3319 := &x.Hard - yyv3319.CodecDecodeSelf(d) - } - case "used": - if r.TryDecodeAsNil() { - x.Used = nil - } else { - yyv3320 := &x.Used - yyv3320.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3318) - } // end switch yys3318 - } // end for yyj3318 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3321 int - var yyb3321 bool - var yyhl3321 bool = l >= 0 - yyj3321++ - if yyhl3321 { - yyb3321 = yyj3321 > l - } else { - yyb3321 = r.CheckBreak() - } - if yyb3321 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3322 := &x.Hard - yyv3322.CodecDecodeSelf(d) - } - yyj3321++ - if yyhl3321 { - yyb3321 = yyj3321 > l - } else { - yyb3321 = r.CheckBreak() - } - if yyb3321 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Used = nil - } else { - yyv3323 := &x.Used - yyv3323.CodecDecodeSelf(d) - } - for { - yyj3321++ - if yyhl3321 { - yyb3321 = yyj3321 > l - } else { - yyb3321 = r.CheckBreak() - } - if yyb3321 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3321-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuota) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3324 := z.EncBinary() - _ = yym3324 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3325 := !z.EncBinary() - yy2arr3325 := z.EncBasicHandle().StructToArray - var yyq3325 [5]bool - _, _, _ = yysep3325, yyq3325, yy2arr3325 - const yyr3325 bool = false - yyq3325[0] = x.Kind != "" - yyq3325[1] = x.APIVersion != "" - yyq3325[2] = true - yyq3325[3] = true - yyq3325[4] = true - var yynn3325 int - if yyr3325 || yy2arr3325 { - r.EncodeArrayStart(5) - } else { - yynn3325 = 0 - for _, b := range yyq3325 { - if b { - yynn3325++ - } - } - r.EncodeMapStart(yynn3325) - yynn3325 = 0 - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3325[0] { - yym3327 := z.EncBinary() - _ = yym3327 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3325[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3328 := z.EncBinary() - _ = yym3328 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3325[1] { - yym3330 := z.EncBinary() - _ = yym3330 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3325[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3331 := z.EncBinary() - _ = yym3331 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3325[2] { - yy3333 := &x.ObjectMeta - yy3333.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3325[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3334 := &x.ObjectMeta - yy3334.CodecEncodeSelf(e) - } - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3325[3] { - yy3336 := &x.Spec - yy3336.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3325[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3337 := &x.Spec - yy3337.CodecEncodeSelf(e) - } - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3325[4] { - yy3339 := &x.Status - yy3339.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3325[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3340 := &x.Status - yy3340.CodecEncodeSelf(e) - } - } - if yyr3325 || yy2arr3325 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuota) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3341 := z.DecBinary() - _ = yym3341 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3342 := r.ContainerType() - if yyct3342 == codecSelferValueTypeMap1234 { - yyl3342 := r.ReadMapStart() - if yyl3342 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3342, d) - } - } else if yyct3342 == codecSelferValueTypeArray1234 { - yyl3342 := r.ReadArrayStart() - if yyl3342 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3342, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuota) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3343Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3343Slc - var yyhl3343 bool = l >= 0 - for yyj3343 := 0; ; yyj3343++ { - if yyhl3343 { - if yyj3343 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3343Slc = r.DecodeBytes(yys3343Slc, true, true) - yys3343 := string(yys3343Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3343 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3346 := &x.ObjectMeta - yyv3346.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ResourceQuotaSpec{} - } else { - yyv3347 := &x.Spec - yyv3347.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ResourceQuotaStatus{} - } else { - yyv3348 := &x.Status - yyv3348.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3343) - } // end switch yys3343 - } // end for yyj3343 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuota) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3349 int - var yyb3349 bool - var yyhl3349 bool = l >= 0 - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3352 := &x.ObjectMeta - yyv3352.CodecDecodeSelf(d) - } - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ResourceQuotaSpec{} - } else { - yyv3353 := &x.Spec - yyv3353.CodecDecodeSelf(d) - } - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ResourceQuotaStatus{} - } else { - yyv3354 := &x.Status - yyv3354.CodecDecodeSelf(d) - } - for { - yyj3349++ - if yyhl3349 { - yyb3349 = yyj3349 > l - } else { - yyb3349 = r.CheckBreak() - } - if yyb3349 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3349-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3355 := z.EncBinary() - _ = yym3355 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3356 := !z.EncBinary() - yy2arr3356 := z.EncBasicHandle().StructToArray - var yyq3356 [4]bool - _, _, _ = yysep3356, yyq3356, yy2arr3356 - const yyr3356 bool = false - yyq3356[0] = x.Kind != "" - yyq3356[1] = x.APIVersion != "" - yyq3356[2] = true - var yynn3356 int - if yyr3356 || yy2arr3356 { - r.EncodeArrayStart(4) - } else { - yynn3356 = 1 - for _, b := range yyq3356 { - if b { - yynn3356++ - } - } - r.EncodeMapStart(yynn3356) - yynn3356 = 0 - } - if yyr3356 || yy2arr3356 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3356[0] { - yym3358 := z.EncBinary() - _ = yym3358 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3356[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3359 := z.EncBinary() - _ = yym3359 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3356 || yy2arr3356 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3356[1] { - yym3361 := z.EncBinary() - _ = yym3361 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3356[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3362 := z.EncBinary() - _ = yym3362 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3356 || yy2arr3356 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3356[2] { - yy3364 := &x.ListMeta - yym3365 := z.EncBinary() - _ = yym3365 - if false { - } else if z.HasExtensions() && z.EncExt(yy3364) { - } else { - z.EncFallback(yy3364) - } - } else { - r.EncodeNil() - } - } else { - if yyq3356[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3366 := &x.ListMeta - yym3367 := z.EncBinary() - _ = yym3367 - if false { - } else if z.HasExtensions() && z.EncExt(yy3366) { - } else { - z.EncFallback(yy3366) - } - } - } - if yyr3356 || yy2arr3356 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3369 := z.EncBinary() - _ = yym3369 - if false { - } else { - h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3370 := z.EncBinary() - _ = yym3370 - if false { - } else { - h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) - } - } - } - if yyr3356 || yy2arr3356 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3371 := z.DecBinary() - _ = yym3371 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3372 := r.ContainerType() - if yyct3372 == codecSelferValueTypeMap1234 { - yyl3372 := r.ReadMapStart() - if yyl3372 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3372, d) - } - } else if yyct3372 == codecSelferValueTypeArray1234 { - yyl3372 := r.ReadArrayStart() - if yyl3372 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3372, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3373Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3373Slc - var yyhl3373 bool = l >= 0 - for yyj3373 := 0; ; yyj3373++ { - if yyhl3373 { - if yyj3373 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3373Slc = r.DecodeBytes(yys3373Slc, true, true) - yys3373 := string(yys3373Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3373 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3376 := &x.ListMeta - yym3377 := z.DecBinary() - _ = yym3377 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3376) { - } else { - z.DecFallback(yyv3376, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3378 := &x.Items - yym3379 := z.DecBinary() - _ = yym3379 - if false { - } else { - h.decSliceResourceQuota((*[]ResourceQuota)(yyv3378), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3373) - } // end switch yys3373 - } // end for yyj3373 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3380 int - var yyb3380 bool - var yyhl3380 bool = l >= 0 - yyj3380++ - if yyhl3380 { - yyb3380 = yyj3380 > l - } else { - yyb3380 = r.CheckBreak() - } - if yyb3380 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3380++ - if yyhl3380 { - yyb3380 = yyj3380 > l - } else { - yyb3380 = r.CheckBreak() - } - if yyb3380 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3380++ - if yyhl3380 { - yyb3380 = yyj3380 > l - } else { - yyb3380 = r.CheckBreak() - } - if yyb3380 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3383 := &x.ListMeta - yym3384 := z.DecBinary() - _ = yym3384 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3383) { - } else { - z.DecFallback(yyv3383, false) - } - } - yyj3380++ - if yyhl3380 { - yyb3380 = yyj3380 > l - } else { - yyb3380 = r.CheckBreak() - } - if yyb3380 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3385 := &x.Items - yym3386 := z.DecBinary() - _ = yym3386 - if false { - } else { - h.decSliceResourceQuota((*[]ResourceQuota)(yyv3385), d) - } - } - for { - yyj3380++ - if yyhl3380 { - yyb3380 = yyj3380 > l - } else { - yyb3380 = r.CheckBreak() - } - if yyb3380 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3380-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3387 := z.EncBinary() - _ = yym3387 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3388 := !z.EncBinary() - yy2arr3388 := z.EncBasicHandle().StructToArray - var yyq3388 [5]bool - _, _, _ = yysep3388, yyq3388, yy2arr3388 - const yyr3388 bool = false - yyq3388[0] = x.Kind != "" - yyq3388[1] = x.APIVersion != "" - yyq3388[2] = true - yyq3388[3] = len(x.Data) != 0 - yyq3388[4] = x.Type != "" - var yynn3388 int - if yyr3388 || yy2arr3388 { - r.EncodeArrayStart(5) - } else { - yynn3388 = 0 - for _, b := range yyq3388 { - if b { - yynn3388++ - } - } - r.EncodeMapStart(yynn3388) - yynn3388 = 0 - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3388[0] { - yym3390 := z.EncBinary() - _ = yym3390 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3388[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3391 := z.EncBinary() - _ = yym3391 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3388[1] { - yym3393 := z.EncBinary() - _ = yym3393 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3388[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3394 := z.EncBinary() - _ = yym3394 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3388[2] { - yy3396 := &x.ObjectMeta - yy3396.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3388[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3397 := &x.ObjectMeta - yy3397.CodecEncodeSelf(e) - } - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3388[3] { - if x.Data == nil { - r.EncodeNil() - } else { - yym3399 := z.EncBinary() - _ = yym3399 - if false { - } else { - h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq3388[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("data")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Data == nil { - r.EncodeNil() - } else { - yym3400 := z.EncBinary() - _ = yym3400 - if false { - } else { - h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) - } - } - } - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3388[4] { - x.Type.CodecEncodeSelf(e) - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3388[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("type")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Type.CodecEncodeSelf(e) - } - } - if yyr3388 || yy2arr3388 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Secret) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3402 := z.DecBinary() - _ = yym3402 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3403 := r.ContainerType() - if yyct3403 == codecSelferValueTypeMap1234 { - yyl3403 := r.ReadMapStart() - if yyl3403 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3403, d) - } - } else if yyct3403 == codecSelferValueTypeArray1234 { - yyl3403 := r.ReadArrayStart() - if yyl3403 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3403, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Secret) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3404Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3404Slc - var yyhl3404 bool = l >= 0 - for yyj3404 := 0; ; yyj3404++ { - if yyhl3404 { - if yyj3404 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3404Slc = r.DecodeBytes(yys3404Slc, true, true) - yys3404 := string(yys3404Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3404 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3407 := &x.ObjectMeta - yyv3407.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3408 := &x.Data - yym3409 := z.DecBinary() - _ = yym3409 - if false { - } else { - h.decMapstringSliceuint8((*map[string][]uint8)(yyv3408), d) - } - } - case "type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = SecretType(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys3404) - } // end switch yys3404 - } // end for yyj3404 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3411 int - var yyb3411 bool - var yyhl3411 bool = l >= 0 - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3414 := &x.ObjectMeta - yyv3414.CodecDecodeSelf(d) - } - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3415 := &x.Data - yym3416 := z.DecBinary() - _ = yym3416 - if false { - } else { - h.decMapstringSliceuint8((*map[string][]uint8)(yyv3415), d) - } - } - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = SecretType(r.DecodeString()) - } - for { - yyj3411++ - if yyhl3411 { - yyb3411 = yyj3411 > l - } else { - yyb3411 = r.CheckBreak() - } - if yyb3411 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3411-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x SecretType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym3418 := z.EncBinary() - _ = yym3418 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *SecretType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3419 := z.DecBinary() - _ = yym3419 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -42524,9 +42835,9 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq3421 [4]bool _, _, _ = yysep3421, yyq3421, yy2arr3421 const yyr3421 bool = false - yyq3421[0] = x.Kind != "" - yyq3421[1] = x.APIVersion != "" - yyq3421[2] = true + yyq3421[0] = true + yyq3421[2] = x.Kind != "" + yyq3421[3] = x.APIVersion != "" var yynn3421 int if yyr3421 || yy2arr3421 { r.EncodeArrayStart(4) @@ -42543,79 +42854,29 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr3421 || yy2arr3421 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq3421[0] { - yym3423 := z.EncBinary() - _ = yym3423 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3421[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3423 := &x.ListMeta yym3424 := z.EncBinary() _ = yym3424 if false { + } else if z.HasExtensions() && z.EncExt(yy3423) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3421 || yy2arr3421 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3421[1] { - yym3426 := z.EncBinary() - _ = yym3426 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3421[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3427 := z.EncBinary() - _ = yym3427 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3421 || yy2arr3421 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3421[2] { - yy3429 := &x.ListMeta - yym3430 := z.EncBinary() - _ = yym3430 - if false { - } else if z.HasExtensions() && z.EncExt(yy3429) { - } else { - z.EncFallback(yy3429) + z.EncFallback(yy3423) } } else { r.EncodeNil() } } else { - if yyq3421[2] { + if yyq3421[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3431 := &x.ListMeta - yym3432 := z.EncBinary() - _ = yym3432 + yy3425 := &x.ListMeta + yym3426 := z.EncBinary() + _ = yym3426 if false { - } else if z.HasExtensions() && z.EncExt(yy3431) { + } else if z.HasExtensions() && z.EncExt(yy3425) { } else { - z.EncFallback(yy3431) + z.EncFallback(yy3425) } } } @@ -42624,11 +42885,11 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3434 := z.EncBinary() - _ = yym3434 + yym3428 := z.EncBinary() + _ = yym3428 if false { } else { - h.encSliceSecret(([]Secret)(x.Items), e) + h.encSliceLimitRange(([]LimitRange)(x.Items), e) } } } else { @@ -42638,11 +42899,61 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym3429 := z.EncBinary() + _ = yym3429 + if false { + } else { + h.encSliceLimitRange(([]LimitRange)(x.Items), e) + } + } + } + if yyr3421 || yy2arr3421 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3421[2] { + yym3431 := z.EncBinary() + _ = yym3431 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3421[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3432 := z.EncBinary() + _ = yym3432 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3421 || yy2arr3421 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3421[3] { + yym3434 := z.EncBinary() + _ = yym3434 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3421[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym3435 := z.EncBinary() _ = yym3435 if false { } else { - h.encSliceSecret(([]Secret)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -42655,7 +42966,7 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *LimitRangeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42685,7 +42996,7 @@ func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *LimitRangeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42707,6 +43018,31 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys3438 := string(yys3438Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys3438 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3439 := &x.ListMeta + yym3440 := z.DecBinary() + _ = yym3440 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3439) { + } else { + z.DecFallback(yyv3439, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3441 := &x.Items + yym3442 := z.DecBinary() + _ = yym3442 + if false { + } else { + h.decSliceLimitRange((*[]LimitRange)(yyv3441), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -42719,31 +43055,6 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3441 := &x.ListMeta - yym3442 := z.DecBinary() - _ = yym3442 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3441) { - } else { - z.DecFallback(yyv3441, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3443 := &x.Items - yym3444 := z.DecBinary() - _ = yym3444 - if false { - } else { - h.decSliceSecret((*[]Secret)(yyv3443), d) - } - } default: z.DecStructFieldNotFound(-1, yys3438) } // end switch yys3438 @@ -42751,7 +43062,7 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *LimitRangeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42769,6 +43080,51 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3446 := &x.ListMeta + yym3447 := z.DecBinary() + _ = yym3447 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3446) { + } else { + z.DecFallback(yyv3446, false) + } + } + yyj3445++ + if yyhl3445 { + yyb3445 = yyj3445 > l + } else { + yyb3445 = r.CheckBreak() + } + if yyb3445 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3448 := &x.Items + yym3449 := z.DecBinary() + _ = yym3449 + if false { + } else { + h.decSliceLimitRange((*[]LimitRange)(yyv3448), d) + } + } + yyj3445++ + if yyhl3445 { + yyb3445 = yyj3445 > l + } else { + yyb3445 = r.CheckBreak() + } + if yyb3445 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -42790,51 +43146,6 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3445++ - if yyhl3445 { - yyb3445 = yyj3445 > l - } else { - yyb3445 = r.CheckBreak() - } - if yyb3445 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3448 := &x.ListMeta - yym3449 := z.DecBinary() - _ = yym3449 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3448) { - } else { - z.DecFallback(yyv3448, false) - } - } - yyj3445++ - if yyhl3445 { - yyb3445 = yyj3445 > l - } else { - yyb3445 = r.CheckBreak() - } - if yyb3445 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3450 := &x.Items - yym3451 := z.DecBinary() - _ = yym3451 - if false { - } else { - h.decSliceSecret((*[]Secret)(yyv3450), d) - } - } for { yyj3445++ if yyhl3445 { @@ -42851,7 +43162,7 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *ResourceQuotaSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -42865,16 +43176,13 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep3453 := !z.EncBinary() yy2arr3453 := z.EncBasicHandle().StructToArray - var yyq3453 [4]bool + var yyq3453 [1]bool _, _, _ = yysep3453, yyq3453, yy2arr3453 const yyr3453 bool = false - yyq3453[0] = x.Kind != "" - yyq3453[1] = x.APIVersion != "" - yyq3453[2] = true - yyq3453[3] = len(x.Data) != 0 + yyq3453[0] = len(x.Hard) != 0 var yynn3453 int if yyr3453 || yy2arr3453 { - r.EncodeArrayStart(4) + r.EncodeArrayStart(1) } else { yynn3453 = 0 for _, b := range yyq3453 { @@ -42888,96 +43196,1857 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { if yyr3453 || yy2arr3453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq3453[0] { - yym3455 := z.EncBinary() - _ = yym3455 - if false { + if x.Hard == nil { + r.EncodeNil() } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + x.Hard.CodecEncodeSelf(e) } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3453[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3456 := z.EncBinary() - _ = yym3456 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3453 || yy2arr3453 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3453[1] { - yym3458 := z.EncBinary() - _ = yym3458 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3453[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3459 := z.EncBinary() - _ = yym3459 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3453 || yy2arr3453 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3453[2] { - yy3461 := &x.ObjectMeta - yy3461.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3453[2] { + if yyq3453[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("hard")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3462 := &x.ObjectMeta - yy3462.CodecEncodeSelf(e) + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } } } if yyr3453 || yy2arr3453 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaSpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3455 := z.DecBinary() + _ = yym3455 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3456 := r.ContainerType() + if yyct3456 == codecSelferValueTypeMap1234 { + yyl3456 := r.ReadMapStart() + if yyl3456 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3456, d) + } + } else if yyct3456 == codecSelferValueTypeArray1234 { + yyl3456 := r.ReadArrayStart() + if yyl3456 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3456, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3457Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3457Slc + var yyhl3457 bool = l >= 0 + for yyj3457 := 0; ; yyj3457++ { + if yyhl3457 { + if yyj3457 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3457Slc = r.DecodeBytes(yys3457Slc, true, true) + yys3457 := string(yys3457Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3457 { + case "hard": + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3458 := &x.Hard + yyv3458.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys3457) + } // end switch yys3457 + } // end for yyj3457 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3459 int + var yyb3459 bool + var yyhl3459 bool = l >= 0 + yyj3459++ + if yyhl3459 { + yyb3459 = yyj3459 > l + } else { + yyb3459 = r.CheckBreak() + } + if yyb3459 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3460 := &x.Hard + yyv3460.CodecDecodeSelf(d) + } + for { + yyj3459++ + if yyhl3459 { + yyb3459 = yyj3459 > l + } else { + yyb3459 = r.CheckBreak() + } + if yyb3459 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3459-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuotaStatus) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3461 := z.EncBinary() + _ = yym3461 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3462 := !z.EncBinary() + yy2arr3462 := z.EncBasicHandle().StructToArray + var yyq3462 [2]bool + _, _, _ = yysep3462, yyq3462, yy2arr3462 + const yyr3462 bool = false + yyq3462[0] = len(x.Hard) != 0 + yyq3462[1] = len(x.Used) != 0 + var yynn3462 int + if yyr3462 || yy2arr3462 { + r.EncodeArrayStart(2) + } else { + yynn3462 = 0 + for _, b := range yyq3462 { + if b { + yynn3462++ + } + } + r.EncodeMapStart(yynn3462) + yynn3462 = 0 + } + if yyr3462 || yy2arr3462 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3453[3] { + if yyq3462[0] { + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq3462[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hard")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } + } + } + if yyr3462 || yy2arr3462 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3462[1] { + if x.Used == nil { + r.EncodeNil() + } else { + x.Used.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq3462[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("used")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Used == nil { + r.EncodeNil() + } else { + x.Used.CodecEncodeSelf(e) + } + } + } + if yyr3462 || yy2arr3462 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaStatus) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3465 := z.DecBinary() + _ = yym3465 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3466 := r.ContainerType() + if yyct3466 == codecSelferValueTypeMap1234 { + yyl3466 := r.ReadMapStart() + if yyl3466 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3466, d) + } + } else if yyct3466 == codecSelferValueTypeArray1234 { + yyl3466 := r.ReadArrayStart() + if yyl3466 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3466, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3467Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3467Slc + var yyhl3467 bool = l >= 0 + for yyj3467 := 0; ; yyj3467++ { + if yyhl3467 { + if yyj3467 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3467Slc = r.DecodeBytes(yys3467Slc, true, true) + yys3467 := string(yys3467Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3467 { + case "hard": + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3468 := &x.Hard + yyv3468.CodecDecodeSelf(d) + } + case "used": + if r.TryDecodeAsNil() { + x.Used = nil + } else { + yyv3469 := &x.Used + yyv3469.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys3467) + } // end switch yys3467 + } // end for yyj3467 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3470 int + var yyb3470 bool + var yyhl3470 bool = l >= 0 + yyj3470++ + if yyhl3470 { + yyb3470 = yyj3470 > l + } else { + yyb3470 = r.CheckBreak() + } + if yyb3470 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3471 := &x.Hard + yyv3471.CodecDecodeSelf(d) + } + yyj3470++ + if yyhl3470 { + yyb3470 = yyj3470 > l + } else { + yyb3470 = r.CheckBreak() + } + if yyb3470 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Used = nil + } else { + yyv3472 := &x.Used + yyv3472.CodecDecodeSelf(d) + } + for { + yyj3470++ + if yyhl3470 { + yyb3470 = yyj3470 > l + } else { + yyb3470 = r.CheckBreak() + } + if yyb3470 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3470-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuota) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3473 := z.EncBinary() + _ = yym3473 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3474 := !z.EncBinary() + yy2arr3474 := z.EncBasicHandle().StructToArray + var yyq3474 [5]bool + _, _, _ = yysep3474, yyq3474, yy2arr3474 + const yyr3474 bool = false + yyq3474[0] = true + yyq3474[1] = true + yyq3474[2] = true + yyq3474[3] = x.Kind != "" + yyq3474[4] = x.APIVersion != "" + var yynn3474 int + if yyr3474 || yy2arr3474 { + r.EncodeArrayStart(5) + } else { + yynn3474 = 0 + for _, b := range yyq3474 { + if b { + yynn3474++ + } + } + r.EncodeMapStart(yynn3474) + yynn3474 = 0 + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3474[0] { + yy3476 := &x.ObjectMeta + yy3476.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3474[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3477 := &x.ObjectMeta + yy3477.CodecEncodeSelf(e) + } + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3474[1] { + yy3479 := &x.Spec + yy3479.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3474[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3480 := &x.Spec + yy3480.CodecEncodeSelf(e) + } + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3474[2] { + yy3482 := &x.Status + yy3482.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3474[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3483 := &x.Status + yy3483.CodecEncodeSelf(e) + } + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3474[3] { + yym3485 := z.EncBinary() + _ = yym3485 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3474[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3486 := z.EncBinary() + _ = yym3486 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3474[4] { + yym3488 := z.EncBinary() + _ = yym3488 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3474[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3489 := z.EncBinary() + _ = yym3489 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3474 || yy2arr3474 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuota) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3490 := z.DecBinary() + _ = yym3490 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3491 := r.ContainerType() + if yyct3491 == codecSelferValueTypeMap1234 { + yyl3491 := r.ReadMapStart() + if yyl3491 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3491, d) + } + } else if yyct3491 == codecSelferValueTypeArray1234 { + yyl3491 := r.ReadArrayStart() + if yyl3491 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3491, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuota) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3492Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3492Slc + var yyhl3492 bool = l >= 0 + for yyj3492 := 0; ; yyj3492++ { + if yyhl3492 { + if yyj3492 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3492Slc = r.DecodeBytes(yys3492Slc, true, true) + yys3492 := string(yys3492Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3492 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3493 := &x.ObjectMeta + yyv3493.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ResourceQuotaSpec{} + } else { + yyv3494 := &x.Spec + yyv3494.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ResourceQuotaStatus{} + } else { + yyv3495 := &x.Status + yyv3495.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, yys3492) + } // end switch yys3492 + } // end for yyj3492 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuota) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3498 int + var yyb3498 bool + var yyhl3498 bool = l >= 0 + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3499 := &x.ObjectMeta + yyv3499.CodecDecodeSelf(d) + } + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ResourceQuotaSpec{} + } else { + yyv3500 := &x.Spec + yyv3500.CodecDecodeSelf(d) + } + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ResourceQuotaStatus{} + } else { + yyv3501 := &x.Status + yyv3501.CodecDecodeSelf(d) + } + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3498++ + if yyhl3498 { + yyb3498 = yyj3498 > l + } else { + yyb3498 = r.CheckBreak() + } + if yyb3498 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3498-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuotaList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3504 := z.EncBinary() + _ = yym3504 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3505 := !z.EncBinary() + yy2arr3505 := z.EncBasicHandle().StructToArray + var yyq3505 [4]bool + _, _, _ = yysep3505, yyq3505, yy2arr3505 + const yyr3505 bool = false + yyq3505[0] = true + yyq3505[2] = x.Kind != "" + yyq3505[3] = x.APIVersion != "" + var yynn3505 int + if yyr3505 || yy2arr3505 { + r.EncodeArrayStart(4) + } else { + yynn3505 = 1 + for _, b := range yyq3505 { + if b { + yynn3505++ + } + } + r.EncodeMapStart(yynn3505) + yynn3505 = 0 + } + if yyr3505 || yy2arr3505 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3505[0] { + yy3507 := &x.ListMeta + yym3508 := z.EncBinary() + _ = yym3508 + if false { + } else if z.HasExtensions() && z.EncExt(yy3507) { + } else { + z.EncFallback(yy3507) + } + } else { + r.EncodeNil() + } + } else { + if yyq3505[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3509 := &x.ListMeta + yym3510 := z.EncBinary() + _ = yym3510 + if false { + } else if z.HasExtensions() && z.EncExt(yy3509) { + } else { + z.EncFallback(yy3509) + } + } + } + if yyr3505 || yy2arr3505 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3512 := z.EncBinary() + _ = yym3512 + if false { + } else { + h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3513 := z.EncBinary() + _ = yym3513 + if false { + } else { + h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) + } + } + } + if yyr3505 || yy2arr3505 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3505[2] { + yym3515 := z.EncBinary() + _ = yym3515 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3505[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3516 := z.EncBinary() + _ = yym3516 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3505 || yy2arr3505 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3505[3] { + yym3518 := z.EncBinary() + _ = yym3518 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3505[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3519 := z.EncBinary() + _ = yym3519 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3505 || yy2arr3505 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3520 := z.DecBinary() + _ = yym3520 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3521 := r.ContainerType() + if yyct3521 == codecSelferValueTypeMap1234 { + yyl3521 := r.ReadMapStart() + if yyl3521 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3521, d) + } + } else if yyct3521 == codecSelferValueTypeArray1234 { + yyl3521 := r.ReadArrayStart() + if yyl3521 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3521, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3522Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3522Slc + var yyhl3522 bool = l >= 0 + for yyj3522 := 0; ; yyj3522++ { + if yyhl3522 { + if yyj3522 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3522Slc = r.DecodeBytes(yys3522Slc, true, true) + yys3522 := string(yys3522Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3522 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3523 := &x.ListMeta + yym3524 := z.DecBinary() + _ = yym3524 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3523) { + } else { + z.DecFallback(yyv3523, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3525 := &x.Items + yym3526 := z.DecBinary() + _ = yym3526 + if false { + } else { + h.decSliceResourceQuota((*[]ResourceQuota)(yyv3525), 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, yys3522) + } // end switch yys3522 + } // end for yyj3522 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3529 int + var yyb3529 bool + var yyhl3529 bool = l >= 0 + yyj3529++ + if yyhl3529 { + yyb3529 = yyj3529 > l + } else { + yyb3529 = r.CheckBreak() + } + if yyb3529 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3530 := &x.ListMeta + yym3531 := z.DecBinary() + _ = yym3531 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3530) { + } else { + z.DecFallback(yyv3530, false) + } + } + yyj3529++ + if yyhl3529 { + yyb3529 = yyj3529 > l + } else { + yyb3529 = r.CheckBreak() + } + if yyb3529 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3532 := &x.Items + yym3533 := z.DecBinary() + _ = yym3533 + if false { + } else { + h.decSliceResourceQuota((*[]ResourceQuota)(yyv3532), d) + } + } + yyj3529++ + if yyhl3529 { + yyb3529 = yyj3529 > l + } else { + yyb3529 = r.CheckBreak() + } + if yyb3529 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3529++ + if yyhl3529 { + yyb3529 = yyj3529 > l + } else { + yyb3529 = r.CheckBreak() + } + if yyb3529 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3529++ + if yyhl3529 { + yyb3529 = yyj3529 > l + } else { + yyb3529 = r.CheckBreak() + } + if yyb3529 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3529-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3536 := z.EncBinary() + _ = yym3536 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3537 := !z.EncBinary() + yy2arr3537 := z.EncBasicHandle().StructToArray + var yyq3537 [5]bool + _, _, _ = yysep3537, yyq3537, yy2arr3537 + const yyr3537 bool = false + yyq3537[0] = true + yyq3537[1] = len(x.Data) != 0 + yyq3537[2] = x.Type != "" + yyq3537[3] = x.Kind != "" + yyq3537[4] = x.APIVersion != "" + var yynn3537 int + if yyr3537 || yy2arr3537 { + r.EncodeArrayStart(5) + } else { + yynn3537 = 0 + for _, b := range yyq3537 { + if b { + yynn3537++ + } + } + r.EncodeMapStart(yynn3537) + yynn3537 = 0 + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3537[0] { + yy3539 := &x.ObjectMeta + yy3539.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3537[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3540 := &x.ObjectMeta + yy3540.CodecEncodeSelf(e) + } + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3537[1] { if x.Data == nil { r.EncodeNil() } else { - yym3464 := z.EncBinary() - _ = yym3464 + yym3542 := z.EncBinary() + _ = yym3542 if false { } else { - z.F.EncMapStringStringV(x.Data, false, e) + h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) } } } else { r.EncodeNil() } } else { - if yyq3453[3] { + if yyq3537[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("data")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Data == nil { r.EncodeNil() } else { - yym3465 := z.EncBinary() - _ = yym3465 + yym3543 := z.EncBinary() + _ = yym3543 + if false { + } else { + h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) + } + } + } + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3537[2] { + x.Type.CodecEncodeSelf(e) + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3537[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("type")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Type.CodecEncodeSelf(e) + } + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3537[3] { + yym3546 := z.EncBinary() + _ = yym3546 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3537[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3547 := z.EncBinary() + _ = yym3547 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3537[4] { + yym3549 := z.EncBinary() + _ = yym3549 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3537[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3550 := z.EncBinary() + _ = yym3550 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3537 || yy2arr3537 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Secret) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3551 := z.DecBinary() + _ = yym3551 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3552 := r.ContainerType() + if yyct3552 == codecSelferValueTypeMap1234 { + yyl3552 := r.ReadMapStart() + if yyl3552 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3552, d) + } + } else if yyct3552 == codecSelferValueTypeArray1234 { + yyl3552 := r.ReadArrayStart() + if yyl3552 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3552, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Secret) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3553Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3553Slc + var yyhl3553 bool = l >= 0 + for yyj3553 := 0; ; yyj3553++ { + if yyhl3553 { + if yyj3553 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3553Slc = r.DecodeBytes(yys3553Slc, true, true) + yys3553 := string(yys3553Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3553 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3554 := &x.ObjectMeta + yyv3554.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3555 := &x.Data + yym3556 := z.DecBinary() + _ = yym3556 + if false { + } else { + h.decMapstringSliceuint8((*map[string][]uint8)(yyv3555), d) + } + } + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SecretType(r.DecodeString()) + } + 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, yys3553) + } // end switch yys3553 + } // end for yyj3553 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3560 int + var yyb3560 bool + var yyhl3560 bool = l >= 0 + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3561 := &x.ObjectMeta + yyv3561.CodecDecodeSelf(d) + } + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3562 := &x.Data + yym3563 := z.DecBinary() + _ = yym3563 + if false { + } else { + h.decMapstringSliceuint8((*map[string][]uint8)(yyv3562), d) + } + } + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SecretType(r.DecodeString()) + } + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3560++ + if yyhl3560 { + yyb3560 = yyj3560 > l + } else { + yyb3560 = r.CheckBreak() + } + if yyb3560 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3560-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x SecretType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym3567 := z.EncBinary() + _ = yym3567 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *SecretType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3568 := z.DecBinary() + _ = yym3568 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3569 := z.EncBinary() + _ = yym3569 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3570 := !z.EncBinary() + yy2arr3570 := z.EncBasicHandle().StructToArray + var yyq3570 [4]bool + _, _, _ = yysep3570, yyq3570, yy2arr3570 + const yyr3570 bool = false + yyq3570[0] = true + yyq3570[2] = x.Kind != "" + yyq3570[3] = x.APIVersion != "" + var yynn3570 int + if yyr3570 || yy2arr3570 { + r.EncodeArrayStart(4) + } else { + yynn3570 = 1 + for _, b := range yyq3570 { + if b { + yynn3570++ + } + } + r.EncodeMapStart(yynn3570) + yynn3570 = 0 + } + if yyr3570 || yy2arr3570 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3570[0] { + yy3572 := &x.ListMeta + yym3573 := z.EncBinary() + _ = yym3573 + if false { + } else if z.HasExtensions() && z.EncExt(yy3572) { + } else { + z.EncFallback(yy3572) + } + } else { + r.EncodeNil() + } + } else { + if yyq3570[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3574 := &x.ListMeta + yym3575 := z.EncBinary() + _ = yym3575 + if false { + } else if z.HasExtensions() && z.EncExt(yy3574) { + } else { + z.EncFallback(yy3574) + } + } + } + if yyr3570 || yy2arr3570 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3577 := z.EncBinary() + _ = yym3577 + if false { + } else { + h.encSliceSecret(([]Secret)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3578 := z.EncBinary() + _ = yym3578 + if false { + } else { + h.encSliceSecret(([]Secret)(x.Items), e) + } + } + } + if yyr3570 || yy2arr3570 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3570[2] { + yym3580 := z.EncBinary() + _ = yym3580 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3570[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3581 := z.EncBinary() + _ = yym3581 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3570 || yy2arr3570 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3570[3] { + yym3583 := z.EncBinary() + _ = yym3583 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3570[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3584 := z.EncBinary() + _ = yym3584 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3570 || yy2arr3570 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3585 := z.DecBinary() + _ = yym3585 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3586 := r.ContainerType() + if yyct3586 == codecSelferValueTypeMap1234 { + yyl3586 := r.ReadMapStart() + if yyl3586 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3586, d) + } + } else if yyct3586 == codecSelferValueTypeArray1234 { + yyl3586 := r.ReadArrayStart() + if yyl3586 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3586, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3587Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3587Slc + var yyhl3587 bool = l >= 0 + for yyj3587 := 0; ; yyj3587++ { + if yyhl3587 { + if yyj3587 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3587Slc = r.DecodeBytes(yys3587Slc, true, true) + yys3587 := string(yys3587Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3587 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3588 := &x.ListMeta + yym3589 := z.DecBinary() + _ = yym3589 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3588) { + } else { + z.DecFallback(yyv3588, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3590 := &x.Items + yym3591 := z.DecBinary() + _ = yym3591 + if false { + } else { + h.decSliceSecret((*[]Secret)(yyv3590), 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, yys3587) + } // end switch yys3587 + } // end for yyj3587 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3594 int + var yyb3594 bool + var yyhl3594 bool = l >= 0 + yyj3594++ + if yyhl3594 { + yyb3594 = yyj3594 > l + } else { + yyb3594 = r.CheckBreak() + } + if yyb3594 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3595 := &x.ListMeta + yym3596 := z.DecBinary() + _ = yym3596 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3595) { + } else { + z.DecFallback(yyv3595, false) + } + } + yyj3594++ + if yyhl3594 { + yyb3594 = yyj3594 > l + } else { + yyb3594 = r.CheckBreak() + } + if yyb3594 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3597 := &x.Items + yym3598 := z.DecBinary() + _ = yym3598 + if false { + } else { + h.decSliceSecret((*[]Secret)(yyv3597), d) + } + } + yyj3594++ + if yyhl3594 { + yyb3594 = yyj3594 > l + } else { + yyb3594 = r.CheckBreak() + } + if yyb3594 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3594++ + if yyhl3594 { + yyb3594 = yyj3594 > l + } else { + yyb3594 = r.CheckBreak() + } + if yyb3594 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3594++ + if yyhl3594 { + yyb3594 = yyj3594 > l + } else { + yyb3594 = r.CheckBreak() + } + if yyb3594 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3594-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3601 := z.EncBinary() + _ = yym3601 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3602 := !z.EncBinary() + yy2arr3602 := z.EncBasicHandle().StructToArray + var yyq3602 [4]bool + _, _, _ = yysep3602, yyq3602, yy2arr3602 + const yyr3602 bool = false + yyq3602[0] = true + yyq3602[1] = len(x.Data) != 0 + yyq3602[2] = x.Kind != "" + yyq3602[3] = x.APIVersion != "" + var yynn3602 int + if yyr3602 || yy2arr3602 { + r.EncodeArrayStart(4) + } else { + yynn3602 = 0 + for _, b := range yyq3602 { + if b { + yynn3602++ + } + } + r.EncodeMapStart(yynn3602) + yynn3602 = 0 + } + if yyr3602 || yy2arr3602 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3602[0] { + yy3604 := &x.ObjectMeta + yy3604.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3602[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3605 := &x.ObjectMeta + yy3605.CodecEncodeSelf(e) + } + } + if yyr3602 || yy2arr3602 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3602[1] { + if x.Data == nil { + r.EncodeNil() + } else { + yym3607 := z.EncBinary() + _ = yym3607 + if false { + } else { + z.F.EncMapStringStringV(x.Data, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq3602[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("data")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Data == nil { + r.EncodeNil() + } else { + yym3608 := z.EncBinary() + _ = yym3608 if false { } else { z.F.EncMapStringStringV(x.Data, false, e) @@ -42985,7 +45054,57 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3453 || yy2arr3453 { + if yyr3602 || yy2arr3602 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3602[2] { + yym3610 := z.EncBinary() + _ = yym3610 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3602[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3611 := z.EncBinary() + _ = yym3611 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3602 || yy2arr3602 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3602[3] { + yym3613 := z.EncBinary() + _ = yym3613 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3602[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3614 := z.EncBinary() + _ = yym3614 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3602 || yy2arr3602 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -42998,25 +45117,25 @@ func (x *ConfigMap) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3466 := z.DecBinary() - _ = yym3466 + yym3615 := z.DecBinary() + _ = yym3615 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3467 := r.ContainerType() - if yyct3467 == codecSelferValueTypeMap1234 { - yyl3467 := r.ReadMapStart() - if yyl3467 == 0 { + yyct3616 := r.ContainerType() + if yyct3616 == codecSelferValueTypeMap1234 { + yyl3616 := r.ReadMapStart() + if yyl3616 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3467, d) + x.codecDecodeSelfFromMap(yyl3616, d) } - } else if yyct3467 == codecSelferValueTypeArray1234 { - yyl3467 := r.ReadArrayStart() - if yyl3467 == 0 { + } else if yyct3616 == codecSelferValueTypeArray1234 { + yyl3616 := r.ReadArrayStart() + if yyl3616 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3467, d) + x.codecDecodeSelfFromArray(yyl3616, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43028,12 +45147,12 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3468Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3468Slc - var yyhl3468 bool = l >= 0 - for yyj3468 := 0; ; yyj3468++ { - if yyhl3468 { - if yyj3468 >= l { + var yys3617Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3617Slc + var yyhl3617 bool = l >= 0 + for yyj3617 := 0; ; yyj3617++ { + if yyhl3617 { + if yyj3617 >= l { break } } else { @@ -43042,10 +45161,29 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3468Slc = r.DecodeBytes(yys3468Slc, true, true) - yys3468 := string(yys3468Slc) + yys3617Slc = r.DecodeBytes(yys3617Slc, true, true) + yys3617 := string(yys3617Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3468 { + switch yys3617 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3618 := &x.ObjectMeta + yyv3618.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3619 := &x.Data + yym3620 := z.DecBinary() + _ = yym3620 + if false { + } else { + z.F.DecMapStringStringX(yyv3619, false, d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -43058,29 +45196,10 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3471 := &x.ObjectMeta - yyv3471.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3472 := &x.Data - yym3473 := z.DecBinary() - _ = yym3473 - if false { - } else { - z.F.DecMapStringStringX(yyv3472, false, d) - } - } default: - z.DecStructFieldNotFound(-1, yys3468) - } // end switch yys3468 - } // end for yyj3468 + z.DecStructFieldNotFound(-1, yys3617) + } // end switch yys3617 + } // end for yyj3617 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43088,16 +45207,55 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3474 int - var yyb3474 bool - var yyhl3474 bool = l >= 0 - yyj3474++ - if yyhl3474 { - yyb3474 = yyj3474 > l + var yyj3623 int + var yyb3623 bool + var yyhl3623 bool = l >= 0 + yyj3623++ + if yyhl3623 { + yyb3623 = yyj3623 > l } else { - yyb3474 = r.CheckBreak() + yyb3623 = r.CheckBreak() } - if yyb3474 { + if yyb3623 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3624 := &x.ObjectMeta + yyv3624.CodecDecodeSelf(d) + } + yyj3623++ + if yyhl3623 { + yyb3623 = yyj3623 > l + } else { + yyb3623 = r.CheckBreak() + } + if yyb3623 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3625 := &x.Data + yym3626 := z.DecBinary() + _ = yym3626 + if false { + } else { + z.F.DecMapStringStringX(yyv3625, false, d) + } + } + yyj3623++ + if yyhl3623 { + yyb3623 = yyj3623 > l + } else { + yyb3623 = r.CheckBreak() + } + if yyb3623 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43107,13 +45265,13 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3474++ - if yyhl3474 { - yyb3474 = yyj3474 > l + yyj3623++ + if yyhl3623 { + yyb3623 = yyj3623 > l } else { - yyb3474 = r.CheckBreak() + yyb3623 = r.CheckBreak() } - if yyb3474 { + if yyb3623 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43123,57 +45281,18 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3474++ - if yyhl3474 { - yyb3474 = yyj3474 > l - } else { - yyb3474 = r.CheckBreak() - } - if yyb3474 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3477 := &x.ObjectMeta - yyv3477.CodecDecodeSelf(d) - } - yyj3474++ - if yyhl3474 { - yyb3474 = yyj3474 > l - } else { - yyb3474 = r.CheckBreak() - } - if yyb3474 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3478 := &x.Data - yym3479 := z.DecBinary() - _ = yym3479 - if false { - } else { - z.F.DecMapStringStringX(yyv3478, false, d) - } - } for { - yyj3474++ - if yyhl3474 { - yyb3474 = yyj3474 > l + yyj3623++ + if yyhl3623 { + yyb3623 = yyj3623 > l } else { - yyb3474 = r.CheckBreak() + yyb3623 = r.CheckBreak() } - if yyb3474 { + if yyb3623 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3474-1, "") + z.DecStructFieldNotFound(yyj3623-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43185,120 +45304,70 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3480 := z.EncBinary() - _ = yym3480 + yym3629 := z.EncBinary() + _ = yym3629 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3481 := !z.EncBinary() - yy2arr3481 := z.EncBasicHandle().StructToArray - var yyq3481 [4]bool - _, _, _ = yysep3481, yyq3481, yy2arr3481 - const yyr3481 bool = false - yyq3481[0] = x.Kind != "" - yyq3481[1] = x.APIVersion != "" - yyq3481[2] = true - yyq3481[3] = len(x.Items) != 0 - var yynn3481 int - if yyr3481 || yy2arr3481 { + yysep3630 := !z.EncBinary() + yy2arr3630 := z.EncBasicHandle().StructToArray + var yyq3630 [4]bool + _, _, _ = yysep3630, yyq3630, yy2arr3630 + const yyr3630 bool = false + yyq3630[0] = true + yyq3630[1] = len(x.Items) != 0 + yyq3630[2] = x.Kind != "" + yyq3630[3] = x.APIVersion != "" + var yynn3630 int + if yyr3630 || yy2arr3630 { r.EncodeArrayStart(4) } else { - yynn3481 = 0 - for _, b := range yyq3481 { + yynn3630 = 0 + for _, b := range yyq3630 { if b { - yynn3481++ + yynn3630++ } } - r.EncodeMapStart(yynn3481) - yynn3481 = 0 + r.EncodeMapStart(yynn3630) + yynn3630 = 0 } - if yyr3481 || yy2arr3481 { + if yyr3630 || yy2arr3630 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3481[0] { - yym3483 := z.EncBinary() - _ = yym3483 + if yyq3630[0] { + yy3632 := &x.ListMeta + yym3633 := z.EncBinary() + _ = yym3633 if false { + } else if z.HasExtensions() && z.EncExt(yy3632) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3481[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3484 := z.EncBinary() - _ = yym3484 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3481 || yy2arr3481 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3481[1] { - yym3486 := z.EncBinary() - _ = yym3486 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3481[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3487 := z.EncBinary() - _ = yym3487 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3481 || yy2arr3481 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3481[2] { - yy3489 := &x.ListMeta - yym3490 := z.EncBinary() - _ = yym3490 - if false { - } else if z.HasExtensions() && z.EncExt(yy3489) { - } else { - z.EncFallback(yy3489) + z.EncFallback(yy3632) } } else { r.EncodeNil() } } else { - if yyq3481[2] { + if yyq3630[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3491 := &x.ListMeta - yym3492 := z.EncBinary() - _ = yym3492 + yy3634 := &x.ListMeta + yym3635 := z.EncBinary() + _ = yym3635 if false { - } else if z.HasExtensions() && z.EncExt(yy3491) { + } else if z.HasExtensions() && z.EncExt(yy3634) { } else { - z.EncFallback(yy3491) + z.EncFallback(yy3634) } } } - if yyr3481 || yy2arr3481 { + if yyr3630 || yy2arr3630 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3481[3] { + if yyq3630[1] { if x.Items == nil { r.EncodeNil() } else { - yym3494 := z.EncBinary() - _ = yym3494 + yym3637 := z.EncBinary() + _ = yym3637 if false { } else { h.encSliceConfigMap(([]ConfigMap)(x.Items), e) @@ -43308,15 +45377,15 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3481[3] { + if yyq3630[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("items")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Items == nil { r.EncodeNil() } else { - yym3495 := z.EncBinary() - _ = yym3495 + yym3638 := z.EncBinary() + _ = yym3638 if false { } else { h.encSliceConfigMap(([]ConfigMap)(x.Items), e) @@ -43324,7 +45393,57 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3481 || yy2arr3481 { + if yyr3630 || yy2arr3630 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3630[2] { + yym3640 := z.EncBinary() + _ = yym3640 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3630[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3641 := z.EncBinary() + _ = yym3641 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3630 || yy2arr3630 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3630[3] { + yym3643 := z.EncBinary() + _ = yym3643 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3630[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3644 := z.EncBinary() + _ = yym3644 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3630 || yy2arr3630 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -43337,25 +45456,25 @@ func (x *ConfigMapList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3496 := z.DecBinary() - _ = yym3496 + yym3645 := z.DecBinary() + _ = yym3645 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3497 := r.ContainerType() - if yyct3497 == codecSelferValueTypeMap1234 { - yyl3497 := r.ReadMapStart() - if yyl3497 == 0 { + yyct3646 := r.ContainerType() + if yyct3646 == codecSelferValueTypeMap1234 { + yyl3646 := r.ReadMapStart() + if yyl3646 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3497, d) + x.codecDecodeSelfFromMap(yyl3646, d) } - } else if yyct3497 == codecSelferValueTypeArray1234 { - yyl3497 := r.ReadArrayStart() - if yyl3497 == 0 { + } else if yyct3646 == codecSelferValueTypeArray1234 { + yyl3646 := r.ReadArrayStart() + if yyl3646 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3497, d) + x.codecDecodeSelfFromArray(yyl3646, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43367,12 +45486,12 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3498Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3498Slc - var yyhl3498 bool = l >= 0 - for yyj3498 := 0; ; yyj3498++ { - if yyhl3498 { - if yyj3498 >= l { + var yys3647Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3647Slc + var yyhl3647 bool = l >= 0 + for yyj3647 := 0; ; yyj3647++ { + if yyhl3647 { + if yyj3647 >= l { break } } else { @@ -43381,10 +45500,35 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3498Slc = r.DecodeBytes(yys3498Slc, true, true) - yys3498 := string(yys3498Slc) + yys3647Slc = r.DecodeBytes(yys3647Slc, true, true) + yys3647 := string(yys3647Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3498 { + switch yys3647 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3648 := &x.ListMeta + yym3649 := z.DecBinary() + _ = yym3649 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3648) { + } else { + z.DecFallback(yyv3648, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3650 := &x.Items + yym3651 := z.DecBinary() + _ = yym3651 + if false { + } else { + h.decSliceConfigMap((*[]ConfigMap)(yyv3650), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -43397,35 +45541,10 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3501 := &x.ListMeta - yym3502 := z.DecBinary() - _ = yym3502 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3501) { - } else { - z.DecFallback(yyv3501, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3503 := &x.Items - yym3504 := z.DecBinary() - _ = yym3504 - if false { - } else { - h.decSliceConfigMap((*[]ConfigMap)(yyv3503), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3498) - } // end switch yys3498 - } // end for yyj3498 + z.DecStructFieldNotFound(-1, yys3647) + } // end switch yys3647 + } // end for yyj3647 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43433,16 +45552,61 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3505 int - var yyb3505 bool - var yyhl3505 bool = l >= 0 - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + var yyj3654 int + var yyb3654 bool + var yyhl3654 bool = l >= 0 + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3655 := &x.ListMeta + yym3656 := z.DecBinary() + _ = yym3656 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3655) { + } else { + z.DecFallback(yyv3655, false) + } + } + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l + } else { + yyb3654 = r.CheckBreak() + } + if yyb3654 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3657 := &x.Items + yym3658 := z.DecBinary() + _ = yym3658 + if false { + } else { + h.decSliceConfigMap((*[]ConfigMap)(yyv3657), d) + } + } + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l + } else { + yyb3654 = r.CheckBreak() + } + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43452,13 +45616,13 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43468,63 +45632,18 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l - } else { - yyb3505 = r.CheckBreak() - } - if yyb3505 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3508 := &x.ListMeta - yym3509 := z.DecBinary() - _ = yym3509 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3508) { - } else { - z.DecFallback(yyv3508, false) - } - } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l - } else { - yyb3505 = r.CheckBreak() - } - if yyb3505 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3510 := &x.Items - yym3511 := z.DecBinary() - _ = yym3511 - if false { - } else { - h.decSliceConfigMap((*[]ConfigMap)(yyv3510), d) - } - } for { - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3505-1, "") + z.DecStructFieldNotFound(yyj3654-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43533,8 +45652,8 @@ func (x PatchType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym3512 := z.EncBinary() - _ = yym3512 + yym3661 := z.EncBinary() + _ = yym3661 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -43546,8 +45665,8 @@ func (x *PatchType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3513 := z.DecBinary() - _ = yym3513 + yym3662 := z.DecBinary() + _ = yym3662 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -43559,8 +45678,8 @@ func (x ComponentConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym3514 := z.EncBinary() - _ = yym3514 + yym3663 := z.EncBinary() + _ = yym3663 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -43572,8 +45691,8 @@ func (x *ComponentConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3515 := z.DecBinary() - _ = yym3515 + yym3664 := z.DecBinary() + _ = yym3664 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -43588,32 +45707,32 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3516 := z.EncBinary() - _ = yym3516 + yym3665 := z.EncBinary() + _ = yym3665 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3517 := !z.EncBinary() - yy2arr3517 := z.EncBasicHandle().StructToArray - var yyq3517 [4]bool - _, _, _ = yysep3517, yyq3517, yy2arr3517 - const yyr3517 bool = false - yyq3517[2] = x.Message != "" - yyq3517[3] = x.Error != "" - var yynn3517 int - if yyr3517 || yy2arr3517 { + yysep3666 := !z.EncBinary() + yy2arr3666 := z.EncBasicHandle().StructToArray + var yyq3666 [4]bool + _, _, _ = yysep3666, yyq3666, yy2arr3666 + const yyr3666 bool = false + yyq3666[2] = x.Message != "" + yyq3666[3] = x.Error != "" + var yynn3666 int + if yyr3666 || yy2arr3666 { r.EncodeArrayStart(4) } else { - yynn3517 = 2 - for _, b := range yyq3517 { + yynn3666 = 2 + for _, b := range yyq3666 { if b { - yynn3517++ + yynn3666++ } } - r.EncodeMapStart(yynn3517) - yynn3517 = 0 + r.EncodeMapStart(yynn3666) + yynn3666 = 0 } - if yyr3517 || yy2arr3517 { + if yyr3666 || yy2arr3666 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -43622,7 +45741,7 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr3517 || yy2arr3517 { + if yyr3666 || yy2arr3666 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -43631,11 +45750,11 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr3517 || yy2arr3517 { + if yyr3666 || yy2arr3666 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3517[2] { - yym3521 := z.EncBinary() - _ = yym3521 + if yyq3666[2] { + yym3670 := z.EncBinary() + _ = yym3670 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -43644,23 +45763,23 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3517[2] { + if yyq3666[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3522 := z.EncBinary() - _ = yym3522 + yym3671 := z.EncBinary() + _ = yym3671 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr3517 || yy2arr3517 { + if yyr3666 || yy2arr3666 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3517[3] { - yym3524 := z.EncBinary() - _ = yym3524 + if yyq3666[3] { + yym3673 := z.EncBinary() + _ = yym3673 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Error)) @@ -43669,19 +45788,19 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3517[3] { + if yyq3666[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("error")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3525 := z.EncBinary() - _ = yym3525 + yym3674 := z.EncBinary() + _ = yym3674 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Error)) } } } - if yyr3517 || yy2arr3517 { + if yyr3666 || yy2arr3666 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -43694,25 +45813,25 @@ func (x *ComponentCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3526 := z.DecBinary() - _ = yym3526 + yym3675 := z.DecBinary() + _ = yym3675 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3527 := r.ContainerType() - if yyct3527 == codecSelferValueTypeMap1234 { - yyl3527 := r.ReadMapStart() - if yyl3527 == 0 { + yyct3676 := r.ContainerType() + if yyct3676 == codecSelferValueTypeMap1234 { + yyl3676 := r.ReadMapStart() + if yyl3676 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3527, d) + x.codecDecodeSelfFromMap(yyl3676, d) } - } else if yyct3527 == codecSelferValueTypeArray1234 { - yyl3527 := r.ReadArrayStart() - if yyl3527 == 0 { + } else if yyct3676 == codecSelferValueTypeArray1234 { + yyl3676 := r.ReadArrayStart() + if yyl3676 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3527, d) + x.codecDecodeSelfFromArray(yyl3676, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43724,12 +45843,12 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3528Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3528Slc - var yyhl3528 bool = l >= 0 - for yyj3528 := 0; ; yyj3528++ { - if yyhl3528 { - if yyj3528 >= l { + var yys3677Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3677Slc + var yyhl3677 bool = l >= 0 + for yyj3677 := 0; ; yyj3677++ { + if yyhl3677 { + if yyj3677 >= l { break } } else { @@ -43738,10 +45857,10 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3528Slc = r.DecodeBytes(yys3528Slc, true, true) - yys3528 := string(yys3528Slc) + yys3677Slc = r.DecodeBytes(yys3677Slc, true, true) + yys3677 := string(yys3677Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3528 { + switch yys3677 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -43767,9 +45886,9 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.Error = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3528) - } // end switch yys3528 - } // end for yyj3528 + z.DecStructFieldNotFound(-1, yys3677) + } // end switch yys3677 + } // end for yyj3677 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43777,16 +45896,16 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3533 int - var yyb3533 bool - var yyhl3533 bool = l >= 0 - yyj3533++ - if yyhl3533 { - yyb3533 = yyj3533 > l + var yyj3682 int + var yyb3682 bool + var yyhl3682 bool = l >= 0 + yyj3682++ + if yyhl3682 { + yyb3682 = yyj3682 > l } else { - yyb3533 = r.CheckBreak() + yyb3682 = r.CheckBreak() } - if yyb3533 { + if yyb3682 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43796,13 +45915,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Type = ComponentConditionType(r.DecodeString()) } - yyj3533++ - if yyhl3533 { - yyb3533 = yyj3533 > l + yyj3682++ + if yyhl3682 { + yyb3682 = yyj3682 > l } else { - yyb3533 = r.CheckBreak() + yyb3682 = r.CheckBreak() } - if yyb3533 { + if yyb3682 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43812,13 +45931,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj3533++ - if yyhl3533 { - yyb3533 = yyj3533 > l + yyj3682++ + if yyhl3682 { + yyb3682 = yyj3682 > l } else { - yyb3533 = r.CheckBreak() + yyb3682 = r.CheckBreak() } - if yyb3533 { + if yyb3682 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43828,13 +45947,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Message = string(r.DecodeString()) } - yyj3533++ - if yyhl3533 { - yyb3533 = yyj3533 > l + yyj3682++ + if yyhl3682 { + yyb3682 = yyj3682 > l } else { - yyb3533 = r.CheckBreak() + yyb3682 = r.CheckBreak() } - if yyb3533 { + if yyb3682 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43845,17 +45964,17 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.Error = string(r.DecodeString()) } for { - yyj3533++ - if yyhl3533 { - yyb3533 = yyj3533 > l + yyj3682++ + if yyhl3682 { + yyb3682 = yyj3682 > l } else { - yyb3533 = r.CheckBreak() + yyb3682 = r.CheckBreak() } - if yyb3533 { + if yyb3682 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3533-1, "") + z.DecStructFieldNotFound(yyj3682-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43867,108 +45986,58 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3538 := z.EncBinary() - _ = yym3538 + yym3687 := z.EncBinary() + _ = yym3687 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3539 := !z.EncBinary() - yy2arr3539 := z.EncBasicHandle().StructToArray - var yyq3539 [4]bool - _, _, _ = yysep3539, yyq3539, yy2arr3539 - const yyr3539 bool = false - yyq3539[0] = x.Kind != "" - yyq3539[1] = x.APIVersion != "" - yyq3539[2] = true - yyq3539[3] = len(x.Conditions) != 0 - var yynn3539 int - if yyr3539 || yy2arr3539 { + yysep3688 := !z.EncBinary() + yy2arr3688 := z.EncBasicHandle().StructToArray + var yyq3688 [4]bool + _, _, _ = yysep3688, yyq3688, yy2arr3688 + const yyr3688 bool = false + yyq3688[0] = true + yyq3688[1] = len(x.Conditions) != 0 + yyq3688[2] = x.Kind != "" + yyq3688[3] = x.APIVersion != "" + var yynn3688 int + if yyr3688 || yy2arr3688 { r.EncodeArrayStart(4) } else { - yynn3539 = 0 - for _, b := range yyq3539 { + yynn3688 = 0 + for _, b := range yyq3688 { if b { - yynn3539++ + yynn3688++ } } - r.EncodeMapStart(yynn3539) - yynn3539 = 0 + r.EncodeMapStart(yynn3688) + yynn3688 = 0 } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[0] { - yym3541 := z.EncBinary() - _ = yym3541 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3539[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3542 := z.EncBinary() - _ = yym3542 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3539 || yy2arr3539 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[1] { - yym3544 := z.EncBinary() - _ = yym3544 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3539[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3545 := z.EncBinary() - _ = yym3545 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3539 || yy2arr3539 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[2] { - yy3547 := &x.ObjectMeta - yy3547.CodecEncodeSelf(e) + if yyq3688[0] { + yy3690 := &x.ObjectMeta + yy3690.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3539[2] { + if yyq3688[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3548 := &x.ObjectMeta - yy3548.CodecEncodeSelf(e) + yy3691 := &x.ObjectMeta + yy3691.CodecEncodeSelf(e) } } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[3] { + if yyq3688[1] { if x.Conditions == nil { r.EncodeNil() } else { - yym3550 := z.EncBinary() - _ = yym3550 + yym3693 := z.EncBinary() + _ = yym3693 if false { } else { h.encSliceComponentCondition(([]ComponentCondition)(x.Conditions), e) @@ -43978,15 +46047,15 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3539[3] { + if yyq3688[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym3551 := z.EncBinary() - _ = yym3551 + yym3694 := z.EncBinary() + _ = yym3694 if false { } else { h.encSliceComponentCondition(([]ComponentCondition)(x.Conditions), e) @@ -43994,7 +46063,57 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3688[2] { + yym3696 := z.EncBinary() + _ = yym3696 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3688[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3697 := z.EncBinary() + _ = yym3697 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3688 || yy2arr3688 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3688[3] { + yym3699 := z.EncBinary() + _ = yym3699 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3688[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3700 := z.EncBinary() + _ = yym3700 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44007,25 +46126,25 @@ func (x *ComponentStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3552 := z.DecBinary() - _ = yym3552 + yym3701 := z.DecBinary() + _ = yym3701 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3553 := r.ContainerType() - if yyct3553 == codecSelferValueTypeMap1234 { - yyl3553 := r.ReadMapStart() - if yyl3553 == 0 { + yyct3702 := r.ContainerType() + if yyct3702 == codecSelferValueTypeMap1234 { + yyl3702 := r.ReadMapStart() + if yyl3702 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3553, d) + x.codecDecodeSelfFromMap(yyl3702, d) } - } else if yyct3553 == codecSelferValueTypeArray1234 { - yyl3553 := r.ReadArrayStart() - if yyl3553 == 0 { + } else if yyct3702 == codecSelferValueTypeArray1234 { + yyl3702 := r.ReadArrayStart() + if yyl3702 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3553, d) + x.codecDecodeSelfFromArray(yyl3702, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44037,12 +46156,12 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3554Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3554Slc - var yyhl3554 bool = l >= 0 - for yyj3554 := 0; ; yyj3554++ { - if yyhl3554 { - if yyj3554 >= l { + var yys3703Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3703Slc + var yyhl3703 bool = l >= 0 + for yyj3703 := 0; ; yyj3703++ { + if yyhl3703 { + if yyj3703 >= l { break } } else { @@ -44051,10 +46170,29 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3554Slc = r.DecodeBytes(yys3554Slc, true, true) - yys3554 := string(yys3554Slc) + yys3703Slc = r.DecodeBytes(yys3703Slc, true, true) + yys3703 := string(yys3703Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3554 { + switch yys3703 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3704 := &x.ObjectMeta + yyv3704.CodecDecodeSelf(d) + } + case "conditions": + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv3705 := &x.Conditions + yym3706 := z.DecBinary() + _ = yym3706 + if false { + } else { + h.decSliceComponentCondition((*[]ComponentCondition)(yyv3705), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -44067,29 +46205,10 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3557 := &x.ObjectMeta - yyv3557.CodecDecodeSelf(d) - } - case "conditions": - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv3558 := &x.Conditions - yym3559 := z.DecBinary() - _ = yym3559 - if false { - } else { - h.decSliceComponentCondition((*[]ComponentCondition)(yyv3558), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3554) - } // end switch yys3554 - } // end for yyj3554 + z.DecStructFieldNotFound(-1, yys3703) + } // end switch yys3703 + } // end for yyj3703 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44097,16 +46216,55 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3560 int - var yyb3560 bool - var yyhl3560 bool = l >= 0 - yyj3560++ - if yyhl3560 { - yyb3560 = yyj3560 > l + var yyj3709 int + var yyb3709 bool + var yyhl3709 bool = l >= 0 + yyj3709++ + if yyhl3709 { + yyb3709 = yyj3709 > l } else { - yyb3560 = r.CheckBreak() + yyb3709 = r.CheckBreak() } - if yyb3560 { + if yyb3709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3710 := &x.ObjectMeta + yyv3710.CodecDecodeSelf(d) + } + yyj3709++ + if yyhl3709 { + yyb3709 = yyj3709 > l + } else { + yyb3709 = r.CheckBreak() + } + if yyb3709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv3711 := &x.Conditions + yym3712 := z.DecBinary() + _ = yym3712 + if false { + } else { + h.decSliceComponentCondition((*[]ComponentCondition)(yyv3711), d) + } + } + yyj3709++ + if yyhl3709 { + yyb3709 = yyj3709 > l + } else { + yyb3709 = r.CheckBreak() + } + if yyb3709 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44116,13 +46274,13 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj3560++ - if yyhl3560 { - yyb3560 = yyj3560 > l + yyj3709++ + if yyhl3709 { + yyb3709 = yyj3709 > l } else { - yyb3560 = r.CheckBreak() + yyb3709 = r.CheckBreak() } - if yyb3560 { + if yyb3709 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44132,57 +46290,18 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj3560++ - if yyhl3560 { - yyb3560 = yyj3560 > l - } else { - yyb3560 = r.CheckBreak() - } - if yyb3560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3563 := &x.ObjectMeta - yyv3563.CodecDecodeSelf(d) - } - yyj3560++ - if yyhl3560 { - yyb3560 = yyj3560 > l - } else { - yyb3560 = r.CheckBreak() - } - if yyb3560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv3564 := &x.Conditions - yym3565 := z.DecBinary() - _ = yym3565 - if false { - } else { - h.decSliceComponentCondition((*[]ComponentCondition)(yyv3564), d) - } - } for { - yyj3560++ - if yyhl3560 { - yyb3560 = yyj3560 > l + yyj3709++ + if yyhl3709 { + yyb3709 = yyj3709 > l } else { - yyb3560 = r.CheckBreak() + yyb3709 = r.CheckBreak() } - if yyb3560 { + if yyb3709 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3560-1, "") + z.DecStructFieldNotFound(yyj3709-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -44194,118 +46313,68 @@ func (x *ComponentStatusList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3566 := z.EncBinary() - _ = yym3566 + yym3715 := z.EncBinary() + _ = yym3715 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3567 := !z.EncBinary() - yy2arr3567 := z.EncBasicHandle().StructToArray - var yyq3567 [4]bool - _, _, _ = yysep3567, yyq3567, yy2arr3567 - const yyr3567 bool = false - yyq3567[0] = x.Kind != "" - yyq3567[1] = x.APIVersion != "" - yyq3567[2] = true - var yynn3567 int - if yyr3567 || yy2arr3567 { + yysep3716 := !z.EncBinary() + yy2arr3716 := z.EncBasicHandle().StructToArray + var yyq3716 [4]bool + _, _, _ = yysep3716, yyq3716, yy2arr3716 + const yyr3716 bool = false + yyq3716[0] = true + yyq3716[2] = x.Kind != "" + yyq3716[3] = x.APIVersion != "" + var yynn3716 int + if yyr3716 || yy2arr3716 { r.EncodeArrayStart(4) } else { - yynn3567 = 1 - for _, b := range yyq3567 { + yynn3716 = 1 + for _, b := range yyq3716 { if b { - yynn3567++ + yynn3716++ } } - r.EncodeMapStart(yynn3567) - yynn3567 = 0 + r.EncodeMapStart(yynn3716) + yynn3716 = 0 } - if yyr3567 || yy2arr3567 { + if yyr3716 || yy2arr3716 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3567[0] { - yym3569 := z.EncBinary() - _ = yym3569 + if yyq3716[0] { + yy3718 := &x.ListMeta + yym3719 := z.EncBinary() + _ = yym3719 if false { + } else if z.HasExtensions() && z.EncExt(yy3718) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3567[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3570 := z.EncBinary() - _ = yym3570 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3567 || yy2arr3567 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3567[1] { - yym3572 := z.EncBinary() - _ = yym3572 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3567[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3573 := z.EncBinary() - _ = yym3573 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3567 || yy2arr3567 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3567[2] { - yy3575 := &x.ListMeta - yym3576 := z.EncBinary() - _ = yym3576 - if false { - } else if z.HasExtensions() && z.EncExt(yy3575) { - } else { - z.EncFallback(yy3575) + z.EncFallback(yy3718) } } else { r.EncodeNil() } } else { - if yyq3567[2] { + if yyq3716[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3577 := &x.ListMeta - yym3578 := z.EncBinary() - _ = yym3578 + yy3720 := &x.ListMeta + yym3721 := z.EncBinary() + _ = yym3721 if false { - } else if z.HasExtensions() && z.EncExt(yy3577) { + } else if z.HasExtensions() && z.EncExt(yy3720) { } else { - z.EncFallback(yy3577) + z.EncFallback(yy3720) } } } - if yyr3567 || yy2arr3567 { + if yyr3716 || yy2arr3716 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3580 := z.EncBinary() - _ = yym3580 + yym3723 := z.EncBinary() + _ = yym3723 if false { } else { h.encSliceComponentStatus(([]ComponentStatus)(x.Items), e) @@ -44318,15 +46387,65 @@ func (x *ComponentStatusList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3581 := z.EncBinary() - _ = yym3581 + yym3724 := z.EncBinary() + _ = yym3724 if false { } else { h.encSliceComponentStatus(([]ComponentStatus)(x.Items), e) } } } - if yyr3567 || yy2arr3567 { + if yyr3716 || yy2arr3716 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3716[2] { + yym3726 := z.EncBinary() + _ = yym3726 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3716[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3727 := z.EncBinary() + _ = yym3727 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3716 || yy2arr3716 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3716[3] { + yym3729 := z.EncBinary() + _ = yym3729 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3716[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3730 := z.EncBinary() + _ = yym3730 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3716 || yy2arr3716 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44339,25 +46458,25 @@ func (x *ComponentStatusList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3582 := z.DecBinary() - _ = yym3582 + yym3731 := z.DecBinary() + _ = yym3731 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3583 := r.ContainerType() - if yyct3583 == codecSelferValueTypeMap1234 { - yyl3583 := r.ReadMapStart() - if yyl3583 == 0 { + yyct3732 := r.ContainerType() + if yyct3732 == codecSelferValueTypeMap1234 { + yyl3732 := r.ReadMapStart() + if yyl3732 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3583, d) + x.codecDecodeSelfFromMap(yyl3732, d) } - } else if yyct3583 == codecSelferValueTypeArray1234 { - yyl3583 := r.ReadArrayStart() - if yyl3583 == 0 { + } else if yyct3732 == codecSelferValueTypeArray1234 { + yyl3732 := r.ReadArrayStart() + if yyl3732 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3583, d) + x.codecDecodeSelfFromArray(yyl3732, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44369,12 +46488,12 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3584Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3584Slc - var yyhl3584 bool = l >= 0 - for yyj3584 := 0; ; yyj3584++ { - if yyhl3584 { - if yyj3584 >= l { + var yys3733Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3733Slc + var yyhl3733 bool = l >= 0 + for yyj3733 := 0; ; yyj3733++ { + if yyhl3733 { + if yyj3733 >= l { break } } else { @@ -44383,10 +46502,35 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3584Slc = r.DecodeBytes(yys3584Slc, true, true) - yys3584 := string(yys3584Slc) + yys3733Slc = r.DecodeBytes(yys3733Slc, true, true) + yys3733 := string(yys3733Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3584 { + switch yys3733 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3734 := &x.ListMeta + yym3735 := z.DecBinary() + _ = yym3735 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3734) { + } else { + z.DecFallback(yyv3734, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3736 := &x.Items + yym3737 := z.DecBinary() + _ = yym3737 + if false { + } else { + h.decSliceComponentStatus((*[]ComponentStatus)(yyv3736), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -44399,35 +46543,10 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3587 := &x.ListMeta - yym3588 := z.DecBinary() - _ = yym3588 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3587) { - } else { - z.DecFallback(yyv3587, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3589 := &x.Items - yym3590 := z.DecBinary() - _ = yym3590 - if false { - } else { - h.decSliceComponentStatus((*[]ComponentStatus)(yyv3589), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3584) - } // end switch yys3584 - } // end for yyj3584 + z.DecStructFieldNotFound(-1, yys3733) + } // end switch yys3733 + } // end for yyj3733 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44435,16 +46554,61 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3591 int - var yyb3591 bool - var yyhl3591 bool = l >= 0 - yyj3591++ - if yyhl3591 { - yyb3591 = yyj3591 > l + var yyj3740 int + var yyb3740 bool + var yyhl3740 bool = l >= 0 + yyj3740++ + if yyhl3740 { + yyb3740 = yyj3740 > l } else { - yyb3591 = r.CheckBreak() + yyb3740 = r.CheckBreak() } - if yyb3591 { + if yyb3740 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3741 := &x.ListMeta + yym3742 := z.DecBinary() + _ = yym3742 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3741) { + } else { + z.DecFallback(yyv3741, false) + } + } + yyj3740++ + if yyhl3740 { + yyb3740 = yyj3740 > l + } else { + yyb3740 = r.CheckBreak() + } + if yyb3740 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3743 := &x.Items + yym3744 := z.DecBinary() + _ = yym3744 + if false { + } else { + h.decSliceComponentStatus((*[]ComponentStatus)(yyv3743), d) + } + } + yyj3740++ + if yyhl3740 { + yyb3740 = yyj3740 > l + } else { + yyb3740 = r.CheckBreak() + } + if yyb3740 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44454,13 +46618,13 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj3591++ - if yyhl3591 { - yyb3591 = yyj3591 > l + yyj3740++ + if yyhl3740 { + yyb3740 = yyj3740 > l } else { - yyb3591 = r.CheckBreak() + yyb3740 = r.CheckBreak() } - if yyb3591 { + if yyb3740 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44470,63 +46634,18 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj3591++ - if yyhl3591 { - yyb3591 = yyj3591 > l - } else { - yyb3591 = r.CheckBreak() - } - if yyb3591 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3594 := &x.ListMeta - yym3595 := z.DecBinary() - _ = yym3595 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3594) { - } else { - z.DecFallback(yyv3594, false) - } - } - yyj3591++ - if yyhl3591 { - yyb3591 = yyj3591 > l - } else { - yyb3591 = r.CheckBreak() - } - if yyb3591 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3596 := &x.Items - yym3597 := z.DecBinary() - _ = yym3597 - if false { - } else { - h.decSliceComponentStatus((*[]ComponentStatus)(yyv3596), d) - } - } for { - yyj3591++ - if yyhl3591 { - yyb3591 = yyj3591 > l + yyj3740++ + if yyhl3740 { + yyb3740 = yyj3740 > l } else { - yyb3591 = r.CheckBreak() + yyb3740 = r.CheckBreak() } - if yyb3591 { + if yyb3740 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3591-1, "") + z.DecStructFieldNotFound(yyj3740-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -44538,37 +46657,37 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3598 := z.EncBinary() - _ = yym3598 + yym3747 := z.EncBinary() + _ = yym3747 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3599 := !z.EncBinary() - yy2arr3599 := z.EncBasicHandle().StructToArray - var yyq3599 [5]bool - _, _, _ = yysep3599, yyq3599, yy2arr3599 - const yyr3599 bool = false - yyq3599[0] = x.Capabilities != nil - yyq3599[1] = x.Privileged != nil - yyq3599[2] = x.SELinuxOptions != nil - yyq3599[3] = x.RunAsUser != nil - yyq3599[4] = x.RunAsNonRoot != nil - var yynn3599 int - if yyr3599 || yy2arr3599 { + yysep3748 := !z.EncBinary() + yy2arr3748 := z.EncBasicHandle().StructToArray + var yyq3748 [5]bool + _, _, _ = yysep3748, yyq3748, yy2arr3748 + const yyr3748 bool = false + yyq3748[0] = x.Capabilities != nil + yyq3748[1] = x.Privileged != nil + yyq3748[2] = x.SELinuxOptions != nil + yyq3748[3] = x.RunAsUser != nil + yyq3748[4] = x.RunAsNonRoot != nil + var yynn3748 int + if yyr3748 || yy2arr3748 { r.EncodeArrayStart(5) } else { - yynn3599 = 0 - for _, b := range yyq3599 { + yynn3748 = 0 + for _, b := range yyq3748 { if b { - yynn3599++ + yynn3748++ } } - r.EncodeMapStart(yynn3599) - yynn3599 = 0 + r.EncodeMapStart(yynn3748) + yynn3748 = 0 } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3599[0] { + if yyq3748[0] { if x.Capabilities == nil { r.EncodeNil() } else { @@ -44578,7 +46697,7 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3599[0] { + if yyq3748[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capabilities")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -44589,44 +46708,44 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3599[1] { + if yyq3748[1] { if x.Privileged == nil { r.EncodeNil() } else { - yy3602 := *x.Privileged - yym3603 := z.EncBinary() - _ = yym3603 + yy3751 := *x.Privileged + yym3752 := z.EncBinary() + _ = yym3752 if false { } else { - r.EncodeBool(bool(yy3602)) + r.EncodeBool(bool(yy3751)) } } } else { r.EncodeNil() } } else { - if yyq3599[1] { + if yyq3748[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("privileged")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Privileged == nil { r.EncodeNil() } else { - yy3604 := *x.Privileged - yym3605 := z.EncBinary() - _ = yym3605 + yy3753 := *x.Privileged + yym3754 := z.EncBinary() + _ = yym3754 if false { } else { - r.EncodeBool(bool(yy3604)) + r.EncodeBool(bool(yy3753)) } } } } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3599[2] { + if yyq3748[2] { if x.SELinuxOptions == nil { r.EncodeNil() } else { @@ -44636,7 +46755,7 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3599[2] { + if yyq3748[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -44647,77 +46766,77 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3599[3] { + if yyq3748[3] { if x.RunAsUser == nil { r.EncodeNil() } else { - yy3608 := *x.RunAsUser - yym3609 := z.EncBinary() - _ = yym3609 + yy3757 := *x.RunAsUser + yym3758 := z.EncBinary() + _ = yym3758 if false { } else { - r.EncodeInt(int64(yy3608)) + r.EncodeInt(int64(yy3757)) } } } else { r.EncodeNil() } } else { - if yyq3599[3] { + if yyq3748[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsUser == nil { r.EncodeNil() } else { - yy3610 := *x.RunAsUser - yym3611 := z.EncBinary() - _ = yym3611 + yy3759 := *x.RunAsUser + yym3760 := z.EncBinary() + _ = yym3760 if false { } else { - r.EncodeInt(int64(yy3610)) + r.EncodeInt(int64(yy3759)) } } } } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3599[4] { + if yyq3748[4] { if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy3613 := *x.RunAsNonRoot - yym3614 := z.EncBinary() - _ = yym3614 + yy3762 := *x.RunAsNonRoot + yym3763 := z.EncBinary() + _ = yym3763 if false { } else { - r.EncodeBool(bool(yy3613)) + r.EncodeBool(bool(yy3762)) } } } else { r.EncodeNil() } } else { - if yyq3599[4] { + if yyq3748[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsNonRoot")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy3615 := *x.RunAsNonRoot - yym3616 := z.EncBinary() - _ = yym3616 + yy3764 := *x.RunAsNonRoot + yym3765 := z.EncBinary() + _ = yym3765 if false { } else { - r.EncodeBool(bool(yy3615)) + r.EncodeBool(bool(yy3764)) } } } } - if yyr3599 || yy2arr3599 { + if yyr3748 || yy2arr3748 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44730,25 +46849,25 @@ func (x *SecurityContext) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3617 := z.DecBinary() - _ = yym3617 + yym3766 := z.DecBinary() + _ = yym3766 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3618 := r.ContainerType() - if yyct3618 == codecSelferValueTypeMap1234 { - yyl3618 := r.ReadMapStart() - if yyl3618 == 0 { + yyct3767 := r.ContainerType() + if yyct3767 == codecSelferValueTypeMap1234 { + yyl3767 := r.ReadMapStart() + if yyl3767 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3618, d) + x.codecDecodeSelfFromMap(yyl3767, d) } - } else if yyct3618 == codecSelferValueTypeArray1234 { - yyl3618 := r.ReadArrayStart() - if yyl3618 == 0 { + } else if yyct3767 == codecSelferValueTypeArray1234 { + yyl3767 := r.ReadArrayStart() + if yyl3767 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3618, d) + x.codecDecodeSelfFromArray(yyl3767, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44760,12 +46879,12 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3619Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3619Slc - var yyhl3619 bool = l >= 0 - for yyj3619 := 0; ; yyj3619++ { - if yyhl3619 { - if yyj3619 >= l { + var yys3768Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3768Slc + var yyhl3768 bool = l >= 0 + for yyj3768 := 0; ; yyj3768++ { + if yyhl3768 { + if yyj3768 >= l { break } } else { @@ -44774,10 +46893,10 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3619Slc = r.DecodeBytes(yys3619Slc, true, true) - yys3619 := string(yys3619Slc) + yys3768Slc = r.DecodeBytes(yys3768Slc, true, true) + yys3768 := string(yys3768Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3619 { + switch yys3768 { case "capabilities": if r.TryDecodeAsNil() { if x.Capabilities != nil { @@ -44798,8 +46917,8 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Privileged == nil { x.Privileged = new(bool) } - yym3622 := z.DecBinary() - _ = yym3622 + yym3771 := z.DecBinary() + _ = yym3771 if false { } else { *((*bool)(x.Privileged)) = r.DecodeBool() @@ -44825,8 +46944,8 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym3625 := z.DecBinary() - _ = yym3625 + yym3774 := z.DecBinary() + _ = yym3774 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) @@ -44841,17 +46960,17 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym3627 := z.DecBinary() - _ = yym3627 + yym3776 := z.DecBinary() + _ = yym3776 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } default: - z.DecStructFieldNotFound(-1, yys3619) - } // end switch yys3619 - } // end for yyj3619 + z.DecStructFieldNotFound(-1, yys3768) + } // end switch yys3768 + } // end for yyj3768 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44859,16 +46978,16 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3628 int - var yyb3628 bool - var yyhl3628 bool = l >= 0 - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + var yyj3777 int + var yyb3777 bool + var yyhl3777 bool = l >= 0 + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44883,13 +47002,13 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.Capabilities.CodecDecodeSelf(d) } - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44902,20 +47021,20 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.Privileged == nil { x.Privileged = new(bool) } - yym3631 := z.DecBinary() - _ = yym3631 + yym3780 := z.DecBinary() + _ = yym3780 if false { } else { *((*bool)(x.Privileged)) = r.DecodeBool() } } - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44930,13 +47049,13 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SELinuxOptions.CodecDecodeSelf(d) } - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44949,20 +47068,20 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym3634 := z.DecBinary() - _ = yym3634 + yym3783 := z.DecBinary() + _ = yym3783 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) } } - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44975,25 +47094,25 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym3636 := z.DecBinary() - _ = yym3636 + yym3785 := z.DecBinary() + _ = yym3785 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } for { - yyj3628++ - if yyhl3628 { - yyb3628 = yyj3628 > l + yyj3777++ + if yyhl3777 { + yyb3777 = yyj3777 > l } else { - yyb3628 = r.CheckBreak() + yyb3777 = r.CheckBreak() } - if yyb3628 { + if yyb3777 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3628-1, "") + z.DecStructFieldNotFound(yyj3777-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45005,38 +47124,38 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3637 := z.EncBinary() - _ = yym3637 + yym3786 := z.EncBinary() + _ = yym3786 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3638 := !z.EncBinary() - yy2arr3638 := z.EncBasicHandle().StructToArray - var yyq3638 [4]bool - _, _, _ = yysep3638, yyq3638, yy2arr3638 - const yyr3638 bool = false - yyq3638[0] = x.User != "" - yyq3638[1] = x.Role != "" - yyq3638[2] = x.Type != "" - yyq3638[3] = x.Level != "" - var yynn3638 int - if yyr3638 || yy2arr3638 { + yysep3787 := !z.EncBinary() + yy2arr3787 := z.EncBasicHandle().StructToArray + var yyq3787 [4]bool + _, _, _ = yysep3787, yyq3787, yy2arr3787 + const yyr3787 bool = false + yyq3787[0] = x.User != "" + yyq3787[1] = x.Role != "" + yyq3787[2] = x.Type != "" + yyq3787[3] = x.Level != "" + var yynn3787 int + if yyr3787 || yy2arr3787 { r.EncodeArrayStart(4) } else { - yynn3638 = 0 - for _, b := range yyq3638 { + yynn3787 = 0 + for _, b := range yyq3787 { if b { - yynn3638++ + yynn3787++ } } - r.EncodeMapStart(yynn3638) - yynn3638 = 0 + r.EncodeMapStart(yynn3787) + yynn3787 = 0 } - if yyr3638 || yy2arr3638 { + if yyr3787 || yy2arr3787 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3638[0] { - yym3640 := z.EncBinary() - _ = yym3640 + if yyq3787[0] { + yym3789 := z.EncBinary() + _ = yym3789 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) @@ -45045,23 +47164,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3638[0] { + if yyq3787[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3641 := z.EncBinary() - _ = yym3641 + yym3790 := z.EncBinary() + _ = yym3790 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) } } } - if yyr3638 || yy2arr3638 { + if yyr3787 || yy2arr3787 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3638[1] { - yym3643 := z.EncBinary() - _ = yym3643 + if yyq3787[1] { + yym3792 := z.EncBinary() + _ = yym3792 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Role)) @@ -45070,23 +47189,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3638[1] { + if yyq3787[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("role")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3644 := z.EncBinary() - _ = yym3644 + yym3793 := z.EncBinary() + _ = yym3793 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Role)) } } } - if yyr3638 || yy2arr3638 { + if yyr3787 || yy2arr3787 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3638[2] { - yym3646 := z.EncBinary() - _ = yym3646 + if yyq3787[2] { + yym3795 := z.EncBinary() + _ = yym3795 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) @@ -45095,23 +47214,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3638[2] { + if yyq3787[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3647 := z.EncBinary() - _ = yym3647 + yym3796 := z.EncBinary() + _ = yym3796 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) } } } - if yyr3638 || yy2arr3638 { + if yyr3787 || yy2arr3787 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3638[3] { - yym3649 := z.EncBinary() - _ = yym3649 + if yyq3787[3] { + yym3798 := z.EncBinary() + _ = yym3798 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Level)) @@ -45120,19 +47239,19 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3638[3] { + if yyq3787[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("level")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3650 := z.EncBinary() - _ = yym3650 + yym3799 := z.EncBinary() + _ = yym3799 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Level)) } } } - if yyr3638 || yy2arr3638 { + if yyr3787 || yy2arr3787 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -45145,25 +47264,25 @@ func (x *SELinuxOptions) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3651 := z.DecBinary() - _ = yym3651 + yym3800 := z.DecBinary() + _ = yym3800 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3652 := r.ContainerType() - if yyct3652 == codecSelferValueTypeMap1234 { - yyl3652 := r.ReadMapStart() - if yyl3652 == 0 { + yyct3801 := r.ContainerType() + if yyct3801 == codecSelferValueTypeMap1234 { + yyl3801 := r.ReadMapStart() + if yyl3801 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3652, d) + x.codecDecodeSelfFromMap(yyl3801, d) } - } else if yyct3652 == codecSelferValueTypeArray1234 { - yyl3652 := r.ReadArrayStart() - if yyl3652 == 0 { + } else if yyct3801 == codecSelferValueTypeArray1234 { + yyl3801 := r.ReadArrayStart() + if yyl3801 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3652, d) + x.codecDecodeSelfFromArray(yyl3801, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -45175,12 +47294,12 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3653Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3653Slc - var yyhl3653 bool = l >= 0 - for yyj3653 := 0; ; yyj3653++ { - if yyhl3653 { - if yyj3653 >= l { + var yys3802Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3802Slc + var yyhl3802 bool = l >= 0 + for yyj3802 := 0; ; yyj3802++ { + if yyhl3802 { + if yyj3802 >= l { break } } else { @@ -45189,10 +47308,10 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3653Slc = r.DecodeBytes(yys3653Slc, true, true) - yys3653 := string(yys3653Slc) + yys3802Slc = r.DecodeBytes(yys3802Slc, true, true) + yys3802 := string(yys3802Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3653 { + switch yys3802 { case "user": if r.TryDecodeAsNil() { x.User = "" @@ -45218,9 +47337,9 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Level = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3653) - } // end switch yys3653 - } // end for yyj3653 + z.DecStructFieldNotFound(-1, yys3802) + } // end switch yys3802 + } // end for yyj3802 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -45228,16 +47347,16 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3658 int - var yyb3658 bool - var yyhl3658 bool = l >= 0 - yyj3658++ - if yyhl3658 { - yyb3658 = yyj3658 > l + var yyj3807 int + var yyb3807 bool + var yyhl3807 bool = l >= 0 + yyj3807++ + if yyhl3807 { + yyb3807 = yyj3807 > l } else { - yyb3658 = r.CheckBreak() + yyb3807 = r.CheckBreak() } - if yyb3658 { + if yyb3807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45247,13 +47366,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.User = string(r.DecodeString()) } - yyj3658++ - if yyhl3658 { - yyb3658 = yyj3658 > l + yyj3807++ + if yyhl3807 { + yyb3807 = yyj3807 > l } else { - yyb3658 = r.CheckBreak() + yyb3807 = r.CheckBreak() } - if yyb3658 { + if yyb3807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45263,13 +47382,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Role = string(r.DecodeString()) } - yyj3658++ - if yyhl3658 { - yyb3658 = yyj3658 > l + yyj3807++ + if yyhl3807 { + yyb3807 = yyj3807 > l } else { - yyb3658 = r.CheckBreak() + yyb3807 = r.CheckBreak() } - if yyb3658 { + if yyb3807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45279,13 +47398,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } - yyj3658++ - if yyhl3658 { - yyb3658 = yyj3658 > l + yyj3807++ + if yyhl3807 { + yyb3807 = yyj3807 > l } else { - yyb3658 = r.CheckBreak() + yyb3807 = r.CheckBreak() } - if yyb3658 { + if yyb3807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45296,17 +47415,17 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Level = string(r.DecodeString()) } for { - yyj3658++ - if yyhl3658 { - yyb3658 = yyj3658 > l + yyj3807++ + if yyhl3807 { + yyb3807 = yyj3807 > l } else { - yyb3658 = r.CheckBreak() + yyb3807 = r.CheckBreak() } - if yyb3658 { + if yyb3807 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3658-1, "") + z.DecStructFieldNotFound(yyj3807-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45318,103 +47437,53 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3663 := z.EncBinary() - _ = yym3663 + yym3812 := z.EncBinary() + _ = yym3812 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3664 := !z.EncBinary() - yy2arr3664 := z.EncBasicHandle().StructToArray - var yyq3664 [5]bool - _, _, _ = yysep3664, yyq3664, yy2arr3664 - const yyr3664 bool = false - yyq3664[0] = x.Kind != "" - yyq3664[1] = x.APIVersion != "" - yyq3664[2] = true - var yynn3664 int - if yyr3664 || yy2arr3664 { + yysep3813 := !z.EncBinary() + yy2arr3813 := z.EncBasicHandle().StructToArray + var yyq3813 [5]bool + _, _, _ = yysep3813, yyq3813, yy2arr3813 + const yyr3813 bool = false + yyq3813[0] = true + yyq3813[3] = x.Kind != "" + yyq3813[4] = x.APIVersion != "" + var yynn3813 int + if yyr3813 || yy2arr3813 { r.EncodeArrayStart(5) } else { - yynn3664 = 2 - for _, b := range yyq3664 { + yynn3813 = 2 + for _, b := range yyq3813 { if b { - yynn3664++ + yynn3813++ } } - r.EncodeMapStart(yynn3664) - yynn3664 = 0 + r.EncodeMapStart(yynn3813) + yynn3813 = 0 } - if yyr3664 || yy2arr3664 { + if yyr3813 || yy2arr3813 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3664[0] { - yym3666 := z.EncBinary() - _ = yym3666 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3664[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3667 := z.EncBinary() - _ = yym3667 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3664 || yy2arr3664 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3664[1] { - yym3669 := z.EncBinary() - _ = yym3669 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3664[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3670 := z.EncBinary() - _ = yym3670 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3664 || yy2arr3664 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3664[2] { - yy3672 := &x.ObjectMeta - yy3672.CodecEncodeSelf(e) + if yyq3813[0] { + yy3815 := &x.ObjectMeta + yy3815.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3664[2] { + if yyq3813[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3673 := &x.ObjectMeta - yy3673.CodecEncodeSelf(e) + yy3816 := &x.ObjectMeta + yy3816.CodecEncodeSelf(e) } } - if yyr3664 || yy2arr3664 { + if yyr3813 || yy2arr3813 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym3675 := z.EncBinary() - _ = yym3675 + yym3818 := z.EncBinary() + _ = yym3818 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Range)) @@ -45423,20 +47492,20 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("range")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3676 := z.EncBinary() - _ = yym3676 + yym3819 := z.EncBinary() + _ = yym3819 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Range)) } } - if yyr3664 || yy2arr3664 { + if yyr3813 || yy2arr3813 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Data == nil { r.EncodeNil() } else { - yym3678 := z.EncBinary() - _ = yym3678 + yym3821 := z.EncBinary() + _ = yym3821 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -45449,15 +47518,65 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { if x.Data == nil { r.EncodeNil() } else { - yym3679 := z.EncBinary() - _ = yym3679 + yym3822 := z.EncBinary() + _ = yym3822 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) } } } - if yyr3664 || yy2arr3664 { + if yyr3813 || yy2arr3813 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3813[3] { + yym3824 := z.EncBinary() + _ = yym3824 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3813[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3825 := z.EncBinary() + _ = yym3825 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3813 || yy2arr3813 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3813[4] { + yym3827 := z.EncBinary() + _ = yym3827 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3813[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3828 := z.EncBinary() + _ = yym3828 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3813 || yy2arr3813 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -45470,25 +47589,25 @@ func (x *RangeAllocation) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3680 := z.DecBinary() - _ = yym3680 + yym3829 := z.DecBinary() + _ = yym3829 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3681 := r.ContainerType() - if yyct3681 == codecSelferValueTypeMap1234 { - yyl3681 := r.ReadMapStart() - if yyl3681 == 0 { + yyct3830 := r.ContainerType() + if yyct3830 == codecSelferValueTypeMap1234 { + yyl3830 := r.ReadMapStart() + if yyl3830 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3681, d) + x.codecDecodeSelfFromMap(yyl3830, d) } - } else if yyct3681 == codecSelferValueTypeArray1234 { - yyl3681 := r.ReadArrayStart() - if yyl3681 == 0 { + } else if yyct3830 == codecSelferValueTypeArray1234 { + yyl3830 := r.ReadArrayStart() + if yyl3830 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3681, d) + x.codecDecodeSelfFromArray(yyl3830, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -45500,12 +47619,12 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3682Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3682Slc - var yyhl3682 bool = l >= 0 - for yyj3682 := 0; ; yyj3682++ { - if yyhl3682 { - if yyj3682 >= l { + var yys3831Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3831Slc + var yyhl3831 bool = l >= 0 + for yyj3831 := 0; ; yyj3831++ { + if yyhl3831 { + if yyj3831 >= l { break } } else { @@ -45514,10 +47633,35 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3682Slc = r.DecodeBytes(yys3682Slc, true, true) - yys3682 := string(yys3682Slc) + yys3831Slc = r.DecodeBytes(yys3831Slc, true, true) + yys3831 := string(yys3831Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3682 { + switch yys3831 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3832 := &x.ObjectMeta + yyv3832.CodecDecodeSelf(d) + } + case "range": + if r.TryDecodeAsNil() { + x.Range = "" + } else { + x.Range = string(r.DecodeString()) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3834 := &x.Data + yym3835 := z.DecBinary() + _ = yym3835 + if false { + } else { + *yyv3834 = r.DecodeBytes(*(*[]byte)(yyv3834), false, false) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -45530,35 +47674,10 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3685 := &x.ObjectMeta - yyv3685.CodecDecodeSelf(d) - } - case "range": - if r.TryDecodeAsNil() { - x.Range = "" - } else { - x.Range = string(r.DecodeString()) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3687 := &x.Data - yym3688 := z.DecBinary() - _ = yym3688 - if false { - } else { - *yyv3687 = r.DecodeBytes(*(*[]byte)(yyv3687), false, false) - } - } default: - z.DecStructFieldNotFound(-1, yys3682) - } // end switch yys3682 - } // end for yyj3682 + z.DecStructFieldNotFound(-1, yys3831) + } // end switch yys3831 + } // end for yyj3831 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -45566,48 +47685,16 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3689 int - var yyb3689 bool - var yyhl3689 bool = l >= 0 - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l + var yyj3838 int + var yyb3838 bool + var yyhl3838 bool = l >= 0 + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l } else { - yyb3689 = r.CheckBreak() + yyb3838 = r.CheckBreak() } - if yyb3689 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l - } else { - yyb3689 = r.CheckBreak() - } - if yyb3689 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l - } else { - yyb3689 = r.CheckBreak() - } - if yyb3689 { + if yyb3838 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45615,16 +47702,16 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3692 := &x.ObjectMeta - yyv3692.CodecDecodeSelf(d) + yyv3839 := &x.ObjectMeta + yyv3839.CodecDecodeSelf(d) } - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l } else { - yyb3689 = r.CheckBreak() + yyb3838 = r.CheckBreak() } - if yyb3689 { + if yyb3838 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45634,13 +47721,13 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Range = string(r.DecodeString()) } - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l } else { - yyb3689 = r.CheckBreak() + yyb3838 = r.CheckBreak() } - if yyb3689 { + if yyb3838 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45648,26 +47735,58 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Data = nil } else { - yyv3694 := &x.Data - yym3695 := z.DecBinary() - _ = yym3695 + yyv3841 := &x.Data + yym3842 := z.DecBinary() + _ = yym3842 if false { } else { - *yyv3694 = r.DecodeBytes(*(*[]byte)(yyv3694), false, false) + *yyv3841 = r.DecodeBytes(*(*[]byte)(yyv3841), false, false) } } + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l + } else { + yyb3838 = r.CheckBreak() + } + if yyb3838 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l + } else { + yyb3838 = r.CheckBreak() + } + if yyb3838 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj3689++ - if yyhl3689 { - yyb3689 = yyj3689 > l + yyj3838++ + if yyhl3838 { + yyb3838 = yyj3838 > l } else { - yyb3689 = r.CheckBreak() + yyb3838 = r.CheckBreak() } - if yyb3689 { + if yyb3838 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3689-1, "") + z.DecStructFieldNotFound(yyj3838-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45677,9 +47796,9 @@ func (x codecSelfer1234) encSlicePersistentVolumeAccessMode(v []PersistentVolume z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3696 := range v { + for _, yyv3845 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3696.CodecEncodeSelf(e) + yyv3845.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45689,2895 +47808,12 @@ func (x codecSelfer1234) decSlicePersistentVolumeAccessMode(v *[]PersistentVolum z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3697 := *v - yyh3697, yyl3697 := z.DecSliceHelperStart() - var yyc3697 bool - if yyl3697 == 0 { - if yyv3697 == nil { - yyv3697 = []PersistentVolumeAccessMode{} - yyc3697 = true - } else if len(yyv3697) != 0 { - yyv3697 = yyv3697[:0] - yyc3697 = true - } - } else if yyl3697 > 0 { - var yyrr3697, yyrl3697 int - var yyrt3697 bool - if yyl3697 > cap(yyv3697) { - - yyrl3697, yyrt3697 = z.DecInferLen(yyl3697, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3697 { - if yyrl3697 <= cap(yyv3697) { - yyv3697 = yyv3697[:yyrl3697] - } else { - yyv3697 = make([]PersistentVolumeAccessMode, yyrl3697) - } - } else { - yyv3697 = make([]PersistentVolumeAccessMode, yyrl3697) - } - yyc3697 = true - yyrr3697 = len(yyv3697) - } else if yyl3697 != len(yyv3697) { - yyv3697 = yyv3697[:yyl3697] - yyc3697 = true - } - yyj3697 := 0 - for ; yyj3697 < yyrr3697; yyj3697++ { - yyh3697.ElemContainerState(yyj3697) - if r.TryDecodeAsNil() { - yyv3697[yyj3697] = "" - } else { - yyv3697[yyj3697] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } - if yyrt3697 { - for ; yyj3697 < yyl3697; yyj3697++ { - yyv3697 = append(yyv3697, "") - yyh3697.ElemContainerState(yyj3697) - if r.TryDecodeAsNil() { - yyv3697[yyj3697] = "" - } else { - yyv3697[yyj3697] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } - } - - } else { - yyj3697 := 0 - for ; !r.CheckBreak(); yyj3697++ { - - if yyj3697 >= len(yyv3697) { - yyv3697 = append(yyv3697, "") // var yyz3697 PersistentVolumeAccessMode - yyc3697 = true - } - yyh3697.ElemContainerState(yyj3697) - if yyj3697 < len(yyv3697) { - if r.TryDecodeAsNil() { - yyv3697[yyj3697] = "" - } else { - yyv3697[yyj3697] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } else { - z.DecSwallow() - } - - } - if yyj3697 < len(yyv3697) { - yyv3697 = yyv3697[:yyj3697] - yyc3697 = true - } else if yyj3697 == 0 && yyv3697 == nil { - yyv3697 = []PersistentVolumeAccessMode{} - yyc3697 = true - } - } - yyh3697.End() - if yyc3697 { - *v = yyv3697 - } -} - -func (x codecSelfer1234) encSlicePersistentVolume(v []PersistentVolume, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3701 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3702 := &yyv3701 - yy3702.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePersistentVolume(v *[]PersistentVolume, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3703 := *v - yyh3703, yyl3703 := z.DecSliceHelperStart() - var yyc3703 bool - if yyl3703 == 0 { - if yyv3703 == nil { - yyv3703 = []PersistentVolume{} - yyc3703 = true - } else if len(yyv3703) != 0 { - yyv3703 = yyv3703[:0] - yyc3703 = true - } - } else if yyl3703 > 0 { - var yyrr3703, yyrl3703 int - var yyrt3703 bool - if yyl3703 > cap(yyv3703) { - - yyrg3703 := len(yyv3703) > 0 - yyv23703 := yyv3703 - yyrl3703, yyrt3703 = z.DecInferLen(yyl3703, z.DecBasicHandle().MaxInitLen, 392) - if yyrt3703 { - if yyrl3703 <= cap(yyv3703) { - yyv3703 = yyv3703[:yyrl3703] - } else { - yyv3703 = make([]PersistentVolume, yyrl3703) - } - } else { - yyv3703 = make([]PersistentVolume, yyrl3703) - } - yyc3703 = true - yyrr3703 = len(yyv3703) - if yyrg3703 { - copy(yyv3703, yyv23703) - } - } else if yyl3703 != len(yyv3703) { - yyv3703 = yyv3703[:yyl3703] - yyc3703 = true - } - yyj3703 := 0 - for ; yyj3703 < yyrr3703; yyj3703++ { - yyh3703.ElemContainerState(yyj3703) - if r.TryDecodeAsNil() { - yyv3703[yyj3703] = PersistentVolume{} - } else { - yyv3704 := &yyv3703[yyj3703] - yyv3704.CodecDecodeSelf(d) - } - - } - if yyrt3703 { - for ; yyj3703 < yyl3703; yyj3703++ { - yyv3703 = append(yyv3703, PersistentVolume{}) - yyh3703.ElemContainerState(yyj3703) - if r.TryDecodeAsNil() { - yyv3703[yyj3703] = PersistentVolume{} - } else { - yyv3705 := &yyv3703[yyj3703] - yyv3705.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3703 := 0 - for ; !r.CheckBreak(); yyj3703++ { - - if yyj3703 >= len(yyv3703) { - yyv3703 = append(yyv3703, PersistentVolume{}) // var yyz3703 PersistentVolume - yyc3703 = true - } - yyh3703.ElemContainerState(yyj3703) - if yyj3703 < len(yyv3703) { - if r.TryDecodeAsNil() { - yyv3703[yyj3703] = PersistentVolume{} - } else { - yyv3706 := &yyv3703[yyj3703] - yyv3706.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3703 < len(yyv3703) { - yyv3703 = yyv3703[:yyj3703] - yyc3703 = true - } else if yyj3703 == 0 && yyv3703 == nil { - yyv3703 = []PersistentVolume{} - yyc3703 = true - } - } - yyh3703.End() - if yyc3703 { - *v = yyv3703 - } -} - -func (x codecSelfer1234) encSlicePersistentVolumeClaim(v []PersistentVolumeClaim, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3707 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3708 := &yyv3707 - yy3708.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePersistentVolumeClaim(v *[]PersistentVolumeClaim, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3709 := *v - yyh3709, yyl3709 := z.DecSliceHelperStart() - var yyc3709 bool - if yyl3709 == 0 { - if yyv3709 == nil { - yyv3709 = []PersistentVolumeClaim{} - yyc3709 = true - } else if len(yyv3709) != 0 { - yyv3709 = yyv3709[:0] - yyc3709 = true - } - } else if yyl3709 > 0 { - var yyrr3709, yyrl3709 int - var yyrt3709 bool - if yyl3709 > cap(yyv3709) { - - yyrg3709 := len(yyv3709) > 0 - yyv23709 := yyv3709 - yyrl3709, yyrt3709 = z.DecInferLen(yyl3709, z.DecBasicHandle().MaxInitLen, 296) - if yyrt3709 { - if yyrl3709 <= cap(yyv3709) { - yyv3709 = yyv3709[:yyrl3709] - } else { - yyv3709 = make([]PersistentVolumeClaim, yyrl3709) - } - } else { - yyv3709 = make([]PersistentVolumeClaim, yyrl3709) - } - yyc3709 = true - yyrr3709 = len(yyv3709) - if yyrg3709 { - copy(yyv3709, yyv23709) - } - } else if yyl3709 != len(yyv3709) { - yyv3709 = yyv3709[:yyl3709] - yyc3709 = true - } - yyj3709 := 0 - for ; yyj3709 < yyrr3709; yyj3709++ { - yyh3709.ElemContainerState(yyj3709) - if r.TryDecodeAsNil() { - yyv3709[yyj3709] = PersistentVolumeClaim{} - } else { - yyv3710 := &yyv3709[yyj3709] - yyv3710.CodecDecodeSelf(d) - } - - } - if yyrt3709 { - for ; yyj3709 < yyl3709; yyj3709++ { - yyv3709 = append(yyv3709, PersistentVolumeClaim{}) - yyh3709.ElemContainerState(yyj3709) - if r.TryDecodeAsNil() { - yyv3709[yyj3709] = PersistentVolumeClaim{} - } else { - yyv3711 := &yyv3709[yyj3709] - yyv3711.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3709 := 0 - for ; !r.CheckBreak(); yyj3709++ { - - if yyj3709 >= len(yyv3709) { - yyv3709 = append(yyv3709, PersistentVolumeClaim{}) // var yyz3709 PersistentVolumeClaim - yyc3709 = true - } - yyh3709.ElemContainerState(yyj3709) - if yyj3709 < len(yyv3709) { - if r.TryDecodeAsNil() { - yyv3709[yyj3709] = PersistentVolumeClaim{} - } else { - yyv3712 := &yyv3709[yyj3709] - yyv3712.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3709 < len(yyv3709) { - yyv3709 = yyv3709[:yyj3709] - yyc3709 = true - } else if yyj3709 == 0 && yyv3709 == nil { - yyv3709 = []PersistentVolumeClaim{} - yyc3709 = true - } - } - yyh3709.End() - if yyc3709 { - *v = yyv3709 - } -} - -func (x codecSelfer1234) encSliceDownwardAPIVolumeFile(v []DownwardAPIVolumeFile, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3713 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3714 := &yyv3713 - yy3714.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFile, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3715 := *v - yyh3715, yyl3715 := z.DecSliceHelperStart() - var yyc3715 bool - if yyl3715 == 0 { - if yyv3715 == nil { - yyv3715 = []DownwardAPIVolumeFile{} - yyc3715 = true - } else if len(yyv3715) != 0 { - yyv3715 = yyv3715[:0] - yyc3715 = true - } - } else if yyl3715 > 0 { - var yyrr3715, yyrl3715 int - var yyrt3715 bool - if yyl3715 > cap(yyv3715) { - - yyrg3715 := len(yyv3715) > 0 - yyv23715 := yyv3715 - yyrl3715, yyrt3715 = z.DecInferLen(yyl3715, z.DecBasicHandle().MaxInitLen, 48) - if yyrt3715 { - if yyrl3715 <= cap(yyv3715) { - yyv3715 = yyv3715[:yyrl3715] - } else { - yyv3715 = make([]DownwardAPIVolumeFile, yyrl3715) - } - } else { - yyv3715 = make([]DownwardAPIVolumeFile, yyrl3715) - } - yyc3715 = true - yyrr3715 = len(yyv3715) - if yyrg3715 { - copy(yyv3715, yyv23715) - } - } else if yyl3715 != len(yyv3715) { - yyv3715 = yyv3715[:yyl3715] - yyc3715 = true - } - yyj3715 := 0 - for ; yyj3715 < yyrr3715; yyj3715++ { - yyh3715.ElemContainerState(yyj3715) - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = DownwardAPIVolumeFile{} - } else { - yyv3716 := &yyv3715[yyj3715] - yyv3716.CodecDecodeSelf(d) - } - - } - if yyrt3715 { - for ; yyj3715 < yyl3715; yyj3715++ { - yyv3715 = append(yyv3715, DownwardAPIVolumeFile{}) - yyh3715.ElemContainerState(yyj3715) - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = DownwardAPIVolumeFile{} - } else { - yyv3717 := &yyv3715[yyj3715] - yyv3717.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3715 := 0 - for ; !r.CheckBreak(); yyj3715++ { - - if yyj3715 >= len(yyv3715) { - yyv3715 = append(yyv3715, DownwardAPIVolumeFile{}) // var yyz3715 DownwardAPIVolumeFile - yyc3715 = true - } - yyh3715.ElemContainerState(yyj3715) - if yyj3715 < len(yyv3715) { - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = DownwardAPIVolumeFile{} - } else { - yyv3718 := &yyv3715[yyj3715] - yyv3718.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3715 < len(yyv3715) { - yyv3715 = yyv3715[:yyj3715] - yyc3715 = true - } else if yyj3715 == 0 && yyv3715 == nil { - yyv3715 = []DownwardAPIVolumeFile{} - yyc3715 = true - } - } - yyh3715.End() - if yyc3715 { - *v = yyv3715 - } -} - -func (x codecSelfer1234) encSliceCapability(v []Capability, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3719 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3719.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceCapability(v *[]Capability, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3720 := *v - yyh3720, yyl3720 := z.DecSliceHelperStart() - var yyc3720 bool - if yyl3720 == 0 { - if yyv3720 == nil { - yyv3720 = []Capability{} - yyc3720 = true - } else if len(yyv3720) != 0 { - yyv3720 = yyv3720[:0] - yyc3720 = true - } - } else if yyl3720 > 0 { - var yyrr3720, yyrl3720 int - var yyrt3720 bool - if yyl3720 > cap(yyv3720) { - - yyrl3720, yyrt3720 = z.DecInferLen(yyl3720, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3720 { - if yyrl3720 <= cap(yyv3720) { - yyv3720 = yyv3720[:yyrl3720] - } else { - yyv3720 = make([]Capability, yyrl3720) - } - } else { - yyv3720 = make([]Capability, yyrl3720) - } - yyc3720 = true - yyrr3720 = len(yyv3720) - } else if yyl3720 != len(yyv3720) { - yyv3720 = yyv3720[:yyl3720] - yyc3720 = true - } - yyj3720 := 0 - for ; yyj3720 < yyrr3720; yyj3720++ { - yyh3720.ElemContainerState(yyj3720) - if r.TryDecodeAsNil() { - yyv3720[yyj3720] = "" - } else { - yyv3720[yyj3720] = Capability(r.DecodeString()) - } - - } - if yyrt3720 { - for ; yyj3720 < yyl3720; yyj3720++ { - yyv3720 = append(yyv3720, "") - yyh3720.ElemContainerState(yyj3720) - if r.TryDecodeAsNil() { - yyv3720[yyj3720] = "" - } else { - yyv3720[yyj3720] = Capability(r.DecodeString()) - } - - } - } - - } else { - yyj3720 := 0 - for ; !r.CheckBreak(); yyj3720++ { - - if yyj3720 >= len(yyv3720) { - yyv3720 = append(yyv3720, "") // var yyz3720 Capability - yyc3720 = true - } - yyh3720.ElemContainerState(yyj3720) - if yyj3720 < len(yyv3720) { - if r.TryDecodeAsNil() { - yyv3720[yyj3720] = "" - } else { - yyv3720[yyj3720] = Capability(r.DecodeString()) - } - - } else { - z.DecSwallow() - } - - } - if yyj3720 < len(yyv3720) { - yyv3720 = yyv3720[:yyj3720] - yyc3720 = true - } else if yyj3720 == 0 && yyv3720 == nil { - yyv3720 = []Capability{} - yyc3720 = true - } - } - yyh3720.End() - if yyc3720 { - *v = yyv3720 - } -} - -func (x codecSelfer1234) encSliceContainerPort(v []ContainerPort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3724 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3725 := &yyv3724 - yy3725.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainerPort(v *[]ContainerPort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3726 := *v - yyh3726, yyl3726 := z.DecSliceHelperStart() - var yyc3726 bool - if yyl3726 == 0 { - if yyv3726 == nil { - yyv3726 = []ContainerPort{} - yyc3726 = true - } else if len(yyv3726) != 0 { - yyv3726 = yyv3726[:0] - yyc3726 = true - } - } else if yyl3726 > 0 { - var yyrr3726, yyrl3726 int - var yyrt3726 bool - if yyl3726 > cap(yyv3726) { - - yyrg3726 := len(yyv3726) > 0 - yyv23726 := yyv3726 - yyrl3726, yyrt3726 = z.DecInferLen(yyl3726, z.DecBasicHandle().MaxInitLen, 64) - if yyrt3726 { - if yyrl3726 <= cap(yyv3726) { - yyv3726 = yyv3726[:yyrl3726] - } else { - yyv3726 = make([]ContainerPort, yyrl3726) - } - } else { - yyv3726 = make([]ContainerPort, yyrl3726) - } - yyc3726 = true - yyrr3726 = len(yyv3726) - if yyrg3726 { - copy(yyv3726, yyv23726) - } - } else if yyl3726 != len(yyv3726) { - yyv3726 = yyv3726[:yyl3726] - yyc3726 = true - } - yyj3726 := 0 - for ; yyj3726 < yyrr3726; yyj3726++ { - yyh3726.ElemContainerState(yyj3726) - if r.TryDecodeAsNil() { - yyv3726[yyj3726] = ContainerPort{} - } else { - yyv3727 := &yyv3726[yyj3726] - yyv3727.CodecDecodeSelf(d) - } - - } - if yyrt3726 { - for ; yyj3726 < yyl3726; yyj3726++ { - yyv3726 = append(yyv3726, ContainerPort{}) - yyh3726.ElemContainerState(yyj3726) - if r.TryDecodeAsNil() { - yyv3726[yyj3726] = ContainerPort{} - } else { - yyv3728 := &yyv3726[yyj3726] - yyv3728.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3726 := 0 - for ; !r.CheckBreak(); yyj3726++ { - - if yyj3726 >= len(yyv3726) { - yyv3726 = append(yyv3726, ContainerPort{}) // var yyz3726 ContainerPort - yyc3726 = true - } - yyh3726.ElemContainerState(yyj3726) - if yyj3726 < len(yyv3726) { - if r.TryDecodeAsNil() { - yyv3726[yyj3726] = ContainerPort{} - } else { - yyv3729 := &yyv3726[yyj3726] - yyv3729.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3726 < len(yyv3726) { - yyv3726 = yyv3726[:yyj3726] - yyc3726 = true - } else if yyj3726 == 0 && yyv3726 == nil { - yyv3726 = []ContainerPort{} - yyc3726 = true - } - } - yyh3726.End() - if yyc3726 { - *v = yyv3726 - } -} - -func (x codecSelfer1234) encSliceEnvVar(v []EnvVar, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3730 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3731 := &yyv3730 - yy3731.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEnvVar(v *[]EnvVar, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3732 := *v - yyh3732, yyl3732 := z.DecSliceHelperStart() - var yyc3732 bool - if yyl3732 == 0 { - if yyv3732 == nil { - yyv3732 = []EnvVar{} - yyc3732 = true - } else if len(yyv3732) != 0 { - yyv3732 = yyv3732[:0] - yyc3732 = true - } - } else if yyl3732 > 0 { - var yyrr3732, yyrl3732 int - var yyrt3732 bool - if yyl3732 > cap(yyv3732) { - - yyrg3732 := len(yyv3732) > 0 - yyv23732 := yyv3732 - yyrl3732, yyrt3732 = z.DecInferLen(yyl3732, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3732 { - if yyrl3732 <= cap(yyv3732) { - yyv3732 = yyv3732[:yyrl3732] - } else { - yyv3732 = make([]EnvVar, yyrl3732) - } - } else { - yyv3732 = make([]EnvVar, yyrl3732) - } - yyc3732 = true - yyrr3732 = len(yyv3732) - if yyrg3732 { - copy(yyv3732, yyv23732) - } - } else if yyl3732 != len(yyv3732) { - yyv3732 = yyv3732[:yyl3732] - yyc3732 = true - } - yyj3732 := 0 - for ; yyj3732 < yyrr3732; yyj3732++ { - yyh3732.ElemContainerState(yyj3732) - if r.TryDecodeAsNil() { - yyv3732[yyj3732] = EnvVar{} - } else { - yyv3733 := &yyv3732[yyj3732] - yyv3733.CodecDecodeSelf(d) - } - - } - if yyrt3732 { - for ; yyj3732 < yyl3732; yyj3732++ { - yyv3732 = append(yyv3732, EnvVar{}) - yyh3732.ElemContainerState(yyj3732) - if r.TryDecodeAsNil() { - yyv3732[yyj3732] = EnvVar{} - } else { - yyv3734 := &yyv3732[yyj3732] - yyv3734.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3732 := 0 - for ; !r.CheckBreak(); yyj3732++ { - - if yyj3732 >= len(yyv3732) { - yyv3732 = append(yyv3732, EnvVar{}) // var yyz3732 EnvVar - yyc3732 = true - } - yyh3732.ElemContainerState(yyj3732) - if yyj3732 < len(yyv3732) { - if r.TryDecodeAsNil() { - yyv3732[yyj3732] = EnvVar{} - } else { - yyv3735 := &yyv3732[yyj3732] - yyv3735.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3732 < len(yyv3732) { - yyv3732 = yyv3732[:yyj3732] - yyc3732 = true - } else if yyj3732 == 0 && yyv3732 == nil { - yyv3732 = []EnvVar{} - yyc3732 = true - } - } - yyh3732.End() - if yyc3732 { - *v = yyv3732 - } -} - -func (x codecSelfer1234) encSliceVolumeMount(v []VolumeMount, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3736 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3737 := &yyv3736 - yy3737.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceVolumeMount(v *[]VolumeMount, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3738 := *v - yyh3738, yyl3738 := z.DecSliceHelperStart() - var yyc3738 bool - if yyl3738 == 0 { - if yyv3738 == nil { - yyv3738 = []VolumeMount{} - yyc3738 = true - } else if len(yyv3738) != 0 { - yyv3738 = yyv3738[:0] - yyc3738 = true - } - } else if yyl3738 > 0 { - var yyrr3738, yyrl3738 int - var yyrt3738 bool - if yyl3738 > cap(yyv3738) { - - yyrg3738 := len(yyv3738) > 0 - yyv23738 := yyv3738 - yyrl3738, yyrt3738 = z.DecInferLen(yyl3738, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3738 { - if yyrl3738 <= cap(yyv3738) { - yyv3738 = yyv3738[:yyrl3738] - } else { - yyv3738 = make([]VolumeMount, yyrl3738) - } - } else { - yyv3738 = make([]VolumeMount, yyrl3738) - } - yyc3738 = true - yyrr3738 = len(yyv3738) - if yyrg3738 { - copy(yyv3738, yyv23738) - } - } else if yyl3738 != len(yyv3738) { - yyv3738 = yyv3738[:yyl3738] - yyc3738 = true - } - yyj3738 := 0 - for ; yyj3738 < yyrr3738; yyj3738++ { - yyh3738.ElemContainerState(yyj3738) - if r.TryDecodeAsNil() { - yyv3738[yyj3738] = VolumeMount{} - } else { - yyv3739 := &yyv3738[yyj3738] - yyv3739.CodecDecodeSelf(d) - } - - } - if yyrt3738 { - for ; yyj3738 < yyl3738; yyj3738++ { - yyv3738 = append(yyv3738, VolumeMount{}) - yyh3738.ElemContainerState(yyj3738) - if r.TryDecodeAsNil() { - yyv3738[yyj3738] = VolumeMount{} - } else { - yyv3740 := &yyv3738[yyj3738] - yyv3740.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3738 := 0 - for ; !r.CheckBreak(); yyj3738++ { - - if yyj3738 >= len(yyv3738) { - yyv3738 = append(yyv3738, VolumeMount{}) // var yyz3738 VolumeMount - yyc3738 = true - } - yyh3738.ElemContainerState(yyj3738) - if yyj3738 < len(yyv3738) { - if r.TryDecodeAsNil() { - yyv3738[yyj3738] = VolumeMount{} - } else { - yyv3741 := &yyv3738[yyj3738] - yyv3741.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3738 < len(yyv3738) { - yyv3738 = yyv3738[:yyj3738] - yyc3738 = true - } else if yyj3738 == 0 && yyv3738 == nil { - yyv3738 = []VolumeMount{} - yyc3738 = true - } - } - yyh3738.End() - if yyc3738 { - *v = yyv3738 - } -} - -func (x codecSelfer1234) encSlicePod(v []Pod, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3742 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3743 := &yyv3742 - yy3743.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePod(v *[]Pod, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3744 := *v - yyh3744, yyl3744 := z.DecSliceHelperStart() - var yyc3744 bool - if yyl3744 == 0 { - if yyv3744 == nil { - yyv3744 = []Pod{} - yyc3744 = true - } else if len(yyv3744) != 0 { - yyv3744 = yyv3744[:0] - yyc3744 = true - } - } else if yyl3744 > 0 { - var yyrr3744, yyrl3744 int - var yyrt3744 bool - if yyl3744 > cap(yyv3744) { - - yyrg3744 := len(yyv3744) > 0 - yyv23744 := yyv3744 - yyrl3744, yyrt3744 = z.DecInferLen(yyl3744, z.DecBasicHandle().MaxInitLen, 496) - if yyrt3744 { - if yyrl3744 <= cap(yyv3744) { - yyv3744 = yyv3744[:yyrl3744] - } else { - yyv3744 = make([]Pod, yyrl3744) - } - } else { - yyv3744 = make([]Pod, yyrl3744) - } - yyc3744 = true - yyrr3744 = len(yyv3744) - if yyrg3744 { - copy(yyv3744, yyv23744) - } - } else if yyl3744 != len(yyv3744) { - yyv3744 = yyv3744[:yyl3744] - yyc3744 = true - } - yyj3744 := 0 - for ; yyj3744 < yyrr3744; yyj3744++ { - yyh3744.ElemContainerState(yyj3744) - if r.TryDecodeAsNil() { - yyv3744[yyj3744] = Pod{} - } else { - yyv3745 := &yyv3744[yyj3744] - yyv3745.CodecDecodeSelf(d) - } - - } - if yyrt3744 { - for ; yyj3744 < yyl3744; yyj3744++ { - yyv3744 = append(yyv3744, Pod{}) - yyh3744.ElemContainerState(yyj3744) - if r.TryDecodeAsNil() { - yyv3744[yyj3744] = Pod{} - } else { - yyv3746 := &yyv3744[yyj3744] - yyv3746.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3744 := 0 - for ; !r.CheckBreak(); yyj3744++ { - - if yyj3744 >= len(yyv3744) { - yyv3744 = append(yyv3744, Pod{}) // var yyz3744 Pod - yyc3744 = true - } - yyh3744.ElemContainerState(yyj3744) - if yyj3744 < len(yyv3744) { - if r.TryDecodeAsNil() { - yyv3744[yyj3744] = Pod{} - } else { - yyv3747 := &yyv3744[yyj3744] - yyv3747.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3744 < len(yyv3744) { - yyv3744 = yyv3744[:yyj3744] - yyc3744 = true - } else if yyj3744 == 0 && yyv3744 == nil { - yyv3744 = []Pod{} - yyc3744 = true - } - } - yyh3744.End() - if yyc3744 { - *v = yyv3744 - } -} - -func (x codecSelfer1234) encSliceVolume(v []Volume, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3748 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3749 := &yyv3748 - yy3749.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceVolume(v *[]Volume, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3750 := *v - yyh3750, yyl3750 := z.DecSliceHelperStart() - var yyc3750 bool - if yyl3750 == 0 { - if yyv3750 == nil { - yyv3750 = []Volume{} - yyc3750 = true - } else if len(yyv3750) != 0 { - yyv3750 = yyv3750[:0] - yyc3750 = true - } - } else if yyl3750 > 0 { - var yyrr3750, yyrl3750 int - var yyrt3750 bool - if yyl3750 > cap(yyv3750) { - - yyrg3750 := len(yyv3750) > 0 - yyv23750 := yyv3750 - yyrl3750, yyrt3750 = z.DecInferLen(yyl3750, z.DecBasicHandle().MaxInitLen, 152) - if yyrt3750 { - if yyrl3750 <= cap(yyv3750) { - yyv3750 = yyv3750[:yyrl3750] - } else { - yyv3750 = make([]Volume, yyrl3750) - } - } else { - yyv3750 = make([]Volume, yyrl3750) - } - yyc3750 = true - yyrr3750 = len(yyv3750) - if yyrg3750 { - copy(yyv3750, yyv23750) - } - } else if yyl3750 != len(yyv3750) { - yyv3750 = yyv3750[:yyl3750] - yyc3750 = true - } - yyj3750 := 0 - for ; yyj3750 < yyrr3750; yyj3750++ { - yyh3750.ElemContainerState(yyj3750) - if r.TryDecodeAsNil() { - yyv3750[yyj3750] = Volume{} - } else { - yyv3751 := &yyv3750[yyj3750] - yyv3751.CodecDecodeSelf(d) - } - - } - if yyrt3750 { - for ; yyj3750 < yyl3750; yyj3750++ { - yyv3750 = append(yyv3750, Volume{}) - yyh3750.ElemContainerState(yyj3750) - if r.TryDecodeAsNil() { - yyv3750[yyj3750] = Volume{} - } else { - yyv3752 := &yyv3750[yyj3750] - yyv3752.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3750 := 0 - for ; !r.CheckBreak(); yyj3750++ { - - if yyj3750 >= len(yyv3750) { - yyv3750 = append(yyv3750, Volume{}) // var yyz3750 Volume - yyc3750 = true - } - yyh3750.ElemContainerState(yyj3750) - if yyj3750 < len(yyv3750) { - if r.TryDecodeAsNil() { - yyv3750[yyj3750] = Volume{} - } else { - yyv3753 := &yyv3750[yyj3750] - yyv3753.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3750 < len(yyv3750) { - yyv3750 = yyv3750[:yyj3750] - yyc3750 = true - } else if yyj3750 == 0 && yyv3750 == nil { - yyv3750 = []Volume{} - yyc3750 = true - } - } - yyh3750.End() - if yyc3750 { - *v = yyv3750 - } -} - -func (x codecSelfer1234) encSliceContainer(v []Container, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3754 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3755 := &yyv3754 - yy3755.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainer(v *[]Container, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3756 := *v - yyh3756, yyl3756 := z.DecSliceHelperStart() - var yyc3756 bool - if yyl3756 == 0 { - if yyv3756 == nil { - yyv3756 = []Container{} - yyc3756 = true - } else if len(yyv3756) != 0 { - yyv3756 = yyv3756[:0] - yyc3756 = true - } - } else if yyl3756 > 0 { - var yyrr3756, yyrl3756 int - var yyrt3756 bool - if yyl3756 > cap(yyv3756) { - - yyrg3756 := len(yyv3756) > 0 - yyv23756 := yyv3756 - yyrl3756, yyrt3756 = z.DecInferLen(yyl3756, z.DecBasicHandle().MaxInitLen, 256) - if yyrt3756 { - if yyrl3756 <= cap(yyv3756) { - yyv3756 = yyv3756[:yyrl3756] - } else { - yyv3756 = make([]Container, yyrl3756) - } - } else { - yyv3756 = make([]Container, yyrl3756) - } - yyc3756 = true - yyrr3756 = len(yyv3756) - if yyrg3756 { - copy(yyv3756, yyv23756) - } - } else if yyl3756 != len(yyv3756) { - yyv3756 = yyv3756[:yyl3756] - yyc3756 = true - } - yyj3756 := 0 - for ; yyj3756 < yyrr3756; yyj3756++ { - yyh3756.ElemContainerState(yyj3756) - if r.TryDecodeAsNil() { - yyv3756[yyj3756] = Container{} - } else { - yyv3757 := &yyv3756[yyj3756] - yyv3757.CodecDecodeSelf(d) - } - - } - if yyrt3756 { - for ; yyj3756 < yyl3756; yyj3756++ { - yyv3756 = append(yyv3756, Container{}) - yyh3756.ElemContainerState(yyj3756) - if r.TryDecodeAsNil() { - yyv3756[yyj3756] = Container{} - } else { - yyv3758 := &yyv3756[yyj3756] - yyv3758.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3756 := 0 - for ; !r.CheckBreak(); yyj3756++ { - - if yyj3756 >= len(yyv3756) { - yyv3756 = append(yyv3756, Container{}) // var yyz3756 Container - yyc3756 = true - } - yyh3756.ElemContainerState(yyj3756) - if yyj3756 < len(yyv3756) { - if r.TryDecodeAsNil() { - yyv3756[yyj3756] = Container{} - } else { - yyv3759 := &yyv3756[yyj3756] - yyv3759.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3756 < len(yyv3756) { - yyv3756 = yyv3756[:yyj3756] - yyc3756 = true - } else if yyj3756 == 0 && yyv3756 == nil { - yyv3756 = []Container{} - yyc3756 = true - } - } - yyh3756.End() - if yyc3756 { - *v = yyv3756 - } -} - -func (x codecSelfer1234) encSliceLocalObjectReference(v []LocalObjectReference, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3760 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3761 := &yyv3760 - yy3761.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceLocalObjectReference(v *[]LocalObjectReference, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3762 := *v - yyh3762, yyl3762 := z.DecSliceHelperStart() - var yyc3762 bool - if yyl3762 == 0 { - if yyv3762 == nil { - yyv3762 = []LocalObjectReference{} - yyc3762 = true - } else if len(yyv3762) != 0 { - yyv3762 = yyv3762[:0] - yyc3762 = true - } - } else if yyl3762 > 0 { - var yyrr3762, yyrl3762 int - var yyrt3762 bool - if yyl3762 > cap(yyv3762) { - - yyrg3762 := len(yyv3762) > 0 - yyv23762 := yyv3762 - yyrl3762, yyrt3762 = z.DecInferLen(yyl3762, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3762 { - if yyrl3762 <= cap(yyv3762) { - yyv3762 = yyv3762[:yyrl3762] - } else { - yyv3762 = make([]LocalObjectReference, yyrl3762) - } - } else { - yyv3762 = make([]LocalObjectReference, yyrl3762) - } - yyc3762 = true - yyrr3762 = len(yyv3762) - if yyrg3762 { - copy(yyv3762, yyv23762) - } - } else if yyl3762 != len(yyv3762) { - yyv3762 = yyv3762[:yyl3762] - yyc3762 = true - } - yyj3762 := 0 - for ; yyj3762 < yyrr3762; yyj3762++ { - yyh3762.ElemContainerState(yyj3762) - if r.TryDecodeAsNil() { - yyv3762[yyj3762] = LocalObjectReference{} - } else { - yyv3763 := &yyv3762[yyj3762] - yyv3763.CodecDecodeSelf(d) - } - - } - if yyrt3762 { - for ; yyj3762 < yyl3762; yyj3762++ { - yyv3762 = append(yyv3762, LocalObjectReference{}) - yyh3762.ElemContainerState(yyj3762) - if r.TryDecodeAsNil() { - yyv3762[yyj3762] = LocalObjectReference{} - } else { - yyv3764 := &yyv3762[yyj3762] - yyv3764.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3762 := 0 - for ; !r.CheckBreak(); yyj3762++ { - - if yyj3762 >= len(yyv3762) { - yyv3762 = append(yyv3762, LocalObjectReference{}) // var yyz3762 LocalObjectReference - yyc3762 = true - } - yyh3762.ElemContainerState(yyj3762) - if yyj3762 < len(yyv3762) { - if r.TryDecodeAsNil() { - yyv3762[yyj3762] = LocalObjectReference{} - } else { - yyv3765 := &yyv3762[yyj3762] - yyv3765.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3762 < len(yyv3762) { - yyv3762 = yyv3762[:yyj3762] - yyc3762 = true - } else if yyj3762 == 0 && yyv3762 == nil { - yyv3762 = []LocalObjectReference{} - yyc3762 = true - } - } - yyh3762.End() - if yyc3762 { - *v = yyv3762 - } -} - -func (x codecSelfer1234) encSlicePodCondition(v []PodCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3766 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3767 := &yyv3766 - yy3767.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePodCondition(v *[]PodCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3768 := *v - yyh3768, yyl3768 := z.DecSliceHelperStart() - var yyc3768 bool - if yyl3768 == 0 { - if yyv3768 == nil { - yyv3768 = []PodCondition{} - yyc3768 = true - } else if len(yyv3768) != 0 { - yyv3768 = yyv3768[:0] - yyc3768 = true - } - } else if yyl3768 > 0 { - var yyrr3768, yyrl3768 int - var yyrt3768 bool - if yyl3768 > cap(yyv3768) { - - yyrg3768 := len(yyv3768) > 0 - yyv23768 := yyv3768 - yyrl3768, yyrt3768 = z.DecInferLen(yyl3768, z.DecBasicHandle().MaxInitLen, 112) - if yyrt3768 { - if yyrl3768 <= cap(yyv3768) { - yyv3768 = yyv3768[:yyrl3768] - } else { - yyv3768 = make([]PodCondition, yyrl3768) - } - } else { - yyv3768 = make([]PodCondition, yyrl3768) - } - yyc3768 = true - yyrr3768 = len(yyv3768) - if yyrg3768 { - copy(yyv3768, yyv23768) - } - } else if yyl3768 != len(yyv3768) { - yyv3768 = yyv3768[:yyl3768] - yyc3768 = true - } - yyj3768 := 0 - for ; yyj3768 < yyrr3768; yyj3768++ { - yyh3768.ElemContainerState(yyj3768) - if r.TryDecodeAsNil() { - yyv3768[yyj3768] = PodCondition{} - } else { - yyv3769 := &yyv3768[yyj3768] - yyv3769.CodecDecodeSelf(d) - } - - } - if yyrt3768 { - for ; yyj3768 < yyl3768; yyj3768++ { - yyv3768 = append(yyv3768, PodCondition{}) - yyh3768.ElemContainerState(yyj3768) - if r.TryDecodeAsNil() { - yyv3768[yyj3768] = PodCondition{} - } else { - yyv3770 := &yyv3768[yyj3768] - yyv3770.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3768 := 0 - for ; !r.CheckBreak(); yyj3768++ { - - if yyj3768 >= len(yyv3768) { - yyv3768 = append(yyv3768, PodCondition{}) // var yyz3768 PodCondition - yyc3768 = true - } - yyh3768.ElemContainerState(yyj3768) - if yyj3768 < len(yyv3768) { - if r.TryDecodeAsNil() { - yyv3768[yyj3768] = PodCondition{} - } else { - yyv3771 := &yyv3768[yyj3768] - yyv3771.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3768 < len(yyv3768) { - yyv3768 = yyv3768[:yyj3768] - yyc3768 = true - } else if yyj3768 == 0 && yyv3768 == nil { - yyv3768 = []PodCondition{} - yyc3768 = true - } - } - yyh3768.End() - if yyc3768 { - *v = yyv3768 - } -} - -func (x codecSelfer1234) encSliceContainerStatus(v []ContainerStatus, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3772 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3773 := &yyv3772 - yy3773.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainerStatus(v *[]ContainerStatus, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3774 := *v - yyh3774, yyl3774 := z.DecSliceHelperStart() - var yyc3774 bool - if yyl3774 == 0 { - if yyv3774 == nil { - yyv3774 = []ContainerStatus{} - yyc3774 = true - } else if len(yyv3774) != 0 { - yyv3774 = yyv3774[:0] - yyc3774 = true - } - } else if yyl3774 > 0 { - var yyrr3774, yyrl3774 int - var yyrt3774 bool - if yyl3774 > cap(yyv3774) { - - yyrg3774 := len(yyv3774) > 0 - yyv23774 := yyv3774 - yyrl3774, yyrt3774 = z.DecInferLen(yyl3774, z.DecBasicHandle().MaxInitLen, 128) - if yyrt3774 { - if yyrl3774 <= cap(yyv3774) { - yyv3774 = yyv3774[:yyrl3774] - } else { - yyv3774 = make([]ContainerStatus, yyrl3774) - } - } else { - yyv3774 = make([]ContainerStatus, yyrl3774) - } - yyc3774 = true - yyrr3774 = len(yyv3774) - if yyrg3774 { - copy(yyv3774, yyv23774) - } - } else if yyl3774 != len(yyv3774) { - yyv3774 = yyv3774[:yyl3774] - yyc3774 = true - } - yyj3774 := 0 - for ; yyj3774 < yyrr3774; yyj3774++ { - yyh3774.ElemContainerState(yyj3774) - if r.TryDecodeAsNil() { - yyv3774[yyj3774] = ContainerStatus{} - } else { - yyv3775 := &yyv3774[yyj3774] - yyv3775.CodecDecodeSelf(d) - } - - } - if yyrt3774 { - for ; yyj3774 < yyl3774; yyj3774++ { - yyv3774 = append(yyv3774, ContainerStatus{}) - yyh3774.ElemContainerState(yyj3774) - if r.TryDecodeAsNil() { - yyv3774[yyj3774] = ContainerStatus{} - } else { - yyv3776 := &yyv3774[yyj3774] - yyv3776.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3774 := 0 - for ; !r.CheckBreak(); yyj3774++ { - - if yyj3774 >= len(yyv3774) { - yyv3774 = append(yyv3774, ContainerStatus{}) // var yyz3774 ContainerStatus - yyc3774 = true - } - yyh3774.ElemContainerState(yyj3774) - if yyj3774 < len(yyv3774) { - if r.TryDecodeAsNil() { - yyv3774[yyj3774] = ContainerStatus{} - } else { - yyv3777 := &yyv3774[yyj3774] - yyv3777.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3774 < len(yyv3774) { - yyv3774 = yyv3774[:yyj3774] - yyc3774 = true - } else if yyj3774 == 0 && yyv3774 == nil { - yyv3774 = []ContainerStatus{} - yyc3774 = true - } - } - yyh3774.End() - if yyc3774 { - *v = yyv3774 - } -} - -func (x codecSelfer1234) encSlicePodTemplate(v []PodTemplate, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3778 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3779 := &yyv3778 - yy3779.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePodTemplate(v *[]PodTemplate, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3780 := *v - yyh3780, yyl3780 := z.DecSliceHelperStart() - var yyc3780 bool - if yyl3780 == 0 { - if yyv3780 == nil { - yyv3780 = []PodTemplate{} - yyc3780 = true - } else if len(yyv3780) != 0 { - yyv3780 = yyv3780[:0] - yyc3780 = true - } - } else if yyl3780 > 0 { - var yyrr3780, yyrl3780 int - var yyrt3780 bool - if yyl3780 > cap(yyv3780) { - - yyrg3780 := len(yyv3780) > 0 - yyv23780 := yyv3780 - yyrl3780, yyrt3780 = z.DecInferLen(yyl3780, z.DecBasicHandle().MaxInitLen, 520) - if yyrt3780 { - if yyrl3780 <= cap(yyv3780) { - yyv3780 = yyv3780[:yyrl3780] - } else { - yyv3780 = make([]PodTemplate, yyrl3780) - } - } else { - yyv3780 = make([]PodTemplate, yyrl3780) - } - yyc3780 = true - yyrr3780 = len(yyv3780) - if yyrg3780 { - copy(yyv3780, yyv23780) - } - } else if yyl3780 != len(yyv3780) { - yyv3780 = yyv3780[:yyl3780] - yyc3780 = true - } - yyj3780 := 0 - for ; yyj3780 < yyrr3780; yyj3780++ { - yyh3780.ElemContainerState(yyj3780) - if r.TryDecodeAsNil() { - yyv3780[yyj3780] = PodTemplate{} - } else { - yyv3781 := &yyv3780[yyj3780] - yyv3781.CodecDecodeSelf(d) - } - - } - if yyrt3780 { - for ; yyj3780 < yyl3780; yyj3780++ { - yyv3780 = append(yyv3780, PodTemplate{}) - yyh3780.ElemContainerState(yyj3780) - if r.TryDecodeAsNil() { - yyv3780[yyj3780] = PodTemplate{} - } else { - yyv3782 := &yyv3780[yyj3780] - yyv3782.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3780 := 0 - for ; !r.CheckBreak(); yyj3780++ { - - if yyj3780 >= len(yyv3780) { - yyv3780 = append(yyv3780, PodTemplate{}) // var yyz3780 PodTemplate - yyc3780 = true - } - yyh3780.ElemContainerState(yyj3780) - if yyj3780 < len(yyv3780) { - if r.TryDecodeAsNil() { - yyv3780[yyj3780] = PodTemplate{} - } else { - yyv3783 := &yyv3780[yyj3780] - yyv3783.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3780 < len(yyv3780) { - yyv3780 = yyv3780[:yyj3780] - yyc3780 = true - } else if yyj3780 == 0 && yyv3780 == nil { - yyv3780 = []PodTemplate{} - yyc3780 = true - } - } - yyh3780.End() - if yyc3780 { - *v = yyv3780 - } -} - -func (x codecSelfer1234) encSliceReplicationController(v []ReplicationController, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3784 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3785 := &yyv3784 - yy3785.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceReplicationController(v *[]ReplicationController, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3786 := *v - yyh3786, yyl3786 := z.DecSliceHelperStart() - var yyc3786 bool - if yyl3786 == 0 { - if yyv3786 == nil { - yyv3786 = []ReplicationController{} - yyc3786 = true - } else if len(yyv3786) != 0 { - yyv3786 = yyv3786[:0] - yyc3786 = true - } - } else if yyl3786 > 0 { - var yyrr3786, yyrl3786 int - var yyrt3786 bool - if yyl3786 > cap(yyv3786) { - - yyrg3786 := len(yyv3786) > 0 - yyv23786 := yyv3786 - yyrl3786, yyrt3786 = z.DecInferLen(yyl3786, z.DecBasicHandle().MaxInitLen, 232) - if yyrt3786 { - if yyrl3786 <= cap(yyv3786) { - yyv3786 = yyv3786[:yyrl3786] - } else { - yyv3786 = make([]ReplicationController, yyrl3786) - } - } else { - yyv3786 = make([]ReplicationController, yyrl3786) - } - yyc3786 = true - yyrr3786 = len(yyv3786) - if yyrg3786 { - copy(yyv3786, yyv23786) - } - } else if yyl3786 != len(yyv3786) { - yyv3786 = yyv3786[:yyl3786] - yyc3786 = true - } - yyj3786 := 0 - for ; yyj3786 < yyrr3786; yyj3786++ { - yyh3786.ElemContainerState(yyj3786) - if r.TryDecodeAsNil() { - yyv3786[yyj3786] = ReplicationController{} - } else { - yyv3787 := &yyv3786[yyj3786] - yyv3787.CodecDecodeSelf(d) - } - - } - if yyrt3786 { - for ; yyj3786 < yyl3786; yyj3786++ { - yyv3786 = append(yyv3786, ReplicationController{}) - yyh3786.ElemContainerState(yyj3786) - if r.TryDecodeAsNil() { - yyv3786[yyj3786] = ReplicationController{} - } else { - yyv3788 := &yyv3786[yyj3786] - yyv3788.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3786 := 0 - for ; !r.CheckBreak(); yyj3786++ { - - if yyj3786 >= len(yyv3786) { - yyv3786 = append(yyv3786, ReplicationController{}) // var yyz3786 ReplicationController - yyc3786 = true - } - yyh3786.ElemContainerState(yyj3786) - if yyj3786 < len(yyv3786) { - if r.TryDecodeAsNil() { - yyv3786[yyj3786] = ReplicationController{} - } else { - yyv3789 := &yyv3786[yyj3786] - yyv3789.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3786 < len(yyv3786) { - yyv3786 = yyv3786[:yyj3786] - yyc3786 = true - } else if yyj3786 == 0 && yyv3786 == nil { - yyv3786 = []ReplicationController{} - yyc3786 = true - } - } - yyh3786.End() - if yyc3786 { - *v = yyv3786 - } -} - -func (x codecSelfer1234) encSliceService(v []Service, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3790 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3791 := &yyv3790 - yy3791.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceService(v *[]Service, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3792 := *v - yyh3792, yyl3792 := z.DecSliceHelperStart() - var yyc3792 bool - if yyl3792 == 0 { - if yyv3792 == nil { - yyv3792 = []Service{} - yyc3792 = true - } else if len(yyv3792) != 0 { - yyv3792 = yyv3792[:0] - yyc3792 = true - } - } else if yyl3792 > 0 { - var yyrr3792, yyrl3792 int - var yyrt3792 bool - if yyl3792 > cap(yyv3792) { - - yyrg3792 := len(yyv3792) > 0 - yyv23792 := yyv3792 - yyrl3792, yyrt3792 = z.DecInferLen(yyl3792, z.DecBasicHandle().MaxInitLen, 336) - if yyrt3792 { - if yyrl3792 <= cap(yyv3792) { - yyv3792 = yyv3792[:yyrl3792] - } else { - yyv3792 = make([]Service, yyrl3792) - } - } else { - yyv3792 = make([]Service, yyrl3792) - } - yyc3792 = true - yyrr3792 = len(yyv3792) - if yyrg3792 { - copy(yyv3792, yyv23792) - } - } else if yyl3792 != len(yyv3792) { - yyv3792 = yyv3792[:yyl3792] - yyc3792 = true - } - yyj3792 := 0 - for ; yyj3792 < yyrr3792; yyj3792++ { - yyh3792.ElemContainerState(yyj3792) - if r.TryDecodeAsNil() { - yyv3792[yyj3792] = Service{} - } else { - yyv3793 := &yyv3792[yyj3792] - yyv3793.CodecDecodeSelf(d) - } - - } - if yyrt3792 { - for ; yyj3792 < yyl3792; yyj3792++ { - yyv3792 = append(yyv3792, Service{}) - yyh3792.ElemContainerState(yyj3792) - if r.TryDecodeAsNil() { - yyv3792[yyj3792] = Service{} - } else { - yyv3794 := &yyv3792[yyj3792] - yyv3794.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3792 := 0 - for ; !r.CheckBreak(); yyj3792++ { - - if yyj3792 >= len(yyv3792) { - yyv3792 = append(yyv3792, Service{}) // var yyz3792 Service - yyc3792 = true - } - yyh3792.ElemContainerState(yyj3792) - if yyj3792 < len(yyv3792) { - if r.TryDecodeAsNil() { - yyv3792[yyj3792] = Service{} - } else { - yyv3795 := &yyv3792[yyj3792] - yyv3795.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3792 < len(yyv3792) { - yyv3792 = yyv3792[:yyj3792] - yyc3792 = true - } else if yyj3792 == 0 && yyv3792 == nil { - yyv3792 = []Service{} - yyc3792 = true - } - } - yyh3792.End() - if yyc3792 { - *v = yyv3792 - } -} - -func (x codecSelfer1234) encSliceLoadBalancerIngress(v []LoadBalancerIngress, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3796 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3797 := &yyv3796 - yy3797.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceLoadBalancerIngress(v *[]LoadBalancerIngress, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3798 := *v - yyh3798, yyl3798 := z.DecSliceHelperStart() - var yyc3798 bool - if yyl3798 == 0 { - if yyv3798 == nil { - yyv3798 = []LoadBalancerIngress{} - yyc3798 = true - } else if len(yyv3798) != 0 { - yyv3798 = yyv3798[:0] - yyc3798 = true - } - } else if yyl3798 > 0 { - var yyrr3798, yyrl3798 int - var yyrt3798 bool - if yyl3798 > cap(yyv3798) { - - yyrg3798 := len(yyv3798) > 0 - yyv23798 := yyv3798 - yyrl3798, yyrt3798 = z.DecInferLen(yyl3798, z.DecBasicHandle().MaxInitLen, 32) - if yyrt3798 { - if yyrl3798 <= cap(yyv3798) { - yyv3798 = yyv3798[:yyrl3798] - } else { - yyv3798 = make([]LoadBalancerIngress, yyrl3798) - } - } else { - yyv3798 = make([]LoadBalancerIngress, yyrl3798) - } - yyc3798 = true - yyrr3798 = len(yyv3798) - if yyrg3798 { - copy(yyv3798, yyv23798) - } - } else if yyl3798 != len(yyv3798) { - yyv3798 = yyv3798[:yyl3798] - yyc3798 = true - } - yyj3798 := 0 - for ; yyj3798 < yyrr3798; yyj3798++ { - yyh3798.ElemContainerState(yyj3798) - if r.TryDecodeAsNil() { - yyv3798[yyj3798] = LoadBalancerIngress{} - } else { - yyv3799 := &yyv3798[yyj3798] - yyv3799.CodecDecodeSelf(d) - } - - } - if yyrt3798 { - for ; yyj3798 < yyl3798; yyj3798++ { - yyv3798 = append(yyv3798, LoadBalancerIngress{}) - yyh3798.ElemContainerState(yyj3798) - if r.TryDecodeAsNil() { - yyv3798[yyj3798] = LoadBalancerIngress{} - } else { - yyv3800 := &yyv3798[yyj3798] - yyv3800.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3798 := 0 - for ; !r.CheckBreak(); yyj3798++ { - - if yyj3798 >= len(yyv3798) { - yyv3798 = append(yyv3798, LoadBalancerIngress{}) // var yyz3798 LoadBalancerIngress - yyc3798 = true - } - yyh3798.ElemContainerState(yyj3798) - if yyj3798 < len(yyv3798) { - if r.TryDecodeAsNil() { - yyv3798[yyj3798] = LoadBalancerIngress{} - } else { - yyv3801 := &yyv3798[yyj3798] - yyv3801.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3798 < len(yyv3798) { - yyv3798 = yyv3798[:yyj3798] - yyc3798 = true - } else if yyj3798 == 0 && yyv3798 == nil { - yyv3798 = []LoadBalancerIngress{} - yyc3798 = true - } - } - yyh3798.End() - if yyc3798 { - *v = yyv3798 - } -} - -func (x codecSelfer1234) encSliceServicePort(v []ServicePort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3802 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3803 := &yyv3802 - yy3803.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServicePort(v *[]ServicePort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3804 := *v - yyh3804, yyl3804 := z.DecSliceHelperStart() - var yyc3804 bool - if yyl3804 == 0 { - if yyv3804 == nil { - yyv3804 = []ServicePort{} - yyc3804 = true - } else if len(yyv3804) != 0 { - yyv3804 = yyv3804[:0] - yyc3804 = true - } - } else if yyl3804 > 0 { - var yyrr3804, yyrl3804 int - var yyrt3804 bool - if yyl3804 > cap(yyv3804) { - - yyrg3804 := len(yyv3804) > 0 - yyv23804 := yyv3804 - yyrl3804, yyrt3804 = z.DecInferLen(yyl3804, z.DecBasicHandle().MaxInitLen, 80) - if yyrt3804 { - if yyrl3804 <= cap(yyv3804) { - yyv3804 = yyv3804[:yyrl3804] - } else { - yyv3804 = make([]ServicePort, yyrl3804) - } - } else { - yyv3804 = make([]ServicePort, yyrl3804) - } - yyc3804 = true - yyrr3804 = len(yyv3804) - if yyrg3804 { - copy(yyv3804, yyv23804) - } - } else if yyl3804 != len(yyv3804) { - yyv3804 = yyv3804[:yyl3804] - yyc3804 = true - } - yyj3804 := 0 - for ; yyj3804 < yyrr3804; yyj3804++ { - yyh3804.ElemContainerState(yyj3804) - if r.TryDecodeAsNil() { - yyv3804[yyj3804] = ServicePort{} - } else { - yyv3805 := &yyv3804[yyj3804] - yyv3805.CodecDecodeSelf(d) - } - - } - if yyrt3804 { - for ; yyj3804 < yyl3804; yyj3804++ { - yyv3804 = append(yyv3804, ServicePort{}) - yyh3804.ElemContainerState(yyj3804) - if r.TryDecodeAsNil() { - yyv3804[yyj3804] = ServicePort{} - } else { - yyv3806 := &yyv3804[yyj3804] - yyv3806.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3804 := 0 - for ; !r.CheckBreak(); yyj3804++ { - - if yyj3804 >= len(yyv3804) { - yyv3804 = append(yyv3804, ServicePort{}) // var yyz3804 ServicePort - yyc3804 = true - } - yyh3804.ElemContainerState(yyj3804) - if yyj3804 < len(yyv3804) { - if r.TryDecodeAsNil() { - yyv3804[yyj3804] = ServicePort{} - } else { - yyv3807 := &yyv3804[yyj3804] - yyv3807.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3804 < len(yyv3804) { - yyv3804 = yyv3804[:yyj3804] - yyc3804 = true - } else if yyj3804 == 0 && yyv3804 == nil { - yyv3804 = []ServicePort{} - yyc3804 = true - } - } - yyh3804.End() - if yyc3804 { - *v = yyv3804 - } -} - -func (x codecSelfer1234) encSliceObjectReference(v []ObjectReference, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3808 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3809 := &yyv3808 - yy3809.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceObjectReference(v *[]ObjectReference, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3810 := *v - yyh3810, yyl3810 := z.DecSliceHelperStart() - var yyc3810 bool - if yyl3810 == 0 { - if yyv3810 == nil { - yyv3810 = []ObjectReference{} - yyc3810 = true - } else if len(yyv3810) != 0 { - yyv3810 = yyv3810[:0] - yyc3810 = true - } - } else if yyl3810 > 0 { - var yyrr3810, yyrl3810 int - var yyrt3810 bool - if yyl3810 > cap(yyv3810) { - - yyrg3810 := len(yyv3810) > 0 - yyv23810 := yyv3810 - yyrl3810, yyrt3810 = z.DecInferLen(yyl3810, z.DecBasicHandle().MaxInitLen, 112) - if yyrt3810 { - if yyrl3810 <= cap(yyv3810) { - yyv3810 = yyv3810[:yyrl3810] - } else { - yyv3810 = make([]ObjectReference, yyrl3810) - } - } else { - yyv3810 = make([]ObjectReference, yyrl3810) - } - yyc3810 = true - yyrr3810 = len(yyv3810) - if yyrg3810 { - copy(yyv3810, yyv23810) - } - } else if yyl3810 != len(yyv3810) { - yyv3810 = yyv3810[:yyl3810] - yyc3810 = true - } - yyj3810 := 0 - for ; yyj3810 < yyrr3810; yyj3810++ { - yyh3810.ElemContainerState(yyj3810) - if r.TryDecodeAsNil() { - yyv3810[yyj3810] = ObjectReference{} - } else { - yyv3811 := &yyv3810[yyj3810] - yyv3811.CodecDecodeSelf(d) - } - - } - if yyrt3810 { - for ; yyj3810 < yyl3810; yyj3810++ { - yyv3810 = append(yyv3810, ObjectReference{}) - yyh3810.ElemContainerState(yyj3810) - if r.TryDecodeAsNil() { - yyv3810[yyj3810] = ObjectReference{} - } else { - yyv3812 := &yyv3810[yyj3810] - yyv3812.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3810 := 0 - for ; !r.CheckBreak(); yyj3810++ { - - if yyj3810 >= len(yyv3810) { - yyv3810 = append(yyv3810, ObjectReference{}) // var yyz3810 ObjectReference - yyc3810 = true - } - yyh3810.ElemContainerState(yyj3810) - if yyj3810 < len(yyv3810) { - if r.TryDecodeAsNil() { - yyv3810[yyj3810] = ObjectReference{} - } else { - yyv3813 := &yyv3810[yyj3810] - yyv3813.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3810 < len(yyv3810) { - yyv3810 = yyv3810[:yyj3810] - yyc3810 = true - } else if yyj3810 == 0 && yyv3810 == nil { - yyv3810 = []ObjectReference{} - yyc3810 = true - } - } - yyh3810.End() - if yyc3810 { - *v = yyv3810 - } -} - -func (x codecSelfer1234) encSliceServiceAccount(v []ServiceAccount, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3814 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3815 := &yyv3814 - yy3815.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServiceAccount(v *[]ServiceAccount, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3816 := *v - yyh3816, yyl3816 := z.DecSliceHelperStart() - var yyc3816 bool - if yyl3816 == 0 { - if yyv3816 == nil { - yyv3816 = []ServiceAccount{} - yyc3816 = true - } else if len(yyv3816) != 0 { - yyv3816 = yyv3816[:0] - yyc3816 = true - } - } else if yyl3816 > 0 { - var yyrr3816, yyrl3816 int - var yyrt3816 bool - if yyl3816 > cap(yyv3816) { - - yyrg3816 := len(yyv3816) > 0 - yyv23816 := yyv3816 - yyrl3816, yyrt3816 = z.DecInferLen(yyl3816, z.DecBasicHandle().MaxInitLen, 240) - if yyrt3816 { - if yyrl3816 <= cap(yyv3816) { - yyv3816 = yyv3816[:yyrl3816] - } else { - yyv3816 = make([]ServiceAccount, yyrl3816) - } - } else { - yyv3816 = make([]ServiceAccount, yyrl3816) - } - yyc3816 = true - yyrr3816 = len(yyv3816) - if yyrg3816 { - copy(yyv3816, yyv23816) - } - } else if yyl3816 != len(yyv3816) { - yyv3816 = yyv3816[:yyl3816] - yyc3816 = true - } - yyj3816 := 0 - for ; yyj3816 < yyrr3816; yyj3816++ { - yyh3816.ElemContainerState(yyj3816) - if r.TryDecodeAsNil() { - yyv3816[yyj3816] = ServiceAccount{} - } else { - yyv3817 := &yyv3816[yyj3816] - yyv3817.CodecDecodeSelf(d) - } - - } - if yyrt3816 { - for ; yyj3816 < yyl3816; yyj3816++ { - yyv3816 = append(yyv3816, ServiceAccount{}) - yyh3816.ElemContainerState(yyj3816) - if r.TryDecodeAsNil() { - yyv3816[yyj3816] = ServiceAccount{} - } else { - yyv3818 := &yyv3816[yyj3816] - yyv3818.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3816 := 0 - for ; !r.CheckBreak(); yyj3816++ { - - if yyj3816 >= len(yyv3816) { - yyv3816 = append(yyv3816, ServiceAccount{}) // var yyz3816 ServiceAccount - yyc3816 = true - } - yyh3816.ElemContainerState(yyj3816) - if yyj3816 < len(yyv3816) { - if r.TryDecodeAsNil() { - yyv3816[yyj3816] = ServiceAccount{} - } else { - yyv3819 := &yyv3816[yyj3816] - yyv3819.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3816 < len(yyv3816) { - yyv3816 = yyv3816[:yyj3816] - yyc3816 = true - } else if yyj3816 == 0 && yyv3816 == nil { - yyv3816 = []ServiceAccount{} - yyc3816 = true - } - } - yyh3816.End() - if yyc3816 { - *v = yyv3816 - } -} - -func (x codecSelfer1234) encSliceEndpointSubset(v []EndpointSubset, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3820 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3821 := &yyv3820 - yy3821.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointSubset(v *[]EndpointSubset, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3822 := *v - yyh3822, yyl3822 := z.DecSliceHelperStart() - var yyc3822 bool - if yyl3822 == 0 { - if yyv3822 == nil { - yyv3822 = []EndpointSubset{} - yyc3822 = true - } else if len(yyv3822) != 0 { - yyv3822 = yyv3822[:0] - yyc3822 = true - } - } else if yyl3822 > 0 { - var yyrr3822, yyrl3822 int - var yyrt3822 bool - if yyl3822 > cap(yyv3822) { - - yyrg3822 := len(yyv3822) > 0 - yyv23822 := yyv3822 - yyrl3822, yyrt3822 = z.DecInferLen(yyl3822, z.DecBasicHandle().MaxInitLen, 72) - if yyrt3822 { - if yyrl3822 <= cap(yyv3822) { - yyv3822 = yyv3822[:yyrl3822] - } else { - yyv3822 = make([]EndpointSubset, yyrl3822) - } - } else { - yyv3822 = make([]EndpointSubset, yyrl3822) - } - yyc3822 = true - yyrr3822 = len(yyv3822) - if yyrg3822 { - copy(yyv3822, yyv23822) - } - } else if yyl3822 != len(yyv3822) { - yyv3822 = yyv3822[:yyl3822] - yyc3822 = true - } - yyj3822 := 0 - for ; yyj3822 < yyrr3822; yyj3822++ { - yyh3822.ElemContainerState(yyj3822) - if r.TryDecodeAsNil() { - yyv3822[yyj3822] = EndpointSubset{} - } else { - yyv3823 := &yyv3822[yyj3822] - yyv3823.CodecDecodeSelf(d) - } - - } - if yyrt3822 { - for ; yyj3822 < yyl3822; yyj3822++ { - yyv3822 = append(yyv3822, EndpointSubset{}) - yyh3822.ElemContainerState(yyj3822) - if r.TryDecodeAsNil() { - yyv3822[yyj3822] = EndpointSubset{} - } else { - yyv3824 := &yyv3822[yyj3822] - yyv3824.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3822 := 0 - for ; !r.CheckBreak(); yyj3822++ { - - if yyj3822 >= len(yyv3822) { - yyv3822 = append(yyv3822, EndpointSubset{}) // var yyz3822 EndpointSubset - yyc3822 = true - } - yyh3822.ElemContainerState(yyj3822) - if yyj3822 < len(yyv3822) { - if r.TryDecodeAsNil() { - yyv3822[yyj3822] = EndpointSubset{} - } else { - yyv3825 := &yyv3822[yyj3822] - yyv3825.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3822 < len(yyv3822) { - yyv3822 = yyv3822[:yyj3822] - yyc3822 = true - } else if yyj3822 == 0 && yyv3822 == nil { - yyv3822 = []EndpointSubset{} - yyc3822 = true - } - } - yyh3822.End() - if yyc3822 { - *v = yyv3822 - } -} - -func (x codecSelfer1234) encSliceEndpointAddress(v []EndpointAddress, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3826 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3827 := &yyv3826 - yy3827.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointAddress(v *[]EndpointAddress, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3828 := *v - yyh3828, yyl3828 := z.DecSliceHelperStart() - var yyc3828 bool - if yyl3828 == 0 { - if yyv3828 == nil { - yyv3828 = []EndpointAddress{} - yyc3828 = true - } else if len(yyv3828) != 0 { - yyv3828 = yyv3828[:0] - yyc3828 = true - } - } else if yyl3828 > 0 { - var yyrr3828, yyrl3828 int - var yyrt3828 bool - if yyl3828 > cap(yyv3828) { - - yyrg3828 := len(yyv3828) > 0 - yyv23828 := yyv3828 - yyrl3828, yyrt3828 = z.DecInferLen(yyl3828, z.DecBasicHandle().MaxInitLen, 24) - if yyrt3828 { - if yyrl3828 <= cap(yyv3828) { - yyv3828 = yyv3828[:yyrl3828] - } else { - yyv3828 = make([]EndpointAddress, yyrl3828) - } - } else { - yyv3828 = make([]EndpointAddress, yyrl3828) - } - yyc3828 = true - yyrr3828 = len(yyv3828) - if yyrg3828 { - copy(yyv3828, yyv23828) - } - } else if yyl3828 != len(yyv3828) { - yyv3828 = yyv3828[:yyl3828] - yyc3828 = true - } - yyj3828 := 0 - for ; yyj3828 < yyrr3828; yyj3828++ { - yyh3828.ElemContainerState(yyj3828) - if r.TryDecodeAsNil() { - yyv3828[yyj3828] = EndpointAddress{} - } else { - yyv3829 := &yyv3828[yyj3828] - yyv3829.CodecDecodeSelf(d) - } - - } - if yyrt3828 { - for ; yyj3828 < yyl3828; yyj3828++ { - yyv3828 = append(yyv3828, EndpointAddress{}) - yyh3828.ElemContainerState(yyj3828) - if r.TryDecodeAsNil() { - yyv3828[yyj3828] = EndpointAddress{} - } else { - yyv3830 := &yyv3828[yyj3828] - yyv3830.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3828 := 0 - for ; !r.CheckBreak(); yyj3828++ { - - if yyj3828 >= len(yyv3828) { - yyv3828 = append(yyv3828, EndpointAddress{}) // var yyz3828 EndpointAddress - yyc3828 = true - } - yyh3828.ElemContainerState(yyj3828) - if yyj3828 < len(yyv3828) { - if r.TryDecodeAsNil() { - yyv3828[yyj3828] = EndpointAddress{} - } else { - yyv3831 := &yyv3828[yyj3828] - yyv3831.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3828 < len(yyv3828) { - yyv3828 = yyv3828[:yyj3828] - yyc3828 = true - } else if yyj3828 == 0 && yyv3828 == nil { - yyv3828 = []EndpointAddress{} - yyc3828 = true - } - } - yyh3828.End() - if yyc3828 { - *v = yyv3828 - } -} - -func (x codecSelfer1234) encSliceEndpointPort(v []EndpointPort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3832 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3833 := &yyv3832 - yy3833.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointPort(v *[]EndpointPort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3834 := *v - yyh3834, yyl3834 := z.DecSliceHelperStart() - var yyc3834 bool - if yyl3834 == 0 { - if yyv3834 == nil { - yyv3834 = []EndpointPort{} - yyc3834 = true - } else if len(yyv3834) != 0 { - yyv3834 = yyv3834[:0] - yyc3834 = true - } - } else if yyl3834 > 0 { - var yyrr3834, yyrl3834 int - var yyrt3834 bool - if yyl3834 > cap(yyv3834) { - - yyrg3834 := len(yyv3834) > 0 - yyv23834 := yyv3834 - yyrl3834, yyrt3834 = z.DecInferLen(yyl3834, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3834 { - if yyrl3834 <= cap(yyv3834) { - yyv3834 = yyv3834[:yyrl3834] - } else { - yyv3834 = make([]EndpointPort, yyrl3834) - } - } else { - yyv3834 = make([]EndpointPort, yyrl3834) - } - yyc3834 = true - yyrr3834 = len(yyv3834) - if yyrg3834 { - copy(yyv3834, yyv23834) - } - } else if yyl3834 != len(yyv3834) { - yyv3834 = yyv3834[:yyl3834] - yyc3834 = true - } - yyj3834 := 0 - for ; yyj3834 < yyrr3834; yyj3834++ { - yyh3834.ElemContainerState(yyj3834) - if r.TryDecodeAsNil() { - yyv3834[yyj3834] = EndpointPort{} - } else { - yyv3835 := &yyv3834[yyj3834] - yyv3835.CodecDecodeSelf(d) - } - - } - if yyrt3834 { - for ; yyj3834 < yyl3834; yyj3834++ { - yyv3834 = append(yyv3834, EndpointPort{}) - yyh3834.ElemContainerState(yyj3834) - if r.TryDecodeAsNil() { - yyv3834[yyj3834] = EndpointPort{} - } else { - yyv3836 := &yyv3834[yyj3834] - yyv3836.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3834 := 0 - for ; !r.CheckBreak(); yyj3834++ { - - if yyj3834 >= len(yyv3834) { - yyv3834 = append(yyv3834, EndpointPort{}) // var yyz3834 EndpointPort - yyc3834 = true - } - yyh3834.ElemContainerState(yyj3834) - if yyj3834 < len(yyv3834) { - if r.TryDecodeAsNil() { - yyv3834[yyj3834] = EndpointPort{} - } else { - yyv3837 := &yyv3834[yyj3834] - yyv3837.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3834 < len(yyv3834) { - yyv3834 = yyv3834[:yyj3834] - yyc3834 = true - } else if yyj3834 == 0 && yyv3834 == nil { - yyv3834 = []EndpointPort{} - yyc3834 = true - } - } - yyh3834.End() - if yyc3834 { - *v = yyv3834 - } -} - -func (x codecSelfer1234) encSliceEndpoints(v []Endpoints, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3838 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3839 := &yyv3838 - yy3839.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpoints(v *[]Endpoints, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3840 := *v - yyh3840, yyl3840 := z.DecSliceHelperStart() - var yyc3840 bool - if yyl3840 == 0 { - if yyv3840 == nil { - yyv3840 = []Endpoints{} - yyc3840 = true - } else if len(yyv3840) != 0 { - yyv3840 = yyv3840[:0] - yyc3840 = true - } - } else if yyl3840 > 0 { - var yyrr3840, yyrl3840 int - var yyrt3840 bool - if yyl3840 > cap(yyv3840) { - - yyrg3840 := len(yyv3840) > 0 - yyv23840 := yyv3840 - yyrl3840, yyrt3840 = z.DecInferLen(yyl3840, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3840 { - if yyrl3840 <= cap(yyv3840) { - yyv3840 = yyv3840[:yyrl3840] - } else { - yyv3840 = make([]Endpoints, yyrl3840) - } - } else { - yyv3840 = make([]Endpoints, yyrl3840) - } - yyc3840 = true - yyrr3840 = len(yyv3840) - if yyrg3840 { - copy(yyv3840, yyv23840) - } - } else if yyl3840 != len(yyv3840) { - yyv3840 = yyv3840[:yyl3840] - yyc3840 = true - } - yyj3840 := 0 - for ; yyj3840 < yyrr3840; yyj3840++ { - yyh3840.ElemContainerState(yyj3840) - if r.TryDecodeAsNil() { - yyv3840[yyj3840] = Endpoints{} - } else { - yyv3841 := &yyv3840[yyj3840] - yyv3841.CodecDecodeSelf(d) - } - - } - if yyrt3840 { - for ; yyj3840 < yyl3840; yyj3840++ { - yyv3840 = append(yyv3840, Endpoints{}) - yyh3840.ElemContainerState(yyj3840) - if r.TryDecodeAsNil() { - yyv3840[yyj3840] = Endpoints{} - } else { - yyv3842 := &yyv3840[yyj3840] - yyv3842.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3840 := 0 - for ; !r.CheckBreak(); yyj3840++ { - - if yyj3840 >= len(yyv3840) { - yyv3840 = append(yyv3840, Endpoints{}) // var yyz3840 Endpoints - yyc3840 = true - } - yyh3840.ElemContainerState(yyj3840) - if yyj3840 < len(yyv3840) { - if r.TryDecodeAsNil() { - yyv3840[yyj3840] = Endpoints{} - } else { - yyv3843 := &yyv3840[yyj3840] - yyv3843.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3840 < len(yyv3840) { - yyv3840 = yyv3840[:yyj3840] - yyc3840 = true - } else if yyj3840 == 0 && yyv3840 == nil { - yyv3840 = []Endpoints{} - yyc3840 = true - } - } - yyh3840.End() - if yyc3840 { - *v = yyv3840 - } -} - -func (x codecSelfer1234) encSliceNodeCondition(v []NodeCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3844 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3845 := &yyv3844 - yy3845.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yyv3846 := *v yyh3846, yyl3846 := z.DecSliceHelperStart() var yyc3846 bool if yyl3846 == 0 { if yyv3846 == nil { - yyv3846 = []NodeCondition{} + yyv3846 = []PersistentVolumeAccessMode{} yyc3846 = true } else if len(yyv3846) != 0 { yyv3846 = yyv3846[:0] @@ -48588,23 +47824,18 @@ func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978. var yyrt3846 bool if yyl3846 > cap(yyv3846) { - yyrg3846 := len(yyv3846) > 0 - yyv23846 := yyv3846 - yyrl3846, yyrt3846 = z.DecInferLen(yyl3846, z.DecBasicHandle().MaxInitLen, 112) + yyrl3846, yyrt3846 = z.DecInferLen(yyl3846, z.DecBasicHandle().MaxInitLen, 16) if yyrt3846 { if yyrl3846 <= cap(yyv3846) { yyv3846 = yyv3846[:yyrl3846] } else { - yyv3846 = make([]NodeCondition, yyrl3846) + yyv3846 = make([]PersistentVolumeAccessMode, yyrl3846) } } else { - yyv3846 = make([]NodeCondition, yyrl3846) + yyv3846 = make([]PersistentVolumeAccessMode, yyrl3846) } yyc3846 = true yyrr3846 = len(yyv3846) - if yyrg3846 { - copy(yyv3846, yyv23846) - } } else if yyl3846 != len(yyv3846) { yyv3846 = yyv3846[:yyl3846] yyc3846 = true @@ -48613,22 +47844,20 @@ func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978. for ; yyj3846 < yyrr3846; yyj3846++ { yyh3846.ElemContainerState(yyj3846) if r.TryDecodeAsNil() { - yyv3846[yyj3846] = NodeCondition{} + yyv3846[yyj3846] = "" } else { - yyv3847 := &yyv3846[yyj3846] - yyv3847.CodecDecodeSelf(d) + yyv3846[yyj3846] = PersistentVolumeAccessMode(r.DecodeString()) } } if yyrt3846 { for ; yyj3846 < yyl3846; yyj3846++ { - yyv3846 = append(yyv3846, NodeCondition{}) + yyv3846 = append(yyv3846, "") yyh3846.ElemContainerState(yyj3846) if r.TryDecodeAsNil() { - yyv3846[yyj3846] = NodeCondition{} + yyv3846[yyj3846] = "" } else { - yyv3848 := &yyv3846[yyj3846] - yyv3848.CodecDecodeSelf(d) + yyv3846[yyj3846] = PersistentVolumeAccessMode(r.DecodeString()) } } @@ -48639,16 +47868,15 @@ func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978. for ; !r.CheckBreak(); yyj3846++ { if yyj3846 >= len(yyv3846) { - yyv3846 = append(yyv3846, NodeCondition{}) // var yyz3846 NodeCondition + yyv3846 = append(yyv3846, "") // var yyz3846 PersistentVolumeAccessMode yyc3846 = true } yyh3846.ElemContainerState(yyj3846) if yyj3846 < len(yyv3846) { if r.TryDecodeAsNil() { - yyv3846[yyj3846] = NodeCondition{} + yyv3846[yyj3846] = "" } else { - yyv3849 := &yyv3846[yyj3846] - yyv3849.CodecDecodeSelf(d) + yyv3846[yyj3846] = PersistentVolumeAccessMode(r.DecodeString()) } } else { @@ -48660,7 +47888,7 @@ func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978. yyv3846 = yyv3846[:yyj3846] yyc3846 = true } else if yyj3846 == 0 && yyv3846 == nil { - yyv3846 = []NodeCondition{} + yyv3846 = []PersistentVolumeAccessMode{} yyc3846 = true } } @@ -48670,7 +47898,7 @@ func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978. } } -func (x codecSelfer1234) encSliceNodeAddress(v []NodeAddress, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePersistentVolume(v []PersistentVolume, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -48683,7 +47911,7 @@ func (x codecSelfer1234) encSliceNodeAddress(v []NodeAddress, e *codec1978.Encod z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePersistentVolume(v *[]PersistentVolume, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -48693,7 +47921,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco var yyc3852 bool if yyl3852 == 0 { if yyv3852 == nil { - yyv3852 = []NodeAddress{} + yyv3852 = []PersistentVolume{} yyc3852 = true } else if len(yyv3852) != 0 { yyv3852 = yyv3852[:0] @@ -48706,15 +47934,15 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco yyrg3852 := len(yyv3852) > 0 yyv23852 := yyv3852 - yyrl3852, yyrt3852 = z.DecInferLen(yyl3852, z.DecBasicHandle().MaxInitLen, 32) + yyrl3852, yyrt3852 = z.DecInferLen(yyl3852, z.DecBasicHandle().MaxInitLen, 400) if yyrt3852 { if yyrl3852 <= cap(yyv3852) { yyv3852 = yyv3852[:yyrl3852] } else { - yyv3852 = make([]NodeAddress, yyrl3852) + yyv3852 = make([]PersistentVolume, yyrl3852) } } else { - yyv3852 = make([]NodeAddress, yyrl3852) + yyv3852 = make([]PersistentVolume, yyrl3852) } yyc3852 = true yyrr3852 = len(yyv3852) @@ -48729,7 +47957,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco for ; yyj3852 < yyrr3852; yyj3852++ { yyh3852.ElemContainerState(yyj3852) if r.TryDecodeAsNil() { - yyv3852[yyj3852] = NodeAddress{} + yyv3852[yyj3852] = PersistentVolume{} } else { yyv3853 := &yyv3852[yyj3852] yyv3853.CodecDecodeSelf(d) @@ -48738,10 +47966,10 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco } if yyrt3852 { for ; yyj3852 < yyl3852; yyj3852++ { - yyv3852 = append(yyv3852, NodeAddress{}) + yyv3852 = append(yyv3852, PersistentVolume{}) yyh3852.ElemContainerState(yyj3852) if r.TryDecodeAsNil() { - yyv3852[yyj3852] = NodeAddress{} + yyv3852[yyj3852] = PersistentVolume{} } else { yyv3854 := &yyv3852[yyj3852] yyv3854.CodecDecodeSelf(d) @@ -48755,13 +47983,13 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco for ; !r.CheckBreak(); yyj3852++ { if yyj3852 >= len(yyv3852) { - yyv3852 = append(yyv3852, NodeAddress{}) // var yyz3852 NodeAddress + yyv3852 = append(yyv3852, PersistentVolume{}) // var yyz3852 PersistentVolume yyc3852 = true } yyh3852.ElemContainerState(yyj3852) if yyj3852 < len(yyv3852) { if r.TryDecodeAsNil() { - yyv3852[yyj3852] = NodeAddress{} + yyv3852[yyj3852] = PersistentVolume{} } else { yyv3855 := &yyv3852[yyj3852] yyv3855.CodecDecodeSelf(d) @@ -48776,7 +48004,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco yyv3852 = yyv3852[:yyj3852] yyc3852 = true } else if yyj3852 == 0 && yyv3852 == nil { - yyv3852 = []NodeAddress{} + yyv3852 = []PersistentVolume{} yyc3852 = true } } @@ -48786,7 +48014,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco } } -func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePersistentVolumeClaim(v []PersistentVolumeClaim, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -48799,7 +48027,7 @@ func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978 z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePersistentVolumeClaim(v *[]PersistentVolumeClaim, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -48809,7 +48037,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 var yyc3858 bool if yyl3858 == 0 { if yyv3858 == nil { - yyv3858 = []ContainerImage{} + yyv3858 = []PersistentVolumeClaim{} yyc3858 = true } else if len(yyv3858) != 0 { yyv3858 = yyv3858[:0] @@ -48822,15 +48050,15 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 yyrg3858 := len(yyv3858) > 0 yyv23858 := yyv3858 - yyrl3858, yyrt3858 = z.DecInferLen(yyl3858, z.DecBasicHandle().MaxInitLen, 32) + yyrl3858, yyrt3858 = z.DecInferLen(yyl3858, z.DecBasicHandle().MaxInitLen, 296) if yyrt3858 { if yyrl3858 <= cap(yyv3858) { yyv3858 = yyv3858[:yyrl3858] } else { - yyv3858 = make([]ContainerImage, yyrl3858) + yyv3858 = make([]PersistentVolumeClaim, yyrl3858) } } else { - yyv3858 = make([]ContainerImage, yyrl3858) + yyv3858 = make([]PersistentVolumeClaim, yyrl3858) } yyc3858 = true yyrr3858 = len(yyv3858) @@ -48845,7 +48073,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 for ; yyj3858 < yyrr3858; yyj3858++ { yyh3858.ElemContainerState(yyj3858) if r.TryDecodeAsNil() { - yyv3858[yyj3858] = ContainerImage{} + yyv3858[yyj3858] = PersistentVolumeClaim{} } else { yyv3859 := &yyv3858[yyj3858] yyv3859.CodecDecodeSelf(d) @@ -48854,10 +48082,10 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 } if yyrt3858 { for ; yyj3858 < yyl3858; yyj3858++ { - yyv3858 = append(yyv3858, ContainerImage{}) + yyv3858 = append(yyv3858, PersistentVolumeClaim{}) yyh3858.ElemContainerState(yyj3858) if r.TryDecodeAsNil() { - yyv3858[yyj3858] = ContainerImage{} + yyv3858[yyj3858] = PersistentVolumeClaim{} } else { yyv3860 := &yyv3858[yyj3858] yyv3860.CodecDecodeSelf(d) @@ -48871,13 +48099,13 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 for ; !r.CheckBreak(); yyj3858++ { if yyj3858 >= len(yyv3858) { - yyv3858 = append(yyv3858, ContainerImage{}) // var yyz3858 ContainerImage + yyv3858 = append(yyv3858, PersistentVolumeClaim{}) // var yyz3858 PersistentVolumeClaim yyc3858 = true } yyh3858.ElemContainerState(yyj3858) if yyj3858 < len(yyv3858) { if r.TryDecodeAsNil() { - yyv3858[yyj3858] = ContainerImage{} + yyv3858[yyj3858] = PersistentVolumeClaim{} } else { yyv3861 := &yyv3858[yyj3858] yyv3861.CodecDecodeSelf(d) @@ -48892,7 +48120,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 yyv3858 = yyv3858[:yyj3858] yyc3858 = true } else if yyj3858 == 0 && yyv3858 == nil { - yyv3858 = []ContainerImage{} + yyv3858 = []PersistentVolumeClaim{} yyc3858 = true } } @@ -48902,24 +48130,3379 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 } } +func (x codecSelfer1234) encSliceDownwardAPIVolumeFile(v []DownwardAPIVolumeFile, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3862 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3863 := &yyv3862 + yy3863.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFile, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3864 := *v + yyh3864, yyl3864 := z.DecSliceHelperStart() + var yyc3864 bool + if yyl3864 == 0 { + if yyv3864 == nil { + yyv3864 = []DownwardAPIVolumeFile{} + yyc3864 = true + } else if len(yyv3864) != 0 { + yyv3864 = yyv3864[:0] + yyc3864 = true + } + } else if yyl3864 > 0 { + var yyrr3864, yyrl3864 int + var yyrt3864 bool + if yyl3864 > cap(yyv3864) { + + yyrg3864 := len(yyv3864) > 0 + yyv23864 := yyv3864 + yyrl3864, yyrt3864 = z.DecInferLen(yyl3864, z.DecBasicHandle().MaxInitLen, 48) + if yyrt3864 { + if yyrl3864 <= cap(yyv3864) { + yyv3864 = yyv3864[:yyrl3864] + } else { + yyv3864 = make([]DownwardAPIVolumeFile, yyrl3864) + } + } else { + yyv3864 = make([]DownwardAPIVolumeFile, yyrl3864) + } + yyc3864 = true + yyrr3864 = len(yyv3864) + if yyrg3864 { + copy(yyv3864, yyv23864) + } + } else if yyl3864 != len(yyv3864) { + yyv3864 = yyv3864[:yyl3864] + yyc3864 = true + } + yyj3864 := 0 + for ; yyj3864 < yyrr3864; yyj3864++ { + yyh3864.ElemContainerState(yyj3864) + if r.TryDecodeAsNil() { + yyv3864[yyj3864] = DownwardAPIVolumeFile{} + } else { + yyv3865 := &yyv3864[yyj3864] + yyv3865.CodecDecodeSelf(d) + } + + } + if yyrt3864 { + for ; yyj3864 < yyl3864; yyj3864++ { + yyv3864 = append(yyv3864, DownwardAPIVolumeFile{}) + yyh3864.ElemContainerState(yyj3864) + if r.TryDecodeAsNil() { + yyv3864[yyj3864] = DownwardAPIVolumeFile{} + } else { + yyv3866 := &yyv3864[yyj3864] + yyv3866.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3864 := 0 + for ; !r.CheckBreak(); yyj3864++ { + + if yyj3864 >= len(yyv3864) { + yyv3864 = append(yyv3864, DownwardAPIVolumeFile{}) // var yyz3864 DownwardAPIVolumeFile + yyc3864 = true + } + yyh3864.ElemContainerState(yyj3864) + if yyj3864 < len(yyv3864) { + if r.TryDecodeAsNil() { + yyv3864[yyj3864] = DownwardAPIVolumeFile{} + } else { + yyv3867 := &yyv3864[yyj3864] + yyv3867.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3864 < len(yyv3864) { + yyv3864 = yyv3864[:yyj3864] + yyc3864 = true + } else if yyj3864 == 0 && yyv3864 == nil { + yyv3864 = []DownwardAPIVolumeFile{} + yyc3864 = true + } + } + yyh3864.End() + if yyc3864 { + *v = yyv3864 + } +} + +func (x codecSelfer1234) encSliceHTTPHeader(v []HTTPHeader, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3868 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3869 := &yyv3868 + yy3869.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceHTTPHeader(v *[]HTTPHeader, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3870 := *v + yyh3870, yyl3870 := z.DecSliceHelperStart() + var yyc3870 bool + if yyl3870 == 0 { + if yyv3870 == nil { + yyv3870 = []HTTPHeader{} + yyc3870 = true + } else if len(yyv3870) != 0 { + yyv3870 = yyv3870[:0] + yyc3870 = true + } + } else if yyl3870 > 0 { + var yyrr3870, yyrl3870 int + var yyrt3870 bool + if yyl3870 > cap(yyv3870) { + + yyrg3870 := len(yyv3870) > 0 + yyv23870 := yyv3870 + yyrl3870, yyrt3870 = z.DecInferLen(yyl3870, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3870 { + if yyrl3870 <= cap(yyv3870) { + yyv3870 = yyv3870[:yyrl3870] + } else { + yyv3870 = make([]HTTPHeader, yyrl3870) + } + } else { + yyv3870 = make([]HTTPHeader, yyrl3870) + } + yyc3870 = true + yyrr3870 = len(yyv3870) + if yyrg3870 { + copy(yyv3870, yyv23870) + } + } else if yyl3870 != len(yyv3870) { + yyv3870 = yyv3870[:yyl3870] + yyc3870 = true + } + yyj3870 := 0 + for ; yyj3870 < yyrr3870; yyj3870++ { + yyh3870.ElemContainerState(yyj3870) + if r.TryDecodeAsNil() { + yyv3870[yyj3870] = HTTPHeader{} + } else { + yyv3871 := &yyv3870[yyj3870] + yyv3871.CodecDecodeSelf(d) + } + + } + if yyrt3870 { + for ; yyj3870 < yyl3870; yyj3870++ { + yyv3870 = append(yyv3870, HTTPHeader{}) + yyh3870.ElemContainerState(yyj3870) + if r.TryDecodeAsNil() { + yyv3870[yyj3870] = HTTPHeader{} + } else { + yyv3872 := &yyv3870[yyj3870] + yyv3872.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3870 := 0 + for ; !r.CheckBreak(); yyj3870++ { + + if yyj3870 >= len(yyv3870) { + yyv3870 = append(yyv3870, HTTPHeader{}) // var yyz3870 HTTPHeader + yyc3870 = true + } + yyh3870.ElemContainerState(yyj3870) + if yyj3870 < len(yyv3870) { + if r.TryDecodeAsNil() { + yyv3870[yyj3870] = HTTPHeader{} + } else { + yyv3873 := &yyv3870[yyj3870] + yyv3873.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3870 < len(yyv3870) { + yyv3870 = yyv3870[:yyj3870] + yyc3870 = true + } else if yyj3870 == 0 && yyv3870 == nil { + yyv3870 = []HTTPHeader{} + yyc3870 = true + } + } + yyh3870.End() + if yyc3870 { + *v = yyv3870 + } +} + +func (x codecSelfer1234) encSliceCapability(v []Capability, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3874 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yyv3874.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceCapability(v *[]Capability, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3875 := *v + yyh3875, yyl3875 := z.DecSliceHelperStart() + var yyc3875 bool + if yyl3875 == 0 { + if yyv3875 == nil { + yyv3875 = []Capability{} + yyc3875 = true + } else if len(yyv3875) != 0 { + yyv3875 = yyv3875[:0] + yyc3875 = true + } + } else if yyl3875 > 0 { + var yyrr3875, yyrl3875 int + var yyrt3875 bool + if yyl3875 > cap(yyv3875) { + + yyrl3875, yyrt3875 = z.DecInferLen(yyl3875, z.DecBasicHandle().MaxInitLen, 16) + if yyrt3875 { + if yyrl3875 <= cap(yyv3875) { + yyv3875 = yyv3875[:yyrl3875] + } else { + yyv3875 = make([]Capability, yyrl3875) + } + } else { + yyv3875 = make([]Capability, yyrl3875) + } + yyc3875 = true + yyrr3875 = len(yyv3875) + } else if yyl3875 != len(yyv3875) { + yyv3875 = yyv3875[:yyl3875] + yyc3875 = true + } + yyj3875 := 0 + for ; yyj3875 < yyrr3875; yyj3875++ { + yyh3875.ElemContainerState(yyj3875) + if r.TryDecodeAsNil() { + yyv3875[yyj3875] = "" + } else { + yyv3875[yyj3875] = Capability(r.DecodeString()) + } + + } + if yyrt3875 { + for ; yyj3875 < yyl3875; yyj3875++ { + yyv3875 = append(yyv3875, "") + yyh3875.ElemContainerState(yyj3875) + if r.TryDecodeAsNil() { + yyv3875[yyj3875] = "" + } else { + yyv3875[yyj3875] = Capability(r.DecodeString()) + } + + } + } + + } else { + yyj3875 := 0 + for ; !r.CheckBreak(); yyj3875++ { + + if yyj3875 >= len(yyv3875) { + yyv3875 = append(yyv3875, "") // var yyz3875 Capability + yyc3875 = true + } + yyh3875.ElemContainerState(yyj3875) + if yyj3875 < len(yyv3875) { + if r.TryDecodeAsNil() { + yyv3875[yyj3875] = "" + } else { + yyv3875[yyj3875] = Capability(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj3875 < len(yyv3875) { + yyv3875 = yyv3875[:yyj3875] + yyc3875 = true + } else if yyj3875 == 0 && yyv3875 == nil { + yyv3875 = []Capability{} + yyc3875 = true + } + } + yyh3875.End() + if yyc3875 { + *v = yyv3875 + } +} + +func (x codecSelfer1234) encSliceContainerPort(v []ContainerPort, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3879 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3880 := &yyv3879 + yy3880.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainerPort(v *[]ContainerPort, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3881 := *v + yyh3881, yyl3881 := z.DecSliceHelperStart() + var yyc3881 bool + if yyl3881 == 0 { + if yyv3881 == nil { + yyv3881 = []ContainerPort{} + yyc3881 = true + } else if len(yyv3881) != 0 { + yyv3881 = yyv3881[:0] + yyc3881 = true + } + } else if yyl3881 > 0 { + var yyrr3881, yyrl3881 int + var yyrt3881 bool + if yyl3881 > cap(yyv3881) { + + yyrg3881 := len(yyv3881) > 0 + yyv23881 := yyv3881 + yyrl3881, yyrt3881 = z.DecInferLen(yyl3881, z.DecBasicHandle().MaxInitLen, 64) + if yyrt3881 { + if yyrl3881 <= cap(yyv3881) { + yyv3881 = yyv3881[:yyrl3881] + } else { + yyv3881 = make([]ContainerPort, yyrl3881) + } + } else { + yyv3881 = make([]ContainerPort, yyrl3881) + } + yyc3881 = true + yyrr3881 = len(yyv3881) + if yyrg3881 { + copy(yyv3881, yyv23881) + } + } else if yyl3881 != len(yyv3881) { + yyv3881 = yyv3881[:yyl3881] + yyc3881 = true + } + yyj3881 := 0 + for ; yyj3881 < yyrr3881; yyj3881++ { + yyh3881.ElemContainerState(yyj3881) + if r.TryDecodeAsNil() { + yyv3881[yyj3881] = ContainerPort{} + } else { + yyv3882 := &yyv3881[yyj3881] + yyv3882.CodecDecodeSelf(d) + } + + } + if yyrt3881 { + for ; yyj3881 < yyl3881; yyj3881++ { + yyv3881 = append(yyv3881, ContainerPort{}) + yyh3881.ElemContainerState(yyj3881) + if r.TryDecodeAsNil() { + yyv3881[yyj3881] = ContainerPort{} + } else { + yyv3883 := &yyv3881[yyj3881] + yyv3883.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3881 := 0 + for ; !r.CheckBreak(); yyj3881++ { + + if yyj3881 >= len(yyv3881) { + yyv3881 = append(yyv3881, ContainerPort{}) // var yyz3881 ContainerPort + yyc3881 = true + } + yyh3881.ElemContainerState(yyj3881) + if yyj3881 < len(yyv3881) { + if r.TryDecodeAsNil() { + yyv3881[yyj3881] = ContainerPort{} + } else { + yyv3884 := &yyv3881[yyj3881] + yyv3884.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3881 < len(yyv3881) { + yyv3881 = yyv3881[:yyj3881] + yyc3881 = true + } else if yyj3881 == 0 && yyv3881 == nil { + yyv3881 = []ContainerPort{} + yyc3881 = true + } + } + yyh3881.End() + if yyc3881 { + *v = yyv3881 + } +} + +func (x codecSelfer1234) encSliceEnvVar(v []EnvVar, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3885 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3886 := &yyv3885 + yy3886.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEnvVar(v *[]EnvVar, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3887 := *v + yyh3887, yyl3887 := z.DecSliceHelperStart() + var yyc3887 bool + if yyl3887 == 0 { + if yyv3887 == nil { + yyv3887 = []EnvVar{} + yyc3887 = true + } else if len(yyv3887) != 0 { + yyv3887 = yyv3887[:0] + yyc3887 = true + } + } else if yyl3887 > 0 { + var yyrr3887, yyrl3887 int + var yyrt3887 bool + if yyl3887 > cap(yyv3887) { + + yyrg3887 := len(yyv3887) > 0 + yyv23887 := yyv3887 + yyrl3887, yyrt3887 = z.DecInferLen(yyl3887, z.DecBasicHandle().MaxInitLen, 40) + if yyrt3887 { + if yyrl3887 <= cap(yyv3887) { + yyv3887 = yyv3887[:yyrl3887] + } else { + yyv3887 = make([]EnvVar, yyrl3887) + } + } else { + yyv3887 = make([]EnvVar, yyrl3887) + } + yyc3887 = true + yyrr3887 = len(yyv3887) + if yyrg3887 { + copy(yyv3887, yyv23887) + } + } else if yyl3887 != len(yyv3887) { + yyv3887 = yyv3887[:yyl3887] + yyc3887 = true + } + yyj3887 := 0 + for ; yyj3887 < yyrr3887; yyj3887++ { + yyh3887.ElemContainerState(yyj3887) + if r.TryDecodeAsNil() { + yyv3887[yyj3887] = EnvVar{} + } else { + yyv3888 := &yyv3887[yyj3887] + yyv3888.CodecDecodeSelf(d) + } + + } + if yyrt3887 { + for ; yyj3887 < yyl3887; yyj3887++ { + yyv3887 = append(yyv3887, EnvVar{}) + yyh3887.ElemContainerState(yyj3887) + if r.TryDecodeAsNil() { + yyv3887[yyj3887] = EnvVar{} + } else { + yyv3889 := &yyv3887[yyj3887] + yyv3889.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3887 := 0 + for ; !r.CheckBreak(); yyj3887++ { + + if yyj3887 >= len(yyv3887) { + yyv3887 = append(yyv3887, EnvVar{}) // var yyz3887 EnvVar + yyc3887 = true + } + yyh3887.ElemContainerState(yyj3887) + if yyj3887 < len(yyv3887) { + if r.TryDecodeAsNil() { + yyv3887[yyj3887] = EnvVar{} + } else { + yyv3890 := &yyv3887[yyj3887] + yyv3890.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3887 < len(yyv3887) { + yyv3887 = yyv3887[:yyj3887] + yyc3887 = true + } else if yyj3887 == 0 && yyv3887 == nil { + yyv3887 = []EnvVar{} + yyc3887 = true + } + } + yyh3887.End() + if yyc3887 { + *v = yyv3887 + } +} + +func (x codecSelfer1234) encSliceVolumeMount(v []VolumeMount, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3891 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3892 := &yyv3891 + yy3892.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceVolumeMount(v *[]VolumeMount, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3893 := *v + yyh3893, yyl3893 := z.DecSliceHelperStart() + var yyc3893 bool + if yyl3893 == 0 { + if yyv3893 == nil { + yyv3893 = []VolumeMount{} + yyc3893 = true + } else if len(yyv3893) != 0 { + yyv3893 = yyv3893[:0] + yyc3893 = true + } + } else if yyl3893 > 0 { + var yyrr3893, yyrl3893 int + var yyrt3893 bool + if yyl3893 > cap(yyv3893) { + + yyrg3893 := len(yyv3893) > 0 + yyv23893 := yyv3893 + yyrl3893, yyrt3893 = z.DecInferLen(yyl3893, z.DecBasicHandle().MaxInitLen, 40) + if yyrt3893 { + if yyrl3893 <= cap(yyv3893) { + yyv3893 = yyv3893[:yyrl3893] + } else { + yyv3893 = make([]VolumeMount, yyrl3893) + } + } else { + yyv3893 = make([]VolumeMount, yyrl3893) + } + yyc3893 = true + yyrr3893 = len(yyv3893) + if yyrg3893 { + copy(yyv3893, yyv23893) + } + } else if yyl3893 != len(yyv3893) { + yyv3893 = yyv3893[:yyl3893] + yyc3893 = true + } + yyj3893 := 0 + for ; yyj3893 < yyrr3893; yyj3893++ { + yyh3893.ElemContainerState(yyj3893) + if r.TryDecodeAsNil() { + yyv3893[yyj3893] = VolumeMount{} + } else { + yyv3894 := &yyv3893[yyj3893] + yyv3894.CodecDecodeSelf(d) + } + + } + if yyrt3893 { + for ; yyj3893 < yyl3893; yyj3893++ { + yyv3893 = append(yyv3893, VolumeMount{}) + yyh3893.ElemContainerState(yyj3893) + if r.TryDecodeAsNil() { + yyv3893[yyj3893] = VolumeMount{} + } else { + yyv3895 := &yyv3893[yyj3893] + yyv3895.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3893 := 0 + for ; !r.CheckBreak(); yyj3893++ { + + if yyj3893 >= len(yyv3893) { + yyv3893 = append(yyv3893, VolumeMount{}) // var yyz3893 VolumeMount + yyc3893 = true + } + yyh3893.ElemContainerState(yyj3893) + if yyj3893 < len(yyv3893) { + if r.TryDecodeAsNil() { + yyv3893[yyj3893] = VolumeMount{} + } else { + yyv3896 := &yyv3893[yyj3893] + yyv3896.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3893 < len(yyv3893) { + yyv3893 = yyv3893[:yyj3893] + yyc3893 = true + } else if yyj3893 == 0 && yyv3893 == nil { + yyv3893 = []VolumeMount{} + yyc3893 = true + } + } + yyh3893.End() + if yyc3893 { + *v = yyv3893 + } +} + +func (x codecSelfer1234) encSlicePod(v []Pod, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3897 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3898 := &yyv3897 + yy3898.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePod(v *[]Pod, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3899 := *v + yyh3899, yyl3899 := z.DecSliceHelperStart() + var yyc3899 bool + if yyl3899 == 0 { + if yyv3899 == nil { + yyv3899 = []Pod{} + yyc3899 = true + } else if len(yyv3899) != 0 { + yyv3899 = yyv3899[:0] + yyc3899 = true + } + } else if yyl3899 > 0 { + var yyrr3899, yyrl3899 int + var yyrt3899 bool + if yyl3899 > cap(yyv3899) { + + yyrg3899 := len(yyv3899) > 0 + yyv23899 := yyv3899 + yyrl3899, yyrt3899 = z.DecInferLen(yyl3899, z.DecBasicHandle().MaxInitLen, 496) + if yyrt3899 { + if yyrl3899 <= cap(yyv3899) { + yyv3899 = yyv3899[:yyrl3899] + } else { + yyv3899 = make([]Pod, yyrl3899) + } + } else { + yyv3899 = make([]Pod, yyrl3899) + } + yyc3899 = true + yyrr3899 = len(yyv3899) + if yyrg3899 { + copy(yyv3899, yyv23899) + } + } else if yyl3899 != len(yyv3899) { + yyv3899 = yyv3899[:yyl3899] + yyc3899 = true + } + yyj3899 := 0 + for ; yyj3899 < yyrr3899; yyj3899++ { + yyh3899.ElemContainerState(yyj3899) + if r.TryDecodeAsNil() { + yyv3899[yyj3899] = Pod{} + } else { + yyv3900 := &yyv3899[yyj3899] + yyv3900.CodecDecodeSelf(d) + } + + } + if yyrt3899 { + for ; yyj3899 < yyl3899; yyj3899++ { + yyv3899 = append(yyv3899, Pod{}) + yyh3899.ElemContainerState(yyj3899) + if r.TryDecodeAsNil() { + yyv3899[yyj3899] = Pod{} + } else { + yyv3901 := &yyv3899[yyj3899] + yyv3901.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3899 := 0 + for ; !r.CheckBreak(); yyj3899++ { + + if yyj3899 >= len(yyv3899) { + yyv3899 = append(yyv3899, Pod{}) // var yyz3899 Pod + yyc3899 = true + } + yyh3899.ElemContainerState(yyj3899) + if yyj3899 < len(yyv3899) { + if r.TryDecodeAsNil() { + yyv3899[yyj3899] = Pod{} + } else { + yyv3902 := &yyv3899[yyj3899] + yyv3902.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3899 < len(yyv3899) { + yyv3899 = yyv3899[:yyj3899] + yyc3899 = true + } else if yyj3899 == 0 && yyv3899 == nil { + yyv3899 = []Pod{} + yyc3899 = true + } + } + yyh3899.End() + if yyc3899 { + *v = yyv3899 + } +} + +func (x codecSelfer1234) encSliceNodeSelectorTerm(v []NodeSelectorTerm, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3903 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3904 := &yyv3903 + yy3904.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeSelectorTerm(v *[]NodeSelectorTerm, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3905 := *v + yyh3905, yyl3905 := z.DecSliceHelperStart() + var yyc3905 bool + if yyl3905 == 0 { + if yyv3905 == nil { + yyv3905 = []NodeSelectorTerm{} + yyc3905 = true + } else if len(yyv3905) != 0 { + yyv3905 = yyv3905[:0] + yyc3905 = true + } + } else if yyl3905 > 0 { + var yyrr3905, yyrl3905 int + var yyrt3905 bool + if yyl3905 > cap(yyv3905) { + + yyrg3905 := len(yyv3905) > 0 + yyv23905 := yyv3905 + yyrl3905, yyrt3905 = z.DecInferLen(yyl3905, z.DecBasicHandle().MaxInitLen, 24) + if yyrt3905 { + if yyrl3905 <= cap(yyv3905) { + yyv3905 = yyv3905[:yyrl3905] + } else { + yyv3905 = make([]NodeSelectorTerm, yyrl3905) + } + } else { + yyv3905 = make([]NodeSelectorTerm, yyrl3905) + } + yyc3905 = true + yyrr3905 = len(yyv3905) + if yyrg3905 { + copy(yyv3905, yyv23905) + } + } else if yyl3905 != len(yyv3905) { + yyv3905 = yyv3905[:yyl3905] + yyc3905 = true + } + yyj3905 := 0 + for ; yyj3905 < yyrr3905; yyj3905++ { + yyh3905.ElemContainerState(yyj3905) + if r.TryDecodeAsNil() { + yyv3905[yyj3905] = NodeSelectorTerm{} + } else { + yyv3906 := &yyv3905[yyj3905] + yyv3906.CodecDecodeSelf(d) + } + + } + if yyrt3905 { + for ; yyj3905 < yyl3905; yyj3905++ { + yyv3905 = append(yyv3905, NodeSelectorTerm{}) + yyh3905.ElemContainerState(yyj3905) + if r.TryDecodeAsNil() { + yyv3905[yyj3905] = NodeSelectorTerm{} + } else { + yyv3907 := &yyv3905[yyj3905] + yyv3907.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3905 := 0 + for ; !r.CheckBreak(); yyj3905++ { + + if yyj3905 >= len(yyv3905) { + yyv3905 = append(yyv3905, NodeSelectorTerm{}) // var yyz3905 NodeSelectorTerm + yyc3905 = true + } + yyh3905.ElemContainerState(yyj3905) + if yyj3905 < len(yyv3905) { + if r.TryDecodeAsNil() { + yyv3905[yyj3905] = NodeSelectorTerm{} + } else { + yyv3908 := &yyv3905[yyj3905] + yyv3908.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3905 < len(yyv3905) { + yyv3905 = yyv3905[:yyj3905] + yyc3905 = true + } else if yyj3905 == 0 && yyv3905 == nil { + yyv3905 = []NodeSelectorTerm{} + yyc3905 = true + } + } + yyh3905.End() + if yyc3905 { + *v = yyv3905 + } +} + +func (x codecSelfer1234) encSliceNodeSelectorRequirement(v []NodeSelectorRequirement, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3909 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3910 := &yyv3909 + yy3910.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeSelectorRequirement(v *[]NodeSelectorRequirement, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3911 := *v + yyh3911, yyl3911 := z.DecSliceHelperStart() + var yyc3911 bool + if yyl3911 == 0 { + if yyv3911 == nil { + yyv3911 = []NodeSelectorRequirement{} + yyc3911 = true + } else if len(yyv3911) != 0 { + yyv3911 = yyv3911[:0] + yyc3911 = true + } + } else if yyl3911 > 0 { + var yyrr3911, yyrl3911 int + var yyrt3911 bool + if yyl3911 > cap(yyv3911) { + + yyrg3911 := len(yyv3911) > 0 + yyv23911 := yyv3911 + yyrl3911, yyrt3911 = z.DecInferLen(yyl3911, z.DecBasicHandle().MaxInitLen, 56) + if yyrt3911 { + if yyrl3911 <= cap(yyv3911) { + yyv3911 = yyv3911[:yyrl3911] + } else { + yyv3911 = make([]NodeSelectorRequirement, yyrl3911) + } + } else { + yyv3911 = make([]NodeSelectorRequirement, yyrl3911) + } + yyc3911 = true + yyrr3911 = len(yyv3911) + if yyrg3911 { + copy(yyv3911, yyv23911) + } + } else if yyl3911 != len(yyv3911) { + yyv3911 = yyv3911[:yyl3911] + yyc3911 = true + } + yyj3911 := 0 + for ; yyj3911 < yyrr3911; yyj3911++ { + yyh3911.ElemContainerState(yyj3911) + if r.TryDecodeAsNil() { + yyv3911[yyj3911] = NodeSelectorRequirement{} + } else { + yyv3912 := &yyv3911[yyj3911] + yyv3912.CodecDecodeSelf(d) + } + + } + if yyrt3911 { + for ; yyj3911 < yyl3911; yyj3911++ { + yyv3911 = append(yyv3911, NodeSelectorRequirement{}) + yyh3911.ElemContainerState(yyj3911) + if r.TryDecodeAsNil() { + yyv3911[yyj3911] = NodeSelectorRequirement{} + } else { + yyv3913 := &yyv3911[yyj3911] + yyv3913.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3911 := 0 + for ; !r.CheckBreak(); yyj3911++ { + + if yyj3911 >= len(yyv3911) { + yyv3911 = append(yyv3911, NodeSelectorRequirement{}) // var yyz3911 NodeSelectorRequirement + yyc3911 = true + } + yyh3911.ElemContainerState(yyj3911) + if yyj3911 < len(yyv3911) { + if r.TryDecodeAsNil() { + yyv3911[yyj3911] = NodeSelectorRequirement{} + } else { + yyv3914 := &yyv3911[yyj3911] + yyv3914.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3911 < len(yyv3911) { + yyv3911 = yyv3911[:yyj3911] + yyc3911 = true + } else if yyj3911 == 0 && yyv3911 == nil { + yyv3911 = []NodeSelectorRequirement{} + yyc3911 = true + } + } + yyh3911.End() + if yyc3911 { + *v = yyv3911 + } +} + +func (x codecSelfer1234) encSlicePreferredSchedulingTerm(v []PreferredSchedulingTerm, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3915 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3916 := &yyv3915 + yy3916.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePreferredSchedulingTerm(v *[]PreferredSchedulingTerm, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3917 := *v + yyh3917, yyl3917 := z.DecSliceHelperStart() + var yyc3917 bool + if yyl3917 == 0 { + if yyv3917 == nil { + yyv3917 = []PreferredSchedulingTerm{} + yyc3917 = true + } else if len(yyv3917) != 0 { + yyv3917 = yyv3917[:0] + yyc3917 = true + } + } else if yyl3917 > 0 { + var yyrr3917, yyrl3917 int + var yyrt3917 bool + if yyl3917 > cap(yyv3917) { + + yyrg3917 := len(yyv3917) > 0 + yyv23917 := yyv3917 + yyrl3917, yyrt3917 = z.DecInferLen(yyl3917, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3917 { + if yyrl3917 <= cap(yyv3917) { + yyv3917 = yyv3917[:yyrl3917] + } else { + yyv3917 = make([]PreferredSchedulingTerm, yyrl3917) + } + } else { + yyv3917 = make([]PreferredSchedulingTerm, yyrl3917) + } + yyc3917 = true + yyrr3917 = len(yyv3917) + if yyrg3917 { + copy(yyv3917, yyv23917) + } + } else if yyl3917 != len(yyv3917) { + yyv3917 = yyv3917[:yyl3917] + yyc3917 = true + } + yyj3917 := 0 + for ; yyj3917 < yyrr3917; yyj3917++ { + yyh3917.ElemContainerState(yyj3917) + if r.TryDecodeAsNil() { + yyv3917[yyj3917] = PreferredSchedulingTerm{} + } else { + yyv3918 := &yyv3917[yyj3917] + yyv3918.CodecDecodeSelf(d) + } + + } + if yyrt3917 { + for ; yyj3917 < yyl3917; yyj3917++ { + yyv3917 = append(yyv3917, PreferredSchedulingTerm{}) + yyh3917.ElemContainerState(yyj3917) + if r.TryDecodeAsNil() { + yyv3917[yyj3917] = PreferredSchedulingTerm{} + } else { + yyv3919 := &yyv3917[yyj3917] + yyv3919.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3917 := 0 + for ; !r.CheckBreak(); yyj3917++ { + + if yyj3917 >= len(yyv3917) { + yyv3917 = append(yyv3917, PreferredSchedulingTerm{}) // var yyz3917 PreferredSchedulingTerm + yyc3917 = true + } + yyh3917.ElemContainerState(yyj3917) + if yyj3917 < len(yyv3917) { + if r.TryDecodeAsNil() { + yyv3917[yyj3917] = PreferredSchedulingTerm{} + } else { + yyv3920 := &yyv3917[yyj3917] + yyv3920.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3917 < len(yyv3917) { + yyv3917 = yyv3917[:yyj3917] + yyc3917 = true + } else if yyj3917 == 0 && yyv3917 == nil { + yyv3917 = []PreferredSchedulingTerm{} + yyc3917 = true + } + } + yyh3917.End() + if yyc3917 { + *v = yyv3917 + } +} + +func (x codecSelfer1234) encSliceVolume(v []Volume, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3921 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3922 := &yyv3921 + yy3922.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceVolume(v *[]Volume, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3923 := *v + yyh3923, yyl3923 := z.DecSliceHelperStart() + var yyc3923 bool + if yyl3923 == 0 { + if yyv3923 == nil { + yyv3923 = []Volume{} + yyc3923 = true + } else if len(yyv3923) != 0 { + yyv3923 = yyv3923[:0] + yyc3923 = true + } + } else if yyl3923 > 0 { + var yyrr3923, yyrl3923 int + var yyrt3923 bool + if yyl3923 > cap(yyv3923) { + + yyrg3923 := len(yyv3923) > 0 + yyv23923 := yyv3923 + yyrl3923, yyrt3923 = z.DecInferLen(yyl3923, z.DecBasicHandle().MaxInitLen, 160) + if yyrt3923 { + if yyrl3923 <= cap(yyv3923) { + yyv3923 = yyv3923[:yyrl3923] + } else { + yyv3923 = make([]Volume, yyrl3923) + } + } else { + yyv3923 = make([]Volume, yyrl3923) + } + yyc3923 = true + yyrr3923 = len(yyv3923) + if yyrg3923 { + copy(yyv3923, yyv23923) + } + } else if yyl3923 != len(yyv3923) { + yyv3923 = yyv3923[:yyl3923] + yyc3923 = true + } + yyj3923 := 0 + for ; yyj3923 < yyrr3923; yyj3923++ { + yyh3923.ElemContainerState(yyj3923) + if r.TryDecodeAsNil() { + yyv3923[yyj3923] = Volume{} + } else { + yyv3924 := &yyv3923[yyj3923] + yyv3924.CodecDecodeSelf(d) + } + + } + if yyrt3923 { + for ; yyj3923 < yyl3923; yyj3923++ { + yyv3923 = append(yyv3923, Volume{}) + yyh3923.ElemContainerState(yyj3923) + if r.TryDecodeAsNil() { + yyv3923[yyj3923] = Volume{} + } else { + yyv3925 := &yyv3923[yyj3923] + yyv3925.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3923 := 0 + for ; !r.CheckBreak(); yyj3923++ { + + if yyj3923 >= len(yyv3923) { + yyv3923 = append(yyv3923, Volume{}) // var yyz3923 Volume + yyc3923 = true + } + yyh3923.ElemContainerState(yyj3923) + if yyj3923 < len(yyv3923) { + if r.TryDecodeAsNil() { + yyv3923[yyj3923] = Volume{} + } else { + yyv3926 := &yyv3923[yyj3923] + yyv3926.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3923 < len(yyv3923) { + yyv3923 = yyv3923[:yyj3923] + yyc3923 = true + } else if yyj3923 == 0 && yyv3923 == nil { + yyv3923 = []Volume{} + yyc3923 = true + } + } + yyh3923.End() + if yyc3923 { + *v = yyv3923 + } +} + +func (x codecSelfer1234) encSliceContainer(v []Container, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3927 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3928 := &yyv3927 + yy3928.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainer(v *[]Container, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3929 := *v + yyh3929, yyl3929 := z.DecSliceHelperStart() + var yyc3929 bool + if yyl3929 == 0 { + if yyv3929 == nil { + yyv3929 = []Container{} + yyc3929 = true + } else if len(yyv3929) != 0 { + yyv3929 = yyv3929[:0] + yyc3929 = true + } + } else if yyl3929 > 0 { + var yyrr3929, yyrl3929 int + var yyrt3929 bool + if yyl3929 > cap(yyv3929) { + + yyrg3929 := len(yyv3929) > 0 + yyv23929 := yyv3929 + yyrl3929, yyrt3929 = z.DecInferLen(yyl3929, z.DecBasicHandle().MaxInitLen, 256) + if yyrt3929 { + if yyrl3929 <= cap(yyv3929) { + yyv3929 = yyv3929[:yyrl3929] + } else { + yyv3929 = make([]Container, yyrl3929) + } + } else { + yyv3929 = make([]Container, yyrl3929) + } + yyc3929 = true + yyrr3929 = len(yyv3929) + if yyrg3929 { + copy(yyv3929, yyv23929) + } + } else if yyl3929 != len(yyv3929) { + yyv3929 = yyv3929[:yyl3929] + yyc3929 = true + } + yyj3929 := 0 + for ; yyj3929 < yyrr3929; yyj3929++ { + yyh3929.ElemContainerState(yyj3929) + if r.TryDecodeAsNil() { + yyv3929[yyj3929] = Container{} + } else { + yyv3930 := &yyv3929[yyj3929] + yyv3930.CodecDecodeSelf(d) + } + + } + if yyrt3929 { + for ; yyj3929 < yyl3929; yyj3929++ { + yyv3929 = append(yyv3929, Container{}) + yyh3929.ElemContainerState(yyj3929) + if r.TryDecodeAsNil() { + yyv3929[yyj3929] = Container{} + } else { + yyv3931 := &yyv3929[yyj3929] + yyv3931.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3929 := 0 + for ; !r.CheckBreak(); yyj3929++ { + + if yyj3929 >= len(yyv3929) { + yyv3929 = append(yyv3929, Container{}) // var yyz3929 Container + yyc3929 = true + } + yyh3929.ElemContainerState(yyj3929) + if yyj3929 < len(yyv3929) { + if r.TryDecodeAsNil() { + yyv3929[yyj3929] = Container{} + } else { + yyv3932 := &yyv3929[yyj3929] + yyv3932.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3929 < len(yyv3929) { + yyv3929 = yyv3929[:yyj3929] + yyc3929 = true + } else if yyj3929 == 0 && yyv3929 == nil { + yyv3929 = []Container{} + yyc3929 = true + } + } + yyh3929.End() + if yyc3929 { + *v = yyv3929 + } +} + +func (x codecSelfer1234) encSliceLocalObjectReference(v []LocalObjectReference, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3933 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3934 := &yyv3933 + yy3934.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLocalObjectReference(v *[]LocalObjectReference, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3935 := *v + yyh3935, yyl3935 := z.DecSliceHelperStart() + var yyc3935 bool + if yyl3935 == 0 { + if yyv3935 == nil { + yyv3935 = []LocalObjectReference{} + yyc3935 = true + } else if len(yyv3935) != 0 { + yyv3935 = yyv3935[:0] + yyc3935 = true + } + } else if yyl3935 > 0 { + var yyrr3935, yyrl3935 int + var yyrt3935 bool + if yyl3935 > cap(yyv3935) { + + yyrg3935 := len(yyv3935) > 0 + yyv23935 := yyv3935 + yyrl3935, yyrt3935 = z.DecInferLen(yyl3935, z.DecBasicHandle().MaxInitLen, 16) + if yyrt3935 { + if yyrl3935 <= cap(yyv3935) { + yyv3935 = yyv3935[:yyrl3935] + } else { + yyv3935 = make([]LocalObjectReference, yyrl3935) + } + } else { + yyv3935 = make([]LocalObjectReference, yyrl3935) + } + yyc3935 = true + yyrr3935 = len(yyv3935) + if yyrg3935 { + copy(yyv3935, yyv23935) + } + } else if yyl3935 != len(yyv3935) { + yyv3935 = yyv3935[:yyl3935] + yyc3935 = true + } + yyj3935 := 0 + for ; yyj3935 < yyrr3935; yyj3935++ { + yyh3935.ElemContainerState(yyj3935) + if r.TryDecodeAsNil() { + yyv3935[yyj3935] = LocalObjectReference{} + } else { + yyv3936 := &yyv3935[yyj3935] + yyv3936.CodecDecodeSelf(d) + } + + } + if yyrt3935 { + for ; yyj3935 < yyl3935; yyj3935++ { + yyv3935 = append(yyv3935, LocalObjectReference{}) + yyh3935.ElemContainerState(yyj3935) + if r.TryDecodeAsNil() { + yyv3935[yyj3935] = LocalObjectReference{} + } else { + yyv3937 := &yyv3935[yyj3935] + yyv3937.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3935 := 0 + for ; !r.CheckBreak(); yyj3935++ { + + if yyj3935 >= len(yyv3935) { + yyv3935 = append(yyv3935, LocalObjectReference{}) // var yyz3935 LocalObjectReference + yyc3935 = true + } + yyh3935.ElemContainerState(yyj3935) + if yyj3935 < len(yyv3935) { + if r.TryDecodeAsNil() { + yyv3935[yyj3935] = LocalObjectReference{} + } else { + yyv3938 := &yyv3935[yyj3935] + yyv3938.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3935 < len(yyv3935) { + yyv3935 = yyv3935[:yyj3935] + yyc3935 = true + } else if yyj3935 == 0 && yyv3935 == nil { + yyv3935 = []LocalObjectReference{} + yyc3935 = true + } + } + yyh3935.End() + if yyc3935 { + *v = yyv3935 + } +} + +func (x codecSelfer1234) encSlicePodCondition(v []PodCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3939 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3940 := &yyv3939 + yy3940.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePodCondition(v *[]PodCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3941 := *v + yyh3941, yyl3941 := z.DecSliceHelperStart() + var yyc3941 bool + if yyl3941 == 0 { + if yyv3941 == nil { + yyv3941 = []PodCondition{} + yyc3941 = true + } else if len(yyv3941) != 0 { + yyv3941 = yyv3941[:0] + yyc3941 = true + } + } else if yyl3941 > 0 { + var yyrr3941, yyrl3941 int + var yyrt3941 bool + if yyl3941 > cap(yyv3941) { + + yyrg3941 := len(yyv3941) > 0 + yyv23941 := yyv3941 + yyrl3941, yyrt3941 = z.DecInferLen(yyl3941, z.DecBasicHandle().MaxInitLen, 112) + if yyrt3941 { + if yyrl3941 <= cap(yyv3941) { + yyv3941 = yyv3941[:yyrl3941] + } else { + yyv3941 = make([]PodCondition, yyrl3941) + } + } else { + yyv3941 = make([]PodCondition, yyrl3941) + } + yyc3941 = true + yyrr3941 = len(yyv3941) + if yyrg3941 { + copy(yyv3941, yyv23941) + } + } else if yyl3941 != len(yyv3941) { + yyv3941 = yyv3941[:yyl3941] + yyc3941 = true + } + yyj3941 := 0 + for ; yyj3941 < yyrr3941; yyj3941++ { + yyh3941.ElemContainerState(yyj3941) + if r.TryDecodeAsNil() { + yyv3941[yyj3941] = PodCondition{} + } else { + yyv3942 := &yyv3941[yyj3941] + yyv3942.CodecDecodeSelf(d) + } + + } + if yyrt3941 { + for ; yyj3941 < yyl3941; yyj3941++ { + yyv3941 = append(yyv3941, PodCondition{}) + yyh3941.ElemContainerState(yyj3941) + if r.TryDecodeAsNil() { + yyv3941[yyj3941] = PodCondition{} + } else { + yyv3943 := &yyv3941[yyj3941] + yyv3943.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3941 := 0 + for ; !r.CheckBreak(); yyj3941++ { + + if yyj3941 >= len(yyv3941) { + yyv3941 = append(yyv3941, PodCondition{}) // var yyz3941 PodCondition + yyc3941 = true + } + yyh3941.ElemContainerState(yyj3941) + if yyj3941 < len(yyv3941) { + if r.TryDecodeAsNil() { + yyv3941[yyj3941] = PodCondition{} + } else { + yyv3944 := &yyv3941[yyj3941] + yyv3944.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3941 < len(yyv3941) { + yyv3941 = yyv3941[:yyj3941] + yyc3941 = true + } else if yyj3941 == 0 && yyv3941 == nil { + yyv3941 = []PodCondition{} + yyc3941 = true + } + } + yyh3941.End() + if yyc3941 { + *v = yyv3941 + } +} + +func (x codecSelfer1234) encSliceContainerStatus(v []ContainerStatus, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3945 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3946 := &yyv3945 + yy3946.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainerStatus(v *[]ContainerStatus, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3947 := *v + yyh3947, yyl3947 := z.DecSliceHelperStart() + var yyc3947 bool + if yyl3947 == 0 { + if yyv3947 == nil { + yyv3947 = []ContainerStatus{} + yyc3947 = true + } else if len(yyv3947) != 0 { + yyv3947 = yyv3947[:0] + yyc3947 = true + } + } else if yyl3947 > 0 { + var yyrr3947, yyrl3947 int + var yyrt3947 bool + if yyl3947 > cap(yyv3947) { + + yyrg3947 := len(yyv3947) > 0 + yyv23947 := yyv3947 + yyrl3947, yyrt3947 = z.DecInferLen(yyl3947, z.DecBasicHandle().MaxInitLen, 128) + if yyrt3947 { + if yyrl3947 <= cap(yyv3947) { + yyv3947 = yyv3947[:yyrl3947] + } else { + yyv3947 = make([]ContainerStatus, yyrl3947) + } + } else { + yyv3947 = make([]ContainerStatus, yyrl3947) + } + yyc3947 = true + yyrr3947 = len(yyv3947) + if yyrg3947 { + copy(yyv3947, yyv23947) + } + } else if yyl3947 != len(yyv3947) { + yyv3947 = yyv3947[:yyl3947] + yyc3947 = true + } + yyj3947 := 0 + for ; yyj3947 < yyrr3947; yyj3947++ { + yyh3947.ElemContainerState(yyj3947) + if r.TryDecodeAsNil() { + yyv3947[yyj3947] = ContainerStatus{} + } else { + yyv3948 := &yyv3947[yyj3947] + yyv3948.CodecDecodeSelf(d) + } + + } + if yyrt3947 { + for ; yyj3947 < yyl3947; yyj3947++ { + yyv3947 = append(yyv3947, ContainerStatus{}) + yyh3947.ElemContainerState(yyj3947) + if r.TryDecodeAsNil() { + yyv3947[yyj3947] = ContainerStatus{} + } else { + yyv3949 := &yyv3947[yyj3947] + yyv3949.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3947 := 0 + for ; !r.CheckBreak(); yyj3947++ { + + if yyj3947 >= len(yyv3947) { + yyv3947 = append(yyv3947, ContainerStatus{}) // var yyz3947 ContainerStatus + yyc3947 = true + } + yyh3947.ElemContainerState(yyj3947) + if yyj3947 < len(yyv3947) { + if r.TryDecodeAsNil() { + yyv3947[yyj3947] = ContainerStatus{} + } else { + yyv3950 := &yyv3947[yyj3947] + yyv3950.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3947 < len(yyv3947) { + yyv3947 = yyv3947[:yyj3947] + yyc3947 = true + } else if yyj3947 == 0 && yyv3947 == nil { + yyv3947 = []ContainerStatus{} + yyc3947 = true + } + } + yyh3947.End() + if yyc3947 { + *v = yyv3947 + } +} + +func (x codecSelfer1234) encSlicePodTemplate(v []PodTemplate, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3951 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3952 := &yyv3951 + yy3952.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePodTemplate(v *[]PodTemplate, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3953 := *v + yyh3953, yyl3953 := z.DecSliceHelperStart() + var yyc3953 bool + if yyl3953 == 0 { + if yyv3953 == nil { + yyv3953 = []PodTemplate{} + yyc3953 = true + } else if len(yyv3953) != 0 { + yyv3953 = yyv3953[:0] + yyc3953 = true + } + } else if yyl3953 > 0 { + var yyrr3953, yyrl3953 int + var yyrt3953 bool + if yyl3953 > cap(yyv3953) { + + yyrg3953 := len(yyv3953) > 0 + yyv23953 := yyv3953 + yyrl3953, yyrt3953 = z.DecInferLen(yyl3953, z.DecBasicHandle().MaxInitLen, 520) + if yyrt3953 { + if yyrl3953 <= cap(yyv3953) { + yyv3953 = yyv3953[:yyrl3953] + } else { + yyv3953 = make([]PodTemplate, yyrl3953) + } + } else { + yyv3953 = make([]PodTemplate, yyrl3953) + } + yyc3953 = true + yyrr3953 = len(yyv3953) + if yyrg3953 { + copy(yyv3953, yyv23953) + } + } else if yyl3953 != len(yyv3953) { + yyv3953 = yyv3953[:yyl3953] + yyc3953 = true + } + yyj3953 := 0 + for ; yyj3953 < yyrr3953; yyj3953++ { + yyh3953.ElemContainerState(yyj3953) + if r.TryDecodeAsNil() { + yyv3953[yyj3953] = PodTemplate{} + } else { + yyv3954 := &yyv3953[yyj3953] + yyv3954.CodecDecodeSelf(d) + } + + } + if yyrt3953 { + for ; yyj3953 < yyl3953; yyj3953++ { + yyv3953 = append(yyv3953, PodTemplate{}) + yyh3953.ElemContainerState(yyj3953) + if r.TryDecodeAsNil() { + yyv3953[yyj3953] = PodTemplate{} + } else { + yyv3955 := &yyv3953[yyj3953] + yyv3955.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3953 := 0 + for ; !r.CheckBreak(); yyj3953++ { + + if yyj3953 >= len(yyv3953) { + yyv3953 = append(yyv3953, PodTemplate{}) // var yyz3953 PodTemplate + yyc3953 = true + } + yyh3953.ElemContainerState(yyj3953) + if yyj3953 < len(yyv3953) { + if r.TryDecodeAsNil() { + yyv3953[yyj3953] = PodTemplate{} + } else { + yyv3956 := &yyv3953[yyj3953] + yyv3956.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3953 < len(yyv3953) { + yyv3953 = yyv3953[:yyj3953] + yyc3953 = true + } else if yyj3953 == 0 && yyv3953 == nil { + yyv3953 = []PodTemplate{} + yyc3953 = true + } + } + yyh3953.End() + if yyc3953 { + *v = yyv3953 + } +} + +func (x codecSelfer1234) encSliceReplicationController(v []ReplicationController, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3957 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3958 := &yyv3957 + yy3958.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceReplicationController(v *[]ReplicationController, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3959 := *v + yyh3959, yyl3959 := z.DecSliceHelperStart() + var yyc3959 bool + if yyl3959 == 0 { + if yyv3959 == nil { + yyv3959 = []ReplicationController{} + yyc3959 = true + } else if len(yyv3959) != 0 { + yyv3959 = yyv3959[:0] + yyc3959 = true + } + } else if yyl3959 > 0 { + var yyrr3959, yyrl3959 int + var yyrt3959 bool + if yyl3959 > cap(yyv3959) { + + yyrg3959 := len(yyv3959) > 0 + yyv23959 := yyv3959 + yyrl3959, yyrt3959 = z.DecInferLen(yyl3959, z.DecBasicHandle().MaxInitLen, 232) + if yyrt3959 { + if yyrl3959 <= cap(yyv3959) { + yyv3959 = yyv3959[:yyrl3959] + } else { + yyv3959 = make([]ReplicationController, yyrl3959) + } + } else { + yyv3959 = make([]ReplicationController, yyrl3959) + } + yyc3959 = true + yyrr3959 = len(yyv3959) + if yyrg3959 { + copy(yyv3959, yyv23959) + } + } else if yyl3959 != len(yyv3959) { + yyv3959 = yyv3959[:yyl3959] + yyc3959 = true + } + yyj3959 := 0 + for ; yyj3959 < yyrr3959; yyj3959++ { + yyh3959.ElemContainerState(yyj3959) + if r.TryDecodeAsNil() { + yyv3959[yyj3959] = ReplicationController{} + } else { + yyv3960 := &yyv3959[yyj3959] + yyv3960.CodecDecodeSelf(d) + } + + } + if yyrt3959 { + for ; yyj3959 < yyl3959; yyj3959++ { + yyv3959 = append(yyv3959, ReplicationController{}) + yyh3959.ElemContainerState(yyj3959) + if r.TryDecodeAsNil() { + yyv3959[yyj3959] = ReplicationController{} + } else { + yyv3961 := &yyv3959[yyj3959] + yyv3961.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3959 := 0 + for ; !r.CheckBreak(); yyj3959++ { + + if yyj3959 >= len(yyv3959) { + yyv3959 = append(yyv3959, ReplicationController{}) // var yyz3959 ReplicationController + yyc3959 = true + } + yyh3959.ElemContainerState(yyj3959) + if yyj3959 < len(yyv3959) { + if r.TryDecodeAsNil() { + yyv3959[yyj3959] = ReplicationController{} + } else { + yyv3962 := &yyv3959[yyj3959] + yyv3962.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3959 < len(yyv3959) { + yyv3959 = yyv3959[:yyj3959] + yyc3959 = true + } else if yyj3959 == 0 && yyv3959 == nil { + yyv3959 = []ReplicationController{} + yyc3959 = true + } + } + yyh3959.End() + if yyc3959 { + *v = yyv3959 + } +} + +func (x codecSelfer1234) encSliceService(v []Service, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3963 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3964 := &yyv3963 + yy3964.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceService(v *[]Service, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3965 := *v + yyh3965, yyl3965 := z.DecSliceHelperStart() + var yyc3965 bool + if yyl3965 == 0 { + if yyv3965 == nil { + yyv3965 = []Service{} + yyc3965 = true + } else if len(yyv3965) != 0 { + yyv3965 = yyv3965[:0] + yyc3965 = true + } + } else if yyl3965 > 0 { + var yyrr3965, yyrl3965 int + var yyrt3965 bool + if yyl3965 > cap(yyv3965) { + + yyrg3965 := len(yyv3965) > 0 + yyv23965 := yyv3965 + yyrl3965, yyrt3965 = z.DecInferLen(yyl3965, z.DecBasicHandle().MaxInitLen, 336) + if yyrt3965 { + if yyrl3965 <= cap(yyv3965) { + yyv3965 = yyv3965[:yyrl3965] + } else { + yyv3965 = make([]Service, yyrl3965) + } + } else { + yyv3965 = make([]Service, yyrl3965) + } + yyc3965 = true + yyrr3965 = len(yyv3965) + if yyrg3965 { + copy(yyv3965, yyv23965) + } + } else if yyl3965 != len(yyv3965) { + yyv3965 = yyv3965[:yyl3965] + yyc3965 = true + } + yyj3965 := 0 + for ; yyj3965 < yyrr3965; yyj3965++ { + yyh3965.ElemContainerState(yyj3965) + if r.TryDecodeAsNil() { + yyv3965[yyj3965] = Service{} + } else { + yyv3966 := &yyv3965[yyj3965] + yyv3966.CodecDecodeSelf(d) + } + + } + if yyrt3965 { + for ; yyj3965 < yyl3965; yyj3965++ { + yyv3965 = append(yyv3965, Service{}) + yyh3965.ElemContainerState(yyj3965) + if r.TryDecodeAsNil() { + yyv3965[yyj3965] = Service{} + } else { + yyv3967 := &yyv3965[yyj3965] + yyv3967.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3965 := 0 + for ; !r.CheckBreak(); yyj3965++ { + + if yyj3965 >= len(yyv3965) { + yyv3965 = append(yyv3965, Service{}) // var yyz3965 Service + yyc3965 = true + } + yyh3965.ElemContainerState(yyj3965) + if yyj3965 < len(yyv3965) { + if r.TryDecodeAsNil() { + yyv3965[yyj3965] = Service{} + } else { + yyv3968 := &yyv3965[yyj3965] + yyv3968.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3965 < len(yyv3965) { + yyv3965 = yyv3965[:yyj3965] + yyc3965 = true + } else if yyj3965 == 0 && yyv3965 == nil { + yyv3965 = []Service{} + yyc3965 = true + } + } + yyh3965.End() + if yyc3965 { + *v = yyv3965 + } +} + +func (x codecSelfer1234) encSliceLoadBalancerIngress(v []LoadBalancerIngress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3969 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3970 := &yyv3969 + yy3970.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLoadBalancerIngress(v *[]LoadBalancerIngress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3971 := *v + yyh3971, yyl3971 := z.DecSliceHelperStart() + var yyc3971 bool + if yyl3971 == 0 { + if yyv3971 == nil { + yyv3971 = []LoadBalancerIngress{} + yyc3971 = true + } else if len(yyv3971) != 0 { + yyv3971 = yyv3971[:0] + yyc3971 = true + } + } else if yyl3971 > 0 { + var yyrr3971, yyrl3971 int + var yyrt3971 bool + if yyl3971 > cap(yyv3971) { + + yyrg3971 := len(yyv3971) > 0 + yyv23971 := yyv3971 + yyrl3971, yyrt3971 = z.DecInferLen(yyl3971, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3971 { + if yyrl3971 <= cap(yyv3971) { + yyv3971 = yyv3971[:yyrl3971] + } else { + yyv3971 = make([]LoadBalancerIngress, yyrl3971) + } + } else { + yyv3971 = make([]LoadBalancerIngress, yyrl3971) + } + yyc3971 = true + yyrr3971 = len(yyv3971) + if yyrg3971 { + copy(yyv3971, yyv23971) + } + } else if yyl3971 != len(yyv3971) { + yyv3971 = yyv3971[:yyl3971] + yyc3971 = true + } + yyj3971 := 0 + for ; yyj3971 < yyrr3971; yyj3971++ { + yyh3971.ElemContainerState(yyj3971) + if r.TryDecodeAsNil() { + yyv3971[yyj3971] = LoadBalancerIngress{} + } else { + yyv3972 := &yyv3971[yyj3971] + yyv3972.CodecDecodeSelf(d) + } + + } + if yyrt3971 { + for ; yyj3971 < yyl3971; yyj3971++ { + yyv3971 = append(yyv3971, LoadBalancerIngress{}) + yyh3971.ElemContainerState(yyj3971) + if r.TryDecodeAsNil() { + yyv3971[yyj3971] = LoadBalancerIngress{} + } else { + yyv3973 := &yyv3971[yyj3971] + yyv3973.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3971 := 0 + for ; !r.CheckBreak(); yyj3971++ { + + if yyj3971 >= len(yyv3971) { + yyv3971 = append(yyv3971, LoadBalancerIngress{}) // var yyz3971 LoadBalancerIngress + yyc3971 = true + } + yyh3971.ElemContainerState(yyj3971) + if yyj3971 < len(yyv3971) { + if r.TryDecodeAsNil() { + yyv3971[yyj3971] = LoadBalancerIngress{} + } else { + yyv3974 := &yyv3971[yyj3971] + yyv3974.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3971 < len(yyv3971) { + yyv3971 = yyv3971[:yyj3971] + yyc3971 = true + } else if yyj3971 == 0 && yyv3971 == nil { + yyv3971 = []LoadBalancerIngress{} + yyc3971 = true + } + } + yyh3971.End() + if yyc3971 { + *v = yyv3971 + } +} + +func (x codecSelfer1234) encSliceServicePort(v []ServicePort, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3975 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3976 := &yyv3975 + yy3976.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceServicePort(v *[]ServicePort, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3977 := *v + yyh3977, yyl3977 := z.DecSliceHelperStart() + var yyc3977 bool + if yyl3977 == 0 { + if yyv3977 == nil { + yyv3977 = []ServicePort{} + yyc3977 = true + } else if len(yyv3977) != 0 { + yyv3977 = yyv3977[:0] + yyc3977 = true + } + } else if yyl3977 > 0 { + var yyrr3977, yyrl3977 int + var yyrt3977 bool + if yyl3977 > cap(yyv3977) { + + yyrg3977 := len(yyv3977) > 0 + yyv23977 := yyv3977 + yyrl3977, yyrt3977 = z.DecInferLen(yyl3977, z.DecBasicHandle().MaxInitLen, 80) + if yyrt3977 { + if yyrl3977 <= cap(yyv3977) { + yyv3977 = yyv3977[:yyrl3977] + } else { + yyv3977 = make([]ServicePort, yyrl3977) + } + } else { + yyv3977 = make([]ServicePort, yyrl3977) + } + yyc3977 = true + yyrr3977 = len(yyv3977) + if yyrg3977 { + copy(yyv3977, yyv23977) + } + } else if yyl3977 != len(yyv3977) { + yyv3977 = yyv3977[:yyl3977] + yyc3977 = true + } + yyj3977 := 0 + for ; yyj3977 < yyrr3977; yyj3977++ { + yyh3977.ElemContainerState(yyj3977) + if r.TryDecodeAsNil() { + yyv3977[yyj3977] = ServicePort{} + } else { + yyv3978 := &yyv3977[yyj3977] + yyv3978.CodecDecodeSelf(d) + } + + } + if yyrt3977 { + for ; yyj3977 < yyl3977; yyj3977++ { + yyv3977 = append(yyv3977, ServicePort{}) + yyh3977.ElemContainerState(yyj3977) + if r.TryDecodeAsNil() { + yyv3977[yyj3977] = ServicePort{} + } else { + yyv3979 := &yyv3977[yyj3977] + yyv3979.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3977 := 0 + for ; !r.CheckBreak(); yyj3977++ { + + if yyj3977 >= len(yyv3977) { + yyv3977 = append(yyv3977, ServicePort{}) // var yyz3977 ServicePort + yyc3977 = true + } + yyh3977.ElemContainerState(yyj3977) + if yyj3977 < len(yyv3977) { + if r.TryDecodeAsNil() { + yyv3977[yyj3977] = ServicePort{} + } else { + yyv3980 := &yyv3977[yyj3977] + yyv3980.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3977 < len(yyv3977) { + yyv3977 = yyv3977[:yyj3977] + yyc3977 = true + } else if yyj3977 == 0 && yyv3977 == nil { + yyv3977 = []ServicePort{} + yyc3977 = true + } + } + yyh3977.End() + if yyc3977 { + *v = yyv3977 + } +} + +func (x codecSelfer1234) encSliceObjectReference(v []ObjectReference, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3981 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3982 := &yyv3981 + yy3982.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceObjectReference(v *[]ObjectReference, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3983 := *v + yyh3983, yyl3983 := z.DecSliceHelperStart() + var yyc3983 bool + if yyl3983 == 0 { + if yyv3983 == nil { + yyv3983 = []ObjectReference{} + yyc3983 = true + } else if len(yyv3983) != 0 { + yyv3983 = yyv3983[:0] + yyc3983 = true + } + } else if yyl3983 > 0 { + var yyrr3983, yyrl3983 int + var yyrt3983 bool + if yyl3983 > cap(yyv3983) { + + yyrg3983 := len(yyv3983) > 0 + yyv23983 := yyv3983 + yyrl3983, yyrt3983 = z.DecInferLen(yyl3983, z.DecBasicHandle().MaxInitLen, 112) + if yyrt3983 { + if yyrl3983 <= cap(yyv3983) { + yyv3983 = yyv3983[:yyrl3983] + } else { + yyv3983 = make([]ObjectReference, yyrl3983) + } + } else { + yyv3983 = make([]ObjectReference, yyrl3983) + } + yyc3983 = true + yyrr3983 = len(yyv3983) + if yyrg3983 { + copy(yyv3983, yyv23983) + } + } else if yyl3983 != len(yyv3983) { + yyv3983 = yyv3983[:yyl3983] + yyc3983 = true + } + yyj3983 := 0 + for ; yyj3983 < yyrr3983; yyj3983++ { + yyh3983.ElemContainerState(yyj3983) + if r.TryDecodeAsNil() { + yyv3983[yyj3983] = ObjectReference{} + } else { + yyv3984 := &yyv3983[yyj3983] + yyv3984.CodecDecodeSelf(d) + } + + } + if yyrt3983 { + for ; yyj3983 < yyl3983; yyj3983++ { + yyv3983 = append(yyv3983, ObjectReference{}) + yyh3983.ElemContainerState(yyj3983) + if r.TryDecodeAsNil() { + yyv3983[yyj3983] = ObjectReference{} + } else { + yyv3985 := &yyv3983[yyj3983] + yyv3985.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3983 := 0 + for ; !r.CheckBreak(); yyj3983++ { + + if yyj3983 >= len(yyv3983) { + yyv3983 = append(yyv3983, ObjectReference{}) // var yyz3983 ObjectReference + yyc3983 = true + } + yyh3983.ElemContainerState(yyj3983) + if yyj3983 < len(yyv3983) { + if r.TryDecodeAsNil() { + yyv3983[yyj3983] = ObjectReference{} + } else { + yyv3986 := &yyv3983[yyj3983] + yyv3986.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3983 < len(yyv3983) { + yyv3983 = yyv3983[:yyj3983] + yyc3983 = true + } else if yyj3983 == 0 && yyv3983 == nil { + yyv3983 = []ObjectReference{} + yyc3983 = true + } + } + yyh3983.End() + if yyc3983 { + *v = yyv3983 + } +} + +func (x codecSelfer1234) encSliceServiceAccount(v []ServiceAccount, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3987 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3988 := &yyv3987 + yy3988.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceServiceAccount(v *[]ServiceAccount, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3989 := *v + yyh3989, yyl3989 := z.DecSliceHelperStart() + var yyc3989 bool + if yyl3989 == 0 { + if yyv3989 == nil { + yyv3989 = []ServiceAccount{} + yyc3989 = true + } else if len(yyv3989) != 0 { + yyv3989 = yyv3989[:0] + yyc3989 = true + } + } else if yyl3989 > 0 { + var yyrr3989, yyrl3989 int + var yyrt3989 bool + if yyl3989 > cap(yyv3989) { + + yyrg3989 := len(yyv3989) > 0 + yyv23989 := yyv3989 + yyrl3989, yyrt3989 = z.DecInferLen(yyl3989, z.DecBasicHandle().MaxInitLen, 240) + if yyrt3989 { + if yyrl3989 <= cap(yyv3989) { + yyv3989 = yyv3989[:yyrl3989] + } else { + yyv3989 = make([]ServiceAccount, yyrl3989) + } + } else { + yyv3989 = make([]ServiceAccount, yyrl3989) + } + yyc3989 = true + yyrr3989 = len(yyv3989) + if yyrg3989 { + copy(yyv3989, yyv23989) + } + } else if yyl3989 != len(yyv3989) { + yyv3989 = yyv3989[:yyl3989] + yyc3989 = true + } + yyj3989 := 0 + for ; yyj3989 < yyrr3989; yyj3989++ { + yyh3989.ElemContainerState(yyj3989) + if r.TryDecodeAsNil() { + yyv3989[yyj3989] = ServiceAccount{} + } else { + yyv3990 := &yyv3989[yyj3989] + yyv3990.CodecDecodeSelf(d) + } + + } + if yyrt3989 { + for ; yyj3989 < yyl3989; yyj3989++ { + yyv3989 = append(yyv3989, ServiceAccount{}) + yyh3989.ElemContainerState(yyj3989) + if r.TryDecodeAsNil() { + yyv3989[yyj3989] = ServiceAccount{} + } else { + yyv3991 := &yyv3989[yyj3989] + yyv3991.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3989 := 0 + for ; !r.CheckBreak(); yyj3989++ { + + if yyj3989 >= len(yyv3989) { + yyv3989 = append(yyv3989, ServiceAccount{}) // var yyz3989 ServiceAccount + yyc3989 = true + } + yyh3989.ElemContainerState(yyj3989) + if yyj3989 < len(yyv3989) { + if r.TryDecodeAsNil() { + yyv3989[yyj3989] = ServiceAccount{} + } else { + yyv3992 := &yyv3989[yyj3989] + yyv3992.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3989 < len(yyv3989) { + yyv3989 = yyv3989[:yyj3989] + yyc3989 = true + } else if yyj3989 == 0 && yyv3989 == nil { + yyv3989 = []ServiceAccount{} + yyc3989 = true + } + } + yyh3989.End() + if yyc3989 { + *v = yyv3989 + } +} + +func (x codecSelfer1234) encSliceEndpointSubset(v []EndpointSubset, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3993 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3994 := &yyv3993 + yy3994.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointSubset(v *[]EndpointSubset, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3995 := *v + yyh3995, yyl3995 := z.DecSliceHelperStart() + var yyc3995 bool + if yyl3995 == 0 { + if yyv3995 == nil { + yyv3995 = []EndpointSubset{} + yyc3995 = true + } else if len(yyv3995) != 0 { + yyv3995 = yyv3995[:0] + yyc3995 = true + } + } else if yyl3995 > 0 { + var yyrr3995, yyrl3995 int + var yyrt3995 bool + if yyl3995 > cap(yyv3995) { + + yyrg3995 := len(yyv3995) > 0 + yyv23995 := yyv3995 + yyrl3995, yyrt3995 = z.DecInferLen(yyl3995, z.DecBasicHandle().MaxInitLen, 72) + if yyrt3995 { + if yyrl3995 <= cap(yyv3995) { + yyv3995 = yyv3995[:yyrl3995] + } else { + yyv3995 = make([]EndpointSubset, yyrl3995) + } + } else { + yyv3995 = make([]EndpointSubset, yyrl3995) + } + yyc3995 = true + yyrr3995 = len(yyv3995) + if yyrg3995 { + copy(yyv3995, yyv23995) + } + } else if yyl3995 != len(yyv3995) { + yyv3995 = yyv3995[:yyl3995] + yyc3995 = true + } + yyj3995 := 0 + for ; yyj3995 < yyrr3995; yyj3995++ { + yyh3995.ElemContainerState(yyj3995) + if r.TryDecodeAsNil() { + yyv3995[yyj3995] = EndpointSubset{} + } else { + yyv3996 := &yyv3995[yyj3995] + yyv3996.CodecDecodeSelf(d) + } + + } + if yyrt3995 { + for ; yyj3995 < yyl3995; yyj3995++ { + yyv3995 = append(yyv3995, EndpointSubset{}) + yyh3995.ElemContainerState(yyj3995) + if r.TryDecodeAsNil() { + yyv3995[yyj3995] = EndpointSubset{} + } else { + yyv3997 := &yyv3995[yyj3995] + yyv3997.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3995 := 0 + for ; !r.CheckBreak(); yyj3995++ { + + if yyj3995 >= len(yyv3995) { + yyv3995 = append(yyv3995, EndpointSubset{}) // var yyz3995 EndpointSubset + yyc3995 = true + } + yyh3995.ElemContainerState(yyj3995) + if yyj3995 < len(yyv3995) { + if r.TryDecodeAsNil() { + yyv3995[yyj3995] = EndpointSubset{} + } else { + yyv3998 := &yyv3995[yyj3995] + yyv3998.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3995 < len(yyv3995) { + yyv3995 = yyv3995[:yyj3995] + yyc3995 = true + } else if yyj3995 == 0 && yyv3995 == nil { + yyv3995 = []EndpointSubset{} + yyc3995 = true + } + } + yyh3995.End() + if yyc3995 { + *v = yyv3995 + } +} + +func (x codecSelfer1234) encSliceEndpointAddress(v []EndpointAddress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3999 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4000 := &yyv3999 + yy4000.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointAddress(v *[]EndpointAddress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4001 := *v + yyh4001, yyl4001 := z.DecSliceHelperStart() + var yyc4001 bool + if yyl4001 == 0 { + if yyv4001 == nil { + yyv4001 = []EndpointAddress{} + yyc4001 = true + } else if len(yyv4001) != 0 { + yyv4001 = yyv4001[:0] + yyc4001 = true + } + } else if yyl4001 > 0 { + var yyrr4001, yyrl4001 int + var yyrt4001 bool + if yyl4001 > cap(yyv4001) { + + yyrg4001 := len(yyv4001) > 0 + yyv24001 := yyv4001 + yyrl4001, yyrt4001 = z.DecInferLen(yyl4001, z.DecBasicHandle().MaxInitLen, 24) + if yyrt4001 { + if yyrl4001 <= cap(yyv4001) { + yyv4001 = yyv4001[:yyrl4001] + } else { + yyv4001 = make([]EndpointAddress, yyrl4001) + } + } else { + yyv4001 = make([]EndpointAddress, yyrl4001) + } + yyc4001 = true + yyrr4001 = len(yyv4001) + if yyrg4001 { + copy(yyv4001, yyv24001) + } + } else if yyl4001 != len(yyv4001) { + yyv4001 = yyv4001[:yyl4001] + yyc4001 = true + } + yyj4001 := 0 + for ; yyj4001 < yyrr4001; yyj4001++ { + yyh4001.ElemContainerState(yyj4001) + if r.TryDecodeAsNil() { + yyv4001[yyj4001] = EndpointAddress{} + } else { + yyv4002 := &yyv4001[yyj4001] + yyv4002.CodecDecodeSelf(d) + } + + } + if yyrt4001 { + for ; yyj4001 < yyl4001; yyj4001++ { + yyv4001 = append(yyv4001, EndpointAddress{}) + yyh4001.ElemContainerState(yyj4001) + if r.TryDecodeAsNil() { + yyv4001[yyj4001] = EndpointAddress{} + } else { + yyv4003 := &yyv4001[yyj4001] + yyv4003.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4001 := 0 + for ; !r.CheckBreak(); yyj4001++ { + + if yyj4001 >= len(yyv4001) { + yyv4001 = append(yyv4001, EndpointAddress{}) // var yyz4001 EndpointAddress + yyc4001 = true + } + yyh4001.ElemContainerState(yyj4001) + if yyj4001 < len(yyv4001) { + if r.TryDecodeAsNil() { + yyv4001[yyj4001] = EndpointAddress{} + } else { + yyv4004 := &yyv4001[yyj4001] + yyv4004.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4001 < len(yyv4001) { + yyv4001 = yyv4001[:yyj4001] + yyc4001 = true + } else if yyj4001 == 0 && yyv4001 == nil { + yyv4001 = []EndpointAddress{} + yyc4001 = true + } + } + yyh4001.End() + if yyc4001 { + *v = yyv4001 + } +} + +func (x codecSelfer1234) encSliceEndpointPort(v []EndpointPort, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4005 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4006 := &yyv4005 + yy4006.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointPort(v *[]EndpointPort, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4007 := *v + yyh4007, yyl4007 := z.DecSliceHelperStart() + var yyc4007 bool + if yyl4007 == 0 { + if yyv4007 == nil { + yyv4007 = []EndpointPort{} + yyc4007 = true + } else if len(yyv4007) != 0 { + yyv4007 = yyv4007[:0] + yyc4007 = true + } + } else if yyl4007 > 0 { + var yyrr4007, yyrl4007 int + var yyrt4007 bool + if yyl4007 > cap(yyv4007) { + + yyrg4007 := len(yyv4007) > 0 + yyv24007 := yyv4007 + yyrl4007, yyrt4007 = z.DecInferLen(yyl4007, z.DecBasicHandle().MaxInitLen, 40) + if yyrt4007 { + if yyrl4007 <= cap(yyv4007) { + yyv4007 = yyv4007[:yyrl4007] + } else { + yyv4007 = make([]EndpointPort, yyrl4007) + } + } else { + yyv4007 = make([]EndpointPort, yyrl4007) + } + yyc4007 = true + yyrr4007 = len(yyv4007) + if yyrg4007 { + copy(yyv4007, yyv24007) + } + } else if yyl4007 != len(yyv4007) { + yyv4007 = yyv4007[:yyl4007] + yyc4007 = true + } + yyj4007 := 0 + for ; yyj4007 < yyrr4007; yyj4007++ { + yyh4007.ElemContainerState(yyj4007) + if r.TryDecodeAsNil() { + yyv4007[yyj4007] = EndpointPort{} + } else { + yyv4008 := &yyv4007[yyj4007] + yyv4008.CodecDecodeSelf(d) + } + + } + if yyrt4007 { + for ; yyj4007 < yyl4007; yyj4007++ { + yyv4007 = append(yyv4007, EndpointPort{}) + yyh4007.ElemContainerState(yyj4007) + if r.TryDecodeAsNil() { + yyv4007[yyj4007] = EndpointPort{} + } else { + yyv4009 := &yyv4007[yyj4007] + yyv4009.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4007 := 0 + for ; !r.CheckBreak(); yyj4007++ { + + if yyj4007 >= len(yyv4007) { + yyv4007 = append(yyv4007, EndpointPort{}) // var yyz4007 EndpointPort + yyc4007 = true + } + yyh4007.ElemContainerState(yyj4007) + if yyj4007 < len(yyv4007) { + if r.TryDecodeAsNil() { + yyv4007[yyj4007] = EndpointPort{} + } else { + yyv4010 := &yyv4007[yyj4007] + yyv4010.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4007 < len(yyv4007) { + yyv4007 = yyv4007[:yyj4007] + yyc4007 = true + } else if yyj4007 == 0 && yyv4007 == nil { + yyv4007 = []EndpointPort{} + yyc4007 = true + } + } + yyh4007.End() + if yyc4007 { + *v = yyv4007 + } +} + +func (x codecSelfer1234) encSliceEndpoints(v []Endpoints, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4011 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4012 := &yyv4011 + yy4012.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpoints(v *[]Endpoints, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4013 := *v + yyh4013, yyl4013 := z.DecSliceHelperStart() + var yyc4013 bool + if yyl4013 == 0 { + if yyv4013 == nil { + yyv4013 = []Endpoints{} + yyc4013 = true + } else if len(yyv4013) != 0 { + yyv4013 = yyv4013[:0] + yyc4013 = true + } + } else if yyl4013 > 0 { + var yyrr4013, yyrl4013 int + var yyrt4013 bool + if yyl4013 > cap(yyv4013) { + + yyrg4013 := len(yyv4013) > 0 + yyv24013 := yyv4013 + yyrl4013, yyrt4013 = z.DecInferLen(yyl4013, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4013 { + if yyrl4013 <= cap(yyv4013) { + yyv4013 = yyv4013[:yyrl4013] + } else { + yyv4013 = make([]Endpoints, yyrl4013) + } + } else { + yyv4013 = make([]Endpoints, yyrl4013) + } + yyc4013 = true + yyrr4013 = len(yyv4013) + if yyrg4013 { + copy(yyv4013, yyv24013) + } + } else if yyl4013 != len(yyv4013) { + yyv4013 = yyv4013[:yyl4013] + yyc4013 = true + } + yyj4013 := 0 + for ; yyj4013 < yyrr4013; yyj4013++ { + yyh4013.ElemContainerState(yyj4013) + if r.TryDecodeAsNil() { + yyv4013[yyj4013] = Endpoints{} + } else { + yyv4014 := &yyv4013[yyj4013] + yyv4014.CodecDecodeSelf(d) + } + + } + if yyrt4013 { + for ; yyj4013 < yyl4013; yyj4013++ { + yyv4013 = append(yyv4013, Endpoints{}) + yyh4013.ElemContainerState(yyj4013) + if r.TryDecodeAsNil() { + yyv4013[yyj4013] = Endpoints{} + } else { + yyv4015 := &yyv4013[yyj4013] + yyv4015.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4013 := 0 + for ; !r.CheckBreak(); yyj4013++ { + + if yyj4013 >= len(yyv4013) { + yyv4013 = append(yyv4013, Endpoints{}) // var yyz4013 Endpoints + yyc4013 = true + } + yyh4013.ElemContainerState(yyj4013) + if yyj4013 < len(yyv4013) { + if r.TryDecodeAsNil() { + yyv4013[yyj4013] = Endpoints{} + } else { + yyv4016 := &yyv4013[yyj4013] + yyv4016.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4013 < len(yyv4013) { + yyv4013 = yyv4013[:yyj4013] + yyc4013 = true + } else if yyj4013 == 0 && yyv4013 == nil { + yyv4013 = []Endpoints{} + yyc4013 = true + } + } + yyh4013.End() + if yyc4013 { + *v = yyv4013 + } +} + +func (x codecSelfer1234) encSliceNodeCondition(v []NodeCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4017 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4018 := &yyv4017 + yy4018.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4019 := *v + yyh4019, yyl4019 := z.DecSliceHelperStart() + var yyc4019 bool + if yyl4019 == 0 { + if yyv4019 == nil { + yyv4019 = []NodeCondition{} + yyc4019 = true + } else if len(yyv4019) != 0 { + yyv4019 = yyv4019[:0] + yyc4019 = true + } + } else if yyl4019 > 0 { + var yyrr4019, yyrl4019 int + var yyrt4019 bool + if yyl4019 > cap(yyv4019) { + + yyrg4019 := len(yyv4019) > 0 + yyv24019 := yyv4019 + yyrl4019, yyrt4019 = z.DecInferLen(yyl4019, z.DecBasicHandle().MaxInitLen, 112) + if yyrt4019 { + if yyrl4019 <= cap(yyv4019) { + yyv4019 = yyv4019[:yyrl4019] + } else { + yyv4019 = make([]NodeCondition, yyrl4019) + } + } else { + yyv4019 = make([]NodeCondition, yyrl4019) + } + yyc4019 = true + yyrr4019 = len(yyv4019) + if yyrg4019 { + copy(yyv4019, yyv24019) + } + } else if yyl4019 != len(yyv4019) { + yyv4019 = yyv4019[:yyl4019] + yyc4019 = true + } + yyj4019 := 0 + for ; yyj4019 < yyrr4019; yyj4019++ { + yyh4019.ElemContainerState(yyj4019) + if r.TryDecodeAsNil() { + yyv4019[yyj4019] = NodeCondition{} + } else { + yyv4020 := &yyv4019[yyj4019] + yyv4020.CodecDecodeSelf(d) + } + + } + if yyrt4019 { + for ; yyj4019 < yyl4019; yyj4019++ { + yyv4019 = append(yyv4019, NodeCondition{}) + yyh4019.ElemContainerState(yyj4019) + if r.TryDecodeAsNil() { + yyv4019[yyj4019] = NodeCondition{} + } else { + yyv4021 := &yyv4019[yyj4019] + yyv4021.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4019 := 0 + for ; !r.CheckBreak(); yyj4019++ { + + if yyj4019 >= len(yyv4019) { + yyv4019 = append(yyv4019, NodeCondition{}) // var yyz4019 NodeCondition + yyc4019 = true + } + yyh4019.ElemContainerState(yyj4019) + if yyj4019 < len(yyv4019) { + if r.TryDecodeAsNil() { + yyv4019[yyj4019] = NodeCondition{} + } else { + yyv4022 := &yyv4019[yyj4019] + yyv4022.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4019 < len(yyv4019) { + yyv4019 = yyv4019[:yyj4019] + yyc4019 = true + } else if yyj4019 == 0 && yyv4019 == nil { + yyv4019 = []NodeCondition{} + yyc4019 = true + } + } + yyh4019.End() + if yyc4019 { + *v = yyv4019 + } +} + +func (x codecSelfer1234) encSliceNodeAddress(v []NodeAddress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4023 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4024 := &yyv4023 + yy4024.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4025 := *v + yyh4025, yyl4025 := z.DecSliceHelperStart() + var yyc4025 bool + if yyl4025 == 0 { + if yyv4025 == nil { + yyv4025 = []NodeAddress{} + yyc4025 = true + } else if len(yyv4025) != 0 { + yyv4025 = yyv4025[:0] + yyc4025 = true + } + } else if yyl4025 > 0 { + var yyrr4025, yyrl4025 int + var yyrt4025 bool + if yyl4025 > cap(yyv4025) { + + yyrg4025 := len(yyv4025) > 0 + yyv24025 := yyv4025 + yyrl4025, yyrt4025 = z.DecInferLen(yyl4025, z.DecBasicHandle().MaxInitLen, 32) + if yyrt4025 { + if yyrl4025 <= cap(yyv4025) { + yyv4025 = yyv4025[:yyrl4025] + } else { + yyv4025 = make([]NodeAddress, yyrl4025) + } + } else { + yyv4025 = make([]NodeAddress, yyrl4025) + } + yyc4025 = true + yyrr4025 = len(yyv4025) + if yyrg4025 { + copy(yyv4025, yyv24025) + } + } else if yyl4025 != len(yyv4025) { + yyv4025 = yyv4025[:yyl4025] + yyc4025 = true + } + yyj4025 := 0 + for ; yyj4025 < yyrr4025; yyj4025++ { + yyh4025.ElemContainerState(yyj4025) + if r.TryDecodeAsNil() { + yyv4025[yyj4025] = NodeAddress{} + } else { + yyv4026 := &yyv4025[yyj4025] + yyv4026.CodecDecodeSelf(d) + } + + } + if yyrt4025 { + for ; yyj4025 < yyl4025; yyj4025++ { + yyv4025 = append(yyv4025, NodeAddress{}) + yyh4025.ElemContainerState(yyj4025) + if r.TryDecodeAsNil() { + yyv4025[yyj4025] = NodeAddress{} + } else { + yyv4027 := &yyv4025[yyj4025] + yyv4027.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4025 := 0 + for ; !r.CheckBreak(); yyj4025++ { + + if yyj4025 >= len(yyv4025) { + yyv4025 = append(yyv4025, NodeAddress{}) // var yyz4025 NodeAddress + yyc4025 = true + } + yyh4025.ElemContainerState(yyj4025) + if yyj4025 < len(yyv4025) { + if r.TryDecodeAsNil() { + yyv4025[yyj4025] = NodeAddress{} + } else { + yyv4028 := &yyv4025[yyj4025] + yyv4028.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4025 < len(yyv4025) { + yyv4025 = yyv4025[:yyj4025] + yyc4025 = true + } else if yyj4025 == 0 && yyv4025 == nil { + yyv4025 = []NodeAddress{} + yyc4025 = true + } + } + yyh4025.End() + if yyc4025 { + *v = yyv4025 + } +} + +func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4029 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4030 := &yyv4029 + yy4030.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4031 := *v + yyh4031, yyl4031 := z.DecSliceHelperStart() + var yyc4031 bool + if yyl4031 == 0 { + if yyv4031 == nil { + yyv4031 = []ContainerImage{} + yyc4031 = true + } else if len(yyv4031) != 0 { + yyv4031 = yyv4031[:0] + yyc4031 = true + } + } else if yyl4031 > 0 { + var yyrr4031, yyrl4031 int + var yyrt4031 bool + if yyl4031 > cap(yyv4031) { + + yyrg4031 := len(yyv4031) > 0 + yyv24031 := yyv4031 + yyrl4031, yyrt4031 = z.DecInferLen(yyl4031, z.DecBasicHandle().MaxInitLen, 32) + if yyrt4031 { + if yyrl4031 <= cap(yyv4031) { + yyv4031 = yyv4031[:yyrl4031] + } else { + yyv4031 = make([]ContainerImage, yyrl4031) + } + } else { + yyv4031 = make([]ContainerImage, yyrl4031) + } + yyc4031 = true + yyrr4031 = len(yyv4031) + if yyrg4031 { + copy(yyv4031, yyv24031) + } + } else if yyl4031 != len(yyv4031) { + yyv4031 = yyv4031[:yyl4031] + yyc4031 = true + } + yyj4031 := 0 + for ; yyj4031 < yyrr4031; yyj4031++ { + yyh4031.ElemContainerState(yyj4031) + if r.TryDecodeAsNil() { + yyv4031[yyj4031] = ContainerImage{} + } else { + yyv4032 := &yyv4031[yyj4031] + yyv4032.CodecDecodeSelf(d) + } + + } + if yyrt4031 { + for ; yyj4031 < yyl4031; yyj4031++ { + yyv4031 = append(yyv4031, ContainerImage{}) + yyh4031.ElemContainerState(yyj4031) + if r.TryDecodeAsNil() { + yyv4031[yyj4031] = ContainerImage{} + } else { + yyv4033 := &yyv4031[yyj4031] + yyv4033.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4031 := 0 + for ; !r.CheckBreak(); yyj4031++ { + + if yyj4031 >= len(yyv4031) { + yyv4031 = append(yyv4031, ContainerImage{}) // var yyz4031 ContainerImage + yyc4031 = true + } + yyh4031.ElemContainerState(yyj4031) + if yyj4031 < len(yyv4031) { + if r.TryDecodeAsNil() { + yyv4031[yyj4031] = ContainerImage{} + } else { + yyv4034 := &yyv4031[yyj4031] + yyv4034.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4031 < len(yyv4031) { + yyv4031 = yyv4031[:yyj4031] + yyc4031 = true + } else if yyj4031 == 0 && yyv4031 == nil { + yyv4031 = []ContainerImage{} + yyc4031 = true + } + } + yyh4031.End() + if yyc4031 { + *v = yyv4031 + } +} + func (x codecSelfer1234) encResourceList(v ResourceList, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeMapStart(len(v)) - for yyk3862, yyv3862 := range v { + for yyk4035, yyv4035 := range v { z.EncSendContainerState(codecSelfer_containerMapKey1234) - yyk3862.CodecEncodeSelf(e) + yyk4035.CodecEncodeSelf(e) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3863 := &yyv3862 - yym3864 := z.EncBinary() - _ = yym3864 + yy4036 := &yyv4035 + yym4037 := z.EncBinary() + _ = yym4037 if false { - } else if z.HasExtensions() && z.EncExt(yy3863) { - } else if !yym3864 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3863) + } else if z.HasExtensions() && z.EncExt(yy4036) { + } else if !yym4037 && z.IsJSONHandle() { + z.EncJSONMarshal(yy4036) } else { - z.EncFallback(yy3863) + z.EncFallback(yy4036) } } z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -48930,86 +51513,86 @@ func (x codecSelfer1234) decResourceList(v *ResourceList, d *codec1978.Decoder) z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3865 := *v - yyl3865 := r.ReadMapStart() - yybh3865 := z.DecBasicHandle() - if yyv3865 == nil { - yyrl3865, _ := z.DecInferLen(yyl3865, yybh3865.MaxInitLen, 40) - yyv3865 = make(map[ResourceName]pkg3_resource.Quantity, yyrl3865) - *v = yyv3865 + yyv4038 := *v + yyl4038 := r.ReadMapStart() + yybh4038 := z.DecBasicHandle() + if yyv4038 == nil { + yyrl4038, _ := z.DecInferLen(yyl4038, yybh4038.MaxInitLen, 40) + yyv4038 = make(map[ResourceName]pkg3_resource.Quantity, yyrl4038) + *v = yyv4038 } - var yymk3865 ResourceName - var yymv3865 pkg3_resource.Quantity - var yymg3865 bool - if yybh3865.MapValueReset { - yymg3865 = true + var yymk4038 ResourceName + var yymv4038 pkg3_resource.Quantity + var yymg4038 bool + if yybh4038.MapValueReset { + yymg4038 = true } - if yyl3865 > 0 { - for yyj3865 := 0; yyj3865 < yyl3865; yyj3865++ { + if yyl4038 > 0 { + for yyj4038 := 0; yyj4038 < yyl4038; yyj4038++ { z.DecSendContainerState(codecSelfer_containerMapKey1234) if r.TryDecodeAsNil() { - yymk3865 = "" + yymk4038 = "" } else { - yymk3865 = ResourceName(r.DecodeString()) + yymk4038 = ResourceName(r.DecodeString()) } - if yymg3865 { - yymv3865 = yyv3865[yymk3865] + if yymg4038 { + yymv4038 = yyv4038[yymk4038] } else { - yymv3865 = pkg3_resource.Quantity{} + yymv4038 = pkg3_resource.Quantity{} } z.DecSendContainerState(codecSelfer_containerMapValue1234) if r.TryDecodeAsNil() { - yymv3865 = pkg3_resource.Quantity{} + yymv4038 = pkg3_resource.Quantity{} } else { - yyv3867 := &yymv3865 - yym3868 := z.DecBinary() - _ = yym3868 + yyv4040 := &yymv4038 + yym4041 := z.DecBinary() + _ = yym4041 if false { - } else if z.HasExtensions() && z.DecExt(yyv3867) { - } else if !yym3868 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3867) + } else if z.HasExtensions() && z.DecExt(yyv4040) { + } else if !yym4041 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4040) } else { - z.DecFallback(yyv3867, false) + z.DecFallback(yyv4040, false) } } - if yyv3865 != nil { - yyv3865[yymk3865] = yymv3865 + if yyv4038 != nil { + yyv4038[yymk4038] = yymv4038 } } - } else if yyl3865 < 0 { - for yyj3865 := 0; !r.CheckBreak(); yyj3865++ { + } else if yyl4038 < 0 { + for yyj4038 := 0; !r.CheckBreak(); yyj4038++ { z.DecSendContainerState(codecSelfer_containerMapKey1234) if r.TryDecodeAsNil() { - yymk3865 = "" + yymk4038 = "" } else { - yymk3865 = ResourceName(r.DecodeString()) + yymk4038 = ResourceName(r.DecodeString()) } - if yymg3865 { - yymv3865 = yyv3865[yymk3865] + if yymg4038 { + yymv4038 = yyv4038[yymk4038] } else { - yymv3865 = pkg3_resource.Quantity{} + yymv4038 = pkg3_resource.Quantity{} } z.DecSendContainerState(codecSelfer_containerMapValue1234) if r.TryDecodeAsNil() { - yymv3865 = pkg3_resource.Quantity{} + yymv4038 = pkg3_resource.Quantity{} } else { - yyv3870 := &yymv3865 - yym3871 := z.DecBinary() - _ = yym3871 + yyv4043 := &yymv4038 + yym4044 := z.DecBinary() + _ = yym4044 if false { - } else if z.HasExtensions() && z.DecExt(yyv3870) { - } else if !yym3871 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3870) + } else if z.HasExtensions() && z.DecExt(yyv4043) { + } else if !yym4044 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4043) } else { - z.DecFallback(yyv3870, false) + z.DecFallback(yyv4043, false) } } - if yyv3865 != nil { - yyv3865[yymk3865] = yymv3865 + if yyv4038 != nil { + yyv4038[yymk4038] = yymv4038 } } } // else len==0: TODO: Should we clear map entries? @@ -49021,10 +51604,10 @@ func (x codecSelfer1234) encSliceNode(v []Node, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3872 := range v { + for _, yyv4045 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3873 := &yyv3872 - yy3873.CodecEncodeSelf(e) + yy4046 := &yyv4045 + yy4046.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49034,83 +51617,83 @@ func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3874 := *v - yyh3874, yyl3874 := z.DecSliceHelperStart() - var yyc3874 bool - if yyl3874 == 0 { - if yyv3874 == nil { - yyv3874 = []Node{} - yyc3874 = true - } else if len(yyv3874) != 0 { - yyv3874 = yyv3874[:0] - yyc3874 = true + yyv4047 := *v + yyh4047, yyl4047 := z.DecSliceHelperStart() + var yyc4047 bool + if yyl4047 == 0 { + if yyv4047 == nil { + yyv4047 = []Node{} + yyc4047 = true + } else if len(yyv4047) != 0 { + yyv4047 = yyv4047[:0] + yyc4047 = true } - } else if yyl3874 > 0 { - var yyrr3874, yyrl3874 int - var yyrt3874 bool - if yyl3874 > cap(yyv3874) { + } else if yyl4047 > 0 { + var yyrr4047, yyrl4047 int + var yyrt4047 bool + if yyl4047 > cap(yyv4047) { - yyrg3874 := len(yyv3874) > 0 - yyv23874 := yyv3874 - yyrl3874, yyrt3874 = z.DecInferLen(yyl3874, z.DecBasicHandle().MaxInitLen, 488) - if yyrt3874 { - if yyrl3874 <= cap(yyv3874) { - yyv3874 = yyv3874[:yyrl3874] + yyrg4047 := len(yyv4047) > 0 + yyv24047 := yyv4047 + yyrl4047, yyrt4047 = z.DecInferLen(yyl4047, z.DecBasicHandle().MaxInitLen, 488) + if yyrt4047 { + if yyrl4047 <= cap(yyv4047) { + yyv4047 = yyv4047[:yyrl4047] } else { - yyv3874 = make([]Node, yyrl3874) + yyv4047 = make([]Node, yyrl4047) } } else { - yyv3874 = make([]Node, yyrl3874) + yyv4047 = make([]Node, yyrl4047) } - yyc3874 = true - yyrr3874 = len(yyv3874) - if yyrg3874 { - copy(yyv3874, yyv23874) + yyc4047 = true + yyrr4047 = len(yyv4047) + if yyrg4047 { + copy(yyv4047, yyv24047) } - } else if yyl3874 != len(yyv3874) { - yyv3874 = yyv3874[:yyl3874] - yyc3874 = true + } else if yyl4047 != len(yyv4047) { + yyv4047 = yyv4047[:yyl4047] + yyc4047 = true } - yyj3874 := 0 - for ; yyj3874 < yyrr3874; yyj3874++ { - yyh3874.ElemContainerState(yyj3874) + yyj4047 := 0 + for ; yyj4047 < yyrr4047; yyj4047++ { + yyh4047.ElemContainerState(yyj4047) if r.TryDecodeAsNil() { - yyv3874[yyj3874] = Node{} + yyv4047[yyj4047] = Node{} } else { - yyv3875 := &yyv3874[yyj3874] - yyv3875.CodecDecodeSelf(d) + yyv4048 := &yyv4047[yyj4047] + yyv4048.CodecDecodeSelf(d) } } - if yyrt3874 { - for ; yyj3874 < yyl3874; yyj3874++ { - yyv3874 = append(yyv3874, Node{}) - yyh3874.ElemContainerState(yyj3874) + if yyrt4047 { + for ; yyj4047 < yyl4047; yyj4047++ { + yyv4047 = append(yyv4047, Node{}) + yyh4047.ElemContainerState(yyj4047) if r.TryDecodeAsNil() { - yyv3874[yyj3874] = Node{} + yyv4047[yyj4047] = Node{} } else { - yyv3876 := &yyv3874[yyj3874] - yyv3876.CodecDecodeSelf(d) + yyv4049 := &yyv4047[yyj4047] + yyv4049.CodecDecodeSelf(d) } } } } else { - yyj3874 := 0 - for ; !r.CheckBreak(); yyj3874++ { + yyj4047 := 0 + for ; !r.CheckBreak(); yyj4047++ { - if yyj3874 >= len(yyv3874) { - yyv3874 = append(yyv3874, Node{}) // var yyz3874 Node - yyc3874 = true + if yyj4047 >= len(yyv4047) { + yyv4047 = append(yyv4047, Node{}) // var yyz4047 Node + yyc4047 = true } - yyh3874.ElemContainerState(yyj3874) - if yyj3874 < len(yyv3874) { + yyh4047.ElemContainerState(yyj4047) + if yyj4047 < len(yyv4047) { if r.TryDecodeAsNil() { - yyv3874[yyj3874] = Node{} + yyv4047[yyj4047] = Node{} } else { - yyv3877 := &yyv3874[yyj3874] - yyv3877.CodecDecodeSelf(d) + yyv4050 := &yyv4047[yyj4047] + yyv4050.CodecDecodeSelf(d) } } else { @@ -49118,17 +51701,17 @@ func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) { } } - if yyj3874 < len(yyv3874) { - yyv3874 = yyv3874[:yyj3874] - yyc3874 = true - } else if yyj3874 == 0 && yyv3874 == nil { - yyv3874 = []Node{} - yyc3874 = true + if yyj4047 < len(yyv4047) { + yyv4047 = yyv4047[:yyj4047] + yyc4047 = true + } else if yyj4047 == 0 && yyv4047 == nil { + yyv4047 = []Node{} + yyc4047 = true } } - yyh3874.End() - if yyc3874 { - *v = yyv3874 + yyh4047.End() + if yyc4047 { + *v = yyv4047 } } @@ -49137,9 +51720,9 @@ func (x codecSelfer1234) encSliceFinalizerName(v []FinalizerName, e *codec1978.E z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3878 := range v { + for _, yyv4051 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3878.CodecEncodeSelf(e) + yyv4051.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49149,75 +51732,75 @@ func (x codecSelfer1234) decSliceFinalizerName(v *[]FinalizerName, d *codec1978. z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3879 := *v - yyh3879, yyl3879 := z.DecSliceHelperStart() - var yyc3879 bool - if yyl3879 == 0 { - if yyv3879 == nil { - yyv3879 = []FinalizerName{} - yyc3879 = true - } else if len(yyv3879) != 0 { - yyv3879 = yyv3879[:0] - yyc3879 = true + yyv4052 := *v + yyh4052, yyl4052 := z.DecSliceHelperStart() + var yyc4052 bool + if yyl4052 == 0 { + if yyv4052 == nil { + yyv4052 = []FinalizerName{} + yyc4052 = true + } else if len(yyv4052) != 0 { + yyv4052 = yyv4052[:0] + yyc4052 = true } - } else if yyl3879 > 0 { - var yyrr3879, yyrl3879 int - var yyrt3879 bool - if yyl3879 > cap(yyv3879) { + } else if yyl4052 > 0 { + var yyrr4052, yyrl4052 int + var yyrt4052 bool + if yyl4052 > cap(yyv4052) { - yyrl3879, yyrt3879 = z.DecInferLen(yyl3879, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3879 { - if yyrl3879 <= cap(yyv3879) { - yyv3879 = yyv3879[:yyrl3879] + yyrl4052, yyrt4052 = z.DecInferLen(yyl4052, z.DecBasicHandle().MaxInitLen, 16) + if yyrt4052 { + if yyrl4052 <= cap(yyv4052) { + yyv4052 = yyv4052[:yyrl4052] } else { - yyv3879 = make([]FinalizerName, yyrl3879) + yyv4052 = make([]FinalizerName, yyrl4052) } } else { - yyv3879 = make([]FinalizerName, yyrl3879) + yyv4052 = make([]FinalizerName, yyrl4052) } - yyc3879 = true - yyrr3879 = len(yyv3879) - } else if yyl3879 != len(yyv3879) { - yyv3879 = yyv3879[:yyl3879] - yyc3879 = true + yyc4052 = true + yyrr4052 = len(yyv4052) + } else if yyl4052 != len(yyv4052) { + yyv4052 = yyv4052[:yyl4052] + yyc4052 = true } - yyj3879 := 0 - for ; yyj3879 < yyrr3879; yyj3879++ { - yyh3879.ElemContainerState(yyj3879) + yyj4052 := 0 + for ; yyj4052 < yyrr4052; yyj4052++ { + yyh4052.ElemContainerState(yyj4052) if r.TryDecodeAsNil() { - yyv3879[yyj3879] = "" + yyv4052[yyj4052] = "" } else { - yyv3879[yyj3879] = FinalizerName(r.DecodeString()) + yyv4052[yyj4052] = FinalizerName(r.DecodeString()) } } - if yyrt3879 { - for ; yyj3879 < yyl3879; yyj3879++ { - yyv3879 = append(yyv3879, "") - yyh3879.ElemContainerState(yyj3879) + if yyrt4052 { + for ; yyj4052 < yyl4052; yyj4052++ { + yyv4052 = append(yyv4052, "") + yyh4052.ElemContainerState(yyj4052) if r.TryDecodeAsNil() { - yyv3879[yyj3879] = "" + yyv4052[yyj4052] = "" } else { - yyv3879[yyj3879] = FinalizerName(r.DecodeString()) + yyv4052[yyj4052] = FinalizerName(r.DecodeString()) } } } } else { - yyj3879 := 0 - for ; !r.CheckBreak(); yyj3879++ { + yyj4052 := 0 + for ; !r.CheckBreak(); yyj4052++ { - if yyj3879 >= len(yyv3879) { - yyv3879 = append(yyv3879, "") // var yyz3879 FinalizerName - yyc3879 = true + if yyj4052 >= len(yyv4052) { + yyv4052 = append(yyv4052, "") // var yyz4052 FinalizerName + yyc4052 = true } - yyh3879.ElemContainerState(yyj3879) - if yyj3879 < len(yyv3879) { + yyh4052.ElemContainerState(yyj4052) + if yyj4052 < len(yyv4052) { if r.TryDecodeAsNil() { - yyv3879[yyj3879] = "" + yyv4052[yyj4052] = "" } else { - yyv3879[yyj3879] = FinalizerName(r.DecodeString()) + yyv4052[yyj4052] = FinalizerName(r.DecodeString()) } } else { @@ -49225,17 +51808,17 @@ func (x codecSelfer1234) decSliceFinalizerName(v *[]FinalizerName, d *codec1978. } } - if yyj3879 < len(yyv3879) { - yyv3879 = yyv3879[:yyj3879] - yyc3879 = true - } else if yyj3879 == 0 && yyv3879 == nil { - yyv3879 = []FinalizerName{} - yyc3879 = true + if yyj4052 < len(yyv4052) { + yyv4052 = yyv4052[:yyj4052] + yyc4052 = true + } else if yyj4052 == 0 && yyv4052 == nil { + yyv4052 = []FinalizerName{} + yyc4052 = true } } - yyh3879.End() - if yyc3879 { - *v = yyv3879 + yyh4052.End() + if yyc4052 { + *v = yyv4052 } } @@ -49244,10 +51827,10 @@ func (x codecSelfer1234) encSliceNamespace(v []Namespace, e *codec1978.Encoder) z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3883 := range v { + for _, yyv4056 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3884 := &yyv3883 - yy3884.CodecEncodeSelf(e) + yy4057 := &yyv4056 + yy4057.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49257,83 +51840,83 @@ func (x codecSelfer1234) decSliceNamespace(v *[]Namespace, d *codec1978.Decoder) z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3885 := *v - yyh3885, yyl3885 := z.DecSliceHelperStart() - var yyc3885 bool - if yyl3885 == 0 { - if yyv3885 == nil { - yyv3885 = []Namespace{} - yyc3885 = true - } else if len(yyv3885) != 0 { - yyv3885 = yyv3885[:0] - yyc3885 = true + yyv4058 := *v + yyh4058, yyl4058 := z.DecSliceHelperStart() + var yyc4058 bool + if yyl4058 == 0 { + if yyv4058 == nil { + yyv4058 = []Namespace{} + yyc4058 = true + } else if len(yyv4058) != 0 { + yyv4058 = yyv4058[:0] + yyc4058 = true } - } else if yyl3885 > 0 { - var yyrr3885, yyrl3885 int - var yyrt3885 bool - if yyl3885 > cap(yyv3885) { + } else if yyl4058 > 0 { + var yyrr4058, yyrl4058 int + var yyrt4058 bool + if yyl4058 > cap(yyv4058) { - yyrg3885 := len(yyv3885) > 0 - yyv23885 := yyv3885 - yyrl3885, yyrt3885 = z.DecInferLen(yyl3885, z.DecBasicHandle().MaxInitLen, 232) - if yyrt3885 { - if yyrl3885 <= cap(yyv3885) { - yyv3885 = yyv3885[:yyrl3885] + yyrg4058 := len(yyv4058) > 0 + yyv24058 := yyv4058 + yyrl4058, yyrt4058 = z.DecInferLen(yyl4058, z.DecBasicHandle().MaxInitLen, 232) + if yyrt4058 { + if yyrl4058 <= cap(yyv4058) { + yyv4058 = yyv4058[:yyrl4058] } else { - yyv3885 = make([]Namespace, yyrl3885) + yyv4058 = make([]Namespace, yyrl4058) } } else { - yyv3885 = make([]Namespace, yyrl3885) + yyv4058 = make([]Namespace, yyrl4058) } - yyc3885 = true - yyrr3885 = len(yyv3885) - if yyrg3885 { - copy(yyv3885, yyv23885) + yyc4058 = true + yyrr4058 = len(yyv4058) + if yyrg4058 { + copy(yyv4058, yyv24058) } - } else if yyl3885 != len(yyv3885) { - yyv3885 = yyv3885[:yyl3885] - yyc3885 = true + } else if yyl4058 != len(yyv4058) { + yyv4058 = yyv4058[:yyl4058] + yyc4058 = true } - yyj3885 := 0 - for ; yyj3885 < yyrr3885; yyj3885++ { - yyh3885.ElemContainerState(yyj3885) + yyj4058 := 0 + for ; yyj4058 < yyrr4058; yyj4058++ { + yyh4058.ElemContainerState(yyj4058) if r.TryDecodeAsNil() { - yyv3885[yyj3885] = Namespace{} + yyv4058[yyj4058] = Namespace{} } else { - yyv3886 := &yyv3885[yyj3885] - yyv3886.CodecDecodeSelf(d) + yyv4059 := &yyv4058[yyj4058] + yyv4059.CodecDecodeSelf(d) } } - if yyrt3885 { - for ; yyj3885 < yyl3885; yyj3885++ { - yyv3885 = append(yyv3885, Namespace{}) - yyh3885.ElemContainerState(yyj3885) + if yyrt4058 { + for ; yyj4058 < yyl4058; yyj4058++ { + yyv4058 = append(yyv4058, Namespace{}) + yyh4058.ElemContainerState(yyj4058) if r.TryDecodeAsNil() { - yyv3885[yyj3885] = Namespace{} + yyv4058[yyj4058] = Namespace{} } else { - yyv3887 := &yyv3885[yyj3885] - yyv3887.CodecDecodeSelf(d) + yyv4060 := &yyv4058[yyj4058] + yyv4060.CodecDecodeSelf(d) } } } } else { - yyj3885 := 0 - for ; !r.CheckBreak(); yyj3885++ { + yyj4058 := 0 + for ; !r.CheckBreak(); yyj4058++ { - if yyj3885 >= len(yyv3885) { - yyv3885 = append(yyv3885, Namespace{}) // var yyz3885 Namespace - yyc3885 = true + if yyj4058 >= len(yyv4058) { + yyv4058 = append(yyv4058, Namespace{}) // var yyz4058 Namespace + yyc4058 = true } - yyh3885.ElemContainerState(yyj3885) - if yyj3885 < len(yyv3885) { + yyh4058.ElemContainerState(yyj4058) + if yyj4058 < len(yyv4058) { if r.TryDecodeAsNil() { - yyv3885[yyj3885] = Namespace{} + yyv4058[yyj4058] = Namespace{} } else { - yyv3888 := &yyv3885[yyj3885] - yyv3888.CodecDecodeSelf(d) + yyv4061 := &yyv4058[yyj4058] + yyv4061.CodecDecodeSelf(d) } } else { @@ -49341,17 +51924,17 @@ func (x codecSelfer1234) decSliceNamespace(v *[]Namespace, d *codec1978.Decoder) } } - if yyj3885 < len(yyv3885) { - yyv3885 = yyv3885[:yyj3885] - yyc3885 = true - } else if yyj3885 == 0 && yyv3885 == nil { - yyv3885 = []Namespace{} - yyc3885 = true + if yyj4058 < len(yyv4058) { + yyv4058 = yyv4058[:yyj4058] + yyc4058 = true + } else if yyj4058 == 0 && yyv4058 == nil { + yyv4058 = []Namespace{} + yyc4058 = true } } - yyh3885.End() - if yyc3885 { - *v = yyv3885 + yyh4058.End() + if yyc4058 { + *v = yyv4058 } } @@ -49360,10 +51943,10 @@ func (x codecSelfer1234) encSliceEvent(v []Event, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3889 := range v { + for _, yyv4062 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3890 := &yyv3889 - yy3890.CodecEncodeSelf(e) + yy4063 := &yyv4062 + yy4063.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49373,83 +51956,83 @@ func (x codecSelfer1234) decSliceEvent(v *[]Event, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3891 := *v - yyh3891, yyl3891 := z.DecSliceHelperStart() - var yyc3891 bool - if yyl3891 == 0 { - if yyv3891 == nil { - yyv3891 = []Event{} - yyc3891 = true - } else if len(yyv3891) != 0 { - yyv3891 = yyv3891[:0] - yyc3891 = true + yyv4064 := *v + yyh4064, yyl4064 := z.DecSliceHelperStart() + var yyc4064 bool + if yyl4064 == 0 { + if yyv4064 == nil { + yyv4064 = []Event{} + yyc4064 = true + } else if len(yyv4064) != 0 { + yyv4064 = yyv4064[:0] + yyc4064 = true } - } else if yyl3891 > 0 { - var yyrr3891, yyrl3891 int - var yyrt3891 bool - if yyl3891 > cap(yyv3891) { + } else if yyl4064 > 0 { + var yyrr4064, yyrl4064 int + var yyrt4064 bool + if yyl4064 > cap(yyv4064) { - yyrg3891 := len(yyv3891) > 0 - yyv23891 := yyv3891 - yyrl3891, yyrt3891 = z.DecInferLen(yyl3891, z.DecBasicHandle().MaxInitLen, 440) - if yyrt3891 { - if yyrl3891 <= cap(yyv3891) { - yyv3891 = yyv3891[:yyrl3891] + yyrg4064 := len(yyv4064) > 0 + yyv24064 := yyv4064 + yyrl4064, yyrt4064 = z.DecInferLen(yyl4064, z.DecBasicHandle().MaxInitLen, 440) + if yyrt4064 { + if yyrl4064 <= cap(yyv4064) { + yyv4064 = yyv4064[:yyrl4064] } else { - yyv3891 = make([]Event, yyrl3891) + yyv4064 = make([]Event, yyrl4064) } } else { - yyv3891 = make([]Event, yyrl3891) + yyv4064 = make([]Event, yyrl4064) } - yyc3891 = true - yyrr3891 = len(yyv3891) - if yyrg3891 { - copy(yyv3891, yyv23891) + yyc4064 = true + yyrr4064 = len(yyv4064) + if yyrg4064 { + copy(yyv4064, yyv24064) } - } else if yyl3891 != len(yyv3891) { - yyv3891 = yyv3891[:yyl3891] - yyc3891 = true + } else if yyl4064 != len(yyv4064) { + yyv4064 = yyv4064[:yyl4064] + yyc4064 = true } - yyj3891 := 0 - for ; yyj3891 < yyrr3891; yyj3891++ { - yyh3891.ElemContainerState(yyj3891) + yyj4064 := 0 + for ; yyj4064 < yyrr4064; yyj4064++ { + yyh4064.ElemContainerState(yyj4064) if r.TryDecodeAsNil() { - yyv3891[yyj3891] = Event{} + yyv4064[yyj4064] = Event{} } else { - yyv3892 := &yyv3891[yyj3891] - yyv3892.CodecDecodeSelf(d) + yyv4065 := &yyv4064[yyj4064] + yyv4065.CodecDecodeSelf(d) } } - if yyrt3891 { - for ; yyj3891 < yyl3891; yyj3891++ { - yyv3891 = append(yyv3891, Event{}) - yyh3891.ElemContainerState(yyj3891) + if yyrt4064 { + for ; yyj4064 < yyl4064; yyj4064++ { + yyv4064 = append(yyv4064, Event{}) + yyh4064.ElemContainerState(yyj4064) if r.TryDecodeAsNil() { - yyv3891[yyj3891] = Event{} + yyv4064[yyj4064] = Event{} } else { - yyv3893 := &yyv3891[yyj3891] - yyv3893.CodecDecodeSelf(d) + yyv4066 := &yyv4064[yyj4064] + yyv4066.CodecDecodeSelf(d) } } } } else { - yyj3891 := 0 - for ; !r.CheckBreak(); yyj3891++ { + yyj4064 := 0 + for ; !r.CheckBreak(); yyj4064++ { - if yyj3891 >= len(yyv3891) { - yyv3891 = append(yyv3891, Event{}) // var yyz3891 Event - yyc3891 = true + if yyj4064 >= len(yyv4064) { + yyv4064 = append(yyv4064, Event{}) // var yyz4064 Event + yyc4064 = true } - yyh3891.ElemContainerState(yyj3891) - if yyj3891 < len(yyv3891) { + yyh4064.ElemContainerState(yyj4064) + if yyj4064 < len(yyv4064) { if r.TryDecodeAsNil() { - yyv3891[yyj3891] = Event{} + yyv4064[yyj4064] = Event{} } else { - yyv3894 := &yyv3891[yyj3891] - yyv3894.CodecDecodeSelf(d) + yyv4067 := &yyv4064[yyj4064] + yyv4067.CodecDecodeSelf(d) } } else { @@ -49457,17 +52040,17 @@ func (x codecSelfer1234) decSliceEvent(v *[]Event, d *codec1978.Decoder) { } } - if yyj3891 < len(yyv3891) { - yyv3891 = yyv3891[:yyj3891] - yyc3891 = true - } else if yyj3891 == 0 && yyv3891 == nil { - yyv3891 = []Event{} - yyc3891 = true + if yyj4064 < len(yyv4064) { + yyv4064 = yyv4064[:yyj4064] + yyc4064 = true + } else if yyj4064 == 0 && yyv4064 == nil { + yyv4064 = []Event{} + yyc4064 = true } } - yyh3891.End() - if yyc3891 { - *v = yyv3891 + yyh4064.End() + if yyc4064 { + *v = yyv4064 } } @@ -49476,17 +52059,17 @@ func (x codecSelfer1234) encSliceruntime_Object(v []pkg8_runtime.Object, e *code z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3895 := range v { + for _, yyv4068 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyv3895 == nil { + if yyv4068 == nil { r.EncodeNil() } else { - yym3896 := z.EncBinary() - _ = yym3896 + yym4069 := z.EncBinary() + _ = yym4069 if false { - } else if z.HasExtensions() && z.EncExt(yyv3895) { + } else if z.HasExtensions() && z.EncExt(yyv4068) { } else { - z.EncFallback(yyv3895) + z.EncFallback(yyv4068) } } } @@ -49498,74 +52081,74 @@ func (x codecSelfer1234) decSliceruntime_Object(v *[]pkg8_runtime.Object, d *cod z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3897 := *v - yyh3897, yyl3897 := z.DecSliceHelperStart() - var yyc3897 bool - if yyl3897 == 0 { - if yyv3897 == nil { - yyv3897 = []pkg8_runtime.Object{} - yyc3897 = true - } else if len(yyv3897) != 0 { - yyv3897 = yyv3897[:0] - yyc3897 = true + yyv4070 := *v + yyh4070, yyl4070 := z.DecSliceHelperStart() + var yyc4070 bool + if yyl4070 == 0 { + if yyv4070 == nil { + yyv4070 = []pkg8_runtime.Object{} + yyc4070 = true + } else if len(yyv4070) != 0 { + yyv4070 = yyv4070[:0] + yyc4070 = true } - } else if yyl3897 > 0 { - var yyrr3897, yyrl3897 int - var yyrt3897 bool - if yyl3897 > cap(yyv3897) { + } else if yyl4070 > 0 { + var yyrr4070, yyrl4070 int + var yyrt4070 bool + if yyl4070 > cap(yyv4070) { - yyrg3897 := len(yyv3897) > 0 - yyv23897 := yyv3897 - yyrl3897, yyrt3897 = z.DecInferLen(yyl3897, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3897 { - if yyrl3897 <= cap(yyv3897) { - yyv3897 = yyv3897[:yyrl3897] + yyrg4070 := len(yyv4070) > 0 + yyv24070 := yyv4070 + yyrl4070, yyrt4070 = z.DecInferLen(yyl4070, z.DecBasicHandle().MaxInitLen, 16) + if yyrt4070 { + if yyrl4070 <= cap(yyv4070) { + yyv4070 = yyv4070[:yyrl4070] } else { - yyv3897 = make([]pkg8_runtime.Object, yyrl3897) + yyv4070 = make([]pkg8_runtime.Object, yyrl4070) } } else { - yyv3897 = make([]pkg8_runtime.Object, yyrl3897) + yyv4070 = make([]pkg8_runtime.Object, yyrl4070) } - yyc3897 = true - yyrr3897 = len(yyv3897) - if yyrg3897 { - copy(yyv3897, yyv23897) + yyc4070 = true + yyrr4070 = len(yyv4070) + if yyrg4070 { + copy(yyv4070, yyv24070) } - } else if yyl3897 != len(yyv3897) { - yyv3897 = yyv3897[:yyl3897] - yyc3897 = true + } else if yyl4070 != len(yyv4070) { + yyv4070 = yyv4070[:yyl4070] + yyc4070 = true } - yyj3897 := 0 - for ; yyj3897 < yyrr3897; yyj3897++ { - yyh3897.ElemContainerState(yyj3897) + yyj4070 := 0 + for ; yyj4070 < yyrr4070; yyj4070++ { + yyh4070.ElemContainerState(yyj4070) if r.TryDecodeAsNil() { - yyv3897[yyj3897] = nil + yyv4070[yyj4070] = nil } else { - yyv3898 := &yyv3897[yyj3897] - yym3899 := z.DecBinary() - _ = yym3899 + yyv4071 := &yyv4070[yyj4070] + yym4072 := z.DecBinary() + _ = yym4072 if false { - } else if z.HasExtensions() && z.DecExt(yyv3898) { + } else if z.HasExtensions() && z.DecExt(yyv4071) { } else { - z.DecFallback(yyv3898, true) + z.DecFallback(yyv4071, true) } } } - if yyrt3897 { - for ; yyj3897 < yyl3897; yyj3897++ { - yyv3897 = append(yyv3897, nil) - yyh3897.ElemContainerState(yyj3897) + if yyrt4070 { + for ; yyj4070 < yyl4070; yyj4070++ { + yyv4070 = append(yyv4070, nil) + yyh4070.ElemContainerState(yyj4070) if r.TryDecodeAsNil() { - yyv3897[yyj3897] = nil + yyv4070[yyj4070] = nil } else { - yyv3900 := &yyv3897[yyj3897] - yym3901 := z.DecBinary() - _ = yym3901 + yyv4073 := &yyv4070[yyj4070] + yym4074 := z.DecBinary() + _ = yym4074 if false { - } else if z.HasExtensions() && z.DecExt(yyv3900) { + } else if z.HasExtensions() && z.DecExt(yyv4073) { } else { - z.DecFallback(yyv3900, true) + z.DecFallback(yyv4073, true) } } @@ -49573,25 +52156,25 @@ func (x codecSelfer1234) decSliceruntime_Object(v *[]pkg8_runtime.Object, d *cod } } else { - yyj3897 := 0 - for ; !r.CheckBreak(); yyj3897++ { + yyj4070 := 0 + for ; !r.CheckBreak(); yyj4070++ { - if yyj3897 >= len(yyv3897) { - yyv3897 = append(yyv3897, nil) // var yyz3897 pkg8_runtime.Object - yyc3897 = true + if yyj4070 >= len(yyv4070) { + yyv4070 = append(yyv4070, nil) // var yyz4070 pkg8_runtime.Object + yyc4070 = true } - yyh3897.ElemContainerState(yyj3897) - if yyj3897 < len(yyv3897) { + yyh4070.ElemContainerState(yyj4070) + if yyj4070 < len(yyv4070) { if r.TryDecodeAsNil() { - yyv3897[yyj3897] = nil + yyv4070[yyj4070] = nil } else { - yyv3902 := &yyv3897[yyj3897] - yym3903 := z.DecBinary() - _ = yym3903 + yyv4075 := &yyv4070[yyj4070] + yym4076 := z.DecBinary() + _ = yym4076 if false { - } else if z.HasExtensions() && z.DecExt(yyv3902) { + } else if z.HasExtensions() && z.DecExt(yyv4075) { } else { - z.DecFallback(yyv3902, true) + z.DecFallback(yyv4075, true) } } @@ -49600,17 +52183,17 @@ func (x codecSelfer1234) decSliceruntime_Object(v *[]pkg8_runtime.Object, d *cod } } - if yyj3897 < len(yyv3897) { - yyv3897 = yyv3897[:yyj3897] - yyc3897 = true - } else if yyj3897 == 0 && yyv3897 == nil { - yyv3897 = []pkg8_runtime.Object{} - yyc3897 = true + if yyj4070 < len(yyv4070) { + yyv4070 = yyv4070[:yyj4070] + yyc4070 = true + } else if yyj4070 == 0 && yyv4070 == nil { + yyv4070 = []pkg8_runtime.Object{} + yyc4070 = true } } - yyh3897.End() - if yyc3897 { - *v = yyv3897 + yyh4070.End() + if yyc4070 { + *v = yyv4070 } } @@ -49619,10 +52202,10 @@ func (x codecSelfer1234) encSliceLimitRangeItem(v []LimitRangeItem, e *codec1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3904 := range v { + for _, yyv4077 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3905 := &yyv3904 - yy3905.CodecEncodeSelf(e) + yy4078 := &yyv4077 + yy4078.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49632,83 +52215,83 @@ func (x codecSelfer1234) decSliceLimitRangeItem(v *[]LimitRangeItem, d *codec197 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3906 := *v - yyh3906, yyl3906 := z.DecSliceHelperStart() - var yyc3906 bool - if yyl3906 == 0 { - if yyv3906 == nil { - yyv3906 = []LimitRangeItem{} - yyc3906 = true - } else if len(yyv3906) != 0 { - yyv3906 = yyv3906[:0] - yyc3906 = true + yyv4079 := *v + yyh4079, yyl4079 := z.DecSliceHelperStart() + var yyc4079 bool + if yyl4079 == 0 { + if yyv4079 == nil { + yyv4079 = []LimitRangeItem{} + yyc4079 = true + } else if len(yyv4079) != 0 { + yyv4079 = yyv4079[:0] + yyc4079 = true } - } else if yyl3906 > 0 { - var yyrr3906, yyrl3906 int - var yyrt3906 bool - if yyl3906 > cap(yyv3906) { + } else if yyl4079 > 0 { + var yyrr4079, yyrl4079 int + var yyrt4079 bool + if yyl4079 > cap(yyv4079) { - yyrg3906 := len(yyv3906) > 0 - yyv23906 := yyv3906 - yyrl3906, yyrt3906 = z.DecInferLen(yyl3906, z.DecBasicHandle().MaxInitLen, 56) - if yyrt3906 { - if yyrl3906 <= cap(yyv3906) { - yyv3906 = yyv3906[:yyrl3906] + yyrg4079 := len(yyv4079) > 0 + yyv24079 := yyv4079 + yyrl4079, yyrt4079 = z.DecInferLen(yyl4079, z.DecBasicHandle().MaxInitLen, 56) + if yyrt4079 { + if yyrl4079 <= cap(yyv4079) { + yyv4079 = yyv4079[:yyrl4079] } else { - yyv3906 = make([]LimitRangeItem, yyrl3906) + yyv4079 = make([]LimitRangeItem, yyrl4079) } } else { - yyv3906 = make([]LimitRangeItem, yyrl3906) + yyv4079 = make([]LimitRangeItem, yyrl4079) } - yyc3906 = true - yyrr3906 = len(yyv3906) - if yyrg3906 { - copy(yyv3906, yyv23906) + yyc4079 = true + yyrr4079 = len(yyv4079) + if yyrg4079 { + copy(yyv4079, yyv24079) } - } else if yyl3906 != len(yyv3906) { - yyv3906 = yyv3906[:yyl3906] - yyc3906 = true + } else if yyl4079 != len(yyv4079) { + yyv4079 = yyv4079[:yyl4079] + yyc4079 = true } - yyj3906 := 0 - for ; yyj3906 < yyrr3906; yyj3906++ { - yyh3906.ElemContainerState(yyj3906) + yyj4079 := 0 + for ; yyj4079 < yyrr4079; yyj4079++ { + yyh4079.ElemContainerState(yyj4079) if r.TryDecodeAsNil() { - yyv3906[yyj3906] = LimitRangeItem{} + yyv4079[yyj4079] = LimitRangeItem{} } else { - yyv3907 := &yyv3906[yyj3906] - yyv3907.CodecDecodeSelf(d) + yyv4080 := &yyv4079[yyj4079] + yyv4080.CodecDecodeSelf(d) } } - if yyrt3906 { - for ; yyj3906 < yyl3906; yyj3906++ { - yyv3906 = append(yyv3906, LimitRangeItem{}) - yyh3906.ElemContainerState(yyj3906) + if yyrt4079 { + for ; yyj4079 < yyl4079; yyj4079++ { + yyv4079 = append(yyv4079, LimitRangeItem{}) + yyh4079.ElemContainerState(yyj4079) if r.TryDecodeAsNil() { - yyv3906[yyj3906] = LimitRangeItem{} + yyv4079[yyj4079] = LimitRangeItem{} } else { - yyv3908 := &yyv3906[yyj3906] - yyv3908.CodecDecodeSelf(d) + yyv4081 := &yyv4079[yyj4079] + yyv4081.CodecDecodeSelf(d) } } } } else { - yyj3906 := 0 - for ; !r.CheckBreak(); yyj3906++ { + yyj4079 := 0 + for ; !r.CheckBreak(); yyj4079++ { - if yyj3906 >= len(yyv3906) { - yyv3906 = append(yyv3906, LimitRangeItem{}) // var yyz3906 LimitRangeItem - yyc3906 = true + if yyj4079 >= len(yyv4079) { + yyv4079 = append(yyv4079, LimitRangeItem{}) // var yyz4079 LimitRangeItem + yyc4079 = true } - yyh3906.ElemContainerState(yyj3906) - if yyj3906 < len(yyv3906) { + yyh4079.ElemContainerState(yyj4079) + if yyj4079 < len(yyv4079) { if r.TryDecodeAsNil() { - yyv3906[yyj3906] = LimitRangeItem{} + yyv4079[yyj4079] = LimitRangeItem{} } else { - yyv3909 := &yyv3906[yyj3906] - yyv3909.CodecDecodeSelf(d) + yyv4082 := &yyv4079[yyj4079] + yyv4082.CodecDecodeSelf(d) } } else { @@ -49716,17 +52299,17 @@ func (x codecSelfer1234) decSliceLimitRangeItem(v *[]LimitRangeItem, d *codec197 } } - if yyj3906 < len(yyv3906) { - yyv3906 = yyv3906[:yyj3906] - yyc3906 = true - } else if yyj3906 == 0 && yyv3906 == nil { - yyv3906 = []LimitRangeItem{} - yyc3906 = true + if yyj4079 < len(yyv4079) { + yyv4079 = yyv4079[:yyj4079] + yyc4079 = true + } else if yyj4079 == 0 && yyv4079 == nil { + yyv4079 = []LimitRangeItem{} + yyc4079 = true } } - yyh3906.End() - if yyc3906 { - *v = yyv3906 + yyh4079.End() + if yyc4079 { + *v = yyv4079 } } @@ -49735,10 +52318,10 @@ func (x codecSelfer1234) encSliceLimitRange(v []LimitRange, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3910 := range v { + for _, yyv4083 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3911 := &yyv3910 - yy3911.CodecEncodeSelf(e) + yy4084 := &yyv4083 + yy4084.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49748,83 +52331,83 @@ func (x codecSelfer1234) decSliceLimitRange(v *[]LimitRange, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3912 := *v - yyh3912, yyl3912 := z.DecSliceHelperStart() - var yyc3912 bool - if yyl3912 == 0 { - if yyv3912 == nil { - yyv3912 = []LimitRange{} - yyc3912 = true - } else if len(yyv3912) != 0 { - yyv3912 = yyv3912[:0] - yyc3912 = true + yyv4085 := *v + yyh4085, yyl4085 := z.DecSliceHelperStart() + var yyc4085 bool + if yyl4085 == 0 { + if yyv4085 == nil { + yyv4085 = []LimitRange{} + yyc4085 = true + } else if len(yyv4085) != 0 { + yyv4085 = yyv4085[:0] + yyc4085 = true } - } else if yyl3912 > 0 { - var yyrr3912, yyrl3912 int - var yyrt3912 bool - if yyl3912 > cap(yyv3912) { + } else if yyl4085 > 0 { + var yyrr4085, yyrl4085 int + var yyrt4085 bool + if yyl4085 > cap(yyv4085) { - yyrg3912 := len(yyv3912) > 0 - yyv23912 := yyv3912 - yyrl3912, yyrt3912 = z.DecInferLen(yyl3912, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3912 { - if yyrl3912 <= cap(yyv3912) { - yyv3912 = yyv3912[:yyrl3912] + yyrg4085 := len(yyv4085) > 0 + yyv24085 := yyv4085 + yyrl4085, yyrt4085 = z.DecInferLen(yyl4085, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4085 { + if yyrl4085 <= cap(yyv4085) { + yyv4085 = yyv4085[:yyrl4085] } else { - yyv3912 = make([]LimitRange, yyrl3912) + yyv4085 = make([]LimitRange, yyrl4085) } } else { - yyv3912 = make([]LimitRange, yyrl3912) + yyv4085 = make([]LimitRange, yyrl4085) } - yyc3912 = true - yyrr3912 = len(yyv3912) - if yyrg3912 { - copy(yyv3912, yyv23912) + yyc4085 = true + yyrr4085 = len(yyv4085) + if yyrg4085 { + copy(yyv4085, yyv24085) } - } else if yyl3912 != len(yyv3912) { - yyv3912 = yyv3912[:yyl3912] - yyc3912 = true + } else if yyl4085 != len(yyv4085) { + yyv4085 = yyv4085[:yyl4085] + yyc4085 = true } - yyj3912 := 0 - for ; yyj3912 < yyrr3912; yyj3912++ { - yyh3912.ElemContainerState(yyj3912) + yyj4085 := 0 + for ; yyj4085 < yyrr4085; yyj4085++ { + yyh4085.ElemContainerState(yyj4085) if r.TryDecodeAsNil() { - yyv3912[yyj3912] = LimitRange{} + yyv4085[yyj4085] = LimitRange{} } else { - yyv3913 := &yyv3912[yyj3912] - yyv3913.CodecDecodeSelf(d) + yyv4086 := &yyv4085[yyj4085] + yyv4086.CodecDecodeSelf(d) } } - if yyrt3912 { - for ; yyj3912 < yyl3912; yyj3912++ { - yyv3912 = append(yyv3912, LimitRange{}) - yyh3912.ElemContainerState(yyj3912) + if yyrt4085 { + for ; yyj4085 < yyl4085; yyj4085++ { + yyv4085 = append(yyv4085, LimitRange{}) + yyh4085.ElemContainerState(yyj4085) if r.TryDecodeAsNil() { - yyv3912[yyj3912] = LimitRange{} + yyv4085[yyj4085] = LimitRange{} } else { - yyv3914 := &yyv3912[yyj3912] - yyv3914.CodecDecodeSelf(d) + yyv4087 := &yyv4085[yyj4085] + yyv4087.CodecDecodeSelf(d) } } } } else { - yyj3912 := 0 - for ; !r.CheckBreak(); yyj3912++ { + yyj4085 := 0 + for ; !r.CheckBreak(); yyj4085++ { - if yyj3912 >= len(yyv3912) { - yyv3912 = append(yyv3912, LimitRange{}) // var yyz3912 LimitRange - yyc3912 = true + if yyj4085 >= len(yyv4085) { + yyv4085 = append(yyv4085, LimitRange{}) // var yyz4085 LimitRange + yyc4085 = true } - yyh3912.ElemContainerState(yyj3912) - if yyj3912 < len(yyv3912) { + yyh4085.ElemContainerState(yyj4085) + if yyj4085 < len(yyv4085) { if r.TryDecodeAsNil() { - yyv3912[yyj3912] = LimitRange{} + yyv4085[yyj4085] = LimitRange{} } else { - yyv3915 := &yyv3912[yyj3912] - yyv3915.CodecDecodeSelf(d) + yyv4088 := &yyv4085[yyj4085] + yyv4088.CodecDecodeSelf(d) } } else { @@ -49832,17 +52415,17 @@ func (x codecSelfer1234) decSliceLimitRange(v *[]LimitRange, d *codec1978.Decode } } - if yyj3912 < len(yyv3912) { - yyv3912 = yyv3912[:yyj3912] - yyc3912 = true - } else if yyj3912 == 0 && yyv3912 == nil { - yyv3912 = []LimitRange{} - yyc3912 = true + if yyj4085 < len(yyv4085) { + yyv4085 = yyv4085[:yyj4085] + yyc4085 = true + } else if yyj4085 == 0 && yyv4085 == nil { + yyv4085 = []LimitRange{} + yyc4085 = true } } - yyh3912.End() - if yyc3912 { - *v = yyv3912 + yyh4085.End() + if yyc4085 { + *v = yyv4085 } } @@ -49851,10 +52434,10 @@ func (x codecSelfer1234) encSliceResourceQuota(v []ResourceQuota, e *codec1978.E z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3916 := range v { + for _, yyv4089 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3917 := &yyv3916 - yy3917.CodecEncodeSelf(e) + yy4090 := &yyv4089 + yy4090.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -49864,83 +52447,83 @@ func (x codecSelfer1234) decSliceResourceQuota(v *[]ResourceQuota, d *codec1978. z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3918 := *v - yyh3918, yyl3918 := z.DecSliceHelperStart() - var yyc3918 bool - if yyl3918 == 0 { - if yyv3918 == nil { - yyv3918 = []ResourceQuota{} - yyc3918 = true - } else if len(yyv3918) != 0 { - yyv3918 = yyv3918[:0] - yyc3918 = true + yyv4091 := *v + yyh4091, yyl4091 := z.DecSliceHelperStart() + var yyc4091 bool + if yyl4091 == 0 { + if yyv4091 == nil { + yyv4091 = []ResourceQuota{} + yyc4091 = true + } else if len(yyv4091) != 0 { + yyv4091 = yyv4091[:0] + yyc4091 = true } - } else if yyl3918 > 0 { - var yyrr3918, yyrl3918 int - var yyrt3918 bool - if yyl3918 > cap(yyv3918) { + } else if yyl4091 > 0 { + var yyrr4091, yyrl4091 int + var yyrt4091 bool + if yyl4091 > cap(yyv4091) { - yyrg3918 := len(yyv3918) > 0 - yyv23918 := yyv3918 - yyrl3918, yyrt3918 = z.DecInferLen(yyl3918, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3918 { - if yyrl3918 <= cap(yyv3918) { - yyv3918 = yyv3918[:yyrl3918] + yyrg4091 := len(yyv4091) > 0 + yyv24091 := yyv4091 + yyrl4091, yyrt4091 = z.DecInferLen(yyl4091, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4091 { + if yyrl4091 <= cap(yyv4091) { + yyv4091 = yyv4091[:yyrl4091] } else { - yyv3918 = make([]ResourceQuota, yyrl3918) + yyv4091 = make([]ResourceQuota, yyrl4091) } } else { - yyv3918 = make([]ResourceQuota, yyrl3918) + yyv4091 = make([]ResourceQuota, yyrl4091) } - yyc3918 = true - yyrr3918 = len(yyv3918) - if yyrg3918 { - copy(yyv3918, yyv23918) + yyc4091 = true + yyrr4091 = len(yyv4091) + if yyrg4091 { + copy(yyv4091, yyv24091) } - } else if yyl3918 != len(yyv3918) { - yyv3918 = yyv3918[:yyl3918] - yyc3918 = true + } else if yyl4091 != len(yyv4091) { + yyv4091 = yyv4091[:yyl4091] + yyc4091 = true } - yyj3918 := 0 - for ; yyj3918 < yyrr3918; yyj3918++ { - yyh3918.ElemContainerState(yyj3918) + yyj4091 := 0 + for ; yyj4091 < yyrr4091; yyj4091++ { + yyh4091.ElemContainerState(yyj4091) if r.TryDecodeAsNil() { - yyv3918[yyj3918] = ResourceQuota{} + yyv4091[yyj4091] = ResourceQuota{} } else { - yyv3919 := &yyv3918[yyj3918] - yyv3919.CodecDecodeSelf(d) + yyv4092 := &yyv4091[yyj4091] + yyv4092.CodecDecodeSelf(d) } } - if yyrt3918 { - for ; yyj3918 < yyl3918; yyj3918++ { - yyv3918 = append(yyv3918, ResourceQuota{}) - yyh3918.ElemContainerState(yyj3918) + if yyrt4091 { + for ; yyj4091 < yyl4091; yyj4091++ { + yyv4091 = append(yyv4091, ResourceQuota{}) + yyh4091.ElemContainerState(yyj4091) if r.TryDecodeAsNil() { - yyv3918[yyj3918] = ResourceQuota{} + yyv4091[yyj4091] = ResourceQuota{} } else { - yyv3920 := &yyv3918[yyj3918] - yyv3920.CodecDecodeSelf(d) + yyv4093 := &yyv4091[yyj4091] + yyv4093.CodecDecodeSelf(d) } } } } else { - yyj3918 := 0 - for ; !r.CheckBreak(); yyj3918++ { + yyj4091 := 0 + for ; !r.CheckBreak(); yyj4091++ { - if yyj3918 >= len(yyv3918) { - yyv3918 = append(yyv3918, ResourceQuota{}) // var yyz3918 ResourceQuota - yyc3918 = true + if yyj4091 >= len(yyv4091) { + yyv4091 = append(yyv4091, ResourceQuota{}) // var yyz4091 ResourceQuota + yyc4091 = true } - yyh3918.ElemContainerState(yyj3918) - if yyj3918 < len(yyv3918) { + yyh4091.ElemContainerState(yyj4091) + if yyj4091 < len(yyv4091) { if r.TryDecodeAsNil() { - yyv3918[yyj3918] = ResourceQuota{} + yyv4091[yyj4091] = ResourceQuota{} } else { - yyv3921 := &yyv3918[yyj3918] - yyv3921.CodecDecodeSelf(d) + yyv4094 := &yyv4091[yyj4091] + yyv4094.CodecDecodeSelf(d) } } else { @@ -49948,17 +52531,17 @@ func (x codecSelfer1234) decSliceResourceQuota(v *[]ResourceQuota, d *codec1978. } } - if yyj3918 < len(yyv3918) { - yyv3918 = yyv3918[:yyj3918] - yyc3918 = true - } else if yyj3918 == 0 && yyv3918 == nil { - yyv3918 = []ResourceQuota{} - yyc3918 = true + if yyj4091 < len(yyv4091) { + yyv4091 = yyv4091[:yyj4091] + yyc4091 = true + } else if yyj4091 == 0 && yyv4091 == nil { + yyv4091 = []ResourceQuota{} + yyc4091 = true } } - yyh3918.End() - if yyc3918 { - *v = yyv3918 + yyh4091.End() + if yyc4091 { + *v = yyv4091 } } @@ -49967,23 +52550,23 @@ func (x codecSelfer1234) encMapstringSliceuint8(v map[string][]uint8, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeMapStart(len(v)) - for yyk3922, yyv3922 := range v { + for yyk4095, yyv4095 := range v { z.EncSendContainerState(codecSelfer_containerMapKey1234) - yym3923 := z.EncBinary() - _ = yym3923 + yym4096 := z.EncBinary() + _ = yym4096 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(yyk3922)) + r.EncodeString(codecSelferC_UTF81234, string(yyk4095)) } z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyv3922 == nil { + if yyv4095 == nil { r.EncodeNil() } else { - yym3924 := z.EncBinary() - _ = yym3924 + yym4097 := z.EncBinary() + _ = yym4097 if false { } else { - r.EncodeStringBytes(codecSelferC_RAW1234, []byte(yyv3922)) + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(yyv4095)) } } } @@ -49995,80 +52578,80 @@ func (x codecSelfer1234) decMapstringSliceuint8(v *map[string][]uint8, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3925 := *v - yyl3925 := r.ReadMapStart() - yybh3925 := z.DecBasicHandle() - if yyv3925 == nil { - yyrl3925, _ := z.DecInferLen(yyl3925, yybh3925.MaxInitLen, 40) - yyv3925 = make(map[string][]uint8, yyrl3925) - *v = yyv3925 + yyv4098 := *v + yyl4098 := r.ReadMapStart() + yybh4098 := z.DecBasicHandle() + if yyv4098 == nil { + yyrl4098, _ := z.DecInferLen(yyl4098, yybh4098.MaxInitLen, 40) + yyv4098 = make(map[string][]uint8, yyrl4098) + *v = yyv4098 } - var yymk3925 string - var yymv3925 []uint8 - var yymg3925 bool - if yybh3925.MapValueReset { - yymg3925 = true + var yymk4098 string + var yymv4098 []uint8 + var yymg4098 bool + if yybh4098.MapValueReset { + yymg4098 = true } - if yyl3925 > 0 { - for yyj3925 := 0; yyj3925 < yyl3925; yyj3925++ { + if yyl4098 > 0 { + for yyj4098 := 0; yyj4098 < yyl4098; yyj4098++ { z.DecSendContainerState(codecSelfer_containerMapKey1234) if r.TryDecodeAsNil() { - yymk3925 = "" + yymk4098 = "" } else { - yymk3925 = string(r.DecodeString()) + yymk4098 = string(r.DecodeString()) } - if yymg3925 { - yymv3925 = yyv3925[yymk3925] + if yymg4098 { + yymv4098 = yyv4098[yymk4098] } else { - yymv3925 = nil + yymv4098 = nil } z.DecSendContainerState(codecSelfer_containerMapValue1234) if r.TryDecodeAsNil() { - yymv3925 = nil + yymv4098 = nil } else { - yyv3927 := &yymv3925 - yym3928 := z.DecBinary() - _ = yym3928 + yyv4100 := &yymv4098 + yym4101 := z.DecBinary() + _ = yym4101 if false { } else { - *yyv3927 = r.DecodeBytes(*(*[]byte)(yyv3927), false, false) + *yyv4100 = r.DecodeBytes(*(*[]byte)(yyv4100), false, false) } } - if yyv3925 != nil { - yyv3925[yymk3925] = yymv3925 + if yyv4098 != nil { + yyv4098[yymk4098] = yymv4098 } } - } else if yyl3925 < 0 { - for yyj3925 := 0; !r.CheckBreak(); yyj3925++ { + } else if yyl4098 < 0 { + for yyj4098 := 0; !r.CheckBreak(); yyj4098++ { z.DecSendContainerState(codecSelfer_containerMapKey1234) if r.TryDecodeAsNil() { - yymk3925 = "" + yymk4098 = "" } else { - yymk3925 = string(r.DecodeString()) + yymk4098 = string(r.DecodeString()) } - if yymg3925 { - yymv3925 = yyv3925[yymk3925] + if yymg4098 { + yymv4098 = yyv4098[yymk4098] } else { - yymv3925 = nil + yymv4098 = nil } z.DecSendContainerState(codecSelfer_containerMapValue1234) if r.TryDecodeAsNil() { - yymv3925 = nil + yymv4098 = nil } else { - yyv3930 := &yymv3925 - yym3931 := z.DecBinary() - _ = yym3931 + yyv4103 := &yymv4098 + yym4104 := z.DecBinary() + _ = yym4104 if false { } else { - *yyv3930 = r.DecodeBytes(*(*[]byte)(yyv3930), false, false) + *yyv4103 = r.DecodeBytes(*(*[]byte)(yyv4103), false, false) } } - if yyv3925 != nil { - yyv3925[yymk3925] = yymv3925 + if yyv4098 != nil { + yyv4098[yymk4098] = yymv4098 } } } // else len==0: TODO: Should we clear map entries? @@ -50080,10 +52663,10 @@ func (x codecSelfer1234) encSliceSecret(v []Secret, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3932 := range v { + for _, yyv4105 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3933 := &yyv3932 - yy3933.CodecEncodeSelf(e) + yy4106 := &yyv4105 + yy4106.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -50093,83 +52676,83 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3934 := *v - yyh3934, yyl3934 := z.DecSliceHelperStart() - var yyc3934 bool - if yyl3934 == 0 { - if yyv3934 == nil { - yyv3934 = []Secret{} - yyc3934 = true - } else if len(yyv3934) != 0 { - yyv3934 = yyv3934[:0] - yyc3934 = true + yyv4107 := *v + yyh4107, yyl4107 := z.DecSliceHelperStart() + var yyc4107 bool + if yyl4107 == 0 { + if yyv4107 == nil { + yyv4107 = []Secret{} + yyc4107 = true + } else if len(yyv4107) != 0 { + yyv4107 = yyv4107[:0] + yyc4107 = true } - } else if yyl3934 > 0 { - var yyrr3934, yyrl3934 int - var yyrt3934 bool - if yyl3934 > cap(yyv3934) { + } else if yyl4107 > 0 { + var yyrr4107, yyrl4107 int + var yyrt4107 bool + if yyl4107 > cap(yyv4107) { - yyrg3934 := len(yyv3934) > 0 - yyv23934 := yyv3934 - yyrl3934, yyrt3934 = z.DecInferLen(yyl3934, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3934 { - if yyrl3934 <= cap(yyv3934) { - yyv3934 = yyv3934[:yyrl3934] + yyrg4107 := len(yyv4107) > 0 + yyv24107 := yyv4107 + yyrl4107, yyrt4107 = z.DecInferLen(yyl4107, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4107 { + if yyrl4107 <= cap(yyv4107) { + yyv4107 = yyv4107[:yyrl4107] } else { - yyv3934 = make([]Secret, yyrl3934) + yyv4107 = make([]Secret, yyrl4107) } } else { - yyv3934 = make([]Secret, yyrl3934) + yyv4107 = make([]Secret, yyrl4107) } - yyc3934 = true - yyrr3934 = len(yyv3934) - if yyrg3934 { - copy(yyv3934, yyv23934) + yyc4107 = true + yyrr4107 = len(yyv4107) + if yyrg4107 { + copy(yyv4107, yyv24107) } - } else if yyl3934 != len(yyv3934) { - yyv3934 = yyv3934[:yyl3934] - yyc3934 = true + } else if yyl4107 != len(yyv4107) { + yyv4107 = yyv4107[:yyl4107] + yyc4107 = true } - yyj3934 := 0 - for ; yyj3934 < yyrr3934; yyj3934++ { - yyh3934.ElemContainerState(yyj3934) + yyj4107 := 0 + for ; yyj4107 < yyrr4107; yyj4107++ { + yyh4107.ElemContainerState(yyj4107) if r.TryDecodeAsNil() { - yyv3934[yyj3934] = Secret{} + yyv4107[yyj4107] = Secret{} } else { - yyv3935 := &yyv3934[yyj3934] - yyv3935.CodecDecodeSelf(d) + yyv4108 := &yyv4107[yyj4107] + yyv4108.CodecDecodeSelf(d) } } - if yyrt3934 { - for ; yyj3934 < yyl3934; yyj3934++ { - yyv3934 = append(yyv3934, Secret{}) - yyh3934.ElemContainerState(yyj3934) + if yyrt4107 { + for ; yyj4107 < yyl4107; yyj4107++ { + yyv4107 = append(yyv4107, Secret{}) + yyh4107.ElemContainerState(yyj4107) if r.TryDecodeAsNil() { - yyv3934[yyj3934] = Secret{} + yyv4107[yyj4107] = Secret{} } else { - yyv3936 := &yyv3934[yyj3934] - yyv3936.CodecDecodeSelf(d) + yyv4109 := &yyv4107[yyj4107] + yyv4109.CodecDecodeSelf(d) } } } } else { - yyj3934 := 0 - for ; !r.CheckBreak(); yyj3934++ { + yyj4107 := 0 + for ; !r.CheckBreak(); yyj4107++ { - if yyj3934 >= len(yyv3934) { - yyv3934 = append(yyv3934, Secret{}) // var yyz3934 Secret - yyc3934 = true + if yyj4107 >= len(yyv4107) { + yyv4107 = append(yyv4107, Secret{}) // var yyz4107 Secret + yyc4107 = true } - yyh3934.ElemContainerState(yyj3934) - if yyj3934 < len(yyv3934) { + yyh4107.ElemContainerState(yyj4107) + if yyj4107 < len(yyv4107) { if r.TryDecodeAsNil() { - yyv3934[yyj3934] = Secret{} + yyv4107[yyj4107] = Secret{} } else { - yyv3937 := &yyv3934[yyj3934] - yyv3937.CodecDecodeSelf(d) + yyv4110 := &yyv4107[yyj4107] + yyv4110.CodecDecodeSelf(d) } } else { @@ -50177,17 +52760,17 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { } } - if yyj3934 < len(yyv3934) { - yyv3934 = yyv3934[:yyj3934] - yyc3934 = true - } else if yyj3934 == 0 && yyv3934 == nil { - yyv3934 = []Secret{} - yyc3934 = true + if yyj4107 < len(yyv4107) { + yyv4107 = yyv4107[:yyj4107] + yyc4107 = true + } else if yyj4107 == 0 && yyv4107 == nil { + yyv4107 = []Secret{} + yyc4107 = true } } - yyh3934.End() - if yyc3934 { - *v = yyv3934 + yyh4107.End() + if yyc4107 { + *v = yyv4107 } } @@ -50196,10 +52779,10 @@ func (x codecSelfer1234) encSliceConfigMap(v []ConfigMap, e *codec1978.Encoder) z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3938 := range v { + for _, yyv4111 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3939 := &yyv3938 - yy3939.CodecEncodeSelf(e) + yy4112 := &yyv4111 + yy4112.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -50209,83 +52792,83 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3940 := *v - yyh3940, yyl3940 := z.DecSliceHelperStart() - var yyc3940 bool - if yyl3940 == 0 { - if yyv3940 == nil { - yyv3940 = []ConfigMap{} - yyc3940 = true - } else if len(yyv3940) != 0 { - yyv3940 = yyv3940[:0] - yyc3940 = true + yyv4113 := *v + yyh4113, yyl4113 := z.DecSliceHelperStart() + var yyc4113 bool + if yyl4113 == 0 { + if yyv4113 == nil { + yyv4113 = []ConfigMap{} + yyc4113 = true + } else if len(yyv4113) != 0 { + yyv4113 = yyv4113[:0] + yyc4113 = true } - } else if yyl3940 > 0 { - var yyrr3940, yyrl3940 int - var yyrt3940 bool - if yyl3940 > cap(yyv3940) { + } else if yyl4113 > 0 { + var yyrr4113, yyrl4113 int + var yyrt4113 bool + if yyl4113 > cap(yyv4113) { - yyrg3940 := len(yyv3940) > 0 - yyv23940 := yyv3940 - yyrl3940, yyrt3940 = z.DecInferLen(yyl3940, z.DecBasicHandle().MaxInitLen, 200) - if yyrt3940 { - if yyrl3940 <= cap(yyv3940) { - yyv3940 = yyv3940[:yyrl3940] + yyrg4113 := len(yyv4113) > 0 + yyv24113 := yyv4113 + yyrl4113, yyrt4113 = z.DecInferLen(yyl4113, z.DecBasicHandle().MaxInitLen, 200) + if yyrt4113 { + if yyrl4113 <= cap(yyv4113) { + yyv4113 = yyv4113[:yyrl4113] } else { - yyv3940 = make([]ConfigMap, yyrl3940) + yyv4113 = make([]ConfigMap, yyrl4113) } } else { - yyv3940 = make([]ConfigMap, yyrl3940) + yyv4113 = make([]ConfigMap, yyrl4113) } - yyc3940 = true - yyrr3940 = len(yyv3940) - if yyrg3940 { - copy(yyv3940, yyv23940) + yyc4113 = true + yyrr4113 = len(yyv4113) + if yyrg4113 { + copy(yyv4113, yyv24113) } - } else if yyl3940 != len(yyv3940) { - yyv3940 = yyv3940[:yyl3940] - yyc3940 = true + } else if yyl4113 != len(yyv4113) { + yyv4113 = yyv4113[:yyl4113] + yyc4113 = true } - yyj3940 := 0 - for ; yyj3940 < yyrr3940; yyj3940++ { - yyh3940.ElemContainerState(yyj3940) + yyj4113 := 0 + for ; yyj4113 < yyrr4113; yyj4113++ { + yyh4113.ElemContainerState(yyj4113) if r.TryDecodeAsNil() { - yyv3940[yyj3940] = ConfigMap{} + yyv4113[yyj4113] = ConfigMap{} } else { - yyv3941 := &yyv3940[yyj3940] - yyv3941.CodecDecodeSelf(d) + yyv4114 := &yyv4113[yyj4113] + yyv4114.CodecDecodeSelf(d) } } - if yyrt3940 { - for ; yyj3940 < yyl3940; yyj3940++ { - yyv3940 = append(yyv3940, ConfigMap{}) - yyh3940.ElemContainerState(yyj3940) + if yyrt4113 { + for ; yyj4113 < yyl4113; yyj4113++ { + yyv4113 = append(yyv4113, ConfigMap{}) + yyh4113.ElemContainerState(yyj4113) if r.TryDecodeAsNil() { - yyv3940[yyj3940] = ConfigMap{} + yyv4113[yyj4113] = ConfigMap{} } else { - yyv3942 := &yyv3940[yyj3940] - yyv3942.CodecDecodeSelf(d) + yyv4115 := &yyv4113[yyj4113] + yyv4115.CodecDecodeSelf(d) } } } } else { - yyj3940 := 0 - for ; !r.CheckBreak(); yyj3940++ { + yyj4113 := 0 + for ; !r.CheckBreak(); yyj4113++ { - if yyj3940 >= len(yyv3940) { - yyv3940 = append(yyv3940, ConfigMap{}) // var yyz3940 ConfigMap - yyc3940 = true + if yyj4113 >= len(yyv4113) { + yyv4113 = append(yyv4113, ConfigMap{}) // var yyz4113 ConfigMap + yyc4113 = true } - yyh3940.ElemContainerState(yyj3940) - if yyj3940 < len(yyv3940) { + yyh4113.ElemContainerState(yyj4113) + if yyj4113 < len(yyv4113) { if r.TryDecodeAsNil() { - yyv3940[yyj3940] = ConfigMap{} + yyv4113[yyj4113] = ConfigMap{} } else { - yyv3943 := &yyv3940[yyj3940] - yyv3943.CodecDecodeSelf(d) + yyv4116 := &yyv4113[yyj4113] + yyv4116.CodecDecodeSelf(d) } } else { @@ -50293,17 +52876,17 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) } } - if yyj3940 < len(yyv3940) { - yyv3940 = yyv3940[:yyj3940] - yyc3940 = true - } else if yyj3940 == 0 && yyv3940 == nil { - yyv3940 = []ConfigMap{} - yyc3940 = true + if yyj4113 < len(yyv4113) { + yyv4113 = yyv4113[:yyj4113] + yyc4113 = true + } else if yyj4113 == 0 && yyv4113 == nil { + yyv4113 = []ConfigMap{} + yyc4113 = true } } - yyh3940.End() - if yyc3940 { - *v = yyv3940 + yyh4113.End() + if yyc4113 { + *v = yyv4113 } } @@ -50312,10 +52895,10 @@ func (x codecSelfer1234) encSliceComponentCondition(v []ComponentCondition, e *c z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3944 := range v { + for _, yyv4117 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3945 := &yyv3944 - yy3945.CodecEncodeSelf(e) + yy4118 := &yyv4117 + yy4118.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -50325,83 +52908,83 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3946 := *v - yyh3946, yyl3946 := z.DecSliceHelperStart() - var yyc3946 bool - if yyl3946 == 0 { - if yyv3946 == nil { - yyv3946 = []ComponentCondition{} - yyc3946 = true - } else if len(yyv3946) != 0 { - yyv3946 = yyv3946[:0] - yyc3946 = true + yyv4119 := *v + yyh4119, yyl4119 := z.DecSliceHelperStart() + var yyc4119 bool + if yyl4119 == 0 { + if yyv4119 == nil { + yyv4119 = []ComponentCondition{} + yyc4119 = true + } else if len(yyv4119) != 0 { + yyv4119 = yyv4119[:0] + yyc4119 = true } - } else if yyl3946 > 0 { - var yyrr3946, yyrl3946 int - var yyrt3946 bool - if yyl3946 > cap(yyv3946) { + } else if yyl4119 > 0 { + var yyrr4119, yyrl4119 int + var yyrt4119 bool + if yyl4119 > cap(yyv4119) { - yyrg3946 := len(yyv3946) > 0 - yyv23946 := yyv3946 - yyrl3946, yyrt3946 = z.DecInferLen(yyl3946, z.DecBasicHandle().MaxInitLen, 64) - if yyrt3946 { - if yyrl3946 <= cap(yyv3946) { - yyv3946 = yyv3946[:yyrl3946] + yyrg4119 := len(yyv4119) > 0 + yyv24119 := yyv4119 + yyrl4119, yyrt4119 = z.DecInferLen(yyl4119, z.DecBasicHandle().MaxInitLen, 64) + if yyrt4119 { + if yyrl4119 <= cap(yyv4119) { + yyv4119 = yyv4119[:yyrl4119] } else { - yyv3946 = make([]ComponentCondition, yyrl3946) + yyv4119 = make([]ComponentCondition, yyrl4119) } } else { - yyv3946 = make([]ComponentCondition, yyrl3946) + yyv4119 = make([]ComponentCondition, yyrl4119) } - yyc3946 = true - yyrr3946 = len(yyv3946) - if yyrg3946 { - copy(yyv3946, yyv23946) + yyc4119 = true + yyrr4119 = len(yyv4119) + if yyrg4119 { + copy(yyv4119, yyv24119) } - } else if yyl3946 != len(yyv3946) { - yyv3946 = yyv3946[:yyl3946] - yyc3946 = true + } else if yyl4119 != len(yyv4119) { + yyv4119 = yyv4119[:yyl4119] + yyc4119 = true } - yyj3946 := 0 - for ; yyj3946 < yyrr3946; yyj3946++ { - yyh3946.ElemContainerState(yyj3946) + yyj4119 := 0 + for ; yyj4119 < yyrr4119; yyj4119++ { + yyh4119.ElemContainerState(yyj4119) if r.TryDecodeAsNil() { - yyv3946[yyj3946] = ComponentCondition{} + yyv4119[yyj4119] = ComponentCondition{} } else { - yyv3947 := &yyv3946[yyj3946] - yyv3947.CodecDecodeSelf(d) + yyv4120 := &yyv4119[yyj4119] + yyv4120.CodecDecodeSelf(d) } } - if yyrt3946 { - for ; yyj3946 < yyl3946; yyj3946++ { - yyv3946 = append(yyv3946, ComponentCondition{}) - yyh3946.ElemContainerState(yyj3946) + if yyrt4119 { + for ; yyj4119 < yyl4119; yyj4119++ { + yyv4119 = append(yyv4119, ComponentCondition{}) + yyh4119.ElemContainerState(yyj4119) if r.TryDecodeAsNil() { - yyv3946[yyj3946] = ComponentCondition{} + yyv4119[yyj4119] = ComponentCondition{} } else { - yyv3948 := &yyv3946[yyj3946] - yyv3948.CodecDecodeSelf(d) + yyv4121 := &yyv4119[yyj4119] + yyv4121.CodecDecodeSelf(d) } } } } else { - yyj3946 := 0 - for ; !r.CheckBreak(); yyj3946++ { + yyj4119 := 0 + for ; !r.CheckBreak(); yyj4119++ { - if yyj3946 >= len(yyv3946) { - yyv3946 = append(yyv3946, ComponentCondition{}) // var yyz3946 ComponentCondition - yyc3946 = true + if yyj4119 >= len(yyv4119) { + yyv4119 = append(yyv4119, ComponentCondition{}) // var yyz4119 ComponentCondition + yyc4119 = true } - yyh3946.ElemContainerState(yyj3946) - if yyj3946 < len(yyv3946) { + yyh4119.ElemContainerState(yyj4119) + if yyj4119 < len(yyv4119) { if r.TryDecodeAsNil() { - yyv3946[yyj3946] = ComponentCondition{} + yyv4119[yyj4119] = ComponentCondition{} } else { - yyv3949 := &yyv3946[yyj3946] - yyv3949.CodecDecodeSelf(d) + yyv4122 := &yyv4119[yyj4119] + yyv4122.CodecDecodeSelf(d) } } else { @@ -50409,17 +52992,17 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * } } - if yyj3946 < len(yyv3946) { - yyv3946 = yyv3946[:yyj3946] - yyc3946 = true - } else if yyj3946 == 0 && yyv3946 == nil { - yyv3946 = []ComponentCondition{} - yyc3946 = true + if yyj4119 < len(yyv4119) { + yyv4119 = yyv4119[:yyj4119] + yyc4119 = true + } else if yyj4119 == 0 && yyv4119 == nil { + yyv4119 = []ComponentCondition{} + yyc4119 = true } } - yyh3946.End() - if yyc3946 { - *v = yyv3946 + yyh4119.End() + if yyc4119 { + *v = yyv4119 } } @@ -50428,10 +53011,10 @@ func (x codecSelfer1234) encSliceComponentStatus(v []ComponentStatus, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3950 := range v { + for _, yyv4123 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3951 := &yyv3950 - yy3951.CodecEncodeSelf(e) + yy4124 := &yyv4123 + yy4124.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -50441,83 +53024,83 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3952 := *v - yyh3952, yyl3952 := z.DecSliceHelperStart() - var yyc3952 bool - if yyl3952 == 0 { - if yyv3952 == nil { - yyv3952 = []ComponentStatus{} - yyc3952 = true - } else if len(yyv3952) != 0 { - yyv3952 = yyv3952[:0] - yyc3952 = true + yyv4125 := *v + yyh4125, yyl4125 := z.DecSliceHelperStart() + var yyc4125 bool + if yyl4125 == 0 { + if yyv4125 == nil { + yyv4125 = []ComponentStatus{} + yyc4125 = true + } else if len(yyv4125) != 0 { + yyv4125 = yyv4125[:0] + yyc4125 = true } - } else if yyl3952 > 0 { - var yyrr3952, yyrl3952 int - var yyrt3952 bool - if yyl3952 > cap(yyv3952) { + } else if yyl4125 > 0 { + var yyrr4125, yyrl4125 int + var yyrt4125 bool + if yyl4125 > cap(yyv4125) { - yyrg3952 := len(yyv3952) > 0 - yyv23952 := yyv3952 - yyrl3952, yyrt3952 = z.DecInferLen(yyl3952, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3952 { - if yyrl3952 <= cap(yyv3952) { - yyv3952 = yyv3952[:yyrl3952] + yyrg4125 := len(yyv4125) > 0 + yyv24125 := yyv4125 + yyrl4125, yyrt4125 = z.DecInferLen(yyl4125, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4125 { + if yyrl4125 <= cap(yyv4125) { + yyv4125 = yyv4125[:yyrl4125] } else { - yyv3952 = make([]ComponentStatus, yyrl3952) + yyv4125 = make([]ComponentStatus, yyrl4125) } } else { - yyv3952 = make([]ComponentStatus, yyrl3952) + yyv4125 = make([]ComponentStatus, yyrl4125) } - yyc3952 = true - yyrr3952 = len(yyv3952) - if yyrg3952 { - copy(yyv3952, yyv23952) + yyc4125 = true + yyrr4125 = len(yyv4125) + if yyrg4125 { + copy(yyv4125, yyv24125) } - } else if yyl3952 != len(yyv3952) { - yyv3952 = yyv3952[:yyl3952] - yyc3952 = true + } else if yyl4125 != len(yyv4125) { + yyv4125 = yyv4125[:yyl4125] + yyc4125 = true } - yyj3952 := 0 - for ; yyj3952 < yyrr3952; yyj3952++ { - yyh3952.ElemContainerState(yyj3952) + yyj4125 := 0 + for ; yyj4125 < yyrr4125; yyj4125++ { + yyh4125.ElemContainerState(yyj4125) if r.TryDecodeAsNil() { - yyv3952[yyj3952] = ComponentStatus{} + yyv4125[yyj4125] = ComponentStatus{} } else { - yyv3953 := &yyv3952[yyj3952] - yyv3953.CodecDecodeSelf(d) + yyv4126 := &yyv4125[yyj4125] + yyv4126.CodecDecodeSelf(d) } } - if yyrt3952 { - for ; yyj3952 < yyl3952; yyj3952++ { - yyv3952 = append(yyv3952, ComponentStatus{}) - yyh3952.ElemContainerState(yyj3952) + if yyrt4125 { + for ; yyj4125 < yyl4125; yyj4125++ { + yyv4125 = append(yyv4125, ComponentStatus{}) + yyh4125.ElemContainerState(yyj4125) if r.TryDecodeAsNil() { - yyv3952[yyj3952] = ComponentStatus{} + yyv4125[yyj4125] = ComponentStatus{} } else { - yyv3954 := &yyv3952[yyj3952] - yyv3954.CodecDecodeSelf(d) + yyv4127 := &yyv4125[yyj4125] + yyv4127.CodecDecodeSelf(d) } } } } else { - yyj3952 := 0 - for ; !r.CheckBreak(); yyj3952++ { + yyj4125 := 0 + for ; !r.CheckBreak(); yyj4125++ { - if yyj3952 >= len(yyv3952) { - yyv3952 = append(yyv3952, ComponentStatus{}) // var yyz3952 ComponentStatus - yyc3952 = true + if yyj4125 >= len(yyv4125) { + yyv4125 = append(yyv4125, ComponentStatus{}) // var yyz4125 ComponentStatus + yyc4125 = true } - yyh3952.ElemContainerState(yyj3952) - if yyj3952 < len(yyv3952) { + yyh4125.ElemContainerState(yyj4125) + if yyj4125 < len(yyv4125) { if r.TryDecodeAsNil() { - yyv3952[yyj3952] = ComponentStatus{} + yyv4125[yyj4125] = ComponentStatus{} } else { - yyv3955 := &yyv3952[yyj3952] - yyv3955.CodecDecodeSelf(d) + yyv4128 := &yyv4125[yyj4125] + yyv4128.CodecDecodeSelf(d) } } else { @@ -50525,16 +53108,16 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 } } - if yyj3952 < len(yyv3952) { - yyv3952 = yyv3952[:yyj3952] - yyc3952 = true - } else if yyj3952 == 0 && yyv3952 == nil { - yyv3952 = []ComponentStatus{} - yyc3952 = true + if yyj4125 < len(yyv4125) { + yyv4125 = yyv4125[:yyj4125] + yyc4125 = true + } else if yyj4125 == 0 && yyv4125 == nil { + yyv4125 = []ComponentStatus{} + yyc4125 = true } } - yyh3952.End() - if yyc3952 { - *v = yyv3952 + yyh4125.End() + if yyc4125 { + *v = yyv4125 } } diff --git a/pkg/api/types.go b/pkg/api/types.go index 69ea781f8ab..ab854971590 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -215,6 +215,8 @@ type VolumeSource struct { DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty"` // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. FC *FCVolumeSource `json:"fc,omitempty"` + // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` } // Similar to VolumeSource but meant for the administrator who creates PVs. @@ -251,6 +253,8 @@ type PersistentVolumeSource struct { FC *FCVolumeSource `json:"fc,omitempty"` // Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running Flocker *FlockerVolumeSource `json:"flocker,omitempty"` + // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` } type PersistentVolumeClaimVolumeSource struct { @@ -442,9 +446,9 @@ const ( type GCEPersistentDiskVolumeSource struct { // Unique name of the PD resource. Used to identify the disk in GCE PDName string `json:"pdName"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine FSType string `json:"fsType,omitempty"` // Optional: Partition on the disk to mount. @@ -469,9 +473,9 @@ type ISCSIVolumeSource struct { Lun int `json:"lun,omitempty"` // Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport. ISCSIInterface string `json:"iscsiInterface,omitempty"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine FSType string `json:"fsType,omitempty"` // Optional: Defaults to false (read/write). ReadOnly here will force @@ -487,11 +491,11 @@ type FCVolumeSource struct { TargetWWNs []string `json:"targetWWNs"` // Required: FC target lun number Lun *int `json:"lun"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine - FSType string `json:"fsType"` + FSType string `json:"fsType,omitempty"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. ReadOnly bool `json:"readOnly,omitempty"` @@ -502,9 +506,9 @@ type FCVolumeSource struct { type FlexVolumeSource struct { // Driver is the name of the driver to use for this volume. Driver string `json:"driver"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. FSType string `json:"fsType,omitempty"` // Optional: SecretRef is reference to the authentication secret for User, default is empty. SecretRef *LocalObjectReference `json:"secretRef,omitempty"` @@ -524,9 +528,9 @@ type FlexVolumeSource struct { type AWSElasticBlockStoreVolumeSource struct { // Unique id of the persistent disk resource. Used to identify the disk in AWS VolumeID string `json:"volumeID"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine FSType string `json:"fsType,omitempty"` // Optional: Partition on the disk to mount. @@ -599,9 +603,9 @@ type RBDVolumeSource struct { CephMonitors []string `json:"monitors"` // Required: RBDImage is the rados image name RBDImage string `json:"image"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine FSType string `json:"fsType,omitempty"` // Optional: RadosPool is the rados pool name,default is rbd @@ -626,6 +630,7 @@ type CinderVolumeSource struct { VolumeID string `json:"volumeID"` // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. FSType string `json:"fsType,omitempty"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. @@ -672,6 +677,17 @@ type DownwardAPIVolumeFile struct { FieldRef ObjectFieldSelector `json:"fieldRef"` } +// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. +type AzureFileVolumeSource struct { + // the name of secret that contains Azure Storage Account Name and Key + SecretName string `json:"secretName"` + // Share Name + ShareName string `json:"shareName"` + // Defaults to false (read/write). ReadOnly here will force + // the ReadOnly setting in VolumeMounts. + ReadOnly bool `json:"readOnly,omitempty"` +} + // ContainerPort represents a network port in a single container type ContainerPort struct { // Optional: If specified, this must be an IANA_SVC_NAME Each named port @@ -752,16 +768,27 @@ type SecretKeySelector struct { Key string `json:"key"` } +// HTTPHeader describes a custom header to be used in HTTP probes +type HTTPHeader struct { + // The header field name + Name string `json:"name"` + // The header field value + Value string `json:"value"` +} + // HTTPGetAction describes an action based on HTTP Get requests. type HTTPGetAction struct { // Optional: Path to access on the HTTP server. Path string `json:"path,omitempty"` // Required: Name or number of the port to access on the container. Port intstr.IntOrString `json:"port,omitempty"` - // Optional: Host name to connect to, defaults to the pod IP. + // Optional: Host name to connect to, defaults to the pod IP. You + // probably want to set "Host" in httpHeaders instead. Host string `json:"host,omitempty"` // Optional: Scheme to use for connecting to the host, defaults to HTTP. Scheme URIScheme `json:"scheme,omitempty"` + // Optional: Custom headers to set in the request. HTTP allows repeated headers. + HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"` } // URIScheme identifies the scheme used for connection to a host for Get actions @@ -1043,6 +1070,93 @@ const ( DNSDefault DNSPolicy = "Default" ) +// A node selector represents the union of the results of one or more label queries +// over a set of nodes; that is, it represents the OR of the selectors represented +// by the node selector terms. +type NodeSelector struct { + //Required. A list of node selector terms. The terms are ORed. + NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"` +} + +// A null or empty node selector term matches no objects. +type NodeSelectorTerm struct { + //Required. A list of node selector requirements. The requirements are ANDed. + MatchExpressions []NodeSelectorRequirement `json:"matchExpressions"` +} + +// A node selector requirement is a selector that contains values, a key, and an operator +// that relates the key and values. +type NodeSelectorRequirement struct { + // The label key that the selector applies to. + Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` + // Represents a key's relationship to a set of values. + // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + Operator NodeSelectorOperator `json:"operator"` + // An array of string values. If the operator is In or NotIn, + // the values array must be non-empty. If the operator is Exists or DoesNotExist, + // the values array must be empty. If the operator is Gt or Lt, the values + // array must have a single element, which will be interpreted as an integer. + // This array is replaced during a strategic merge patch. + Values []string `json:"values,omitempty"` +} + +// A node selector operator is the set of operators that can be used in +// a node selector requirement. +type NodeSelectorOperator string + +const ( + NodeSelectorOpIn NodeSelectorOperator = "In" + NodeSelectorOpNotIn NodeSelectorOperator = "NotIn" + NodeSelectorOpExists NodeSelectorOperator = "Exists" + NodeSelectorOpDoesNotExist NodeSelectorOperator = "DoesNotExist" + NodeSelectorOpGt NodeSelectorOperator = "Gt" + NodeSelectorOpLt NodeSelectorOperator = "Lt" +) + +// Affinity is a group of affinity scheduling requirements. +type Affinity struct { + // Describes node affinity scheduling requirements for the pod. + NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"` +} + +// Node affinity is a group of node affinity scheduling requirements. +// If RequiredDuringSchedulingRequiredDuringExecution and +// RequiredDuringSchedulingIgnoredDuringExecution are both set, +// then both node selectors must be satisfied. +type NodeAffinity struct { + // If the affinity requirements specified by this field are not met at + // scheduling time, the pod will not be scheduled onto the node. + // If the affinity requirements specified by this field cease to be met + // at some point during pod execution (e.g. due to an update), the system + // will try to eventually evict the pod from its node. + RequiredDuringSchedulingRequiredDuringExecution *NodeSelector `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` + // If the affinity requirements specified by this field are not met at + // scheduling time, the pod will not be scheduled onto the node. + // If the affinity requirements specified by this field cease to be met + // at some point during pod execution (e.g. due to an update), the system + // may or may not try to eventually evict the pod from its node. + RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` + // The scheduler will prefer to schedule pods to nodes that satisfy + // the affinity expressions specified by this field, but it may choose + // a node that violates one or more of the expressions. The node that is + // most preferred is the one with the greatest sum of weights, i.e. + // for each node that meets all of the scheduling requirements (resource + // request, requiredDuringScheduling affinity expressions, etc.), + // compute a sum by iterating through the elements of this field and adding + // "weight" to the sum if the node matches the corresponding matchExpressions; the + // node(s) with the highest sum are the most preferred. + PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +// An empty preferred scheduling term matches all objects with implicit weight 0 +// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). +type PreferredSchedulingTerm struct { + // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + Weight int `json:"weight"` + // A node selector term, associated with the corresponding weight. + Preference NodeSelectorTerm `json:"preference"` +} + // PodSpec is a description of a pod type PodSpec struct { Volumes []Volume `json:"volumes"` @@ -2143,6 +2257,21 @@ const ( // SSHAuthPrivateKey is the key of the required SSH private key for SecretTypeSSHAuth secrets SSHAuthPrivateKey = "ssh-privatekey" + + // SecretTypeTLS contains information about a TLS client or server secret. It + // is primarily used with TLS termination of the Ingress resource, but may be + // used in other types. + // + // Required fields: + // - Secret.Data["tls.key"] - TLS private key. + // Secret.Data["tls.crt"] - TLS certificate. + // 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 = "tls.crt" + // TLSPrivateKeyKey is the key for the private key field in a TLS secret. + TLSPrivateKeyKey = "tls.key" ) type SecretList struct { @@ -2152,6 +2281,8 @@ type SecretList struct { Items []Secret `json:"items"` } +// +genclient=true + // ConfigMap holds configuration data for components or applications to consume. type ConfigMap struct { unversioned.TypeMeta `json:",inline"` diff --git a/pkg/api/unversioned/helpers.go b/pkg/api/unversioned/helpers.go new file mode 100644 index 00000000000..066832dc145 --- /dev/null +++ b/pkg/api/unversioned/helpers.go @@ -0,0 +1,94 @@ +/* +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. +*/ + +package unversioned + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/util/sets" +) + +// LabelSelectorAsSelector converts the LabelSelector api type into a struct that implements +// labels.Selector +func LabelSelectorAsSelector(ps *LabelSelector) (labels.Selector, error) { + if ps == nil { + return labels.Nothing(), nil + } + if len(ps.MatchLabels)+len(ps.MatchExpressions) == 0 { + return labels.Everything(), nil + } + selector := labels.NewSelector() + for k, v := range ps.MatchLabels { + r, err := labels.NewRequirement(k, labels.InOperator, sets.NewString(v)) + if err != nil { + return nil, err + } + selector = selector.Add(*r) + } + for _, expr := range ps.MatchExpressions { + var op labels.Operator + switch expr.Operator { + case LabelSelectorOpIn: + op = labels.InOperator + case LabelSelectorOpNotIn: + op = labels.NotInOperator + case LabelSelectorOpExists: + op = labels.ExistsOperator + case LabelSelectorOpDoesNotExist: + op = labels.DoesNotExistOperator + default: + return nil, fmt.Errorf("%q is not a valid pod selector operator", expr.Operator) + } + r, err := labels.NewRequirement(expr.Key, op, sets.NewString(expr.Values...)) + if err != nil { + return nil, err + } + selector = selector.Add(*r) + } + return selector, nil +} + +// SetAsLabelSelector converts the labels.Set object into a LabelSelector api object. +func SetAsLabelSelector(ls labels.Set) *LabelSelector { + if ls == nil { + return nil + } + + selector := &LabelSelector{ + MatchLabels: make(map[string]string), + } + for label, value := range ls { + selector.MatchLabels[label] = value + } + + return selector +} + +// FormatLabelSelector convert labelSelector into plain string +func FormatLabelSelector(labelSelector *LabelSelector) string { + var l string + if selector, err := LabelSelectorAsSelector(labelSelector); err != nil { + l = selector.String() + } else { + l = "" + } + if l == "" { + l = "" + } + return l +} diff --git a/pkg/apis/extensions/helpers_test.go b/pkg/api/unversioned/helpers_test.go similarity index 96% rename from pkg/apis/extensions/helpers_test.go rename to pkg/api/unversioned/helpers_test.go index 2fbd6199433..334c78597c6 100644 --- a/pkg/apis/extensions/helpers_test.go +++ b/pkg/api/unversioned/helpers_test.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors All rights reserved. +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. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package extensions +package unversioned import ( "reflect" diff --git a/pkg/api/unversioned/types.go b/pkg/api/unversioned/types.go index 3c77fcfdf91..71544493154 100644 --- a/pkg/api/unversioned/types.go +++ b/pkg/api/unversioned/types.go @@ -15,6 +15,14 @@ limitations under the License. */ // Package unversioned contains API types that are common to all versions. +// +// The package contains two categories of types: +// - external (serialized) types that lack their own version (e.g TypeMeta) +// - internal (never-serialized) types that are needed by several different +// api groups, and so live here, to avoid duplication and/or import loops +// (e.g. LabelSelector). +// In the future, we will probably move these categories of objects into +// separate packages. package unversioned import "strings" @@ -339,6 +347,8 @@ type APIResource struct { Name string `json:"name"` // namespaced indicates if a resource is namespaced or not. Namespaced bool `json:"namespaced"` + // kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') + Kind string `json:"kind"` } // APIResourceList is a list of APIResource, it is used to expose the name of the @@ -380,3 +390,46 @@ func (apiVersions APIVersions) GoString() string { // Patch is provided to give a concrete name and type to the Kubernetes PATCH request body. type Patch struct{} + +// Note: +// There are two different styles of label selectors used in versioned types: +// an older style which is represented as just a string in versioned types, and a +// newer style that is structured. LabelSelector is an internal representation for the +// latter style. + +// A label selector is a label query over a set of resources. The result of matchLabels and +// matchExpressions are ANDed. An empty label selector matches all objects. A null +// label selector matches no objects. +type LabelSelector struct { + // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + // map is equivalent to an element of matchExpressions, whose key field is "key", the + // operator is "In", and the values array contains only "value". The requirements are ANDed. + MatchLabels map[string]string `json:"matchLabels,omitempty"` + // matchExpressions is a list of label selector requirements. The requirements are ANDed. + MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty"` +} + +// A label selector requirement is a selector that contains values, a key, and an operator that +// relates the key and values. +type LabelSelectorRequirement struct { + // key is the label key that the selector applies to. + Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` + // operator represents a key's relationship to a set of values. + // Valid operators ard In, NotIn, Exists and DoesNotExist. + Operator LabelSelectorOperator `json:"operator"` + // values is an array of string values. If the operator is In or NotIn, + // the values array must be non-empty. If the operator is Exists or DoesNotExist, + // the values array must be empty. This array is replaced during a strategic + // merge patch. + Values []string `json:"values,omitempty"` +} + +// A label selector operator is the set of operators that can be used in a selector requirement. +type LabelSelectorOperator string + +const ( + LabelSelectorOpIn LabelSelectorOperator = "In" + LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" + LabelSelectorOpExists LabelSelectorOperator = "Exists" + LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" +) diff --git a/pkg/api/unversioned/types_swagger_doc_generated.go b/pkg/api/unversioned/types_swagger_doc_generated.go index 6633ddf4fc1..a65e8893187 100644 --- a/pkg/api/unversioned/types_swagger_doc_generated.go +++ b/pkg/api/unversioned/types_swagger_doc_generated.go @@ -51,6 +51,7 @@ var map_APIResource = map[string]string{ "": "APIResource specifies the name of a resource and whether it is namespaced.", "name": "name is the name of the resource.", "namespaced": "namespaced indicates if a resource is namespaced or not.", + "kind": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", } func (APIResource) SwaggerDoc() map[string]string { @@ -96,6 +97,27 @@ func (GroupVersionForDiscovery) SwaggerDoc() map[string]string { return map_GroupVersionForDiscovery } +var map_LabelSelector = map[string]string{ + "": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", + "matchLabels": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", + "matchExpressions": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", +} + +func (LabelSelector) SwaggerDoc() map[string]string { + return map_LabelSelector +} + +var map_LabelSelectorRequirement = map[string]string{ + "": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", + "key": "key is the label key that the selector applies to.", + "operator": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.", + "values": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", +} + +func (LabelSelectorRequirement) SwaggerDoc() map[string]string { + return map_LabelSelectorRequirement +} + var map_ListMeta = map[string]string{ "": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "selfLink": "SelfLink is a URL representing this object. Populated by the system. Read-only.", diff --git a/pkg/api/unversioned/validation/validation.go b/pkg/api/unversioned/validation/validation.go new file mode 100644 index 00000000000..f42f37b0482 --- /dev/null +++ b/pkg/api/unversioned/validation/validation.go @@ -0,0 +1,53 @@ +/* +Copyright 2015 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. +*/ + +package validation + +import ( + "k8s.io/kubernetes/pkg/api/unversioned" + apivalidation "k8s.io/kubernetes/pkg/api/validation" + "k8s.io/kubernetes/pkg/util/validation/field" +) + +func ValidateLabelSelector(ps *unversioned.LabelSelector, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if ps == nil { + return allErrs + } + allErrs = append(allErrs, apivalidation.ValidateLabels(ps.MatchLabels, fldPath.Child("matchLabels"))...) + for i, expr := range ps.MatchExpressions { + allErrs = append(allErrs, ValidateLabelSelectorRequirement(expr, fldPath.Child("matchExpressions").Index(i))...) + } + return allErrs +} + +func ValidateLabelSelectorRequirement(sr unversioned.LabelSelectorRequirement, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + switch sr.Operator { + case unversioned.LabelSelectorOpIn, unversioned.LabelSelectorOpNotIn: + if len(sr.Values) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'")) + } + case unversioned.LabelSelectorOpExists, unversioned.LabelSelectorOpDoesNotExist: + if len(sr.Values) > 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'")) + } + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator")) + } + allErrs = append(allErrs, apivalidation.ValidateLabelName(sr.Key, fldPath.Child("key"))...) + return allErrs +} diff --git a/pkg/api/v1/conversion_generated.go b/pkg/api/v1/conversion_generated.go index 61393c1dafb..7c2c2f8ea55 100644 --- a/pkg/api/v1/conversion_generated.go +++ b/pkg/api/v1/conversion_generated.go @@ -43,6 +43,20 @@ func Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolu return autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in, out, s) } +func autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *AzureFileVolumeSource, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*api.AzureFileVolumeSource))(in) + } + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + +func Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *AzureFileVolumeSource, s conversion.Scope) error { + return autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in, out, s) +} + func autoConvert_api_Binding_To_v1_Binding(in *api.Binding, out *Binding, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*api.Binding))(in) @@ -977,6 +991,16 @@ func autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, ou } out.Host = in.Host out.Scheme = URIScheme(in.Scheme) + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := Convert_api_HTTPHeader_To_v1_HTTPHeader(&in.HTTPHeaders[i], &out.HTTPHeaders[i], s); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } return nil } @@ -984,6 +1008,19 @@ func Convert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, out *H return autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in, out, s) } +func autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *HTTPHeader, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*api.HTTPHeader))(in) + } + out.Name = in.Name + out.Value = in.Value + return nil +} + +func Convert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *HTTPHeader, s conversion.Scope) error { + return autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in, out, s) +} + func autoConvert_api_Handler_To_v1_Handler(in *api.Handler, out *Handler, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*api.Handler))(in) @@ -1947,6 +1984,15 @@ func autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api } else { out.Flocker = nil } + // unable to generate simple pointer conversion for api.AzureFileVolumeSource -> v1.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(AzureFileVolumeSource) + if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -3173,6 +3219,15 @@ func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out * } else { out.FC = nil } + // unable to generate simple pointer conversion for api.AzureFileVolumeSource -> v1.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(AzureFileVolumeSource) + if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -3208,6 +3263,20 @@ func Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolu return autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in, out, s) } +func autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*AzureFileVolumeSource))(in) + } + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + +func Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { + return autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in, out, s) +} + func autoConvert_v1_Binding_To_api_Binding(in *Binding, out *api.Binding, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*Binding))(in) @@ -4155,6 +4224,16 @@ func autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *a } out.Host = in.Host out.Scheme = api.URIScheme(in.Scheme) + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]api.HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := Convert_v1_HTTPHeader_To_api_HTTPHeader(&in.HTTPHeaders[i], &out.HTTPHeaders[i], s); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } return nil } @@ -4162,6 +4241,19 @@ func Convert_v1_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *api.H return autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in, out, s) } +func autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in *HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*HTTPHeader))(in) + } + out.Name = in.Name + out.Value = in.Value + return nil +} + +func Convert_v1_HTTPHeader_To_api_HTTPHeader(in *HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { + return autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in, out, s) +} + func autoConvert_v1_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*Handler))(in) @@ -5053,6 +5145,15 @@ func autoConvert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *Per } else { out.FlexVolume = nil } + // unable to generate simple pointer conversion for v1.AzureFileVolumeSource -> api.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(api.AzureFileVolumeSource) + if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -6228,6 +6329,15 @@ func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api. } else { out.FC = nil } + // unable to generate simple pointer conversion for v1.AzureFileVolumeSource -> api.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(api.AzureFileVolumeSource) + if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -6238,6 +6348,7 @@ func Convert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.Volu func init() { err := api.Scheme.AddGeneratedConversionFuncs( autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource, + autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource, autoConvert_api_Binding_To_v1_Binding, autoConvert_api_Capabilities_To_v1_Capabilities, autoConvert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource, @@ -6279,6 +6390,7 @@ func init() { autoConvert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource, autoConvert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource, autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction, + autoConvert_api_HTTPHeader_To_v1_HTTPHeader, autoConvert_api_Handler_To_v1_Handler, autoConvert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource, autoConvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource, @@ -6363,6 +6475,7 @@ func init() { autoConvert_api_Volume_To_v1_Volume, autoConvert_unversioned_ExportOptions_To_v1_ExportOptions, autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource, + autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource, autoConvert_v1_Binding_To_api_Binding, autoConvert_v1_Capabilities_To_api_Capabilities, autoConvert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource, @@ -6405,6 +6518,7 @@ func init() { autoConvert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource, autoConvert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource, autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction, + autoConvert_v1_HTTPHeader_To_api_HTTPHeader, autoConvert_v1_Handler_To_api_Handler, autoConvert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource, autoConvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource, diff --git a/pkg/api/v1/deep_copy_generated.go b/pkg/api/v1/deep_copy_generated.go index f42db54f7b8..f5b35610466 100644 --- a/pkg/api/v1/deep_copy_generated.go +++ b/pkg/api/v1/deep_copy_generated.go @@ -73,6 +73,13 @@ func deepCopy_v1_AWSElasticBlockStoreVolumeSource(in AWSElasticBlockStoreVolumeS return nil } +func deepCopy_v1_AzureFileVolumeSource(in AzureFileVolumeSource, out *AzureFileVolumeSource, c *conversion.Cloner) error { + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + func deepCopy_v1_Binding(in Binding, out *Binding, c *conversion.Cloner) error { if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err @@ -749,6 +756,22 @@ func deepCopy_v1_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversi } out.Host = in.Host out.Scheme = in.Scheme + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := deepCopy_v1_HTTPHeader(in.HTTPHeaders[i], &out.HTTPHeaders[i], c); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } + return nil +} + +func deepCopy_v1_HTTPHeader(in HTTPHeader, out *HTTPHeader, c *conversion.Cloner) error { + out.Name = in.Name + out.Value = in.Value return nil } @@ -1474,6 +1497,14 @@ func deepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste } else { out.FlexVolume = nil } + if in.AzureFile != nil { + out.AzureFile = new(AzureFileVolumeSource) + if err := deepCopy_v1_AzureFileVolumeSource(*in.AzureFile, out.AzureFile, c); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -2498,6 +2529,14 @@ func deepCopy_v1_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion. } else { out.FC = nil } + if in.AzureFile != nil { + out.AzureFile = new(AzureFileVolumeSource) + if err := deepCopy_v1_AzureFileVolumeSource(*in.AzureFile, out.AzureFile, c); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -2534,6 +2573,7 @@ func init() { deepCopy_unversioned_Time, deepCopy_unversioned_TypeMeta, deepCopy_v1_AWSElasticBlockStoreVolumeSource, + deepCopy_v1_AzureFileVolumeSource, deepCopy_v1_Binding, deepCopy_v1_Capabilities, deepCopy_v1_CephFSVolumeSource, @@ -2576,6 +2616,7 @@ func init() { deepCopy_v1_GitRepoVolumeSource, deepCopy_v1_GlusterfsVolumeSource, deepCopy_v1_HTTPGetAction, + deepCopy_v1_HTTPHeader, deepCopy_v1_Handler, deepCopy_v1_HostPathVolumeSource, deepCopy_v1_ISCSIVolumeSource, diff --git a/pkg/api/v1/types.generated.go b/pkg/api/v1/types.generated.go index 2efd94f0580..7374491fa39 100644 --- a/pkg/api/v1/types.generated.go +++ b/pkg/api/v1/types.generated.go @@ -942,7 +942,7 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep82 := !z.EncBinary() yy2arr82 := z.EncBasicHandle().StructToArray - var yyq82 [18]bool + var yyq82 [19]bool _, _, _ = yysep82, yyq82, yy2arr82 const yyr82 bool = false yyq82[1] = x.VolumeSource.HostPath != nil && x.HostPath != nil @@ -962,9 +962,10 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { yyq82[15] = x.VolumeSource.Flocker != nil && x.Flocker != nil yyq82[16] = x.VolumeSource.DownwardAPI != nil && x.DownwardAPI != nil yyq82[17] = x.VolumeSource.FC != nil && x.FC != nil + yyq82[18] = x.VolumeSource.AzureFile != nil && x.AzureFile != nil var yynn82 int if yyr82 || yy2arr82 { - r.EncodeArrayStart(18) + r.EncodeArrayStart(19) } else { yynn82 = 1 for _, b := range yyq82 { @@ -1623,6 +1624,43 @@ func (x *Volume) CodecEncodeSelf(e *codec1978.Encoder) { } } } + var yyn103 bool + if x.VolumeSource.AzureFile == nil { + yyn103 = true + goto LABEL103 + } + LABEL103: + if yyr82 || yy2arr82 { + if yyn103 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq82[18] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq82[18] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn103 { + r.EncodeNil() + } else { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + } if yyr82 || yy2arr82 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1636,25 +1674,25 @@ func (x *Volume) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym103 := z.DecBinary() - _ = yym103 + yym104 := z.DecBinary() + _ = yym104 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct104 := r.ContainerType() - if yyct104 == codecSelferValueTypeMap1234 { - yyl104 := r.ReadMapStart() - if yyl104 == 0 { + yyct105 := r.ContainerType() + if yyct105 == codecSelferValueTypeMap1234 { + yyl105 := r.ReadMapStart() + if yyl105 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl104, d) + x.codecDecodeSelfFromMap(yyl105, d) } - } else if yyct104 == codecSelferValueTypeArray1234 { - yyl104 := r.ReadArrayStart() - if yyl104 == 0 { + } else if yyct105 == codecSelferValueTypeArray1234 { + yyl105 := r.ReadArrayStart() + if yyl105 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl104, d) + x.codecDecodeSelfFromArray(yyl105, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1666,12 +1704,12 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys105Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys105Slc - var yyhl105 bool = l >= 0 - for yyj105 := 0; ; yyj105++ { - if yyhl105 { - if yyj105 >= l { + var yys106Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys106Slc + var yyhl106 bool = l >= 0 + for yyj106 := 0; ; yyj106++ { + if yyhl106 { + if yyj106 >= l { break } } else { @@ -1680,10 +1718,10 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys105Slc = r.DecodeBytes(yys105Slc, true, true) - yys105 := string(yys105Slc) + yys106Slc = r.DecodeBytes(yys106Slc, true, true) + yys106 := string(yys106Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys105 { + switch yys106 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -1928,10 +1966,24 @@ func (x *Volume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } + case "azureFile": + if x.VolumeSource.AzureFile == nil { + x.VolumeSource.AzureFile = new(AzureFileVolumeSource) + } + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys105) - } // end switch yys105 - } // end for yyj105 + z.DecStructFieldNotFound(-1, yys106) + } // end switch yys106 + } // end for yyj106 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1939,16 +1991,16 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj124 int - var yyb124 bool - var yyhl124 bool = l >= 0 - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + var yyj126 int + var yyb126 bool + var yyhl126 bool = l >= 0 + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1961,13 +2013,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.HostPath == nil { x.VolumeSource.HostPath = new(HostPathVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1985,13 +2037,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.EmptyDir == nil { x.VolumeSource.EmptyDir = new(EmptyDirVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2009,13 +2061,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.GCEPersistentDisk == nil { x.VolumeSource.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2033,13 +2085,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.AWSElasticBlockStore == nil { x.VolumeSource.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2057,13 +2109,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.GitRepo == nil { x.VolumeSource.GitRepo = new(GitRepoVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2081,13 +2133,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Secret == nil { x.VolumeSource.Secret = new(SecretVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2105,13 +2157,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.NFS == nil { x.VolumeSource.NFS = new(NFSVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2129,13 +2181,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.ISCSI == nil { x.VolumeSource.ISCSI = new(ISCSIVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2153,13 +2205,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Glusterfs == nil { x.VolumeSource.Glusterfs = new(GlusterfsVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2177,13 +2229,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.PersistentVolumeClaim == nil { x.VolumeSource.PersistentVolumeClaim = new(PersistentVolumeClaimVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2201,13 +2253,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.RBD == nil { x.VolumeSource.RBD = new(RBDVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2225,13 +2277,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.FlexVolume == nil { x.VolumeSource.FlexVolume = new(FlexVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2249,13 +2301,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Cinder == nil { x.VolumeSource.Cinder = new(CinderVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2273,13 +2325,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.CephFS == nil { x.VolumeSource.CephFS = new(CephFSVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2297,13 +2349,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.Flocker == nil { x.VolumeSource.Flocker = new(FlockerVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2321,13 +2373,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.DownwardAPI == nil { x.VolumeSource.DownwardAPI = new(DownwardAPIVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2345,13 +2397,13 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.VolumeSource.FC == nil { x.VolumeSource.FC = new(FCVolumeSource) } - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l } else { - yyb124 = r.CheckBreak() + yyb126 = r.CheckBreak() } - if yyb124 { + if yyb126 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -2366,18 +2418,42 @@ func (x *Volume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } - for { - yyj124++ - if yyhl124 { - yyb124 = yyj124 > l - } else { - yyb124 = r.CheckBreak() + if x.VolumeSource.AzureFile == nil { + x.VolumeSource.AzureFile = new(AzureFileVolumeSource) + } + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l + } else { + yyb126 = r.CheckBreak() + } + if yyb126 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb124 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj126++ + if yyhl126 { + yyb126 = yyj126 > l + } else { + yyb126 = r.CheckBreak() + } + if yyb126 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj124-1, "") + z.DecStructFieldNotFound(yyj126-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -2389,49 +2465,50 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym143 := z.EncBinary() - _ = yym143 + yym146 := z.EncBinary() + _ = yym146 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep144 := !z.EncBinary() - yy2arr144 := z.EncBasicHandle().StructToArray - var yyq144 [17]bool - _, _, _ = yysep144, yyq144, yy2arr144 - const yyr144 bool = false - yyq144[0] = x.HostPath != nil - yyq144[1] = x.EmptyDir != nil - yyq144[2] = x.GCEPersistentDisk != nil - yyq144[3] = x.AWSElasticBlockStore != nil - yyq144[4] = x.GitRepo != nil - yyq144[5] = x.Secret != nil - yyq144[6] = x.NFS != nil - yyq144[7] = x.ISCSI != nil - yyq144[8] = x.Glusterfs != nil - yyq144[9] = x.PersistentVolumeClaim != nil - yyq144[10] = x.RBD != nil - yyq144[11] = x.FlexVolume != nil - yyq144[12] = x.Cinder != nil - yyq144[13] = x.CephFS != nil - yyq144[14] = x.Flocker != nil - yyq144[15] = x.DownwardAPI != nil - yyq144[16] = x.FC != nil - var yynn144 int - if yyr144 || yy2arr144 { - r.EncodeArrayStart(17) + yysep147 := !z.EncBinary() + yy2arr147 := z.EncBasicHandle().StructToArray + var yyq147 [18]bool + _, _, _ = yysep147, yyq147, yy2arr147 + const yyr147 bool = false + yyq147[0] = x.HostPath != nil + yyq147[1] = x.EmptyDir != nil + yyq147[2] = x.GCEPersistentDisk != nil + yyq147[3] = x.AWSElasticBlockStore != nil + yyq147[4] = x.GitRepo != nil + yyq147[5] = x.Secret != nil + yyq147[6] = x.NFS != nil + yyq147[7] = x.ISCSI != nil + yyq147[8] = x.Glusterfs != nil + yyq147[9] = x.PersistentVolumeClaim != nil + yyq147[10] = x.RBD != nil + yyq147[11] = x.FlexVolume != nil + yyq147[12] = x.Cinder != nil + yyq147[13] = x.CephFS != nil + yyq147[14] = x.Flocker != nil + yyq147[15] = x.DownwardAPI != nil + yyq147[16] = x.FC != nil + yyq147[17] = x.AzureFile != nil + var yynn147 int + if yyr147 || yy2arr147 { + r.EncodeArrayStart(18) } else { - yynn144 = 0 - for _, b := range yyq144 { + yynn147 = 0 + for _, b := range yyq147 { if b { - yynn144++ + yynn147++ } } - r.EncodeMapStart(yynn144) - yynn144 = 0 + r.EncodeMapStart(yynn147) + yynn147 = 0 } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[0] { + if yyq147[0] { if x.HostPath == nil { r.EncodeNil() } else { @@ -2441,7 +2518,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[0] { + if yyq147[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2452,9 +2529,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[1] { + if yyq147[1] { if x.EmptyDir == nil { r.EncodeNil() } else { @@ -2464,7 +2541,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[1] { + if yyq147[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("emptyDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2475,9 +2552,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[2] { + if yyq147[2] { if x.GCEPersistentDisk == nil { r.EncodeNil() } else { @@ -2487,7 +2564,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[2] { + if yyq147[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2498,9 +2575,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[3] { + if yyq147[3] { if x.AWSElasticBlockStore == nil { r.EncodeNil() } else { @@ -2510,7 +2587,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[3] { + if yyq147[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2521,9 +2598,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[4] { + if yyq147[4] { if x.GitRepo == nil { r.EncodeNil() } else { @@ -2533,7 +2610,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[4] { + if yyq147[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gitRepo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2544,9 +2621,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[5] { + if yyq147[5] { if x.Secret == nil { r.EncodeNil() } else { @@ -2556,7 +2633,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[5] { + if yyq147[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secret")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2567,9 +2644,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[6] { + if yyq147[6] { if x.NFS == nil { r.EncodeNil() } else { @@ -2579,7 +2656,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[6] { + if yyq147[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2590,9 +2667,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[7] { + if yyq147[7] { if x.ISCSI == nil { r.EncodeNil() } else { @@ -2602,7 +2679,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[7] { + if yyq147[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsi")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2613,9 +2690,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[8] { + if yyq147[8] { if x.Glusterfs == nil { r.EncodeNil() } else { @@ -2625,7 +2702,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[8] { + if yyq147[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2636,9 +2713,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[9] { + if yyq147[9] { if x.PersistentVolumeClaim == nil { r.EncodeNil() } else { @@ -2648,7 +2725,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[9] { + if yyq147[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("persistentVolumeClaim")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2659,9 +2736,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[10] { + if yyq147[10] { if x.RBD == nil { r.EncodeNil() } else { @@ -2671,7 +2748,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[10] { + if yyq147[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rbd")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2682,9 +2759,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[11] { + if yyq147[11] { if x.FlexVolume == nil { r.EncodeNil() } else { @@ -2694,7 +2771,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[11] { + if yyq147[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2705,9 +2782,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[12] { + if yyq147[12] { if x.Cinder == nil { r.EncodeNil() } else { @@ -2717,7 +2794,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[12] { + if yyq147[12] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cinder")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2728,9 +2805,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[13] { + if yyq147[13] { if x.CephFS == nil { r.EncodeNil() } else { @@ -2740,7 +2817,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[13] { + if yyq147[13] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cephfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2751,9 +2828,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[14] { + if yyq147[14] { if x.Flocker == nil { r.EncodeNil() } else { @@ -2763,7 +2840,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[14] { + if yyq147[14] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flocker")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2774,9 +2851,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[15] { + if yyq147[15] { if x.DownwardAPI == nil { r.EncodeNil() } else { @@ -2786,7 +2863,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[15] { + if yyq147[15] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("downwardAPI")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2797,9 +2874,9 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq144[16] { + if yyq147[16] { if x.FC == nil { r.EncodeNil() } else { @@ -2809,7 +2886,7 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq144[16] { + if yyq147[16] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fc")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -2820,7 +2897,30 @@ func (x *VolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr144 || yy2arr144 { + if yyr147 || yy2arr147 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq147[17] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq147[17] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + if yyr147 || yy2arr147 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -2833,25 +2933,25 @@ func (x *VolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym162 := z.DecBinary() - _ = yym162 + yym166 := z.DecBinary() + _ = yym166 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct163 := r.ContainerType() - if yyct163 == codecSelferValueTypeMap1234 { - yyl163 := r.ReadMapStart() - if yyl163 == 0 { + yyct167 := r.ContainerType() + if yyct167 == codecSelferValueTypeMap1234 { + yyl167 := r.ReadMapStart() + if yyl167 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl163, d) + x.codecDecodeSelfFromMap(yyl167, d) } - } else if yyct163 == codecSelferValueTypeArray1234 { - yyl163 := r.ReadArrayStart() - if yyl163 == 0 { + } else if yyct167 == codecSelferValueTypeArray1234 { + yyl167 := r.ReadArrayStart() + if yyl167 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl163, d) + x.codecDecodeSelfFromArray(yyl167, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -2863,12 +2963,12 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys164Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys164Slc - var yyhl164 bool = l >= 0 - for yyj164 := 0; ; yyj164++ { - if yyhl164 { - if yyj164 >= l { + var yys168Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys168Slc + var yyhl168 bool = l >= 0 + for yyj168 := 0; ; yyj168++ { + if yyhl168 { + if yyj168 >= l { break } } else { @@ -2877,10 +2977,10 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys164Slc = r.DecodeBytes(yys164Slc, true, true) - yys164 := string(yys164Slc) + yys168Slc = r.DecodeBytes(yys168Slc, true, true) + yys168 := string(yys168Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys164 { + switch yys168 { case "hostPath": if r.TryDecodeAsNil() { if x.HostPath != nil { @@ -3068,10 +3168,21 @@ func (x *VolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } + case "azureFile": + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys164) - } // end switch yys164 - } // end for yyj164 + z.DecStructFieldNotFound(-1, yys168) + } // end switch yys168 + } // end for yyj168 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -3079,16 +3190,16 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj182 int - var yyb182 bool - var yyhl182 bool = l >= 0 - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + var yyj187 int + var yyb187 bool + var yyhl187 bool = l >= 0 + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3103,13 +3214,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.HostPath.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3124,13 +3235,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.EmptyDir.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3145,13 +3256,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.GCEPersistentDisk.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3166,13 +3277,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.AWSElasticBlockStore.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3187,13 +3298,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.GitRepo.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3208,13 +3319,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Secret.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3229,13 +3340,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.NFS.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3250,13 +3361,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.ISCSI.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3271,13 +3382,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Glusterfs.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3292,13 +3403,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.PersistentVolumeClaim.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3313,13 +3424,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.RBD.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3334,13 +3445,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FlexVolume.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3355,13 +3466,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Cinder.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3376,13 +3487,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.CephFS.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3397,13 +3508,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Flocker.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3418,13 +3529,13 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.DownwardAPI.CodecDecodeSelf(d) } - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l } else { - yyb182 = r.CheckBreak() + yyb187 = r.CheckBreak() } - if yyb182 { + if yyb187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3439,18 +3550,39 @@ func (x *VolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.FC.CodecDecodeSelf(d) } - for { - yyj182++ - if yyhl182 { - yyb182 = yyj182 > l - } else { - yyb182 = r.CheckBreak() + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l + } else { + yyb187 = r.CheckBreak() + } + if yyb187 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb182 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj187++ + if yyhl187 { + yyb187 = yyj187 > l + } else { + yyb187 = r.CheckBreak() + } + if yyb187 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj182-1, "") + z.DecStructFieldNotFound(yyj187-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -3462,34 +3594,34 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder if x == nil { r.EncodeNil() } else { - yym200 := z.EncBinary() - _ = yym200 + yym206 := z.EncBinary() + _ = yym206 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep201 := !z.EncBinary() - yy2arr201 := z.EncBasicHandle().StructToArray - var yyq201 [2]bool - _, _, _ = yysep201, yyq201, yy2arr201 - const yyr201 bool = false - yyq201[1] = x.ReadOnly != false - var yynn201 int - if yyr201 || yy2arr201 { + yysep207 := !z.EncBinary() + yy2arr207 := z.EncBasicHandle().StructToArray + var yyq207 [2]bool + _, _, _ = yysep207, yyq207, yy2arr207 + const yyr207 bool = false + yyq207[1] = x.ReadOnly != false + var yynn207 int + if yyr207 || yy2arr207 { r.EncodeArrayStart(2) } else { - yynn201 = 1 - for _, b := range yyq201 { + yynn207 = 1 + for _, b := range yyq207 { if b { - yynn201++ + yynn207++ } } - r.EncodeMapStart(yynn201) - yynn201 = 0 + r.EncodeMapStart(yynn207) + yynn207 = 0 } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym203 := z.EncBinary() - _ = yym203 + yym209 := z.EncBinary() + _ = yym209 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClaimName)) @@ -3498,18 +3630,18 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("claimName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym204 := z.EncBinary() - _ = yym204 + yym210 := z.EncBinary() + _ = yym210 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClaimName)) } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq201[1] { - yym206 := z.EncBinary() - _ = yym206 + if yyq207[1] { + yym212 := z.EncBinary() + _ = yym212 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -3518,19 +3650,19 @@ func (x *PersistentVolumeClaimVolumeSource) CodecEncodeSelf(e *codec1978.Encoder r.EncodeBool(false) } } else { - if yyq201[1] { + if yyq207[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym207 := z.EncBinary() - _ = yym207 + yym213 := z.EncBinary() + _ = yym213 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr201 || yy2arr201 { + if yyr207 || yy2arr207 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -3543,25 +3675,25 @@ func (x *PersistentVolumeClaimVolumeSource) CodecDecodeSelf(d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym208 := z.DecBinary() - _ = yym208 + yym214 := z.DecBinary() + _ = yym214 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct209 := r.ContainerType() - if yyct209 == codecSelferValueTypeMap1234 { - yyl209 := r.ReadMapStart() - if yyl209 == 0 { + yyct215 := r.ContainerType() + if yyct215 == codecSelferValueTypeMap1234 { + yyl215 := r.ReadMapStart() + if yyl215 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl209, d) + x.codecDecodeSelfFromMap(yyl215, d) } - } else if yyct209 == codecSelferValueTypeArray1234 { - yyl209 := r.ReadArrayStart() - if yyl209 == 0 { + } else if yyct215 == codecSelferValueTypeArray1234 { + yyl215 := r.ReadArrayStart() + if yyl215 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl209, d) + x.codecDecodeSelfFromArray(yyl215, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -3573,12 +3705,12 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys210Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys210Slc - var yyhl210 bool = l >= 0 - for yyj210 := 0; ; yyj210++ { - if yyhl210 { - if yyj210 >= l { + var yys216Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys216Slc + var yyhl216 bool = l >= 0 + for yyj216 := 0; ; yyj216++ { + if yyhl216 { + if yyj216 >= l { break } } else { @@ -3587,10 +3719,10 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys210Slc = r.DecodeBytes(yys210Slc, true, true) - yys210 := string(yys210Slc) + yys216Slc = r.DecodeBytes(yys216Slc, true, true) + yys216 := string(yys216Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys210 { + switch yys216 { case "claimName": if r.TryDecodeAsNil() { x.ClaimName = "" @@ -3604,9 +3736,9 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromMap(l int, d *cod x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys210) - } // end switch yys210 - } // end for yyj210 + z.DecStructFieldNotFound(-1, yys216) + } // end switch yys216 + } // end for yyj216 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -3614,16 +3746,16 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj213 int - var yyb213 bool - var yyhl213 bool = l >= 0 - yyj213++ - if yyhl213 { - yyb213 = yyj213 > l + var yyj219 int + var yyb219 bool + var yyhl219 bool = l >= 0 + yyj219++ + if yyhl219 { + yyb219 = yyj219 > l } else { - yyb213 = r.CheckBreak() + yyb219 = r.CheckBreak() } - if yyb213 { + if yyb219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3633,13 +3765,13 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c } else { x.ClaimName = string(r.DecodeString()) } - yyj213++ - if yyhl213 { - yyb213 = yyj213 > l + yyj219++ + if yyhl219 { + yyb219 = yyj219 > l } else { - yyb213 = r.CheckBreak() + yyb219 = r.CheckBreak() } - if yyb213 { + if yyb219 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3650,17 +3782,17 @@ func (x *PersistentVolumeClaimVolumeSource) codecDecodeSelfFromArray(l int, d *c x.ReadOnly = bool(r.DecodeBool()) } for { - yyj213++ - if yyhl213 { - yyb213 = yyj213 > l + yyj219++ + if yyhl219 { + yyb219 = yyj219 > l } else { - yyb213 = r.CheckBreak() + yyb219 = r.CheckBreak() } - if yyb213 { + if yyb219 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj213-1, "") + z.DecStructFieldNotFound(yyj219-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -3672,44 +3804,45 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym216 := z.EncBinary() - _ = yym216 + yym222 := z.EncBinary() + _ = yym222 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep217 := !z.EncBinary() - yy2arr217 := z.EncBasicHandle().StructToArray - var yyq217 [12]bool - _, _, _ = yysep217, yyq217, yy2arr217 - const yyr217 bool = false - yyq217[0] = x.GCEPersistentDisk != nil - yyq217[1] = x.AWSElasticBlockStore != nil - yyq217[2] = x.HostPath != nil - yyq217[3] = x.Glusterfs != nil - yyq217[4] = x.NFS != nil - yyq217[5] = x.RBD != nil - yyq217[6] = x.ISCSI != nil - yyq217[7] = x.Cinder != nil - yyq217[8] = x.CephFS != nil - yyq217[9] = x.FC != nil - yyq217[10] = x.Flocker != nil - yyq217[11] = x.FlexVolume != nil - var yynn217 int - if yyr217 || yy2arr217 { - r.EncodeArrayStart(12) + yysep223 := !z.EncBinary() + yy2arr223 := z.EncBasicHandle().StructToArray + var yyq223 [13]bool + _, _, _ = yysep223, yyq223, yy2arr223 + const yyr223 bool = false + yyq223[0] = x.GCEPersistentDisk != nil + yyq223[1] = x.AWSElasticBlockStore != nil + yyq223[2] = x.HostPath != nil + yyq223[3] = x.Glusterfs != nil + yyq223[4] = x.NFS != nil + yyq223[5] = x.RBD != nil + yyq223[6] = x.ISCSI != nil + yyq223[7] = x.Cinder != nil + yyq223[8] = x.CephFS != nil + yyq223[9] = x.FC != nil + yyq223[10] = x.Flocker != nil + yyq223[11] = x.FlexVolume != nil + yyq223[12] = x.AzureFile != nil + var yynn223 int + if yyr223 || yy2arr223 { + r.EncodeArrayStart(13) } else { - yynn217 = 0 - for _, b := range yyq217 { + yynn223 = 0 + for _, b := range yyq223 { if b { - yynn217++ + yynn223++ } } - r.EncodeMapStart(yynn217) - yynn217 = 0 + r.EncodeMapStart(yynn223) + yynn223 = 0 } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[0] { + if yyq223[0] { if x.GCEPersistentDisk == nil { r.EncodeNil() } else { @@ -3719,7 +3852,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[0] { + if yyq223[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3730,9 +3863,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[1] { + if yyq223[1] { if x.AWSElasticBlockStore == nil { r.EncodeNil() } else { @@ -3742,7 +3875,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[1] { + if yyq223[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3753,9 +3886,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[2] { + if yyq223[2] { if x.HostPath == nil { r.EncodeNil() } else { @@ -3765,7 +3898,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[2] { + if yyq223[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3776,9 +3909,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[3] { + if yyq223[3] { if x.Glusterfs == nil { r.EncodeNil() } else { @@ -3788,7 +3921,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[3] { + if yyq223[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3799,9 +3932,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[4] { + if yyq223[4] { if x.NFS == nil { r.EncodeNil() } else { @@ -3811,7 +3944,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[4] { + if yyq223[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3822,9 +3955,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[5] { + if yyq223[5] { if x.RBD == nil { r.EncodeNil() } else { @@ -3834,7 +3967,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[5] { + if yyq223[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rbd")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3845,9 +3978,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[6] { + if yyq223[6] { if x.ISCSI == nil { r.EncodeNil() } else { @@ -3857,7 +3990,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[6] { + if yyq223[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsi")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3868,9 +4001,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[7] { + if yyq223[7] { if x.Cinder == nil { r.EncodeNil() } else { @@ -3880,7 +4013,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[7] { + if yyq223[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cinder")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3891,9 +4024,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[8] { + if yyq223[8] { if x.CephFS == nil { r.EncodeNil() } else { @@ -3903,7 +4036,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[8] { + if yyq223[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cephfs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3914,9 +4047,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[9] { + if yyq223[9] { if x.FC == nil { r.EncodeNil() } else { @@ -3926,7 +4059,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[9] { + if yyq223[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fc")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3937,9 +4070,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[10] { + if yyq223[10] { if x.Flocker == nil { r.EncodeNil() } else { @@ -3949,7 +4082,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[10] { + if yyq223[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flocker")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3960,9 +4093,9 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq217[11] { + if yyq223[11] { if x.FlexVolume == nil { r.EncodeNil() } else { @@ -3972,7 +4105,7 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq217[11] { + if yyq223[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -3983,7 +4116,30 @@ func (x *PersistentVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr217 || yy2arr217 { + if yyr223 || yy2arr223 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq223[12] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq223[12] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + if yyr223 || yy2arr223 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -3996,25 +4152,25 @@ func (x *PersistentVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym230 := z.DecBinary() - _ = yym230 + yym237 := z.DecBinary() + _ = yym237 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct231 := r.ContainerType() - if yyct231 == codecSelferValueTypeMap1234 { - yyl231 := r.ReadMapStart() - if yyl231 == 0 { + yyct238 := r.ContainerType() + if yyct238 == codecSelferValueTypeMap1234 { + yyl238 := r.ReadMapStart() + if yyl238 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl231, d) + x.codecDecodeSelfFromMap(yyl238, d) } - } else if yyct231 == codecSelferValueTypeArray1234 { - yyl231 := r.ReadArrayStart() - if yyl231 == 0 { + } else if yyct238 == codecSelferValueTypeArray1234 { + yyl238 := r.ReadArrayStart() + if yyl238 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl231, d) + x.codecDecodeSelfFromArray(yyl238, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4026,12 +4182,12 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys232Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys232Slc - var yyhl232 bool = l >= 0 - for yyj232 := 0; ; yyj232++ { - if yyhl232 { - if yyj232 >= l { + var yys239Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys239Slc + var yyhl239 bool = l >= 0 + for yyj239 := 0; ; yyj239++ { + if yyhl239 { + if yyj239 >= l { break } } else { @@ -4040,10 +4196,10 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys232Slc = r.DecodeBytes(yys232Slc, true, true) - yys232 := string(yys232Slc) + yys239Slc = r.DecodeBytes(yys239Slc, true, true) + yys239 := string(yys239Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys232 { + switch yys239 { case "gcePersistentDisk": if r.TryDecodeAsNil() { if x.GCEPersistentDisk != nil { @@ -4176,10 +4332,21 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Deco } x.FlexVolume.CodecDecodeSelf(d) } + case "azureFile": + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil + } + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } default: - z.DecStructFieldNotFound(-1, yys232) - } // end switch yys232 - } // end for yyj232 + z.DecStructFieldNotFound(-1, yys239) + } // end switch yys239 + } // end for yyj239 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -4187,16 +4354,16 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj245 int - var yyb245 bool - var yyhl245 bool = l >= 0 - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + var yyj253 int + var yyb253 bool + var yyhl253 bool = l >= 0 + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4211,13 +4378,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.GCEPersistentDisk.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4232,13 +4399,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.AWSElasticBlockStore.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4253,13 +4420,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.HostPath.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4274,13 +4441,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Glusterfs.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4295,13 +4462,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.NFS.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4316,13 +4483,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.RBD.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4337,13 +4504,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.ISCSI.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4358,13 +4525,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Cinder.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4379,13 +4546,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.CephFS.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4400,13 +4567,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.FC.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4421,13 +4588,13 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.Flocker.CodecDecodeSelf(d) } - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l } else { - yyb245 = r.CheckBreak() + yyb253 = r.CheckBreak() } - if yyb245 { + if yyb253 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4442,18 +4609,39 @@ func (x *PersistentVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.De } x.FlexVolume.CodecDecodeSelf(d) } - for { - yyj245++ - if yyhl245 { - yyb245 = yyj245 > l - } else { - yyb245 = r.CheckBreak() + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l + } else { + yyb253 = r.CheckBreak() + } + if yyb253 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.AzureFile != nil { + x.AzureFile = nil } - if yyb245 { + } else { + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) + } + x.AzureFile.CodecDecodeSelf(d) + } + for { + yyj253++ + if yyhl253 { + yyb253 = yyj253 > l + } else { + yyb253 = r.CheckBreak() + } + if yyb253 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj245-1, "") + z.DecStructFieldNotFound(yyj253-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4465,136 +4653,136 @@ func (x *PersistentVolume) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym258 := z.EncBinary() - _ = yym258 + yym267 := z.EncBinary() + _ = yym267 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep259 := !z.EncBinary() - yy2arr259 := z.EncBasicHandle().StructToArray - var yyq259 [5]bool - _, _, _ = yysep259, yyq259, yy2arr259 - const yyr259 bool = false - yyq259[0] = x.Kind != "" - yyq259[1] = x.APIVersion != "" - yyq259[2] = true - yyq259[3] = true - yyq259[4] = true - var yynn259 int - if yyr259 || yy2arr259 { + yysep268 := !z.EncBinary() + yy2arr268 := z.EncBasicHandle().StructToArray + var yyq268 [5]bool + _, _, _ = yysep268, yyq268, yy2arr268 + const yyr268 bool = false + yyq268[0] = true + yyq268[1] = true + yyq268[2] = true + yyq268[3] = x.Kind != "" + yyq268[4] = x.APIVersion != "" + var yynn268 int + if yyr268 || yy2arr268 { r.EncodeArrayStart(5) } else { - yynn259 = 0 - for _, b := range yyq259 { + yynn268 = 0 + for _, b := range yyq268 { if b { - yynn259++ + yynn268++ } } - r.EncodeMapStart(yynn259) - yynn259 = 0 + r.EncodeMapStart(yynn268) + yynn268 = 0 } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[0] { - yym261 := z.EncBinary() - _ = yym261 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq259[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym262 := z.EncBinary() - _ = yym262 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[1] { - yym264 := z.EncBinary() - _ = yym264 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq259[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym265 := z.EncBinary() - _ = yym265 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[2] { - yy267 := &x.ObjectMeta - yy267.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq259[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy268 := &x.ObjectMeta - yy268.CodecEncodeSelf(e) - } - } - if yyr259 || yy2arr259 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[3] { - yy270 := &x.Spec + if yyq268[0] { + yy270 := &x.ObjectMeta yy270.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq259[3] { + if yyq268[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy271 := &x.Spec + yy271 := &x.ObjectMeta yy271.CodecEncodeSelf(e) } } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq259[4] { - yy273 := &x.Status + if yyq268[1] { + yy273 := &x.Spec yy273.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq259[4] { + if yyq268[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy274 := &x.Status + yy274 := &x.Spec yy274.CodecEncodeSelf(e) } } - if yyr259 || yy2arr259 { + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[2] { + yy276 := &x.Status + yy276.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq268[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy277 := &x.Status + yy277.CodecEncodeSelf(e) + } + } + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[3] { + yym279 := z.EncBinary() + _ = yym279 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq268[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym280 := z.EncBinary() + _ = yym280 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr268 || yy2arr268 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq268[4] { + yym282 := z.EncBinary() + _ = yym282 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq268[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym283 := z.EncBinary() + _ = yym283 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr268 || yy2arr268 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -4607,25 +4795,25 @@ func (x *PersistentVolume) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym275 := z.DecBinary() - _ = yym275 + yym284 := z.DecBinary() + _ = yym284 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct276 := r.ContainerType() - if yyct276 == codecSelferValueTypeMap1234 { - yyl276 := r.ReadMapStart() - if yyl276 == 0 { + yyct285 := r.ContainerType() + if yyct285 == codecSelferValueTypeMap1234 { + yyl285 := r.ReadMapStart() + if yyl285 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl276, d) + x.codecDecodeSelfFromMap(yyl285, d) } - } else if yyct276 == codecSelferValueTypeArray1234 { - yyl276 := r.ReadArrayStart() - if yyl276 == 0 { + } else if yyct285 == codecSelferValueTypeArray1234 { + yyl285 := r.ReadArrayStart() + if yyl285 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl276, d) + x.codecDecodeSelfFromArray(yyl285, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4637,12 +4825,12 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys277Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys277Slc - var yyhl277 bool = l >= 0 - for yyj277 := 0; ; yyj277++ { - if yyhl277 { - if yyj277 >= l { + var yys286Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys286Slc + var yyhl286 bool = l >= 0 + for yyj286 := 0; ; yyj286++ { + if yyhl286 { + if yyj286 >= l { break } } else { @@ -4651,10 +4839,31 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys277Slc = r.DecodeBytes(yys277Slc, true, true) - yys277 := string(yys277Slc) + yys286Slc = r.DecodeBytes(yys286Slc, true, true) + yys286 := string(yys286Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys277 { + switch yys286 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv287 := &x.ObjectMeta + yyv287.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeSpec{} + } else { + yyv288 := &x.Spec + yyv288.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeStatus{} + } else { + yyv289 := &x.Status + yyv289.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4667,31 +4876,10 @@ func (x *PersistentVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv280 := &x.ObjectMeta - yyv280.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeSpec{} - } else { - yyv281 := &x.Spec - yyv281.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeStatus{} - } else { - yyv282 := &x.Status - yyv282.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys277) - } // end switch yys277 - } // end for yyj277 + z.DecStructFieldNotFound(-1, yys286) + } // end switch yys286 + } // end for yyj286 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -4699,16 +4887,67 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj283 int - var yyb283 bool - var yyhl283 bool = l >= 0 - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + var yyj292 int + var yyb292 bool + var yyhl292 bool = l >= 0 + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv293 := &x.ObjectMeta + yyv293.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeSpec{} + } else { + yyv294 := &x.Spec + yyv294.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeStatus{} + } else { + yyv295 := &x.Status + yyv295.CodecDecodeSelf(d) + } + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l + } else { + yyb292 = r.CheckBreak() + } + if yyb292 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4718,13 +4957,13 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4734,69 +4973,18 @@ func (x *PersistentVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv286 := &x.ObjectMeta - yyv286.CodecDecodeSelf(d) - } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeSpec{} - } else { - yyv287 := &x.Spec - yyv287.CodecDecodeSelf(d) - } - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l - } else { - yyb283 = r.CheckBreak() - } - if yyb283 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeStatus{} - } else { - yyv288 := &x.Status - yyv288.CodecDecodeSelf(d) - } for { - yyj283++ - if yyhl283 { - yyb283 = yyj283 > l + yyj292++ + if yyhl292 { + yyb292 = yyj292 > l } else { - yyb283 = r.CheckBreak() + yyb292 = r.CheckBreak() } - if yyb283 { + if yyb292 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj283-1, "") + z.DecStructFieldNotFound(yyj292-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4808,48 +4996,49 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym289 := z.EncBinary() - _ = yym289 + yym298 := z.EncBinary() + _ = yym298 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep290 := !z.EncBinary() - yy2arr290 := z.EncBasicHandle().StructToArray - var yyq290 [16]bool - _, _, _ = yysep290, yyq290, yy2arr290 - const yyr290 bool = false - yyq290[0] = len(x.Capacity) != 0 - yyq290[1] = x.PersistentVolumeSource.GCEPersistentDisk != nil && x.GCEPersistentDisk != nil - yyq290[2] = x.PersistentVolumeSource.AWSElasticBlockStore != nil && x.AWSElasticBlockStore != nil - yyq290[3] = x.PersistentVolumeSource.HostPath != nil && x.HostPath != nil - yyq290[4] = x.PersistentVolumeSource.Glusterfs != nil && x.Glusterfs != nil - yyq290[5] = x.PersistentVolumeSource.NFS != nil && x.NFS != nil - yyq290[6] = x.PersistentVolumeSource.RBD != nil && x.RBD != nil - yyq290[7] = x.PersistentVolumeSource.ISCSI != nil && x.ISCSI != nil - yyq290[8] = x.PersistentVolumeSource.Cinder != nil && x.Cinder != nil - yyq290[9] = x.PersistentVolumeSource.CephFS != nil && x.CephFS != nil - yyq290[10] = x.PersistentVolumeSource.FC != nil && x.FC != nil - yyq290[11] = x.PersistentVolumeSource.Flocker != nil && x.Flocker != nil - yyq290[12] = x.PersistentVolumeSource.FlexVolume != nil && x.FlexVolume != nil - yyq290[13] = len(x.AccessModes) != 0 - yyq290[14] = x.ClaimRef != nil - yyq290[15] = x.PersistentVolumeReclaimPolicy != "" - var yynn290 int - if yyr290 || yy2arr290 { - r.EncodeArrayStart(16) + yysep299 := !z.EncBinary() + yy2arr299 := z.EncBasicHandle().StructToArray + var yyq299 [17]bool + _, _, _ = yysep299, yyq299, yy2arr299 + const yyr299 bool = false + yyq299[0] = len(x.Capacity) != 0 + yyq299[1] = len(x.AccessModes) != 0 + yyq299[2] = x.ClaimRef != nil + yyq299[3] = x.PersistentVolumeReclaimPolicy != "" + yyq299[4] = x.PersistentVolumeSource.GCEPersistentDisk != nil && x.GCEPersistentDisk != nil + yyq299[5] = x.PersistentVolumeSource.AWSElasticBlockStore != nil && x.AWSElasticBlockStore != nil + yyq299[6] = x.PersistentVolumeSource.HostPath != nil && x.HostPath != nil + yyq299[7] = x.PersistentVolumeSource.Glusterfs != nil && x.Glusterfs != nil + yyq299[8] = x.PersistentVolumeSource.NFS != nil && x.NFS != nil + yyq299[9] = x.PersistentVolumeSource.RBD != nil && x.RBD != nil + yyq299[10] = x.PersistentVolumeSource.ISCSI != nil && x.ISCSI != nil + yyq299[11] = x.PersistentVolumeSource.Cinder != nil && x.Cinder != nil + yyq299[12] = x.PersistentVolumeSource.CephFS != nil && x.CephFS != nil + yyq299[13] = x.PersistentVolumeSource.FC != nil && x.FC != nil + yyq299[14] = x.PersistentVolumeSource.Flocker != nil && x.Flocker != nil + yyq299[15] = x.PersistentVolumeSource.FlexVolume != nil && x.FlexVolume != nil + yyq299[16] = x.PersistentVolumeSource.AzureFile != nil && x.AzureFile != nil + var yynn299 int + if yyr299 || yy2arr299 { + r.EncodeArrayStart(17) } else { - yynn290 = 0 - for _, b := range yyq290 { + yynn299 = 0 + for _, b := range yyq299 { if b { - yynn290++ + yynn299++ } } - r.EncodeMapStart(yynn290) - yynn290 = 0 + r.EncodeMapStart(yynn299) + yynn299 = 0 } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[0] { + if yyq299[0] { if x.Capacity == nil { r.EncodeNil() } else { @@ -4859,7 +5048,7 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq290[0] { + if yyq299[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -4870,458 +5059,14 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - var yyn292 bool - if x.PersistentVolumeSource.GCEPersistentDisk == nil { - yyn292 = true - goto LABEL292 - } - LABEL292: - if yyr290 || yy2arr290 { - if yyn292 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[1] { - if x.GCEPersistentDisk == nil { - r.EncodeNil() - } else { - x.GCEPersistentDisk.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn292 { - r.EncodeNil() - } else { - if x.GCEPersistentDisk == nil { - r.EncodeNil() - } else { - x.GCEPersistentDisk.CodecEncodeSelf(e) - } - } - } - } - var yyn293 bool - if x.PersistentVolumeSource.AWSElasticBlockStore == nil { - yyn293 = true - goto LABEL293 - } - LABEL293: - if yyr290 || yy2arr290 { - if yyn293 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[2] { - if x.AWSElasticBlockStore == nil { - r.EncodeNil() - } else { - x.AWSElasticBlockStore.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn293 { - r.EncodeNil() - } else { - if x.AWSElasticBlockStore == nil { - r.EncodeNil() - } else { - x.AWSElasticBlockStore.CodecEncodeSelf(e) - } - } - } - } - var yyn294 bool - if x.PersistentVolumeSource.HostPath == nil { - yyn294 = true - goto LABEL294 - } - LABEL294: - if yyr290 || yy2arr290 { - if yyn294 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[3] { - if x.HostPath == nil { - r.EncodeNil() - } else { - x.HostPath.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hostPath")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn294 { - r.EncodeNil() - } else { - if x.HostPath == nil { - r.EncodeNil() - } else { - x.HostPath.CodecEncodeSelf(e) - } - } - } - } - var yyn295 bool - if x.PersistentVolumeSource.Glusterfs == nil { - yyn295 = true - goto LABEL295 - } - LABEL295: - if yyr290 || yy2arr290 { - if yyn295 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[4] { - if x.Glusterfs == nil { - r.EncodeNil() - } else { - x.Glusterfs.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn295 { - r.EncodeNil() - } else { - if x.Glusterfs == nil { - r.EncodeNil() - } else { - x.Glusterfs.CodecEncodeSelf(e) - } - } - } - } - var yyn296 bool - if x.PersistentVolumeSource.NFS == nil { - yyn296 = true - goto LABEL296 - } - LABEL296: - if yyr290 || yy2arr290 { - if yyn296 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[5] { - if x.NFS == nil { - r.EncodeNil() - } else { - x.NFS.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("nfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn296 { - r.EncodeNil() - } else { - if x.NFS == nil { - r.EncodeNil() - } else { - x.NFS.CodecEncodeSelf(e) - } - } - } - } - var yyn297 bool - if x.PersistentVolumeSource.RBD == nil { - yyn297 = true - goto LABEL297 - } - LABEL297: - if yyr290 || yy2arr290 { - if yyn297 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[6] { - if x.RBD == nil { - r.EncodeNil() - } else { - x.RBD.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("rbd")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn297 { - r.EncodeNil() - } else { - if x.RBD == nil { - r.EncodeNil() - } else { - x.RBD.CodecEncodeSelf(e) - } - } - } - } - var yyn298 bool - if x.PersistentVolumeSource.ISCSI == nil { - yyn298 = true - goto LABEL298 - } - LABEL298: - if yyr290 || yy2arr290 { - if yyn298 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[7] { - if x.ISCSI == nil { - r.EncodeNil() - } else { - x.ISCSI.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[7] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("iscsi")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn298 { - r.EncodeNil() - } else { - if x.ISCSI == nil { - r.EncodeNil() - } else { - x.ISCSI.CodecEncodeSelf(e) - } - } - } - } - var yyn299 bool - if x.PersistentVolumeSource.Cinder == nil { - yyn299 = true - goto LABEL299 - } - LABEL299: - if yyr290 || yy2arr290 { - if yyn299 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[8] { - if x.Cinder == nil { - r.EncodeNil() - } else { - x.Cinder.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[8] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("cinder")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn299 { - r.EncodeNil() - } else { - if x.Cinder == nil { - r.EncodeNil() - } else { - x.Cinder.CodecEncodeSelf(e) - } - } - } - } - var yyn300 bool - if x.PersistentVolumeSource.CephFS == nil { - yyn300 = true - goto LABEL300 - } - LABEL300: - if yyr290 || yy2arr290 { - if yyn300 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[9] { - if x.CephFS == nil { - r.EncodeNil() - } else { - x.CephFS.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[9] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("cephfs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn300 { - r.EncodeNil() - } else { - if x.CephFS == nil { - r.EncodeNil() - } else { - x.CephFS.CodecEncodeSelf(e) - } - } - } - } - var yyn301 bool - if x.PersistentVolumeSource.FC == nil { - yyn301 = true - goto LABEL301 - } - LABEL301: - if yyr290 || yy2arr290 { - if yyn301 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[10] { - if x.FC == nil { - r.EncodeNil() - } else { - x.FC.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[10] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fc")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn301 { - r.EncodeNil() - } else { - if x.FC == nil { - r.EncodeNil() - } else { - x.FC.CodecEncodeSelf(e) - } - } - } - } - var yyn302 bool - if x.PersistentVolumeSource.Flocker == nil { - yyn302 = true - goto LABEL302 - } - LABEL302: - if yyr290 || yy2arr290 { - if yyn302 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[11] { - if x.Flocker == nil { - r.EncodeNil() - } else { - x.Flocker.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[11] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("flocker")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn302 { - r.EncodeNil() - } else { - if x.Flocker == nil { - r.EncodeNil() - } else { - x.Flocker.CodecEncodeSelf(e) - } - } - } - } - var yyn303 bool - if x.PersistentVolumeSource.FlexVolume == nil { - yyn303 = true - goto LABEL303 - } - LABEL303: - if yyr290 || yy2arr290 { - if yyn303 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[12] { - if x.FlexVolume == nil { - r.EncodeNil() - } else { - x.FlexVolume.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq290[12] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn303 { - r.EncodeNil() - } else { - if x.FlexVolume == nil { - r.EncodeNil() - } else { - x.FlexVolume.CodecEncodeSelf(e) - } - } - } - } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[13] { + if yyq299[1] { if x.AccessModes == nil { r.EncodeNil() } else { - yym305 := z.EncBinary() - _ = yym305 + yym302 := z.EncBinary() + _ = yym302 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -5331,15 +5076,15 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq290[13] { + if yyq299[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym306 := z.EncBinary() - _ = yym306 + yym303 := z.EncBinary() + _ = yym303 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -5347,9 +5092,9 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[14] { + if yyq299[2] { if x.ClaimRef == nil { r.EncodeNil() } else { @@ -5359,7 +5104,7 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq290[14] { + if yyq299[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("claimRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -5370,22 +5115,503 @@ func (x *PersistentVolumeSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr290 || yy2arr290 { + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq290[15] { + if yyq299[3] { x.PersistentVolumeReclaimPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq290[15] { + if yyq299[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("persistentVolumeReclaimPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.PersistentVolumeReclaimPolicy.CodecEncodeSelf(e) } } - if yyr290 || yy2arr290 { + var yyn306 bool + if x.PersistentVolumeSource.GCEPersistentDisk == nil { + yyn306 = true + goto LABEL306 + } + LABEL306: + if yyr299 || yy2arr299 { + if yyn306 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[4] { + if x.GCEPersistentDisk == nil { + r.EncodeNil() + } else { + x.GCEPersistentDisk.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("gcePersistentDisk")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn306 { + r.EncodeNil() + } else { + if x.GCEPersistentDisk == nil { + r.EncodeNil() + } else { + x.GCEPersistentDisk.CodecEncodeSelf(e) + } + } + } + } + var yyn307 bool + if x.PersistentVolumeSource.AWSElasticBlockStore == nil { + yyn307 = true + goto LABEL307 + } + LABEL307: + if yyr299 || yy2arr299 { + if yyn307 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[5] { + if x.AWSElasticBlockStore == nil { + r.EncodeNil() + } else { + x.AWSElasticBlockStore.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("awsElasticBlockStore")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn307 { + r.EncodeNil() + } else { + if x.AWSElasticBlockStore == nil { + r.EncodeNil() + } else { + x.AWSElasticBlockStore.CodecEncodeSelf(e) + } + } + } + } + var yyn308 bool + if x.PersistentVolumeSource.HostPath == nil { + yyn308 = true + goto LABEL308 + } + LABEL308: + if yyr299 || yy2arr299 { + if yyn308 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[6] { + if x.HostPath == nil { + r.EncodeNil() + } else { + x.HostPath.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPath")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn308 { + r.EncodeNil() + } else { + if x.HostPath == nil { + r.EncodeNil() + } else { + x.HostPath.CodecEncodeSelf(e) + } + } + } + } + var yyn309 bool + if x.PersistentVolumeSource.Glusterfs == nil { + yyn309 = true + goto LABEL309 + } + LABEL309: + if yyr299 || yy2arr299 { + if yyn309 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[7] { + if x.Glusterfs == nil { + r.EncodeNil() + } else { + x.Glusterfs.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("glusterfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn309 { + r.EncodeNil() + } else { + if x.Glusterfs == nil { + r.EncodeNil() + } else { + x.Glusterfs.CodecEncodeSelf(e) + } + } + } + } + var yyn310 bool + if x.PersistentVolumeSource.NFS == nil { + yyn310 = true + goto LABEL310 + } + LABEL310: + if yyr299 || yy2arr299 { + if yyn310 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[8] { + if x.NFS == nil { + r.EncodeNil() + } else { + x.NFS.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn310 { + r.EncodeNil() + } else { + if x.NFS == nil { + r.EncodeNil() + } else { + x.NFS.CodecEncodeSelf(e) + } + } + } + } + var yyn311 bool + if x.PersistentVolumeSource.RBD == nil { + yyn311 = true + goto LABEL311 + } + LABEL311: + if yyr299 || yy2arr299 { + if yyn311 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[9] { + if x.RBD == nil { + r.EncodeNil() + } else { + x.RBD.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("rbd")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn311 { + r.EncodeNil() + } else { + if x.RBD == nil { + r.EncodeNil() + } else { + x.RBD.CodecEncodeSelf(e) + } + } + } + } + var yyn312 bool + if x.PersistentVolumeSource.ISCSI == nil { + yyn312 = true + goto LABEL312 + } + LABEL312: + if yyr299 || yy2arr299 { + if yyn312 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[10] { + if x.ISCSI == nil { + r.EncodeNil() + } else { + x.ISCSI.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("iscsi")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn312 { + r.EncodeNil() + } else { + if x.ISCSI == nil { + r.EncodeNil() + } else { + x.ISCSI.CodecEncodeSelf(e) + } + } + } + } + var yyn313 bool + if x.PersistentVolumeSource.Cinder == nil { + yyn313 = true + goto LABEL313 + } + LABEL313: + if yyr299 || yy2arr299 { + if yyn313 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[11] { + if x.Cinder == nil { + r.EncodeNil() + } else { + x.Cinder.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[11] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("cinder")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn313 { + r.EncodeNil() + } else { + if x.Cinder == nil { + r.EncodeNil() + } else { + x.Cinder.CodecEncodeSelf(e) + } + } + } + } + var yyn314 bool + if x.PersistentVolumeSource.CephFS == nil { + yyn314 = true + goto LABEL314 + } + LABEL314: + if yyr299 || yy2arr299 { + if yyn314 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[12] { + if x.CephFS == nil { + r.EncodeNil() + } else { + x.CephFS.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[12] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("cephfs")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn314 { + r.EncodeNil() + } else { + if x.CephFS == nil { + r.EncodeNil() + } else { + x.CephFS.CodecEncodeSelf(e) + } + } + } + } + var yyn315 bool + if x.PersistentVolumeSource.FC == nil { + yyn315 = true + goto LABEL315 + } + LABEL315: + if yyr299 || yy2arr299 { + if yyn315 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[13] { + if x.FC == nil { + r.EncodeNil() + } else { + x.FC.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[13] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fc")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn315 { + r.EncodeNil() + } else { + if x.FC == nil { + r.EncodeNil() + } else { + x.FC.CodecEncodeSelf(e) + } + } + } + } + var yyn316 bool + if x.PersistentVolumeSource.Flocker == nil { + yyn316 = true + goto LABEL316 + } + LABEL316: + if yyr299 || yy2arr299 { + if yyn316 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[14] { + if x.Flocker == nil { + r.EncodeNil() + } else { + x.Flocker.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[14] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("flocker")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn316 { + r.EncodeNil() + } else { + if x.Flocker == nil { + r.EncodeNil() + } else { + x.Flocker.CodecEncodeSelf(e) + } + } + } + } + var yyn317 bool + if x.PersistentVolumeSource.FlexVolume == nil { + yyn317 = true + goto LABEL317 + } + LABEL317: + if yyr299 || yy2arr299 { + if yyn317 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[15] { + if x.FlexVolume == nil { + r.EncodeNil() + } else { + x.FlexVolume.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[15] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("flexVolume")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn317 { + r.EncodeNil() + } else { + if x.FlexVolume == nil { + r.EncodeNil() + } else { + x.FlexVolume.CodecEncodeSelf(e) + } + } + } + } + var yyn318 bool + if x.PersistentVolumeSource.AzureFile == nil { + yyn318 = true + goto LABEL318 + } + LABEL318: + if yyr299 || yy2arr299 { + if yyn318 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq299[16] { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq299[16] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("azureFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn318 { + r.EncodeNil() + } else { + if x.AzureFile == nil { + r.EncodeNil() + } else { + x.AzureFile.CodecEncodeSelf(e) + } + } + } + } + if yyr299 || yy2arr299 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -5398,25 +5624,25 @@ func (x *PersistentVolumeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym309 := z.DecBinary() - _ = yym309 + yym319 := z.DecBinary() + _ = yym319 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct310 := r.ContainerType() - if yyct310 == codecSelferValueTypeMap1234 { - yyl310 := r.ReadMapStart() - if yyl310 == 0 { + yyct320 := r.ContainerType() + if yyct320 == codecSelferValueTypeMap1234 { + yyl320 := r.ReadMapStart() + if yyl320 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl310, d) + x.codecDecodeSelfFromMap(yyl320, d) } - } else if yyct310 == codecSelferValueTypeArray1234 { - yyl310 := r.ReadArrayStart() - if yyl310 == 0 { + } else if yyct320 == codecSelferValueTypeArray1234 { + yyl320 := r.ReadArrayStart() + if yyl320 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl310, d) + x.codecDecodeSelfFromArray(yyl320, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -5428,12 +5654,12 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys311Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys311Slc - var yyhl311 bool = l >= 0 - for yyj311 := 0; ; yyj311++ { - if yyhl311 { - if yyj311 >= l { + var yys321Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys321Slc + var yyhl321 bool = l >= 0 + for yyj321 := 0; ; yyj321++ { + if yyhl321 { + if yyj321 >= l { break } } else { @@ -5442,16 +5668,45 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys311Slc = r.DecodeBytes(yys311Slc, true, true) - yys311 := string(yys311Slc) + yys321Slc = r.DecodeBytes(yys321Slc, true, true) + yys321 := string(yys321Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys311 { + switch yys321 { case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv312 := &x.Capacity - yyv312.CodecDecodeSelf(d) + yyv322 := &x.Capacity + yyv322.CodecDecodeSelf(d) + } + case "accessModes": + if r.TryDecodeAsNil() { + x.AccessModes = nil + } else { + yyv323 := &x.AccessModes + yym324 := z.DecBinary() + _ = yym324 + if false { + } else { + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv323), d) + } + } + case "claimRef": + if r.TryDecodeAsNil() { + if x.ClaimRef != nil { + x.ClaimRef = nil + } + } else { + if x.ClaimRef == nil { + x.ClaimRef = new(ObjectReference) + } + x.ClaimRef.CodecDecodeSelf(d) + } + case "persistentVolumeReclaimPolicy": + if r.TryDecodeAsNil() { + x.PersistentVolumeReclaimPolicy = "" + } else { + x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) } case "gcePersistentDisk": if x.PersistentVolumeSource.GCEPersistentDisk == nil { @@ -5621,39 +5876,24 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decode } x.FlexVolume.CodecDecodeSelf(d) } - case "accessModes": - if r.TryDecodeAsNil() { - x.AccessModes = nil - } else { - yyv325 := &x.AccessModes - yym326 := z.DecBinary() - _ = yym326 - if false { - } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv325), d) - } + case "azureFile": + if x.PersistentVolumeSource.AzureFile == nil { + x.PersistentVolumeSource.AzureFile = new(AzureFileVolumeSource) } - case "claimRef": if r.TryDecodeAsNil() { - if x.ClaimRef != nil { - x.ClaimRef = nil + if x.AzureFile != nil { + x.AzureFile = nil } } else { - if x.ClaimRef == nil { - x.ClaimRef = new(ObjectReference) + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) } - x.ClaimRef.CodecDecodeSelf(d) - } - case "persistentVolumeReclaimPolicy": - if r.TryDecodeAsNil() { - x.PersistentVolumeReclaimPolicy = "" - } else { - x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) + x.AzureFile.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys311) - } // end switch yys311 - } // end for yyj311 + z.DecStructFieldNotFound(-1, yys321) + } // end switch yys321 + } // end for yyj321 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -5661,16 +5901,16 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj329 int - var yyb329 bool - var yyhl329 bool = l >= 0 - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + var yyj340 int + var yyb340 bool + var yyhl340 bool = l >= 0 + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5678,19 +5918,78 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv330 := &x.Capacity - yyv330.CodecDecodeSelf(d) + yyv341 := &x.Capacity + yyv341.CodecDecodeSelf(d) + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.AccessModes = nil + } else { + yyv342 := &x.AccessModes + yym343 := z.DecBinary() + _ = yym343 + if false { + } else { + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv342), d) + } + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.ClaimRef != nil { + x.ClaimRef = nil + } + } else { + if x.ClaimRef == nil { + x.ClaimRef = new(ObjectReference) + } + x.ClaimRef.CodecDecodeSelf(d) + } + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PersistentVolumeReclaimPolicy = "" + } else { + x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) } if x.PersistentVolumeSource.GCEPersistentDisk == nil { x.PersistentVolumeSource.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5708,13 +6007,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.AWSElasticBlockStore == nil { x.PersistentVolumeSource.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5732,13 +6031,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.HostPath == nil { x.PersistentVolumeSource.HostPath = new(HostPathVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5756,13 +6055,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Glusterfs == nil { x.PersistentVolumeSource.Glusterfs = new(GlusterfsVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5780,13 +6079,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.NFS == nil { x.PersistentVolumeSource.NFS = new(NFSVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5804,13 +6103,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.RBD == nil { x.PersistentVolumeSource.RBD = new(RBDVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5828,13 +6127,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.ISCSI == nil { x.PersistentVolumeSource.ISCSI = new(ISCSIVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5852,13 +6151,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Cinder == nil { x.PersistentVolumeSource.Cinder = new(CinderVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5876,13 +6175,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.CephFS == nil { x.PersistentVolumeSource.CephFS = new(CephFSVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5900,13 +6199,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.FC == nil { x.PersistentVolumeSource.FC = new(FCVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5924,13 +6223,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.Flocker == nil { x.PersistentVolumeSource.Flocker = new(FlockerVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5948,13 +6247,13 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco if x.PersistentVolumeSource.FlexVolume == nil { x.PersistentVolumeSource.FlexVolume = new(FlexVolumeSource) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5969,77 +6268,42 @@ func (x *PersistentVolumeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Deco } x.FlexVolume.CodecDecodeSelf(d) } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() + if x.PersistentVolumeSource.AzureFile == nil { + x.PersistentVolumeSource.AzureFile = new(AzureFileVolumeSource) } - if yyb329 { + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l + } else { + yyb340 = r.CheckBreak() + } + if yyb340 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.AccessModes = nil - } else { - yyv343 := &x.AccessModes - yym344 := z.DecBinary() - _ = yym344 - if false { - } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv343), d) - } - } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() - } - if yyb329 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.ClaimRef != nil { - x.ClaimRef = nil + if x.AzureFile != nil { + x.AzureFile = nil } } else { - if x.ClaimRef == nil { - x.ClaimRef = new(ObjectReference) + if x.AzureFile == nil { + x.AzureFile = new(AzureFileVolumeSource) } - x.ClaimRef.CodecDecodeSelf(d) - } - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l - } else { - yyb329 = r.CheckBreak() - } - if yyb329 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PersistentVolumeReclaimPolicy = "" - } else { - x.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(r.DecodeString()) + x.AzureFile.CodecDecodeSelf(d) } for { - yyj329++ - if yyhl329 { - yyb329 = yyj329 > l + yyj340++ + if yyhl340 { + yyb340 = yyj340 > l } else { - yyb329 = r.CheckBreak() + yyb340 = r.CheckBreak() } - if yyb329 { + if yyb340 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj329-1, "") + z.DecStructFieldNotFound(yyj340-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6048,8 +6312,8 @@ func (x PersistentVolumeReclaimPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym347 := z.EncBinary() - _ = yym347 + yym359 := z.EncBinary() + _ = yym359 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -6061,8 +6325,8 @@ func (x *PersistentVolumeReclaimPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym348 := z.DecBinary() - _ = yym348 + yym360 := z.DecBinary() + _ = yym360 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -6077,52 +6341,52 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym349 := z.EncBinary() - _ = yym349 + yym361 := z.EncBinary() + _ = yym361 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep350 := !z.EncBinary() - yy2arr350 := z.EncBasicHandle().StructToArray - var yyq350 [3]bool - _, _, _ = yysep350, yyq350, yy2arr350 - const yyr350 bool = false - yyq350[0] = x.Phase != "" - yyq350[1] = x.Message != "" - yyq350[2] = x.Reason != "" - var yynn350 int - if yyr350 || yy2arr350 { + yysep362 := !z.EncBinary() + yy2arr362 := z.EncBasicHandle().StructToArray + var yyq362 [3]bool + _, _, _ = yysep362, yyq362, yy2arr362 + const yyr362 bool = false + yyq362[0] = x.Phase != "" + yyq362[1] = x.Message != "" + yyq362[2] = x.Reason != "" + var yynn362 int + if yyr362 || yy2arr362 { r.EncodeArrayStart(3) } else { - yynn350 = 0 - for _, b := range yyq350 { + yynn362 = 0 + for _, b := range yyq362 { if b { - yynn350++ + yynn362++ } } - r.EncodeMapStart(yynn350) - yynn350 = 0 + r.EncodeMapStart(yynn362) + yynn362 = 0 } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[0] { + if yyq362[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[0] { + if yyq362[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[1] { - yym353 := z.EncBinary() - _ = yym353 + if yyq362[1] { + yym365 := z.EncBinary() + _ = yym365 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -6131,23 +6395,23 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[1] { + if yyq362[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym354 := z.EncBinary() - _ = yym354 + yym366 := z.EncBinary() + _ = yym366 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq350[2] { - yym356 := z.EncBinary() - _ = yym356 + if yyq362[2] { + yym368 := z.EncBinary() + _ = yym368 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -6156,19 +6420,19 @@ func (x *PersistentVolumeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq350[2] { + if yyq362[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym357 := z.EncBinary() - _ = yym357 + yym369 := z.EncBinary() + _ = yym369 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr350 || yy2arr350 { + if yyr362 || yy2arr362 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6181,25 +6445,25 @@ func (x *PersistentVolumeStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym358 := z.DecBinary() - _ = yym358 + yym370 := z.DecBinary() + _ = yym370 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct359 := r.ContainerType() - if yyct359 == codecSelferValueTypeMap1234 { - yyl359 := r.ReadMapStart() - if yyl359 == 0 { + yyct371 := r.ContainerType() + if yyct371 == codecSelferValueTypeMap1234 { + yyl371 := r.ReadMapStart() + if yyl371 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl359, d) + x.codecDecodeSelfFromMap(yyl371, d) } - } else if yyct359 == codecSelferValueTypeArray1234 { - yyl359 := r.ReadArrayStart() - if yyl359 == 0 { + } else if yyct371 == codecSelferValueTypeArray1234 { + yyl371 := r.ReadArrayStart() + if yyl371 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl359, d) + x.codecDecodeSelfFromArray(yyl371, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6211,12 +6475,12 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys360Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys360Slc - var yyhl360 bool = l >= 0 - for yyj360 := 0; ; yyj360++ { - if yyhl360 { - if yyj360 >= l { + var yys372Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys372Slc + var yyhl372 bool = l >= 0 + for yyj372 := 0; ; yyj372++ { + if yyhl372 { + if yyj372 >= l { break } } else { @@ -6225,10 +6489,10 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys360Slc = r.DecodeBytes(yys360Slc, true, true) - yys360 := string(yys360Slc) + yys372Slc = r.DecodeBytes(yys372Slc, true, true) + yys372 := string(yys372Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys360 { + switch yys372 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -6248,9 +6512,9 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Deco x.Reason = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys360) - } // end switch yys360 - } // end for yyj360 + z.DecStructFieldNotFound(-1, yys372) + } // end switch yys372 + } // end for yyj372 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6258,16 +6522,16 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj364 int - var yyb364 bool - var yyhl364 bool = l >= 0 - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + var yyj376 int + var yyb376 bool + var yyhl376 bool = l >= 0 + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6277,13 +6541,13 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Phase = PersistentVolumePhase(r.DecodeString()) } - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6293,13 +6557,13 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Message = string(r.DecodeString()) } - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6310,17 +6574,17 @@ func (x *PersistentVolumeStatus) codecDecodeSelfFromArray(l int, d *codec1978.De x.Reason = string(r.DecodeString()) } for { - yyj364++ - if yyhl364 { - yyb364 = yyj364 > l + yyj376++ + if yyhl376 { + yyb376 = yyj376 > l } else { - yyb364 = r.CheckBreak() + yyb376 = r.CheckBreak() } - if yyb364 { + if yyb376 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj364-1, "") + z.DecStructFieldNotFound(yyj376-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6332,118 +6596,68 @@ func (x *PersistentVolumeList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym368 := z.EncBinary() - _ = yym368 + yym380 := z.EncBinary() + _ = yym380 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep369 := !z.EncBinary() - yy2arr369 := z.EncBasicHandle().StructToArray - var yyq369 [4]bool - _, _, _ = yysep369, yyq369, yy2arr369 - const yyr369 bool = false - yyq369[0] = x.Kind != "" - yyq369[1] = x.APIVersion != "" - yyq369[2] = true - var yynn369 int - if yyr369 || yy2arr369 { + yysep381 := !z.EncBinary() + yy2arr381 := z.EncBasicHandle().StructToArray + var yyq381 [4]bool + _, _, _ = yysep381, yyq381, yy2arr381 + const yyr381 bool = false + yyq381[0] = true + yyq381[2] = x.Kind != "" + yyq381[3] = x.APIVersion != "" + var yynn381 int + if yyr381 || yy2arr381 { r.EncodeArrayStart(4) } else { - yynn369 = 1 - for _, b := range yyq369 { + yynn381 = 1 + for _, b := range yyq381 { if b { - yynn369++ + yynn381++ } } - r.EncodeMapStart(yynn369) - yynn369 = 0 + r.EncodeMapStart(yynn381) + yynn381 = 0 } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[0] { - yym371 := z.EncBinary() - _ = yym371 + if yyq381[0] { + yy383 := &x.ListMeta + yym384 := z.EncBinary() + _ = yym384 if false { + } else if z.HasExtensions() && z.EncExt(yy383) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq369[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym372 := z.EncBinary() - _ = yym372 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr369 || yy2arr369 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[1] { - yym374 := z.EncBinary() - _ = yym374 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq369[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym375 := z.EncBinary() - _ = yym375 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr369 || yy2arr369 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq369[2] { - yy377 := &x.ListMeta - yym378 := z.EncBinary() - _ = yym378 - if false { - } else if z.HasExtensions() && z.EncExt(yy377) { - } else { - z.EncFallback(yy377) + z.EncFallback(yy383) } } else { r.EncodeNil() } } else { - if yyq369[2] { + if yyq381[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy379 := &x.ListMeta - yym380 := z.EncBinary() - _ = yym380 + yy385 := &x.ListMeta + yym386 := z.EncBinary() + _ = yym386 if false { - } else if z.HasExtensions() && z.EncExt(yy379) { + } else if z.HasExtensions() && z.EncExt(yy385) { } else { - z.EncFallback(yy379) + z.EncFallback(yy385) } } } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym382 := z.EncBinary() - _ = yym382 + yym388 := z.EncBinary() + _ = yym388 if false { } else { h.encSlicePersistentVolume(([]PersistentVolume)(x.Items), e) @@ -6456,15 +6670,65 @@ func (x *PersistentVolumeList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym383 := z.EncBinary() - _ = yym383 + yym389 := z.EncBinary() + _ = yym389 if false { } else { h.encSlicePersistentVolume(([]PersistentVolume)(x.Items), e) } } } - if yyr369 || yy2arr369 { + if yyr381 || yy2arr381 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq381[2] { + yym391 := z.EncBinary() + _ = yym391 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq381[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym392 := z.EncBinary() + _ = yym392 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr381 || yy2arr381 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq381[3] { + yym394 := z.EncBinary() + _ = yym394 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq381[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym395 := z.EncBinary() + _ = yym395 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr381 || yy2arr381 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6477,25 +6741,25 @@ func (x *PersistentVolumeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym384 := z.DecBinary() - _ = yym384 + yym396 := z.DecBinary() + _ = yym396 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct385 := r.ContainerType() - if yyct385 == codecSelferValueTypeMap1234 { - yyl385 := r.ReadMapStart() - if yyl385 == 0 { + yyct397 := r.ContainerType() + if yyct397 == codecSelferValueTypeMap1234 { + yyl397 := r.ReadMapStart() + if yyl397 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl385, d) + x.codecDecodeSelfFromMap(yyl397, d) } - } else if yyct385 == codecSelferValueTypeArray1234 { - yyl385 := r.ReadArrayStart() - if yyl385 == 0 { + } else if yyct397 == codecSelferValueTypeArray1234 { + yyl397 := r.ReadArrayStart() + if yyl397 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl385, d) + x.codecDecodeSelfFromArray(yyl397, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6507,12 +6771,12 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys386Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys386Slc - var yyhl386 bool = l >= 0 - for yyj386 := 0; ; yyj386++ { - if yyhl386 { - if yyj386 >= l { + var yys398Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys398Slc + var yyhl398 bool = l >= 0 + for yyj398 := 0; ; yyj398++ { + if yyhl398 { + if yyj398 >= l { break } } else { @@ -6521,10 +6785,35 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys386Slc = r.DecodeBytes(yys386Slc, true, true) - yys386 := string(yys386Slc) + yys398Slc = r.DecodeBytes(yys398Slc, true, true) + yys398 := string(yys398Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys386 { + switch yys398 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv399 := &x.ListMeta + yym400 := z.DecBinary() + _ = yym400 + if false { + } else if z.HasExtensions() && z.DecExt(yyv399) { + } else { + z.DecFallback(yyv399, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv401 := &x.Items + yym402 := z.DecBinary() + _ = yym402 + if false { + } else { + h.decSlicePersistentVolume((*[]PersistentVolume)(yyv401), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6537,35 +6826,10 @@ func (x *PersistentVolumeList) codecDecodeSelfFromMap(l int, d *codec1978.Decode } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv389 := &x.ListMeta - yym390 := z.DecBinary() - _ = yym390 - if false { - } else if z.HasExtensions() && z.DecExt(yyv389) { - } else { - z.DecFallback(yyv389, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv391 := &x.Items - yym392 := z.DecBinary() - _ = yym392 - if false { - } else { - h.decSlicePersistentVolume((*[]PersistentVolume)(yyv391), d) - } - } default: - z.DecStructFieldNotFound(-1, yys386) - } // end switch yys386 - } // end for yyj386 + z.DecStructFieldNotFound(-1, yys398) + } // end switch yys398 + } // end for yyj398 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6573,16 +6837,61 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj393 int - var yyb393 bool - var yyhl393 bool = l >= 0 - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + var yyj405 int + var yyb405 bool + var yyhl405 bool = l >= 0 + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv406 := &x.ListMeta + yym407 := z.DecBinary() + _ = yym407 + if false { + } else if z.HasExtensions() && z.DecExt(yyv406) { + } else { + z.DecFallback(yyv406, false) + } + } + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l + } else { + yyb405 = r.CheckBreak() + } + if yyb405 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv408 := &x.Items + yym409 := z.DecBinary() + _ = yym409 + if false { + } else { + h.decSlicePersistentVolume((*[]PersistentVolume)(yyv408), d) + } + } + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l + } else { + yyb405 = r.CheckBreak() + } + if yyb405 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6592,13 +6901,13 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.Kind = string(r.DecodeString()) } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6608,63 +6917,18 @@ func (x *PersistentVolumeList) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l - } else { - yyb393 = r.CheckBreak() - } - if yyb393 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv396 := &x.ListMeta - yym397 := z.DecBinary() - _ = yym397 - if false { - } else if z.HasExtensions() && z.DecExt(yyv396) { - } else { - z.DecFallback(yyv396, false) - } - } - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l - } else { - yyb393 = r.CheckBreak() - } - if yyb393 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv398 := &x.Items - yym399 := z.DecBinary() - _ = yym399 - if false { - } else { - h.decSlicePersistentVolume((*[]PersistentVolume)(yyv398), d) - } - } for { - yyj393++ - if yyhl393 { - yyb393 = yyj393 > l + yyj405++ + if yyhl405 { + yyb405 = yyj405 > l } else { - yyb393 = r.CheckBreak() + yyb405 = r.CheckBreak() } - if yyb393 { + if yyb405 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj393-1, "") + z.DecStructFieldNotFound(yyj405-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6676,136 +6940,136 @@ func (x *PersistentVolumeClaim) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym400 := z.EncBinary() - _ = yym400 + yym412 := z.EncBinary() + _ = yym412 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep401 := !z.EncBinary() - yy2arr401 := z.EncBasicHandle().StructToArray - var yyq401 [5]bool - _, _, _ = yysep401, yyq401, yy2arr401 - const yyr401 bool = false - yyq401[0] = x.Kind != "" - yyq401[1] = x.APIVersion != "" - yyq401[2] = true - yyq401[3] = true - yyq401[4] = true - var yynn401 int - if yyr401 || yy2arr401 { + yysep413 := !z.EncBinary() + yy2arr413 := z.EncBasicHandle().StructToArray + var yyq413 [5]bool + _, _, _ = yysep413, yyq413, yy2arr413 + const yyr413 bool = false + yyq413[0] = true + yyq413[1] = true + yyq413[2] = true + yyq413[3] = x.Kind != "" + yyq413[4] = x.APIVersion != "" + var yynn413 int + if yyr413 || yy2arr413 { r.EncodeArrayStart(5) } else { - yynn401 = 0 - for _, b := range yyq401 { + yynn413 = 0 + for _, b := range yyq413 { if b { - yynn401++ + yynn413++ } } - r.EncodeMapStart(yynn401) - yynn401 = 0 + r.EncodeMapStart(yynn413) + yynn413 = 0 } - if yyr401 || yy2arr401 { + if yyr413 || yy2arr413 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[0] { - yym403 := z.EncBinary() - _ = yym403 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq401[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym404 := z.EncBinary() - _ = yym404 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[1] { - yym406 := z.EncBinary() - _ = yym406 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq401[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym407 := z.EncBinary() - _ = yym407 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[2] { - yy409 := &x.ObjectMeta - yy409.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq401[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy410 := &x.ObjectMeta - yy410.CodecEncodeSelf(e) - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[3] { - yy412 := &x.Spec - yy412.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq401[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy413 := &x.Spec - yy413.CodecEncodeSelf(e) - } - } - if yyr401 || yy2arr401 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq401[4] { - yy415 := &x.Status + if yyq413[0] { + yy415 := &x.ObjectMeta yy415.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq401[4] { + if yyq413[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy416 := &x.Status + yy416 := &x.ObjectMeta yy416.CodecEncodeSelf(e) } } - if yyr401 || yy2arr401 { + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[1] { + yy418 := &x.Spec + yy418.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq413[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy419 := &x.Spec + yy419.CodecEncodeSelf(e) + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[2] { + yy421 := &x.Status + yy421.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq413[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy422 := &x.Status + yy422.CodecEncodeSelf(e) + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[3] { + yym424 := z.EncBinary() + _ = yym424 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq413[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym425 := z.EncBinary() + _ = yym425 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr413 || yy2arr413 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq413[4] { + yym427 := z.EncBinary() + _ = yym427 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq413[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym428 := z.EncBinary() + _ = yym428 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr413 || yy2arr413 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6818,25 +7082,25 @@ func (x *PersistentVolumeClaim) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym417 := z.DecBinary() - _ = yym417 + yym429 := z.DecBinary() + _ = yym429 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct418 := r.ContainerType() - if yyct418 == codecSelferValueTypeMap1234 { - yyl418 := r.ReadMapStart() - if yyl418 == 0 { + yyct430 := r.ContainerType() + if yyct430 == codecSelferValueTypeMap1234 { + yyl430 := r.ReadMapStart() + if yyl430 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl418, d) + x.codecDecodeSelfFromMap(yyl430, d) } - } else if yyct418 == codecSelferValueTypeArray1234 { - yyl418 := r.ReadArrayStart() - if yyl418 == 0 { + } else if yyct430 == codecSelferValueTypeArray1234 { + yyl430 := r.ReadArrayStart() + if yyl430 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl418, d) + x.codecDecodeSelfFromArray(yyl430, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6848,12 +7112,12 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys419Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys419Slc - var yyhl419 bool = l >= 0 - for yyj419 := 0; ; yyj419++ { - if yyhl419 { - if yyj419 >= l { + var yys431Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys431Slc + var yyhl431 bool = l >= 0 + for yyj431 := 0; ; yyj431++ { + if yyhl431 { + if yyj431 >= l { break } } else { @@ -6862,10 +7126,31 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys419Slc = r.DecodeBytes(yys419Slc, true, true) - yys419 := string(yys419Slc) + yys431Slc = r.DecodeBytes(yys431Slc, true, true) + yys431 := string(yys431Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys419 { + switch yys431 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv432 := &x.ObjectMeta + yyv432.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeClaimSpec{} + } else { + yyv433 := &x.Spec + yyv433.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeClaimStatus{} + } else { + yyv434 := &x.Status + yyv434.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6878,31 +7163,10 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv422 := &x.ObjectMeta - yyv422.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeClaimSpec{} - } else { - yyv423 := &x.Spec - yyv423.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeClaimStatus{} - } else { - yyv424 := &x.Status - yyv424.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys419) - } // end switch yys419 - } // end for yyj419 + z.DecStructFieldNotFound(-1, yys431) + } // end switch yys431 + } // end for yyj431 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6910,16 +7174,67 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj425 int - var yyb425 bool - var yyhl425 bool = l >= 0 - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + var yyj437 int + var yyb437 bool + var yyhl437 bool = l >= 0 + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv438 := &x.ObjectMeta + yyv438.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PersistentVolumeClaimSpec{} + } else { + yyv439 := &x.Spec + yyv439.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PersistentVolumeClaimStatus{} + } else { + yyv440 := &x.Status + yyv440.CodecDecodeSelf(d) + } + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l + } else { + yyb437 = r.CheckBreak() + } + if yyb437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6929,13 +7244,13 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6945,69 +7260,18 @@ func (x *PersistentVolumeClaim) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv428 := &x.ObjectMeta - yyv428.CodecDecodeSelf(d) - } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PersistentVolumeClaimSpec{} - } else { - yyv429 := &x.Spec - yyv429.CodecDecodeSelf(d) - } - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l - } else { - yyb425 = r.CheckBreak() - } - if yyb425 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PersistentVolumeClaimStatus{} - } else { - yyv430 := &x.Status - yyv430.CodecDecodeSelf(d) - } for { - yyj425++ - if yyhl425 { - yyb425 = yyj425 > l + yyj437++ + if yyhl437 { + yyb437 = yyj437 > l } else { - yyb425 = r.CheckBreak() + yyb437 = r.CheckBreak() } - if yyb425 { + if yyb437 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj425-1, "") + z.DecStructFieldNotFound(yyj437-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7019,118 +7283,68 @@ func (x *PersistentVolumeClaimList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym431 := z.EncBinary() - _ = yym431 + yym443 := z.EncBinary() + _ = yym443 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep432 := !z.EncBinary() - yy2arr432 := z.EncBasicHandle().StructToArray - var yyq432 [4]bool - _, _, _ = yysep432, yyq432, yy2arr432 - const yyr432 bool = false - yyq432[0] = x.Kind != "" - yyq432[1] = x.APIVersion != "" - yyq432[2] = true - var yynn432 int - if yyr432 || yy2arr432 { + yysep444 := !z.EncBinary() + yy2arr444 := z.EncBasicHandle().StructToArray + var yyq444 [4]bool + _, _, _ = yysep444, yyq444, yy2arr444 + const yyr444 bool = false + yyq444[0] = true + yyq444[2] = x.Kind != "" + yyq444[3] = x.APIVersion != "" + var yynn444 int + if yyr444 || yy2arr444 { r.EncodeArrayStart(4) } else { - yynn432 = 1 - for _, b := range yyq432 { + yynn444 = 1 + for _, b := range yyq444 { if b { - yynn432++ + yynn444++ } } - r.EncodeMapStart(yynn432) - yynn432 = 0 + r.EncodeMapStart(yynn444) + yynn444 = 0 } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[0] { - yym434 := z.EncBinary() - _ = yym434 + if yyq444[0] { + yy446 := &x.ListMeta + yym447 := z.EncBinary() + _ = yym447 if false { + } else if z.HasExtensions() && z.EncExt(yy446) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq432[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym435 := z.EncBinary() - _ = yym435 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr432 || yy2arr432 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[1] { - yym437 := z.EncBinary() - _ = yym437 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq432[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym438 := z.EncBinary() - _ = yym438 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr432 || yy2arr432 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq432[2] { - yy440 := &x.ListMeta - yym441 := z.EncBinary() - _ = yym441 - if false { - } else if z.HasExtensions() && z.EncExt(yy440) { - } else { - z.EncFallback(yy440) + z.EncFallback(yy446) } } else { r.EncodeNil() } } else { - if yyq432[2] { + if yyq444[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy442 := &x.ListMeta - yym443 := z.EncBinary() - _ = yym443 + yy448 := &x.ListMeta + yym449 := z.EncBinary() + _ = yym449 if false { - } else if z.HasExtensions() && z.EncExt(yy442) { + } else if z.HasExtensions() && z.EncExt(yy448) { } else { - z.EncFallback(yy442) + z.EncFallback(yy448) } } } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym445 := z.EncBinary() - _ = yym445 + yym451 := z.EncBinary() + _ = yym451 if false { } else { h.encSlicePersistentVolumeClaim(([]PersistentVolumeClaim)(x.Items), e) @@ -7143,15 +7357,65 @@ func (x *PersistentVolumeClaimList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym446 := z.EncBinary() - _ = yym446 + yym452 := z.EncBinary() + _ = yym452 if false { } else { h.encSlicePersistentVolumeClaim(([]PersistentVolumeClaim)(x.Items), e) } } } - if yyr432 || yy2arr432 { + if yyr444 || yy2arr444 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq444[2] { + yym454 := z.EncBinary() + _ = yym454 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq444[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym455 := z.EncBinary() + _ = yym455 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr444 || yy2arr444 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq444[3] { + yym457 := z.EncBinary() + _ = yym457 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq444[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym458 := z.EncBinary() + _ = yym458 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr444 || yy2arr444 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7164,25 +7428,25 @@ func (x *PersistentVolumeClaimList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym447 := z.DecBinary() - _ = yym447 + yym459 := z.DecBinary() + _ = yym459 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct448 := r.ContainerType() - if yyct448 == codecSelferValueTypeMap1234 { - yyl448 := r.ReadMapStart() - if yyl448 == 0 { + yyct460 := r.ContainerType() + if yyct460 == codecSelferValueTypeMap1234 { + yyl460 := r.ReadMapStart() + if yyl460 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl448, d) + x.codecDecodeSelfFromMap(yyl460, d) } - } else if yyct448 == codecSelferValueTypeArray1234 { - yyl448 := r.ReadArrayStart() - if yyl448 == 0 { + } else if yyct460 == codecSelferValueTypeArray1234 { + yyl460 := r.ReadArrayStart() + if yyl460 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl448, d) + x.codecDecodeSelfFromArray(yyl460, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7194,12 +7458,12 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys449Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys449Slc - var yyhl449 bool = l >= 0 - for yyj449 := 0; ; yyj449++ { - if yyhl449 { - if yyj449 >= l { + var yys461Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys461Slc + var yyhl461 bool = l >= 0 + for yyj461 := 0; ; yyj461++ { + if yyhl461 { + if yyj461 >= l { break } } else { @@ -7208,10 +7472,35 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys449Slc = r.DecodeBytes(yys449Slc, true, true) - yys449 := string(yys449Slc) + yys461Slc = r.DecodeBytes(yys461Slc, true, true) + yys461 := string(yys461Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys449 { + switch yys461 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv462 := &x.ListMeta + yym463 := z.DecBinary() + _ = yym463 + if false { + } else if z.HasExtensions() && z.DecExt(yyv462) { + } else { + z.DecFallback(yyv462, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv464 := &x.Items + yym465 := z.DecBinary() + _ = yym465 + if false { + } else { + h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv464), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -7224,35 +7513,10 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv452 := &x.ListMeta - yym453 := z.DecBinary() - _ = yym453 - if false { - } else if z.HasExtensions() && z.DecExt(yyv452) { - } else { - z.DecFallback(yyv452, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv454 := &x.Items - yym455 := z.DecBinary() - _ = yym455 - if false { - } else { - h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv454), d) - } - } default: - z.DecStructFieldNotFound(-1, yys449) - } // end switch yys449 - } // end for yyj449 + z.DecStructFieldNotFound(-1, yys461) + } // end switch yys461 + } // end for yyj461 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7260,16 +7524,61 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj456 int - var yyb456 bool - var yyhl456 bool = l >= 0 - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + var yyj468 int + var yyb468 bool + var yyhl468 bool = l >= 0 + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv469 := &x.ListMeta + yym470 := z.DecBinary() + _ = yym470 + if false { + } else if z.HasExtensions() && z.DecExt(yyv469) { + } else { + z.DecFallback(yyv469, false) + } + } + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l + } else { + yyb468 = r.CheckBreak() + } + if yyb468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv471 := &x.Items + yym472 := z.DecBinary() + _ = yym472 + if false { + } else { + h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv471), d) + } + } + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l + } else { + yyb468 = r.CheckBreak() + } + if yyb468 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7279,13 +7588,13 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.Kind = string(r.DecodeString()) } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7295,63 +7604,18 @@ func (x *PersistentVolumeClaimList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l - } else { - yyb456 = r.CheckBreak() - } - if yyb456 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv459 := &x.ListMeta - yym460 := z.DecBinary() - _ = yym460 - if false { - } else if z.HasExtensions() && z.DecExt(yyv459) { - } else { - z.DecFallback(yyv459, false) - } - } - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l - } else { - yyb456 = r.CheckBreak() - } - if yyb456 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv461 := &x.Items - yym462 := z.DecBinary() - _ = yym462 - if false { - } else { - h.decSlicePersistentVolumeClaim((*[]PersistentVolumeClaim)(yyv461), d) - } - } for { - yyj456++ - if yyhl456 { - yyb456 = yyj456 > l + yyj468++ + if yyhl468 { + yyb468 = yyj468 > l } else { - yyb456 = r.CheckBreak() + yyb468 = r.CheckBreak() } - if yyb456 { + if yyb468 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj456-1, "") + z.DecStructFieldNotFound(yyj468-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7363,40 +7627,40 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym463 := z.EncBinary() - _ = yym463 + yym475 := z.EncBinary() + _ = yym475 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep464 := !z.EncBinary() - yy2arr464 := z.EncBasicHandle().StructToArray - var yyq464 [3]bool - _, _, _ = yysep464, yyq464, yy2arr464 - const yyr464 bool = false - yyq464[0] = len(x.AccessModes) != 0 - yyq464[1] = true - yyq464[2] = x.VolumeName != "" - var yynn464 int - if yyr464 || yy2arr464 { + yysep476 := !z.EncBinary() + yy2arr476 := z.EncBasicHandle().StructToArray + var yyq476 [3]bool + _, _, _ = yysep476, yyq476, yy2arr476 + const yyr476 bool = false + yyq476[0] = len(x.AccessModes) != 0 + yyq476[1] = true + yyq476[2] = x.VolumeName != "" + var yynn476 int + if yyr476 || yy2arr476 { r.EncodeArrayStart(3) } else { - yynn464 = 0 - for _, b := range yyq464 { + yynn476 = 0 + for _, b := range yyq476 { if b { - yynn464++ + yynn476++ } } - r.EncodeMapStart(yynn464) - yynn464 = 0 + r.EncodeMapStart(yynn476) + yynn476 = 0 } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[0] { + if yyq476[0] { if x.AccessModes == nil { r.EncodeNil() } else { - yym466 := z.EncBinary() - _ = yym466 + yym478 := z.EncBinary() + _ = yym478 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7406,15 +7670,15 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq464[0] { + if yyq476[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym467 := z.EncBinary() - _ = yym467 + yym479 := z.EncBinary() + _ = yym479 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7422,28 +7686,28 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[1] { - yy469 := &x.Resources - yy469.CodecEncodeSelf(e) + if yyq476[1] { + yy481 := &x.Resources + yy481.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq464[1] { + if yyq476[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy470 := &x.Resources - yy470.CodecEncodeSelf(e) + yy482 := &x.Resources + yy482.CodecEncodeSelf(e) } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq464[2] { - yym472 := z.EncBinary() - _ = yym472 + if yyq476[2] { + yym484 := z.EncBinary() + _ = yym484 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeName)) @@ -7452,19 +7716,19 @@ func (x *PersistentVolumeClaimSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq464[2] { + if yyq476[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym473 := z.EncBinary() - _ = yym473 + yym485 := z.EncBinary() + _ = yym485 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeName)) } } } - if yyr464 || yy2arr464 { + if yyr476 || yy2arr476 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7477,25 +7741,25 @@ func (x *PersistentVolumeClaimSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym474 := z.DecBinary() - _ = yym474 + yym486 := z.DecBinary() + _ = yym486 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct475 := r.ContainerType() - if yyct475 == codecSelferValueTypeMap1234 { - yyl475 := r.ReadMapStart() - if yyl475 == 0 { + yyct487 := r.ContainerType() + if yyct487 == codecSelferValueTypeMap1234 { + yyl487 := r.ReadMapStart() + if yyl487 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl475, d) + x.codecDecodeSelfFromMap(yyl487, d) } - } else if yyct475 == codecSelferValueTypeArray1234 { - yyl475 := r.ReadArrayStart() - if yyl475 == 0 { + } else if yyct487 == codecSelferValueTypeArray1234 { + yyl487 := r.ReadArrayStart() + if yyl487 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl475, d) + x.codecDecodeSelfFromArray(yyl487, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7507,12 +7771,12 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys476Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys476Slc - var yyhl476 bool = l >= 0 - for yyj476 := 0; ; yyj476++ { - if yyhl476 { - if yyj476 >= l { + var yys488Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys488Slc + var yyhl488 bool = l >= 0 + for yyj488 := 0; ; yyj488++ { + if yyhl488 { + if yyj488 >= l { break } } else { @@ -7521,28 +7785,28 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys476Slc = r.DecodeBytes(yys476Slc, true, true) - yys476 := string(yys476Slc) + yys488Slc = r.DecodeBytes(yys488Slc, true, true) + yys488 := string(yys488Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys476 { + switch yys488 { case "accessModes": if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv477 := &x.AccessModes - yym478 := z.DecBinary() - _ = yym478 + yyv489 := &x.AccessModes + yym490 := z.DecBinary() + _ = yym490 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv477), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv489), d) } } case "resources": if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv479 := &x.Resources - yyv479.CodecDecodeSelf(d) + yyv491 := &x.Resources + yyv491.CodecDecodeSelf(d) } case "volumeName": if r.TryDecodeAsNil() { @@ -7551,9 +7815,9 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromMap(l int, d *codec1978.D x.VolumeName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys476) - } // end switch yys476 - } // end for yyj476 + z.DecStructFieldNotFound(-1, yys488) + } // end switch yys488 + } // end for yyj488 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7561,16 +7825,16 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj481 int - var yyb481 bool - var yyhl481 bool = l >= 0 - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + var yyj493 int + var yyb493 bool + var yyhl493 bool = l >= 0 + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7578,21 +7842,21 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv482 := &x.AccessModes - yym483 := z.DecBinary() - _ = yym483 + yyv494 := &x.AccessModes + yym495 := z.DecBinary() + _ = yym495 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv482), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv494), d) } } - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7600,16 +7864,16 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv484 := &x.Resources - yyv484.CodecDecodeSelf(d) + yyv496 := &x.Resources + yyv496.CodecDecodeSelf(d) } - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7620,17 +7884,17 @@ func (x *PersistentVolumeClaimSpec) codecDecodeSelfFromArray(l int, d *codec1978 x.VolumeName = string(r.DecodeString()) } for { - yyj481++ - if yyhl481 { - yyb481 = yyj481 > l + yyj493++ + if yyhl493 { + yyb493 = yyj493 > l } else { - yyb481 = r.CheckBreak() + yyb493 = r.CheckBreak() } - if yyb481 { + if yyb493 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj481-1, "") + z.DecStructFieldNotFound(yyj493-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7642,55 +7906,55 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym486 := z.EncBinary() - _ = yym486 + yym498 := z.EncBinary() + _ = yym498 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep487 := !z.EncBinary() - yy2arr487 := z.EncBasicHandle().StructToArray - var yyq487 [3]bool - _, _, _ = yysep487, yyq487, yy2arr487 - const yyr487 bool = false - yyq487[0] = x.Phase != "" - yyq487[1] = len(x.AccessModes) != 0 - yyq487[2] = len(x.Capacity) != 0 - var yynn487 int - if yyr487 || yy2arr487 { + yysep499 := !z.EncBinary() + yy2arr499 := z.EncBasicHandle().StructToArray + var yyq499 [3]bool + _, _, _ = yysep499, yyq499, yy2arr499 + const yyr499 bool = false + yyq499[0] = x.Phase != "" + yyq499[1] = len(x.AccessModes) != 0 + yyq499[2] = len(x.Capacity) != 0 + var yynn499 int + if yyr499 || yy2arr499 { r.EncodeArrayStart(3) } else { - yynn487 = 0 - for _, b := range yyq487 { + yynn499 = 0 + for _, b := range yyq499 { if b { - yynn487++ + yynn499++ } } - r.EncodeMapStart(yynn487) - yynn487 = 0 + r.EncodeMapStart(yynn499) + yynn499 = 0 } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[0] { + if yyq499[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq487[0] { + if yyq499[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[1] { + if yyq499[1] { if x.AccessModes == nil { r.EncodeNil() } else { - yym490 := z.EncBinary() - _ = yym490 + yym502 := z.EncBinary() + _ = yym502 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7700,15 +7964,15 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq487[1] { + if yyq499[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("accessModes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.AccessModes == nil { r.EncodeNil() } else { - yym491 := z.EncBinary() - _ = yym491 + yym503 := z.EncBinary() + _ = yym503 if false { } else { h.encSlicePersistentVolumeAccessMode(([]PersistentVolumeAccessMode)(x.AccessModes), e) @@ -7716,9 +7980,9 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq487[2] { + if yyq499[2] { if x.Capacity == nil { r.EncodeNil() } else { @@ -7728,7 +7992,7 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq487[2] { + if yyq499[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -7739,7 +8003,7 @@ func (x *PersistentVolumeClaimStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr487 || yy2arr487 { + if yyr499 || yy2arr499 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7752,25 +8016,25 @@ func (x *PersistentVolumeClaimStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym493 := z.DecBinary() - _ = yym493 + yym505 := z.DecBinary() + _ = yym505 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct494 := r.ContainerType() - if yyct494 == codecSelferValueTypeMap1234 { - yyl494 := r.ReadMapStart() - if yyl494 == 0 { + yyct506 := r.ContainerType() + if yyct506 == codecSelferValueTypeMap1234 { + yyl506 := r.ReadMapStart() + if yyl506 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl494, d) + x.codecDecodeSelfFromMap(yyl506, d) } - } else if yyct494 == codecSelferValueTypeArray1234 { - yyl494 := r.ReadArrayStart() - if yyl494 == 0 { + } else if yyct506 == codecSelferValueTypeArray1234 { + yyl506 := r.ReadArrayStart() + if yyl506 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl494, d) + x.codecDecodeSelfFromArray(yyl506, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7782,12 +8046,12 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys495Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys495Slc - var yyhl495 bool = l >= 0 - for yyj495 := 0; ; yyj495++ { - if yyhl495 { - if yyj495 >= l { + var yys507Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys507Slc + var yyhl507 bool = l >= 0 + for yyj507 := 0; ; yyj507++ { + if yyhl507 { + if yyj507 >= l { break } } else { @@ -7796,10 +8060,10 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys495Slc = r.DecodeBytes(yys495Slc, true, true) - yys495 := string(yys495Slc) + yys507Slc = r.DecodeBytes(yys507Slc, true, true) + yys507 := string(yys507Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys495 { + switch yys507 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -7810,25 +8074,25 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromMap(l int, d *codec1978 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv497 := &x.AccessModes - yym498 := z.DecBinary() - _ = yym498 + yyv509 := &x.AccessModes + yym510 := z.DecBinary() + _ = yym510 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv497), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv509), d) } } case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv499 := &x.Capacity - yyv499.CodecDecodeSelf(d) + yyv511 := &x.Capacity + yyv511.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys495) - } // end switch yys495 - } // end for yyj495 + z.DecStructFieldNotFound(-1, yys507) + } // end switch yys507 + } // end for yyj507 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7836,16 +8100,16 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj500 int - var yyb500 bool - var yyhl500 bool = l >= 0 - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + var yyj512 int + var yyb512 bool + var yyhl512 bool = l >= 0 + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7855,13 +8119,13 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 } else { x.Phase = PersistentVolumeClaimPhase(r.DecodeString()) } - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7869,21 +8133,21 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.AccessModes = nil } else { - yyv502 := &x.AccessModes - yym503 := z.DecBinary() - _ = yym503 + yyv514 := &x.AccessModes + yym515 := z.DecBinary() + _ = yym515 if false { } else { - h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv502), d) + h.decSlicePersistentVolumeAccessMode((*[]PersistentVolumeAccessMode)(yyv514), d) } } - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7891,21 +8155,21 @@ func (x *PersistentVolumeClaimStatus) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv504 := &x.Capacity - yyv504.CodecDecodeSelf(d) + yyv516 := &x.Capacity + yyv516.CodecDecodeSelf(d) } for { - yyj500++ - if yyhl500 { - yyb500 = yyj500 > l + yyj512++ + if yyhl512 { + yyb512 = yyj512 > l } else { - yyb500 = r.CheckBreak() + yyb512 = r.CheckBreak() } - if yyb500 { + if yyb512 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj500-1, "") + z.DecStructFieldNotFound(yyj512-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7914,8 +8178,8 @@ func (x PersistentVolumeAccessMode) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym505 := z.EncBinary() - _ = yym505 + yym517 := z.EncBinary() + _ = yym517 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7927,8 +8191,8 @@ func (x *PersistentVolumeAccessMode) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym506 := z.DecBinary() - _ = yym506 + yym518 := z.DecBinary() + _ = yym518 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7940,8 +8204,8 @@ func (x PersistentVolumePhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym507 := z.EncBinary() - _ = yym507 + yym519 := z.EncBinary() + _ = yym519 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7953,8 +8217,8 @@ func (x *PersistentVolumePhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym508 := z.DecBinary() - _ = yym508 + yym520 := z.DecBinary() + _ = yym520 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7966,8 +8230,8 @@ func (x PersistentVolumeClaimPhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym509 := z.EncBinary() - _ = yym509 + yym521 := z.EncBinary() + _ = yym521 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7979,8 +8243,8 @@ func (x *PersistentVolumeClaimPhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym510 := z.DecBinary() - _ = yym510 + yym522 := z.DecBinary() + _ = yym522 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7995,33 +8259,33 @@ func (x *HostPathVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym511 := z.EncBinary() - _ = yym511 + yym523 := z.EncBinary() + _ = yym523 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep512 := !z.EncBinary() - yy2arr512 := z.EncBasicHandle().StructToArray - var yyq512 [1]bool - _, _, _ = yysep512, yyq512, yy2arr512 - const yyr512 bool = false - var yynn512 int - if yyr512 || yy2arr512 { + yysep524 := !z.EncBinary() + yy2arr524 := z.EncBasicHandle().StructToArray + var yyq524 [1]bool + _, _, _ = yysep524, yyq524, yy2arr524 + const yyr524 bool = false + var yynn524 int + if yyr524 || yy2arr524 { r.EncodeArrayStart(1) } else { - yynn512 = 1 - for _, b := range yyq512 { + yynn524 = 1 + for _, b := range yyq524 { if b { - yynn512++ + yynn524++ } } - r.EncodeMapStart(yynn512) - yynn512 = 0 + r.EncodeMapStart(yynn524) + yynn524 = 0 } - if yyr512 || yy2arr512 { + if yyr524 || yy2arr524 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym514 := z.EncBinary() - _ = yym514 + yym526 := z.EncBinary() + _ = yym526 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -8030,14 +8294,14 @@ func (x *HostPathVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym515 := z.EncBinary() - _ = yym515 + yym527 := z.EncBinary() + _ = yym527 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr512 || yy2arr512 { + if yyr524 || yy2arr524 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8050,25 +8314,25 @@ func (x *HostPathVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym516 := z.DecBinary() - _ = yym516 + yym528 := z.DecBinary() + _ = yym528 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct517 := r.ContainerType() - if yyct517 == codecSelferValueTypeMap1234 { - yyl517 := r.ReadMapStart() - if yyl517 == 0 { + yyct529 := r.ContainerType() + if yyct529 == codecSelferValueTypeMap1234 { + yyl529 := r.ReadMapStart() + if yyl529 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl517, d) + x.codecDecodeSelfFromMap(yyl529, d) } - } else if yyct517 == codecSelferValueTypeArray1234 { - yyl517 := r.ReadArrayStart() - if yyl517 == 0 { + } else if yyct529 == codecSelferValueTypeArray1234 { + yyl529 := r.ReadArrayStart() + if yyl529 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl517, d) + x.codecDecodeSelfFromArray(yyl529, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8080,12 +8344,12 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys518Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys518Slc - var yyhl518 bool = l >= 0 - for yyj518 := 0; ; yyj518++ { - if yyhl518 { - if yyj518 >= l { + var yys530Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys530Slc + var yyhl530 bool = l >= 0 + for yyj530 := 0; ; yyj530++ { + if yyhl530 { + if yyj530 >= l { break } } else { @@ -8094,10 +8358,10 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys518Slc = r.DecodeBytes(yys518Slc, true, true) - yys518 := string(yys518Slc) + yys530Slc = r.DecodeBytes(yys530Slc, true, true) + yys530 := string(yys530Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys518 { + switch yys530 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -8105,9 +8369,9 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Path = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys518) - } // end switch yys518 - } // end for yyj518 + z.DecStructFieldNotFound(-1, yys530) + } // end switch yys530 + } // end for yyj530 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8115,16 +8379,16 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj520 int - var yyb520 bool - var yyhl520 bool = l >= 0 - yyj520++ - if yyhl520 { - yyb520 = yyj520 > l + var yyj532 int + var yyb532 bool + var yyhl532 bool = l >= 0 + yyj532++ + if yyhl532 { + yyb532 = yyj532 > l } else { - yyb520 = r.CheckBreak() + yyb532 = r.CheckBreak() } - if yyb520 { + if yyb532 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8135,17 +8399,17 @@ func (x *HostPathVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Path = string(r.DecodeString()) } for { - yyj520++ - if yyhl520 { - yyb520 = yyj520 > l + yyj532++ + if yyhl532 { + yyb532 = yyj532 > l } else { - yyb520 = r.CheckBreak() + yyb532 = r.CheckBreak() } - if yyb520 { + if yyb532 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj520-1, "") + z.DecStructFieldNotFound(yyj532-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8157,46 +8421,46 @@ func (x *EmptyDirVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym522 := z.EncBinary() - _ = yym522 + yym534 := z.EncBinary() + _ = yym534 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep523 := !z.EncBinary() - yy2arr523 := z.EncBasicHandle().StructToArray - var yyq523 [1]bool - _, _, _ = yysep523, yyq523, yy2arr523 - const yyr523 bool = false - yyq523[0] = x.Medium != "" - var yynn523 int - if yyr523 || yy2arr523 { + yysep535 := !z.EncBinary() + yy2arr535 := z.EncBasicHandle().StructToArray + var yyq535 [1]bool + _, _, _ = yysep535, yyq535, yy2arr535 + const yyr535 bool = false + yyq535[0] = x.Medium != "" + var yynn535 int + if yyr535 || yy2arr535 { r.EncodeArrayStart(1) } else { - yynn523 = 0 - for _, b := range yyq523 { + yynn535 = 0 + for _, b := range yyq535 { if b { - yynn523++ + yynn535++ } } - r.EncodeMapStart(yynn523) - yynn523 = 0 + r.EncodeMapStart(yynn535) + yynn535 = 0 } - if yyr523 || yy2arr523 { + if yyr535 || yy2arr535 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq523[0] { + if yyq535[0] { x.Medium.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq523[0] { + if yyq535[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("medium")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Medium.CodecEncodeSelf(e) } } - if yyr523 || yy2arr523 { + if yyr535 || yy2arr535 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8209,25 +8473,25 @@ func (x *EmptyDirVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym525 := z.DecBinary() - _ = yym525 + yym537 := z.DecBinary() + _ = yym537 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct526 := r.ContainerType() - if yyct526 == codecSelferValueTypeMap1234 { - yyl526 := r.ReadMapStart() - if yyl526 == 0 { + yyct538 := r.ContainerType() + if yyct538 == codecSelferValueTypeMap1234 { + yyl538 := r.ReadMapStart() + if yyl538 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl526, d) + x.codecDecodeSelfFromMap(yyl538, d) } - } else if yyct526 == codecSelferValueTypeArray1234 { - yyl526 := r.ReadArrayStart() - if yyl526 == 0 { + } else if yyct538 == codecSelferValueTypeArray1234 { + yyl538 := r.ReadArrayStart() + if yyl538 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl526, d) + x.codecDecodeSelfFromArray(yyl538, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8239,12 +8503,12 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys527Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys527Slc - var yyhl527 bool = l >= 0 - for yyj527 := 0; ; yyj527++ { - if yyhl527 { - if yyj527 >= l { + var yys539Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys539Slc + var yyhl539 bool = l >= 0 + for yyj539 := 0; ; yyj539++ { + if yyhl539 { + if yyj539 >= l { break } } else { @@ -8253,10 +8517,10 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys527Slc = r.DecodeBytes(yys527Slc, true, true) - yys527 := string(yys527Slc) + yys539Slc = r.DecodeBytes(yys539Slc, true, true) + yys539 := string(yys539Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys527 { + switch yys539 { case "medium": if r.TryDecodeAsNil() { x.Medium = "" @@ -8264,9 +8528,9 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Medium = StorageMedium(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys527) - } // end switch yys527 - } // end for yyj527 + z.DecStructFieldNotFound(-1, yys539) + } // end switch yys539 + } // end for yyj539 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8274,16 +8538,16 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj529 int - var yyb529 bool - var yyhl529 bool = l >= 0 - yyj529++ - if yyhl529 { - yyb529 = yyj529 > l + var yyj541 int + var yyb541 bool + var yyhl541 bool = l >= 0 + yyj541++ + if yyhl541 { + yyb541 = yyj541 > l } else { - yyb529 = r.CheckBreak() + yyb541 = r.CheckBreak() } - if yyb529 { + if yyb541 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8294,17 +8558,17 @@ func (x *EmptyDirVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Medium = StorageMedium(r.DecodeString()) } for { - yyj529++ - if yyhl529 { - yyb529 = yyj529 > l + yyj541++ + if yyhl541 { + yyb541 = yyj541 > l } else { - yyb529 = r.CheckBreak() + yyb541 = r.CheckBreak() } - if yyb529 { + if yyb541 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj529-1, "") + z.DecStructFieldNotFound(yyj541-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8316,34 +8580,34 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym531 := z.EncBinary() - _ = yym531 + yym543 := z.EncBinary() + _ = yym543 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep532 := !z.EncBinary() - yy2arr532 := z.EncBasicHandle().StructToArray - var yyq532 [3]bool - _, _, _ = yysep532, yyq532, yy2arr532 - const yyr532 bool = false - yyq532[2] = x.ReadOnly != false - var yynn532 int - if yyr532 || yy2arr532 { + yysep544 := !z.EncBinary() + yy2arr544 := z.EncBasicHandle().StructToArray + var yyq544 [3]bool + _, _, _ = yysep544, yyq544, yy2arr544 + const yyr544 bool = false + yyq544[2] = x.ReadOnly != false + var yynn544 int + if yyr544 || yy2arr544 { r.EncodeArrayStart(3) } else { - yynn532 = 2 - for _, b := range yyq532 { + yynn544 = 2 + for _, b := range yyq544 { if b { - yynn532++ + yynn544++ } } - r.EncodeMapStart(yynn532) - yynn532 = 0 + r.EncodeMapStart(yynn544) + yynn544 = 0 } - if yyr532 || yy2arr532 { + if yyr544 || yy2arr544 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym534 := z.EncBinary() - _ = yym534 + yym546 := z.EncBinary() + _ = yym546 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.EndpointsName)) @@ -8352,17 +8616,17 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("endpoints")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym535 := z.EncBinary() - _ = yym535 + yym547 := z.EncBinary() + _ = yym547 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.EndpointsName)) } } - if yyr532 || yy2arr532 { + if yyr544 || yy2arr544 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym537 := z.EncBinary() - _ = yym537 + yym549 := z.EncBinary() + _ = yym549 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -8371,18 +8635,18 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym538 := z.EncBinary() - _ = yym538 + yym550 := z.EncBinary() + _ = yym550 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr532 || yy2arr532 { + if yyr544 || yy2arr544 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq532[2] { - yym540 := z.EncBinary() - _ = yym540 + if yyq544[2] { + yym552 := z.EncBinary() + _ = yym552 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -8391,19 +8655,19 @@ func (x *GlusterfsVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq532[2] { + if yyq544[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym541 := z.EncBinary() - _ = yym541 + yym553 := z.EncBinary() + _ = yym553 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr532 || yy2arr532 { + if yyr544 || yy2arr544 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8416,25 +8680,25 @@ func (x *GlusterfsVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym542 := z.DecBinary() - _ = yym542 + yym554 := z.DecBinary() + _ = yym554 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct543 := r.ContainerType() - if yyct543 == codecSelferValueTypeMap1234 { - yyl543 := r.ReadMapStart() - if yyl543 == 0 { + yyct555 := r.ContainerType() + if yyct555 == codecSelferValueTypeMap1234 { + yyl555 := r.ReadMapStart() + if yyl555 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl543, d) + x.codecDecodeSelfFromMap(yyl555, d) } - } else if yyct543 == codecSelferValueTypeArray1234 { - yyl543 := r.ReadArrayStart() - if yyl543 == 0 { + } else if yyct555 == codecSelferValueTypeArray1234 { + yyl555 := r.ReadArrayStart() + if yyl555 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl543, d) + x.codecDecodeSelfFromArray(yyl555, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8446,12 +8710,12 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys544Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys544Slc - var yyhl544 bool = l >= 0 - for yyj544 := 0; ; yyj544++ { - if yyhl544 { - if yyj544 >= l { + var yys556Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys556Slc + var yyhl556 bool = l >= 0 + for yyj556 := 0; ; yyj556++ { + if yyhl556 { + if yyj556 >= l { break } } else { @@ -8460,10 +8724,10 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys544Slc = r.DecodeBytes(yys544Slc, true, true) - yys544 := string(yys544Slc) + yys556Slc = r.DecodeBytes(yys556Slc, true, true) + yys556 := string(yys556Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys544 { + switch yys556 { case "endpoints": if r.TryDecodeAsNil() { x.EndpointsName = "" @@ -8483,9 +8747,9 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys544) - } // end switch yys544 - } // end for yyj544 + z.DecStructFieldNotFound(-1, yys556) + } // end switch yys556 + } // end for yyj556 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8493,16 +8757,16 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj548 int - var yyb548 bool - var yyhl548 bool = l >= 0 - yyj548++ - if yyhl548 { - yyb548 = yyj548 > l + var yyj560 int + var yyb560 bool + var yyhl560 bool = l >= 0 + yyj560++ + if yyhl560 { + yyb560 = yyj560 > l } else { - yyb548 = r.CheckBreak() + yyb560 = r.CheckBreak() } - if yyb548 { + if yyb560 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8512,13 +8776,13 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.EndpointsName = string(r.DecodeString()) } - yyj548++ - if yyhl548 { - yyb548 = yyj548 > l + yyj560++ + if yyhl560 { + yyb560 = yyj560 > l } else { - yyb548 = r.CheckBreak() + yyb560 = r.CheckBreak() } - if yyb548 { + if yyb560 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8528,13 +8792,13 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Path = string(r.DecodeString()) } - yyj548++ - if yyhl548 { - yyb548 = yyj548 > l + yyj560++ + if yyhl560 { + yyb560 = yyj560 > l } else { - yyb548 = r.CheckBreak() + yyb560 = r.CheckBreak() } - if yyb548 { + if yyb560 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8545,17 +8809,17 @@ func (x *GlusterfsVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec x.ReadOnly = bool(r.DecodeBool()) } for { - yyj548++ - if yyhl548 { - yyb548 = yyj548 > l + yyj560++ + if yyhl560 { + yyb560 = yyj560 > l } else { - yyb548 = r.CheckBreak() + yyb560 = r.CheckBreak() } - if yyb548 { + if yyb560 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj548-1, "") + z.DecStructFieldNotFound(yyj560-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8567,38 +8831,38 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym552 := z.EncBinary() - _ = yym552 + yym564 := z.EncBinary() + _ = yym564 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep553 := !z.EncBinary() - yy2arr553 := z.EncBasicHandle().StructToArray - var yyq553 [8]bool - _, _, _ = yysep553, yyq553, yy2arr553 - const yyr553 bool = false - yyq553[2] = x.FSType != "" - yyq553[7] = x.ReadOnly != false - var yynn553 int - if yyr553 || yy2arr553 { + yysep565 := !z.EncBinary() + yy2arr565 := z.EncBasicHandle().StructToArray + var yyq565 [8]bool + _, _, _ = yysep565, yyq565, yy2arr565 + const yyr565 bool = false + yyq565[2] = x.FSType != "" + yyq565[7] = x.ReadOnly != false + var yynn565 int + if yyr565 || yy2arr565 { r.EncodeArrayStart(8) } else { - yynn553 = 6 - for _, b := range yyq553 { + yynn565 = 6 + for _, b := range yyq565 { if b { - yynn553++ + yynn565++ } } - r.EncodeMapStart(yynn553) - yynn553 = 0 + r.EncodeMapStart(yynn565) + yynn565 = 0 } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.CephMonitors == nil { r.EncodeNil() } else { - yym555 := z.EncBinary() - _ = yym555 + yym567 := z.EncBinary() + _ = yym567 if false { } else { z.F.EncSliceStringV(x.CephMonitors, false, e) @@ -8611,18 +8875,18 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.CephMonitors == nil { r.EncodeNil() } else { - yym556 := z.EncBinary() - _ = yym556 + yym568 := z.EncBinary() + _ = yym568 if false { } else { z.F.EncSliceStringV(x.CephMonitors, false, e) } } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym558 := z.EncBinary() - _ = yym558 + yym570 := z.EncBinary() + _ = yym570 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDImage)) @@ -8631,18 +8895,18 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym559 := z.EncBinary() - _ = yym559 + yym571 := z.EncBinary() + _ = yym571 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDImage)) } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq553[2] { - yym561 := z.EncBinary() - _ = yym561 + if yyq565[2] { + yym573 := z.EncBinary() + _ = yym573 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -8651,22 +8915,22 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq553[2] { + if yyq565[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym562 := z.EncBinary() - _ = yym562 + yym574 := z.EncBinary() + _ = yym574 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym564 := z.EncBinary() - _ = yym564 + yym576 := z.EncBinary() + _ = yym576 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDPool)) @@ -8675,17 +8939,17 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("pool")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym565 := z.EncBinary() - _ = yym565 + yym577 := z.EncBinary() + _ = yym577 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RBDPool)) } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym567 := z.EncBinary() - _ = yym567 + yym579 := z.EncBinary() + _ = yym579 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RadosUser)) @@ -8694,17 +8958,17 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym568 := z.EncBinary() - _ = yym568 + yym580 := z.EncBinary() + _ = yym580 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RadosUser)) } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym570 := z.EncBinary() - _ = yym570 + yym582 := z.EncBinary() + _ = yym582 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Keyring)) @@ -8713,14 +8977,14 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("keyring")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym571 := z.EncBinary() - _ = yym571 + yym583 := z.EncBinary() + _ = yym583 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Keyring)) } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.SecretRef == nil { r.EncodeNil() @@ -8737,11 +9001,11 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { x.SecretRef.CodecEncodeSelf(e) } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq553[7] { - yym574 := z.EncBinary() - _ = yym574 + if yyq565[7] { + yym586 := z.EncBinary() + _ = yym586 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -8750,19 +9014,19 @@ func (x *RBDVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq553[7] { + if yyq565[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym575 := z.EncBinary() - _ = yym575 + yym587 := z.EncBinary() + _ = yym587 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr553 || yy2arr553 { + if yyr565 || yy2arr565 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8775,25 +9039,25 @@ func (x *RBDVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym576 := z.DecBinary() - _ = yym576 + yym588 := z.DecBinary() + _ = yym588 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct577 := r.ContainerType() - if yyct577 == codecSelferValueTypeMap1234 { - yyl577 := r.ReadMapStart() - if yyl577 == 0 { + yyct589 := r.ContainerType() + if yyct589 == codecSelferValueTypeMap1234 { + yyl589 := r.ReadMapStart() + if yyl589 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl577, d) + x.codecDecodeSelfFromMap(yyl589, d) } - } else if yyct577 == codecSelferValueTypeArray1234 { - yyl577 := r.ReadArrayStart() - if yyl577 == 0 { + } else if yyct589 == codecSelferValueTypeArray1234 { + yyl589 := r.ReadArrayStart() + if yyl589 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl577, d) + x.codecDecodeSelfFromArray(yyl589, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8805,12 +9069,12 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys578Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys578Slc - var yyhl578 bool = l >= 0 - for yyj578 := 0; ; yyj578++ { - if yyhl578 { - if yyj578 >= l { + var yys590Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys590Slc + var yyhl590 bool = l >= 0 + for yyj590 := 0; ; yyj590++ { + if yyhl590 { + if yyj590 >= l { break } } else { @@ -8819,20 +9083,20 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys578Slc = r.DecodeBytes(yys578Slc, true, true) - yys578 := string(yys578Slc) + yys590Slc = r.DecodeBytes(yys590Slc, true, true) + yys590 := string(yys590Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys578 { + switch yys590 { case "monitors": if r.TryDecodeAsNil() { x.CephMonitors = nil } else { - yyv579 := &x.CephMonitors - yym580 := z.DecBinary() - _ = yym580 + yyv591 := &x.CephMonitors + yym592 := z.DecBinary() + _ = yym592 if false { } else { - z.F.DecSliceStringX(yyv579, false, d) + z.F.DecSliceStringX(yyv591, false, d) } } case "image": @@ -8883,9 +9147,9 @@ func (x *RBDVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys578) - } // end switch yys578 - } // end for yyj578 + z.DecStructFieldNotFound(-1, yys590) + } // end switch yys590 + } // end for yyj590 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8893,16 +9157,16 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj588 int - var yyb588 bool - var yyhl588 bool = l >= 0 - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + var yyj600 int + var yyb600 bool + var yyhl600 bool = l >= 0 + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8910,21 +9174,21 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.CephMonitors = nil } else { - yyv589 := &x.CephMonitors - yym590 := z.DecBinary() - _ = yym590 + yyv601 := &x.CephMonitors + yym602 := z.DecBinary() + _ = yym602 if false { } else { - z.F.DecSliceStringX(yyv589, false, d) + z.F.DecSliceStringX(yyv601, false, d) } } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8934,13 +9198,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RBDImage = string(r.DecodeString()) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8950,13 +9214,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.FSType = string(r.DecodeString()) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8966,13 +9230,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RBDPool = string(r.DecodeString()) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8982,13 +9246,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RadosUser = string(r.DecodeString()) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8998,13 +9262,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Keyring = string(r.DecodeString()) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9019,13 +9283,13 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SecretRef.CodecDecodeSelf(d) } - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9036,17 +9300,17 @@ func (x *RBDVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } for { - yyj588++ - if yyhl588 { - yyb588 = yyj588 > l + yyj600++ + if yyhl600 { + yyb600 = yyj600 > l } else { - yyb588 = r.CheckBreak() + yyb600 = r.CheckBreak() } - if yyb588 { + if yyb600 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj588-1, "") + z.DecStructFieldNotFound(yyj600-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9058,35 +9322,35 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym598 := z.EncBinary() - _ = yym598 + yym610 := z.EncBinary() + _ = yym610 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep599 := !z.EncBinary() - yy2arr599 := z.EncBasicHandle().StructToArray - var yyq599 [3]bool - _, _, _ = yysep599, yyq599, yy2arr599 - const yyr599 bool = false - yyq599[1] = x.FSType != "" - yyq599[2] = x.ReadOnly != false - var yynn599 int - if yyr599 || yy2arr599 { + yysep611 := !z.EncBinary() + yy2arr611 := z.EncBasicHandle().StructToArray + var yyq611 [3]bool + _, _, _ = yysep611, yyq611, yy2arr611 + const yyr611 bool = false + yyq611[1] = x.FSType != "" + yyq611[2] = x.ReadOnly != false + var yynn611 int + if yyr611 || yy2arr611 { r.EncodeArrayStart(3) } else { - yynn599 = 1 - for _, b := range yyq599 { + yynn611 = 1 + for _, b := range yyq611 { if b { - yynn599++ + yynn611++ } } - r.EncodeMapStart(yynn599) - yynn599 = 0 + r.EncodeMapStart(yynn611) + yynn611 = 0 } - if yyr599 || yy2arr599 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym601 := z.EncBinary() - _ = yym601 + yym613 := z.EncBinary() + _ = yym613 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) @@ -9095,18 +9359,18 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym602 := z.EncBinary() - _ = yym602 + yym614 := z.EncBinary() + _ = yym614 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) } } - if yyr599 || yy2arr599 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq599[1] { - yym604 := z.EncBinary() - _ = yym604 + if yyq611[1] { + yym616 := z.EncBinary() + _ = yym616 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -9115,23 +9379,23 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq599[1] { + if yyq611[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym605 := z.EncBinary() - _ = yym605 + yym617 := z.EncBinary() + _ = yym617 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr599 || yy2arr599 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq599[2] { - yym607 := z.EncBinary() - _ = yym607 + if yyq611[2] { + yym619 := z.EncBinary() + _ = yym619 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -9140,19 +9404,19 @@ func (x *CinderVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq599[2] { + if yyq611[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym608 := z.EncBinary() - _ = yym608 + yym620 := z.EncBinary() + _ = yym620 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr599 || yy2arr599 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9165,25 +9429,25 @@ func (x *CinderVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym609 := z.DecBinary() - _ = yym609 + yym621 := z.DecBinary() + _ = yym621 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct610 := r.ContainerType() - if yyct610 == codecSelferValueTypeMap1234 { - yyl610 := r.ReadMapStart() - if yyl610 == 0 { + yyct622 := r.ContainerType() + if yyct622 == codecSelferValueTypeMap1234 { + yyl622 := r.ReadMapStart() + if yyl622 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl610, d) + x.codecDecodeSelfFromMap(yyl622, d) } - } else if yyct610 == codecSelferValueTypeArray1234 { - yyl610 := r.ReadArrayStart() - if yyl610 == 0 { + } else if yyct622 == codecSelferValueTypeArray1234 { + yyl622 := r.ReadArrayStart() + if yyl622 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl610, d) + x.codecDecodeSelfFromArray(yyl622, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9195,12 +9459,12 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys611Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys611Slc - var yyhl611 bool = l >= 0 - for yyj611 := 0; ; yyj611++ { - if yyhl611 { - if yyj611 >= l { + var yys623Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys623Slc + var yyhl623 bool = l >= 0 + for yyj623 := 0; ; yyj623++ { + if yyhl623 { + if yyj623 >= l { break } } else { @@ -9209,10 +9473,10 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys611Slc = r.DecodeBytes(yys611Slc, true, true) - yys611 := string(yys611Slc) + yys623Slc = r.DecodeBytes(yys623Slc, true, true) + yys623 := string(yys623Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys611 { + switch yys623 { case "volumeID": if r.TryDecodeAsNil() { x.VolumeID = "" @@ -9232,9 +9496,9 @@ func (x *CinderVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys611) - } // end switch yys611 - } // end for yyj611 + z.DecStructFieldNotFound(-1, yys623) + } // end switch yys623 + } // end for yyj623 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9242,16 +9506,16 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj615 int - var yyb615 bool - var yyhl615 bool = l >= 0 - yyj615++ - if yyhl615 { - yyb615 = yyj615 > l + var yyj627 int + var yyb627 bool + var yyhl627 bool = l >= 0 + yyj627++ + if yyhl627 { + yyb627 = yyj627 > l } else { - yyb615 = r.CheckBreak() + yyb627 = r.CheckBreak() } - if yyb615 { + if yyb627 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9261,13 +9525,13 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.VolumeID = string(r.DecodeString()) } - yyj615++ - if yyhl615 { - yyb615 = yyj615 > l + yyj627++ + if yyhl627 { + yyb627 = yyj627 > l } else { - yyb615 = r.CheckBreak() + yyb627 = r.CheckBreak() } - if yyb615 { + if yyb627 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9277,13 +9541,13 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.FSType = string(r.DecodeString()) } - yyj615++ - if yyhl615 { - yyb615 = yyj615 > l + yyj627++ + if yyhl627 { + yyb627 = yyj627 > l } else { - yyb615 = r.CheckBreak() + yyb627 = r.CheckBreak() } - if yyb615 { + if yyb627 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9294,17 +9558,17 @@ func (x *CinderVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.ReadOnly = bool(r.DecodeBool()) } for { - yyj615++ - if yyhl615 { - yyb615 = yyj615 > l + yyj627++ + if yyhl627 { + yyb627 = yyj627 > l } else { - yyb615 = r.CheckBreak() + yyb627 = r.CheckBreak() } - if yyb615 { + if yyb627 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj615-1, "") + z.DecStructFieldNotFound(yyj627-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9316,41 +9580,41 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym619 := z.EncBinary() - _ = yym619 + yym631 := z.EncBinary() + _ = yym631 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep620 := !z.EncBinary() - yy2arr620 := z.EncBasicHandle().StructToArray - var yyq620 [6]bool - _, _, _ = yysep620, yyq620, yy2arr620 - const yyr620 bool = false - yyq620[1] = x.Path != "" - yyq620[2] = x.User != "" - yyq620[3] = x.SecretFile != "" - yyq620[4] = x.SecretRef != nil - yyq620[5] = x.ReadOnly != false - var yynn620 int - if yyr620 || yy2arr620 { + yysep632 := !z.EncBinary() + yy2arr632 := z.EncBasicHandle().StructToArray + var yyq632 [6]bool + _, _, _ = yysep632, yyq632, yy2arr632 + const yyr632 bool = false + yyq632[1] = x.Path != "" + yyq632[2] = x.User != "" + yyq632[3] = x.SecretFile != "" + yyq632[4] = x.SecretRef != nil + yyq632[5] = x.ReadOnly != false + var yynn632 int + if yyr632 || yy2arr632 { r.EncodeArrayStart(6) } else { - yynn620 = 1 - for _, b := range yyq620 { + yynn632 = 1 + for _, b := range yyq632 { if b { - yynn620++ + yynn632++ } } - r.EncodeMapStart(yynn620) - yynn620 = 0 + r.EncodeMapStart(yynn632) + yynn632 = 0 } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Monitors == nil { r.EncodeNil() } else { - yym622 := z.EncBinary() - _ = yym622 + yym634 := z.EncBinary() + _ = yym634 if false { } else { z.F.EncSliceStringV(x.Monitors, false, e) @@ -9363,19 +9627,19 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.Monitors == nil { r.EncodeNil() } else { - yym623 := z.EncBinary() - _ = yym623 + yym635 := z.EncBinary() + _ = yym635 if false { } else { z.F.EncSliceStringV(x.Monitors, false, e) } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[1] { - yym625 := z.EncBinary() - _ = yym625 + if yyq632[1] { + yym637 := z.EncBinary() + _ = yym637 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -9384,23 +9648,23 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq620[1] { + if yyq632[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym626 := z.EncBinary() - _ = yym626 + yym638 := z.EncBinary() + _ = yym638 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[2] { - yym628 := z.EncBinary() - _ = yym628 + if yyq632[2] { + yym640 := z.EncBinary() + _ = yym640 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) @@ -9409,23 +9673,23 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq620[2] { + if yyq632[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym629 := z.EncBinary() - _ = yym629 + yym641 := z.EncBinary() + _ = yym641 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[3] { - yym631 := z.EncBinary() - _ = yym631 + if yyq632[3] { + yym643 := z.EncBinary() + _ = yym643 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretFile)) @@ -9434,21 +9698,21 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq620[3] { + if yyq632[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym632 := z.EncBinary() - _ = yym632 + yym644 := z.EncBinary() + _ = yym644 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretFile)) } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[4] { + if yyq632[4] { if x.SecretRef == nil { r.EncodeNil() } else { @@ -9458,7 +9722,7 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq620[4] { + if yyq632[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -9469,11 +9733,11 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[5] { - yym635 := z.EncBinary() - _ = yym635 + if yyq632[5] { + yym647 := z.EncBinary() + _ = yym647 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -9482,19 +9746,19 @@ func (x *CephFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq620[5] { + if yyq632[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym636 := z.EncBinary() - _ = yym636 + yym648 := z.EncBinary() + _ = yym648 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr620 || yy2arr620 { + if yyr632 || yy2arr632 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9507,25 +9771,25 @@ func (x *CephFSVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym637 := z.DecBinary() - _ = yym637 + yym649 := z.DecBinary() + _ = yym649 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct638 := r.ContainerType() - if yyct638 == codecSelferValueTypeMap1234 { - yyl638 := r.ReadMapStart() - if yyl638 == 0 { + yyct650 := r.ContainerType() + if yyct650 == codecSelferValueTypeMap1234 { + yyl650 := r.ReadMapStart() + if yyl650 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl638, d) + x.codecDecodeSelfFromMap(yyl650, d) } - } else if yyct638 == codecSelferValueTypeArray1234 { - yyl638 := r.ReadArrayStart() - if yyl638 == 0 { + } else if yyct650 == codecSelferValueTypeArray1234 { + yyl650 := r.ReadArrayStart() + if yyl650 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl638, d) + x.codecDecodeSelfFromArray(yyl650, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9537,12 +9801,12 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys639Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys639Slc - var yyhl639 bool = l >= 0 - for yyj639 := 0; ; yyj639++ { - if yyhl639 { - if yyj639 >= l { + var yys651Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys651Slc + var yyhl651 bool = l >= 0 + for yyj651 := 0; ; yyj651++ { + if yyhl651 { + if yyj651 >= l { break } } else { @@ -9551,20 +9815,20 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys639Slc = r.DecodeBytes(yys639Slc, true, true) - yys639 := string(yys639Slc) + yys651Slc = r.DecodeBytes(yys651Slc, true, true) + yys651 := string(yys651Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys639 { + switch yys651 { case "monitors": if r.TryDecodeAsNil() { x.Monitors = nil } else { - yyv640 := &x.Monitors - yym641 := z.DecBinary() - _ = yym641 + yyv652 := &x.Monitors + yym653 := z.DecBinary() + _ = yym653 if false { } else { - z.F.DecSliceStringX(yyv640, false, d) + z.F.DecSliceStringX(yyv652, false, d) } } case "path": @@ -9603,9 +9867,9 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys639) - } // end switch yys639 - } // end for yyj639 + z.DecStructFieldNotFound(-1, yys651) + } // end switch yys651 + } // end for yyj651 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9613,16 +9877,16 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj647 int - var yyb647 bool - var yyhl647 bool = l >= 0 - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + var yyj659 int + var yyb659 bool + var yyhl659 bool = l >= 0 + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9630,21 +9894,21 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Monitors = nil } else { - yyv648 := &x.Monitors - yym649 := z.DecBinary() - _ = yym649 + yyv660 := &x.Monitors + yym661 := z.DecBinary() + _ = yym661 if false { } else { - z.F.DecSliceStringX(yyv648, false, d) + z.F.DecSliceStringX(yyv660, false, d) } } - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9654,13 +9918,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Path = string(r.DecodeString()) } - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9670,13 +9934,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.User = string(r.DecodeString()) } - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9686,13 +9950,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.SecretFile = string(r.DecodeString()) } - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9707,13 +9971,13 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode } x.SecretRef.CodecDecodeSelf(d) } - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9724,17 +9988,17 @@ func (x *CephFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.ReadOnly = bool(r.DecodeBool()) } for { - yyj647++ - if yyhl647 { - yyb647 = yyj647 > l + yyj659++ + if yyhl659 { + yyb659 = yyj659 > l } else { - yyb647 = r.CheckBreak() + yyb659 = r.CheckBreak() } - if yyb647 { + if yyb659 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj647-1, "") + z.DecStructFieldNotFound(yyj659-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9746,33 +10010,33 @@ func (x *FlockerVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym655 := z.EncBinary() - _ = yym655 + yym667 := z.EncBinary() + _ = yym667 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep656 := !z.EncBinary() - yy2arr656 := z.EncBasicHandle().StructToArray - var yyq656 [1]bool - _, _, _ = yysep656, yyq656, yy2arr656 - const yyr656 bool = false - var yynn656 int - if yyr656 || yy2arr656 { + yysep668 := !z.EncBinary() + yy2arr668 := z.EncBasicHandle().StructToArray + var yyq668 [1]bool + _, _, _ = yysep668, yyq668, yy2arr668 + const yyr668 bool = false + var yynn668 int + if yyr668 || yy2arr668 { r.EncodeArrayStart(1) } else { - yynn656 = 1 - for _, b := range yyq656 { + yynn668 = 1 + for _, b := range yyq668 { if b { - yynn656++ + yynn668++ } } - r.EncodeMapStart(yynn656) - yynn656 = 0 + r.EncodeMapStart(yynn668) + yynn668 = 0 } - if yyr656 || yy2arr656 { + if yyr668 || yy2arr668 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym658 := z.EncBinary() - _ = yym658 + yym670 := z.EncBinary() + _ = yym670 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DatasetName)) @@ -9781,14 +10045,14 @@ func (x *FlockerVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("datasetName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym659 := z.EncBinary() - _ = yym659 + yym671 := z.EncBinary() + _ = yym671 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DatasetName)) } } - if yyr656 || yy2arr656 { + if yyr668 || yy2arr668 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9801,25 +10065,25 @@ func (x *FlockerVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym660 := z.DecBinary() - _ = yym660 + yym672 := z.DecBinary() + _ = yym672 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct661 := r.ContainerType() - if yyct661 == codecSelferValueTypeMap1234 { - yyl661 := r.ReadMapStart() - if yyl661 == 0 { + yyct673 := r.ContainerType() + if yyct673 == codecSelferValueTypeMap1234 { + yyl673 := r.ReadMapStart() + if yyl673 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl661, d) + x.codecDecodeSelfFromMap(yyl673, d) } - } else if yyct661 == codecSelferValueTypeArray1234 { - yyl661 := r.ReadArrayStart() - if yyl661 == 0 { + } else if yyct673 == codecSelferValueTypeArray1234 { + yyl673 := r.ReadArrayStart() + if yyl673 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl661, d) + x.codecDecodeSelfFromArray(yyl673, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9831,12 +10095,12 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys662Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys662Slc - var yyhl662 bool = l >= 0 - for yyj662 := 0; ; yyj662++ { - if yyhl662 { - if yyj662 >= l { + var yys674Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys674Slc + var yyhl674 bool = l >= 0 + for yyj674 := 0; ; yyj674++ { + if yyhl674 { + if yyj674 >= l { break } } else { @@ -9845,10 +10109,10 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys662Slc = r.DecodeBytes(yys662Slc, true, true) - yys662 := string(yys662Slc) + yys674Slc = r.DecodeBytes(yys674Slc, true, true) + yys674 := string(yys674Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys662 { + switch yys674 { case "datasetName": if r.TryDecodeAsNil() { x.DatasetName = "" @@ -9856,9 +10120,9 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.DatasetName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys662) - } // end switch yys662 - } // end for yyj662 + z.DecStructFieldNotFound(-1, yys674) + } // end switch yys674 + } // end for yyj674 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9866,16 +10130,16 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj664 int - var yyb664 bool - var yyhl664 bool = l >= 0 - yyj664++ - if yyhl664 { - yyb664 = yyj664 > l + var yyj676 int + var yyb676 bool + var yyhl676 bool = l >= 0 + yyj676++ + if yyhl676 { + yyb676 = yyj676 > l } else { - yyb664 = r.CheckBreak() + yyb676 = r.CheckBreak() } - if yyb664 { + if yyb676 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9886,17 +10150,17 @@ func (x *FlockerVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod x.DatasetName = string(r.DecodeString()) } for { - yyj664++ - if yyhl664 { - yyb664 = yyj664 > l + yyj676++ + if yyhl676 { + yyb676 = yyj676 > l } else { - yyb664 = r.CheckBreak() + yyb676 = r.CheckBreak() } - if yyb664 { + if yyb676 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj664-1, "") + z.DecStructFieldNotFound(yyj676-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9905,8 +10169,8 @@ func (x StorageMedium) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym666 := z.EncBinary() - _ = yym666 + yym678 := z.EncBinary() + _ = yym678 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -9918,8 +10182,8 @@ func (x *StorageMedium) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym667 := z.DecBinary() - _ = yym667 + yym679 := z.DecBinary() + _ = yym679 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -9931,8 +10195,8 @@ func (x Protocol) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym668 := z.EncBinary() - _ = yym668 + yym680 := z.EncBinary() + _ = yym680 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -9944,8 +10208,8 @@ func (x *Protocol) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym669 := z.DecBinary() - _ = yym669 + yym681 := z.DecBinary() + _ = yym681 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -9960,35 +10224,36 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym670 := z.EncBinary() - _ = yym670 + yym682 := z.EncBinary() + _ = yym682 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep671 := !z.EncBinary() - yy2arr671 := z.EncBasicHandle().StructToArray - var yyq671 [4]bool - _, _, _ = yysep671, yyq671, yy2arr671 - const yyr671 bool = false - yyq671[2] = x.Partition != 0 - yyq671[3] = x.ReadOnly != false - var yynn671 int - if yyr671 || yy2arr671 { + yysep683 := !z.EncBinary() + yy2arr683 := z.EncBasicHandle().StructToArray + var yyq683 [4]bool + _, _, _ = yysep683, yyq683, yy2arr683 + const yyr683 bool = false + yyq683[1] = x.FSType != "" + yyq683[2] = x.Partition != 0 + yyq683[3] = x.ReadOnly != false + var yynn683 int + if yyr683 || yy2arr683 { r.EncodeArrayStart(4) } else { - yynn671 = 2 - for _, b := range yyq671 { + yynn683 = 1 + for _, b := range yyq683 { if b { - yynn671++ + yynn683++ } } - r.EncodeMapStart(yynn671) - yynn671 = 0 + r.EncodeMapStart(yynn683) + yynn683 = 0 } - if yyr671 || yy2arr671 { + if yyr683 || yy2arr683 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym673 := z.EncBinary() - _ = yym673 + yym685 := z.EncBinary() + _ = yym685 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PDName)) @@ -9997,37 +10262,43 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("pdName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym674 := z.EncBinary() - _ = yym674 + yym686 := z.EncBinary() + _ = yym686 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PDName)) } } - if yyr671 || yy2arr671 { + if yyr683 || yy2arr683 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym676 := z.EncBinary() - _ = yym676 - if false { + if yyq683[1] { + yym688 := z.EncBinary() + _ = yym688 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + r.EncodeString(codecSelferC_UTF81234, "") } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fsType")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym677 := z.EncBinary() - _ = yym677 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + if yyq683[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fsType")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym689 := z.EncBinary() + _ = yym689 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } } - if yyr671 || yy2arr671 { + if yyr683 || yy2arr683 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq671[2] { - yym679 := z.EncBinary() - _ = yym679 + if yyq683[2] { + yym691 := z.EncBinary() + _ = yym691 if false { } else { r.EncodeInt(int64(x.Partition)) @@ -10036,23 +10307,23 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq671[2] { + if yyq683[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("partition")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym680 := z.EncBinary() - _ = yym680 + yym692 := z.EncBinary() + _ = yym692 if false { } else { r.EncodeInt(int64(x.Partition)) } } } - if yyr671 || yy2arr671 { + if yyr683 || yy2arr683 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq671[3] { - yym682 := z.EncBinary() - _ = yym682 + if yyq683[3] { + yym694 := z.EncBinary() + _ = yym694 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -10061,19 +10332,19 @@ func (x *GCEPersistentDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq671[3] { + if yyq683[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym683 := z.EncBinary() - _ = yym683 + yym695 := z.EncBinary() + _ = yym695 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr671 || yy2arr671 { + if yyr683 || yy2arr683 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10086,25 +10357,25 @@ func (x *GCEPersistentDiskVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym684 := z.DecBinary() - _ = yym684 + yym696 := z.DecBinary() + _ = yym696 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct685 := r.ContainerType() - if yyct685 == codecSelferValueTypeMap1234 { - yyl685 := r.ReadMapStart() - if yyl685 == 0 { + yyct697 := r.ContainerType() + if yyct697 == codecSelferValueTypeMap1234 { + yyl697 := r.ReadMapStart() + if yyl697 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl685, d) + x.codecDecodeSelfFromMap(yyl697, d) } - } else if yyct685 == codecSelferValueTypeArray1234 { - yyl685 := r.ReadArrayStart() - if yyl685 == 0 { + } else if yyct697 == codecSelferValueTypeArray1234 { + yyl697 := r.ReadArrayStart() + if yyl697 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl685, d) + x.codecDecodeSelfFromArray(yyl697, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10116,12 +10387,12 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys686Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys686Slc - var yyhl686 bool = l >= 0 - for yyj686 := 0; ; yyj686++ { - if yyhl686 { - if yyj686 >= l { + var yys698Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys698Slc + var yyhl698 bool = l >= 0 + for yyj698 := 0; ; yyj698++ { + if yyhl698 { + if yyj698 >= l { break } } else { @@ -10130,10 +10401,10 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys686Slc = r.DecodeBytes(yys686Slc, true, true) - yys686 := string(yys686Slc) + yys698Slc = r.DecodeBytes(yys698Slc, true, true) + yys698 := string(yys698Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys686 { + switch yys698 { case "pdName": if r.TryDecodeAsNil() { x.PDName = "" @@ -10159,9 +10430,9 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec19 x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys686) - } // end switch yys686 - } // end for yyj686 + z.DecStructFieldNotFound(-1, yys698) + } // end switch yys698 + } // end for yyj698 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10169,16 +10440,16 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj691 int - var yyb691 bool - var yyhl691 bool = l >= 0 - yyj691++ - if yyhl691 { - yyb691 = yyj691 > l + var yyj703 int + var yyb703 bool + var yyhl703 bool = l >= 0 + yyj703++ + if yyhl703 { + yyb703 = yyj703 > l } else { - yyb691 = r.CheckBreak() + yyb703 = r.CheckBreak() } - if yyb691 { + if yyb703 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10188,13 +10459,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.PDName = string(r.DecodeString()) } - yyj691++ - if yyhl691 { - yyb691 = yyj691 > l + yyj703++ + if yyhl703 { + yyb703 = yyj703 > l } else { - yyb691 = r.CheckBreak() + yyb703 = r.CheckBreak() } - if yyb691 { + if yyb703 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10204,13 +10475,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.FSType = string(r.DecodeString()) } - yyj691++ - if yyhl691 { - yyb691 = yyj691 > l + yyj703++ + if yyhl703 { + yyb703 = yyj703 > l } else { - yyb691 = r.CheckBreak() + yyb703 = r.CheckBreak() } - if yyb691 { + if yyb703 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10220,13 +10491,13 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec } else { x.Partition = int32(r.DecodeInt(32)) } - yyj691++ - if yyhl691 { - yyb691 = yyj691 > l + yyj703++ + if yyhl703 { + yyb703 = yyj703 > l } else { - yyb691 = r.CheckBreak() + yyb703 = r.CheckBreak() } - if yyb691 { + if yyb703 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10237,17 +10508,17 @@ func (x *GCEPersistentDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec x.ReadOnly = bool(r.DecodeBool()) } for { - yyj691++ - if yyhl691 { - yyb691 = yyj691 > l + yyj703++ + if yyhl703 { + yyb703 = yyj703 > l } else { - yyb691 = r.CheckBreak() + yyb703 = r.CheckBreak() } - if yyb691 { + if yyb703 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj691-1, "") + z.DecStructFieldNotFound(yyj703-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10259,37 +10530,37 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym696 := z.EncBinary() - _ = yym696 + yym708 := z.EncBinary() + _ = yym708 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep697 := !z.EncBinary() - yy2arr697 := z.EncBasicHandle().StructToArray - var yyq697 [5]bool - _, _, _ = yysep697, yyq697, yy2arr697 - const yyr697 bool = false - yyq697[1] = x.FSType != "" - yyq697[2] = x.SecretRef != nil - yyq697[3] = x.ReadOnly != false - yyq697[4] = len(x.Options) != 0 - var yynn697 int - if yyr697 || yy2arr697 { + yysep709 := !z.EncBinary() + yy2arr709 := z.EncBasicHandle().StructToArray + var yyq709 [5]bool + _, _, _ = yysep709, yyq709, yy2arr709 + const yyr709 bool = false + yyq709[1] = x.FSType != "" + yyq709[2] = x.SecretRef != nil + yyq709[3] = x.ReadOnly != false + yyq709[4] = len(x.Options) != 0 + var yynn709 int + if yyr709 || yy2arr709 { r.EncodeArrayStart(5) } else { - yynn697 = 1 - for _, b := range yyq697 { + yynn709 = 1 + for _, b := range yyq709 { if b { - yynn697++ + yynn709++ } } - r.EncodeMapStart(yynn697) - yynn697 = 0 + r.EncodeMapStart(yynn709) + yynn709 = 0 } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym699 := z.EncBinary() - _ = yym699 + yym711 := z.EncBinary() + _ = yym711 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Driver)) @@ -10298,18 +10569,18 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("driver")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym700 := z.EncBinary() - _ = yym700 + yym712 := z.EncBinary() + _ = yym712 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Driver)) } } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq697[1] { - yym702 := z.EncBinary() - _ = yym702 + if yyq709[1] { + yym714 := z.EncBinary() + _ = yym714 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) @@ -10318,21 +10589,21 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq697[1] { + if yyq709[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsType")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym703 := z.EncBinary() - _ = yym703 + yym715 := z.EncBinary() + _ = yym715 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) } } } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq697[2] { + if yyq709[2] { if x.SecretRef == nil { r.EncodeNil() } else { @@ -10342,7 +10613,7 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq697[2] { + if yyq709[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -10353,11 +10624,11 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq697[3] { - yym706 := z.EncBinary() - _ = yym706 + if yyq709[3] { + yym718 := z.EncBinary() + _ = yym718 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -10366,26 +10637,26 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq697[3] { + if yyq709[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym707 := z.EncBinary() - _ = yym707 + yym719 := z.EncBinary() + _ = yym719 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq697[4] { + if yyq709[4] { if x.Options == nil { r.EncodeNil() } else { - yym709 := z.EncBinary() - _ = yym709 + yym721 := z.EncBinary() + _ = yym721 if false { } else { z.F.EncMapStringStringV(x.Options, false, e) @@ -10395,15 +10666,15 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq697[4] { + if yyq709[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("options")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Options == nil { r.EncodeNil() } else { - yym710 := z.EncBinary() - _ = yym710 + yym722 := z.EncBinary() + _ = yym722 if false { } else { z.F.EncMapStringStringV(x.Options, false, e) @@ -10411,7 +10682,7 @@ func (x *FlexVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr697 || yy2arr697 { + if yyr709 || yy2arr709 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10424,25 +10695,25 @@ func (x *FlexVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym711 := z.DecBinary() - _ = yym711 + yym723 := z.DecBinary() + _ = yym723 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct712 := r.ContainerType() - if yyct712 == codecSelferValueTypeMap1234 { - yyl712 := r.ReadMapStart() - if yyl712 == 0 { + yyct724 := r.ContainerType() + if yyct724 == codecSelferValueTypeMap1234 { + yyl724 := r.ReadMapStart() + if yyl724 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl712, d) + x.codecDecodeSelfFromMap(yyl724, d) } - } else if yyct712 == codecSelferValueTypeArray1234 { - yyl712 := r.ReadArrayStart() - if yyl712 == 0 { + } else if yyct724 == codecSelferValueTypeArray1234 { + yyl724 := r.ReadArrayStart() + if yyl724 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl712, d) + x.codecDecodeSelfFromArray(yyl724, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10454,12 +10725,12 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys713Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys713Slc - var yyhl713 bool = l >= 0 - for yyj713 := 0; ; yyj713++ { - if yyhl713 { - if yyj713 >= l { + var yys725Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys725Slc + var yyhl725 bool = l >= 0 + for yyj725 := 0; ; yyj725++ { + if yyhl725 { + if yyj725 >= l { break } } else { @@ -10468,10 +10739,10 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys713Slc = r.DecodeBytes(yys713Slc, true, true) - yys713 := string(yys713Slc) + yys725Slc = r.DecodeBytes(yys725Slc, true, true) + yys725 := string(yys725Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys713 { + switch yys725 { case "driver": if r.TryDecodeAsNil() { x.Driver = "" @@ -10505,18 +10776,18 @@ func (x *FlexVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Options = nil } else { - yyv718 := &x.Options - yym719 := z.DecBinary() - _ = yym719 + yyv730 := &x.Options + yym731 := z.DecBinary() + _ = yym731 if false { } else { - z.F.DecMapStringStringX(yyv718, false, d) + z.F.DecMapStringStringX(yyv730, false, d) } } default: - z.DecStructFieldNotFound(-1, yys713) - } // end switch yys713 - } // end for yyj713 + z.DecStructFieldNotFound(-1, yys725) + } // end switch yys725 + } // end for yyj725 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10524,16 +10795,16 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj720 int - var yyb720 bool - var yyhl720 bool = l >= 0 - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + var yyj732 int + var yyb732 bool + var yyhl732 bool = l >= 0 + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10543,13 +10814,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Driver = string(r.DecodeString()) } - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10559,13 +10830,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.FSType = string(r.DecodeString()) } - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10580,13 +10851,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SecretRef.CodecDecodeSelf(d) } - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10596,13 +10867,13 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ReadOnly = bool(r.DecodeBool()) } - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10610,26 +10881,26 @@ func (x *FlexVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Options = nil } else { - yyv725 := &x.Options - yym726 := z.DecBinary() - _ = yym726 + yyv737 := &x.Options + yym738 := z.DecBinary() + _ = yym738 if false { } else { - z.F.DecMapStringStringX(yyv725, false, d) + z.F.DecMapStringStringX(yyv737, false, d) } } for { - yyj720++ - if yyhl720 { - yyb720 = yyj720 > l + yyj732++ + if yyhl732 { + yyb732 = yyj732 > l } else { - yyb720 = r.CheckBreak() + yyb732 = r.CheckBreak() } - if yyb720 { + if yyb732 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj720-1, "") + z.DecStructFieldNotFound(yyj732-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10641,35 +10912,36 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) if x == nil { r.EncodeNil() } else { - yym727 := z.EncBinary() - _ = yym727 + yym739 := z.EncBinary() + _ = yym739 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep728 := !z.EncBinary() - yy2arr728 := z.EncBasicHandle().StructToArray - var yyq728 [4]bool - _, _, _ = yysep728, yyq728, yy2arr728 - const yyr728 bool = false - yyq728[2] = x.Partition != 0 - yyq728[3] = x.ReadOnly != false - var yynn728 int - if yyr728 || yy2arr728 { + yysep740 := !z.EncBinary() + yy2arr740 := z.EncBasicHandle().StructToArray + var yyq740 [4]bool + _, _, _ = yysep740, yyq740, yy2arr740 + const yyr740 bool = false + yyq740[1] = x.FSType != "" + yyq740[2] = x.Partition != 0 + yyq740[3] = x.ReadOnly != false + var yynn740 int + if yyr740 || yy2arr740 { r.EncodeArrayStart(4) } else { - yynn728 = 2 - for _, b := range yyq728 { + yynn740 = 1 + for _, b := range yyq740 { if b { - yynn728++ + yynn740++ } } - r.EncodeMapStart(yynn728) - yynn728 = 0 + r.EncodeMapStart(yynn740) + yynn740 = 0 } - if yyr728 || yy2arr728 { + if yyr740 || yy2arr740 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym730 := z.EncBinary() - _ = yym730 + yym742 := z.EncBinary() + _ = yym742 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) @@ -10678,37 +10950,43 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym731 := z.EncBinary() - _ = yym731 + yym743 := z.EncBinary() + _ = yym743 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumeID)) } } - if yyr728 || yy2arr728 { + if yyr740 || yy2arr740 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym733 := z.EncBinary() - _ = yym733 - if false { + if yyq740[1] { + yym745 := z.EncBinary() + _ = yym745 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + r.EncodeString(codecSelferC_UTF81234, "") } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fsType")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym734 := z.EncBinary() - _ = yym734 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + if yyq740[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fsType")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym746 := z.EncBinary() + _ = yym746 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } } - if yyr728 || yy2arr728 { + if yyr740 || yy2arr740 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq728[2] { - yym736 := z.EncBinary() - _ = yym736 + if yyq740[2] { + yym748 := z.EncBinary() + _ = yym748 if false { } else { r.EncodeInt(int64(x.Partition)) @@ -10717,23 +10995,23 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) r.EncodeInt(0) } } else { - if yyq728[2] { + if yyq740[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("partition")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym737 := z.EncBinary() - _ = yym737 + yym749 := z.EncBinary() + _ = yym749 if false { } else { r.EncodeInt(int64(x.Partition)) } } } - if yyr728 || yy2arr728 { + if yyr740 || yy2arr740 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq728[3] { - yym739 := z.EncBinary() - _ = yym739 + if yyq740[3] { + yym751 := z.EncBinary() + _ = yym751 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -10742,19 +11020,19 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) r.EncodeBool(false) } } else { - if yyq728[3] { + if yyq740[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym740 := z.EncBinary() - _ = yym740 + yym752 := z.EncBinary() + _ = yym752 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr728 || yy2arr728 { + if yyr740 || yy2arr740 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10767,25 +11045,25 @@ func (x *AWSElasticBlockStoreVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym741 := z.DecBinary() - _ = yym741 + yym753 := z.DecBinary() + _ = yym753 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct742 := r.ContainerType() - if yyct742 == codecSelferValueTypeMap1234 { - yyl742 := r.ReadMapStart() - if yyl742 == 0 { + yyct754 := r.ContainerType() + if yyct754 == codecSelferValueTypeMap1234 { + yyl754 := r.ReadMapStart() + if yyl754 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl742, d) + x.codecDecodeSelfFromMap(yyl754, d) } - } else if yyct742 == codecSelferValueTypeArray1234 { - yyl742 := r.ReadArrayStart() - if yyl742 == 0 { + } else if yyct754 == codecSelferValueTypeArray1234 { + yyl754 := r.ReadArrayStart() + if yyl754 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl742, d) + x.codecDecodeSelfFromArray(yyl754, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10797,12 +11075,12 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys743Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys743Slc - var yyhl743 bool = l >= 0 - for yyj743 := 0; ; yyj743++ { - if yyhl743 { - if yyj743 >= l { + var yys755Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys755Slc + var yyhl755 bool = l >= 0 + for yyj755 := 0; ; yyj755++ { + if yyhl755 { + if yyj755 >= l { break } } else { @@ -10811,10 +11089,10 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys743Slc = r.DecodeBytes(yys743Slc, true, true) - yys743 := string(yys743Slc) + yys755Slc = r.DecodeBytes(yys755Slc, true, true) + yys755 := string(yys755Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys743 { + switch yys755 { case "volumeID": if r.TryDecodeAsNil() { x.VolumeID = "" @@ -10840,9 +11118,9 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromMap(l int, d *code x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys743) - } // end switch yys743 - } // end for yyj743 + z.DecStructFieldNotFound(-1, yys755) + } // end switch yys755 + } // end for yyj755 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10850,16 +11128,16 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj748 int - var yyb748 bool - var yyhl748 bool = l >= 0 - yyj748++ - if yyhl748 { - yyb748 = yyj748 > l + var yyj760 int + var yyb760 bool + var yyhl760 bool = l >= 0 + yyj760++ + if yyhl760 { + yyb760 = yyj760 > l } else { - yyb748 = r.CheckBreak() + yyb760 = r.CheckBreak() } - if yyb748 { + if yyb760 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10869,13 +11147,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.VolumeID = string(r.DecodeString()) } - yyj748++ - if yyhl748 { - yyb748 = yyj748 > l + yyj760++ + if yyhl760 { + yyb760 = yyj760 > l } else { - yyb748 = r.CheckBreak() + yyb760 = r.CheckBreak() } - if yyb748 { + if yyb760 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10885,13 +11163,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.FSType = string(r.DecodeString()) } - yyj748++ - if yyhl748 { - yyb748 = yyj748 > l + yyj760++ + if yyhl760 { + yyb760 = yyj760 > l } else { - yyb748 = r.CheckBreak() + yyb760 = r.CheckBreak() } - if yyb748 { + if yyb760 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10901,13 +11179,13 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co } else { x.Partition = int32(r.DecodeInt(32)) } - yyj748++ - if yyhl748 { - yyb748 = yyj748 > l + yyj760++ + if yyhl760 { + yyb760 = yyj760 > l } else { - yyb748 = r.CheckBreak() + yyb760 = r.CheckBreak() } - if yyb748 { + if yyb760 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10918,17 +11196,17 @@ func (x *AWSElasticBlockStoreVolumeSource) codecDecodeSelfFromArray(l int, d *co x.ReadOnly = bool(r.DecodeBool()) } for { - yyj748++ - if yyhl748 { - yyb748 = yyj748 > l + yyj760++ + if yyhl760 { + yyb760 = yyj760 > l } else { - yyb748 = r.CheckBreak() + yyb760 = r.CheckBreak() } - if yyb748 { + if yyb760 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj748-1, "") + z.DecStructFieldNotFound(yyj760-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10940,35 +11218,35 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym753 := z.EncBinary() - _ = yym753 + yym765 := z.EncBinary() + _ = yym765 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep754 := !z.EncBinary() - yy2arr754 := z.EncBasicHandle().StructToArray - var yyq754 [3]bool - _, _, _ = yysep754, yyq754, yy2arr754 - const yyr754 bool = false - yyq754[1] = x.Revision != "" - yyq754[2] = x.Directory != "" - var yynn754 int - if yyr754 || yy2arr754 { + yysep766 := !z.EncBinary() + yy2arr766 := z.EncBasicHandle().StructToArray + var yyq766 [3]bool + _, _, _ = yysep766, yyq766, yy2arr766 + const yyr766 bool = false + yyq766[1] = x.Revision != "" + yyq766[2] = x.Directory != "" + var yynn766 int + if yyr766 || yy2arr766 { r.EncodeArrayStart(3) } else { - yynn754 = 1 - for _, b := range yyq754 { + yynn766 = 1 + for _, b := range yyq766 { if b { - yynn754++ + yynn766++ } } - r.EncodeMapStart(yynn754) - yynn754 = 0 + r.EncodeMapStart(yynn766) + yynn766 = 0 } - if yyr754 || yy2arr754 { + if yyr766 || yy2arr766 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym756 := z.EncBinary() - _ = yym756 + yym768 := z.EncBinary() + _ = yym768 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Repository)) @@ -10977,18 +11255,18 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("repository")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym757 := z.EncBinary() - _ = yym757 + yym769 := z.EncBinary() + _ = yym769 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Repository)) } } - if yyr754 || yy2arr754 { + if yyr766 || yy2arr766 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq754[1] { - yym759 := z.EncBinary() - _ = yym759 + if yyq766[1] { + yym771 := z.EncBinary() + _ = yym771 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Revision)) @@ -10997,23 +11275,23 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq754[1] { + if yyq766[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("revision")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym760 := z.EncBinary() - _ = yym760 + yym772 := z.EncBinary() + _ = yym772 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Revision)) } } } - if yyr754 || yy2arr754 { + if yyr766 || yy2arr766 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq754[2] { - yym762 := z.EncBinary() - _ = yym762 + if yyq766[2] { + yym774 := z.EncBinary() + _ = yym774 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Directory)) @@ -11022,19 +11300,19 @@ func (x *GitRepoVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq754[2] { + if yyq766[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("directory")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym763 := z.EncBinary() - _ = yym763 + yym775 := z.EncBinary() + _ = yym775 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Directory)) } } } - if yyr754 || yy2arr754 { + if yyr766 || yy2arr766 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11047,25 +11325,25 @@ func (x *GitRepoVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym764 := z.DecBinary() - _ = yym764 + yym776 := z.DecBinary() + _ = yym776 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct765 := r.ContainerType() - if yyct765 == codecSelferValueTypeMap1234 { - yyl765 := r.ReadMapStart() - if yyl765 == 0 { + yyct777 := r.ContainerType() + if yyct777 == codecSelferValueTypeMap1234 { + yyl777 := r.ReadMapStart() + if yyl777 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl765, d) + x.codecDecodeSelfFromMap(yyl777, d) } - } else if yyct765 == codecSelferValueTypeArray1234 { - yyl765 := r.ReadArrayStart() - if yyl765 == 0 { + } else if yyct777 == codecSelferValueTypeArray1234 { + yyl777 := r.ReadArrayStart() + if yyl777 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl765, d) + x.codecDecodeSelfFromArray(yyl777, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11077,12 +11355,12 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys766Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys766Slc - var yyhl766 bool = l >= 0 - for yyj766 := 0; ; yyj766++ { - if yyhl766 { - if yyj766 >= l { + var yys778Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys778Slc + var yyhl778 bool = l >= 0 + for yyj778 := 0; ; yyj778++ { + if yyhl778 { + if yyj778 >= l { break } } else { @@ -11091,10 +11369,10 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys766Slc = r.DecodeBytes(yys766Slc, true, true) - yys766 := string(yys766Slc) + yys778Slc = r.DecodeBytes(yys778Slc, true, true) + yys778 := string(yys778Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys766 { + switch yys778 { case "repository": if r.TryDecodeAsNil() { x.Repository = "" @@ -11114,9 +11392,9 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.Directory = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys766) - } // end switch yys766 - } // end for yyj766 + z.DecStructFieldNotFound(-1, yys778) + } // end switch yys778 + } // end for yyj778 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11124,16 +11402,16 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj770 int - var yyb770 bool - var yyhl770 bool = l >= 0 - yyj770++ - if yyhl770 { - yyb770 = yyj770 > l + var yyj782 int + var yyb782 bool + var yyhl782 bool = l >= 0 + yyj782++ + if yyhl782 { + yyb782 = yyj782 > l } else { - yyb770 = r.CheckBreak() + yyb782 = r.CheckBreak() } - if yyb770 { + if yyb782 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11143,13 +11421,13 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Repository = string(r.DecodeString()) } - yyj770++ - if yyhl770 { - yyb770 = yyj770 > l + yyj782++ + if yyhl782 { + yyb782 = yyj782 > l } else { - yyb770 = r.CheckBreak() + yyb782 = r.CheckBreak() } - if yyb770 { + if yyb782 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11159,13 +11437,13 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Revision = string(r.DecodeString()) } - yyj770++ - if yyhl770 { - yyb770 = yyj770 > l + yyj782++ + if yyhl782 { + yyb782 = yyj782 > l } else { - yyb770 = r.CheckBreak() + yyb782 = r.CheckBreak() } - if yyb770 { + if yyb782 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11176,17 +11454,17 @@ func (x *GitRepoVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decod x.Directory = string(r.DecodeString()) } for { - yyj770++ - if yyhl770 { - yyb770 = yyj770 > l + yyj782++ + if yyhl782 { + yyb782 = yyj782 > l } else { - yyb770 = r.CheckBreak() + yyb782 = r.CheckBreak() } - if yyb770 { + if yyb782 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj770-1, "") + z.DecStructFieldNotFound(yyj782-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11198,35 +11476,35 @@ func (x *SecretVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym774 := z.EncBinary() - _ = yym774 + yym786 := z.EncBinary() + _ = yym786 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep775 := !z.EncBinary() - yy2arr775 := z.EncBasicHandle().StructToArray - var yyq775 [1]bool - _, _, _ = yysep775, yyq775, yy2arr775 - const yyr775 bool = false - yyq775[0] = x.SecretName != "" - var yynn775 int - if yyr775 || yy2arr775 { + yysep787 := !z.EncBinary() + yy2arr787 := z.EncBasicHandle().StructToArray + var yyq787 [1]bool + _, _, _ = yysep787, yyq787, yy2arr787 + const yyr787 bool = false + yyq787[0] = x.SecretName != "" + var yynn787 int + if yyr787 || yy2arr787 { r.EncodeArrayStart(1) } else { - yynn775 = 0 - for _, b := range yyq775 { + yynn787 = 0 + for _, b := range yyq787 { if b { - yynn775++ + yynn787++ } } - r.EncodeMapStart(yynn775) - yynn775 = 0 + r.EncodeMapStart(yynn787) + yynn787 = 0 } - if yyr775 || yy2arr775 { + if yyr787 || yy2arr787 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq775[0] { - yym777 := z.EncBinary() - _ = yym777 + if yyq787[0] { + yym789 := z.EncBinary() + _ = yym789 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) @@ -11235,19 +11513,19 @@ func (x *SecretVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq775[0] { + if yyq787[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym778 := z.EncBinary() - _ = yym778 + yym790 := z.EncBinary() + _ = yym790 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) } } } - if yyr775 || yy2arr775 { + if yyr787 || yy2arr787 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11260,25 +11538,25 @@ func (x *SecretVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym779 := z.DecBinary() - _ = yym779 + yym791 := z.DecBinary() + _ = yym791 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct780 := r.ContainerType() - if yyct780 == codecSelferValueTypeMap1234 { - yyl780 := r.ReadMapStart() - if yyl780 == 0 { + yyct792 := r.ContainerType() + if yyct792 == codecSelferValueTypeMap1234 { + yyl792 := r.ReadMapStart() + if yyl792 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl780, d) + x.codecDecodeSelfFromMap(yyl792, d) } - } else if yyct780 == codecSelferValueTypeArray1234 { - yyl780 := r.ReadArrayStart() - if yyl780 == 0 { + } else if yyct792 == codecSelferValueTypeArray1234 { + yyl792 := r.ReadArrayStart() + if yyl792 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl780, d) + x.codecDecodeSelfFromArray(yyl792, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11290,12 +11568,12 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys781Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys781Slc - var yyhl781 bool = l >= 0 - for yyj781 := 0; ; yyj781++ { - if yyhl781 { - if yyj781 >= l { + var yys793Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys793Slc + var yyhl793 bool = l >= 0 + for yyj793 := 0; ; yyj793++ { + if yyhl793 { + if yyj793 >= l { break } } else { @@ -11304,10 +11582,10 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys781Slc = r.DecodeBytes(yys781Slc, true, true) - yys781 := string(yys781Slc) + yys793Slc = r.DecodeBytes(yys793Slc, true, true) + yys793 := string(yys793Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys781 { + switch yys793 { case "secretName": if r.TryDecodeAsNil() { x.SecretName = "" @@ -11315,9 +11593,9 @@ func (x *SecretVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.SecretName = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys781) - } // end switch yys781 - } // end for yyj781 + z.DecStructFieldNotFound(-1, yys793) + } // end switch yys793 + } // end for yyj793 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11325,16 +11603,16 @@ func (x *SecretVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj783 int - var yyb783 bool - var yyhl783 bool = l >= 0 - yyj783++ - if yyhl783 { - yyb783 = yyj783 > l + var yyj795 int + var yyb795 bool + var yyhl795 bool = l >= 0 + yyj795++ + if yyhl795 { + yyb795 = yyj795 > l } else { - yyb783 = r.CheckBreak() + yyb795 = r.CheckBreak() } - if yyb783 { + if yyb795 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11345,17 +11623,17 @@ func (x *SecretVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.SecretName = string(r.DecodeString()) } for { - yyj783++ - if yyhl783 { - yyb783 = yyj783 > l + yyj795++ + if yyhl795 { + yyb795 = yyj795 > l } else { - yyb783 = r.CheckBreak() + yyb795 = r.CheckBreak() } - if yyb783 { + if yyb795 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj783-1, "") + z.DecStructFieldNotFound(yyj795-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11367,34 +11645,34 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym785 := z.EncBinary() - _ = yym785 + yym797 := z.EncBinary() + _ = yym797 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep786 := !z.EncBinary() - yy2arr786 := z.EncBasicHandle().StructToArray - var yyq786 [3]bool - _, _, _ = yysep786, yyq786, yy2arr786 - const yyr786 bool = false - yyq786[2] = x.ReadOnly != false - var yynn786 int - if yyr786 || yy2arr786 { + yysep798 := !z.EncBinary() + yy2arr798 := z.EncBasicHandle().StructToArray + var yyq798 [3]bool + _, _, _ = yysep798, yyq798, yy2arr798 + const yyr798 bool = false + yyq798[2] = x.ReadOnly != false + var yynn798 int + if yyr798 || yy2arr798 { r.EncodeArrayStart(3) } else { - yynn786 = 2 - for _, b := range yyq786 { + yynn798 = 2 + for _, b := range yyq798 { if b { - yynn786++ + yynn798++ } } - r.EncodeMapStart(yynn786) - yynn786 = 0 + r.EncodeMapStart(yynn798) + yynn798 = 0 } - if yyr786 || yy2arr786 { + if yyr798 || yy2arr798 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym788 := z.EncBinary() - _ = yym788 + yym800 := z.EncBinary() + _ = yym800 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Server)) @@ -11403,17 +11681,17 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("server")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym789 := z.EncBinary() - _ = yym789 + yym801 := z.EncBinary() + _ = yym801 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Server)) } } - if yyr786 || yy2arr786 { + if yyr798 || yy2arr798 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym791 := z.EncBinary() - _ = yym791 + yym803 := z.EncBinary() + _ = yym803 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -11422,18 +11700,18 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym792 := z.EncBinary() - _ = yym792 + yym804 := z.EncBinary() + _ = yym804 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr786 || yy2arr786 { + if yyr798 || yy2arr798 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq786[2] { - yym794 := z.EncBinary() - _ = yym794 + if yyq798[2] { + yym806 := z.EncBinary() + _ = yym806 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -11442,19 +11720,19 @@ func (x *NFSVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq786[2] { + if yyq798[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym795 := z.EncBinary() - _ = yym795 + yym807 := z.EncBinary() + _ = yym807 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr786 || yy2arr786 { + if yyr798 || yy2arr798 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11467,25 +11745,25 @@ func (x *NFSVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym796 := z.DecBinary() - _ = yym796 + yym808 := z.DecBinary() + _ = yym808 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct797 := r.ContainerType() - if yyct797 == codecSelferValueTypeMap1234 { - yyl797 := r.ReadMapStart() - if yyl797 == 0 { + yyct809 := r.ContainerType() + if yyct809 == codecSelferValueTypeMap1234 { + yyl809 := r.ReadMapStart() + if yyl809 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl797, d) + x.codecDecodeSelfFromMap(yyl809, d) } - } else if yyct797 == codecSelferValueTypeArray1234 { - yyl797 := r.ReadArrayStart() - if yyl797 == 0 { + } else if yyct809 == codecSelferValueTypeArray1234 { + yyl809 := r.ReadArrayStart() + if yyl809 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl797, d) + x.codecDecodeSelfFromArray(yyl809, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11497,12 +11775,12 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys798Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys798Slc - var yyhl798 bool = l >= 0 - for yyj798 := 0; ; yyj798++ { - if yyhl798 { - if yyj798 >= l { + var yys810Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys810Slc + var yyhl810 bool = l >= 0 + for yyj810 := 0; ; yyj810++ { + if yyhl810 { + if yyj810 >= l { break } } else { @@ -11511,10 +11789,10 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys798Slc = r.DecodeBytes(yys798Slc, true, true) - yys798 := string(yys798Slc) + yys810Slc = r.DecodeBytes(yys810Slc, true, true) + yys810 := string(yys810Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys798 { + switch yys810 { case "server": if r.TryDecodeAsNil() { x.Server = "" @@ -11534,9 +11812,9 @@ func (x *NFSVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys798) - } // end switch yys798 - } // end for yyj798 + z.DecStructFieldNotFound(-1, yys810) + } // end switch yys810 + } // end for yyj810 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11544,16 +11822,16 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj802 int - var yyb802 bool - var yyhl802 bool = l >= 0 - yyj802++ - if yyhl802 { - yyb802 = yyj802 > l + var yyj814 int + var yyb814 bool + var yyhl814 bool = l >= 0 + yyj814++ + if yyhl814 { + yyb814 = yyj814 > l } else { - yyb802 = r.CheckBreak() + yyb814 = r.CheckBreak() } - if yyb802 { + if yyb814 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11563,13 +11841,13 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Server = string(r.DecodeString()) } - yyj802++ - if yyhl802 { - yyb802 = yyj802 > l + yyj814++ + if yyhl814 { + yyb814 = yyj814 > l } else { - yyb802 = r.CheckBreak() + yyb814 = r.CheckBreak() } - if yyb802 { + if yyb814 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11579,13 +11857,13 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } - yyj802++ - if yyhl802 { - yyb802 = yyj802 > l + yyj814++ + if yyhl814 { + yyb814 = yyj814 > l } else { - yyb802 = r.CheckBreak() + yyb814 = r.CheckBreak() } - if yyb802 { + if yyb814 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11596,17 +11874,17 @@ func (x *NFSVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } for { - yyj802++ - if yyhl802 { - yyb802 = yyj802 > l + yyj814++ + if yyhl814 { + yyb814 = yyj814 > l } else { - yyb802 = r.CheckBreak() + yyb814 = r.CheckBreak() } - if yyb802 { + if yyb814 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj802-1, "") + z.DecStructFieldNotFound(yyj814-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11618,35 +11896,36 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym806 := z.EncBinary() - _ = yym806 + yym818 := z.EncBinary() + _ = yym818 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep807 := !z.EncBinary() - yy2arr807 := z.EncBasicHandle().StructToArray - var yyq807 [6]bool - _, _, _ = yysep807, yyq807, yy2arr807 - const yyr807 bool = false - yyq807[3] = x.ISCSIInterface != "" - yyq807[5] = x.ReadOnly != false - var yynn807 int - if yyr807 || yy2arr807 { + yysep819 := !z.EncBinary() + yy2arr819 := z.EncBasicHandle().StructToArray + var yyq819 [6]bool + _, _, _ = yysep819, yyq819, yy2arr819 + const yyr819 bool = false + yyq819[3] = x.ISCSIInterface != "" + yyq819[4] = x.FSType != "" + yyq819[5] = x.ReadOnly != false + var yynn819 int + if yyr819 || yy2arr819 { r.EncodeArrayStart(6) } else { - yynn807 = 4 - for _, b := range yyq807 { + yynn819 = 3 + for _, b := range yyq819 { if b { - yynn807++ + yynn819++ } } - r.EncodeMapStart(yynn807) - yynn807 = 0 + r.EncodeMapStart(yynn819) + yynn819 = 0 } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym809 := z.EncBinary() - _ = yym809 + yym821 := z.EncBinary() + _ = yym821 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TargetPortal)) @@ -11655,17 +11934,17 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("targetPortal")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym810 := z.EncBinary() - _ = yym810 + yym822 := z.EncBinary() + _ = yym822 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TargetPortal)) } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym812 := z.EncBinary() - _ = yym812 + yym824 := z.EncBinary() + _ = yym824 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IQN)) @@ -11674,17 +11953,17 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iqn")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym813 := z.EncBinary() - _ = yym813 + yym825 := z.EncBinary() + _ = yym825 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IQN)) } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym815 := z.EncBinary() - _ = yym815 + yym827 := z.EncBinary() + _ = yym827 if false { } else { r.EncodeInt(int64(x.Lun)) @@ -11693,18 +11972,18 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lun")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym816 := z.EncBinary() - _ = yym816 + yym828 := z.EncBinary() + _ = yym828 if false { } else { r.EncodeInt(int64(x.Lun)) } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq807[3] { - yym818 := z.EncBinary() - _ = yym818 + if yyq819[3] { + yym830 := z.EncBinary() + _ = yym830 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ISCSIInterface)) @@ -11713,42 +11992,48 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq807[3] { + if yyq819[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iscsiInterface")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym819 := z.EncBinary() - _ = yym819 + yym831 := z.EncBinary() + _ = yym831 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ISCSIInterface)) } } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym821 := z.EncBinary() - _ = yym821 - if false { + if yyq819[4] { + yym833 := z.EncBinary() + _ = yym833 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + r.EncodeString(codecSelferC_UTF81234, "") } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fsType")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym822 := z.EncBinary() - _ = yym822 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + if yyq819[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fsType")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym834 := z.EncBinary() + _ = yym834 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq807[5] { - yym824 := z.EncBinary() - _ = yym824 + if yyq819[5] { + yym836 := z.EncBinary() + _ = yym836 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -11757,19 +12042,19 @@ func (x *ISCSIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq807[5] { + if yyq819[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym825 := z.EncBinary() - _ = yym825 + yym837 := z.EncBinary() + _ = yym837 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr807 || yy2arr807 { + if yyr819 || yy2arr819 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11782,25 +12067,25 @@ func (x *ISCSIVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym826 := z.DecBinary() - _ = yym826 + yym838 := z.DecBinary() + _ = yym838 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct827 := r.ContainerType() - if yyct827 == codecSelferValueTypeMap1234 { - yyl827 := r.ReadMapStart() - if yyl827 == 0 { + yyct839 := r.ContainerType() + if yyct839 == codecSelferValueTypeMap1234 { + yyl839 := r.ReadMapStart() + if yyl839 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl827, d) + x.codecDecodeSelfFromMap(yyl839, d) } - } else if yyct827 == codecSelferValueTypeArray1234 { - yyl827 := r.ReadArrayStart() - if yyl827 == 0 { + } else if yyct839 == codecSelferValueTypeArray1234 { + yyl839 := r.ReadArrayStart() + if yyl839 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl827, d) + x.codecDecodeSelfFromArray(yyl839, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11812,12 +12097,12 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys828Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys828Slc - var yyhl828 bool = l >= 0 - for yyj828 := 0; ; yyj828++ { - if yyhl828 { - if yyj828 >= l { + var yys840Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys840Slc + var yyhl840 bool = l >= 0 + for yyj840 := 0; ; yyj840++ { + if yyhl840 { + if yyj840 >= l { break } } else { @@ -11826,10 +12111,10 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys828Slc = r.DecodeBytes(yys828Slc, true, true) - yys828 := string(yys828Slc) + yys840Slc = r.DecodeBytes(yys840Slc, true, true) + yys840 := string(yys840Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys828 { + switch yys840 { case "targetPortal": if r.TryDecodeAsNil() { x.TargetPortal = "" @@ -11867,9 +12152,9 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys828) - } // end switch yys828 - } // end for yyj828 + z.DecStructFieldNotFound(-1, yys840) + } // end switch yys840 + } // end for yyj840 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11877,16 +12162,16 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj835 int - var yyb835 bool - var yyhl835 bool = l >= 0 - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + var yyj847 int + var yyb847 bool + var yyhl847 bool = l >= 0 + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11896,13 +12181,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.TargetPortal = string(r.DecodeString()) } - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11912,13 +12197,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.IQN = string(r.DecodeString()) } - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11928,13 +12213,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.Lun = int32(r.DecodeInt(32)) } - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11944,13 +12229,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.ISCSIInterface = string(r.DecodeString()) } - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11960,13 +12245,13 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.FSType = string(r.DecodeString()) } - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11977,17 +12262,17 @@ func (x *ISCSIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder x.ReadOnly = bool(r.DecodeBool()) } for { - yyj835++ - if yyhl835 { - yyb835 = yyj835 > l + yyj847++ + if yyhl847 { + yyb847 = yyj847 > l } else { - yyb835 = r.CheckBreak() + yyb847 = r.CheckBreak() } - if yyb835 { + if yyb847 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj835-1, "") + z.DecStructFieldNotFound(yyj847-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11999,37 +12284,38 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym842 := z.EncBinary() - _ = yym842 + yym854 := z.EncBinary() + _ = yym854 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep843 := !z.EncBinary() - yy2arr843 := z.EncBasicHandle().StructToArray - var yyq843 [4]bool - _, _, _ = yysep843, yyq843, yy2arr843 - const yyr843 bool = false - yyq843[3] = x.ReadOnly != false - var yynn843 int - if yyr843 || yy2arr843 { + yysep855 := !z.EncBinary() + yy2arr855 := z.EncBasicHandle().StructToArray + var yyq855 [4]bool + _, _, _ = yysep855, yyq855, yy2arr855 + const yyr855 bool = false + yyq855[2] = x.FSType != "" + yyq855[3] = x.ReadOnly != false + var yynn855 int + if yyr855 || yy2arr855 { r.EncodeArrayStart(4) } else { - yynn843 = 3 - for _, b := range yyq843 { + yynn855 = 2 + for _, b := range yyq855 { if b { - yynn843++ + yynn855++ } } - r.EncodeMapStart(yynn843) - yynn843 = 0 + r.EncodeMapStart(yynn855) + yynn855 = 0 } - if yyr843 || yy2arr843 { + if yyr855 || yy2arr855 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TargetWWNs == nil { r.EncodeNil() } else { - yym845 := z.EncBinary() - _ = yym845 + yym857 := z.EncBinary() + _ = yym857 if false { } else { z.F.EncSliceStringV(x.TargetWWNs, false, e) @@ -12042,25 +12328,25 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.TargetWWNs == nil { r.EncodeNil() } else { - yym846 := z.EncBinary() - _ = yym846 + yym858 := z.EncBinary() + _ = yym858 if false { } else { z.F.EncSliceStringV(x.TargetWWNs, false, e) } } } - if yyr843 || yy2arr843 { + if yyr855 || yy2arr855 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Lun == nil { r.EncodeNil() } else { - yy848 := *x.Lun - yym849 := z.EncBinary() - _ = yym849 + yy860 := *x.Lun + yym861 := z.EncBinary() + _ = yym861 if false { } else { - r.EncodeInt(int64(yy848)) + r.EncodeInt(int64(yy860)) } } } else { @@ -12070,39 +12356,45 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x.Lun == nil { r.EncodeNil() } else { - yy850 := *x.Lun - yym851 := z.EncBinary() - _ = yym851 + yy862 := *x.Lun + yym863 := z.EncBinary() + _ = yym863 if false { } else { - r.EncodeInt(int64(yy850)) + r.EncodeInt(int64(yy862)) } } } - if yyr843 || yy2arr843 { + if yyr855 || yy2arr855 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym853 := z.EncBinary() - _ = yym853 - if false { + if yyq855[2] { + yym865 := z.EncBinary() + _ = yym865 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + r.EncodeString(codecSelferC_UTF81234, "") } } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fsType")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym854 := z.EncBinary() - _ = yym854 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + if yyq855[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fsType")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym866 := z.EncBinary() + _ = yym866 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FSType)) + } } } - if yyr843 || yy2arr843 { + if yyr855 || yy2arr855 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq843[3] { - yym856 := z.EncBinary() - _ = yym856 + if yyq855[3] { + yym868 := z.EncBinary() + _ = yym868 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -12111,19 +12403,19 @@ func (x *FCVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq843[3] { + if yyq855[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym857 := z.EncBinary() - _ = yym857 + yym869 := z.EncBinary() + _ = yym869 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr843 || yy2arr843 { + if yyr855 || yy2arr855 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12136,25 +12428,25 @@ func (x *FCVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym858 := z.DecBinary() - _ = yym858 + yym870 := z.DecBinary() + _ = yym870 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct859 := r.ContainerType() - if yyct859 == codecSelferValueTypeMap1234 { - yyl859 := r.ReadMapStart() - if yyl859 == 0 { + yyct871 := r.ContainerType() + if yyct871 == codecSelferValueTypeMap1234 { + yyl871 := r.ReadMapStart() + if yyl871 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl859, d) + x.codecDecodeSelfFromMap(yyl871, d) } - } else if yyct859 == codecSelferValueTypeArray1234 { - yyl859 := r.ReadArrayStart() - if yyl859 == 0 { + } else if yyct871 == codecSelferValueTypeArray1234 { + yyl871 := r.ReadArrayStart() + if yyl871 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl859, d) + x.codecDecodeSelfFromArray(yyl871, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12166,12 +12458,12 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys860Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys860Slc - var yyhl860 bool = l >= 0 - for yyj860 := 0; ; yyj860++ { - if yyhl860 { - if yyj860 >= l { + var yys872Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys872Slc + var yyhl872 bool = l >= 0 + for yyj872 := 0; ; yyj872++ { + if yyhl872 { + if yyj872 >= l { break } } else { @@ -12180,20 +12472,20 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys860Slc = r.DecodeBytes(yys860Slc, true, true) - yys860 := string(yys860Slc) + yys872Slc = r.DecodeBytes(yys872Slc, true, true) + yys872 := string(yys872Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys860 { + switch yys872 { case "targetWWNs": if r.TryDecodeAsNil() { x.TargetWWNs = nil } else { - yyv861 := &x.TargetWWNs - yym862 := z.DecBinary() - _ = yym862 + yyv873 := &x.TargetWWNs + yym874 := z.DecBinary() + _ = yym874 if false { } else { - z.F.DecSliceStringX(yyv861, false, d) + z.F.DecSliceStringX(yyv873, false, d) } } case "lun": @@ -12205,8 +12497,8 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Lun == nil { x.Lun = new(int32) } - yym864 := z.DecBinary() - _ = yym864 + yym876 := z.DecBinary() + _ = yym876 if false { } else { *((*int32)(x.Lun)) = int32(r.DecodeInt(32)) @@ -12225,9 +12517,9 @@ func (x *FCVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys860) - } // end switch yys860 - } // end for yyj860 + z.DecStructFieldNotFound(-1, yys872) + } // end switch yys872 + } // end for yyj872 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12235,16 +12527,16 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj867 int - var yyb867 bool - var yyhl867 bool = l >= 0 - yyj867++ - if yyhl867 { - yyb867 = yyj867 > l + var yyj879 int + var yyb879 bool + var yyhl879 bool = l >= 0 + yyj879++ + if yyhl879 { + yyb879 = yyj879 > l } else { - yyb867 = r.CheckBreak() + yyb879 = r.CheckBreak() } - if yyb867 { + if yyb879 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12252,21 +12544,21 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetWWNs = nil } else { - yyv868 := &x.TargetWWNs - yym869 := z.DecBinary() - _ = yym869 + yyv880 := &x.TargetWWNs + yym881 := z.DecBinary() + _ = yym881 if false { } else { - z.F.DecSliceStringX(yyv868, false, d) + z.F.DecSliceStringX(yyv880, false, d) } } - yyj867++ - if yyhl867 { - yyb867 = yyj867 > l + yyj879++ + if yyhl879 { + yyb879 = yyj879 > l } else { - yyb867 = r.CheckBreak() + yyb879 = r.CheckBreak() } - if yyb867 { + if yyb879 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12279,20 +12571,20 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Lun == nil { x.Lun = new(int32) } - yym871 := z.DecBinary() - _ = yym871 + yym883 := z.DecBinary() + _ = yym883 if false { } else { *((*int32)(x.Lun)) = int32(r.DecodeInt(32)) } } - yyj867++ - if yyhl867 { - yyb867 = yyj867 > l + yyj879++ + if yyhl879 { + yyb879 = yyj879 > l } else { - yyb867 = r.CheckBreak() + yyb879 = r.CheckBreak() } - if yyb867 { + if yyb879 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12302,13 +12594,13 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.FSType = string(r.DecodeString()) } - yyj867++ - if yyhl867 { - yyb867 = yyj867 > l + yyj879++ + if yyhl879 { + yyb879 = yyj879 > l } else { - yyb867 = r.CheckBreak() + yyb879 = r.CheckBreak() } - if yyb867 { + if yyb879 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12319,17 +12611,268 @@ func (x *FCVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.ReadOnly = bool(r.DecodeBool()) } for { - yyj867++ - if yyhl867 { - yyb867 = yyj867 > l + yyj879++ + if yyhl879 { + yyb879 = yyj879 > l } else { - yyb867 = r.CheckBreak() + yyb879 = r.CheckBreak() } - if yyb867 { + if yyb879 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj867-1, "") + z.DecStructFieldNotFound(yyj879-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *AzureFileVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym886 := z.EncBinary() + _ = yym886 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep887 := !z.EncBinary() + yy2arr887 := z.EncBasicHandle().StructToArray + var yyq887 [3]bool + _, _, _ = yysep887, yyq887, yy2arr887 + const yyr887 bool = false + yyq887[2] = x.ReadOnly != false + var yynn887 int + if yyr887 || yy2arr887 { + r.EncodeArrayStart(3) + } else { + yynn887 = 2 + for _, b := range yyq887 { + if b { + yynn887++ + } + } + r.EncodeMapStart(yynn887) + yynn887 = 0 + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym889 := z.EncBinary() + _ = yym889 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("secretName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym890 := z.EncBinary() + _ = yym890 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym892 := z.EncBinary() + _ = yym892 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ShareName)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("shareName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym893 := z.EncBinary() + _ = yym893 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ShareName)) + } + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq887[2] { + yym895 := z.EncBinary() + _ = yym895 + if false { + } else { + r.EncodeBool(bool(x.ReadOnly)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq887[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("readOnly")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym896 := z.EncBinary() + _ = yym896 + if false { + } else { + r.EncodeBool(bool(x.ReadOnly)) + } + } + } + if yyr887 || yy2arr887 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *AzureFileVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym897 := z.DecBinary() + _ = yym897 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct898 := r.ContainerType() + if yyct898 == codecSelferValueTypeMap1234 { + yyl898 := r.ReadMapStart() + if yyl898 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl898, d) + } + } else if yyct898 == codecSelferValueTypeArray1234 { + yyl898 := r.ReadArrayStart() + if yyl898 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl898, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *AzureFileVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys899Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys899Slc + var yyhl899 bool = l >= 0 + for yyj899 := 0; ; yyj899++ { + if yyhl899 { + if yyj899 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys899Slc = r.DecodeBytes(yys899Slc, true, true) + yys899 := string(yys899Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys899 { + case "secretName": + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + case "shareName": + if r.TryDecodeAsNil() { + x.ShareName = "" + } else { + x.ShareName = string(r.DecodeString()) + } + case "readOnly": + if r.TryDecodeAsNil() { + x.ReadOnly = false + } else { + x.ReadOnly = bool(r.DecodeBool()) + } + default: + z.DecStructFieldNotFound(-1, yys899) + } // end switch yys899 + } // end for yyj899 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *AzureFileVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj903 int + var yyb903 bool + var yyhl903 bool = l >= 0 + yyj903++ + if yyhl903 { + yyb903 = yyj903 > l + } else { + yyb903 = r.CheckBreak() + } + if yyb903 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + yyj903++ + if yyhl903 { + yyb903 = yyj903 > l + } else { + yyb903 = r.CheckBreak() + } + if yyb903 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ShareName = "" + } else { + x.ShareName = string(r.DecodeString()) + } + yyj903++ + if yyhl903 { + yyb903 = yyj903 > l + } else { + yyb903 = r.CheckBreak() + } + if yyb903 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ReadOnly = false + } else { + x.ReadOnly = bool(r.DecodeBool()) + } + for { + yyj903++ + if yyhl903 { + yyb903 = yyj903 > l + } else { + yyb903 = r.CheckBreak() + } + if yyb903 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj903-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12341,38 +12884,38 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym874 := z.EncBinary() - _ = yym874 + yym907 := z.EncBinary() + _ = yym907 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep875 := !z.EncBinary() - yy2arr875 := z.EncBasicHandle().StructToArray - var yyq875 [5]bool - _, _, _ = yysep875, yyq875, yy2arr875 - const yyr875 bool = false - yyq875[0] = x.Name != "" - yyq875[1] = x.HostPort != 0 - yyq875[3] = x.Protocol != "" - yyq875[4] = x.HostIP != "" - var yynn875 int - if yyr875 || yy2arr875 { + yysep908 := !z.EncBinary() + yy2arr908 := z.EncBasicHandle().StructToArray + var yyq908 [5]bool + _, _, _ = yysep908, yyq908, yy2arr908 + const yyr908 bool = false + yyq908[0] = x.Name != "" + yyq908[1] = x.HostPort != 0 + yyq908[3] = x.Protocol != "" + yyq908[4] = x.HostIP != "" + var yynn908 int + if yyr908 || yy2arr908 { r.EncodeArrayStart(5) } else { - yynn875 = 1 - for _, b := range yyq875 { + yynn908 = 1 + for _, b := range yyq908 { if b { - yynn875++ + yynn908++ } } - r.EncodeMapStart(yynn875) - yynn875 = 0 + r.EncodeMapStart(yynn908) + yynn908 = 0 } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq875[0] { - yym877 := z.EncBinary() - _ = yym877 + if yyq908[0] { + yym910 := z.EncBinary() + _ = yym910 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -12381,23 +12924,23 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq875[0] { + if yyq908[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym878 := z.EncBinary() - _ = yym878 + yym911 := z.EncBinary() + _ = yym911 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq875[1] { - yym880 := z.EncBinary() - _ = yym880 + if yyq908[1] { + yym913 := z.EncBinary() + _ = yym913 if false { } else { r.EncodeInt(int64(x.HostPort)) @@ -12406,22 +12949,22 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq875[1] { + if yyq908[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym881 := z.EncBinary() - _ = yym881 + yym914 := z.EncBinary() + _ = yym914 if false { } else { r.EncodeInt(int64(x.HostPort)) } } } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym883 := z.EncBinary() - _ = yym883 + yym916 := z.EncBinary() + _ = yym916 if false { } else { r.EncodeInt(int64(x.ContainerPort)) @@ -12430,33 +12973,33 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym884 := z.EncBinary() - _ = yym884 + yym917 := z.EncBinary() + _ = yym917 if false { } else { r.EncodeInt(int64(x.ContainerPort)) } } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq875[3] { + if yyq908[3] { x.Protocol.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq875[3] { + if yyq908[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("protocol")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq875[4] { - yym887 := z.EncBinary() - _ = yym887 + if yyq908[4] { + yym920 := z.EncBinary() + _ = yym920 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) @@ -12465,19 +13008,19 @@ func (x *ContainerPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq875[4] { + if yyq908[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym888 := z.EncBinary() - _ = yym888 + yym921 := z.EncBinary() + _ = yym921 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) } } } - if yyr875 || yy2arr875 { + if yyr908 || yy2arr908 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12490,25 +13033,25 @@ func (x *ContainerPort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym889 := z.DecBinary() - _ = yym889 + yym922 := z.DecBinary() + _ = yym922 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct890 := r.ContainerType() - if yyct890 == codecSelferValueTypeMap1234 { - yyl890 := r.ReadMapStart() - if yyl890 == 0 { + yyct923 := r.ContainerType() + if yyct923 == codecSelferValueTypeMap1234 { + yyl923 := r.ReadMapStart() + if yyl923 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl890, d) + x.codecDecodeSelfFromMap(yyl923, d) } - } else if yyct890 == codecSelferValueTypeArray1234 { - yyl890 := r.ReadArrayStart() - if yyl890 == 0 { + } else if yyct923 == codecSelferValueTypeArray1234 { + yyl923 := r.ReadArrayStart() + if yyl923 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl890, d) + x.codecDecodeSelfFromArray(yyl923, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12520,12 +13063,12 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys891Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys891Slc - var yyhl891 bool = l >= 0 - for yyj891 := 0; ; yyj891++ { - if yyhl891 { - if yyj891 >= l { + var yys924Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys924Slc + var yyhl924 bool = l >= 0 + for yyj924 := 0; ; yyj924++ { + if yyhl924 { + if yyj924 >= l { break } } else { @@ -12534,10 +13077,10 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys891Slc = r.DecodeBytes(yys891Slc, true, true) - yys891 := string(yys891Slc) + yys924Slc = r.DecodeBytes(yys924Slc, true, true) + yys924 := string(yys924Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys891 { + switch yys924 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -12569,9 +13112,9 @@ func (x *ContainerPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HostIP = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys891) - } // end switch yys891 - } // end for yyj891 + z.DecStructFieldNotFound(-1, yys924) + } // end switch yys924 + } // end for yyj924 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12579,16 +13122,16 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj897 int - var yyb897 bool - var yyhl897 bool = l >= 0 - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + var yyj930 int + var yyb930 bool + var yyhl930 bool = l >= 0 + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12598,13 +13141,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12614,13 +13157,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostPort = int32(r.DecodeInt(32)) } - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12630,13 +13173,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ContainerPort = int32(r.DecodeInt(32)) } - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12646,13 +13189,13 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Protocol = Protocol(r.DecodeString()) } - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12663,17 +13206,17 @@ func (x *ContainerPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.HostIP = string(r.DecodeString()) } for { - yyj897++ - if yyhl897 { - yyb897 = yyj897 > l + yyj930++ + if yyhl930 { + yyb930 = yyj930 > l } else { - yyb897 = r.CheckBreak() + yyb930 = r.CheckBreak() } - if yyb897 { + if yyb930 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj897-1, "") + z.DecStructFieldNotFound(yyj930-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12685,34 +13228,34 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym903 := z.EncBinary() - _ = yym903 + yym936 := z.EncBinary() + _ = yym936 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep904 := !z.EncBinary() - yy2arr904 := z.EncBasicHandle().StructToArray - var yyq904 [3]bool - _, _, _ = yysep904, yyq904, yy2arr904 - const yyr904 bool = false - yyq904[1] = x.ReadOnly != false - var yynn904 int - if yyr904 || yy2arr904 { + yysep937 := !z.EncBinary() + yy2arr937 := z.EncBasicHandle().StructToArray + var yyq937 [3]bool + _, _, _ = yysep937, yyq937, yy2arr937 + const yyr937 bool = false + yyq937[1] = x.ReadOnly != false + var yynn937 int + if yyr937 || yy2arr937 { r.EncodeArrayStart(3) } else { - yynn904 = 2 - for _, b := range yyq904 { + yynn937 = 2 + for _, b := range yyq937 { if b { - yynn904++ + yynn937++ } } - r.EncodeMapStart(yynn904) - yynn904 = 0 + r.EncodeMapStart(yynn937) + yynn937 = 0 } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym906 := z.EncBinary() - _ = yym906 + yym939 := z.EncBinary() + _ = yym939 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -12721,18 +13264,18 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym907 := z.EncBinary() - _ = yym907 + yym940 := z.EncBinary() + _ = yym940 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq904[1] { - yym909 := z.EncBinary() - _ = yym909 + if yyq937[1] { + yym942 := z.EncBinary() + _ = yym942 if false { } else { r.EncodeBool(bool(x.ReadOnly)) @@ -12741,22 +13284,22 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq904[1] { + if yyq937[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnly")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym910 := z.EncBinary() - _ = yym910 + yym943 := z.EncBinary() + _ = yym943 if false { } else { r.EncodeBool(bool(x.ReadOnly)) } } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym912 := z.EncBinary() - _ = yym912 + yym945 := z.EncBinary() + _ = yym945 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MountPath)) @@ -12765,14 +13308,14 @@ func (x *VolumeMount) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("mountPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym913 := z.EncBinary() - _ = yym913 + yym946 := z.EncBinary() + _ = yym946 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MountPath)) } } - if yyr904 || yy2arr904 { + if yyr937 || yy2arr937 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12785,25 +13328,25 @@ func (x *VolumeMount) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym914 := z.DecBinary() - _ = yym914 + yym947 := z.DecBinary() + _ = yym947 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct915 := r.ContainerType() - if yyct915 == codecSelferValueTypeMap1234 { - yyl915 := r.ReadMapStart() - if yyl915 == 0 { + yyct948 := r.ContainerType() + if yyct948 == codecSelferValueTypeMap1234 { + yyl948 := r.ReadMapStart() + if yyl948 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl915, d) + x.codecDecodeSelfFromMap(yyl948, d) } - } else if yyct915 == codecSelferValueTypeArray1234 { - yyl915 := r.ReadArrayStart() - if yyl915 == 0 { + } else if yyct948 == codecSelferValueTypeArray1234 { + yyl948 := r.ReadArrayStart() + if yyl948 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl915, d) + x.codecDecodeSelfFromArray(yyl948, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12815,12 +13358,12 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys916Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys916Slc - var yyhl916 bool = l >= 0 - for yyj916 := 0; ; yyj916++ { - if yyhl916 { - if yyj916 >= l { + var yys949Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys949Slc + var yyhl949 bool = l >= 0 + for yyj949 := 0; ; yyj949++ { + if yyhl949 { + if yyj949 >= l { break } } else { @@ -12829,10 +13372,10 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys916Slc = r.DecodeBytes(yys916Slc, true, true) - yys916 := string(yys916Slc) + yys949Slc = r.DecodeBytes(yys949Slc, true, true) + yys949 := string(yys949Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys916 { + switch yys949 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -12852,9 +13395,9 @@ func (x *VolumeMount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.MountPath = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys916) - } // end switch yys916 - } // end for yyj916 + z.DecStructFieldNotFound(-1, yys949) + } // end switch yys949 + } // end for yyj949 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12862,16 +13405,16 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj920 int - var yyb920 bool - var yyhl920 bool = l >= 0 - yyj920++ - if yyhl920 { - yyb920 = yyj920 > l + var yyj953 int + var yyb953 bool + var yyhl953 bool = l >= 0 + yyj953++ + if yyhl953 { + yyb953 = yyj953 > l } else { - yyb920 = r.CheckBreak() + yyb953 = r.CheckBreak() } - if yyb920 { + if yyb953 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12881,13 +13424,13 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj920++ - if yyhl920 { - yyb920 = yyj920 > l + yyj953++ + if yyhl953 { + yyb953 = yyj953 > l } else { - yyb920 = r.CheckBreak() + yyb953 = r.CheckBreak() } - if yyb920 { + if yyb953 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12897,13 +13440,13 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ReadOnly = bool(r.DecodeBool()) } - yyj920++ - if yyhl920 { - yyb920 = yyj920 > l + yyj953++ + if yyhl953 { + yyb953 = yyj953 > l } else { - yyb920 = r.CheckBreak() + yyb953 = r.CheckBreak() } - if yyb920 { + if yyb953 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12914,17 +13457,17 @@ func (x *VolumeMount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.MountPath = string(r.DecodeString()) } for { - yyj920++ - if yyhl920 { - yyb920 = yyj920 > l + yyj953++ + if yyhl953 { + yyb953 = yyj953 > l } else { - yyb920 = r.CheckBreak() + yyb953 = r.CheckBreak() } - if yyb920 { + if yyb953 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj920-1, "") + z.DecStructFieldNotFound(yyj953-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12936,35 +13479,35 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym924 := z.EncBinary() - _ = yym924 + yym957 := z.EncBinary() + _ = yym957 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep925 := !z.EncBinary() - yy2arr925 := z.EncBasicHandle().StructToArray - var yyq925 [3]bool - _, _, _ = yysep925, yyq925, yy2arr925 - const yyr925 bool = false - yyq925[1] = x.Value != "" - yyq925[2] = x.ValueFrom != nil - var yynn925 int - if yyr925 || yy2arr925 { + yysep958 := !z.EncBinary() + yy2arr958 := z.EncBasicHandle().StructToArray + var yyq958 [3]bool + _, _, _ = yysep958, yyq958, yy2arr958 + const yyr958 bool = false + yyq958[1] = x.Value != "" + yyq958[2] = x.ValueFrom != nil + var yynn958 int + if yyr958 || yy2arr958 { r.EncodeArrayStart(3) } else { - yynn925 = 1 - for _, b := range yyq925 { + yynn958 = 1 + for _, b := range yyq958 { if b { - yynn925++ + yynn958++ } } - r.EncodeMapStart(yynn925) - yynn925 = 0 + r.EncodeMapStart(yynn958) + yynn958 = 0 } - if yyr925 || yy2arr925 { + if yyr958 || yy2arr958 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym927 := z.EncBinary() - _ = yym927 + yym960 := z.EncBinary() + _ = yym960 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -12973,18 +13516,18 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym928 := z.EncBinary() - _ = yym928 + yym961 := z.EncBinary() + _ = yym961 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr925 || yy2arr925 { + if yyr958 || yy2arr958 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq925[1] { - yym930 := z.EncBinary() - _ = yym930 + if yyq958[1] { + yym963 := z.EncBinary() + _ = yym963 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Value)) @@ -12993,21 +13536,21 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq925[1] { + if yyq958[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("value")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym931 := z.EncBinary() - _ = yym931 + yym964 := z.EncBinary() + _ = yym964 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Value)) } } } - if yyr925 || yy2arr925 { + if yyr958 || yy2arr958 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq925[2] { + if yyq958[2] { if x.ValueFrom == nil { r.EncodeNil() } else { @@ -13017,7 +13560,7 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq925[2] { + if yyq958[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("valueFrom")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13028,7 +13571,7 @@ func (x *EnvVar) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr925 || yy2arr925 { + if yyr958 || yy2arr958 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13041,25 +13584,25 @@ func (x *EnvVar) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym933 := z.DecBinary() - _ = yym933 + yym966 := z.DecBinary() + _ = yym966 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct934 := r.ContainerType() - if yyct934 == codecSelferValueTypeMap1234 { - yyl934 := r.ReadMapStart() - if yyl934 == 0 { + yyct967 := r.ContainerType() + if yyct967 == codecSelferValueTypeMap1234 { + yyl967 := r.ReadMapStart() + if yyl967 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl934, d) + x.codecDecodeSelfFromMap(yyl967, d) } - } else if yyct934 == codecSelferValueTypeArray1234 { - yyl934 := r.ReadArrayStart() - if yyl934 == 0 { + } else if yyct967 == codecSelferValueTypeArray1234 { + yyl967 := r.ReadArrayStart() + if yyl967 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl934, d) + x.codecDecodeSelfFromArray(yyl967, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13071,12 +13614,12 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys935Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys935Slc - var yyhl935 bool = l >= 0 - for yyj935 := 0; ; yyj935++ { - if yyhl935 { - if yyj935 >= l { + var yys968Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys968Slc + var yyhl968 bool = l >= 0 + for yyj968 := 0; ; yyj968++ { + if yyhl968 { + if yyj968 >= l { break } } else { @@ -13085,10 +13628,10 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys935Slc = r.DecodeBytes(yys935Slc, true, true) - yys935 := string(yys935Slc) + yys968Slc = r.DecodeBytes(yys968Slc, true, true) + yys968 := string(yys968Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys935 { + switch yys968 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -13113,9 +13656,9 @@ func (x *EnvVar) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ValueFrom.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys935) - } // end switch yys935 - } // end for yyj935 + z.DecStructFieldNotFound(-1, yys968) + } // end switch yys968 + } // end for yyj968 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13123,16 +13666,16 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj939 int - var yyb939 bool - var yyhl939 bool = l >= 0 - yyj939++ - if yyhl939 { - yyb939 = yyj939 > l + var yyj972 int + var yyb972 bool + var yyhl972 bool = l >= 0 + yyj972++ + if yyhl972 { + yyb972 = yyj972 > l } else { - yyb939 = r.CheckBreak() + yyb972 = r.CheckBreak() } - if yyb939 { + if yyb972 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13142,13 +13685,13 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj939++ - if yyhl939 { - yyb939 = yyj939 > l + yyj972++ + if yyhl972 { + yyb972 = yyj972 > l } else { - yyb939 = r.CheckBreak() + yyb972 = r.CheckBreak() } - if yyb939 { + if yyb972 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13158,13 +13701,13 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Value = string(r.DecodeString()) } - yyj939++ - if yyhl939 { - yyb939 = yyj939 > l + yyj972++ + if yyhl972 { + yyb972 = yyj972 > l } else { - yyb939 = r.CheckBreak() + yyb972 = r.CheckBreak() } - if yyb939 { + if yyb972 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13180,17 +13723,17 @@ func (x *EnvVar) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.ValueFrom.CodecDecodeSelf(d) } for { - yyj939++ - if yyhl939 { - yyb939 = yyj939 > l + yyj972++ + if yyhl972 { + yyb972 = yyj972 > l } else { - yyb939 = r.CheckBreak() + yyb972 = r.CheckBreak() } - if yyb939 { + if yyb972 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj939-1, "") + z.DecStructFieldNotFound(yyj972-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13202,35 +13745,35 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym943 := z.EncBinary() - _ = yym943 + yym976 := z.EncBinary() + _ = yym976 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep944 := !z.EncBinary() - yy2arr944 := z.EncBasicHandle().StructToArray - var yyq944 [3]bool - _, _, _ = yysep944, yyq944, yy2arr944 - const yyr944 bool = false - yyq944[0] = x.FieldRef != nil - yyq944[1] = x.ConfigMapKeyRef != nil - yyq944[2] = x.SecretKeyRef != nil - var yynn944 int - if yyr944 || yy2arr944 { + yysep977 := !z.EncBinary() + yy2arr977 := z.EncBasicHandle().StructToArray + var yyq977 [3]bool + _, _, _ = yysep977, yyq977, yy2arr977 + const yyr977 bool = false + yyq977[0] = x.FieldRef != nil + yyq977[1] = x.ConfigMapKeyRef != nil + yyq977[2] = x.SecretKeyRef != nil + var yynn977 int + if yyr977 || yy2arr977 { r.EncodeArrayStart(3) } else { - yynn944 = 0 - for _, b := range yyq944 { + yynn977 = 0 + for _, b := range yyq977 { if b { - yynn944++ + yynn977++ } } - r.EncodeMapStart(yynn944) - yynn944 = 0 + r.EncodeMapStart(yynn977) + yynn977 = 0 } - if yyr944 || yy2arr944 { + if yyr977 || yy2arr977 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq944[0] { + if yyq977[0] { if x.FieldRef == nil { r.EncodeNil() } else { @@ -13240,7 +13783,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq944[0] { + if yyq977[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13251,9 +13794,9 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr944 || yy2arr944 { + if yyr977 || yy2arr977 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq944[1] { + if yyq977[1] { if x.ConfigMapKeyRef == nil { r.EncodeNil() } else { @@ -13263,7 +13806,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq944[1] { + if yyq977[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("configMapKeyRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13274,9 +13817,9 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr944 || yy2arr944 { + if yyr977 || yy2arr977 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq944[2] { + if yyq977[2] { if x.SecretKeyRef == nil { r.EncodeNil() } else { @@ -13286,7 +13829,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq944[2] { + if yyq977[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secretKeyRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13297,7 +13840,7 @@ func (x *EnvVarSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr944 || yy2arr944 { + if yyr977 || yy2arr977 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13310,25 +13853,25 @@ func (x *EnvVarSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym948 := z.DecBinary() - _ = yym948 + yym981 := z.DecBinary() + _ = yym981 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct949 := r.ContainerType() - if yyct949 == codecSelferValueTypeMap1234 { - yyl949 := r.ReadMapStart() - if yyl949 == 0 { + yyct982 := r.ContainerType() + if yyct982 == codecSelferValueTypeMap1234 { + yyl982 := r.ReadMapStart() + if yyl982 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl949, d) + x.codecDecodeSelfFromMap(yyl982, d) } - } else if yyct949 == codecSelferValueTypeArray1234 { - yyl949 := r.ReadArrayStart() - if yyl949 == 0 { + } else if yyct982 == codecSelferValueTypeArray1234 { + yyl982 := r.ReadArrayStart() + if yyl982 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl949, d) + x.codecDecodeSelfFromArray(yyl982, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13340,12 +13883,12 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys950Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys950Slc - var yyhl950 bool = l >= 0 - for yyj950 := 0; ; yyj950++ { - if yyhl950 { - if yyj950 >= l { + var yys983Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys983Slc + var yyhl983 bool = l >= 0 + for yyj983 := 0; ; yyj983++ { + if yyhl983 { + if yyj983 >= l { break } } else { @@ -13354,10 +13897,10 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys950Slc = r.DecodeBytes(yys950Slc, true, true) - yys950 := string(yys950Slc) + yys983Slc = r.DecodeBytes(yys983Slc, true, true) + yys983 := string(yys983Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys950 { + switch yys983 { case "fieldRef": if r.TryDecodeAsNil() { if x.FieldRef != nil { @@ -13392,464 +13935,13 @@ func (x *EnvVarSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.SecretKeyRef.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys950) - } // end switch yys950 - } // end for yyj950 + z.DecStructFieldNotFound(-1, yys983) + } // end switch yys983 + } // end for yyj983 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } func (x *EnvVarSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj954 int - var yyb954 bool - var yyhl954 bool = l >= 0 - yyj954++ - if yyhl954 { - yyb954 = yyj954 > l - } else { - yyb954 = r.CheckBreak() - } - if yyb954 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.FieldRef != nil { - x.FieldRef = nil - } - } else { - if x.FieldRef == nil { - x.FieldRef = new(ObjectFieldSelector) - } - x.FieldRef.CodecDecodeSelf(d) - } - yyj954++ - if yyhl954 { - yyb954 = yyj954 > l - } else { - yyb954 = r.CheckBreak() - } - if yyb954 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.ConfigMapKeyRef != nil { - x.ConfigMapKeyRef = nil - } - } else { - if x.ConfigMapKeyRef == nil { - x.ConfigMapKeyRef = new(ConfigMapKeySelector) - } - x.ConfigMapKeyRef.CodecDecodeSelf(d) - } - yyj954++ - if yyhl954 { - yyb954 = yyj954 > l - } else { - yyb954 = r.CheckBreak() - } - if yyb954 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SecretKeyRef != nil { - x.SecretKeyRef = nil - } - } else { - if x.SecretKeyRef == nil { - x.SecretKeyRef = new(SecretKeySelector) - } - x.SecretKeyRef.CodecDecodeSelf(d) - } - for { - yyj954++ - if yyhl954 { - yyb954 = yyj954 > l - } else { - yyb954 = r.CheckBreak() - } - if yyb954 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj954-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ObjectFieldSelector) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym958 := z.EncBinary() - _ = yym958 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep959 := !z.EncBinary() - yy2arr959 := z.EncBasicHandle().StructToArray - var yyq959 [2]bool - _, _, _ = yysep959, yyq959, yy2arr959 - const yyr959 bool = false - yyq959[0] = x.APIVersion != "" - var yynn959 int - if yyr959 || yy2arr959 { - r.EncodeArrayStart(2) - } else { - yynn959 = 1 - for _, b := range yyq959 { - if b { - yynn959++ - } - } - r.EncodeMapStart(yynn959) - yynn959 = 0 - } - if yyr959 || yy2arr959 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq959[0] { - yym961 := z.EncBinary() - _ = yym961 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq959[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym962 := z.EncBinary() - _ = yym962 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr959 || yy2arr959 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym964 := z.EncBinary() - _ = yym964 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym965 := z.EncBinary() - _ = yym965 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) - } - } - if yyr959 || yy2arr959 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ObjectFieldSelector) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym966 := z.DecBinary() - _ = yym966 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct967 := r.ContainerType() - if yyct967 == codecSelferValueTypeMap1234 { - yyl967 := r.ReadMapStart() - if yyl967 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl967, d) - } - } else if yyct967 == codecSelferValueTypeArray1234 { - yyl967 := r.ReadArrayStart() - if yyl967 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl967, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ObjectFieldSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys968Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys968Slc - var yyhl968 bool = l >= 0 - for yyj968 := 0; ; yyj968++ { - if yyhl968 { - if yyj968 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys968Slc = r.DecodeBytes(yys968Slc, true, true) - yys968 := string(yys968Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys968 { - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "fieldPath": - if r.TryDecodeAsNil() { - x.FieldPath = "" - } else { - x.FieldPath = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys968) - } // end switch yys968 - } // end for yyj968 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ObjectFieldSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj971 int - var yyb971 bool - var yyhl971 bool = l >= 0 - yyj971++ - if yyhl971 { - yyb971 = yyj971 > l - } else { - yyb971 = r.CheckBreak() - } - if yyb971 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj971++ - if yyhl971 { - yyb971 = yyj971 > l - } else { - yyb971 = r.CheckBreak() - } - if yyb971 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FieldPath = "" - } else { - x.FieldPath = string(r.DecodeString()) - } - for { - yyj971++ - if yyhl971 { - yyb971 = yyj971 > l - } else { - yyb971 = r.CheckBreak() - } - if yyb971 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj971-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ConfigMapKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym974 := z.EncBinary() - _ = yym974 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep975 := !z.EncBinary() - yy2arr975 := z.EncBasicHandle().StructToArray - var yyq975 [2]bool - _, _, _ = yysep975, yyq975, yy2arr975 - const yyr975 bool = false - yyq975[0] = x.Name != "" - var yynn975 int - if yyr975 || yy2arr975 { - r.EncodeArrayStart(2) - } else { - yynn975 = 1 - for _, b := range yyq975 { - if b { - yynn975++ - } - } - r.EncodeMapStart(yynn975) - yynn975 = 0 - } - if yyr975 || yy2arr975 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq975[0] { - yym977 := z.EncBinary() - _ = yym977 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq975[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("name")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym978 := z.EncBinary() - _ = yym978 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } - } - if yyr975 || yy2arr975 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym980 := z.EncBinary() - _ = yym980 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("key")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym981 := z.EncBinary() - _ = yym981 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } - if yyr975 || yy2arr975 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ConfigMapKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym982 := z.DecBinary() - _ = yym982 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct983 := r.ContainerType() - if yyct983 == codecSelferValueTypeMap1234 { - yyl983 := r.ReadMapStart() - if yyl983 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl983, d) - } - } else if yyct983 == codecSelferValueTypeArray1234 { - yyl983 := r.ReadArrayStart() - if yyl983 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl983, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ConfigMapKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys984Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys984Slc - var yyhl984 bool = l >= 0 - for yyj984 := 0; ; yyj984++ { - if yyhl984 { - if yyj984 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys984Slc = r.DecodeBytes(yys984Slc, true, true) - yys984 := string(yys984Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys984 { - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - case "key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - x.Key = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys984) - } // end switch yys984 - } // end for yyj984 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -13868,9 +13960,14 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Name = "" + if x.FieldRef != nil { + x.FieldRef = nil + } } else { - x.Name = string(r.DecodeString()) + if x.FieldRef == nil { + x.FieldRef = new(ObjectFieldSelector) + } + x.FieldRef.CodecDecodeSelf(d) } yyj987++ if yyhl987 { @@ -13884,9 +13981,35 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Key = "" + if x.ConfigMapKeyRef != nil { + x.ConfigMapKeyRef = nil + } } else { - x.Key = string(r.DecodeString()) + if x.ConfigMapKeyRef == nil { + x.ConfigMapKeyRef = new(ConfigMapKeySelector) + } + x.ConfigMapKeyRef.CodecDecodeSelf(d) + } + yyj987++ + if yyhl987 { + yyb987 = yyj987 > l + } else { + yyb987 = r.CheckBreak() + } + if yyb987 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SecretKeyRef != nil { + x.SecretKeyRef = nil + } + } else { + if x.SecretKeyRef == nil { + x.SecretKeyRef = new(SecretKeySelector) + } + x.SecretKeyRef.CodecDecodeSelf(d) } for { yyj987++ @@ -13904,66 +14027,251 @@ func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Deco z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *ObjectFieldSelector) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym990 := z.EncBinary() - _ = yym990 + yym991 := z.EncBinary() + _ = yym991 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep991 := !z.EncBinary() - yy2arr991 := z.EncBasicHandle().StructToArray - var yyq991 [2]bool - _, _, _ = yysep991, yyq991, yy2arr991 - const yyr991 bool = false - yyq991[0] = x.Name != "" - var yynn991 int - if yyr991 || yy2arr991 { + yysep992 := !z.EncBinary() + yy2arr992 := z.EncBasicHandle().StructToArray + var yyq992 [2]bool + _, _, _ = yysep992, yyq992, yy2arr992 + const yyr992 bool = false + yyq992[0] = x.APIVersion != "" + var yynn992 int + if yyr992 || yy2arr992 { r.EncodeArrayStart(2) } else { - yynn991 = 1 - for _, b := range yyq991 { + yynn992 = 1 + for _, b := range yyq992 { if b { - yynn991++ + yynn992++ } } - r.EncodeMapStart(yynn991) - yynn991 = 0 + r.EncodeMapStart(yynn992) + yynn992 = 0 } - if yyr991 || yy2arr991 { + if yyr992 || yy2arr992 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq991[0] { - yym993 := z.EncBinary() - _ = yym993 + if yyq992[0] { + yym994 := z.EncBinary() + _ = yym994 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq991[0] { + if yyq992[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("name")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym994 := z.EncBinary() - _ = yym994 + yym995 := z.EncBinary() + _ = yym995 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr991 || yy2arr991 { + if yyr992 || yy2arr992 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym996 := z.EncBinary() - _ = yym996 + yym997 := z.EncBinary() + _ = yym997 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym998 := z.EncBinary() + _ = yym998 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) + } + } + if yyr992 || yy2arr992 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ObjectFieldSelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym999 := z.DecBinary() + _ = yym999 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1000 := r.ContainerType() + if yyct1000 == codecSelferValueTypeMap1234 { + yyl1000 := r.ReadMapStart() + if yyl1000 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1000, d) + } + } else if yyct1000 == codecSelferValueTypeArray1234 { + yyl1000 := r.ReadArrayStart() + if yyl1000 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1000, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ObjectFieldSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1001Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1001Slc + var yyhl1001 bool = l >= 0 + for yyj1001 := 0; ; yyj1001++ { + if yyhl1001 { + if yyj1001 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1001Slc = r.DecodeBytes(yys1001Slc, true, true) + yys1001 := string(yys1001Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1001 { + case "apiVersion": + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + case "fieldPath": + if r.TryDecodeAsNil() { + x.FieldPath = "" + } else { + x.FieldPath = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1001) + } // end switch yys1001 + } // end for yyj1001 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ObjectFieldSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1004 int + var yyb1004 bool + var yyhl1004 bool = l >= 0 + yyj1004++ + if yyhl1004 { + yyb1004 = yyj1004 > l + } else { + yyb1004 = r.CheckBreak() + } + if yyb1004 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + yyj1004++ + if yyhl1004 { + yyb1004 = yyj1004 > l + } else { + yyb1004 = r.CheckBreak() + } + if yyb1004 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FieldPath = "" + } else { + x.FieldPath = string(r.DecodeString()) + } + for { + yyj1004++ + if yyhl1004 { + yyb1004 = yyj1004 > l + } else { + yyb1004 = r.CheckBreak() + } + if yyb1004 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1004-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ConfigMapKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1007 := z.EncBinary() + _ = yym1007 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1008 := !z.EncBinary() + yy2arr1008 := z.EncBasicHandle().StructToArray + var yyq1008 [2]bool + _, _, _ = yysep1008, yyq1008, yy2arr1008 + const yyr1008 bool = false + yyq1008[1] = x.Name != "" + var yynn1008 int + if yyr1008 || yy2arr1008 { + r.EncodeArrayStart(2) + } else { + yynn1008 = 1 + for _, b := range yyq1008 { + if b { + yynn1008++ + } + } + r.EncodeMapStart(yynn1008) + yynn1008 = 0 + } + if yyr1008 || yy2arr1008 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1010 := z.EncBinary() + _ = yym1010 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) @@ -13972,14 +14280,249 @@ func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("key")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym997 := z.EncBinary() - _ = yym997 + yym1011 := z.EncBinary() + _ = yym1011 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) } } - if yyr991 || yy2arr991 { + if yyr1008 || yy2arr1008 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1008[1] { + yym1013 := z.EncBinary() + _ = yym1013 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1008[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1014 := z.EncBinary() + _ = yym1014 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + } + if yyr1008 || yy2arr1008 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ConfigMapKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1015 := z.DecBinary() + _ = yym1015 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1016 := r.ContainerType() + if yyct1016 == codecSelferValueTypeMap1234 { + yyl1016 := r.ReadMapStart() + if yyl1016 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1016, d) + } + } else if yyct1016 == codecSelferValueTypeArray1234 { + yyl1016 := r.ReadArrayStart() + if yyl1016 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1016, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ConfigMapKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1017Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1017Slc + var yyhl1017 bool = l >= 0 + for yyj1017 := 0; ; yyj1017++ { + if yyhl1017 { + if yyj1017 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1017Slc = r.DecodeBytes(yys1017Slc, true, true) + yys1017 := string(yys1017Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1017 { + case "key": + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1017) + } // end switch yys1017 + } // end for yyj1017 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ConfigMapKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1020 int + var yyb1020 bool + var yyhl1020 bool = l >= 0 + yyj1020++ + if yyhl1020 { + yyb1020 = yyj1020 > l + } else { + yyb1020 = r.CheckBreak() + } + if yyb1020 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + yyj1020++ + if yyhl1020 { + yyb1020 = yyj1020 > l + } else { + yyb1020 = r.CheckBreak() + } + if yyb1020 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + for { + yyj1020++ + if yyhl1020 { + yyb1020 = yyj1020 > l + } else { + yyb1020 = r.CheckBreak() + } + if yyb1020 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1020-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *SecretKeySelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1023 := z.EncBinary() + _ = yym1023 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1024 := !z.EncBinary() + yy2arr1024 := z.EncBasicHandle().StructToArray + var yyq1024 [2]bool + _, _, _ = yysep1024, yyq1024, yy2arr1024 + const yyr1024 bool = false + yyq1024[1] = x.Name != "" + var yynn1024 int + if yyr1024 || yy2arr1024 { + r.EncodeArrayStart(2) + } else { + yynn1024 = 1 + for _, b := range yyq1024 { + if b { + yynn1024++ + } + } + r.EncodeMapStart(yynn1024) + yynn1024 = 0 + } + if yyr1024 || yy2arr1024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1026 := z.EncBinary() + _ = yym1026 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("key")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1027 := z.EncBinary() + _ = yym1027 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } + if yyr1024 || yy2arr1024 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1024[1] { + yym1029 := z.EncBinary() + _ = yym1029 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1024[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1030 := z.EncBinary() + _ = yym1030 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + } + if yyr1024 || yy2arr1024 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13992,25 +14535,25 @@ func (x *SecretKeySelector) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym998 := z.DecBinary() - _ = yym998 + yym1031 := z.DecBinary() + _ = yym1031 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct999 := r.ContainerType() - if yyct999 == codecSelferValueTypeMap1234 { - yyl999 := r.ReadMapStart() - if yyl999 == 0 { + yyct1032 := r.ContainerType() + if yyct1032 == codecSelferValueTypeMap1234 { + yyl1032 := r.ReadMapStart() + if yyl1032 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl999, d) + x.codecDecodeSelfFromMap(yyl1032, d) } - } else if yyct999 == codecSelferValueTypeArray1234 { - yyl999 := r.ReadArrayStart() - if yyl999 == 0 { + } else if yyct1032 == codecSelferValueTypeArray1234 { + yyl1032 := r.ReadArrayStart() + if yyl1032 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl999, d) + x.codecDecodeSelfFromArray(yyl1032, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14022,12 +14565,12 @@ func (x *SecretKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1000Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1000Slc - var yyhl1000 bool = l >= 0 - for yyj1000 := 0; ; yyj1000++ { - if yyhl1000 { - if yyj1000 >= l { + var yys1033Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1033Slc + var yyhl1033 bool = l >= 0 + for yyj1033 := 0; ; yyj1033++ { + if yyhl1033 { + if yyj1033 >= l { break } } else { @@ -14036,26 +14579,26 @@ func (x *SecretKeySelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1000Slc = r.DecodeBytes(yys1000Slc, true, true) - yys1000 := string(yys1000Slc) + yys1033Slc = r.DecodeBytes(yys1033Slc, true, true) + yys1033 := string(yys1033Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1000 { - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } + switch yys1033 { case "key": if r.TryDecodeAsNil() { x.Key = "" } else { x.Key = string(r.DecodeString()) } + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } default: - z.DecStructFieldNotFound(-1, yys1000) - } // end switch yys1000 - } // end for yyj1000 + z.DecStructFieldNotFound(-1, yys1033) + } // end switch yys1033 + } // end for yyj1033 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14063,32 +14606,16 @@ func (x *SecretKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1003 int - var yyb1003 bool - var yyhl1003 bool = l >= 0 - yyj1003++ - if yyhl1003 { - yyb1003 = yyj1003 > l + var yyj1036 int + var yyb1036 bool + var yyhl1036 bool = l >= 0 + yyj1036++ + if yyhl1036 { + yyb1036 = yyj1036 > l } else { - yyb1003 = r.CheckBreak() + yyb1036 = r.CheckBreak() } - if yyb1003 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - yyj1003++ - if yyhl1003 { - yyb1003 = yyj1003 > l - } else { - yyb1003 = r.CheckBreak() - } - if yyb1003 { + if yyb1036 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14098,18 +14625,237 @@ func (x *SecretKeySelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.Key = string(r.DecodeString()) } + yyj1036++ + if yyhl1036 { + yyb1036 = yyj1036 > l + } else { + yyb1036 = r.CheckBreak() + } + if yyb1036 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } for { - yyj1003++ - if yyhl1003 { - yyb1003 = yyj1003 > l + yyj1036++ + if yyhl1036 { + yyb1036 = yyj1036 > l } else { - yyb1003 = r.CheckBreak() + yyb1036 = r.CheckBreak() } - if yyb1003 { + if yyb1036 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1003-1, "") + z.DecStructFieldNotFound(yyj1036-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *HTTPHeader) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1039 := z.EncBinary() + _ = yym1039 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1040 := !z.EncBinary() + yy2arr1040 := z.EncBasicHandle().StructToArray + var yyq1040 [2]bool + _, _, _ = yysep1040, yyq1040, yy2arr1040 + const yyr1040 bool = false + var yynn1040 int + if yyr1040 || yy2arr1040 { + r.EncodeArrayStart(2) + } else { + yynn1040 = 2 + for _, b := range yyq1040 { + if b { + yynn1040++ + } + } + r.EncodeMapStart(yynn1040) + yynn1040 = 0 + } + if yyr1040 || yy2arr1040 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1042 := z.EncBinary() + _ = yym1042 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("name")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1043 := z.EncBinary() + _ = yym1043 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Name)) + } + } + if yyr1040 || yy2arr1040 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1045 := z.EncBinary() + _ = yym1045 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Value)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("value")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1046 := z.EncBinary() + _ = yym1046 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Value)) + } + } + if yyr1040 || yy2arr1040 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HTTPHeader) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1047 := z.DecBinary() + _ = yym1047 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1048 := r.ContainerType() + if yyct1048 == codecSelferValueTypeMap1234 { + yyl1048 := r.ReadMapStart() + if yyl1048 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1048, d) + } + } else if yyct1048 == codecSelferValueTypeArray1234 { + yyl1048 := r.ReadArrayStart() + if yyl1048 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1048, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HTTPHeader) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1049Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1049Slc + var yyhl1049 bool = l >= 0 + for yyj1049 := 0; ; yyj1049++ { + if yyhl1049 { + if yyj1049 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1049Slc = r.DecodeBytes(yys1049Slc, true, true) + yys1049 := string(yys1049Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1049 { + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + case "value": + if r.TryDecodeAsNil() { + x.Value = "" + } else { + x.Value = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1049) + } // end switch yys1049 + } // end for yyj1049 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HTTPHeader) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1052 int + var yyb1052 bool + var yyhl1052 bool = l >= 0 + yyj1052++ + if yyhl1052 { + yyb1052 = yyj1052 > l + } else { + yyb1052 = r.CheckBreak() + } + if yyb1052 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + yyj1052++ + if yyhl1052 { + yyb1052 = yyj1052 > l + } else { + yyb1052 = r.CheckBreak() + } + if yyb1052 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Value = "" + } else { + x.Value = string(r.DecodeString()) + } + for { + yyj1052++ + if yyhl1052 { + yyb1052 = yyj1052 > l + } else { + yyb1052 = r.CheckBreak() + } + if yyb1052 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1052-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14121,37 +14867,38 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1006 := z.EncBinary() - _ = yym1006 + yym1055 := z.EncBinary() + _ = yym1055 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1007 := !z.EncBinary() - yy2arr1007 := z.EncBasicHandle().StructToArray - var yyq1007 [4]bool - _, _, _ = yysep1007, yyq1007, yy2arr1007 - const yyr1007 bool = false - yyq1007[0] = x.Path != "" - yyq1007[2] = x.Host != "" - yyq1007[3] = x.Scheme != "" - var yynn1007 int - if yyr1007 || yy2arr1007 { - r.EncodeArrayStart(4) + yysep1056 := !z.EncBinary() + yy2arr1056 := z.EncBasicHandle().StructToArray + var yyq1056 [5]bool + _, _, _ = yysep1056, yyq1056, yy2arr1056 + const yyr1056 bool = false + yyq1056[0] = x.Path != "" + yyq1056[2] = x.Host != "" + yyq1056[3] = x.Scheme != "" + yyq1056[4] = len(x.HTTPHeaders) != 0 + var yynn1056 int + if yyr1056 || yy2arr1056 { + r.EncodeArrayStart(5) } else { - yynn1007 = 1 - for _, b := range yyq1007 { + yynn1056 = 1 + for _, b := range yyq1056 { if b { - yynn1007++ + yynn1056++ } } - r.EncodeMapStart(yynn1007) - yynn1007 = 0 + r.EncodeMapStart(yynn1056) + yynn1056 = 0 } - if yyr1007 || yy2arr1007 { + if yyr1056 || yy2arr1056 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1007[0] { - yym1009 := z.EncBinary() - _ = yym1009 + if yyq1056[0] { + yym1058 := z.EncBinary() + _ = yym1058 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -14160,50 +14907,50 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1007[0] { + if yyq1056[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1010 := z.EncBinary() - _ = yym1010 + yym1059 := z.EncBinary() + _ = yym1059 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } } - if yyr1007 || yy2arr1007 { + if yyr1056 || yy2arr1056 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1012 := &x.Port - yym1013 := z.EncBinary() - _ = yym1013 + yy1061 := &x.Port + yym1062 := z.EncBinary() + _ = yym1062 if false { - } else if z.HasExtensions() && z.EncExt(yy1012) { - } else if !yym1013 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1012) + } else if z.HasExtensions() && z.EncExt(yy1061) { + } else if !yym1062 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1061) } else { - z.EncFallback(yy1012) + z.EncFallback(yy1061) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1014 := &x.Port - yym1015 := z.EncBinary() - _ = yym1015 + yy1063 := &x.Port + yym1064 := z.EncBinary() + _ = yym1064 if false { - } else if z.HasExtensions() && z.EncExt(yy1014) { - } else if !yym1015 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1014) + } else if z.HasExtensions() && z.EncExt(yy1063) { + } else if !yym1064 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1063) } else { - z.EncFallback(yy1014) + z.EncFallback(yy1063) } } - if yyr1007 || yy2arr1007 { + if yyr1056 || yy2arr1056 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1007[2] { - yym1017 := z.EncBinary() - _ = yym1017 + if yyq1056[2] { + yym1066 := z.EncBinary() + _ = yym1066 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) @@ -14212,34 +14959,67 @@ func (x *HTTPGetAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1007[2] { + if yyq1056[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("host")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1018 := z.EncBinary() - _ = yym1018 + yym1067 := z.EncBinary() + _ = yym1067 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) } } } - if yyr1007 || yy2arr1007 { + if yyr1056 || yy2arr1056 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1007[3] { + if yyq1056[3] { x.Scheme.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1007[3] { + if yyq1056[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("scheme")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Scheme.CodecEncodeSelf(e) } } - if yyr1007 || yy2arr1007 { + if yyr1056 || yy2arr1056 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1056[4] { + if x.HTTPHeaders == nil { + r.EncodeNil() + } else { + yym1070 := z.EncBinary() + _ = yym1070 + if false { + } else { + h.encSliceHTTPHeader(([]HTTPHeader)(x.HTTPHeaders), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1056[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("httpHeaders")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.HTTPHeaders == nil { + r.EncodeNil() + } else { + yym1071 := z.EncBinary() + _ = yym1071 + if false { + } else { + h.encSliceHTTPHeader(([]HTTPHeader)(x.HTTPHeaders), e) + } + } + } + } + if yyr1056 || yy2arr1056 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14252,25 +15032,25 @@ func (x *HTTPGetAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1020 := z.DecBinary() - _ = yym1020 + yym1072 := z.DecBinary() + _ = yym1072 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1021 := r.ContainerType() - if yyct1021 == codecSelferValueTypeMap1234 { - yyl1021 := r.ReadMapStart() - if yyl1021 == 0 { + yyct1073 := r.ContainerType() + if yyct1073 == codecSelferValueTypeMap1234 { + yyl1073 := r.ReadMapStart() + if yyl1073 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1021, d) + x.codecDecodeSelfFromMap(yyl1073, d) } - } else if yyct1021 == codecSelferValueTypeArray1234 { - yyl1021 := r.ReadArrayStart() - if yyl1021 == 0 { + } else if yyct1073 == codecSelferValueTypeArray1234 { + yyl1073 := r.ReadArrayStart() + if yyl1073 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1021, d) + x.codecDecodeSelfFromArray(yyl1073, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14282,12 +15062,12 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1022Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1022Slc - var yyhl1022 bool = l >= 0 - for yyj1022 := 0; ; yyj1022++ { - if yyhl1022 { - if yyj1022 >= l { + var yys1074Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1074Slc + var yyhl1074 bool = l >= 0 + for yyj1074 := 0; ; yyj1074++ { + if yyhl1074 { + if yyj1074 >= l { break } } else { @@ -14296,10 +15076,10 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1022Slc = r.DecodeBytes(yys1022Slc, true, true) - yys1022 := string(yys1022Slc) + yys1074Slc = r.DecodeBytes(yys1074Slc, true, true) + yys1074 := string(yys1074Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1022 { + switch yys1074 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -14310,15 +15090,15 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1024 := &x.Port - yym1025 := z.DecBinary() - _ = yym1025 + yyv1076 := &x.Port + yym1077 := z.DecBinary() + _ = yym1077 if false { - } else if z.HasExtensions() && z.DecExt(yyv1024) { - } else if !yym1025 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1024) + } else if z.HasExtensions() && z.DecExt(yyv1076) { + } else if !yym1077 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1076) } else { - z.DecFallback(yyv1024, false) + z.DecFallback(yyv1076, false) } } case "host": @@ -14333,10 +15113,22 @@ func (x *HTTPGetAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Scheme = URIScheme(r.DecodeString()) } + case "httpHeaders": + if r.TryDecodeAsNil() { + x.HTTPHeaders = nil + } else { + yyv1080 := &x.HTTPHeaders + yym1081 := z.DecBinary() + _ = yym1081 + if false { + } else { + h.decSliceHTTPHeader((*[]HTTPHeader)(yyv1080), d) + } + } default: - z.DecStructFieldNotFound(-1, yys1022) - } // end switch yys1022 - } // end for yyj1022 + z.DecStructFieldNotFound(-1, yys1074) + } // end switch yys1074 + } // end for yyj1074 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14344,16 +15136,16 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1028 int - var yyb1028 bool - var yyhl1028 bool = l >= 0 - yyj1028++ - if yyhl1028 { - yyb1028 = yyj1028 > l + var yyj1082 int + var yyb1082 bool + var yyhl1082 bool = l >= 0 + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l } else { - yyb1028 = r.CheckBreak() + yyb1082 = r.CheckBreak() } - if yyb1028 { + if yyb1082 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14363,13 +15155,13 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Path = string(r.DecodeString()) } - yyj1028++ - if yyhl1028 { - yyb1028 = yyj1028 > l + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l } else { - yyb1028 = r.CheckBreak() + yyb1082 = r.CheckBreak() } - if yyb1028 { + if yyb1082 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14377,24 +15169,24 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1030 := &x.Port - yym1031 := z.DecBinary() - _ = yym1031 + yyv1084 := &x.Port + yym1085 := z.DecBinary() + _ = yym1085 if false { - } else if z.HasExtensions() && z.DecExt(yyv1030) { - } else if !yym1031 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1030) + } else if z.HasExtensions() && z.DecExt(yyv1084) { + } else if !yym1085 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1084) } else { - z.DecFallback(yyv1030, false) + z.DecFallback(yyv1084, false) } } - yyj1028++ - if yyhl1028 { - yyb1028 = yyj1028 > l + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l } else { - yyb1028 = r.CheckBreak() + yyb1082 = r.CheckBreak() } - if yyb1028 { + if yyb1082 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14404,13 +15196,13 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Host = string(r.DecodeString()) } - yyj1028++ - if yyhl1028 { - yyb1028 = yyj1028 > l + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l } else { - yyb1028 = r.CheckBreak() + yyb1082 = r.CheckBreak() } - if yyb1028 { + if yyb1082 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14420,18 +15212,40 @@ func (x *HTTPGetAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Scheme = URIScheme(r.DecodeString()) } - for { - yyj1028++ - if yyhl1028 { - yyb1028 = yyj1028 > l + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l + } else { + yyb1082 = r.CheckBreak() + } + if yyb1082 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HTTPHeaders = nil + } else { + yyv1088 := &x.HTTPHeaders + yym1089 := z.DecBinary() + _ = yym1089 + if false { } else { - yyb1028 = r.CheckBreak() + h.decSliceHTTPHeader((*[]HTTPHeader)(yyv1088), d) } - if yyb1028 { + } + for { + yyj1082++ + if yyhl1082 { + yyb1082 = yyj1082 > l + } else { + yyb1082 = r.CheckBreak() + } + if yyb1082 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1028-1, "") + z.DecStructFieldNotFound(yyj1082-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14440,8 +15254,8 @@ func (x URIScheme) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1034 := z.EncBinary() - _ = yym1034 + yym1090 := z.EncBinary() + _ = yym1090 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -14453,8 +15267,8 @@ func (x *URIScheme) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1035 := z.DecBinary() - _ = yym1035 + yym1091 := z.DecBinary() + _ = yym1091 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -14469,57 +15283,57 @@ func (x *TCPSocketAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1036 := z.EncBinary() - _ = yym1036 + yym1092 := z.EncBinary() + _ = yym1092 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1037 := !z.EncBinary() - yy2arr1037 := z.EncBasicHandle().StructToArray - var yyq1037 [1]bool - _, _, _ = yysep1037, yyq1037, yy2arr1037 - const yyr1037 bool = false - var yynn1037 int - if yyr1037 || yy2arr1037 { + yysep1093 := !z.EncBinary() + yy2arr1093 := z.EncBasicHandle().StructToArray + var yyq1093 [1]bool + _, _, _ = yysep1093, yyq1093, yy2arr1093 + const yyr1093 bool = false + var yynn1093 int + if yyr1093 || yy2arr1093 { r.EncodeArrayStart(1) } else { - yynn1037 = 1 - for _, b := range yyq1037 { + yynn1093 = 1 + for _, b := range yyq1093 { if b { - yynn1037++ + yynn1093++ } } - r.EncodeMapStart(yynn1037) - yynn1037 = 0 + r.EncodeMapStart(yynn1093) + yynn1093 = 0 } - if yyr1037 || yy2arr1037 { + if yyr1093 || yy2arr1093 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1039 := &x.Port - yym1040 := z.EncBinary() - _ = yym1040 + yy1095 := &x.Port + yym1096 := z.EncBinary() + _ = yym1096 if false { - } else if z.HasExtensions() && z.EncExt(yy1039) { - } else if !yym1040 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1039) + } else if z.HasExtensions() && z.EncExt(yy1095) { + } else if !yym1096 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1095) } else { - z.EncFallback(yy1039) + z.EncFallback(yy1095) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1041 := &x.Port - yym1042 := z.EncBinary() - _ = yym1042 + yy1097 := &x.Port + yym1098 := z.EncBinary() + _ = yym1098 if false { - } else if z.HasExtensions() && z.EncExt(yy1041) { - } else if !yym1042 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1041) + } else if z.HasExtensions() && z.EncExt(yy1097) { + } else if !yym1098 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1097) } else { - z.EncFallback(yy1041) + z.EncFallback(yy1097) } } - if yyr1037 || yy2arr1037 { + if yyr1093 || yy2arr1093 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14532,25 +15346,25 @@ func (x *TCPSocketAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1043 := z.DecBinary() - _ = yym1043 + yym1099 := z.DecBinary() + _ = yym1099 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1044 := r.ContainerType() - if yyct1044 == codecSelferValueTypeMap1234 { - yyl1044 := r.ReadMapStart() - if yyl1044 == 0 { + yyct1100 := r.ContainerType() + if yyct1100 == codecSelferValueTypeMap1234 { + yyl1100 := r.ReadMapStart() + if yyl1100 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1044, d) + x.codecDecodeSelfFromMap(yyl1100, d) } - } else if yyct1044 == codecSelferValueTypeArray1234 { - yyl1044 := r.ReadArrayStart() - if yyl1044 == 0 { + } else if yyct1100 == codecSelferValueTypeArray1234 { + yyl1100 := r.ReadArrayStart() + if yyl1100 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1044, d) + x.codecDecodeSelfFromArray(yyl1100, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14562,12 +15376,12 @@ func (x *TCPSocketAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1045Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1045Slc - var yyhl1045 bool = l >= 0 - for yyj1045 := 0; ; yyj1045++ { - if yyhl1045 { - if yyj1045 >= l { + var yys1101Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1101Slc + var yyhl1101 bool = l >= 0 + for yyj1101 := 0; ; yyj1101++ { + if yyhl1101 { + if yyj1101 >= l { break } } else { @@ -14576,29 +15390,29 @@ func (x *TCPSocketAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1045Slc = r.DecodeBytes(yys1045Slc, true, true) - yys1045 := string(yys1045Slc) + yys1101Slc = r.DecodeBytes(yys1101Slc, true, true) + yys1101 := string(yys1101Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1045 { + switch yys1101 { case "port": if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1046 := &x.Port - yym1047 := z.DecBinary() - _ = yym1047 + yyv1102 := &x.Port + yym1103 := z.DecBinary() + _ = yym1103 if false { - } else if z.HasExtensions() && z.DecExt(yyv1046) { - } else if !yym1047 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1046) + } else if z.HasExtensions() && z.DecExt(yyv1102) { + } else if !yym1103 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1102) } else { - z.DecFallback(yyv1046, false) + z.DecFallback(yyv1102, false) } } default: - z.DecStructFieldNotFound(-1, yys1045) - } // end switch yys1045 - } // end for yyj1045 + z.DecStructFieldNotFound(-1, yys1101) + } // end switch yys1101 + } // end for yyj1101 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14606,16 +15420,16 @@ func (x *TCPSocketAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1048 int - var yyb1048 bool - var yyhl1048 bool = l >= 0 - yyj1048++ - if yyhl1048 { - yyb1048 = yyj1048 > l + var yyj1104 int + var yyb1104 bool + var yyhl1104 bool = l >= 0 + yyj1104++ + if yyhl1104 { + yyb1104 = yyj1104 > l } else { - yyb1048 = r.CheckBreak() + yyb1104 = r.CheckBreak() } - if yyb1048 { + if yyb1104 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14623,29 +15437,29 @@ func (x *TCPSocketAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Port = pkg5_intstr.IntOrString{} } else { - yyv1049 := &x.Port - yym1050 := z.DecBinary() - _ = yym1050 + yyv1105 := &x.Port + yym1106 := z.DecBinary() + _ = yym1106 if false { - } else if z.HasExtensions() && z.DecExt(yyv1049) { - } else if !yym1050 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1049) + } else if z.HasExtensions() && z.DecExt(yyv1105) { + } else if !yym1106 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1105) } else { - z.DecFallback(yyv1049, false) + z.DecFallback(yyv1105, false) } } for { - yyj1048++ - if yyhl1048 { - yyb1048 = yyj1048 > l + yyj1104++ + if yyhl1104 { + yyb1104 = yyj1104 > l } else { - yyb1048 = r.CheckBreak() + yyb1104 = r.CheckBreak() } - if yyb1048 { + if yyb1104 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1048-1, "") + z.DecStructFieldNotFound(yyj1104-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14657,38 +15471,38 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1051 := z.EncBinary() - _ = yym1051 + yym1107 := z.EncBinary() + _ = yym1107 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1052 := !z.EncBinary() - yy2arr1052 := z.EncBasicHandle().StructToArray - var yyq1052 [1]bool - _, _, _ = yysep1052, yyq1052, yy2arr1052 - const yyr1052 bool = false - yyq1052[0] = len(x.Command) != 0 - var yynn1052 int - if yyr1052 || yy2arr1052 { + yysep1108 := !z.EncBinary() + yy2arr1108 := z.EncBasicHandle().StructToArray + var yyq1108 [1]bool + _, _, _ = yysep1108, yyq1108, yy2arr1108 + const yyr1108 bool = false + yyq1108[0] = len(x.Command) != 0 + var yynn1108 int + if yyr1108 || yy2arr1108 { r.EncodeArrayStart(1) } else { - yynn1052 = 0 - for _, b := range yyq1052 { + yynn1108 = 0 + for _, b := range yyq1108 { if b { - yynn1052++ + yynn1108++ } } - r.EncodeMapStart(yynn1052) - yynn1052 = 0 + r.EncodeMapStart(yynn1108) + yynn1108 = 0 } - if yyr1052 || yy2arr1052 { + if yyr1108 || yy2arr1108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1052[0] { + if yyq1108[0] { if x.Command == nil { r.EncodeNil() } else { - yym1054 := z.EncBinary() - _ = yym1054 + yym1110 := z.EncBinary() + _ = yym1110 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -14698,15 +15512,15 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1052[0] { + if yyq1108[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("command")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Command == nil { r.EncodeNil() } else { - yym1055 := z.EncBinary() - _ = yym1055 + yym1111 := z.EncBinary() + _ = yym1111 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -14714,7 +15528,7 @@ func (x *ExecAction) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1052 || yy2arr1052 { + if yyr1108 || yy2arr1108 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14727,25 +15541,25 @@ func (x *ExecAction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1056 := z.DecBinary() - _ = yym1056 + yym1112 := z.DecBinary() + _ = yym1112 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1057 := r.ContainerType() - if yyct1057 == codecSelferValueTypeMap1234 { - yyl1057 := r.ReadMapStart() - if yyl1057 == 0 { + yyct1113 := r.ContainerType() + if yyct1113 == codecSelferValueTypeMap1234 { + yyl1113 := r.ReadMapStart() + if yyl1113 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1057, d) + x.codecDecodeSelfFromMap(yyl1113, d) } - } else if yyct1057 == codecSelferValueTypeArray1234 { - yyl1057 := r.ReadArrayStart() - if yyl1057 == 0 { + } else if yyct1113 == codecSelferValueTypeArray1234 { + yyl1113 := r.ReadArrayStart() + if yyl1113 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1057, d) + x.codecDecodeSelfFromArray(yyl1113, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14757,12 +15571,12 @@ func (x *ExecAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1058Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1058Slc - var yyhl1058 bool = l >= 0 - for yyj1058 := 0; ; yyj1058++ { - if yyhl1058 { - if yyj1058 >= l { + var yys1114Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1114Slc + var yyhl1114 bool = l >= 0 + for yyj1114 := 0; ; yyj1114++ { + if yyhl1114 { + if yyj1114 >= l { break } } else { @@ -14771,26 +15585,26 @@ func (x *ExecAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1058Slc = r.DecodeBytes(yys1058Slc, true, true) - yys1058 := string(yys1058Slc) + yys1114Slc = r.DecodeBytes(yys1114Slc, true, true) + yys1114 := string(yys1114Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1058 { + switch yys1114 { case "command": if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1059 := &x.Command - yym1060 := z.DecBinary() - _ = yym1060 + yyv1115 := &x.Command + yym1116 := z.DecBinary() + _ = yym1116 if false { } else { - z.F.DecSliceStringX(yyv1059, false, d) + z.F.DecSliceStringX(yyv1115, false, d) } } default: - z.DecStructFieldNotFound(-1, yys1058) - } // end switch yys1058 - } // end for yyj1058 + z.DecStructFieldNotFound(-1, yys1114) + } // end switch yys1114 + } // end for yyj1114 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14798,16 +15612,16 @@ func (x *ExecAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1061 int - var yyb1061 bool - var yyhl1061 bool = l >= 0 - yyj1061++ - if yyhl1061 { - yyb1061 = yyj1061 > l + var yyj1117 int + var yyb1117 bool + var yyhl1117 bool = l >= 0 + yyj1117++ + if yyhl1117 { + yyb1117 = yyj1117 > l } else { - yyb1061 = r.CheckBreak() + yyb1117 = r.CheckBreak() } - if yyb1061 { + if yyb1117 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14815,26 +15629,26 @@ func (x *ExecAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1062 := &x.Command - yym1063 := z.DecBinary() - _ = yym1063 + yyv1118 := &x.Command + yym1119 := z.DecBinary() + _ = yym1119 if false { } else { - z.F.DecSliceStringX(yyv1062, false, d) + z.F.DecSliceStringX(yyv1118, false, d) } } for { - yyj1061++ - if yyhl1061 { - yyb1061 = yyj1061 > l + yyj1117++ + if yyhl1117 { + yyb1117 = yyj1117 > l } else { - yyb1061 = r.CheckBreak() + yyb1117 = r.CheckBreak() } - if yyb1061 { + if yyb1117 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1061-1, "") + z.DecStructFieldNotFound(yyj1117-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14846,153 +15660,42 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1064 := z.EncBinary() - _ = yym1064 + yym1120 := z.EncBinary() + _ = yym1120 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1065 := !z.EncBinary() - yy2arr1065 := z.EncBasicHandle().StructToArray - var yyq1065 [8]bool - _, _, _ = yysep1065, yyq1065, yy2arr1065 - const yyr1065 bool = false - yyq1065[0] = x.Handler.Exec != nil && x.Exec != nil - yyq1065[1] = x.Handler.HTTPGet != nil && x.HTTPGet != nil - yyq1065[2] = x.Handler.TCPSocket != nil && x.TCPSocket != nil - yyq1065[3] = x.InitialDelaySeconds != 0 - yyq1065[4] = x.TimeoutSeconds != 0 - yyq1065[5] = x.PeriodSeconds != 0 - yyq1065[6] = x.SuccessThreshold != 0 - yyq1065[7] = x.FailureThreshold != 0 - var yynn1065 int - if yyr1065 || yy2arr1065 { + yysep1121 := !z.EncBinary() + yy2arr1121 := z.EncBasicHandle().StructToArray + var yyq1121 [8]bool + _, _, _ = yysep1121, yyq1121, yy2arr1121 + const yyr1121 bool = false + yyq1121[0] = x.InitialDelaySeconds != 0 + yyq1121[1] = x.TimeoutSeconds != 0 + yyq1121[2] = x.PeriodSeconds != 0 + yyq1121[3] = x.SuccessThreshold != 0 + yyq1121[4] = x.FailureThreshold != 0 + yyq1121[5] = x.Handler.Exec != nil && x.Exec != nil + yyq1121[6] = x.Handler.HTTPGet != nil && x.HTTPGet != nil + yyq1121[7] = x.Handler.TCPSocket != nil && x.TCPSocket != nil + var yynn1121 int + if yyr1121 || yy2arr1121 { r.EncodeArrayStart(8) } else { - yynn1065 = 0 - for _, b := range yyq1065 { + yynn1121 = 0 + for _, b := range yyq1121 { if b { - yynn1065++ + yynn1121++ } } - r.EncodeMapStart(yynn1065) - yynn1065 = 0 + r.EncodeMapStart(yynn1121) + yynn1121 = 0 } - var yyn1066 bool - if x.Handler.Exec == nil { - yyn1066 = true - goto LABEL1066 - } - LABEL1066: - if yyr1065 || yy2arr1065 { - if yyn1066 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[0] { - if x.Exec == nil { - r.EncodeNil() - } else { - x.Exec.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1065[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("exec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1066 { - r.EncodeNil() - } else { - if x.Exec == nil { - r.EncodeNil() - } else { - x.Exec.CodecEncodeSelf(e) - } - } - } - } - var yyn1067 bool - if x.Handler.HTTPGet == nil { - yyn1067 = true - goto LABEL1067 - } - LABEL1067: - if yyr1065 || yy2arr1065 { - if yyn1067 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[1] { - if x.HTTPGet == nil { - r.EncodeNil() - } else { - x.HTTPGet.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1065[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("httpGet")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1067 { - r.EncodeNil() - } else { - if x.HTTPGet == nil { - r.EncodeNil() - } else { - x.HTTPGet.CodecEncodeSelf(e) - } - } - } - } - var yyn1068 bool - if x.Handler.TCPSocket == nil { - yyn1068 = true - goto LABEL1068 - } - LABEL1068: - if yyr1065 || yy2arr1065 { - if yyn1068 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[2] { - if x.TCPSocket == nil { - r.EncodeNil() - } else { - x.TCPSocket.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1065[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1068 { - r.EncodeNil() - } else { - if x.TCPSocket == nil { - r.EncodeNil() - } else { - x.TCPSocket.CodecEncodeSelf(e) - } - } - } - } - if yyr1065 || yy2arr1065 { + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[3] { - yym1070 := z.EncBinary() - _ = yym1070 + if yyq1121[0] { + yym1123 := z.EncBinary() + _ = yym1123 if false { } else { r.EncodeInt(int64(x.InitialDelaySeconds)) @@ -15001,23 +15704,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1065[3] { + if yyq1121[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("initialDelaySeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1071 := z.EncBinary() - _ = yym1071 + yym1124 := z.EncBinary() + _ = yym1124 if false { } else { r.EncodeInt(int64(x.InitialDelaySeconds)) } } } - if yyr1065 || yy2arr1065 { + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[4] { - yym1073 := z.EncBinary() - _ = yym1073 + if yyq1121[1] { + yym1126 := z.EncBinary() + _ = yym1126 if false { } else { r.EncodeInt(int64(x.TimeoutSeconds)) @@ -15026,23 +15729,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1065[4] { + if yyq1121[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1074 := z.EncBinary() - _ = yym1074 + yym1127 := z.EncBinary() + _ = yym1127 if false { } else { r.EncodeInt(int64(x.TimeoutSeconds)) } } } - if yyr1065 || yy2arr1065 { + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[5] { - yym1076 := z.EncBinary() - _ = yym1076 + if yyq1121[2] { + yym1129 := z.EncBinary() + _ = yym1129 if false { } else { r.EncodeInt(int64(x.PeriodSeconds)) @@ -15051,23 +15754,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1065[5] { + if yyq1121[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("periodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1077 := z.EncBinary() - _ = yym1077 + yym1130 := z.EncBinary() + _ = yym1130 if false { } else { r.EncodeInt(int64(x.PeriodSeconds)) } } } - if yyr1065 || yy2arr1065 { + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[6] { - yym1079 := z.EncBinary() - _ = yym1079 + if yyq1121[3] { + yym1132 := z.EncBinary() + _ = yym1132 if false { } else { r.EncodeInt(int64(x.SuccessThreshold)) @@ -15076,23 +15779,23 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1065[6] { + if yyq1121[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("successThreshold")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1080 := z.EncBinary() - _ = yym1080 + yym1133 := z.EncBinary() + _ = yym1133 if false { } else { r.EncodeInt(int64(x.SuccessThreshold)) } } } - if yyr1065 || yy2arr1065 { + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1065[7] { - yym1082 := z.EncBinary() - _ = yym1082 + if yyq1121[4] { + yym1135 := z.EncBinary() + _ = yym1135 if false { } else { r.EncodeInt(int64(x.FailureThreshold)) @@ -15101,19 +15804,130 @@ func (x *Probe) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1065[7] { + if yyq1121[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("failureThreshold")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1083 := z.EncBinary() - _ = yym1083 + yym1136 := z.EncBinary() + _ = yym1136 if false { } else { r.EncodeInt(int64(x.FailureThreshold)) } } } - if yyr1065 || yy2arr1065 { + var yyn1137 bool + if x.Handler.Exec == nil { + yyn1137 = true + goto LABEL1137 + } + LABEL1137: + if yyr1121 || yy2arr1121 { + if yyn1137 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1121[5] { + if x.Exec == nil { + r.EncodeNil() + } else { + x.Exec.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1121[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("exec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1137 { + r.EncodeNil() + } else { + if x.Exec == nil { + r.EncodeNil() + } else { + x.Exec.CodecEncodeSelf(e) + } + } + } + } + var yyn1138 bool + if x.Handler.HTTPGet == nil { + yyn1138 = true + goto LABEL1138 + } + LABEL1138: + if yyr1121 || yy2arr1121 { + if yyn1138 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1121[6] { + if x.HTTPGet == nil { + r.EncodeNil() + } else { + x.HTTPGet.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1121[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("httpGet")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1138 { + r.EncodeNil() + } else { + if x.HTTPGet == nil { + r.EncodeNil() + } else { + x.HTTPGet.CodecEncodeSelf(e) + } + } + } + } + var yyn1139 bool + if x.Handler.TCPSocket == nil { + yyn1139 = true + goto LABEL1139 + } + LABEL1139: + if yyr1121 || yy2arr1121 { + if yyn1139 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1121[7] { + if x.TCPSocket == nil { + r.EncodeNil() + } else { + x.TCPSocket.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1121[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1139 { + r.EncodeNil() + } else { + if x.TCPSocket == nil { + r.EncodeNil() + } else { + x.TCPSocket.CodecEncodeSelf(e) + } + } + } + } + if yyr1121 || yy2arr1121 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15126,25 +15940,25 @@ func (x *Probe) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1084 := z.DecBinary() - _ = yym1084 + yym1140 := z.DecBinary() + _ = yym1140 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1085 := r.ContainerType() - if yyct1085 == codecSelferValueTypeMap1234 { - yyl1085 := r.ReadMapStart() - if yyl1085 == 0 { + yyct1141 := r.ContainerType() + if yyct1141 == codecSelferValueTypeMap1234 { + yyl1141 := r.ReadMapStart() + if yyl1141 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1085, d) + x.codecDecodeSelfFromMap(yyl1141, d) } - } else if yyct1085 == codecSelferValueTypeArray1234 { - yyl1085 := r.ReadArrayStart() - if yyl1085 == 0 { + } else if yyct1141 == codecSelferValueTypeArray1234 { + yyl1141 := r.ReadArrayStart() + if yyl1141 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1085, d) + x.codecDecodeSelfFromArray(yyl1141, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15156,12 +15970,12 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1086Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1086Slc - var yyhl1086 bool = l >= 0 - for yyj1086 := 0; ; yyj1086++ { - if yyhl1086 { - if yyj1086 >= l { + var yys1142Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1142Slc + var yyhl1142 bool = l >= 0 + for yyj1142 := 0; ; yyj1142++ { + if yyhl1142 { + if yyj1142 >= l { break } } else { @@ -15170,10 +15984,40 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1086Slc = r.DecodeBytes(yys1086Slc, true, true) - yys1086 := string(yys1086Slc) + yys1142Slc = r.DecodeBytes(yys1142Slc, true, true) + yys1142 := string(yys1142Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1086 { + switch yys1142 { + case "initialDelaySeconds": + if r.TryDecodeAsNil() { + x.InitialDelaySeconds = 0 + } else { + x.InitialDelaySeconds = int32(r.DecodeInt(32)) + } + case "timeoutSeconds": + if r.TryDecodeAsNil() { + x.TimeoutSeconds = 0 + } else { + x.TimeoutSeconds = int32(r.DecodeInt(32)) + } + case "periodSeconds": + if r.TryDecodeAsNil() { + x.PeriodSeconds = 0 + } else { + x.PeriodSeconds = int32(r.DecodeInt(32)) + } + case "successThreshold": + if r.TryDecodeAsNil() { + x.SuccessThreshold = 0 + } else { + x.SuccessThreshold = int32(r.DecodeInt(32)) + } + case "failureThreshold": + if r.TryDecodeAsNil() { + x.FailureThreshold = 0 + } else { + x.FailureThreshold = int32(r.DecodeInt(32)) + } case "exec": if x.Handler.Exec == nil { x.Handler.Exec = new(ExecAction) @@ -15216,40 +16060,10 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.TCPSocket.CodecDecodeSelf(d) } - case "initialDelaySeconds": - if r.TryDecodeAsNil() { - x.InitialDelaySeconds = 0 - } else { - x.InitialDelaySeconds = int32(r.DecodeInt(32)) - } - case "timeoutSeconds": - if r.TryDecodeAsNil() { - x.TimeoutSeconds = 0 - } else { - x.TimeoutSeconds = int32(r.DecodeInt(32)) - } - case "periodSeconds": - if r.TryDecodeAsNil() { - x.PeriodSeconds = 0 - } else { - x.PeriodSeconds = int32(r.DecodeInt(32)) - } - case "successThreshold": - if r.TryDecodeAsNil() { - x.SuccessThreshold = 0 - } else { - x.SuccessThreshold = int32(r.DecodeInt(32)) - } - case "failureThreshold": - if r.TryDecodeAsNil() { - x.FailureThreshold = 0 - } else { - x.FailureThreshold = int32(r.DecodeInt(32)) - } default: - z.DecStructFieldNotFound(-1, yys1086) - } // end switch yys1086 - } // end for yyj1086 + z.DecStructFieldNotFound(-1, yys1142) + } // end switch yys1142 + } // end for yyj1142 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15257,19 +16071,99 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1095 int - var yyb1095 bool - var yyhl1095 bool = l >= 0 + var yyj1151 int + var yyb1151 bool + var yyhl1151 bool = l >= 0 + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l + } else { + yyb1151 = r.CheckBreak() + } + if yyb1151 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.InitialDelaySeconds = 0 + } else { + x.InitialDelaySeconds = int32(r.DecodeInt(32)) + } + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l + } else { + yyb1151 = r.CheckBreak() + } + if yyb1151 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TimeoutSeconds = 0 + } else { + x.TimeoutSeconds = int32(r.DecodeInt(32)) + } + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l + } else { + yyb1151 = r.CheckBreak() + } + if yyb1151 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PeriodSeconds = 0 + } else { + x.PeriodSeconds = int32(r.DecodeInt(32)) + } + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l + } else { + yyb1151 = r.CheckBreak() + } + if yyb1151 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SuccessThreshold = 0 + } else { + x.SuccessThreshold = int32(r.DecodeInt(32)) + } + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l + } else { + yyb1151 = r.CheckBreak() + } + if yyb1151 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FailureThreshold = 0 + } else { + x.FailureThreshold = int32(r.DecodeInt(32)) + } if x.Handler.Exec == nil { x.Handler.Exec = new(ExecAction) } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l } else { - yyb1095 = r.CheckBreak() + yyb1151 = r.CheckBreak() } - if yyb1095 { + if yyb1151 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15287,13 +16181,13 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Handler.HTTPGet == nil { x.Handler.HTTPGet = new(HTTPGetAction) } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l } else { - yyb1095 = r.CheckBreak() + yyb1151 = r.CheckBreak() } - if yyb1095 { + if yyb1151 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15311,13 +16205,13 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Handler.TCPSocket == nil { x.Handler.TCPSocket = new(TCPSocketAction) } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l } else { - yyb1095 = r.CheckBreak() + yyb1151 = r.CheckBreak() } - if yyb1095 { + if yyb1151 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15332,98 +16226,18 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.TCPSocket.CodecDecodeSelf(d) } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l - } else { - yyb1095 = r.CheckBreak() - } - if yyb1095 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.InitialDelaySeconds = 0 - } else { - x.InitialDelaySeconds = int32(r.DecodeInt(32)) - } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l - } else { - yyb1095 = r.CheckBreak() - } - if yyb1095 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TimeoutSeconds = 0 - } else { - x.TimeoutSeconds = int32(r.DecodeInt(32)) - } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l - } else { - yyb1095 = r.CheckBreak() - } - if yyb1095 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PeriodSeconds = 0 - } else { - x.PeriodSeconds = int32(r.DecodeInt(32)) - } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l - } else { - yyb1095 = r.CheckBreak() - } - if yyb1095 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.SuccessThreshold = 0 - } else { - x.SuccessThreshold = int32(r.DecodeInt(32)) - } - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l - } else { - yyb1095 = r.CheckBreak() - } - if yyb1095 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FailureThreshold = 0 - } else { - x.FailureThreshold = int32(r.DecodeInt(32)) - } for { - yyj1095++ - if yyhl1095 { - yyb1095 = yyj1095 > l + yyj1151++ + if yyhl1151 { + yyb1151 = yyj1151 > l } else { - yyb1095 = r.CheckBreak() + yyb1151 = r.CheckBreak() } - if yyb1095 { + if yyb1151 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1095-1, "") + z.DecStructFieldNotFound(yyj1151-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15432,8 +16246,8 @@ func (x PullPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1104 := z.EncBinary() - _ = yym1104 + yym1160 := z.EncBinary() + _ = yym1160 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -15445,8 +16259,8 @@ func (x *PullPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1105 := z.DecBinary() - _ = yym1105 + yym1161 := z.DecBinary() + _ = yym1161 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -15458,8 +16272,8 @@ func (x Capability) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1106 := z.EncBinary() - _ = yym1106 + yym1162 := z.EncBinary() + _ = yym1162 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -15471,8 +16285,8 @@ func (x *Capability) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1107 := z.DecBinary() - _ = yym1107 + yym1163 := z.DecBinary() + _ = yym1163 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -15487,39 +16301,39 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1108 := z.EncBinary() - _ = yym1108 + yym1164 := z.EncBinary() + _ = yym1164 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1109 := !z.EncBinary() - yy2arr1109 := z.EncBasicHandle().StructToArray - var yyq1109 [2]bool - _, _, _ = yysep1109, yyq1109, yy2arr1109 - const yyr1109 bool = false - yyq1109[0] = len(x.Add) != 0 - yyq1109[1] = len(x.Drop) != 0 - var yynn1109 int - if yyr1109 || yy2arr1109 { + yysep1165 := !z.EncBinary() + yy2arr1165 := z.EncBasicHandle().StructToArray + var yyq1165 [2]bool + _, _, _ = yysep1165, yyq1165, yy2arr1165 + const yyr1165 bool = false + yyq1165[0] = len(x.Add) != 0 + yyq1165[1] = len(x.Drop) != 0 + var yynn1165 int + if yyr1165 || yy2arr1165 { r.EncodeArrayStart(2) } else { - yynn1109 = 0 - for _, b := range yyq1109 { + yynn1165 = 0 + for _, b := range yyq1165 { if b { - yynn1109++ + yynn1165++ } } - r.EncodeMapStart(yynn1109) - yynn1109 = 0 + r.EncodeMapStart(yynn1165) + yynn1165 = 0 } - if yyr1109 || yy2arr1109 { + if yyr1165 || yy2arr1165 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1109[0] { + if yyq1165[0] { if x.Add == nil { r.EncodeNil() } else { - yym1111 := z.EncBinary() - _ = yym1111 + yym1167 := z.EncBinary() + _ = yym1167 if false { } else { h.encSliceCapability(([]Capability)(x.Add), e) @@ -15529,15 +16343,15 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1109[0] { + if yyq1165[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("add")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Add == nil { r.EncodeNil() } else { - yym1112 := z.EncBinary() - _ = yym1112 + yym1168 := z.EncBinary() + _ = yym1168 if false { } else { h.encSliceCapability(([]Capability)(x.Add), e) @@ -15545,14 +16359,14 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1109 || yy2arr1109 { + if yyr1165 || yy2arr1165 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1109[1] { + if yyq1165[1] { if x.Drop == nil { r.EncodeNil() } else { - yym1114 := z.EncBinary() - _ = yym1114 + yym1170 := z.EncBinary() + _ = yym1170 if false { } else { h.encSliceCapability(([]Capability)(x.Drop), e) @@ -15562,15 +16376,15 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1109[1] { + if yyq1165[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("drop")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Drop == nil { r.EncodeNil() } else { - yym1115 := z.EncBinary() - _ = yym1115 + yym1171 := z.EncBinary() + _ = yym1171 if false { } else { h.encSliceCapability(([]Capability)(x.Drop), e) @@ -15578,7 +16392,7 @@ func (x *Capabilities) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1109 || yy2arr1109 { + if yyr1165 || yy2arr1165 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15591,25 +16405,25 @@ func (x *Capabilities) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1116 := z.DecBinary() - _ = yym1116 + yym1172 := z.DecBinary() + _ = yym1172 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1117 := r.ContainerType() - if yyct1117 == codecSelferValueTypeMap1234 { - yyl1117 := r.ReadMapStart() - if yyl1117 == 0 { + yyct1173 := r.ContainerType() + if yyct1173 == codecSelferValueTypeMap1234 { + yyl1173 := r.ReadMapStart() + if yyl1173 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1117, d) + x.codecDecodeSelfFromMap(yyl1173, d) } - } else if yyct1117 == codecSelferValueTypeArray1234 { - yyl1117 := r.ReadArrayStart() - if yyl1117 == 0 { + } else if yyct1173 == codecSelferValueTypeArray1234 { + yyl1173 := r.ReadArrayStart() + if yyl1173 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1117, d) + x.codecDecodeSelfFromArray(yyl1173, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15621,12 +16435,12 @@ func (x *Capabilities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1118Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1118Slc - var yyhl1118 bool = l >= 0 - for yyj1118 := 0; ; yyj1118++ { - if yyhl1118 { - if yyj1118 >= l { + var yys1174Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1174Slc + var yyhl1174 bool = l >= 0 + for yyj1174 := 0; ; yyj1174++ { + if yyhl1174 { + if yyj1174 >= l { break } } else { @@ -15635,38 +16449,38 @@ func (x *Capabilities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1118Slc = r.DecodeBytes(yys1118Slc, true, true) - yys1118 := string(yys1118Slc) + yys1174Slc = r.DecodeBytes(yys1174Slc, true, true) + yys1174 := string(yys1174Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1118 { + switch yys1174 { case "add": if r.TryDecodeAsNil() { x.Add = nil } else { - yyv1119 := &x.Add - yym1120 := z.DecBinary() - _ = yym1120 + yyv1175 := &x.Add + yym1176 := z.DecBinary() + _ = yym1176 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1119), d) + h.decSliceCapability((*[]Capability)(yyv1175), d) } } case "drop": if r.TryDecodeAsNil() { x.Drop = nil } else { - yyv1121 := &x.Drop - yym1122 := z.DecBinary() - _ = yym1122 + yyv1177 := &x.Drop + yym1178 := z.DecBinary() + _ = yym1178 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1121), d) + h.decSliceCapability((*[]Capability)(yyv1177), d) } } default: - z.DecStructFieldNotFound(-1, yys1118) - } // end switch yys1118 - } // end for yyj1118 + z.DecStructFieldNotFound(-1, yys1174) + } // end switch yys1174 + } // end for yyj1174 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15674,16 +16488,16 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1123 int - var yyb1123 bool - var yyhl1123 bool = l >= 0 - yyj1123++ - if yyhl1123 { - yyb1123 = yyj1123 > l + var yyj1179 int + var yyb1179 bool + var yyhl1179 bool = l >= 0 + yyj1179++ + if yyhl1179 { + yyb1179 = yyj1179 > l } else { - yyb1123 = r.CheckBreak() + yyb1179 = r.CheckBreak() } - if yyb1123 { + if yyb1179 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15691,21 +16505,21 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Add = nil } else { - yyv1124 := &x.Add - yym1125 := z.DecBinary() - _ = yym1125 + yyv1180 := &x.Add + yym1181 := z.DecBinary() + _ = yym1181 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1124), d) + h.decSliceCapability((*[]Capability)(yyv1180), d) } } - yyj1123++ - if yyhl1123 { - yyb1123 = yyj1123 > l + yyj1179++ + if yyhl1179 { + yyb1179 = yyj1179 > l } else { - yyb1123 = r.CheckBreak() + yyb1179 = r.CheckBreak() } - if yyb1123 { + if yyb1179 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15713,26 +16527,26 @@ func (x *Capabilities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Drop = nil } else { - yyv1126 := &x.Drop - yym1127 := z.DecBinary() - _ = yym1127 + yyv1182 := &x.Drop + yym1183 := z.DecBinary() + _ = yym1183 if false { } else { - h.decSliceCapability((*[]Capability)(yyv1126), d) + h.decSliceCapability((*[]Capability)(yyv1182), d) } } for { - yyj1123++ - if yyhl1123 { - yyb1123 = yyj1123 > l + yyj1179++ + if yyhl1179 { + yyb1179 = yyj1179 > l } else { - yyb1123 = r.CheckBreak() + yyb1179 = r.CheckBreak() } - if yyb1123 { + if yyb1179 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1123-1, "") + z.DecStructFieldNotFound(yyj1179-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15744,34 +16558,34 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1128 := z.EncBinary() - _ = yym1128 + yym1184 := z.EncBinary() + _ = yym1184 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1129 := !z.EncBinary() - yy2arr1129 := z.EncBasicHandle().StructToArray - var yyq1129 [2]bool - _, _, _ = yysep1129, yyq1129, yy2arr1129 - const yyr1129 bool = false - yyq1129[0] = len(x.Limits) != 0 - yyq1129[1] = len(x.Requests) != 0 - var yynn1129 int - if yyr1129 || yy2arr1129 { + yysep1185 := !z.EncBinary() + yy2arr1185 := z.EncBasicHandle().StructToArray + var yyq1185 [2]bool + _, _, _ = yysep1185, yyq1185, yy2arr1185 + const yyr1185 bool = false + yyq1185[0] = len(x.Limits) != 0 + yyq1185[1] = len(x.Requests) != 0 + var yynn1185 int + if yyr1185 || yy2arr1185 { r.EncodeArrayStart(2) } else { - yynn1129 = 0 - for _, b := range yyq1129 { + yynn1185 = 0 + for _, b := range yyq1185 { if b { - yynn1129++ + yynn1185++ } } - r.EncodeMapStart(yynn1129) - yynn1129 = 0 + r.EncodeMapStart(yynn1185) + yynn1185 = 0 } - if yyr1129 || yy2arr1129 { + if yyr1185 || yy2arr1185 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1129[0] { + if yyq1185[0] { if x.Limits == nil { r.EncodeNil() } else { @@ -15781,7 +16595,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1129[0] { + if yyq1185[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("limits")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -15792,9 +16606,9 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1129 || yy2arr1129 { + if yyr1185 || yy2arr1185 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1129[1] { + if yyq1185[1] { if x.Requests == nil { r.EncodeNil() } else { @@ -15804,7 +16618,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1129[1] { + if yyq1185[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("requests")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -15815,7 +16629,7 @@ func (x *ResourceRequirements) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1129 || yy2arr1129 { + if yyr1185 || yy2arr1185 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15828,25 +16642,25 @@ func (x *ResourceRequirements) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1132 := z.DecBinary() - _ = yym1132 + yym1188 := z.DecBinary() + _ = yym1188 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1133 := r.ContainerType() - if yyct1133 == codecSelferValueTypeMap1234 { - yyl1133 := r.ReadMapStart() - if yyl1133 == 0 { + yyct1189 := r.ContainerType() + if yyct1189 == codecSelferValueTypeMap1234 { + yyl1189 := r.ReadMapStart() + if yyl1189 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1133, d) + x.codecDecodeSelfFromMap(yyl1189, d) } - } else if yyct1133 == codecSelferValueTypeArray1234 { - yyl1133 := r.ReadArrayStart() - if yyl1133 == 0 { + } else if yyct1189 == codecSelferValueTypeArray1234 { + yyl1189 := r.ReadArrayStart() + if yyl1189 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1133, d) + x.codecDecodeSelfFromArray(yyl1189, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15858,12 +16672,12 @@ func (x *ResourceRequirements) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1134Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1134Slc - var yyhl1134 bool = l >= 0 - for yyj1134 := 0; ; yyj1134++ { - if yyhl1134 { - if yyj1134 >= l { + var yys1190Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1190Slc + var yyhl1190 bool = l >= 0 + for yyj1190 := 0; ; yyj1190++ { + if yyhl1190 { + if yyj1190 >= l { break } } else { @@ -15872,28 +16686,28 @@ func (x *ResourceRequirements) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1134Slc = r.DecodeBytes(yys1134Slc, true, true) - yys1134 := string(yys1134Slc) + yys1190Slc = r.DecodeBytes(yys1190Slc, true, true) + yys1190 := string(yys1190Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1134 { + switch yys1190 { case "limits": if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv1135 := &x.Limits - yyv1135.CodecDecodeSelf(d) + yyv1191 := &x.Limits + yyv1191.CodecDecodeSelf(d) } case "requests": if r.TryDecodeAsNil() { x.Requests = nil } else { - yyv1136 := &x.Requests - yyv1136.CodecDecodeSelf(d) + yyv1192 := &x.Requests + yyv1192.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1134) - } // end switch yys1134 - } // end for yyj1134 + z.DecStructFieldNotFound(-1, yys1190) + } // end switch yys1190 + } // end for yyj1190 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15901,16 +16715,16 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1137 int - var yyb1137 bool - var yyhl1137 bool = l >= 0 - yyj1137++ - if yyhl1137 { - yyb1137 = yyj1137 > l + var yyj1193 int + var yyb1193 bool + var yyhl1193 bool = l >= 0 + yyj1193++ + if yyhl1193 { + yyb1193 = yyj1193 > l } else { - yyb1137 = r.CheckBreak() + yyb1193 = r.CheckBreak() } - if yyb1137 { + if yyb1193 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15918,16 +16732,16 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv1138 := &x.Limits - yyv1138.CodecDecodeSelf(d) + yyv1194 := &x.Limits + yyv1194.CodecDecodeSelf(d) } - yyj1137++ - if yyhl1137 { - yyb1137 = yyj1137 > l + yyj1193++ + if yyhl1193 { + yyb1193 = yyj1193 > l } else { - yyb1137 = r.CheckBreak() + yyb1193 = r.CheckBreak() } - if yyb1137 { + if yyb1193 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15935,21 +16749,21 @@ func (x *ResourceRequirements) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.Requests = nil } else { - yyv1139 := &x.Requests - yyv1139.CodecDecodeSelf(d) + yyv1195 := &x.Requests + yyv1195.CodecDecodeSelf(d) } for { - yyj1137++ - if yyhl1137 { - yyb1137 = yyj1137 > l + yyj1193++ + if yyhl1193 { + yyb1193 = yyj1193 > l } else { - yyb1137 = r.CheckBreak() + yyb1193 = r.CheckBreak() } - if yyb1137 { + if yyb1193 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1137-1, "") + z.DecStructFieldNotFound(yyj1193-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15961,50 +16775,50 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1140 := z.EncBinary() - _ = yym1140 + yym1196 := z.EncBinary() + _ = yym1196 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1141 := !z.EncBinary() - yy2arr1141 := z.EncBasicHandle().StructToArray - var yyq1141 [18]bool - _, _, _ = yysep1141, yyq1141, yy2arr1141 - const yyr1141 bool = false - yyq1141[1] = x.Image != "" - yyq1141[2] = len(x.Command) != 0 - yyq1141[3] = len(x.Args) != 0 - yyq1141[4] = x.WorkingDir != "" - yyq1141[5] = len(x.Ports) != 0 - yyq1141[6] = len(x.Env) != 0 - yyq1141[7] = true - yyq1141[8] = len(x.VolumeMounts) != 0 - yyq1141[9] = x.LivenessProbe != nil - yyq1141[10] = x.ReadinessProbe != nil - yyq1141[11] = x.Lifecycle != nil - yyq1141[12] = x.TerminationMessagePath != "" - yyq1141[13] = x.ImagePullPolicy != "" - yyq1141[14] = x.SecurityContext != nil - yyq1141[15] = x.Stdin != false - yyq1141[16] = x.StdinOnce != false - yyq1141[17] = x.TTY != false - var yynn1141 int - if yyr1141 || yy2arr1141 { + yysep1197 := !z.EncBinary() + yy2arr1197 := z.EncBasicHandle().StructToArray + var yyq1197 [18]bool + _, _, _ = yysep1197, yyq1197, yy2arr1197 + const yyr1197 bool = false + yyq1197[1] = x.Image != "" + yyq1197[2] = len(x.Command) != 0 + yyq1197[3] = len(x.Args) != 0 + yyq1197[4] = x.WorkingDir != "" + yyq1197[5] = len(x.Ports) != 0 + yyq1197[6] = len(x.Env) != 0 + yyq1197[7] = true + yyq1197[8] = len(x.VolumeMounts) != 0 + yyq1197[9] = x.LivenessProbe != nil + yyq1197[10] = x.ReadinessProbe != nil + yyq1197[11] = x.Lifecycle != nil + yyq1197[12] = x.TerminationMessagePath != "" + yyq1197[13] = x.ImagePullPolicy != "" + yyq1197[14] = x.SecurityContext != nil + yyq1197[15] = x.Stdin != false + yyq1197[16] = x.StdinOnce != false + yyq1197[17] = x.TTY != false + var yynn1197 int + if yyr1197 || yy2arr1197 { r.EncodeArrayStart(18) } else { - yynn1141 = 1 - for _, b := range yyq1141 { + yynn1197 = 1 + for _, b := range yyq1197 { if b { - yynn1141++ + yynn1197++ } } - r.EncodeMapStart(yynn1141) - yynn1141 = 0 + r.EncodeMapStart(yynn1197) + yynn1197 = 0 } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1143 := z.EncBinary() - _ = yym1143 + yym1199 := z.EncBinary() + _ = yym1199 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -16013,18 +16827,18 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1144 := z.EncBinary() - _ = yym1144 + yym1200 := z.EncBinary() + _ = yym1200 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[1] { - yym1146 := z.EncBinary() - _ = yym1146 + if yyq1197[1] { + yym1202 := z.EncBinary() + _ = yym1202 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) @@ -16033,26 +16847,26 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1141[1] { + if yyq1197[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1147 := z.EncBinary() - _ = yym1147 + yym1203 := z.EncBinary() + _ = yym1203 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[2] { + if yyq1197[2] { if x.Command == nil { r.EncodeNil() } else { - yym1149 := z.EncBinary() - _ = yym1149 + yym1205 := z.EncBinary() + _ = yym1205 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -16062,15 +16876,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[2] { + if yyq1197[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("command")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Command == nil { r.EncodeNil() } else { - yym1150 := z.EncBinary() - _ = yym1150 + yym1206 := z.EncBinary() + _ = yym1206 if false { } else { z.F.EncSliceStringV(x.Command, false, e) @@ -16078,14 +16892,14 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[3] { + if yyq1197[3] { if x.Args == nil { r.EncodeNil() } else { - yym1152 := z.EncBinary() - _ = yym1152 + yym1208 := z.EncBinary() + _ = yym1208 if false { } else { z.F.EncSliceStringV(x.Args, false, e) @@ -16095,15 +16909,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[3] { + if yyq1197[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("args")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Args == nil { r.EncodeNil() } else { - yym1153 := z.EncBinary() - _ = yym1153 + yym1209 := z.EncBinary() + _ = yym1209 if false { } else { z.F.EncSliceStringV(x.Args, false, e) @@ -16111,11 +16925,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[4] { - yym1155 := z.EncBinary() - _ = yym1155 + if yyq1197[4] { + yym1211 := z.EncBinary() + _ = yym1211 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.WorkingDir)) @@ -16124,26 +16938,26 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1141[4] { + if yyq1197[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("workingDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1156 := z.EncBinary() - _ = yym1156 + yym1212 := z.EncBinary() + _ = yym1212 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.WorkingDir)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[5] { + if yyq1197[5] { if x.Ports == nil { r.EncodeNil() } else { - yym1158 := z.EncBinary() - _ = yym1158 + yym1214 := z.EncBinary() + _ = yym1214 if false { } else { h.encSliceContainerPort(([]ContainerPort)(x.Ports), e) @@ -16153,15 +16967,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[5] { + if yyq1197[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ports")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Ports == nil { r.EncodeNil() } else { - yym1159 := z.EncBinary() - _ = yym1159 + yym1215 := z.EncBinary() + _ = yym1215 if false { } else { h.encSliceContainerPort(([]ContainerPort)(x.Ports), e) @@ -16169,14 +16983,14 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[6] { + if yyq1197[6] { if x.Env == nil { r.EncodeNil() } else { - yym1161 := z.EncBinary() - _ = yym1161 + yym1217 := z.EncBinary() + _ = yym1217 if false { } else { h.encSliceEnvVar(([]EnvVar)(x.Env), e) @@ -16186,15 +17000,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[6] { + if yyq1197[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("env")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Env == nil { r.EncodeNil() } else { - yym1162 := z.EncBinary() - _ = yym1162 + yym1218 := z.EncBinary() + _ = yym1218 if false { } else { h.encSliceEnvVar(([]EnvVar)(x.Env), e) @@ -16202,31 +17016,31 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[7] { - yy1164 := &x.Resources - yy1164.CodecEncodeSelf(e) + if yyq1197[7] { + yy1220 := &x.Resources + yy1220.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1141[7] { + if yyq1197[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1165 := &x.Resources - yy1165.CodecEncodeSelf(e) + yy1221 := &x.Resources + yy1221.CodecEncodeSelf(e) } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[8] { + if yyq1197[8] { if x.VolumeMounts == nil { r.EncodeNil() } else { - yym1167 := z.EncBinary() - _ = yym1167 + yym1223 := z.EncBinary() + _ = yym1223 if false { } else { h.encSliceVolumeMount(([]VolumeMount)(x.VolumeMounts), e) @@ -16236,15 +17050,15 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[8] { + if yyq1197[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumeMounts")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.VolumeMounts == nil { r.EncodeNil() } else { - yym1168 := z.EncBinary() - _ = yym1168 + yym1224 := z.EncBinary() + _ = yym1224 if false { } else { h.encSliceVolumeMount(([]VolumeMount)(x.VolumeMounts), e) @@ -16252,9 +17066,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[9] { + if yyq1197[9] { if x.LivenessProbe == nil { r.EncodeNil() } else { @@ -16264,7 +17078,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[9] { + if yyq1197[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("livenessProbe")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16275,9 +17089,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[10] { + if yyq1197[10] { if x.ReadinessProbe == nil { r.EncodeNil() } else { @@ -16287,7 +17101,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[10] { + if yyq1197[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readinessProbe")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16298,9 +17112,9 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[11] { + if yyq1197[11] { if x.Lifecycle == nil { r.EncodeNil() } else { @@ -16310,7 +17124,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[11] { + if yyq1197[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lifecycle")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16321,11 +17135,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[12] { - yym1173 := z.EncBinary() - _ = yym1173 + if yyq1197[12] { + yym1229 := z.EncBinary() + _ = yym1229 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TerminationMessagePath)) @@ -16334,36 +17148,36 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1141[12] { + if yyq1197[12] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminationMessagePath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1174 := z.EncBinary() - _ = yym1174 + yym1230 := z.EncBinary() + _ = yym1230 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TerminationMessagePath)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[13] { + if yyq1197[13] { x.ImagePullPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1141[13] { + if yyq1197[13] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imagePullPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.ImagePullPolicy.CodecEncodeSelf(e) } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[14] { + if yyq1197[14] { if x.SecurityContext == nil { r.EncodeNil() } else { @@ -16373,7 +17187,7 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1141[14] { + if yyq1197[14] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("securityContext")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16384,11 +17198,11 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[15] { - yym1178 := z.EncBinary() - _ = yym1178 + if yyq1197[15] { + yym1234 := z.EncBinary() + _ = yym1234 if false { } else { r.EncodeBool(bool(x.Stdin)) @@ -16397,23 +17211,23 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1141[15] { + if yyq1197[15] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("stdin")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1179 := z.EncBinary() - _ = yym1179 + yym1235 := z.EncBinary() + _ = yym1235 if false { } else { r.EncodeBool(bool(x.Stdin)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[16] { - yym1181 := z.EncBinary() - _ = yym1181 + if yyq1197[16] { + yym1237 := z.EncBinary() + _ = yym1237 if false { } else { r.EncodeBool(bool(x.StdinOnce)) @@ -16422,23 +17236,23 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1141[16] { + if yyq1197[16] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("stdinOnce")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1182 := z.EncBinary() - _ = yym1182 + yym1238 := z.EncBinary() + _ = yym1238 if false { } else { r.EncodeBool(bool(x.StdinOnce)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1141[17] { - yym1184 := z.EncBinary() - _ = yym1184 + if yyq1197[17] { + yym1240 := z.EncBinary() + _ = yym1240 if false { } else { r.EncodeBool(bool(x.TTY)) @@ -16447,19 +17261,19 @@ func (x *Container) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1141[17] { + if yyq1197[17] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tty")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1185 := z.EncBinary() - _ = yym1185 + yym1241 := z.EncBinary() + _ = yym1241 if false { } else { r.EncodeBool(bool(x.TTY)) } } } - if yyr1141 || yy2arr1141 { + if yyr1197 || yy2arr1197 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16472,25 +17286,25 @@ func (x *Container) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1186 := z.DecBinary() - _ = yym1186 + yym1242 := z.DecBinary() + _ = yym1242 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1187 := r.ContainerType() - if yyct1187 == codecSelferValueTypeMap1234 { - yyl1187 := r.ReadMapStart() - if yyl1187 == 0 { + yyct1243 := r.ContainerType() + if yyct1243 == codecSelferValueTypeMap1234 { + yyl1243 := r.ReadMapStart() + if yyl1243 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1187, d) + x.codecDecodeSelfFromMap(yyl1243, d) } - } else if yyct1187 == codecSelferValueTypeArray1234 { - yyl1187 := r.ReadArrayStart() - if yyl1187 == 0 { + } else if yyct1243 == codecSelferValueTypeArray1234 { + yyl1243 := r.ReadArrayStart() + if yyl1243 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1187, d) + x.codecDecodeSelfFromArray(yyl1243, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16502,12 +17316,12 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1188Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1188Slc - var yyhl1188 bool = l >= 0 - for yyj1188 := 0; ; yyj1188++ { - if yyhl1188 { - if yyj1188 >= l { + var yys1244Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1244Slc + var yyhl1244 bool = l >= 0 + for yyj1244 := 0; ; yyj1244++ { + if yyhl1244 { + if yyj1244 >= l { break } } else { @@ -16516,10 +17330,10 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1188Slc = r.DecodeBytes(yys1188Slc, true, true) - yys1188 := string(yys1188Slc) + yys1244Slc = r.DecodeBytes(yys1244Slc, true, true) + yys1244 := string(yys1244Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1188 { + switch yys1244 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -16536,24 +17350,24 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1191 := &x.Command - yym1192 := z.DecBinary() - _ = yym1192 + yyv1247 := &x.Command + yym1248 := z.DecBinary() + _ = yym1248 if false { } else { - z.F.DecSliceStringX(yyv1191, false, d) + z.F.DecSliceStringX(yyv1247, false, d) } } case "args": if r.TryDecodeAsNil() { x.Args = nil } else { - yyv1193 := &x.Args - yym1194 := z.DecBinary() - _ = yym1194 + yyv1249 := &x.Args + yym1250 := z.DecBinary() + _ = yym1250 if false { } else { - z.F.DecSliceStringX(yyv1193, false, d) + z.F.DecSliceStringX(yyv1249, false, d) } } case "workingDir": @@ -16566,43 +17380,43 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1196 := &x.Ports - yym1197 := z.DecBinary() - _ = yym1197 + yyv1252 := &x.Ports + yym1253 := z.DecBinary() + _ = yym1253 if false { } else { - h.decSliceContainerPort((*[]ContainerPort)(yyv1196), d) + h.decSliceContainerPort((*[]ContainerPort)(yyv1252), d) } } case "env": if r.TryDecodeAsNil() { x.Env = nil } else { - yyv1198 := &x.Env - yym1199 := z.DecBinary() - _ = yym1199 + yyv1254 := &x.Env + yym1255 := z.DecBinary() + _ = yym1255 if false { } else { - h.decSliceEnvVar((*[]EnvVar)(yyv1198), d) + h.decSliceEnvVar((*[]EnvVar)(yyv1254), d) } } case "resources": if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv1200 := &x.Resources - yyv1200.CodecDecodeSelf(d) + yyv1256 := &x.Resources + yyv1256.CodecDecodeSelf(d) } case "volumeMounts": if r.TryDecodeAsNil() { x.VolumeMounts = nil } else { - yyv1201 := &x.VolumeMounts - yym1202 := z.DecBinary() - _ = yym1202 + yyv1257 := &x.VolumeMounts + yym1258 := z.DecBinary() + _ = yym1258 if false { } else { - h.decSliceVolumeMount((*[]VolumeMount)(yyv1201), d) + h.decSliceVolumeMount((*[]VolumeMount)(yyv1257), d) } } case "livenessProbe": @@ -16680,9 +17494,9 @@ func (x *Container) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TTY = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys1188) - } // end switch yys1188 - } // end for yyj1188 + z.DecStructFieldNotFound(-1, yys1244) + } // end switch yys1244 + } // end for yyj1244 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16690,16 +17504,16 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1212 int - var yyb1212 bool - var yyhl1212 bool = l >= 0 - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + var yyj1268 int + var yyb1268 bool + var yyhl1268 bool = l >= 0 + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16709,13 +17523,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16725,13 +17539,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Image = string(r.DecodeString()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16739,21 +17553,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv1215 := &x.Command - yym1216 := z.DecBinary() - _ = yym1216 + yyv1271 := &x.Command + yym1272 := z.DecBinary() + _ = yym1272 if false { } else { - z.F.DecSliceStringX(yyv1215, false, d) + z.F.DecSliceStringX(yyv1271, false, d) } } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16761,21 +17575,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Args = nil } else { - yyv1217 := &x.Args - yym1218 := z.DecBinary() - _ = yym1218 + yyv1273 := &x.Args + yym1274 := z.DecBinary() + _ = yym1274 if false { } else { - z.F.DecSliceStringX(yyv1217, false, d) + z.F.DecSliceStringX(yyv1273, false, d) } } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16785,13 +17599,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.WorkingDir = string(r.DecodeString()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16799,21 +17613,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1220 := &x.Ports - yym1221 := z.DecBinary() - _ = yym1221 + yyv1276 := &x.Ports + yym1277 := z.DecBinary() + _ = yym1277 if false { } else { - h.decSliceContainerPort((*[]ContainerPort)(yyv1220), d) + h.decSliceContainerPort((*[]ContainerPort)(yyv1276), d) } } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16821,21 +17635,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Env = nil } else { - yyv1222 := &x.Env - yym1223 := z.DecBinary() - _ = yym1223 + yyv1278 := &x.Env + yym1279 := z.DecBinary() + _ = yym1279 if false { } else { - h.decSliceEnvVar((*[]EnvVar)(yyv1222), d) + h.decSliceEnvVar((*[]EnvVar)(yyv1278), d) } } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16843,16 +17657,16 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Resources = ResourceRequirements{} } else { - yyv1224 := &x.Resources - yyv1224.CodecDecodeSelf(d) + yyv1280 := &x.Resources + yyv1280.CodecDecodeSelf(d) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16860,21 +17674,21 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.VolumeMounts = nil } else { - yyv1225 := &x.VolumeMounts - yym1226 := z.DecBinary() - _ = yym1226 + yyv1281 := &x.VolumeMounts + yym1282 := z.DecBinary() + _ = yym1282 if false { } else { - h.decSliceVolumeMount((*[]VolumeMount)(yyv1225), d) + h.decSliceVolumeMount((*[]VolumeMount)(yyv1281), d) } } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16889,13 +17703,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.LivenessProbe.CodecDecodeSelf(d) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16910,13 +17724,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.ReadinessProbe.CodecDecodeSelf(d) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16931,13 +17745,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Lifecycle.CodecDecodeSelf(d) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16947,13 +17761,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.TerminationMessagePath = string(r.DecodeString()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16963,13 +17777,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ImagePullPolicy = PullPolicy(r.DecodeString()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16984,13 +17798,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.SecurityContext.CodecDecodeSelf(d) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17000,13 +17814,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Stdin = bool(r.DecodeBool()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17016,13 +17830,13 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.StdinOnce = bool(r.DecodeBool()) } - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17033,17 +17847,17 @@ func (x *Container) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.TTY = bool(r.DecodeBool()) } for { - yyj1212++ - if yyhl1212 { - yyb1212 = yyj1212 > l + yyj1268++ + if yyhl1268 { + yyb1268 = yyj1268 > l } else { - yyb1212 = r.CheckBreak() + yyb1268 = r.CheckBreak() } - if yyb1212 { + if yyb1268 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1212-1, "") + z.DecStructFieldNotFound(yyj1268-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17055,35 +17869,35 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1236 := z.EncBinary() - _ = yym1236 + yym1292 := z.EncBinary() + _ = yym1292 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1237 := !z.EncBinary() - yy2arr1237 := z.EncBasicHandle().StructToArray - var yyq1237 [3]bool - _, _, _ = yysep1237, yyq1237, yy2arr1237 - const yyr1237 bool = false - yyq1237[0] = x.Exec != nil - yyq1237[1] = x.HTTPGet != nil - yyq1237[2] = x.TCPSocket != nil - var yynn1237 int - if yyr1237 || yy2arr1237 { + yysep1293 := !z.EncBinary() + yy2arr1293 := z.EncBasicHandle().StructToArray + var yyq1293 [3]bool + _, _, _ = yysep1293, yyq1293, yy2arr1293 + const yyr1293 bool = false + yyq1293[0] = x.Exec != nil + yyq1293[1] = x.HTTPGet != nil + yyq1293[2] = x.TCPSocket != nil + var yynn1293 int + if yyr1293 || yy2arr1293 { r.EncodeArrayStart(3) } else { - yynn1237 = 0 - for _, b := range yyq1237 { + yynn1293 = 0 + for _, b := range yyq1293 { if b { - yynn1237++ + yynn1293++ } } - r.EncodeMapStart(yynn1237) - yynn1237 = 0 + r.EncodeMapStart(yynn1293) + yynn1293 = 0 } - if yyr1237 || yy2arr1237 { + if yyr1293 || yy2arr1293 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1237[0] { + if yyq1293[0] { if x.Exec == nil { r.EncodeNil() } else { @@ -17093,7 +17907,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1237[0] { + if yyq1293[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("exec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17104,9 +17918,9 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1237 || yy2arr1237 { + if yyr1293 || yy2arr1293 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1237[1] { + if yyq1293[1] { if x.HTTPGet == nil { r.EncodeNil() } else { @@ -17116,7 +17930,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1237[1] { + if yyq1293[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("httpGet")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17127,9 +17941,9 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1237 || yy2arr1237 { + if yyr1293 || yy2arr1293 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1237[2] { + if yyq1293[2] { if x.TCPSocket == nil { r.EncodeNil() } else { @@ -17139,7 +17953,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1237[2] { + if yyq1293[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tcpSocket")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17150,7 +17964,7 @@ func (x *Handler) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1237 || yy2arr1237 { + if yyr1293 || yy2arr1293 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17163,25 +17977,25 @@ func (x *Handler) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1241 := z.DecBinary() - _ = yym1241 + yym1297 := z.DecBinary() + _ = yym1297 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1242 := r.ContainerType() - if yyct1242 == codecSelferValueTypeMap1234 { - yyl1242 := r.ReadMapStart() - if yyl1242 == 0 { + yyct1298 := r.ContainerType() + if yyct1298 == codecSelferValueTypeMap1234 { + yyl1298 := r.ReadMapStart() + if yyl1298 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1242, d) + x.codecDecodeSelfFromMap(yyl1298, d) } - } else if yyct1242 == codecSelferValueTypeArray1234 { - yyl1242 := r.ReadArrayStart() - if yyl1242 == 0 { + } else if yyct1298 == codecSelferValueTypeArray1234 { + yyl1298 := r.ReadArrayStart() + if yyl1298 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1242, d) + x.codecDecodeSelfFromArray(yyl1298, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17193,12 +18007,12 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1243Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1243Slc - var yyhl1243 bool = l >= 0 - for yyj1243 := 0; ; yyj1243++ { - if yyhl1243 { - if yyj1243 >= l { + var yys1299Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1299Slc + var yyhl1299 bool = l >= 0 + for yyj1299 := 0; ; yyj1299++ { + if yyhl1299 { + if yyj1299 >= l { break } } else { @@ -17207,10 +18021,10 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1243Slc = r.DecodeBytes(yys1243Slc, true, true) - yys1243 := string(yys1243Slc) + yys1299Slc = r.DecodeBytes(yys1299Slc, true, true) + yys1299 := string(yys1299Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1243 { + switch yys1299 { case "exec": if r.TryDecodeAsNil() { if x.Exec != nil { @@ -17245,9 +18059,9 @@ func (x *Handler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TCPSocket.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1243) - } // end switch yys1243 - } // end for yyj1243 + z.DecStructFieldNotFound(-1, yys1299) + } // end switch yys1299 + } // end for yyj1299 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17255,16 +18069,16 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1247 int - var yyb1247 bool - var yyhl1247 bool = l >= 0 - yyj1247++ - if yyhl1247 { - yyb1247 = yyj1247 > l + var yyj1303 int + var yyb1303 bool + var yyhl1303 bool = l >= 0 + yyj1303++ + if yyhl1303 { + yyb1303 = yyj1303 > l } else { - yyb1247 = r.CheckBreak() + yyb1303 = r.CheckBreak() } - if yyb1247 { + if yyb1303 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17279,13 +18093,13 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Exec.CodecDecodeSelf(d) } - yyj1247++ - if yyhl1247 { - yyb1247 = yyj1247 > l + yyj1303++ + if yyhl1303 { + yyb1303 = yyj1303 > l } else { - yyb1247 = r.CheckBreak() + yyb1303 = r.CheckBreak() } - if yyb1247 { + if yyb1303 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17300,13 +18114,13 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.HTTPGet.CodecDecodeSelf(d) } - yyj1247++ - if yyhl1247 { - yyb1247 = yyj1247 > l + yyj1303++ + if yyhl1303 { + yyb1303 = yyj1303 > l } else { - yyb1247 = r.CheckBreak() + yyb1303 = r.CheckBreak() } - if yyb1247 { + if yyb1303 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17322,17 +18136,17 @@ func (x *Handler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.TCPSocket.CodecDecodeSelf(d) } for { - yyj1247++ - if yyhl1247 { - yyb1247 = yyj1247 > l + yyj1303++ + if yyhl1303 { + yyb1303 = yyj1303 > l } else { - yyb1247 = r.CheckBreak() + yyb1303 = r.CheckBreak() } - if yyb1247 { + if yyb1303 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1247-1, "") + z.DecStructFieldNotFound(yyj1303-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17344,34 +18158,34 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1251 := z.EncBinary() - _ = yym1251 + yym1307 := z.EncBinary() + _ = yym1307 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1252 := !z.EncBinary() - yy2arr1252 := z.EncBasicHandle().StructToArray - var yyq1252 [2]bool - _, _, _ = yysep1252, yyq1252, yy2arr1252 - const yyr1252 bool = false - yyq1252[0] = x.PostStart != nil - yyq1252[1] = x.PreStop != nil - var yynn1252 int - if yyr1252 || yy2arr1252 { + yysep1308 := !z.EncBinary() + yy2arr1308 := z.EncBasicHandle().StructToArray + var yyq1308 [2]bool + _, _, _ = yysep1308, yyq1308, yy2arr1308 + const yyr1308 bool = false + yyq1308[0] = x.PostStart != nil + yyq1308[1] = x.PreStop != nil + var yynn1308 int + if yyr1308 || yy2arr1308 { r.EncodeArrayStart(2) } else { - yynn1252 = 0 - for _, b := range yyq1252 { + yynn1308 = 0 + for _, b := range yyq1308 { if b { - yynn1252++ + yynn1308++ } } - r.EncodeMapStart(yynn1252) - yynn1252 = 0 + r.EncodeMapStart(yynn1308) + yynn1308 = 0 } - if yyr1252 || yy2arr1252 { + if yyr1308 || yy2arr1308 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1252[0] { + if yyq1308[0] { if x.PostStart == nil { r.EncodeNil() } else { @@ -17381,7 +18195,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1252[0] { + if yyq1308[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("postStart")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17392,9 +18206,9 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1252 || yy2arr1252 { + if yyr1308 || yy2arr1308 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1252[1] { + if yyq1308[1] { if x.PreStop == nil { r.EncodeNil() } else { @@ -17404,7 +18218,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1252[1] { + if yyq1308[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("preStop")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17415,7 +18229,7 @@ func (x *Lifecycle) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1252 || yy2arr1252 { + if yyr1308 || yy2arr1308 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17428,25 +18242,25 @@ func (x *Lifecycle) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1255 := z.DecBinary() - _ = yym1255 + yym1311 := z.DecBinary() + _ = yym1311 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1256 := r.ContainerType() - if yyct1256 == codecSelferValueTypeMap1234 { - yyl1256 := r.ReadMapStart() - if yyl1256 == 0 { + yyct1312 := r.ContainerType() + if yyct1312 == codecSelferValueTypeMap1234 { + yyl1312 := r.ReadMapStart() + if yyl1312 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1256, d) + x.codecDecodeSelfFromMap(yyl1312, d) } - } else if yyct1256 == codecSelferValueTypeArray1234 { - yyl1256 := r.ReadArrayStart() - if yyl1256 == 0 { + } else if yyct1312 == codecSelferValueTypeArray1234 { + yyl1312 := r.ReadArrayStart() + if yyl1312 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1256, d) + x.codecDecodeSelfFromArray(yyl1312, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17458,12 +18272,12 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1257Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1257Slc - var yyhl1257 bool = l >= 0 - for yyj1257 := 0; ; yyj1257++ { - if yyhl1257 { - if yyj1257 >= l { + var yys1313Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1313Slc + var yyhl1313 bool = l >= 0 + for yyj1313 := 0; ; yyj1313++ { + if yyhl1313 { + if yyj1313 >= l { break } } else { @@ -17472,10 +18286,10 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1257Slc = r.DecodeBytes(yys1257Slc, true, true) - yys1257 := string(yys1257Slc) + yys1313Slc = r.DecodeBytes(yys1313Slc, true, true) + yys1313 := string(yys1313Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1257 { + switch yys1313 { case "postStart": if r.TryDecodeAsNil() { if x.PostStart != nil { @@ -17499,9 +18313,9 @@ func (x *Lifecycle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.PreStop.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1257) - } // end switch yys1257 - } // end for yyj1257 + z.DecStructFieldNotFound(-1, yys1313) + } // end switch yys1313 + } // end for yyj1313 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17509,16 +18323,16 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1260 int - var yyb1260 bool - var yyhl1260 bool = l >= 0 - yyj1260++ - if yyhl1260 { - yyb1260 = yyj1260 > l + var yyj1316 int + var yyb1316 bool + var yyhl1316 bool = l >= 0 + yyj1316++ + if yyhl1316 { + yyb1316 = yyj1316 > l } else { - yyb1260 = r.CheckBreak() + yyb1316 = r.CheckBreak() } - if yyb1260 { + if yyb1316 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17533,13 +18347,13 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.PostStart.CodecDecodeSelf(d) } - yyj1260++ - if yyhl1260 { - yyb1260 = yyj1260 > l + yyj1316++ + if yyhl1316 { + yyb1316 = yyj1316 > l } else { - yyb1260 = r.CheckBreak() + yyb1316 = r.CheckBreak() } - if yyb1260 { + if yyb1316 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17555,17 +18369,17 @@ func (x *Lifecycle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.PreStop.CodecDecodeSelf(d) } for { - yyj1260++ - if yyhl1260 { - yyb1260 = yyj1260 > l + yyj1316++ + if yyhl1316 { + yyb1316 = yyj1316 > l } else { - yyb1260 = r.CheckBreak() + yyb1316 = r.CheckBreak() } - if yyb1260 { + if yyb1316 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1260-1, "") + z.DecStructFieldNotFound(yyj1316-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17574,8 +18388,8 @@ func (x ConditionStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1263 := z.EncBinary() - _ = yym1263 + yym1319 := z.EncBinary() + _ = yym1319 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -17587,8 +18401,8 @@ func (x *ConditionStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1264 := z.DecBinary() - _ = yym1264 + yym1320 := z.DecBinary() + _ = yym1320 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -17603,36 +18417,36 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1265 := z.EncBinary() - _ = yym1265 + yym1321 := z.EncBinary() + _ = yym1321 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1266 := !z.EncBinary() - yy2arr1266 := z.EncBasicHandle().StructToArray - var yyq1266 [2]bool - _, _, _ = yysep1266, yyq1266, yy2arr1266 - const yyr1266 bool = false - yyq1266[0] = x.Reason != "" - yyq1266[1] = x.Message != "" - var yynn1266 int - if yyr1266 || yy2arr1266 { + yysep1322 := !z.EncBinary() + yy2arr1322 := z.EncBasicHandle().StructToArray + var yyq1322 [2]bool + _, _, _ = yysep1322, yyq1322, yy2arr1322 + const yyr1322 bool = false + yyq1322[0] = x.Reason != "" + yyq1322[1] = x.Message != "" + var yynn1322 int + if yyr1322 || yy2arr1322 { r.EncodeArrayStart(2) } else { - yynn1266 = 0 - for _, b := range yyq1266 { + yynn1322 = 0 + for _, b := range yyq1322 { if b { - yynn1266++ + yynn1322++ } } - r.EncodeMapStart(yynn1266) - yynn1266 = 0 + r.EncodeMapStart(yynn1322) + yynn1322 = 0 } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1266[0] { - yym1268 := z.EncBinary() - _ = yym1268 + if yyq1322[0] { + yym1324 := z.EncBinary() + _ = yym1324 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -17641,23 +18455,23 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1266[0] { + if yyq1322[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1269 := z.EncBinary() - _ = yym1269 + yym1325 := z.EncBinary() + _ = yym1325 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1266[1] { - yym1271 := z.EncBinary() - _ = yym1271 + if yyq1322[1] { + yym1327 := z.EncBinary() + _ = yym1327 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -17666,19 +18480,19 @@ func (x *ContainerStateWaiting) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1266[1] { + if yyq1322[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1272 := z.EncBinary() - _ = yym1272 + yym1328 := z.EncBinary() + _ = yym1328 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1266 || yy2arr1266 { + if yyr1322 || yy2arr1322 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17691,25 +18505,25 @@ func (x *ContainerStateWaiting) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1273 := z.DecBinary() - _ = yym1273 + yym1329 := z.DecBinary() + _ = yym1329 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1274 := r.ContainerType() - if yyct1274 == codecSelferValueTypeMap1234 { - yyl1274 := r.ReadMapStart() - if yyl1274 == 0 { + yyct1330 := r.ContainerType() + if yyct1330 == codecSelferValueTypeMap1234 { + yyl1330 := r.ReadMapStart() + if yyl1330 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1274, d) + x.codecDecodeSelfFromMap(yyl1330, d) } - } else if yyct1274 == codecSelferValueTypeArray1234 { - yyl1274 := r.ReadArrayStart() - if yyl1274 == 0 { + } else if yyct1330 == codecSelferValueTypeArray1234 { + yyl1330 := r.ReadArrayStart() + if yyl1330 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1274, d) + x.codecDecodeSelfFromArray(yyl1330, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17721,12 +18535,12 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1275Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1275Slc - var yyhl1275 bool = l >= 0 - for yyj1275 := 0; ; yyj1275++ { - if yyhl1275 { - if yyj1275 >= l { + var yys1331Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1331Slc + var yyhl1331 bool = l >= 0 + for yyj1331 := 0; ; yyj1331++ { + if yyhl1331 { + if yyj1331 >= l { break } } else { @@ -17735,10 +18549,10 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1275Slc = r.DecodeBytes(yys1275Slc, true, true) - yys1275 := string(yys1275Slc) + yys1331Slc = r.DecodeBytes(yys1331Slc, true, true) + yys1331 := string(yys1331Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1275 { + switch yys1331 { case "reason": if r.TryDecodeAsNil() { x.Reason = "" @@ -17752,9 +18566,9 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromMap(l int, d *codec1978.Decod x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1275) - } // end switch yys1275 - } // end for yyj1275 + z.DecStructFieldNotFound(-1, yys1331) + } // end switch yys1331 + } // end for yyj1331 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17762,16 +18576,16 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1278 int - var yyb1278 bool - var yyhl1278 bool = l >= 0 - yyj1278++ - if yyhl1278 { - yyb1278 = yyj1278 > l + var yyj1334 int + var yyb1334 bool + var yyhl1334 bool = l >= 0 + yyj1334++ + if yyhl1334 { + yyb1334 = yyj1334 > l } else { - yyb1278 = r.CheckBreak() + yyb1334 = r.CheckBreak() } - if yyb1278 { + if yyb1334 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17781,13 +18595,13 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Reason = string(r.DecodeString()) } - yyj1278++ - if yyhl1278 { - yyb1278 = yyj1278 > l + yyj1334++ + if yyhl1334 { + yyb1334 = yyj1334 > l } else { - yyb1278 = r.CheckBreak() + yyb1334 = r.CheckBreak() } - if yyb1278 { + if yyb1334 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17798,17 +18612,17 @@ func (x *ContainerStateWaiting) codecDecodeSelfFromArray(l int, d *codec1978.Dec x.Message = string(r.DecodeString()) } for { - yyj1278++ - if yyhl1278 { - yyb1278 = yyj1278 > l + yyj1334++ + if yyhl1334 { + yyb1334 = yyj1334 > l } else { - yyb1278 = r.CheckBreak() + yyb1334 = r.CheckBreak() } - if yyb1278 { + if yyb1334 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1278-1, "") + z.DecStructFieldNotFound(yyj1334-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17820,68 +18634,68 @@ func (x *ContainerStateRunning) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1281 := z.EncBinary() - _ = yym1281 + yym1337 := z.EncBinary() + _ = yym1337 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1282 := !z.EncBinary() - yy2arr1282 := z.EncBasicHandle().StructToArray - var yyq1282 [1]bool - _, _, _ = yysep1282, yyq1282, yy2arr1282 - const yyr1282 bool = false - yyq1282[0] = true - var yynn1282 int - if yyr1282 || yy2arr1282 { + yysep1338 := !z.EncBinary() + yy2arr1338 := z.EncBasicHandle().StructToArray + var yyq1338 [1]bool + _, _, _ = yysep1338, yyq1338, yy2arr1338 + const yyr1338 bool = false + yyq1338[0] = true + var yynn1338 int + if yyr1338 || yy2arr1338 { r.EncodeArrayStart(1) } else { - yynn1282 = 0 - for _, b := range yyq1282 { + yynn1338 = 0 + for _, b := range yyq1338 { if b { - yynn1282++ + yynn1338++ } } - r.EncodeMapStart(yynn1282) - yynn1282 = 0 + r.EncodeMapStart(yynn1338) + yynn1338 = 0 } - if yyr1282 || yy2arr1282 { + if yyr1338 || yy2arr1338 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1282[0] { - yy1284 := &x.StartedAt - yym1285 := z.EncBinary() - _ = yym1285 + if yyq1338[0] { + yy1340 := &x.StartedAt + yym1341 := z.EncBinary() + _ = yym1341 if false { - } else if z.HasExtensions() && z.EncExt(yy1284) { - } else if yym1285 { - z.EncBinaryMarshal(yy1284) - } else if !yym1285 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1284) + } else if z.HasExtensions() && z.EncExt(yy1340) { + } else if yym1341 { + z.EncBinaryMarshal(yy1340) + } else if !yym1341 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1340) } else { - z.EncFallback(yy1284) + z.EncFallback(yy1340) } } else { r.EncodeNil() } } else { - if yyq1282[0] { + if yyq1338[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1286 := &x.StartedAt - yym1287 := z.EncBinary() - _ = yym1287 + yy1342 := &x.StartedAt + yym1343 := z.EncBinary() + _ = yym1343 if false { - } else if z.HasExtensions() && z.EncExt(yy1286) { - } else if yym1287 { - z.EncBinaryMarshal(yy1286) - } else if !yym1287 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1286) + } else if z.HasExtensions() && z.EncExt(yy1342) { + } else if yym1343 { + z.EncBinaryMarshal(yy1342) + } else if !yym1343 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1342) } else { - z.EncFallback(yy1286) + z.EncFallback(yy1342) } } } - if yyr1282 || yy2arr1282 { + if yyr1338 || yy2arr1338 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17894,25 +18708,25 @@ func (x *ContainerStateRunning) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1288 := z.DecBinary() - _ = yym1288 + yym1344 := z.DecBinary() + _ = yym1344 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1289 := r.ContainerType() - if yyct1289 == codecSelferValueTypeMap1234 { - yyl1289 := r.ReadMapStart() - if yyl1289 == 0 { + yyct1345 := r.ContainerType() + if yyct1345 == codecSelferValueTypeMap1234 { + yyl1345 := r.ReadMapStart() + if yyl1345 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1289, d) + x.codecDecodeSelfFromMap(yyl1345, d) } - } else if yyct1289 == codecSelferValueTypeArray1234 { - yyl1289 := r.ReadArrayStart() - if yyl1289 == 0 { + } else if yyct1345 == codecSelferValueTypeArray1234 { + yyl1345 := r.ReadArrayStart() + if yyl1345 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1289, d) + x.codecDecodeSelfFromArray(yyl1345, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17924,12 +18738,12 @@ func (x *ContainerStateRunning) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1290Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1290Slc - var yyhl1290 bool = l >= 0 - for yyj1290 := 0; ; yyj1290++ { - if yyhl1290 { - if yyj1290 >= l { + var yys1346Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1346Slc + var yyhl1346 bool = l >= 0 + for yyj1346 := 0; ; yyj1346++ { + if yyhl1346 { + if yyj1346 >= l { break } } else { @@ -17938,31 +18752,31 @@ func (x *ContainerStateRunning) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1290Slc = r.DecodeBytes(yys1290Slc, true, true) - yys1290 := string(yys1290Slc) + yys1346Slc = r.DecodeBytes(yys1346Slc, true, true) + yys1346 := string(yys1346Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1290 { + switch yys1346 { case "startedAt": if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1291 := &x.StartedAt - yym1292 := z.DecBinary() - _ = yym1292 + yyv1347 := &x.StartedAt + yym1348 := z.DecBinary() + _ = yym1348 if false { - } else if z.HasExtensions() && z.DecExt(yyv1291) { - } else if yym1292 { - z.DecBinaryUnmarshal(yyv1291) - } else if !yym1292 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1291) + } else if z.HasExtensions() && z.DecExt(yyv1347) { + } else if yym1348 { + z.DecBinaryUnmarshal(yyv1347) + } else if !yym1348 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1347) } else { - z.DecFallback(yyv1291, false) + z.DecFallback(yyv1347, false) } } default: - z.DecStructFieldNotFound(-1, yys1290) - } // end switch yys1290 - } // end for yyj1290 + z.DecStructFieldNotFound(-1, yys1346) + } // end switch yys1346 + } // end for yyj1346 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17970,16 +18784,16 @@ func (x *ContainerStateRunning) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1293 int - var yyb1293 bool - var yyhl1293 bool = l >= 0 - yyj1293++ - if yyhl1293 { - yyb1293 = yyj1293 > l + var yyj1349 int + var yyb1349 bool + var yyhl1349 bool = l >= 0 + yyj1349++ + if yyhl1349 { + yyb1349 = yyj1349 > l } else { - yyb1293 = r.CheckBreak() + yyb1349 = r.CheckBreak() } - if yyb1293 { + if yyb1349 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17987,31 +18801,31 @@ func (x *ContainerStateRunning) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1294 := &x.StartedAt - yym1295 := z.DecBinary() - _ = yym1295 + yyv1350 := &x.StartedAt + yym1351 := z.DecBinary() + _ = yym1351 if false { - } else if z.HasExtensions() && z.DecExt(yyv1294) { - } else if yym1295 { - z.DecBinaryUnmarshal(yyv1294) - } else if !yym1295 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1294) + } else if z.HasExtensions() && z.DecExt(yyv1350) { + } else if yym1351 { + z.DecBinaryUnmarshal(yyv1350) + } else if !yym1351 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1350) } else { - z.DecFallback(yyv1294, false) + z.DecFallback(yyv1350, false) } } for { - yyj1293++ - if yyhl1293 { - yyb1293 = yyj1293 > l + yyj1349++ + if yyhl1349 { + yyb1349 = yyj1349 > l } else { - yyb1293 = r.CheckBreak() + yyb1349 = r.CheckBreak() } - if yyb1293 { + if yyb1349 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1293-1, "") + z.DecStructFieldNotFound(yyj1349-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18023,39 +18837,39 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1296 := z.EncBinary() - _ = yym1296 + yym1352 := z.EncBinary() + _ = yym1352 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1297 := !z.EncBinary() - yy2arr1297 := z.EncBasicHandle().StructToArray - var yyq1297 [7]bool - _, _, _ = yysep1297, yyq1297, yy2arr1297 - const yyr1297 bool = false - yyq1297[1] = x.Signal != 0 - yyq1297[2] = x.Reason != "" - yyq1297[3] = x.Message != "" - yyq1297[4] = true - yyq1297[5] = true - yyq1297[6] = x.ContainerID != "" - var yynn1297 int - if yyr1297 || yy2arr1297 { + yysep1353 := !z.EncBinary() + yy2arr1353 := z.EncBasicHandle().StructToArray + var yyq1353 [7]bool + _, _, _ = yysep1353, yyq1353, yy2arr1353 + const yyr1353 bool = false + yyq1353[1] = x.Signal != 0 + yyq1353[2] = x.Reason != "" + yyq1353[3] = x.Message != "" + yyq1353[4] = true + yyq1353[5] = true + yyq1353[6] = x.ContainerID != "" + var yynn1353 int + if yyr1353 || yy2arr1353 { r.EncodeArrayStart(7) } else { - yynn1297 = 1 - for _, b := range yyq1297 { + yynn1353 = 1 + for _, b := range yyq1353 { if b { - yynn1297++ + yynn1353++ } } - r.EncodeMapStart(yynn1297) - yynn1297 = 0 + r.EncodeMapStart(yynn1353) + yynn1353 = 0 } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1299 := z.EncBinary() - _ = yym1299 + yym1355 := z.EncBinary() + _ = yym1355 if false { } else { r.EncodeInt(int64(x.ExitCode)) @@ -18064,18 +18878,18 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("exitCode")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1300 := z.EncBinary() - _ = yym1300 + yym1356 := z.EncBinary() + _ = yym1356 if false { } else { r.EncodeInt(int64(x.ExitCode)) } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[1] { - yym1302 := z.EncBinary() - _ = yym1302 + if yyq1353[1] { + yym1358 := z.EncBinary() + _ = yym1358 if false { } else { r.EncodeInt(int64(x.Signal)) @@ -18084,23 +18898,23 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1297[1] { + if yyq1353[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("signal")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1303 := z.EncBinary() - _ = yym1303 + yym1359 := z.EncBinary() + _ = yym1359 if false { } else { r.EncodeInt(int64(x.Signal)) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[2] { - yym1305 := z.EncBinary() - _ = yym1305 + if yyq1353[2] { + yym1361 := z.EncBinary() + _ = yym1361 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -18109,23 +18923,23 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1297[2] { + if yyq1353[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1306 := z.EncBinary() - _ = yym1306 + yym1362 := z.EncBinary() + _ = yym1362 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[3] { - yym1308 := z.EncBinary() - _ = yym1308 + if yyq1353[3] { + yym1364 := z.EncBinary() + _ = yym1364 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -18134,97 +18948,97 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1297[3] { + if yyq1353[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1309 := z.EncBinary() - _ = yym1309 + yym1365 := z.EncBinary() + _ = yym1365 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[4] { - yy1311 := &x.StartedAt - yym1312 := z.EncBinary() - _ = yym1312 + if yyq1353[4] { + yy1367 := &x.StartedAt + yym1368 := z.EncBinary() + _ = yym1368 if false { - } else if z.HasExtensions() && z.EncExt(yy1311) { - } else if yym1312 { - z.EncBinaryMarshal(yy1311) - } else if !yym1312 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1311) + } else if z.HasExtensions() && z.EncExt(yy1367) { + } else if yym1368 { + z.EncBinaryMarshal(yy1367) + } else if !yym1368 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1367) } else { - z.EncFallback(yy1311) + z.EncFallback(yy1367) } } else { r.EncodeNil() } } else { - if yyq1297[4] { + if yyq1353[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1313 := &x.StartedAt - yym1314 := z.EncBinary() - _ = yym1314 + yy1369 := &x.StartedAt + yym1370 := z.EncBinary() + _ = yym1370 if false { - } else if z.HasExtensions() && z.EncExt(yy1313) { - } else if yym1314 { - z.EncBinaryMarshal(yy1313) - } else if !yym1314 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1313) + } else if z.HasExtensions() && z.EncExt(yy1369) { + } else if yym1370 { + z.EncBinaryMarshal(yy1369) + } else if !yym1370 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1369) } else { - z.EncFallback(yy1313) + z.EncFallback(yy1369) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[5] { - yy1316 := &x.FinishedAt - yym1317 := z.EncBinary() - _ = yym1317 + if yyq1353[5] { + yy1372 := &x.FinishedAt + yym1373 := z.EncBinary() + _ = yym1373 if false { - } else if z.HasExtensions() && z.EncExt(yy1316) { - } else if yym1317 { - z.EncBinaryMarshal(yy1316) - } else if !yym1317 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1316) + } else if z.HasExtensions() && z.EncExt(yy1372) { + } else if yym1373 { + z.EncBinaryMarshal(yy1372) + } else if !yym1373 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1372) } else { - z.EncFallback(yy1316) + z.EncFallback(yy1372) } } else { r.EncodeNil() } } else { - if yyq1297[5] { + if yyq1353[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("finishedAt")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1318 := &x.FinishedAt - yym1319 := z.EncBinary() - _ = yym1319 + yy1374 := &x.FinishedAt + yym1375 := z.EncBinary() + _ = yym1375 if false { - } else if z.HasExtensions() && z.EncExt(yy1318) { - } else if yym1319 { - z.EncBinaryMarshal(yy1318) - } else if !yym1319 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1318) + } else if z.HasExtensions() && z.EncExt(yy1374) { + } else if yym1375 { + z.EncBinaryMarshal(yy1374) + } else if !yym1375 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1374) } else { - z.EncFallback(yy1318) + z.EncFallback(yy1374) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1297[6] { - yym1321 := z.EncBinary() - _ = yym1321 + if yyq1353[6] { + yym1377 := z.EncBinary() + _ = yym1377 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) @@ -18233,19 +19047,19 @@ func (x *ContainerStateTerminated) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1297[6] { + if yyq1353[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1322 := z.EncBinary() - _ = yym1322 + yym1378 := z.EncBinary() + _ = yym1378 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) } } } - if yyr1297 || yy2arr1297 { + if yyr1353 || yy2arr1353 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -18258,25 +19072,25 @@ func (x *ContainerStateTerminated) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1323 := z.DecBinary() - _ = yym1323 + yym1379 := z.DecBinary() + _ = yym1379 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1324 := r.ContainerType() - if yyct1324 == codecSelferValueTypeMap1234 { - yyl1324 := r.ReadMapStart() - if yyl1324 == 0 { + yyct1380 := r.ContainerType() + if yyct1380 == codecSelferValueTypeMap1234 { + yyl1380 := r.ReadMapStart() + if yyl1380 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1324, d) + x.codecDecodeSelfFromMap(yyl1380, d) } - } else if yyct1324 == codecSelferValueTypeArray1234 { - yyl1324 := r.ReadArrayStart() - if yyl1324 == 0 { + } else if yyct1380 == codecSelferValueTypeArray1234 { + yyl1380 := r.ReadArrayStart() + if yyl1380 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1324, d) + x.codecDecodeSelfFromArray(yyl1380, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -18288,12 +19102,12 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1325Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1325Slc - var yyhl1325 bool = l >= 0 - for yyj1325 := 0; ; yyj1325++ { - if yyhl1325 { - if yyj1325 >= l { + var yys1381Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1381Slc + var yyhl1381 bool = l >= 0 + for yyj1381 := 0; ; yyj1381++ { + if yyhl1381 { + if yyj1381 >= l { break } } else { @@ -18302,10 +19116,10 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1325Slc = r.DecodeBytes(yys1325Slc, true, true) - yys1325 := string(yys1325Slc) + yys1381Slc = r.DecodeBytes(yys1381Slc, true, true) + yys1381 := string(yys1381Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1325 { + switch yys1381 { case "exitCode": if r.TryDecodeAsNil() { x.ExitCode = 0 @@ -18334,34 +19148,34 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1330 := &x.StartedAt - yym1331 := z.DecBinary() - _ = yym1331 + yyv1386 := &x.StartedAt + yym1387 := z.DecBinary() + _ = yym1387 if false { - } else if z.HasExtensions() && z.DecExt(yyv1330) { - } else if yym1331 { - z.DecBinaryUnmarshal(yyv1330) - } else if !yym1331 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1330) + } else if z.HasExtensions() && z.DecExt(yyv1386) { + } else if yym1387 { + z.DecBinaryUnmarshal(yyv1386) + } else if !yym1387 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1386) } else { - z.DecFallback(yyv1330, false) + z.DecFallback(yyv1386, false) } } case "finishedAt": if r.TryDecodeAsNil() { x.FinishedAt = pkg2_unversioned.Time{} } else { - yyv1332 := &x.FinishedAt - yym1333 := z.DecBinary() - _ = yym1333 + yyv1388 := &x.FinishedAt + yym1389 := z.DecBinary() + _ = yym1389 if false { - } else if z.HasExtensions() && z.DecExt(yyv1332) { - } else if yym1333 { - z.DecBinaryUnmarshal(yyv1332) - } else if !yym1333 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1332) + } else if z.HasExtensions() && z.DecExt(yyv1388) { + } else if yym1389 { + z.DecBinaryUnmarshal(yyv1388) + } else if !yym1389 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1388) } else { - z.DecFallback(yyv1332, false) + z.DecFallback(yyv1388, false) } } case "containerID": @@ -18371,9 +19185,9 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromMap(l int, d *codec1978.De x.ContainerID = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1325) - } // end switch yys1325 - } // end for yyj1325 + z.DecStructFieldNotFound(-1, yys1381) + } // end switch yys1381 + } // end for yyj1381 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -18381,16 +19195,16 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1335 int - var yyb1335 bool - var yyhl1335 bool = l >= 0 - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + var yyj1391 int + var yyb1391 bool + var yyhl1391 bool = l >= 0 + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18400,13 +19214,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.ExitCode = int32(r.DecodeInt(32)) } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18416,13 +19230,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Signal = int32(r.DecodeInt(32)) } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18432,13 +19246,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Reason = string(r.DecodeString()) } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18448,13 +19262,13 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Message = string(r.DecodeString()) } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18462,26 +19276,26 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. if r.TryDecodeAsNil() { x.StartedAt = pkg2_unversioned.Time{} } else { - yyv1340 := &x.StartedAt - yym1341 := z.DecBinary() - _ = yym1341 + yyv1396 := &x.StartedAt + yym1397 := z.DecBinary() + _ = yym1397 if false { - } else if z.HasExtensions() && z.DecExt(yyv1340) { - } else if yym1341 { - z.DecBinaryUnmarshal(yyv1340) - } else if !yym1341 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1340) + } else if z.HasExtensions() && z.DecExt(yyv1396) { + } else if yym1397 { + z.DecBinaryUnmarshal(yyv1396) + } else if !yym1397 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1396) } else { - z.DecFallback(yyv1340, false) + z.DecFallback(yyv1396, false) } } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18489,26 +19303,26 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. if r.TryDecodeAsNil() { x.FinishedAt = pkg2_unversioned.Time{} } else { - yyv1342 := &x.FinishedAt - yym1343 := z.DecBinary() - _ = yym1343 + yyv1398 := &x.FinishedAt + yym1399 := z.DecBinary() + _ = yym1399 if false { - } else if z.HasExtensions() && z.DecExt(yyv1342) { - } else if yym1343 { - z.DecBinaryUnmarshal(yyv1342) - } else if !yym1343 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1342) + } else if z.HasExtensions() && z.DecExt(yyv1398) { + } else if yym1399 { + z.DecBinaryUnmarshal(yyv1398) + } else if !yym1399 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1398) } else { - z.DecFallback(yyv1342, false) + z.DecFallback(yyv1398, false) } } - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18519,17 +19333,17 @@ func (x *ContainerStateTerminated) codecDecodeSelfFromArray(l int, d *codec1978. x.ContainerID = string(r.DecodeString()) } for { - yyj1335++ - if yyhl1335 { - yyb1335 = yyj1335 > l + yyj1391++ + if yyhl1391 { + yyb1391 = yyj1391 > l } else { - yyb1335 = r.CheckBreak() + yyb1391 = r.CheckBreak() } - if yyb1335 { + if yyb1391 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1335-1, "") + z.DecStructFieldNotFound(yyj1391-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18541,35 +19355,35 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1345 := z.EncBinary() - _ = yym1345 + yym1401 := z.EncBinary() + _ = yym1401 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1346 := !z.EncBinary() - yy2arr1346 := z.EncBasicHandle().StructToArray - var yyq1346 [3]bool - _, _, _ = yysep1346, yyq1346, yy2arr1346 - const yyr1346 bool = false - yyq1346[0] = x.Waiting != nil - yyq1346[1] = x.Running != nil - yyq1346[2] = x.Terminated != nil - var yynn1346 int - if yyr1346 || yy2arr1346 { + yysep1402 := !z.EncBinary() + yy2arr1402 := z.EncBasicHandle().StructToArray + var yyq1402 [3]bool + _, _, _ = yysep1402, yyq1402, yy2arr1402 + const yyr1402 bool = false + yyq1402[0] = x.Waiting != nil + yyq1402[1] = x.Running != nil + yyq1402[2] = x.Terminated != nil + var yynn1402 int + if yyr1402 || yy2arr1402 { r.EncodeArrayStart(3) } else { - yynn1346 = 0 - for _, b := range yyq1346 { + yynn1402 = 0 + for _, b := range yyq1402 { if b { - yynn1346++ + yynn1402++ } } - r.EncodeMapStart(yynn1346) - yynn1346 = 0 + r.EncodeMapStart(yynn1402) + yynn1402 = 0 } - if yyr1346 || yy2arr1346 { + if yyr1402 || yy2arr1402 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1346[0] { + if yyq1402[0] { if x.Waiting == nil { r.EncodeNil() } else { @@ -18579,7 +19393,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1346[0] { + if yyq1402[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("waiting")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -18590,9 +19404,9 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1346 || yy2arr1346 { + if yyr1402 || yy2arr1402 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1346[1] { + if yyq1402[1] { if x.Running == nil { r.EncodeNil() } else { @@ -18602,7 +19416,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1346[1] { + if yyq1402[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("running")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -18613,9 +19427,9 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1346 || yy2arr1346 { + if yyr1402 || yy2arr1402 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1346[2] { + if yyq1402[2] { if x.Terminated == nil { r.EncodeNil() } else { @@ -18625,7 +19439,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1346[2] { + if yyq1402[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminated")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -18636,7 +19450,7 @@ func (x *ContainerState) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1346 || yy2arr1346 { + if yyr1402 || yy2arr1402 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -18649,25 +19463,25 @@ func (x *ContainerState) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1350 := z.DecBinary() - _ = yym1350 + yym1406 := z.DecBinary() + _ = yym1406 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1351 := r.ContainerType() - if yyct1351 == codecSelferValueTypeMap1234 { - yyl1351 := r.ReadMapStart() - if yyl1351 == 0 { + yyct1407 := r.ContainerType() + if yyct1407 == codecSelferValueTypeMap1234 { + yyl1407 := r.ReadMapStart() + if yyl1407 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1351, d) + x.codecDecodeSelfFromMap(yyl1407, d) } - } else if yyct1351 == codecSelferValueTypeArray1234 { - yyl1351 := r.ReadArrayStart() - if yyl1351 == 0 { + } else if yyct1407 == codecSelferValueTypeArray1234 { + yyl1407 := r.ReadArrayStart() + if yyl1407 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1351, d) + x.codecDecodeSelfFromArray(yyl1407, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -18679,12 +19493,12 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1352Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1352Slc - var yyhl1352 bool = l >= 0 - for yyj1352 := 0; ; yyj1352++ { - if yyhl1352 { - if yyj1352 >= l { + var yys1408Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1408Slc + var yyhl1408 bool = l >= 0 + for yyj1408 := 0; ; yyj1408++ { + if yyhl1408 { + if yyj1408 >= l { break } } else { @@ -18693,10 +19507,10 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1352Slc = r.DecodeBytes(yys1352Slc, true, true) - yys1352 := string(yys1352Slc) + yys1408Slc = r.DecodeBytes(yys1408Slc, true, true) + yys1408 := string(yys1408Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1352 { + switch yys1408 { case "waiting": if r.TryDecodeAsNil() { if x.Waiting != nil { @@ -18731,9 +19545,9 @@ func (x *ContainerState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Terminated.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1352) - } // end switch yys1352 - } // end for yyj1352 + z.DecStructFieldNotFound(-1, yys1408) + } // end switch yys1408 + } // end for yyj1408 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -18741,16 +19555,16 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1356 int - var yyb1356 bool - var yyhl1356 bool = l >= 0 - yyj1356++ - if yyhl1356 { - yyb1356 = yyj1356 > l + var yyj1412 int + var yyb1412 bool + var yyhl1412 bool = l >= 0 + yyj1412++ + if yyhl1412 { + yyb1412 = yyj1412 > l } else { - yyb1356 = r.CheckBreak() + yyb1412 = r.CheckBreak() } - if yyb1356 { + if yyb1412 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18765,13 +19579,13 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Waiting.CodecDecodeSelf(d) } - yyj1356++ - if yyhl1356 { - yyb1356 = yyj1356 > l + yyj1412++ + if yyhl1412 { + yyb1412 = yyj1412 > l } else { - yyb1356 = r.CheckBreak() + yyb1412 = r.CheckBreak() } - if yyb1356 { + if yyb1412 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18786,13 +19600,13 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Running.CodecDecodeSelf(d) } - yyj1356++ - if yyhl1356 { - yyb1356 = yyj1356 > l + yyj1412++ + if yyhl1412 { + yyb1412 = yyj1412 > l } else { - yyb1356 = r.CheckBreak() + yyb1412 = r.CheckBreak() } - if yyb1356 { + if yyb1412 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -18808,17 +19622,17 @@ func (x *ContainerState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Terminated.CodecDecodeSelf(d) } for { - yyj1356++ - if yyhl1356 { - yyb1356 = yyj1356 > l + yyj1412++ + if yyhl1412 { + yyb1412 = yyj1412 > l } else { - yyb1356 = r.CheckBreak() + yyb1412 = r.CheckBreak() } - if yyb1356 { + if yyb1412 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1356-1, "") + z.DecStructFieldNotFound(yyj1412-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18830,36 +19644,36 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1360 := z.EncBinary() - _ = yym1360 + yym1416 := z.EncBinary() + _ = yym1416 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1361 := !z.EncBinary() - yy2arr1361 := z.EncBasicHandle().StructToArray - var yyq1361 [8]bool - _, _, _ = yysep1361, yyq1361, yy2arr1361 - const yyr1361 bool = false - yyq1361[1] = true - yyq1361[2] = true - yyq1361[7] = x.ContainerID != "" - var yynn1361 int - if yyr1361 || yy2arr1361 { + yysep1417 := !z.EncBinary() + yy2arr1417 := z.EncBasicHandle().StructToArray + var yyq1417 [8]bool + _, _, _ = yysep1417, yyq1417, yy2arr1417 + const yyr1417 bool = false + yyq1417[1] = true + yyq1417[2] = true + yyq1417[7] = x.ContainerID != "" + var yynn1417 int + if yyr1417 || yy2arr1417 { r.EncodeArrayStart(8) } else { - yynn1361 = 5 - for _, b := range yyq1361 { + yynn1417 = 5 + for _, b := range yyq1417 { if b { - yynn1361++ + yynn1417++ } } - r.EncodeMapStart(yynn1361) - yynn1361 = 0 + r.EncodeMapStart(yynn1417) + yynn1417 = 0 } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1363 := z.EncBinary() - _ = yym1363 + yym1419 := z.EncBinary() + _ = yym1419 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -18868,51 +19682,51 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1364 := z.EncBinary() - _ = yym1364 + yym1420 := z.EncBinary() + _ = yym1420 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1361[1] { - yy1366 := &x.State - yy1366.CodecEncodeSelf(e) + if yyq1417[1] { + yy1422 := &x.State + yy1422.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1361[1] { + if yyq1417[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("state")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1367 := &x.State - yy1367.CodecEncodeSelf(e) + yy1423 := &x.State + yy1423.CodecEncodeSelf(e) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1361[2] { - yy1369 := &x.LastTerminationState - yy1369.CodecEncodeSelf(e) + if yyq1417[2] { + yy1425 := &x.LastTerminationState + yy1425.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1361[2] { + if yyq1417[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastState")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1370 := &x.LastTerminationState - yy1370.CodecEncodeSelf(e) + yy1426 := &x.LastTerminationState + yy1426.CodecEncodeSelf(e) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1372 := z.EncBinary() - _ = yym1372 + yym1428 := z.EncBinary() + _ = yym1428 if false { } else { r.EncodeBool(bool(x.Ready)) @@ -18921,17 +19735,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ready")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1373 := z.EncBinary() - _ = yym1373 + yym1429 := z.EncBinary() + _ = yym1429 if false { } else { r.EncodeBool(bool(x.Ready)) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1375 := z.EncBinary() - _ = yym1375 + yym1431 := z.EncBinary() + _ = yym1431 if false { } else { r.EncodeInt(int64(x.RestartCount)) @@ -18940,17 +19754,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("restartCount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1376 := z.EncBinary() - _ = yym1376 + yym1432 := z.EncBinary() + _ = yym1432 if false { } else { r.EncodeInt(int64(x.RestartCount)) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1378 := z.EncBinary() - _ = yym1378 + yym1434 := z.EncBinary() + _ = yym1434 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) @@ -18959,17 +19773,17 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1379 := z.EncBinary() - _ = yym1379 + yym1435 := z.EncBinary() + _ = yym1435 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Image)) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1381 := z.EncBinary() - _ = yym1381 + yym1437 := z.EncBinary() + _ = yym1437 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ImageID)) @@ -18978,18 +19792,18 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imageID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1382 := z.EncBinary() - _ = yym1382 + yym1438 := z.EncBinary() + _ = yym1438 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ImageID)) } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1361[7] { - yym1384 := z.EncBinary() - _ = yym1384 + if yyq1417[7] { + yym1440 := z.EncBinary() + _ = yym1440 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) @@ -18998,19 +19812,19 @@ func (x *ContainerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1361[7] { + if yyq1417[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1385 := z.EncBinary() - _ = yym1385 + yym1441 := z.EncBinary() + _ = yym1441 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerID)) } } } - if yyr1361 || yy2arr1361 { + if yyr1417 || yy2arr1417 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -19023,25 +19837,25 @@ func (x *ContainerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1386 := z.DecBinary() - _ = yym1386 + yym1442 := z.DecBinary() + _ = yym1442 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1387 := r.ContainerType() - if yyct1387 == codecSelferValueTypeMap1234 { - yyl1387 := r.ReadMapStart() - if yyl1387 == 0 { + yyct1443 := r.ContainerType() + if yyct1443 == codecSelferValueTypeMap1234 { + yyl1443 := r.ReadMapStart() + if yyl1443 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1387, d) + x.codecDecodeSelfFromMap(yyl1443, d) } - } else if yyct1387 == codecSelferValueTypeArray1234 { - yyl1387 := r.ReadArrayStart() - if yyl1387 == 0 { + } else if yyct1443 == codecSelferValueTypeArray1234 { + yyl1443 := r.ReadArrayStart() + if yyl1443 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1387, d) + x.codecDecodeSelfFromArray(yyl1443, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -19053,12 +19867,12 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1388Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1388Slc - var yyhl1388 bool = l >= 0 - for yyj1388 := 0; ; yyj1388++ { - if yyhl1388 { - if yyj1388 >= l { + var yys1444Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1444Slc + var yyhl1444 bool = l >= 0 + for yyj1444 := 0; ; yyj1444++ { + if yyhl1444 { + if yyj1444 >= l { break } } else { @@ -19067,10 +19881,10 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1388Slc = r.DecodeBytes(yys1388Slc, true, true) - yys1388 := string(yys1388Slc) + yys1444Slc = r.DecodeBytes(yys1444Slc, true, true) + yys1444 := string(yys1444Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1388 { + switch yys1444 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -19081,15 +19895,15 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.State = ContainerState{} } else { - yyv1390 := &x.State - yyv1390.CodecDecodeSelf(d) + yyv1446 := &x.State + yyv1446.CodecDecodeSelf(d) } case "lastState": if r.TryDecodeAsNil() { x.LastTerminationState = ContainerState{} } else { - yyv1391 := &x.LastTerminationState - yyv1391.CodecDecodeSelf(d) + yyv1447 := &x.LastTerminationState + yyv1447.CodecDecodeSelf(d) } case "ready": if r.TryDecodeAsNil() { @@ -19122,9 +19936,9 @@ func (x *ContainerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ContainerID = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1388) - } // end switch yys1388 - } // end for yyj1388 + z.DecStructFieldNotFound(-1, yys1444) + } // end switch yys1444 + } // end for yyj1444 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -19132,16 +19946,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1397 int - var yyb1397 bool - var yyhl1397 bool = l >= 0 - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + var yyj1453 int + var yyb1453 bool + var yyhl1453 bool = l >= 0 + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19151,13 +19965,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Name = string(r.DecodeString()) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19165,16 +19979,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.State = ContainerState{} } else { - yyv1399 := &x.State - yyv1399.CodecDecodeSelf(d) + yyv1455 := &x.State + yyv1455.CodecDecodeSelf(d) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19182,16 +19996,16 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.LastTerminationState = ContainerState{} } else { - yyv1400 := &x.LastTerminationState - yyv1400.CodecDecodeSelf(d) + yyv1456 := &x.LastTerminationState + yyv1456.CodecDecodeSelf(d) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19201,13 +20015,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Ready = bool(r.DecodeBool()) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19217,13 +20031,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.RestartCount = int32(r.DecodeInt(32)) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19233,13 +20047,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Image = string(r.DecodeString()) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19249,13 +20063,13 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ImageID = string(r.DecodeString()) } - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19266,17 +20080,17 @@ func (x *ContainerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ContainerID = string(r.DecodeString()) } for { - yyj1397++ - if yyhl1397 { - yyb1397 = yyj1397 > l + yyj1453++ + if yyhl1453 { + yyb1453 = yyj1453 > l } else { - yyb1397 = r.CheckBreak() + yyb1453 = r.CheckBreak() } - if yyb1397 { + if yyb1453 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1397-1, "") + z.DecStructFieldNotFound(yyj1453-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19285,8 +20099,8 @@ func (x PodPhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1406 := z.EncBinary() - _ = yym1406 + yym1462 := z.EncBinary() + _ = yym1462 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19298,8 +20112,8 @@ func (x *PodPhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1407 := z.DecBinary() - _ = yym1407 + yym1463 := z.DecBinary() + _ = yym1463 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19311,8 +20125,8 @@ func (x PodConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1408 := z.EncBinary() - _ = yym1408 + yym1464 := z.EncBinary() + _ = yym1464 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19324,8 +20138,8 @@ func (x *PodConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1409 := z.DecBinary() - _ = yym1409 + yym1465 := z.DecBinary() + _ = yym1465 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19340,34 +20154,34 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1410 := z.EncBinary() - _ = yym1410 + yym1466 := z.EncBinary() + _ = yym1466 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1411 := !z.EncBinary() - yy2arr1411 := z.EncBasicHandle().StructToArray - var yyq1411 [6]bool - _, _, _ = yysep1411, yyq1411, yy2arr1411 - const yyr1411 bool = false - yyq1411[2] = true - yyq1411[3] = true - yyq1411[4] = x.Reason != "" - yyq1411[5] = x.Message != "" - var yynn1411 int - if yyr1411 || yy2arr1411 { + yysep1467 := !z.EncBinary() + yy2arr1467 := z.EncBasicHandle().StructToArray + var yyq1467 [6]bool + _, _, _ = yysep1467, yyq1467, yy2arr1467 + const yyr1467 bool = false + yyq1467[2] = true + yyq1467[3] = true + yyq1467[4] = x.Reason != "" + yyq1467[5] = x.Message != "" + var yynn1467 int + if yyr1467 || yy2arr1467 { r.EncodeArrayStart(6) } else { - yynn1411 = 2 - for _, b := range yyq1411 { + yynn1467 = 2 + for _, b := range yyq1467 { if b { - yynn1411++ + yynn1467++ } } - r.EncodeMapStart(yynn1411) - yynn1411 = 0 + r.EncodeMapStart(yynn1467) + yynn1467 = 0 } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -19376,7 +20190,7 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -19385,85 +20199,85 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1411[2] { - yy1415 := &x.LastProbeTime - yym1416 := z.EncBinary() - _ = yym1416 + if yyq1467[2] { + yy1471 := &x.LastProbeTime + yym1472 := z.EncBinary() + _ = yym1472 if false { - } else if z.HasExtensions() && z.EncExt(yy1415) { - } else if yym1416 { - z.EncBinaryMarshal(yy1415) - } else if !yym1416 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1415) + } else if z.HasExtensions() && z.EncExt(yy1471) { + } else if yym1472 { + z.EncBinaryMarshal(yy1471) + } else if !yym1472 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1471) } else { - z.EncFallback(yy1415) + z.EncFallback(yy1471) } } else { r.EncodeNil() } } else { - if yyq1411[2] { + if yyq1467[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1417 := &x.LastProbeTime - yym1418 := z.EncBinary() - _ = yym1418 + yy1473 := &x.LastProbeTime + yym1474 := z.EncBinary() + _ = yym1474 if false { - } else if z.HasExtensions() && z.EncExt(yy1417) { - } else if yym1418 { - z.EncBinaryMarshal(yy1417) - } else if !yym1418 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1417) + } else if z.HasExtensions() && z.EncExt(yy1473) { + } else if yym1474 { + z.EncBinaryMarshal(yy1473) + } else if !yym1474 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1473) } else { - z.EncFallback(yy1417) + z.EncFallback(yy1473) } } } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1411[3] { - yy1420 := &x.LastTransitionTime - yym1421 := z.EncBinary() - _ = yym1421 + if yyq1467[3] { + yy1476 := &x.LastTransitionTime + yym1477 := z.EncBinary() + _ = yym1477 if false { - } else if z.HasExtensions() && z.EncExt(yy1420) { - } else if yym1421 { - z.EncBinaryMarshal(yy1420) - } else if !yym1421 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1420) + } else if z.HasExtensions() && z.EncExt(yy1476) { + } else if yym1477 { + z.EncBinaryMarshal(yy1476) + } else if !yym1477 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1476) } else { - z.EncFallback(yy1420) + z.EncFallback(yy1476) } } else { r.EncodeNil() } } else { - if yyq1411[3] { + if yyq1467[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1422 := &x.LastTransitionTime - yym1423 := z.EncBinary() - _ = yym1423 + yy1478 := &x.LastTransitionTime + yym1479 := z.EncBinary() + _ = yym1479 if false { - } else if z.HasExtensions() && z.EncExt(yy1422) { - } else if yym1423 { - z.EncBinaryMarshal(yy1422) - } else if !yym1423 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1422) + } else if z.HasExtensions() && z.EncExt(yy1478) { + } else if yym1479 { + z.EncBinaryMarshal(yy1478) + } else if !yym1479 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1478) } else { - z.EncFallback(yy1422) + z.EncFallback(yy1478) } } } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1411[4] { - yym1425 := z.EncBinary() - _ = yym1425 + if yyq1467[4] { + yym1481 := z.EncBinary() + _ = yym1481 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -19472,23 +20286,23 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1411[4] { + if yyq1467[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1426 := z.EncBinary() - _ = yym1426 + yym1482 := z.EncBinary() + _ = yym1482 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1411[5] { - yym1428 := z.EncBinary() - _ = yym1428 + if yyq1467[5] { + yym1484 := z.EncBinary() + _ = yym1484 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -19497,19 +20311,19 @@ func (x *PodCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1411[5] { + if yyq1467[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1429 := z.EncBinary() - _ = yym1429 + yym1485 := z.EncBinary() + _ = yym1485 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1411 || yy2arr1411 { + if yyr1467 || yy2arr1467 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -19522,25 +20336,25 @@ func (x *PodCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1430 := z.DecBinary() - _ = yym1430 + yym1486 := z.DecBinary() + _ = yym1486 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1431 := r.ContainerType() - if yyct1431 == codecSelferValueTypeMap1234 { - yyl1431 := r.ReadMapStart() - if yyl1431 == 0 { + yyct1487 := r.ContainerType() + if yyct1487 == codecSelferValueTypeMap1234 { + yyl1487 := r.ReadMapStart() + if yyl1487 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1431, d) + x.codecDecodeSelfFromMap(yyl1487, d) } - } else if yyct1431 == codecSelferValueTypeArray1234 { - yyl1431 := r.ReadArrayStart() - if yyl1431 == 0 { + } else if yyct1487 == codecSelferValueTypeArray1234 { + yyl1487 := r.ReadArrayStart() + if yyl1487 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1431, d) + x.codecDecodeSelfFromArray(yyl1487, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -19552,12 +20366,12 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1432Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1432Slc - var yyhl1432 bool = l >= 0 - for yyj1432 := 0; ; yyj1432++ { - if yyhl1432 { - if yyj1432 >= l { + var yys1488Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1488Slc + var yyhl1488 bool = l >= 0 + for yyj1488 := 0; ; yyj1488++ { + if yyhl1488 { + if yyj1488 >= l { break } } else { @@ -19566,10 +20380,10 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1432Slc = r.DecodeBytes(yys1432Slc, true, true) - yys1432 := string(yys1432Slc) + yys1488Slc = r.DecodeBytes(yys1488Slc, true, true) + yys1488 := string(yys1488Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1432 { + switch yys1488 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -19586,34 +20400,34 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg2_unversioned.Time{} } else { - yyv1435 := &x.LastProbeTime - yym1436 := z.DecBinary() - _ = yym1436 + yyv1491 := &x.LastProbeTime + yym1492 := z.DecBinary() + _ = yym1492 if false { - } else if z.HasExtensions() && z.DecExt(yyv1435) { - } else if yym1436 { - z.DecBinaryUnmarshal(yyv1435) - } else if !yym1436 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1435) + } else if z.HasExtensions() && z.DecExt(yyv1491) { + } else if yym1492 { + z.DecBinaryUnmarshal(yyv1491) + } else if !yym1492 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1491) } else { - z.DecFallback(yyv1435, false) + z.DecFallback(yyv1491, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv1437 := &x.LastTransitionTime - yym1438 := z.DecBinary() - _ = yym1438 + yyv1493 := &x.LastTransitionTime + yym1494 := z.DecBinary() + _ = yym1494 if false { - } else if z.HasExtensions() && z.DecExt(yyv1437) { - } else if yym1438 { - z.DecBinaryUnmarshal(yyv1437) - } else if !yym1438 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1437) + } else if z.HasExtensions() && z.DecExt(yyv1493) { + } else if yym1494 { + z.DecBinaryUnmarshal(yyv1493) + } else if !yym1494 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1493) } else { - z.DecFallback(yyv1437, false) + z.DecFallback(yyv1493, false) } } case "reason": @@ -19629,9 +20443,9 @@ func (x *PodCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1432) - } // end switch yys1432 - } // end for yyj1432 + z.DecStructFieldNotFound(-1, yys1488) + } // end switch yys1488 + } // end for yyj1488 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -19639,16 +20453,16 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1441 int - var yyb1441 bool - var yyhl1441 bool = l >= 0 - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + var yyj1497 int + var yyb1497 bool + var yyhl1497 bool = l >= 0 + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19658,13 +20472,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = PodConditionType(r.DecodeString()) } - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19674,13 +20488,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19688,26 +20502,26 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg2_unversioned.Time{} } else { - yyv1444 := &x.LastProbeTime - yym1445 := z.DecBinary() - _ = yym1445 + yyv1500 := &x.LastProbeTime + yym1501 := z.DecBinary() + _ = yym1501 if false { - } else if z.HasExtensions() && z.DecExt(yyv1444) { - } else if yym1445 { - z.DecBinaryUnmarshal(yyv1444) - } else if !yym1445 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1444) + } else if z.HasExtensions() && z.DecExt(yyv1500) { + } else if yym1501 { + z.DecBinaryUnmarshal(yyv1500) + } else if !yym1501 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1500) } else { - z.DecFallback(yyv1444, false) + z.DecFallback(yyv1500, false) } } - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19715,26 +20529,26 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv1446 := &x.LastTransitionTime - yym1447 := z.DecBinary() - _ = yym1447 + yyv1502 := &x.LastTransitionTime + yym1503 := z.DecBinary() + _ = yym1503 if false { - } else if z.HasExtensions() && z.DecExt(yyv1446) { - } else if yym1447 { - z.DecBinaryUnmarshal(yyv1446) - } else if !yym1447 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1446) + } else if z.HasExtensions() && z.DecExt(yyv1502) { + } else if yym1503 { + z.DecBinaryUnmarshal(yyv1502) + } else if !yym1503 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1502) } else { - z.DecFallback(yyv1446, false) + z.DecFallback(yyv1502, false) } } - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19744,13 +20558,13 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -19761,17 +20575,17 @@ func (x *PodCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj1441++ - if yyhl1441 { - yyb1441 = yyj1441 > l + yyj1497++ + if yyhl1497 { + yyb1497 = yyj1497 > l } else { - yyb1441 = r.CheckBreak() + yyb1497 = r.CheckBreak() } - if yyb1441 { + if yyb1497 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1441-1, "") + z.DecStructFieldNotFound(yyj1497-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19780,8 +20594,8 @@ func (x RestartPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1450 := z.EncBinary() - _ = yym1450 + yym1506 := z.EncBinary() + _ = yym1506 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19793,8 +20607,8 @@ func (x *RestartPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1451 := z.DecBinary() - _ = yym1451 + yym1507 := z.DecBinary() + _ = yym1507 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19806,8 +20620,8 @@ func (x DNSPolicy) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1452 := z.EncBinary() - _ = yym1452 + yym1508 := z.EncBinary() + _ = yym1508 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -19819,8 +20633,8 @@ func (x *DNSPolicy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1453 := z.DecBinary() - _ = yym1453 + yym1509 := z.DecBinary() + _ = yym1509 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -19828,6 +20642,1332 @@ func (x *DNSPolicy) CodecDecodeSelf(d *codec1978.Decoder) { } } +func (x *NodeSelector) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1510 := z.EncBinary() + _ = yym1510 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1511 := !z.EncBinary() + yy2arr1511 := z.EncBasicHandle().StructToArray + var yyq1511 [1]bool + _, _, _ = yysep1511, yyq1511, yy2arr1511 + const yyr1511 bool = false + var yynn1511 int + if yyr1511 || yy2arr1511 { + r.EncodeArrayStart(1) + } else { + yynn1511 = 1 + for _, b := range yyq1511 { + if b { + yynn1511++ + } + } + r.EncodeMapStart(yynn1511) + yynn1511 = 0 + } + if yyr1511 || yy2arr1511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.NodeSelectorTerms == nil { + r.EncodeNil() + } else { + yym1513 := z.EncBinary() + _ = yym1513 + if false { + } else { + h.encSliceNodeSelectorTerm(([]NodeSelectorTerm)(x.NodeSelectorTerms), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nodeSelectorTerms")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.NodeSelectorTerms == nil { + r.EncodeNil() + } else { + yym1514 := z.EncBinary() + _ = yym1514 + if false { + } else { + h.encSliceNodeSelectorTerm(([]NodeSelectorTerm)(x.NodeSelectorTerms), e) + } + } + } + if yyr1511 || yy2arr1511 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelector) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1515 := z.DecBinary() + _ = yym1515 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1516 := r.ContainerType() + if yyct1516 == codecSelferValueTypeMap1234 { + yyl1516 := r.ReadMapStart() + if yyl1516 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1516, d) + } + } else if yyct1516 == codecSelferValueTypeArray1234 { + yyl1516 := r.ReadArrayStart() + if yyl1516 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1516, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1517Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1517Slc + var yyhl1517 bool = l >= 0 + for yyj1517 := 0; ; yyj1517++ { + if yyhl1517 { + if yyj1517 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1517Slc = r.DecodeBytes(yys1517Slc, true, true) + yys1517 := string(yys1517Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1517 { + case "nodeSelectorTerms": + if r.TryDecodeAsNil() { + x.NodeSelectorTerms = nil + } else { + yyv1518 := &x.NodeSelectorTerms + yym1519 := z.DecBinary() + _ = yym1519 + if false { + } else { + h.decSliceNodeSelectorTerm((*[]NodeSelectorTerm)(yyv1518), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1517) + } // end switch yys1517 + } // end for yyj1517 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1520 int + var yyb1520 bool + var yyhl1520 bool = l >= 0 + yyj1520++ + if yyhl1520 { + yyb1520 = yyj1520 > l + } else { + yyb1520 = r.CheckBreak() + } + if yyb1520 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.NodeSelectorTerms = nil + } else { + yyv1521 := &x.NodeSelectorTerms + yym1522 := z.DecBinary() + _ = yym1522 + if false { + } else { + h.decSliceNodeSelectorTerm((*[]NodeSelectorTerm)(yyv1521), d) + } + } + for { + yyj1520++ + if yyhl1520 { + yyb1520 = yyj1520 > l + } else { + yyb1520 = r.CheckBreak() + } + if yyb1520 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1520-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeSelectorTerm) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1523 := z.EncBinary() + _ = yym1523 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1524 := !z.EncBinary() + yy2arr1524 := z.EncBasicHandle().StructToArray + var yyq1524 [1]bool + _, _, _ = yysep1524, yyq1524, yy2arr1524 + const yyr1524 bool = false + var yynn1524 int + if yyr1524 || yy2arr1524 { + r.EncodeArrayStart(1) + } else { + yynn1524 = 1 + for _, b := range yyq1524 { + if b { + yynn1524++ + } + } + r.EncodeMapStart(yynn1524) + yynn1524 = 0 + } + if yyr1524 || yy2arr1524 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.MatchExpressions == nil { + r.EncodeNil() + } else { + yym1526 := z.EncBinary() + _ = yym1526 + if false { + } else { + h.encSliceNodeSelectorRequirement(([]NodeSelectorRequirement)(x.MatchExpressions), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("matchExpressions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.MatchExpressions == nil { + r.EncodeNil() + } else { + yym1527 := z.EncBinary() + _ = yym1527 + if false { + } else { + h.encSliceNodeSelectorRequirement(([]NodeSelectorRequirement)(x.MatchExpressions), e) + } + } + } + if yyr1524 || yy2arr1524 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelectorTerm) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1528 := z.DecBinary() + _ = yym1528 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1529 := r.ContainerType() + if yyct1529 == codecSelferValueTypeMap1234 { + yyl1529 := r.ReadMapStart() + if yyl1529 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1529, d) + } + } else if yyct1529 == codecSelferValueTypeArray1234 { + yyl1529 := r.ReadArrayStart() + if yyl1529 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1529, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelectorTerm) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1530Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1530Slc + var yyhl1530 bool = l >= 0 + for yyj1530 := 0; ; yyj1530++ { + if yyhl1530 { + if yyj1530 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1530Slc = r.DecodeBytes(yys1530Slc, true, true) + yys1530 := string(yys1530Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1530 { + case "matchExpressions": + if r.TryDecodeAsNil() { + x.MatchExpressions = nil + } else { + yyv1531 := &x.MatchExpressions + yym1532 := z.DecBinary() + _ = yym1532 + if false { + } else { + h.decSliceNodeSelectorRequirement((*[]NodeSelectorRequirement)(yyv1531), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1530) + } // end switch yys1530 + } // end for yyj1530 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelectorTerm) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1533 int + var yyb1533 bool + var yyhl1533 bool = l >= 0 + yyj1533++ + if yyhl1533 { + yyb1533 = yyj1533 > l + } else { + yyb1533 = r.CheckBreak() + } + if yyb1533 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.MatchExpressions = nil + } else { + yyv1534 := &x.MatchExpressions + yym1535 := z.DecBinary() + _ = yym1535 + if false { + } else { + h.decSliceNodeSelectorRequirement((*[]NodeSelectorRequirement)(yyv1534), d) + } + } + for { + yyj1533++ + if yyhl1533 { + yyb1533 = yyj1533 > l + } else { + yyb1533 = r.CheckBreak() + } + if yyb1533 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1533-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1536 := z.EncBinary() + _ = yym1536 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1537 := !z.EncBinary() + yy2arr1537 := z.EncBasicHandle().StructToArray + var yyq1537 [3]bool + _, _, _ = yysep1537, yyq1537, yy2arr1537 + const yyr1537 bool = false + yyq1537[2] = len(x.Values) != 0 + var yynn1537 int + if yyr1537 || yy2arr1537 { + r.EncodeArrayStart(3) + } else { + yynn1537 = 2 + for _, b := range yyq1537 { + if b { + yynn1537++ + } + } + r.EncodeMapStart(yynn1537) + yynn1537 = 0 + } + if yyr1537 || yy2arr1537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1539 := z.EncBinary() + _ = yym1539 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("key")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1540 := z.EncBinary() + _ = yym1540 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Key)) + } + } + if yyr1537 || yy2arr1537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + x.Operator.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("operator")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Operator.CodecEncodeSelf(e) + } + if yyr1537 || yy2arr1537 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1537[2] { + if x.Values == nil { + r.EncodeNil() + } else { + yym1543 := z.EncBinary() + _ = yym1543 + if false { + } else { + z.F.EncSliceStringV(x.Values, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1537[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("values")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Values == nil { + r.EncodeNil() + } else { + yym1544 := z.EncBinary() + _ = yym1544 + if false { + } else { + z.F.EncSliceStringV(x.Values, false, e) + } + } + } + } + if yyr1537 || yy2arr1537 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeSelectorRequirement) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1545 := z.DecBinary() + _ = yym1545 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1546 := r.ContainerType() + if yyct1546 == codecSelferValueTypeMap1234 { + yyl1546 := r.ReadMapStart() + if yyl1546 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1546, d) + } + } else if yyct1546 == codecSelferValueTypeArray1234 { + yyl1546 := r.ReadArrayStart() + if yyl1546 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1546, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1547Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1547Slc + var yyhl1547 bool = l >= 0 + for yyj1547 := 0; ; yyj1547++ { + if yyhl1547 { + if yyj1547 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1547Slc = r.DecodeBytes(yys1547Slc, true, true) + yys1547 := string(yys1547Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1547 { + case "key": + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + case "operator": + if r.TryDecodeAsNil() { + x.Operator = "" + } else { + x.Operator = NodeSelectorOperator(r.DecodeString()) + } + case "values": + if r.TryDecodeAsNil() { + x.Values = nil + } else { + yyv1550 := &x.Values + yym1551 := z.DecBinary() + _ = yym1551 + if false { + } else { + z.F.DecSliceStringX(yyv1550, false, d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1547) + } // end switch yys1547 + } // end for yyj1547 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1552 int + var yyb1552 bool + var yyhl1552 bool = l >= 0 + yyj1552++ + if yyhl1552 { + yyb1552 = yyj1552 > l + } else { + yyb1552 = r.CheckBreak() + } + if yyb1552 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + yyj1552++ + if yyhl1552 { + yyb1552 = yyj1552 > l + } else { + yyb1552 = r.CheckBreak() + } + if yyb1552 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Operator = "" + } else { + x.Operator = NodeSelectorOperator(r.DecodeString()) + } + yyj1552++ + if yyhl1552 { + yyb1552 = yyj1552 > l + } else { + yyb1552 = r.CheckBreak() + } + if yyb1552 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Values = nil + } else { + yyv1555 := &x.Values + yym1556 := z.DecBinary() + _ = yym1556 + if false { + } else { + z.F.DecSliceStringX(yyv1555, false, d) + } + } + for { + yyj1552++ + if yyhl1552 { + yyb1552 = yyj1552 > l + } else { + yyb1552 = r.CheckBreak() + } + if yyb1552 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1552-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x NodeSelectorOperator) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1557 := z.EncBinary() + _ = yym1557 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *NodeSelectorOperator) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1558 := z.DecBinary() + _ = yym1558 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *Affinity) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1559 := z.EncBinary() + _ = yym1559 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1560 := !z.EncBinary() + yy2arr1560 := z.EncBasicHandle().StructToArray + var yyq1560 [1]bool + _, _, _ = yysep1560, yyq1560, yy2arr1560 + const yyr1560 bool = false + yyq1560[0] = x.NodeAffinity != nil + var yynn1560 int + if yyr1560 || yy2arr1560 { + r.EncodeArrayStart(1) + } else { + yynn1560 = 0 + for _, b := range yyq1560 { + if b { + yynn1560++ + } + } + r.EncodeMapStart(yynn1560) + yynn1560 = 0 + } + if yyr1560 || yy2arr1560 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1560[0] { + if x.NodeAffinity == nil { + r.EncodeNil() + } else { + x.NodeAffinity.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1560[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("nodeAffinity")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.NodeAffinity == nil { + r.EncodeNil() + } else { + x.NodeAffinity.CodecEncodeSelf(e) + } + } + } + if yyr1560 || yy2arr1560 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Affinity) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1562 := z.DecBinary() + _ = yym1562 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1563 := r.ContainerType() + if yyct1563 == codecSelferValueTypeMap1234 { + yyl1563 := r.ReadMapStart() + if yyl1563 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1563, d) + } + } else if yyct1563 == codecSelferValueTypeArray1234 { + yyl1563 := r.ReadArrayStart() + if yyl1563 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1563, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Affinity) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1564Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1564Slc + var yyhl1564 bool = l >= 0 + for yyj1564 := 0; ; yyj1564++ { + if yyhl1564 { + if yyj1564 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1564Slc = r.DecodeBytes(yys1564Slc, true, true) + yys1564 := string(yys1564Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1564 { + case "nodeAffinity": + if r.TryDecodeAsNil() { + if x.NodeAffinity != nil { + x.NodeAffinity = nil + } + } else { + if x.NodeAffinity == nil { + x.NodeAffinity = new(NodeAffinity) + } + x.NodeAffinity.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1564) + } // end switch yys1564 + } // end for yyj1564 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Affinity) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1566 int + var yyb1566 bool + var yyhl1566 bool = l >= 0 + yyj1566++ + if yyhl1566 { + yyb1566 = yyj1566 > l + } else { + yyb1566 = r.CheckBreak() + } + if yyb1566 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.NodeAffinity != nil { + x.NodeAffinity = nil + } + } else { + if x.NodeAffinity == nil { + x.NodeAffinity = new(NodeAffinity) + } + x.NodeAffinity.CodecDecodeSelf(d) + } + for { + yyj1566++ + if yyhl1566 { + yyb1566 = yyj1566 > l + } else { + yyb1566 = r.CheckBreak() + } + if yyb1566 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1566-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NodeAffinity) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1568 := z.EncBinary() + _ = yym1568 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1569 := !z.EncBinary() + yy2arr1569 := z.EncBasicHandle().StructToArray + var yyq1569 [3]bool + _, _, _ = yysep1569, yyq1569, yy2arr1569 + const yyr1569 bool = false + yyq1569[0] = x.RequiredDuringSchedulingRequiredDuringExecution != nil + yyq1569[1] = x.RequiredDuringSchedulingIgnoredDuringExecution != nil + yyq1569[2] = len(x.PreferredDuringSchedulingIgnoredDuringExecution) != 0 + var yynn1569 int + if yyr1569 || yy2arr1569 { + r.EncodeArrayStart(3) + } else { + yynn1569 = 0 + for _, b := range yyq1569 { + if b { + yynn1569++ + } + } + r.EncodeMapStart(yynn1569) + yynn1569 = 0 + } + if yyr1569 || yy2arr1569 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1569[0] { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingRequiredDuringExecution.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1569[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("requiredDuringSchedulingRequiredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingRequiredDuringExecution.CodecEncodeSelf(e) + } + } + } + if yyr1569 || yy2arr1569 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1569[1] { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1569[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("requiredDuringSchedulingIgnoredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecEncodeSelf(e) + } + } + } + if yyr1569 || yy2arr1569 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1569[2] { + if x.PreferredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + yym1573 := z.EncBinary() + _ = yym1573 + if false { + } else { + h.encSlicePreferredSchedulingTerm(([]PreferredSchedulingTerm)(x.PreferredDuringSchedulingIgnoredDuringExecution), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1569[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("preferredDuringSchedulingIgnoredDuringExecution")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.PreferredDuringSchedulingIgnoredDuringExecution == nil { + r.EncodeNil() + } else { + yym1574 := z.EncBinary() + _ = yym1574 + if false { + } else { + h.encSlicePreferredSchedulingTerm(([]PreferredSchedulingTerm)(x.PreferredDuringSchedulingIgnoredDuringExecution), e) + } + } + } + } + if yyr1569 || yy2arr1569 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NodeAffinity) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1575 := z.DecBinary() + _ = yym1575 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1576 := r.ContainerType() + if yyct1576 == codecSelferValueTypeMap1234 { + yyl1576 := r.ReadMapStart() + if yyl1576 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1576, d) + } + } else if yyct1576 == codecSelferValueTypeArray1234 { + yyl1576 := r.ReadArrayStart() + if yyl1576 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1576, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NodeAffinity) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1577Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1577Slc + var yyhl1577 bool = l >= 0 + for yyj1577 := 0; ; yyj1577++ { + if yyhl1577 { + if yyj1577 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1577Slc = r.DecodeBytes(yys1577Slc, true, true) + yys1577 := string(yys1577Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1577 { + case "requiredDuringSchedulingRequiredDuringExecution": + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingRequiredDuringExecution != nil { + x.RequiredDuringSchedulingRequiredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + x.RequiredDuringSchedulingRequiredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingRequiredDuringExecution.CodecDecodeSelf(d) + } + case "requiredDuringSchedulingIgnoredDuringExecution": + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingIgnoredDuringExecution != nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecDecodeSelf(d) + } + case "preferredDuringSchedulingIgnoredDuringExecution": + if r.TryDecodeAsNil() { + x.PreferredDuringSchedulingIgnoredDuringExecution = nil + } else { + yyv1580 := &x.PreferredDuringSchedulingIgnoredDuringExecution + yym1581 := z.DecBinary() + _ = yym1581 + if false { + } else { + h.decSlicePreferredSchedulingTerm((*[]PreferredSchedulingTerm)(yyv1580), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1577) + } // end switch yys1577 + } // end for yyj1577 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NodeAffinity) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1582 int + var yyb1582 bool + var yyhl1582 bool = l >= 0 + yyj1582++ + if yyhl1582 { + yyb1582 = yyj1582 > l + } else { + yyb1582 = r.CheckBreak() + } + if yyb1582 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingRequiredDuringExecution != nil { + x.RequiredDuringSchedulingRequiredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingRequiredDuringExecution == nil { + x.RequiredDuringSchedulingRequiredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingRequiredDuringExecution.CodecDecodeSelf(d) + } + yyj1582++ + if yyhl1582 { + yyb1582 = yyj1582 > l + } else { + yyb1582 = r.CheckBreak() + } + if yyb1582 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.RequiredDuringSchedulingIgnoredDuringExecution != nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = nil + } + } else { + if x.RequiredDuringSchedulingIgnoredDuringExecution == nil { + x.RequiredDuringSchedulingIgnoredDuringExecution = new(NodeSelector) + } + x.RequiredDuringSchedulingIgnoredDuringExecution.CodecDecodeSelf(d) + } + yyj1582++ + if yyhl1582 { + yyb1582 = yyj1582 > l + } else { + yyb1582 = r.CheckBreak() + } + if yyb1582 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PreferredDuringSchedulingIgnoredDuringExecution = nil + } else { + yyv1585 := &x.PreferredDuringSchedulingIgnoredDuringExecution + yym1586 := z.DecBinary() + _ = yym1586 + if false { + } else { + h.decSlicePreferredSchedulingTerm((*[]PreferredSchedulingTerm)(yyv1585), d) + } + } + for { + yyj1582++ + if yyhl1582 { + yyb1582 = yyj1582 > l + } else { + yyb1582 = r.CheckBreak() + } + if yyb1582 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1582-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PreferredSchedulingTerm) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1587 := z.EncBinary() + _ = yym1587 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1588 := !z.EncBinary() + yy2arr1588 := z.EncBasicHandle().StructToArray + var yyq1588 [2]bool + _, _, _ = yysep1588, yyq1588, yy2arr1588 + const yyr1588 bool = false + var yynn1588 int + if yyr1588 || yy2arr1588 { + r.EncodeArrayStart(2) + } else { + yynn1588 = 2 + for _, b := range yyq1588 { + if b { + yynn1588++ + } + } + r.EncodeMapStart(yynn1588) + yynn1588 = 0 + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1590 := z.EncBinary() + _ = yym1590 + if false { + } else { + r.EncodeInt(int64(x.Weight)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("weight")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1591 := z.EncBinary() + _ = yym1591 + if false { + } else { + r.EncodeInt(int64(x.Weight)) + } + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1593 := &x.Preference + yy1593.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("preference")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1594 := &x.Preference + yy1594.CodecEncodeSelf(e) + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PreferredSchedulingTerm) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1595 := z.DecBinary() + _ = yym1595 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1596 := r.ContainerType() + if yyct1596 == codecSelferValueTypeMap1234 { + yyl1596 := r.ReadMapStart() + if yyl1596 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1596, d) + } + } else if yyct1596 == codecSelferValueTypeArray1234 { + yyl1596 := r.ReadArrayStart() + if yyl1596 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1596, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PreferredSchedulingTerm) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1597Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1597Slc + var yyhl1597 bool = l >= 0 + for yyj1597 := 0; ; yyj1597++ { + if yyhl1597 { + if yyj1597 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1597Slc = r.DecodeBytes(yys1597Slc, true, true) + yys1597 := string(yys1597Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1597 { + case "weight": + if r.TryDecodeAsNil() { + x.Weight = 0 + } else { + x.Weight = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "preference": + if r.TryDecodeAsNil() { + x.Preference = NodeSelectorTerm{} + } else { + yyv1599 := &x.Preference + yyv1599.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1597) + } // end switch yys1597 + } // end for yyj1597 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PreferredSchedulingTerm) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1600 int + var yyb1600 bool + var yyhl1600 bool = l >= 0 + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Weight = 0 + } else { + x.Weight = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Preference = NodeSelectorTerm{} + } else { + yyv1602 := &x.Preference + yyv1602.CodecDecodeSelf(d) + } + for { + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1600-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -19835,51 +21975,51 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1454 := z.EncBinary() - _ = yym1454 + yym1603 := z.EncBinary() + _ = yym1603 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1455 := !z.EncBinary() - yy2arr1455 := z.EncBasicHandle().StructToArray - var yyq1455 [15]bool - _, _, _ = yysep1455, yyq1455, yy2arr1455 - const yyr1455 bool = false - yyq1455[0] = len(x.Volumes) != 0 - yyq1455[2] = x.RestartPolicy != "" - yyq1455[3] = x.TerminationGracePeriodSeconds != nil - yyq1455[4] = x.ActiveDeadlineSeconds != nil - yyq1455[5] = x.DNSPolicy != "" - yyq1455[6] = len(x.NodeSelector) != 0 - yyq1455[7] = x.ServiceAccountName != "" - yyq1455[8] = x.DeprecatedServiceAccount != "" - yyq1455[9] = x.NodeName != "" - yyq1455[10] = x.HostNetwork != false - yyq1455[11] = x.HostPID != false - yyq1455[12] = x.HostIPC != false - yyq1455[13] = x.SecurityContext != nil - yyq1455[14] = len(x.ImagePullSecrets) != 0 - var yynn1455 int - if yyr1455 || yy2arr1455 { + yysep1604 := !z.EncBinary() + yy2arr1604 := z.EncBasicHandle().StructToArray + var yyq1604 [15]bool + _, _, _ = yysep1604, yyq1604, yy2arr1604 + const yyr1604 bool = false + yyq1604[0] = len(x.Volumes) != 0 + yyq1604[2] = x.RestartPolicy != "" + yyq1604[3] = x.TerminationGracePeriodSeconds != nil + yyq1604[4] = x.ActiveDeadlineSeconds != nil + yyq1604[5] = x.DNSPolicy != "" + yyq1604[6] = len(x.NodeSelector) != 0 + yyq1604[7] = x.ServiceAccountName != "" + yyq1604[8] = x.DeprecatedServiceAccount != "" + yyq1604[9] = x.NodeName != "" + yyq1604[10] = x.HostNetwork != false + yyq1604[11] = x.HostPID != false + yyq1604[12] = x.HostIPC != false + yyq1604[13] = x.SecurityContext != nil + yyq1604[14] = len(x.ImagePullSecrets) != 0 + var yynn1604 int + if yyr1604 || yy2arr1604 { r.EncodeArrayStart(15) } else { - yynn1455 = 1 - for _, b := range yyq1455 { + yynn1604 = 1 + for _, b := range yyq1604 { if b { - yynn1455++ + yynn1604++ } } - r.EncodeMapStart(yynn1455) - yynn1455 = 0 + r.EncodeMapStart(yynn1604) + yynn1604 = 0 } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[0] { + if yyq1604[0] { if x.Volumes == nil { r.EncodeNil() } else { - yym1457 := z.EncBinary() - _ = yym1457 + yym1606 := z.EncBinary() + _ = yym1606 if false { } else { h.encSliceVolume(([]Volume)(x.Volumes), e) @@ -19889,15 +22029,15 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1455[0] { + if yyq1604[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Volumes == nil { r.EncodeNil() } else { - yym1458 := z.EncBinary() - _ = yym1458 + yym1607 := z.EncBinary() + _ = yym1607 if false { } else { h.encSliceVolume(([]Volume)(x.Volumes), e) @@ -19905,13 +22045,13 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Containers == nil { r.EncodeNil() } else { - yym1460 := z.EncBinary() - _ = yym1460 + yym1609 := z.EncBinary() + _ = yym1609 if false { } else { h.encSliceContainer(([]Container)(x.Containers), e) @@ -19924,122 +22064,122 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Containers == nil { r.EncodeNil() } else { - yym1461 := z.EncBinary() - _ = yym1461 + yym1610 := z.EncBinary() + _ = yym1610 if false { } else { h.encSliceContainer(([]Container)(x.Containers), e) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[2] { + if yyq1604[2] { x.RestartPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1455[2] { + if yyq1604[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("restartPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.RestartPolicy.CodecEncodeSelf(e) } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[3] { + if yyq1604[3] { if x.TerminationGracePeriodSeconds == nil { r.EncodeNil() } else { - yy1464 := *x.TerminationGracePeriodSeconds - yym1465 := z.EncBinary() - _ = yym1465 + yy1613 := *x.TerminationGracePeriodSeconds + yym1614 := z.EncBinary() + _ = yym1614 if false { } else { - r.EncodeInt(int64(yy1464)) + r.EncodeInt(int64(yy1613)) } } } else { r.EncodeNil() } } else { - if yyq1455[3] { + if yyq1604[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("terminationGracePeriodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.TerminationGracePeriodSeconds == nil { r.EncodeNil() } else { - yy1466 := *x.TerminationGracePeriodSeconds - yym1467 := z.EncBinary() - _ = yym1467 + yy1615 := *x.TerminationGracePeriodSeconds + yym1616 := z.EncBinary() + _ = yym1616 if false { } else { - r.EncodeInt(int64(yy1466)) + r.EncodeInt(int64(yy1615)) } } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[4] { + if yyq1604[4] { if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy1469 := *x.ActiveDeadlineSeconds - yym1470 := z.EncBinary() - _ = yym1470 + yy1618 := *x.ActiveDeadlineSeconds + yym1619 := z.EncBinary() + _ = yym1619 if false { } else { - r.EncodeInt(int64(yy1469)) + r.EncodeInt(int64(yy1618)) } } } else { r.EncodeNil() } } else { - if yyq1455[4] { + if yyq1604[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("activeDeadlineSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy1471 := *x.ActiveDeadlineSeconds - yym1472 := z.EncBinary() - _ = yym1472 + yy1620 := *x.ActiveDeadlineSeconds + yym1621 := z.EncBinary() + _ = yym1621 if false { } else { - r.EncodeInt(int64(yy1471)) + r.EncodeInt(int64(yy1620)) } } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[5] { + if yyq1604[5] { x.DNSPolicy.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1455[5] { + if yyq1604[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("dnsPolicy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.DNSPolicy.CodecEncodeSelf(e) } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[6] { + if yyq1604[6] { if x.NodeSelector == nil { r.EncodeNil() } else { - yym1475 := z.EncBinary() - _ = yym1475 + yym1624 := z.EncBinary() + _ = yym1624 if false { } else { z.F.EncMapStringStringV(x.NodeSelector, false, e) @@ -20049,15 +22189,15 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1455[6] { + if yyq1604[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeSelector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.NodeSelector == nil { r.EncodeNil() } else { - yym1476 := z.EncBinary() - _ = yym1476 + yym1625 := z.EncBinary() + _ = yym1625 if false { } else { z.F.EncMapStringStringV(x.NodeSelector, false, e) @@ -20065,11 +22205,11 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[7] { - yym1478 := z.EncBinary() - _ = yym1478 + if yyq1604[7] { + yym1627 := z.EncBinary() + _ = yym1627 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountName)) @@ -20078,23 +22218,23 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1455[7] { + if yyq1604[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceAccountName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1479 := z.EncBinary() - _ = yym1479 + yym1628 := z.EncBinary() + _ = yym1628 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceAccountName)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[8] { - yym1481 := z.EncBinary() - _ = yym1481 + if yyq1604[8] { + yym1630 := z.EncBinary() + _ = yym1630 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DeprecatedServiceAccount)) @@ -20103,23 +22243,23 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1455[8] { + if yyq1604[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceAccount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1482 := z.EncBinary() - _ = yym1482 + yym1631 := z.EncBinary() + _ = yym1631 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DeprecatedServiceAccount)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[9] { - yym1484 := z.EncBinary() - _ = yym1484 + if yyq1604[9] { + yym1633 := z.EncBinary() + _ = yym1633 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeName)) @@ -20128,23 +22268,23 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1455[9] { + if yyq1604[9] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1485 := z.EncBinary() - _ = yym1485 + yym1634 := z.EncBinary() + _ = yym1634 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeName)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[10] { - yym1487 := z.EncBinary() - _ = yym1487 + if yyq1604[10] { + yym1636 := z.EncBinary() + _ = yym1636 if false { } else { r.EncodeBool(bool(x.HostNetwork)) @@ -20153,23 +22293,23 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1455[10] { + if yyq1604[10] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostNetwork")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1488 := z.EncBinary() - _ = yym1488 + yym1637 := z.EncBinary() + _ = yym1637 if false { } else { r.EncodeBool(bool(x.HostNetwork)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[11] { - yym1490 := z.EncBinary() - _ = yym1490 + if yyq1604[11] { + yym1639 := z.EncBinary() + _ = yym1639 if false { } else { r.EncodeBool(bool(x.HostPID)) @@ -20178,23 +22318,23 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1455[11] { + if yyq1604[11] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1491 := z.EncBinary() - _ = yym1491 + yym1640 := z.EncBinary() + _ = yym1640 if false { } else { r.EncodeBool(bool(x.HostPID)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[12] { - yym1493 := z.EncBinary() - _ = yym1493 + if yyq1604[12] { + yym1642 := z.EncBinary() + _ = yym1642 if false { } else { r.EncodeBool(bool(x.HostIPC)) @@ -20203,21 +22343,21 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq1455[12] { + if yyq1604[12] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIPC")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1494 := z.EncBinary() - _ = yym1494 + yym1643 := z.EncBinary() + _ = yym1643 if false { } else { r.EncodeBool(bool(x.HostIPC)) } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[13] { + if yyq1604[13] { if x.SecurityContext == nil { r.EncodeNil() } else { @@ -20227,7 +22367,7 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1455[13] { + if yyq1604[13] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("securityContext")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -20238,14 +22378,14 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1455[14] { + if yyq1604[14] { if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym1497 := z.EncBinary() - _ = yym1497 + yym1646 := z.EncBinary() + _ = yym1646 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -20255,15 +22395,15 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1455[14] { + if yyq1604[14] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imagePullSecrets")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym1498 := z.EncBinary() - _ = yym1498 + yym1647 := z.EncBinary() + _ = yym1647 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -20271,7 +22411,7 @@ func (x *PodSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1455 || yy2arr1455 { + if yyr1604 || yy2arr1604 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -20284,25 +22424,25 @@ func (x *PodSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1499 := z.DecBinary() - _ = yym1499 + yym1648 := z.DecBinary() + _ = yym1648 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1500 := r.ContainerType() - if yyct1500 == codecSelferValueTypeMap1234 { - yyl1500 := r.ReadMapStart() - if yyl1500 == 0 { + yyct1649 := r.ContainerType() + if yyct1649 == codecSelferValueTypeMap1234 { + yyl1649 := r.ReadMapStart() + if yyl1649 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1500, d) + x.codecDecodeSelfFromMap(yyl1649, d) } - } else if yyct1500 == codecSelferValueTypeArray1234 { - yyl1500 := r.ReadArrayStart() - if yyl1500 == 0 { + } else if yyct1649 == codecSelferValueTypeArray1234 { + yyl1649 := r.ReadArrayStart() + if yyl1649 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1500, d) + x.codecDecodeSelfFromArray(yyl1649, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -20314,12 +22454,12 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1501Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1501Slc - var yyhl1501 bool = l >= 0 - for yyj1501 := 0; ; yyj1501++ { - if yyhl1501 { - if yyj1501 >= l { + var yys1650Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1650Slc + var yyhl1650 bool = l >= 0 + for yyj1650 := 0; ; yyj1650++ { + if yyhl1650 { + if yyj1650 >= l { break } } else { @@ -20328,32 +22468,32 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1501Slc = r.DecodeBytes(yys1501Slc, true, true) - yys1501 := string(yys1501Slc) + yys1650Slc = r.DecodeBytes(yys1650Slc, true, true) + yys1650 := string(yys1650Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1501 { + switch yys1650 { case "volumes": if r.TryDecodeAsNil() { x.Volumes = nil } else { - yyv1502 := &x.Volumes - yym1503 := z.DecBinary() - _ = yym1503 + yyv1651 := &x.Volumes + yym1652 := z.DecBinary() + _ = yym1652 if false { } else { - h.decSliceVolume((*[]Volume)(yyv1502), d) + h.decSliceVolume((*[]Volume)(yyv1651), d) } } case "containers": if r.TryDecodeAsNil() { x.Containers = nil } else { - yyv1504 := &x.Containers - yym1505 := z.DecBinary() - _ = yym1505 + yyv1653 := &x.Containers + yym1654 := z.DecBinary() + _ = yym1654 if false { } else { - h.decSliceContainer((*[]Container)(yyv1504), d) + h.decSliceContainer((*[]Container)(yyv1653), d) } } case "restartPolicy": @@ -20371,8 +22511,8 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TerminationGracePeriodSeconds == nil { x.TerminationGracePeriodSeconds = new(int64) } - yym1508 := z.DecBinary() - _ = yym1508 + yym1657 := z.DecBinary() + _ = yym1657 if false { } else { *((*int64)(x.TerminationGracePeriodSeconds)) = int64(r.DecodeInt(64)) @@ -20387,8 +22527,8 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym1510 := z.DecBinary() - _ = yym1510 + yym1659 := z.DecBinary() + _ = yym1659 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) @@ -20404,12 +22544,12 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeSelector = nil } else { - yyv1512 := &x.NodeSelector - yym1513 := z.DecBinary() - _ = yym1513 + yyv1661 := &x.NodeSelector + yym1662 := z.DecBinary() + _ = yym1662 if false { } else { - z.F.DecMapStringStringX(yyv1512, false, d) + z.F.DecMapStringStringX(yyv1661, false, d) } } case "serviceAccountName": @@ -20463,18 +22603,18 @@ func (x *PodSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ImagePullSecrets = nil } else { - yyv1521 := &x.ImagePullSecrets - yym1522 := z.DecBinary() - _ = yym1522 + yyv1670 := &x.ImagePullSecrets + yym1671 := z.DecBinary() + _ = yym1671 if false { } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1521), d) + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1670), d) } } default: - z.DecStructFieldNotFound(-1, yys1501) - } // end switch yys1501 - } // end for yyj1501 + z.DecStructFieldNotFound(-1, yys1650) + } // end switch yys1650 + } // end for yyj1650 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -20482,16 +22622,16 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1523 int - var yyb1523 bool - var yyhl1523 bool = l >= 0 - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + var yyj1672 int + var yyb1672 bool + var yyhl1672 bool = l >= 0 + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20499,21 +22639,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Volumes = nil } else { - yyv1524 := &x.Volumes - yym1525 := z.DecBinary() - _ = yym1525 + yyv1673 := &x.Volumes + yym1674 := z.DecBinary() + _ = yym1674 if false { } else { - h.decSliceVolume((*[]Volume)(yyv1524), d) + h.decSliceVolume((*[]Volume)(yyv1673), d) } } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20521,21 +22661,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Containers = nil } else { - yyv1526 := &x.Containers - yym1527 := z.DecBinary() - _ = yym1527 + yyv1675 := &x.Containers + yym1676 := z.DecBinary() + _ = yym1676 if false { } else { - h.decSliceContainer((*[]Container)(yyv1526), d) + h.decSliceContainer((*[]Container)(yyv1675), d) } } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20545,13 +22685,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.RestartPolicy = RestartPolicy(r.DecodeString()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20564,20 +22704,20 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.TerminationGracePeriodSeconds == nil { x.TerminationGracePeriodSeconds = new(int64) } - yym1530 := z.DecBinary() - _ = yym1530 + yym1679 := z.DecBinary() + _ = yym1679 if false { } else { *((*int64)(x.TerminationGracePeriodSeconds)) = int64(r.DecodeInt(64)) } } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20590,20 +22730,20 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym1532 := z.DecBinary() - _ = yym1532 + yym1681 := z.DecBinary() + _ = yym1681 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) } } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20613,13 +22753,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.DNSPolicy = DNSPolicy(r.DecodeString()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20627,21 +22767,21 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeSelector = nil } else { - yyv1534 := &x.NodeSelector - yym1535 := z.DecBinary() - _ = yym1535 + yyv1683 := &x.NodeSelector + yym1684 := z.DecBinary() + _ = yym1684 if false { } else { - z.F.DecMapStringStringX(yyv1534, false, d) + z.F.DecMapStringStringX(yyv1683, false, d) } } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20651,13 +22791,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ServiceAccountName = string(r.DecodeString()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20667,13 +22807,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.DeprecatedServiceAccount = string(r.DecodeString()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20683,13 +22823,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.NodeName = string(r.DecodeString()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20699,13 +22839,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostNetwork = bool(r.DecodeBool()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20715,13 +22855,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostPID = bool(r.DecodeBool()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20731,13 +22871,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostIPC = bool(r.DecodeBool()) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20752,13 +22892,13 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.SecurityContext.CodecDecodeSelf(d) } - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -20766,26 +22906,26 @@ func (x *PodSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ImagePullSecrets = nil } else { - yyv1543 := &x.ImagePullSecrets - yym1544 := z.DecBinary() - _ = yym1544 + yyv1692 := &x.ImagePullSecrets + yym1693 := z.DecBinary() + _ = yym1693 if false { } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1543), d) + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv1692), d) } } for { - yyj1523++ - if yyhl1523 { - yyb1523 = yyj1523 > l + yyj1672++ + if yyhl1672 { + yyb1672 = yyj1672 > l } else { - yyb1523 = r.CheckBreak() + yyb1672 = r.CheckBreak() } - if yyb1523 { + if yyb1672 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1523-1, "") + z.DecStructFieldNotFound(yyj1672-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -20797,37 +22937,37 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1545 := z.EncBinary() - _ = yym1545 + yym1694 := z.EncBinary() + _ = yym1694 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1546 := !z.EncBinary() - yy2arr1546 := z.EncBasicHandle().StructToArray - var yyq1546 [5]bool - _, _, _ = yysep1546, yyq1546, yy2arr1546 - const yyr1546 bool = false - yyq1546[0] = x.SELinuxOptions != nil - yyq1546[1] = x.RunAsUser != nil - yyq1546[2] = x.RunAsNonRoot != nil - yyq1546[3] = len(x.SupplementalGroups) != 0 - yyq1546[4] = x.FSGroup != nil - var yynn1546 int - if yyr1546 || yy2arr1546 { + yysep1695 := !z.EncBinary() + yy2arr1695 := z.EncBasicHandle().StructToArray + var yyq1695 [5]bool + _, _, _ = yysep1695, yyq1695, yy2arr1695 + const yyr1695 bool = false + yyq1695[0] = x.SELinuxOptions != nil + yyq1695[1] = x.RunAsUser != nil + yyq1695[2] = x.RunAsNonRoot != nil + yyq1695[3] = len(x.SupplementalGroups) != 0 + yyq1695[4] = x.FSGroup != nil + var yynn1695 int + if yyr1695 || yy2arr1695 { r.EncodeArrayStart(5) } else { - yynn1546 = 0 - for _, b := range yyq1546 { + yynn1695 = 0 + for _, b := range yyq1695 { if b { - yynn1546++ + yynn1695++ } } - r.EncodeMapStart(yynn1546) - yynn1546 = 0 + r.EncodeMapStart(yynn1695) + yynn1695 = 0 } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1546[0] { + if yyq1695[0] { if x.SELinuxOptions == nil { r.EncodeNil() } else { @@ -20837,7 +22977,7 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1546[0] { + if yyq1695[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -20848,84 +22988,84 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1546[1] { + if yyq1695[1] { if x.RunAsUser == nil { r.EncodeNil() } else { - yy1549 := *x.RunAsUser - yym1550 := z.EncBinary() - _ = yym1550 + yy1698 := *x.RunAsUser + yym1699 := z.EncBinary() + _ = yym1699 if false { } else { - r.EncodeInt(int64(yy1549)) + r.EncodeInt(int64(yy1698)) } } } else { r.EncodeNil() } } else { - if yyq1546[1] { + if yyq1695[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsUser == nil { r.EncodeNil() } else { - yy1551 := *x.RunAsUser - yym1552 := z.EncBinary() - _ = yym1552 + yy1700 := *x.RunAsUser + yym1701 := z.EncBinary() + _ = yym1701 if false { } else { - r.EncodeInt(int64(yy1551)) + r.EncodeInt(int64(yy1700)) } } } } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1546[2] { + if yyq1695[2] { if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy1554 := *x.RunAsNonRoot - yym1555 := z.EncBinary() - _ = yym1555 + yy1703 := *x.RunAsNonRoot + yym1704 := z.EncBinary() + _ = yym1704 if false { } else { - r.EncodeBool(bool(yy1554)) + r.EncodeBool(bool(yy1703)) } } } else { r.EncodeNil() } } else { - if yyq1546[2] { + if yyq1695[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsNonRoot")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy1556 := *x.RunAsNonRoot - yym1557 := z.EncBinary() - _ = yym1557 + yy1705 := *x.RunAsNonRoot + yym1706 := z.EncBinary() + _ = yym1706 if false { } else { - r.EncodeBool(bool(yy1556)) + r.EncodeBool(bool(yy1705)) } } } } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1546[3] { + if yyq1695[3] { if x.SupplementalGroups == nil { r.EncodeNil() } else { - yym1559 := z.EncBinary() - _ = yym1559 + yym1708 := z.EncBinary() + _ = yym1708 if false { } else { z.F.EncSliceInt64V(x.SupplementalGroups, false, e) @@ -20935,15 +23075,15 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1546[3] { + if yyq1695[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("supplementalGroups")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.SupplementalGroups == nil { r.EncodeNil() } else { - yym1560 := z.EncBinary() - _ = yym1560 + yym1709 := z.EncBinary() + _ = yym1709 if false { } else { z.F.EncSliceInt64V(x.SupplementalGroups, false, e) @@ -20951,42 +23091,42 @@ func (x *PodSecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1546[4] { + if yyq1695[4] { if x.FSGroup == nil { r.EncodeNil() } else { - yy1562 := *x.FSGroup - yym1563 := z.EncBinary() - _ = yym1563 + yy1711 := *x.FSGroup + yym1712 := z.EncBinary() + _ = yym1712 if false { } else { - r.EncodeInt(int64(yy1562)) + r.EncodeInt(int64(yy1711)) } } } else { r.EncodeNil() } } else { - if yyq1546[4] { + if yyq1695[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fsGroup")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.FSGroup == nil { r.EncodeNil() } else { - yy1564 := *x.FSGroup - yym1565 := z.EncBinary() - _ = yym1565 + yy1713 := *x.FSGroup + yym1714 := z.EncBinary() + _ = yym1714 if false { } else { - r.EncodeInt(int64(yy1564)) + r.EncodeInt(int64(yy1713)) } } } } - if yyr1546 || yy2arr1546 { + if yyr1695 || yy2arr1695 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -20999,25 +23139,25 @@ func (x *PodSecurityContext) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1566 := z.DecBinary() - _ = yym1566 + yym1715 := z.DecBinary() + _ = yym1715 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1567 := r.ContainerType() - if yyct1567 == codecSelferValueTypeMap1234 { - yyl1567 := r.ReadMapStart() - if yyl1567 == 0 { + yyct1716 := r.ContainerType() + if yyct1716 == codecSelferValueTypeMap1234 { + yyl1716 := r.ReadMapStart() + if yyl1716 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1567, d) + x.codecDecodeSelfFromMap(yyl1716, d) } - } else if yyct1567 == codecSelferValueTypeArray1234 { - yyl1567 := r.ReadArrayStart() - if yyl1567 == 0 { + } else if yyct1716 == codecSelferValueTypeArray1234 { + yyl1716 := r.ReadArrayStart() + if yyl1716 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1567, d) + x.codecDecodeSelfFromArray(yyl1716, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -21029,12 +23169,12 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1568Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1568Slc - var yyhl1568 bool = l >= 0 - for yyj1568 := 0; ; yyj1568++ { - if yyhl1568 { - if yyj1568 >= l { + var yys1717Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1717Slc + var yyhl1717 bool = l >= 0 + for yyj1717 := 0; ; yyj1717++ { + if yyhl1717 { + if yyj1717 >= l { break } } else { @@ -21043,10 +23183,10 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1568Slc = r.DecodeBytes(yys1568Slc, true, true) - yys1568 := string(yys1568Slc) + yys1717Slc = r.DecodeBytes(yys1717Slc, true, true) + yys1717 := string(yys1717Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1568 { + switch yys1717 { case "seLinuxOptions": if r.TryDecodeAsNil() { if x.SELinuxOptions != nil { @@ -21067,8 +23207,8 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym1571 := z.DecBinary() - _ = yym1571 + yym1720 := z.DecBinary() + _ = yym1720 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) @@ -21083,8 +23223,8 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym1573 := z.DecBinary() - _ = yym1573 + yym1722 := z.DecBinary() + _ = yym1722 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() @@ -21094,12 +23234,12 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.SupplementalGroups = nil } else { - yyv1574 := &x.SupplementalGroups - yym1575 := z.DecBinary() - _ = yym1575 + yyv1723 := &x.SupplementalGroups + yym1724 := z.DecBinary() + _ = yym1724 if false { } else { - z.F.DecSliceInt64X(yyv1574, false, d) + z.F.DecSliceInt64X(yyv1723, false, d) } } case "fsGroup": @@ -21111,17 +23251,17 @@ func (x *PodSecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if x.FSGroup == nil { x.FSGroup = new(int64) } - yym1577 := z.DecBinary() - _ = yym1577 + yym1726 := z.DecBinary() + _ = yym1726 if false { } else { *((*int64)(x.FSGroup)) = int64(r.DecodeInt(64)) } } default: - z.DecStructFieldNotFound(-1, yys1568) - } // end switch yys1568 - } // end for yyj1568 + z.DecStructFieldNotFound(-1, yys1717) + } // end switch yys1717 + } // end for yyj1717 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -21129,16 +23269,16 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1578 int - var yyb1578 bool - var yyhl1578 bool = l >= 0 - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + var yyj1727 int + var yyb1727 bool + var yyhl1727 bool = l >= 0 + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21153,13 +23293,13 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode } x.SELinuxOptions.CodecDecodeSelf(d) } - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21172,20 +23312,20 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym1581 := z.DecBinary() - _ = yym1581 + yym1730 := z.DecBinary() + _ = yym1730 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) } } - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21198,20 +23338,20 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym1583 := z.DecBinary() - _ = yym1583 + yym1732 := z.DecBinary() + _ = yym1732 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21219,21 +23359,21 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.SupplementalGroups = nil } else { - yyv1584 := &x.SupplementalGroups - yym1585 := z.DecBinary() - _ = yym1585 + yyv1733 := &x.SupplementalGroups + yym1734 := z.DecBinary() + _ = yym1734 if false { } else { - z.F.DecSliceInt64X(yyv1584, false, d) + z.F.DecSliceInt64X(yyv1733, false, d) } } - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21246,25 +23386,25 @@ func (x *PodSecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decode if x.FSGroup == nil { x.FSGroup = new(int64) } - yym1587 := z.DecBinary() - _ = yym1587 + yym1736 := z.DecBinary() + _ = yym1736 if false { } else { *((*int64)(x.FSGroup)) = int64(r.DecodeInt(64)) } } for { - yyj1578++ - if yyhl1578 { - yyb1578 = yyj1578 > l + yyj1727++ + if yyhl1727 { + yyb1727 = yyj1727 > l } else { - yyb1578 = r.CheckBreak() + yyb1727 = r.CheckBreak() } - if yyb1578 { + if yyb1727 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1578-1, "") + z.DecStructFieldNotFound(yyj1727-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -21276,60 +23416,60 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1588 := z.EncBinary() - _ = yym1588 + yym1737 := z.EncBinary() + _ = yym1737 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1589 := !z.EncBinary() - yy2arr1589 := z.EncBasicHandle().StructToArray - var yyq1589 [8]bool - _, _, _ = yysep1589, yyq1589, yy2arr1589 - const yyr1589 bool = false - yyq1589[0] = x.Phase != "" - yyq1589[1] = len(x.Conditions) != 0 - yyq1589[2] = x.Message != "" - yyq1589[3] = x.Reason != "" - yyq1589[4] = x.HostIP != "" - yyq1589[5] = x.PodIP != "" - yyq1589[6] = x.StartTime != nil - yyq1589[7] = len(x.ContainerStatuses) != 0 - var yynn1589 int - if yyr1589 || yy2arr1589 { + yysep1738 := !z.EncBinary() + yy2arr1738 := z.EncBasicHandle().StructToArray + var yyq1738 [8]bool + _, _, _ = yysep1738, yyq1738, yy2arr1738 + const yyr1738 bool = false + yyq1738[0] = x.Phase != "" + yyq1738[1] = len(x.Conditions) != 0 + yyq1738[2] = x.Message != "" + yyq1738[3] = x.Reason != "" + yyq1738[4] = x.HostIP != "" + yyq1738[5] = x.PodIP != "" + yyq1738[6] = x.StartTime != nil + yyq1738[7] = len(x.ContainerStatuses) != 0 + var yynn1738 int + if yyr1738 || yy2arr1738 { r.EncodeArrayStart(8) } else { - yynn1589 = 0 - for _, b := range yyq1589 { + yynn1738 = 0 + for _, b := range yyq1738 { if b { - yynn1589++ + yynn1738++ } } - r.EncodeMapStart(yynn1589) - yynn1589 = 0 + r.EncodeMapStart(yynn1738) + yynn1738 = 0 } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[0] { + if yyq1738[0] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1589[0] { + if yyq1738[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[1] { + if yyq1738[1] { if x.Conditions == nil { r.EncodeNil() } else { - yym1592 := z.EncBinary() - _ = yym1592 + yym1741 := z.EncBinary() + _ = yym1741 if false { } else { h.encSlicePodCondition(([]PodCondition)(x.Conditions), e) @@ -21339,15 +23479,15 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1589[1] { + if yyq1738[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym1593 := z.EncBinary() - _ = yym1593 + yym1742 := z.EncBinary() + _ = yym1742 if false { } else { h.encSlicePodCondition(([]PodCondition)(x.Conditions), e) @@ -21355,11 +23495,11 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[2] { - yym1595 := z.EncBinary() - _ = yym1595 + if yyq1738[2] { + yym1744 := z.EncBinary() + _ = yym1744 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -21368,23 +23508,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1589[2] { + if yyq1738[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1596 := z.EncBinary() - _ = yym1596 + yym1745 := z.EncBinary() + _ = yym1745 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[3] { - yym1598 := z.EncBinary() - _ = yym1598 + if yyq1738[3] { + yym1747 := z.EncBinary() + _ = yym1747 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -21393,23 +23533,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1589[3] { + if yyq1738[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1599 := z.EncBinary() - _ = yym1599 + yym1748 := z.EncBinary() + _ = yym1748 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[4] { - yym1601 := z.EncBinary() - _ = yym1601 + if yyq1738[4] { + yym1750 := z.EncBinary() + _ = yym1750 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) @@ -21418,23 +23558,23 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1589[4] { + if yyq1738[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1602 := z.EncBinary() - _ = yym1602 + yym1751 := z.EncBinary() + _ = yym1751 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIP)) } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[5] { - yym1604 := z.EncBinary() - _ = yym1604 + if yyq1738[5] { + yym1753 := z.EncBinary() + _ = yym1753 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodIP)) @@ -21443,31 +23583,31 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1589[5] { + if yyq1738[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1605 := z.EncBinary() - _ = yym1605 + yym1754 := z.EncBinary() + _ = yym1754 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodIP)) } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[6] { + if yyq1738[6] { if x.StartTime == nil { r.EncodeNil() } else { - yym1607 := z.EncBinary() - _ = yym1607 + yym1756 := z.EncBinary() + _ = yym1756 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym1607 { + } else if yym1756 { z.EncBinaryMarshal(x.StartTime) - } else if !yym1607 && z.IsJSONHandle() { + } else if !yym1756 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -21477,20 +23617,20 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1589[6] { + if yyq1738[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.StartTime == nil { r.EncodeNil() } else { - yym1608 := z.EncBinary() - _ = yym1608 + yym1757 := z.EncBinary() + _ = yym1757 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym1608 { + } else if yym1757 { z.EncBinaryMarshal(x.StartTime) - } else if !yym1608 && z.IsJSONHandle() { + } else if !yym1757 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -21498,14 +23638,14 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1589[7] { + if yyq1738[7] { if x.ContainerStatuses == nil { r.EncodeNil() } else { - yym1610 := z.EncBinary() - _ = yym1610 + yym1759 := z.EncBinary() + _ = yym1759 if false { } else { h.encSliceContainerStatus(([]ContainerStatus)(x.ContainerStatuses), e) @@ -21515,15 +23655,15 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1589[7] { + if yyq1738[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerStatuses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ContainerStatuses == nil { r.EncodeNil() } else { - yym1611 := z.EncBinary() - _ = yym1611 + yym1760 := z.EncBinary() + _ = yym1760 if false { } else { h.encSliceContainerStatus(([]ContainerStatus)(x.ContainerStatuses), e) @@ -21531,7 +23671,7 @@ func (x *PodStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1589 || yy2arr1589 { + if yyr1738 || yy2arr1738 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -21544,25 +23684,25 @@ func (x *PodStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1612 := z.DecBinary() - _ = yym1612 + yym1761 := z.DecBinary() + _ = yym1761 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1613 := r.ContainerType() - if yyct1613 == codecSelferValueTypeMap1234 { - yyl1613 := r.ReadMapStart() - if yyl1613 == 0 { + yyct1762 := r.ContainerType() + if yyct1762 == codecSelferValueTypeMap1234 { + yyl1762 := r.ReadMapStart() + if yyl1762 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1613, d) + x.codecDecodeSelfFromMap(yyl1762, d) } - } else if yyct1613 == codecSelferValueTypeArray1234 { - yyl1613 := r.ReadArrayStart() - if yyl1613 == 0 { + } else if yyct1762 == codecSelferValueTypeArray1234 { + yyl1762 := r.ReadArrayStart() + if yyl1762 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1613, d) + x.codecDecodeSelfFromArray(yyl1762, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -21574,12 +23714,12 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1614Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1614Slc - var yyhl1614 bool = l >= 0 - for yyj1614 := 0; ; yyj1614++ { - if yyhl1614 { - if yyj1614 >= l { + var yys1763Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1763Slc + var yyhl1763 bool = l >= 0 + for yyj1763 := 0; ; yyj1763++ { + if yyhl1763 { + if yyj1763 >= l { break } } else { @@ -21588,10 +23728,10 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1614Slc = r.DecodeBytes(yys1614Slc, true, true) - yys1614 := string(yys1614Slc) + yys1763Slc = r.DecodeBytes(yys1763Slc, true, true) + yys1763 := string(yys1763Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1614 { + switch yys1763 { case "phase": if r.TryDecodeAsNil() { x.Phase = "" @@ -21602,12 +23742,12 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv1616 := &x.Conditions - yym1617 := z.DecBinary() - _ = yym1617 + yyv1765 := &x.Conditions + yym1766 := z.DecBinary() + _ = yym1766 if false { } else { - h.decSlicePodCondition((*[]PodCondition)(yyv1616), d) + h.decSlicePodCondition((*[]PodCondition)(yyv1765), d) } } case "message": @@ -21643,13 +23783,13 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg2_unversioned.Time) } - yym1623 := z.DecBinary() - _ = yym1623 + yym1772 := z.DecBinary() + _ = yym1772 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym1623 { + } else if yym1772 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym1623 && z.IsJSONHandle() { + } else if !yym1772 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) @@ -21659,18 +23799,18 @@ func (x *PodStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ContainerStatuses = nil } else { - yyv1624 := &x.ContainerStatuses - yym1625 := z.DecBinary() - _ = yym1625 + yyv1773 := &x.ContainerStatuses + yym1774 := z.DecBinary() + _ = yym1774 if false { } else { - h.decSliceContainerStatus((*[]ContainerStatus)(yyv1624), d) + h.decSliceContainerStatus((*[]ContainerStatus)(yyv1773), d) } } default: - z.DecStructFieldNotFound(-1, yys1614) - } // end switch yys1614 - } // end for yyj1614 + z.DecStructFieldNotFound(-1, yys1763) + } // end switch yys1763 + } // end for yyj1763 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -21678,16 +23818,16 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1626 int - var yyb1626 bool - var yyhl1626 bool = l >= 0 - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + var yyj1775 int + var yyb1775 bool + var yyhl1775 bool = l >= 0 + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21697,13 +23837,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Phase = PodPhase(r.DecodeString()) } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21711,21 +23851,21 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv1628 := &x.Conditions - yym1629 := z.DecBinary() - _ = yym1629 + yyv1777 := &x.Conditions + yym1778 := z.DecBinary() + _ = yym1778 if false { } else { - h.decSlicePodCondition((*[]PodCondition)(yyv1628), d) + h.decSlicePodCondition((*[]PodCondition)(yyv1777), d) } } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21735,13 +23875,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Message = string(r.DecodeString()) } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21751,13 +23891,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21767,13 +23907,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.HostIP = string(r.DecodeString()) } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21783,13 +23923,13 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.PodIP = string(r.DecodeString()) } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21802,25 +23942,25 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg2_unversioned.Time) } - yym1635 := z.DecBinary() - _ = yym1635 + yym1784 := z.DecBinary() + _ = yym1784 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym1635 { + } else if yym1784 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym1635 && z.IsJSONHandle() { + } else if !yym1784 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) } } - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -21828,26 +23968,26 @@ func (x *PodStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ContainerStatuses = nil } else { - yyv1636 := &x.ContainerStatuses - yym1637 := z.DecBinary() - _ = yym1637 + yyv1785 := &x.ContainerStatuses + yym1786 := z.DecBinary() + _ = yym1786 if false { } else { - h.decSliceContainerStatus((*[]ContainerStatus)(yyv1636), d) + h.decSliceContainerStatus((*[]ContainerStatus)(yyv1785), d) } } for { - yyj1626++ - if yyhl1626 { - yyb1626 = yyj1626 > l + yyj1775++ + if yyhl1775 { + yyb1775 = yyj1775 > l } else { - yyb1626 = r.CheckBreak() + yyb1775 = r.CheckBreak() } - if yyb1626 { + if yyb1775 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1626-1, "") + z.DecStructFieldNotFound(yyj1775-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -21859,118 +23999,118 @@ func (x *PodStatusResult) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1638 := z.EncBinary() - _ = yym1638 + yym1787 := z.EncBinary() + _ = yym1787 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1639 := !z.EncBinary() - yy2arr1639 := z.EncBasicHandle().StructToArray - var yyq1639 [4]bool - _, _, _ = yysep1639, yyq1639, yy2arr1639 - const yyr1639 bool = false - yyq1639[0] = x.Kind != "" - yyq1639[1] = x.APIVersion != "" - yyq1639[2] = true - yyq1639[3] = true - var yynn1639 int - if yyr1639 || yy2arr1639 { + yysep1788 := !z.EncBinary() + yy2arr1788 := z.EncBasicHandle().StructToArray + var yyq1788 [4]bool + _, _, _ = yysep1788, yyq1788, yy2arr1788 + const yyr1788 bool = false + yyq1788[0] = true + yyq1788[1] = true + yyq1788[2] = x.Kind != "" + yyq1788[3] = x.APIVersion != "" + var yynn1788 int + if yyr1788 || yy2arr1788 { r.EncodeArrayStart(4) } else { - yynn1639 = 0 - for _, b := range yyq1639 { + yynn1788 = 0 + for _, b := range yyq1788 { if b { - yynn1639++ + yynn1788++ } } - r.EncodeMapStart(yynn1639) - yynn1639 = 0 + r.EncodeMapStart(yynn1788) + yynn1788 = 0 } - if yyr1639 || yy2arr1639 { + if yyr1788 || yy2arr1788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1639[0] { - yym1641 := z.EncBinary() - _ = yym1641 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1639[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1642 := z.EncBinary() - _ = yym1642 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1639 || yy2arr1639 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1639[1] { - yym1644 := z.EncBinary() - _ = yym1644 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1639[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1645 := z.EncBinary() - _ = yym1645 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1639 || yy2arr1639 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1639[2] { - yy1647 := &x.ObjectMeta - yy1647.CodecEncodeSelf(e) + if yyq1788[0] { + yy1790 := &x.ObjectMeta + yy1790.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1639[2] { + if yyq1788[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1648 := &x.ObjectMeta - yy1648.CodecEncodeSelf(e) + yy1791 := &x.ObjectMeta + yy1791.CodecEncodeSelf(e) } } - if yyr1639 || yy2arr1639 { + if yyr1788 || yy2arr1788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1639[3] { - yy1650 := &x.Status - yy1650.CodecEncodeSelf(e) + if yyq1788[1] { + yy1793 := &x.Status + yy1793.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1639[3] { + if yyq1788[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1651 := &x.Status - yy1651.CodecEncodeSelf(e) + yy1794 := &x.Status + yy1794.CodecEncodeSelf(e) } } - if yyr1639 || yy2arr1639 { + if yyr1788 || yy2arr1788 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1788[2] { + yym1796 := z.EncBinary() + _ = yym1796 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1788[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1797 := z.EncBinary() + _ = yym1797 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1788 || yy2arr1788 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1788[3] { + yym1799 := z.EncBinary() + _ = yym1799 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1788[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1800 := z.EncBinary() + _ = yym1800 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1788 || yy2arr1788 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -21983,25 +24123,25 @@ func (x *PodStatusResult) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1652 := z.DecBinary() - _ = yym1652 + yym1801 := z.DecBinary() + _ = yym1801 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1653 := r.ContainerType() - if yyct1653 == codecSelferValueTypeMap1234 { - yyl1653 := r.ReadMapStart() - if yyl1653 == 0 { + yyct1802 := r.ContainerType() + if yyct1802 == codecSelferValueTypeMap1234 { + yyl1802 := r.ReadMapStart() + if yyl1802 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1653, d) + x.codecDecodeSelfFromMap(yyl1802, d) } - } else if yyct1653 == codecSelferValueTypeArray1234 { - yyl1653 := r.ReadArrayStart() - if yyl1653 == 0 { + } else if yyct1802 == codecSelferValueTypeArray1234 { + yyl1802 := r.ReadArrayStart() + if yyl1802 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1653, d) + x.codecDecodeSelfFromArray(yyl1802, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22013,12 +24153,12 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1654Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1654Slc - var yyhl1654 bool = l >= 0 - for yyj1654 := 0; ; yyj1654++ { - if yyhl1654 { - if yyj1654 >= l { + var yys1803Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1803Slc + var yyhl1803 bool = l >= 0 + for yyj1803 := 0; ; yyj1803++ { + if yyhl1803 { + if yyj1803 >= l { break } } else { @@ -22027,10 +24167,24 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1654Slc = r.DecodeBytes(yys1654Slc, true, true) - yys1654 := string(yys1654Slc) + yys1803Slc = r.DecodeBytes(yys1803Slc, true, true) + yys1803 := string(yys1803Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1654 { + switch yys1803 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1804 := &x.ObjectMeta + yyv1804.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1805 := &x.Status + yyv1805.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -22043,24 +24197,10 @@ func (x *PodStatusResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1657 := &x.ObjectMeta - yyv1657.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1658 := &x.Status - yyv1658.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1654) - } // end switch yys1654 - } // end for yyj1654 + z.DecStructFieldNotFound(-1, yys1803) + } // end switch yys1803 + } // end for yyj1803 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22068,16 +24208,50 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1659 int - var yyb1659 bool - var yyhl1659 bool = l >= 0 - yyj1659++ - if yyhl1659 { - yyb1659 = yyj1659 > l + var yyj1808 int + var yyb1808 bool + var yyhl1808 bool = l >= 0 + yyj1808++ + if yyhl1808 { + yyb1808 = yyj1808 > l } else { - yyb1659 = r.CheckBreak() + yyb1808 = r.CheckBreak() } - if yyb1659 { + if yyb1808 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1809 := &x.ObjectMeta + yyv1809.CodecDecodeSelf(d) + } + yyj1808++ + if yyhl1808 { + yyb1808 = yyj1808 > l + } else { + yyb1808 = r.CheckBreak() + } + if yyb1808 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1810 := &x.Status + yyv1810.CodecDecodeSelf(d) + } + yyj1808++ + if yyhl1808 { + yyb1808 = yyj1808 > l + } else { + yyb1808 = r.CheckBreak() + } + if yyb1808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22087,13 +24261,13 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj1659++ - if yyhl1659 { - yyb1659 = yyj1659 > l + yyj1808++ + if yyhl1808 { + yyb1808 = yyj1808 > l } else { - yyb1659 = r.CheckBreak() + yyb1808 = r.CheckBreak() } - if yyb1659 { + if yyb1808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22103,52 +24277,18 @@ func (x *PodStatusResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj1659++ - if yyhl1659 { - yyb1659 = yyj1659 > l - } else { - yyb1659 = r.CheckBreak() - } - if yyb1659 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1662 := &x.ObjectMeta - yyv1662.CodecDecodeSelf(d) - } - yyj1659++ - if yyhl1659 { - yyb1659 = yyj1659 > l - } else { - yyb1659 = r.CheckBreak() - } - if yyb1659 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1663 := &x.Status - yyv1663.CodecDecodeSelf(d) - } for { - yyj1659++ - if yyhl1659 { - yyb1659 = yyj1659 > l + yyj1808++ + if yyhl1808 { + yyb1808 = yyj1808 > l } else { - yyb1659 = r.CheckBreak() + yyb1808 = r.CheckBreak() } - if yyb1659 { + if yyb1808 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1659-1, "") + z.DecStructFieldNotFound(yyj1808-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -22160,136 +24300,136 @@ func (x *Pod) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1664 := z.EncBinary() - _ = yym1664 + yym1813 := z.EncBinary() + _ = yym1813 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1665 := !z.EncBinary() - yy2arr1665 := z.EncBasicHandle().StructToArray - var yyq1665 [5]bool - _, _, _ = yysep1665, yyq1665, yy2arr1665 - const yyr1665 bool = false - yyq1665[0] = x.Kind != "" - yyq1665[1] = x.APIVersion != "" - yyq1665[2] = true - yyq1665[3] = true - yyq1665[4] = true - var yynn1665 int - if yyr1665 || yy2arr1665 { + yysep1814 := !z.EncBinary() + yy2arr1814 := z.EncBasicHandle().StructToArray + var yyq1814 [5]bool + _, _, _ = yysep1814, yyq1814, yy2arr1814 + const yyr1814 bool = false + yyq1814[0] = true + yyq1814[1] = true + yyq1814[2] = true + yyq1814[3] = x.Kind != "" + yyq1814[4] = x.APIVersion != "" + var yynn1814 int + if yyr1814 || yy2arr1814 { r.EncodeArrayStart(5) } else { - yynn1665 = 0 - for _, b := range yyq1665 { + yynn1814 = 0 + for _, b := range yyq1814 { if b { - yynn1665++ + yynn1814++ } } - r.EncodeMapStart(yynn1665) - yynn1665 = 0 + r.EncodeMapStart(yynn1814) + yynn1814 = 0 } - if yyr1665 || yy2arr1665 { + if yyr1814 || yy2arr1814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1665[0] { - yym1667 := z.EncBinary() - _ = yym1667 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1665[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1668 := z.EncBinary() - _ = yym1668 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1665 || yy2arr1665 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1665[1] { - yym1670 := z.EncBinary() - _ = yym1670 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1665[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1671 := z.EncBinary() - _ = yym1671 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1665 || yy2arr1665 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1665[2] { - yy1673 := &x.ObjectMeta - yy1673.CodecEncodeSelf(e) + if yyq1814[0] { + yy1816 := &x.ObjectMeta + yy1816.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1665[2] { + if yyq1814[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1674 := &x.ObjectMeta - yy1674.CodecEncodeSelf(e) + yy1817 := &x.ObjectMeta + yy1817.CodecEncodeSelf(e) } } - if yyr1665 || yy2arr1665 { + if yyr1814 || yy2arr1814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1665[3] { - yy1676 := &x.Spec - yy1676.CodecEncodeSelf(e) + if yyq1814[1] { + yy1819 := &x.Spec + yy1819.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1665[3] { + if yyq1814[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1677 := &x.Spec - yy1677.CodecEncodeSelf(e) + yy1820 := &x.Spec + yy1820.CodecEncodeSelf(e) } } - if yyr1665 || yy2arr1665 { + if yyr1814 || yy2arr1814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1665[4] { - yy1679 := &x.Status - yy1679.CodecEncodeSelf(e) + if yyq1814[2] { + yy1822 := &x.Status + yy1822.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1665[4] { + if yyq1814[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1680 := &x.Status - yy1680.CodecEncodeSelf(e) + yy1823 := &x.Status + yy1823.CodecEncodeSelf(e) } } - if yyr1665 || yy2arr1665 { + if yyr1814 || yy2arr1814 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1814[3] { + yym1825 := z.EncBinary() + _ = yym1825 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1814[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1826 := z.EncBinary() + _ = yym1826 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1814 || yy2arr1814 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1814[4] { + yym1828 := z.EncBinary() + _ = yym1828 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1814[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1829 := z.EncBinary() + _ = yym1829 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1814 || yy2arr1814 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22302,25 +24442,25 @@ func (x *Pod) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1681 := z.DecBinary() - _ = yym1681 + yym1830 := z.DecBinary() + _ = yym1830 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1682 := r.ContainerType() - if yyct1682 == codecSelferValueTypeMap1234 { - yyl1682 := r.ReadMapStart() - if yyl1682 == 0 { + yyct1831 := r.ContainerType() + if yyct1831 == codecSelferValueTypeMap1234 { + yyl1831 := r.ReadMapStart() + if yyl1831 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1682, d) + x.codecDecodeSelfFromMap(yyl1831, d) } - } else if yyct1682 == codecSelferValueTypeArray1234 { - yyl1682 := r.ReadArrayStart() - if yyl1682 == 0 { + } else if yyct1831 == codecSelferValueTypeArray1234 { + yyl1831 := r.ReadArrayStart() + if yyl1831 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1682, d) + x.codecDecodeSelfFromArray(yyl1831, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22332,12 +24472,12 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1683Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1683Slc - var yyhl1683 bool = l >= 0 - for yyj1683 := 0; ; yyj1683++ { - if yyhl1683 { - if yyj1683 >= l { + var yys1832Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1832Slc + var yyhl1832 bool = l >= 0 + for yyj1832 := 0; ; yyj1832++ { + if yyhl1832 { + if yyj1832 >= l { break } } else { @@ -22346,10 +24486,31 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1683Slc = r.DecodeBytes(yys1683Slc, true, true) - yys1683 := string(yys1683Slc) + yys1832Slc = r.DecodeBytes(yys1832Slc, true, true) + yys1832 := string(yys1832Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1683 { + switch yys1832 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1833 := &x.ObjectMeta + yyv1833.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PodSpec{} + } else { + yyv1834 := &x.Spec + yyv1834.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1835 := &x.Status + yyv1835.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -22362,31 +24523,10 @@ func (x *Pod) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1686 := &x.ObjectMeta - yyv1686.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = PodSpec{} - } else { - yyv1687 := &x.Spec - yyv1687.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1688 := &x.Status - yyv1688.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1683) - } // end switch yys1683 - } // end for yyj1683 + z.DecStructFieldNotFound(-1, yys1832) + } // end switch yys1832 + } // end for yyj1832 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22394,16 +24534,67 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1689 int - var yyb1689 bool - var yyhl1689 bool = l >= 0 - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l + var yyj1838 int + var yyb1838 bool + var yyhl1838 bool = l >= 0 + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l } else { - yyb1689 = r.CheckBreak() + yyb1838 = r.CheckBreak() } - if yyb1689 { + if yyb1838 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1839 := &x.ObjectMeta + yyv1839.CodecDecodeSelf(d) + } + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l + } else { + yyb1838 = r.CheckBreak() + } + if yyb1838 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PodSpec{} + } else { + yyv1840 := &x.Spec + yyv1840.CodecDecodeSelf(d) + } + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l + } else { + yyb1838 = r.CheckBreak() + } + if yyb1838 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = PodStatus{} + } else { + yyv1841 := &x.Status + yyv1841.CodecDecodeSelf(d) + } + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l + } else { + yyb1838 = r.CheckBreak() + } + if yyb1838 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22413,13 +24604,13 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l } else { - yyb1689 = r.CheckBreak() + yyb1838 = r.CheckBreak() } - if yyb1689 { + if yyb1838 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22429,69 +24620,18 @@ func (x *Pod) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l - } else { - yyb1689 = r.CheckBreak() - } - if yyb1689 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1692 := &x.ObjectMeta - yyv1692.CodecDecodeSelf(d) - } - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l - } else { - yyb1689 = r.CheckBreak() - } - if yyb1689 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = PodSpec{} - } else { - yyv1693 := &x.Spec - yyv1693.CodecDecodeSelf(d) - } - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l - } else { - yyb1689 = r.CheckBreak() - } - if yyb1689 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = PodStatus{} - } else { - yyv1694 := &x.Status - yyv1694.CodecDecodeSelf(d) - } for { - yyj1689++ - if yyhl1689 { - yyb1689 = yyj1689 > l + yyj1838++ + if yyhl1838 { + yyb1838 = yyj1838 > l } else { - yyb1689 = r.CheckBreak() + yyb1838 = r.CheckBreak() } - if yyb1689 { + if yyb1838 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1689-1, "") + z.DecStructFieldNotFound(yyj1838-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -22503,118 +24643,68 @@ func (x *PodList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1695 := z.EncBinary() - _ = yym1695 + yym1844 := z.EncBinary() + _ = yym1844 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1696 := !z.EncBinary() - yy2arr1696 := z.EncBasicHandle().StructToArray - var yyq1696 [4]bool - _, _, _ = yysep1696, yyq1696, yy2arr1696 - const yyr1696 bool = false - yyq1696[0] = x.Kind != "" - yyq1696[1] = x.APIVersion != "" - yyq1696[2] = true - var yynn1696 int - if yyr1696 || yy2arr1696 { + yysep1845 := !z.EncBinary() + yy2arr1845 := z.EncBasicHandle().StructToArray + var yyq1845 [4]bool + _, _, _ = yysep1845, yyq1845, yy2arr1845 + const yyr1845 bool = false + yyq1845[0] = true + yyq1845[2] = x.Kind != "" + yyq1845[3] = x.APIVersion != "" + var yynn1845 int + if yyr1845 || yy2arr1845 { r.EncodeArrayStart(4) } else { - yynn1696 = 1 - for _, b := range yyq1696 { + yynn1845 = 1 + for _, b := range yyq1845 { if b { - yynn1696++ + yynn1845++ } } - r.EncodeMapStart(yynn1696) - yynn1696 = 0 + r.EncodeMapStart(yynn1845) + yynn1845 = 0 } - if yyr1696 || yy2arr1696 { + if yyr1845 || yy2arr1845 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1696[0] { - yym1698 := z.EncBinary() - _ = yym1698 + if yyq1845[0] { + yy1847 := &x.ListMeta + yym1848 := z.EncBinary() + _ = yym1848 if false { + } else if z.HasExtensions() && z.EncExt(yy1847) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1696[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1699 := z.EncBinary() - _ = yym1699 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1696 || yy2arr1696 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1696[1] { - yym1701 := z.EncBinary() - _ = yym1701 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1696[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1702 := z.EncBinary() - _ = yym1702 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1696 || yy2arr1696 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1696[2] { - yy1704 := &x.ListMeta - yym1705 := z.EncBinary() - _ = yym1705 - if false { - } else if z.HasExtensions() && z.EncExt(yy1704) { - } else { - z.EncFallback(yy1704) + z.EncFallback(yy1847) } } else { r.EncodeNil() } } else { - if yyq1696[2] { + if yyq1845[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1706 := &x.ListMeta - yym1707 := z.EncBinary() - _ = yym1707 + yy1849 := &x.ListMeta + yym1850 := z.EncBinary() + _ = yym1850 if false { - } else if z.HasExtensions() && z.EncExt(yy1706) { + } else if z.HasExtensions() && z.EncExt(yy1849) { } else { - z.EncFallback(yy1706) + z.EncFallback(yy1849) } } } - if yyr1696 || yy2arr1696 { + if yyr1845 || yy2arr1845 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1709 := z.EncBinary() - _ = yym1709 + yym1852 := z.EncBinary() + _ = yym1852 if false { } else { h.encSlicePod(([]Pod)(x.Items), e) @@ -22627,15 +24717,65 @@ func (x *PodList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1710 := z.EncBinary() - _ = yym1710 + yym1853 := z.EncBinary() + _ = yym1853 if false { } else { h.encSlicePod(([]Pod)(x.Items), e) } } } - if yyr1696 || yy2arr1696 { + if yyr1845 || yy2arr1845 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1845[2] { + yym1855 := z.EncBinary() + _ = yym1855 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1845[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1856 := z.EncBinary() + _ = yym1856 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1845 || yy2arr1845 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1845[3] { + yym1858 := z.EncBinary() + _ = yym1858 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1845[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1859 := z.EncBinary() + _ = yym1859 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1845 || yy2arr1845 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22648,25 +24788,25 @@ func (x *PodList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1711 := z.DecBinary() - _ = yym1711 + yym1860 := z.DecBinary() + _ = yym1860 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1712 := r.ContainerType() - if yyct1712 == codecSelferValueTypeMap1234 { - yyl1712 := r.ReadMapStart() - if yyl1712 == 0 { + yyct1861 := r.ContainerType() + if yyct1861 == codecSelferValueTypeMap1234 { + yyl1861 := r.ReadMapStart() + if yyl1861 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1712, d) + x.codecDecodeSelfFromMap(yyl1861, d) } - } else if yyct1712 == codecSelferValueTypeArray1234 { - yyl1712 := r.ReadArrayStart() - if yyl1712 == 0 { + } else if yyct1861 == codecSelferValueTypeArray1234 { + yyl1861 := r.ReadArrayStart() + if yyl1861 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1712, d) + x.codecDecodeSelfFromArray(yyl1861, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22678,12 +24818,12 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1713Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1713Slc - var yyhl1713 bool = l >= 0 - for yyj1713 := 0; ; yyj1713++ { - if yyhl1713 { - if yyj1713 >= l { + var yys1862Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1862Slc + var yyhl1862 bool = l >= 0 + for yyj1862 := 0; ; yyj1862++ { + if yyhl1862 { + if yyj1862 >= l { break } } else { @@ -22692,10 +24832,35 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1713Slc = r.DecodeBytes(yys1713Slc, true, true) - yys1713 := string(yys1713Slc) + yys1862Slc = r.DecodeBytes(yys1862Slc, true, true) + yys1862 := string(yys1862Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1713 { + switch yys1862 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1863 := &x.ListMeta + yym1864 := z.DecBinary() + _ = yym1864 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1863) { + } else { + z.DecFallback(yyv1863, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1865 := &x.Items + yym1866 := z.DecBinary() + _ = yym1866 + if false { + } else { + h.decSlicePod((*[]Pod)(yyv1865), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -22708,35 +24873,10 @@ func (x *PodList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1716 := &x.ListMeta - yym1717 := z.DecBinary() - _ = yym1717 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1716) { - } else { - z.DecFallback(yyv1716, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1718 := &x.Items - yym1719 := z.DecBinary() - _ = yym1719 - if false { - } else { - h.decSlicePod((*[]Pod)(yyv1718), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1713) - } // end switch yys1713 - } // end for yyj1713 + z.DecStructFieldNotFound(-1, yys1862) + } // end switch yys1862 + } // end for yyj1862 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22744,16 +24884,61 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1720 int - var yyb1720 bool - var yyhl1720 bool = l >= 0 - yyj1720++ - if yyhl1720 { - yyb1720 = yyj1720 > l + var yyj1869 int + var yyb1869 bool + var yyhl1869 bool = l >= 0 + yyj1869++ + if yyhl1869 { + yyb1869 = yyj1869 > l } else { - yyb1720 = r.CheckBreak() + yyb1869 = r.CheckBreak() } - if yyb1720 { + if yyb1869 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1870 := &x.ListMeta + yym1871 := z.DecBinary() + _ = yym1871 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1870) { + } else { + z.DecFallback(yyv1870, false) + } + } + yyj1869++ + if yyhl1869 { + yyb1869 = yyj1869 > l + } else { + yyb1869 = r.CheckBreak() + } + if yyb1869 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1872 := &x.Items + yym1873 := z.DecBinary() + _ = yym1873 + if false { + } else { + h.decSlicePod((*[]Pod)(yyv1872), d) + } + } + yyj1869++ + if yyhl1869 { + yyb1869 = yyj1869 > l + } else { + yyb1869 = r.CheckBreak() + } + if yyb1869 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22763,13 +24948,13 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1720++ - if yyhl1720 { - yyb1720 = yyj1720 > l + yyj1869++ + if yyhl1869 { + yyb1869 = yyj1869 > l } else { - yyb1720 = r.CheckBreak() + yyb1869 = r.CheckBreak() } - if yyb1720 { + if yyb1869 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -22779,63 +24964,18 @@ func (x *PodList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1720++ - if yyhl1720 { - yyb1720 = yyj1720 > l - } else { - yyb1720 = r.CheckBreak() - } - if yyb1720 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1723 := &x.ListMeta - yym1724 := z.DecBinary() - _ = yym1724 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1723) { - } else { - z.DecFallback(yyv1723, false) - } - } - yyj1720++ - if yyhl1720 { - yyb1720 = yyj1720 > l - } else { - yyb1720 = r.CheckBreak() - } - if yyb1720 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1725 := &x.Items - yym1726 := z.DecBinary() - _ = yym1726 - if false { - } else { - h.decSlicePod((*[]Pod)(yyv1725), d) - } - } for { - yyj1720++ - if yyhl1720 { - yyb1720 = yyj1720 > l + yyj1869++ + if yyhl1869 { + yyb1869 = yyj1869 > l } else { - yyb1720 = r.CheckBreak() + yyb1869 = r.CheckBreak() } - if yyb1720 { + if yyb1869 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1720-1, "") + z.DecStructFieldNotFound(yyj1869-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -22847,66 +24987,66 @@ func (x *PodTemplateSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1727 := z.EncBinary() - _ = yym1727 + yym1876 := z.EncBinary() + _ = yym1876 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1728 := !z.EncBinary() - yy2arr1728 := z.EncBasicHandle().StructToArray - var yyq1728 [2]bool - _, _, _ = yysep1728, yyq1728, yy2arr1728 - const yyr1728 bool = false - yyq1728[0] = true - yyq1728[1] = true - var yynn1728 int - if yyr1728 || yy2arr1728 { + yysep1877 := !z.EncBinary() + yy2arr1877 := z.EncBasicHandle().StructToArray + var yyq1877 [2]bool + _, _, _ = yysep1877, yyq1877, yy2arr1877 + const yyr1877 bool = false + yyq1877[0] = true + yyq1877[1] = true + var yynn1877 int + if yyr1877 || yy2arr1877 { r.EncodeArrayStart(2) } else { - yynn1728 = 0 - for _, b := range yyq1728 { + yynn1877 = 0 + for _, b := range yyq1877 { if b { - yynn1728++ + yynn1877++ } } - r.EncodeMapStart(yynn1728) - yynn1728 = 0 + r.EncodeMapStart(yynn1877) + yynn1877 = 0 } - if yyr1728 || yy2arr1728 { + if yyr1877 || yy2arr1877 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1728[0] { - yy1730 := &x.ObjectMeta - yy1730.CodecEncodeSelf(e) + if yyq1877[0] { + yy1879 := &x.ObjectMeta + yy1879.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1728[0] { + if yyq1877[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1731 := &x.ObjectMeta - yy1731.CodecEncodeSelf(e) + yy1880 := &x.ObjectMeta + yy1880.CodecEncodeSelf(e) } } - if yyr1728 || yy2arr1728 { + if yyr1877 || yy2arr1877 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1728[1] { - yy1733 := &x.Spec - yy1733.CodecEncodeSelf(e) + if yyq1877[1] { + yy1882 := &x.Spec + yy1882.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1728[1] { + if yyq1877[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1734 := &x.Spec - yy1734.CodecEncodeSelf(e) + yy1883 := &x.Spec + yy1883.CodecEncodeSelf(e) } } - if yyr1728 || yy2arr1728 { + if yyr1877 || yy2arr1877 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -22919,25 +25059,25 @@ func (x *PodTemplateSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1735 := z.DecBinary() - _ = yym1735 + yym1884 := z.DecBinary() + _ = yym1884 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1736 := r.ContainerType() - if yyct1736 == codecSelferValueTypeMap1234 { - yyl1736 := r.ReadMapStart() - if yyl1736 == 0 { + yyct1885 := r.ContainerType() + if yyct1885 == codecSelferValueTypeMap1234 { + yyl1885 := r.ReadMapStart() + if yyl1885 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1736, d) + x.codecDecodeSelfFromMap(yyl1885, d) } - } else if yyct1736 == codecSelferValueTypeArray1234 { - yyl1736 := r.ReadArrayStart() - if yyl1736 == 0 { + } else if yyct1885 == codecSelferValueTypeArray1234 { + yyl1885 := r.ReadArrayStart() + if yyl1885 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1736, d) + x.codecDecodeSelfFromArray(yyl1885, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -22949,12 +25089,12 @@ func (x *PodTemplateSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1737Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1737Slc - var yyhl1737 bool = l >= 0 - for yyj1737 := 0; ; yyj1737++ { - if yyhl1737 { - if yyj1737 >= l { + var yys1886Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1886Slc + var yyhl1886 bool = l >= 0 + for yyj1886 := 0; ; yyj1886++ { + if yyhl1886 { + if yyj1886 >= l { break } } else { @@ -22963,28 +25103,28 @@ func (x *PodTemplateSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1737Slc = r.DecodeBytes(yys1737Slc, true, true) - yys1737 := string(yys1737Slc) + yys1886Slc = r.DecodeBytes(yys1886Slc, true, true) + yys1886 := string(yys1886Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1737 { + switch yys1886 { case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv1738 := &x.ObjectMeta - yyv1738.CodecDecodeSelf(d) + yyv1887 := &x.ObjectMeta + yyv1887.CodecDecodeSelf(d) } case "spec": if r.TryDecodeAsNil() { x.Spec = PodSpec{} } else { - yyv1739 := &x.Spec - yyv1739.CodecDecodeSelf(d) + yyv1888 := &x.Spec + yyv1888.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1737) - } // end switch yys1737 - } // end for yyj1737 + z.DecStructFieldNotFound(-1, yys1886) + } // end switch yys1886 + } // end for yyj1886 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -22992,16 +25132,16 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1740 int - var yyb1740 bool - var yyhl1740 bool = l >= 0 - yyj1740++ - if yyhl1740 { - yyb1740 = yyj1740 > l + var yyj1889 int + var yyb1889 bool + var yyhl1889 bool = l >= 0 + yyj1889++ + if yyhl1889 { + yyb1889 = yyj1889 > l } else { - yyb1740 = r.CheckBreak() + yyb1889 = r.CheckBreak() } - if yyb1740 { + if yyb1889 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23009,16 +25149,16 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv1741 := &x.ObjectMeta - yyv1741.CodecDecodeSelf(d) + yyv1890 := &x.ObjectMeta + yyv1890.CodecDecodeSelf(d) } - yyj1740++ - if yyhl1740 { - yyb1740 = yyj1740 > l + yyj1889++ + if yyhl1889 { + yyb1889 = yyj1889 > l } else { - yyb1740 = r.CheckBreak() + yyb1889 = r.CheckBreak() } - if yyb1740 { + if yyb1889 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23026,21 +25166,21 @@ func (x *PodTemplateSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Spec = PodSpec{} } else { - yyv1742 := &x.Spec - yyv1742.CodecDecodeSelf(d) + yyv1891 := &x.Spec + yyv1891.CodecDecodeSelf(d) } for { - yyj1740++ - if yyhl1740 { - yyb1740 = yyj1740 > l + yyj1889++ + if yyhl1889 { + yyb1889 = yyj1889 > l } else { - yyb1740 = r.CheckBreak() + yyb1889 = r.CheckBreak() } - if yyb1740 { + if yyb1889 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1740-1, "") + z.DecStructFieldNotFound(yyj1889-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23052,118 +25192,118 @@ func (x *PodTemplate) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1743 := z.EncBinary() - _ = yym1743 + yym1892 := z.EncBinary() + _ = yym1892 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1744 := !z.EncBinary() - yy2arr1744 := z.EncBasicHandle().StructToArray - var yyq1744 [4]bool - _, _, _ = yysep1744, yyq1744, yy2arr1744 - const yyr1744 bool = false - yyq1744[0] = x.Kind != "" - yyq1744[1] = x.APIVersion != "" - yyq1744[2] = true - yyq1744[3] = true - var yynn1744 int - if yyr1744 || yy2arr1744 { + yysep1893 := !z.EncBinary() + yy2arr1893 := z.EncBasicHandle().StructToArray + var yyq1893 [4]bool + _, _, _ = yysep1893, yyq1893, yy2arr1893 + const yyr1893 bool = false + yyq1893[0] = true + yyq1893[1] = true + yyq1893[2] = x.Kind != "" + yyq1893[3] = x.APIVersion != "" + var yynn1893 int + if yyr1893 || yy2arr1893 { r.EncodeArrayStart(4) } else { - yynn1744 = 0 - for _, b := range yyq1744 { + yynn1893 = 0 + for _, b := range yyq1893 { if b { - yynn1744++ + yynn1893++ } } - r.EncodeMapStart(yynn1744) - yynn1744 = 0 + r.EncodeMapStart(yynn1893) + yynn1893 = 0 } - if yyr1744 || yy2arr1744 { + if yyr1893 || yy2arr1893 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1744[0] { - yym1746 := z.EncBinary() - _ = yym1746 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1744[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1747 := z.EncBinary() - _ = yym1747 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1744 || yy2arr1744 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1744[1] { - yym1749 := z.EncBinary() - _ = yym1749 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1744[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1750 := z.EncBinary() - _ = yym1750 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1744 || yy2arr1744 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1744[2] { - yy1752 := &x.ObjectMeta - yy1752.CodecEncodeSelf(e) + if yyq1893[0] { + yy1895 := &x.ObjectMeta + yy1895.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1744[2] { + if yyq1893[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1753 := &x.ObjectMeta - yy1753.CodecEncodeSelf(e) + yy1896 := &x.ObjectMeta + yy1896.CodecEncodeSelf(e) } } - if yyr1744 || yy2arr1744 { + if yyr1893 || yy2arr1893 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1744[3] { - yy1755 := &x.Template - yy1755.CodecEncodeSelf(e) + if yyq1893[1] { + yy1898 := &x.Template + yy1898.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1744[3] { + if yyq1893[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1756 := &x.Template - yy1756.CodecEncodeSelf(e) + yy1899 := &x.Template + yy1899.CodecEncodeSelf(e) } } - if yyr1744 || yy2arr1744 { + if yyr1893 || yy2arr1893 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1893[2] { + yym1901 := z.EncBinary() + _ = yym1901 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1893[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1902 := z.EncBinary() + _ = yym1902 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1893 || yy2arr1893 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1893[3] { + yym1904 := z.EncBinary() + _ = yym1904 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1893[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1905 := z.EncBinary() + _ = yym1905 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1893 || yy2arr1893 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23176,25 +25316,25 @@ func (x *PodTemplate) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1757 := z.DecBinary() - _ = yym1757 + yym1906 := z.DecBinary() + _ = yym1906 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1758 := r.ContainerType() - if yyct1758 == codecSelferValueTypeMap1234 { - yyl1758 := r.ReadMapStart() - if yyl1758 == 0 { + yyct1907 := r.ContainerType() + if yyct1907 == codecSelferValueTypeMap1234 { + yyl1907 := r.ReadMapStart() + if yyl1907 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1758, d) + x.codecDecodeSelfFromMap(yyl1907, d) } - } else if yyct1758 == codecSelferValueTypeArray1234 { - yyl1758 := r.ReadArrayStart() - if yyl1758 == 0 { + } else if yyct1907 == codecSelferValueTypeArray1234 { + yyl1907 := r.ReadArrayStart() + if yyl1907 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1758, d) + x.codecDecodeSelfFromArray(yyl1907, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23206,12 +25346,12 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1759Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1759Slc - var yyhl1759 bool = l >= 0 - for yyj1759 := 0; ; yyj1759++ { - if yyhl1759 { - if yyj1759 >= l { + var yys1908Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1908Slc + var yyhl1908 bool = l >= 0 + for yyj1908 := 0; ; yyj1908++ { + if yyhl1908 { + if yyj1908 >= l { break } } else { @@ -23220,10 +25360,24 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1759Slc = r.DecodeBytes(yys1759Slc, true, true) - yys1759 := string(yys1759Slc) + yys1908Slc = r.DecodeBytes(yys1908Slc, true, true) + yys1908 := string(yys1908Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1759 { + switch yys1908 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1909 := &x.ObjectMeta + yyv1909.CodecDecodeSelf(d) + } + case "template": + if r.TryDecodeAsNil() { + x.Template = PodTemplateSpec{} + } else { + yyv1910 := &x.Template + yyv1910.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -23236,24 +25390,10 @@ func (x *PodTemplate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1762 := &x.ObjectMeta - yyv1762.CodecDecodeSelf(d) - } - case "template": - if r.TryDecodeAsNil() { - x.Template = PodTemplateSpec{} - } else { - yyv1763 := &x.Template - yyv1763.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1759) - } // end switch yys1759 - } // end for yyj1759 + z.DecStructFieldNotFound(-1, yys1908) + } // end switch yys1908 + } // end for yyj1908 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23261,16 +25401,50 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1764 int - var yyb1764 bool - var yyhl1764 bool = l >= 0 - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + var yyj1913 int + var yyb1913 bool + var yyhl1913 bool = l >= 0 + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv1914 := &x.ObjectMeta + yyv1914.CodecDecodeSelf(d) + } + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l + } else { + yyb1913 = r.CheckBreak() + } + if yyb1913 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Template = PodTemplateSpec{} + } else { + yyv1915 := &x.Template + yyv1915.CodecDecodeSelf(d) + } + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l + } else { + yyb1913 = r.CheckBreak() + } + if yyb1913 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23280,13 +25454,13 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23296,52 +25470,18 @@ func (x *PodTemplate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l - } else { - yyb1764 = r.CheckBreak() - } - if yyb1764 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1767 := &x.ObjectMeta - yyv1767.CodecDecodeSelf(d) - } - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l - } else { - yyb1764 = r.CheckBreak() - } - if yyb1764 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Template = PodTemplateSpec{} - } else { - yyv1768 := &x.Template - yyv1768.CodecDecodeSelf(d) - } for { - yyj1764++ - if yyhl1764 { - yyb1764 = yyj1764 > l + yyj1913++ + if yyhl1913 { + yyb1913 = yyj1913 > l } else { - yyb1764 = r.CheckBreak() + yyb1913 = r.CheckBreak() } - if yyb1764 { + if yyb1913 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1764-1, "") + z.DecStructFieldNotFound(yyj1913-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23353,118 +25493,68 @@ func (x *PodTemplateList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1769 := z.EncBinary() - _ = yym1769 + yym1918 := z.EncBinary() + _ = yym1918 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1770 := !z.EncBinary() - yy2arr1770 := z.EncBasicHandle().StructToArray - var yyq1770 [4]bool - _, _, _ = yysep1770, yyq1770, yy2arr1770 - const yyr1770 bool = false - yyq1770[0] = x.Kind != "" - yyq1770[1] = x.APIVersion != "" - yyq1770[2] = true - var yynn1770 int - if yyr1770 || yy2arr1770 { + yysep1919 := !z.EncBinary() + yy2arr1919 := z.EncBasicHandle().StructToArray + var yyq1919 [4]bool + _, _, _ = yysep1919, yyq1919, yy2arr1919 + const yyr1919 bool = false + yyq1919[0] = true + yyq1919[2] = x.Kind != "" + yyq1919[3] = x.APIVersion != "" + var yynn1919 int + if yyr1919 || yy2arr1919 { r.EncodeArrayStart(4) } else { - yynn1770 = 1 - for _, b := range yyq1770 { + yynn1919 = 1 + for _, b := range yyq1919 { if b { - yynn1770++ + yynn1919++ } } - r.EncodeMapStart(yynn1770) - yynn1770 = 0 + r.EncodeMapStart(yynn1919) + yynn1919 = 0 } - if yyr1770 || yy2arr1770 { + if yyr1919 || yy2arr1919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1770[0] { - yym1772 := z.EncBinary() - _ = yym1772 + if yyq1919[0] { + yy1921 := &x.ListMeta + yym1922 := z.EncBinary() + _ = yym1922 if false { + } else if z.HasExtensions() && z.EncExt(yy1921) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1770[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1773 := z.EncBinary() - _ = yym1773 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1770 || yy2arr1770 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1770[1] { - yym1775 := z.EncBinary() - _ = yym1775 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1770[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1776 := z.EncBinary() - _ = yym1776 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1770 || yy2arr1770 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1770[2] { - yy1778 := &x.ListMeta - yym1779 := z.EncBinary() - _ = yym1779 - if false { - } else if z.HasExtensions() && z.EncExt(yy1778) { - } else { - z.EncFallback(yy1778) + z.EncFallback(yy1921) } } else { r.EncodeNil() } } else { - if yyq1770[2] { + if yyq1919[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1780 := &x.ListMeta - yym1781 := z.EncBinary() - _ = yym1781 + yy1923 := &x.ListMeta + yym1924 := z.EncBinary() + _ = yym1924 if false { - } else if z.HasExtensions() && z.EncExt(yy1780) { + } else if z.HasExtensions() && z.EncExt(yy1923) { } else { - z.EncFallback(yy1780) + z.EncFallback(yy1923) } } } - if yyr1770 || yy2arr1770 { + if yyr1919 || yy2arr1919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1783 := z.EncBinary() - _ = yym1783 + yym1926 := z.EncBinary() + _ = yym1926 if false { } else { h.encSlicePodTemplate(([]PodTemplate)(x.Items), e) @@ -23477,15 +25567,65 @@ func (x *PodTemplateList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1784 := z.EncBinary() - _ = yym1784 + yym1927 := z.EncBinary() + _ = yym1927 if false { } else { h.encSlicePodTemplate(([]PodTemplate)(x.Items), e) } } } - if yyr1770 || yy2arr1770 { + if yyr1919 || yy2arr1919 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1919[2] { + yym1929 := z.EncBinary() + _ = yym1929 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1919[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1930 := z.EncBinary() + _ = yym1930 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1919 || yy2arr1919 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1919[3] { + yym1932 := z.EncBinary() + _ = yym1932 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1919[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1933 := z.EncBinary() + _ = yym1933 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1919 || yy2arr1919 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23498,25 +25638,25 @@ func (x *PodTemplateList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1785 := z.DecBinary() - _ = yym1785 + yym1934 := z.DecBinary() + _ = yym1934 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1786 := r.ContainerType() - if yyct1786 == codecSelferValueTypeMap1234 { - yyl1786 := r.ReadMapStart() - if yyl1786 == 0 { + yyct1935 := r.ContainerType() + if yyct1935 == codecSelferValueTypeMap1234 { + yyl1935 := r.ReadMapStart() + if yyl1935 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1786, d) + x.codecDecodeSelfFromMap(yyl1935, d) } - } else if yyct1786 == codecSelferValueTypeArray1234 { - yyl1786 := r.ReadArrayStart() - if yyl1786 == 0 { + } else if yyct1935 == codecSelferValueTypeArray1234 { + yyl1935 := r.ReadArrayStart() + if yyl1935 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1786, d) + x.codecDecodeSelfFromArray(yyl1935, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23528,12 +25668,12 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1787Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1787Slc - var yyhl1787 bool = l >= 0 - for yyj1787 := 0; ; yyj1787++ { - if yyhl1787 { - if yyj1787 >= l { + var yys1936Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1936Slc + var yyhl1936 bool = l >= 0 + for yyj1936 := 0; ; yyj1936++ { + if yyhl1936 { + if yyj1936 >= l { break } } else { @@ -23542,10 +25682,35 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1787Slc = r.DecodeBytes(yys1787Slc, true, true) - yys1787 := string(yys1787Slc) + yys1936Slc = r.DecodeBytes(yys1936Slc, true, true) + yys1936 := string(yys1936Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1787 { + switch yys1936 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1937 := &x.ListMeta + yym1938 := z.DecBinary() + _ = yym1938 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1937) { + } else { + z.DecFallback(yyv1937, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1939 := &x.Items + yym1940 := z.DecBinary() + _ = yym1940 + if false { + } else { + h.decSlicePodTemplate((*[]PodTemplate)(yyv1939), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -23558,35 +25723,10 @@ func (x *PodTemplateList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1790 := &x.ListMeta - yym1791 := z.DecBinary() - _ = yym1791 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1790) { - } else { - z.DecFallback(yyv1790, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1792 := &x.Items - yym1793 := z.DecBinary() - _ = yym1793 - if false { - } else { - h.decSlicePodTemplate((*[]PodTemplate)(yyv1792), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1787) - } // end switch yys1787 - } // end for yyj1787 + z.DecStructFieldNotFound(-1, yys1936) + } // end switch yys1936 + } // end for yyj1936 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23594,16 +25734,61 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1794 int - var yyb1794 bool - var yyhl1794 bool = l >= 0 - yyj1794++ - if yyhl1794 { - yyb1794 = yyj1794 > l + var yyj1943 int + var yyb1943 bool + var yyhl1943 bool = l >= 0 + yyj1943++ + if yyhl1943 { + yyb1943 = yyj1943 > l } else { - yyb1794 = r.CheckBreak() + yyb1943 = r.CheckBreak() } - if yyb1794 { + if yyb1943 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv1944 := &x.ListMeta + yym1945 := z.DecBinary() + _ = yym1945 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1944) { + } else { + z.DecFallback(yyv1944, false) + } + } + yyj1943++ + if yyhl1943 { + yyb1943 = yyj1943 > l + } else { + yyb1943 = r.CheckBreak() + } + if yyb1943 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1946 := &x.Items + yym1947 := z.DecBinary() + _ = yym1947 + if false { + } else { + h.decSlicePodTemplate((*[]PodTemplate)(yyv1946), d) + } + } + yyj1943++ + if yyhl1943 { + yyb1943 = yyj1943 > l + } else { + yyb1943 = r.CheckBreak() + } + if yyb1943 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23613,13 +25798,13 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj1794++ - if yyhl1794 { - yyb1794 = yyj1794 > l + yyj1943++ + if yyhl1943 { + yyb1943 = yyj1943 > l } else { - yyb1794 = r.CheckBreak() + yyb1943 = r.CheckBreak() } - if yyb1794 { + if yyb1943 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23629,63 +25814,18 @@ func (x *PodTemplateList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj1794++ - if yyhl1794 { - yyb1794 = yyj1794 > l - } else { - yyb1794 = r.CheckBreak() - } - if yyb1794 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1797 := &x.ListMeta - yym1798 := z.DecBinary() - _ = yym1798 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1797) { - } else { - z.DecFallback(yyv1797, false) - } - } - yyj1794++ - if yyhl1794 { - yyb1794 = yyj1794 > l - } else { - yyb1794 = r.CheckBreak() - } - if yyb1794 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1799 := &x.Items - yym1800 := z.DecBinary() - _ = yym1800 - if false { - } else { - h.decSlicePodTemplate((*[]PodTemplate)(yyv1799), d) - } - } for { - yyj1794++ - if yyhl1794 { - yyb1794 = yyj1794 > l + yyj1943++ + if yyhl1943 { + yyb1943 = yyj1943 > l } else { - yyb1794 = r.CheckBreak() + yyb1943 = r.CheckBreak() } - if yyb1794 { + if yyb1943 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1794-1, "") + z.DecStructFieldNotFound(yyj1943-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -23697,75 +25837,75 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1801 := z.EncBinary() - _ = yym1801 + yym1950 := z.EncBinary() + _ = yym1950 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1802 := !z.EncBinary() - yy2arr1802 := z.EncBasicHandle().StructToArray - var yyq1802 [3]bool - _, _, _ = yysep1802, yyq1802, yy2arr1802 - const yyr1802 bool = false - yyq1802[0] = x.Replicas != nil - yyq1802[1] = len(x.Selector) != 0 - yyq1802[2] = x.Template != nil - var yynn1802 int - if yyr1802 || yy2arr1802 { + yysep1951 := !z.EncBinary() + yy2arr1951 := z.EncBasicHandle().StructToArray + var yyq1951 [3]bool + _, _, _ = yysep1951, yyq1951, yy2arr1951 + const yyr1951 bool = false + yyq1951[0] = x.Replicas != nil + yyq1951[1] = len(x.Selector) != 0 + yyq1951[2] = x.Template != nil + var yynn1951 int + if yyr1951 || yy2arr1951 { r.EncodeArrayStart(3) } else { - yynn1802 = 0 - for _, b := range yyq1802 { + yynn1951 = 0 + for _, b := range yyq1951 { if b { - yynn1802++ + yynn1951++ } } - r.EncodeMapStart(yynn1802) - yynn1802 = 0 + r.EncodeMapStart(yynn1951) + yynn1951 = 0 } - if yyr1802 || yy2arr1802 { + if yyr1951 || yy2arr1951 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1802[0] { + if yyq1951[0] { if x.Replicas == nil { r.EncodeNil() } else { - yy1804 := *x.Replicas - yym1805 := z.EncBinary() - _ = yym1805 + yy1953 := *x.Replicas + yym1954 := z.EncBinary() + _ = yym1954 if false { } else { - r.EncodeInt(int64(yy1804)) + r.EncodeInt(int64(yy1953)) } } } else { r.EncodeNil() } } else { - if yyq1802[0] { + if yyq1951[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Replicas == nil { r.EncodeNil() } else { - yy1806 := *x.Replicas - yym1807 := z.EncBinary() - _ = yym1807 + yy1955 := *x.Replicas + yym1956 := z.EncBinary() + _ = yym1956 if false { } else { - r.EncodeInt(int64(yy1806)) + r.EncodeInt(int64(yy1955)) } } } } - if yyr1802 || yy2arr1802 { + if yyr1951 || yy2arr1951 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1802[1] { + if yyq1951[1] { if x.Selector == nil { r.EncodeNil() } else { - yym1809 := z.EncBinary() - _ = yym1809 + yym1958 := z.EncBinary() + _ = yym1958 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -23775,15 +25915,15 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1802[1] { + if yyq1951[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Selector == nil { r.EncodeNil() } else { - yym1810 := z.EncBinary() - _ = yym1810 + yym1959 := z.EncBinary() + _ = yym1959 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -23791,9 +25931,9 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1802 || yy2arr1802 { + if yyr1951 || yy2arr1951 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1802[2] { + if yyq1951[2] { if x.Template == nil { r.EncodeNil() } else { @@ -23803,7 +25943,7 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1802[2] { + if yyq1951[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -23814,7 +25954,7 @@ func (x *ReplicationControllerSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1802 || yy2arr1802 { + if yyr1951 || yy2arr1951 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -23827,25 +25967,25 @@ func (x *ReplicationControllerSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1812 := z.DecBinary() - _ = yym1812 + yym1961 := z.DecBinary() + _ = yym1961 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1813 := r.ContainerType() - if yyct1813 == codecSelferValueTypeMap1234 { - yyl1813 := r.ReadMapStart() - if yyl1813 == 0 { + yyct1962 := r.ContainerType() + if yyct1962 == codecSelferValueTypeMap1234 { + yyl1962 := r.ReadMapStart() + if yyl1962 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1813, d) + x.codecDecodeSelfFromMap(yyl1962, d) } - } else if yyct1813 == codecSelferValueTypeArray1234 { - yyl1813 := r.ReadArrayStart() - if yyl1813 == 0 { + } else if yyct1962 == codecSelferValueTypeArray1234 { + yyl1962 := r.ReadArrayStart() + if yyl1962 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1813, d) + x.codecDecodeSelfFromArray(yyl1962, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -23857,12 +25997,12 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1814Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1814Slc - var yyhl1814 bool = l >= 0 - for yyj1814 := 0; ; yyj1814++ { - if yyhl1814 { - if yyj1814 >= l { + var yys1963Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1963Slc + var yyhl1963 bool = l >= 0 + for yyj1963 := 0; ; yyj1963++ { + if yyhl1963 { + if yyj1963 >= l { break } } else { @@ -23871,10 +26011,10 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1814Slc = r.DecodeBytes(yys1814Slc, true, true) - yys1814 := string(yys1814Slc) + yys1963Slc = r.DecodeBytes(yys1963Slc, true, true) + yys1963 := string(yys1963Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1814 { + switch yys1963 { case "replicas": if r.TryDecodeAsNil() { if x.Replicas != nil { @@ -23884,8 +26024,8 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D if x.Replicas == nil { x.Replicas = new(int32) } - yym1816 := z.DecBinary() - _ = yym1816 + yym1965 := z.DecBinary() + _ = yym1965 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) @@ -23895,12 +26035,12 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1817 := &x.Selector - yym1818 := z.DecBinary() - _ = yym1818 + yyv1966 := &x.Selector + yym1967 := z.DecBinary() + _ = yym1967 if false { } else { - z.F.DecMapStringStringX(yyv1817, false, d) + z.F.DecMapStringStringX(yyv1966, false, d) } } case "template": @@ -23915,9 +26055,9 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromMap(l int, d *codec1978.D x.Template.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1814) - } // end switch yys1814 - } // end for yyj1814 + z.DecStructFieldNotFound(-1, yys1963) + } // end switch yys1963 + } // end for yyj1963 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -23925,16 +26065,16 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1820 int - var yyb1820 bool - var yyhl1820 bool = l >= 0 - yyj1820++ - if yyhl1820 { - yyb1820 = yyj1820 > l + var yyj1969 int + var yyb1969 bool + var yyhl1969 bool = l >= 0 + yyj1969++ + if yyhl1969 { + yyb1969 = yyj1969 > l } else { - yyb1820 = r.CheckBreak() + yyb1969 = r.CheckBreak() } - if yyb1820 { + if yyb1969 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23947,20 +26087,20 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 if x.Replicas == nil { x.Replicas = new(int32) } - yym1822 := z.DecBinary() - _ = yym1822 + yym1971 := z.DecBinary() + _ = yym1971 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) } } - yyj1820++ - if yyhl1820 { - yyb1820 = yyj1820 > l + yyj1969++ + if yyhl1969 { + yyb1969 = yyj1969 > l } else { - yyb1820 = r.CheckBreak() + yyb1969 = r.CheckBreak() } - if yyb1820 { + if yyb1969 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23968,21 +26108,21 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1823 := &x.Selector - yym1824 := z.DecBinary() - _ = yym1824 + yyv1972 := &x.Selector + yym1973 := z.DecBinary() + _ = yym1973 if false { } else { - z.F.DecMapStringStringX(yyv1823, false, d) + z.F.DecMapStringStringX(yyv1972, false, d) } } - yyj1820++ - if yyhl1820 { - yyb1820 = yyj1820 > l + yyj1969++ + if yyhl1969 { + yyb1969 = yyj1969 > l } else { - yyb1820 = r.CheckBreak() + yyb1969 = r.CheckBreak() } - if yyb1820 { + if yyb1969 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -23998,17 +26138,17 @@ func (x *ReplicationControllerSpec) codecDecodeSelfFromArray(l int, d *codec1978 x.Template.CodecDecodeSelf(d) } for { - yyj1820++ - if yyhl1820 { - yyb1820 = yyj1820 > l + yyj1969++ + if yyhl1969 { + yyb1969 = yyj1969 > l } else { - yyb1820 = r.CheckBreak() + yyb1969 = r.CheckBreak() } - if yyb1820 { + if yyb1969 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1820-1, "") + z.DecStructFieldNotFound(yyj1969-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24020,34 +26160,34 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1826 := z.EncBinary() - _ = yym1826 + yym1975 := z.EncBinary() + _ = yym1975 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1827 := !z.EncBinary() - yy2arr1827 := z.EncBasicHandle().StructToArray - var yyq1827 [2]bool - _, _, _ = yysep1827, yyq1827, yy2arr1827 - const yyr1827 bool = false - yyq1827[1] = x.ObservedGeneration != 0 - var yynn1827 int - if yyr1827 || yy2arr1827 { + yysep1976 := !z.EncBinary() + yy2arr1976 := z.EncBasicHandle().StructToArray + var yyq1976 [2]bool + _, _, _ = yysep1976, yyq1976, yy2arr1976 + const yyr1976 bool = false + yyq1976[1] = x.ObservedGeneration != 0 + var yynn1976 int + if yyr1976 || yy2arr1976 { r.EncodeArrayStart(2) } else { - yynn1827 = 1 - for _, b := range yyq1827 { + yynn1976 = 1 + for _, b := range yyq1976 { if b { - yynn1827++ + yynn1976++ } } - r.EncodeMapStart(yynn1827) - yynn1827 = 0 + r.EncodeMapStart(yynn1976) + yynn1976 = 0 } - if yyr1827 || yy2arr1827 { + if yyr1976 || yy2arr1976 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1829 := z.EncBinary() - _ = yym1829 + yym1978 := z.EncBinary() + _ = yym1978 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -24056,18 +26196,18 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1830 := z.EncBinary() - _ = yym1830 + yym1979 := z.EncBinary() + _ = yym1979 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1827 || yy2arr1827 { + if yyr1976 || yy2arr1976 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1827[1] { - yym1832 := z.EncBinary() - _ = yym1832 + if yyq1976[1] { + yym1981 := z.EncBinary() + _ = yym1981 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) @@ -24076,19 +26216,19 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1827[1] { + if yyq1976[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("observedGeneration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1833 := z.EncBinary() - _ = yym1833 + yym1982 := z.EncBinary() + _ = yym1982 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) } } } - if yyr1827 || yy2arr1827 { + if yyr1976 || yy2arr1976 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24101,25 +26241,25 @@ func (x *ReplicationControllerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1834 := z.DecBinary() - _ = yym1834 + yym1983 := z.DecBinary() + _ = yym1983 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1835 := r.ContainerType() - if yyct1835 == codecSelferValueTypeMap1234 { - yyl1835 := r.ReadMapStart() - if yyl1835 == 0 { + yyct1984 := r.ContainerType() + if yyct1984 == codecSelferValueTypeMap1234 { + yyl1984 := r.ReadMapStart() + if yyl1984 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1835, d) + x.codecDecodeSelfFromMap(yyl1984, d) } - } else if yyct1835 == codecSelferValueTypeArray1234 { - yyl1835 := r.ReadArrayStart() - if yyl1835 == 0 { + } else if yyct1984 == codecSelferValueTypeArray1234 { + yyl1984 := r.ReadArrayStart() + if yyl1984 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1835, d) + x.codecDecodeSelfFromArray(yyl1984, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24131,12 +26271,12 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1836Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1836Slc - var yyhl1836 bool = l >= 0 - for yyj1836 := 0; ; yyj1836++ { - if yyhl1836 { - if yyj1836 >= l { + var yys1985Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1985Slc + var yyhl1985 bool = l >= 0 + for yyj1985 := 0; ; yyj1985++ { + if yyhl1985 { + if yyj1985 >= l { break } } else { @@ -24145,10 +26285,10 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1836Slc = r.DecodeBytes(yys1836Slc, true, true) - yys1836 := string(yys1836Slc) + yys1985Slc = r.DecodeBytes(yys1985Slc, true, true) + yys1985 := string(yys1985Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1836 { + switch yys1985 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -24162,9 +26302,9 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978 x.ObservedGeneration = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys1836) - } // end switch yys1836 - } // end for yyj1836 + z.DecStructFieldNotFound(-1, yys1985) + } // end switch yys1985 + } // end for yyj1985 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24172,16 +26312,16 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1839 int - var yyb1839 bool - var yyhl1839 bool = l >= 0 - yyj1839++ - if yyhl1839 { - yyb1839 = yyj1839 > l + var yyj1988 int + var yyb1988 bool + var yyhl1988 bool = l >= 0 + yyj1988++ + if yyhl1988 { + yyb1988 = yyj1988 > l } else { - yyb1839 = r.CheckBreak() + yyb1988 = r.CheckBreak() } - if yyb1839 { + if yyb1988 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24191,13 +26331,13 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 } else { x.Replicas = int32(r.DecodeInt(32)) } - yyj1839++ - if yyhl1839 { - yyb1839 = yyj1839 > l + yyj1988++ + if yyhl1988 { + yyb1988 = yyj1988 > l } else { - yyb1839 = r.CheckBreak() + yyb1988 = r.CheckBreak() } - if yyb1839 { + if yyb1988 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24208,17 +26348,17 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19 x.ObservedGeneration = int64(r.DecodeInt(64)) } for { - yyj1839++ - if yyhl1839 { - yyb1839 = yyj1839 > l + yyj1988++ + if yyhl1988 { + yyb1988 = yyj1988 > l } else { - yyb1839 = r.CheckBreak() + yyb1988 = r.CheckBreak() } - if yyb1839 { + if yyb1988 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1839-1, "") + z.DecStructFieldNotFound(yyj1988-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24230,136 +26370,136 @@ func (x *ReplicationController) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1842 := z.EncBinary() - _ = yym1842 + yym1991 := z.EncBinary() + _ = yym1991 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1843 := !z.EncBinary() - yy2arr1843 := z.EncBasicHandle().StructToArray - var yyq1843 [5]bool - _, _, _ = yysep1843, yyq1843, yy2arr1843 - const yyr1843 bool = false - yyq1843[0] = x.Kind != "" - yyq1843[1] = x.APIVersion != "" - yyq1843[2] = true - yyq1843[3] = true - yyq1843[4] = true - var yynn1843 int - if yyr1843 || yy2arr1843 { + yysep1992 := !z.EncBinary() + yy2arr1992 := z.EncBasicHandle().StructToArray + var yyq1992 [5]bool + _, _, _ = yysep1992, yyq1992, yy2arr1992 + const yyr1992 bool = false + yyq1992[0] = true + yyq1992[1] = true + yyq1992[2] = true + yyq1992[3] = x.Kind != "" + yyq1992[4] = x.APIVersion != "" + var yynn1992 int + if yyr1992 || yy2arr1992 { r.EncodeArrayStart(5) } else { - yynn1843 = 0 - for _, b := range yyq1843 { + yynn1992 = 0 + for _, b := range yyq1992 { if b { - yynn1843++ + yynn1992++ } } - r.EncodeMapStart(yynn1843) - yynn1843 = 0 + r.EncodeMapStart(yynn1992) + yynn1992 = 0 } - if yyr1843 || yy2arr1843 { + if yyr1992 || yy2arr1992 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1843[0] { - yym1845 := z.EncBinary() - _ = yym1845 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1843[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1846 := z.EncBinary() - _ = yym1846 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1843 || yy2arr1843 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1843[1] { - yym1848 := z.EncBinary() - _ = yym1848 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1843[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1849 := z.EncBinary() - _ = yym1849 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1843 || yy2arr1843 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1843[2] { - yy1851 := &x.ObjectMeta - yy1851.CodecEncodeSelf(e) + if yyq1992[0] { + yy1994 := &x.ObjectMeta + yy1994.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1843[2] { + if yyq1992[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1852 := &x.ObjectMeta - yy1852.CodecEncodeSelf(e) + yy1995 := &x.ObjectMeta + yy1995.CodecEncodeSelf(e) } } - if yyr1843 || yy2arr1843 { + if yyr1992 || yy2arr1992 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1843[3] { - yy1854 := &x.Spec - yy1854.CodecEncodeSelf(e) + if yyq1992[1] { + yy1997 := &x.Spec + yy1997.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1843[3] { + if yyq1992[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1855 := &x.Spec - yy1855.CodecEncodeSelf(e) + yy1998 := &x.Spec + yy1998.CodecEncodeSelf(e) } } - if yyr1843 || yy2arr1843 { + if yyr1992 || yy2arr1992 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1843[4] { - yy1857 := &x.Status - yy1857.CodecEncodeSelf(e) + if yyq1992[2] { + yy2000 := &x.Status + yy2000.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1843[4] { + if yyq1992[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1858 := &x.Status - yy1858.CodecEncodeSelf(e) + yy2001 := &x.Status + yy2001.CodecEncodeSelf(e) } } - if yyr1843 || yy2arr1843 { + if yyr1992 || yy2arr1992 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1992[3] { + yym2003 := z.EncBinary() + _ = yym2003 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1992[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2004 := z.EncBinary() + _ = yym2004 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1992 || yy2arr1992 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1992[4] { + yym2006 := z.EncBinary() + _ = yym2006 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1992[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2007 := z.EncBinary() + _ = yym2007 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1992 || yy2arr1992 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24372,25 +26512,25 @@ func (x *ReplicationController) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1859 := z.DecBinary() - _ = yym1859 + yym2008 := z.DecBinary() + _ = yym2008 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1860 := r.ContainerType() - if yyct1860 == codecSelferValueTypeMap1234 { - yyl1860 := r.ReadMapStart() - if yyl1860 == 0 { + yyct2009 := r.ContainerType() + if yyct2009 == codecSelferValueTypeMap1234 { + yyl2009 := r.ReadMapStart() + if yyl2009 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1860, d) + x.codecDecodeSelfFromMap(yyl2009, d) } - } else if yyct1860 == codecSelferValueTypeArray1234 { - yyl1860 := r.ReadArrayStart() - if yyl1860 == 0 { + } else if yyct2009 == codecSelferValueTypeArray1234 { + yyl2009 := r.ReadArrayStart() + if yyl2009 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1860, d) + x.codecDecodeSelfFromArray(yyl2009, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24402,12 +26542,12 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1861Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1861Slc - var yyhl1861 bool = l >= 0 - for yyj1861 := 0; ; yyj1861++ { - if yyhl1861 { - if yyj1861 >= l { + var yys2010Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2010Slc + var yyhl2010 bool = l >= 0 + for yyj2010 := 0; ; yyj2010++ { + if yyhl2010 { + if yyj2010 >= l { break } } else { @@ -24416,10 +26556,31 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1861Slc = r.DecodeBytes(yys1861Slc, true, true) - yys1861 := string(yys1861Slc) + yys2010Slc = r.DecodeBytes(yys2010Slc, true, true) + yys2010 := string(yys2010Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1861 { + switch yys2010 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2011 := &x.ObjectMeta + yyv2011.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ReplicationControllerSpec{} + } else { + yyv2012 := &x.Spec + yyv2012.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ReplicationControllerStatus{} + } else { + yyv2013 := &x.Status + yyv2013.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -24432,31 +26593,10 @@ func (x *ReplicationController) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1864 := &x.ObjectMeta - yyv1864.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ReplicationControllerSpec{} - } else { - yyv1865 := &x.Spec - yyv1865.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ReplicationControllerStatus{} - } else { - yyv1866 := &x.Status - yyv1866.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1861) - } // end switch yys1861 - } // end for yyj1861 + z.DecStructFieldNotFound(-1, yys2010) + } // end switch yys2010 + } // end for yyj2010 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24464,16 +26604,67 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1867 int - var yyb1867 bool - var yyhl1867 bool = l >= 0 - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l + var yyj2016 int + var yyb2016 bool + var yyhl2016 bool = l >= 0 + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l } else { - yyb1867 = r.CheckBreak() + yyb2016 = r.CheckBreak() } - if yyb1867 { + if yyb2016 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2017 := &x.ObjectMeta + yyv2017.CodecDecodeSelf(d) + } + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l + } else { + yyb2016 = r.CheckBreak() + } + if yyb2016 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ReplicationControllerSpec{} + } else { + yyv2018 := &x.Spec + yyv2018.CodecDecodeSelf(d) + } + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l + } else { + yyb2016 = r.CheckBreak() + } + if yyb2016 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ReplicationControllerStatus{} + } else { + yyv2019 := &x.Status + yyv2019.CodecDecodeSelf(d) + } + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l + } else { + yyb2016 = r.CheckBreak() + } + if yyb2016 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24483,13 +26674,13 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l } else { - yyb1867 = r.CheckBreak() + yyb2016 = r.CheckBreak() } - if yyb1867 { + if yyb2016 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24499,69 +26690,18 @@ func (x *ReplicationController) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l - } else { - yyb1867 = r.CheckBreak() - } - if yyb1867 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv1870 := &x.ObjectMeta - yyv1870.CodecDecodeSelf(d) - } - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l - } else { - yyb1867 = r.CheckBreak() - } - if yyb1867 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ReplicationControllerSpec{} - } else { - yyv1871 := &x.Spec - yyv1871.CodecDecodeSelf(d) - } - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l - } else { - yyb1867 = r.CheckBreak() - } - if yyb1867 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ReplicationControllerStatus{} - } else { - yyv1872 := &x.Status - yyv1872.CodecDecodeSelf(d) - } for { - yyj1867++ - if yyhl1867 { - yyb1867 = yyj1867 > l + yyj2016++ + if yyhl2016 { + yyb2016 = yyj2016 > l } else { - yyb1867 = r.CheckBreak() + yyb2016 = r.CheckBreak() } - if yyb1867 { + if yyb2016 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1867-1, "") + z.DecStructFieldNotFound(yyj2016-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24573,118 +26713,68 @@ func (x *ReplicationControllerList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1873 := z.EncBinary() - _ = yym1873 + yym2022 := z.EncBinary() + _ = yym2022 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1874 := !z.EncBinary() - yy2arr1874 := z.EncBasicHandle().StructToArray - var yyq1874 [4]bool - _, _, _ = yysep1874, yyq1874, yy2arr1874 - const yyr1874 bool = false - yyq1874[0] = x.Kind != "" - yyq1874[1] = x.APIVersion != "" - yyq1874[2] = true - var yynn1874 int - if yyr1874 || yy2arr1874 { + yysep2023 := !z.EncBinary() + yy2arr2023 := z.EncBasicHandle().StructToArray + var yyq2023 [4]bool + _, _, _ = yysep2023, yyq2023, yy2arr2023 + const yyr2023 bool = false + yyq2023[0] = true + yyq2023[2] = x.Kind != "" + yyq2023[3] = x.APIVersion != "" + var yynn2023 int + if yyr2023 || yy2arr2023 { r.EncodeArrayStart(4) } else { - yynn1874 = 1 - for _, b := range yyq1874 { + yynn2023 = 1 + for _, b := range yyq2023 { if b { - yynn1874++ + yynn2023++ } } - r.EncodeMapStart(yynn1874) - yynn1874 = 0 + r.EncodeMapStart(yynn2023) + yynn2023 = 0 } - if yyr1874 || yy2arr1874 { + if yyr2023 || yy2arr2023 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1874[0] { - yym1876 := z.EncBinary() - _ = yym1876 + if yyq2023[0] { + yy2025 := &x.ListMeta + yym2026 := z.EncBinary() + _ = yym2026 if false { + } else if z.HasExtensions() && z.EncExt(yy2025) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1874[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1877 := z.EncBinary() - _ = yym1877 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1874 || yy2arr1874 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1874[1] { - yym1879 := z.EncBinary() - _ = yym1879 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1874[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1880 := z.EncBinary() - _ = yym1880 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1874 || yy2arr1874 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1874[2] { - yy1882 := &x.ListMeta - yym1883 := z.EncBinary() - _ = yym1883 - if false { - } else if z.HasExtensions() && z.EncExt(yy1882) { - } else { - z.EncFallback(yy1882) + z.EncFallback(yy2025) } } else { r.EncodeNil() } } else { - if yyq1874[2] { + if yyq2023[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1884 := &x.ListMeta - yym1885 := z.EncBinary() - _ = yym1885 + yy2027 := &x.ListMeta + yym2028 := z.EncBinary() + _ = yym2028 if false { - } else if z.HasExtensions() && z.EncExt(yy1884) { + } else if z.HasExtensions() && z.EncExt(yy2027) { } else { - z.EncFallback(yy1884) + z.EncFallback(yy2027) } } } - if yyr1874 || yy2arr1874 { + if yyr2023 || yy2arr2023 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1887 := z.EncBinary() - _ = yym1887 + yym2030 := z.EncBinary() + _ = yym2030 if false { } else { h.encSliceReplicationController(([]ReplicationController)(x.Items), e) @@ -24697,15 +26787,65 @@ func (x *ReplicationControllerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1888 := z.EncBinary() - _ = yym1888 + yym2031 := z.EncBinary() + _ = yym2031 if false { } else { h.encSliceReplicationController(([]ReplicationController)(x.Items), e) } } } - if yyr1874 || yy2arr1874 { + if yyr2023 || yy2arr2023 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2023[2] { + yym2033 := z.EncBinary() + _ = yym2033 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2023[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2034 := z.EncBinary() + _ = yym2034 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2023 || yy2arr2023 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2023[3] { + yym2036 := z.EncBinary() + _ = yym2036 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2023[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2037 := z.EncBinary() + _ = yym2037 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2023 || yy2arr2023 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -24718,25 +26858,25 @@ func (x *ReplicationControllerList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1889 := z.DecBinary() - _ = yym1889 + yym2038 := z.DecBinary() + _ = yym2038 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1890 := r.ContainerType() - if yyct1890 == codecSelferValueTypeMap1234 { - yyl1890 := r.ReadMapStart() - if yyl1890 == 0 { + yyct2039 := r.ContainerType() + if yyct2039 == codecSelferValueTypeMap1234 { + yyl2039 := r.ReadMapStart() + if yyl2039 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1890, d) + x.codecDecodeSelfFromMap(yyl2039, d) } - } else if yyct1890 == codecSelferValueTypeArray1234 { - yyl1890 := r.ReadArrayStart() - if yyl1890 == 0 { + } else if yyct2039 == codecSelferValueTypeArray1234 { + yyl2039 := r.ReadArrayStart() + if yyl2039 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1890, d) + x.codecDecodeSelfFromArray(yyl2039, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -24748,12 +26888,12 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1891Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1891Slc - var yyhl1891 bool = l >= 0 - for yyj1891 := 0; ; yyj1891++ { - if yyhl1891 { - if yyj1891 >= l { + var yys2040Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2040Slc + var yyhl2040 bool = l >= 0 + for yyj2040 := 0; ; yyj2040++ { + if yyhl2040 { + if yyj2040 >= l { break } } else { @@ -24762,10 +26902,35 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1891Slc = r.DecodeBytes(yys1891Slc, true, true) - yys1891 := string(yys1891Slc) + yys2040Slc = r.DecodeBytes(yys2040Slc, true, true) + yys2040 := string(yys2040Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1891 { + switch yys2040 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2041 := &x.ListMeta + yym2042 := z.DecBinary() + _ = yym2042 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2041) { + } else { + z.DecFallback(yyv2041, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2043 := &x.Items + yym2044 := z.DecBinary() + _ = yym2044 + if false { + } else { + h.decSliceReplicationController((*[]ReplicationController)(yyv2043), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -24778,35 +26943,10 @@ func (x *ReplicationControllerList) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1894 := &x.ListMeta - yym1895 := z.DecBinary() - _ = yym1895 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1894) { - } else { - z.DecFallback(yyv1894, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1896 := &x.Items - yym1897 := z.DecBinary() - _ = yym1897 - if false { - } else { - h.decSliceReplicationController((*[]ReplicationController)(yyv1896), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1891) - } // end switch yys1891 - } // end for yyj1891 + z.DecStructFieldNotFound(-1, yys2040) + } // end switch yys2040 + } // end for yyj2040 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -24814,16 +26954,61 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1898 int - var yyb1898 bool - var yyhl1898 bool = l >= 0 - yyj1898++ - if yyhl1898 { - yyb1898 = yyj1898 > l + var yyj2047 int + var yyb2047 bool + var yyhl2047 bool = l >= 0 + yyj2047++ + if yyhl2047 { + yyb2047 = yyj2047 > l } else { - yyb1898 = r.CheckBreak() + yyb2047 = r.CheckBreak() } - if yyb1898 { + if yyb2047 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2048 := &x.ListMeta + yym2049 := z.DecBinary() + _ = yym2049 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2048) { + } else { + z.DecFallback(yyv2048, false) + } + } + yyj2047++ + if yyhl2047 { + yyb2047 = yyj2047 > l + } else { + yyb2047 = r.CheckBreak() + } + if yyb2047 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2050 := &x.Items + yym2051 := z.DecBinary() + _ = yym2051 + if false { + } else { + h.decSliceReplicationController((*[]ReplicationController)(yyv2050), d) + } + } + yyj2047++ + if yyhl2047 { + yyb2047 = yyj2047 > l + } else { + yyb2047 = r.CheckBreak() + } + if yyb2047 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24833,13 +27018,13 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.Kind = string(r.DecodeString()) } - yyj1898++ - if yyhl1898 { - yyb1898 = yyj1898 > l + yyj2047++ + if yyhl2047 { + yyb2047 = yyj2047 > l } else { - yyb1898 = r.CheckBreak() + yyb2047 = r.CheckBreak() } - if yyb1898 { + if yyb2047 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -24849,63 +27034,18 @@ func (x *ReplicationControllerList) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - yyj1898++ - if yyhl1898 { - yyb1898 = yyj1898 > l - } else { - yyb1898 = r.CheckBreak() - } - if yyb1898 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv1901 := &x.ListMeta - yym1902 := z.DecBinary() - _ = yym1902 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1901) { - } else { - z.DecFallback(yyv1901, false) - } - } - yyj1898++ - if yyhl1898 { - yyb1898 = yyj1898 > l - } else { - yyb1898 = r.CheckBreak() - } - if yyb1898 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1903 := &x.Items - yym1904 := z.DecBinary() - _ = yym1904 - if false { - } else { - h.decSliceReplicationController((*[]ReplicationController)(yyv1903), d) - } - } for { - yyj1898++ - if yyhl1898 { - yyb1898 = yyj1898 > l + yyj2047++ + if yyhl2047 { + yyb2047 = yyj2047 > l } else { - yyb1898 = r.CheckBreak() + yyb2047 = r.CheckBreak() } - if yyb1898 { + if yyb2047 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1898-1, "") + z.DecStructFieldNotFound(yyj2047-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -24914,8 +27054,8 @@ func (x ServiceAffinity) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1905 := z.EncBinary() - _ = yym1905 + yym2054 := z.EncBinary() + _ = yym2054 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -24927,8 +27067,8 @@ func (x *ServiceAffinity) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1906 := z.DecBinary() - _ = yym1906 + yym2055 := z.DecBinary() + _ = yym2055 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -24940,8 +27080,8 @@ func (x ServiceType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1907 := z.EncBinary() - _ = yym1907 + yym2056 := z.EncBinary() + _ = yym2056 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -24953,8 +27093,8 @@ func (x *ServiceType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1908 := z.DecBinary() - _ = yym1908 + yym2057 := z.DecBinary() + _ = yym2057 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -24969,48 +27109,48 @@ func (x *ServiceStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1909 := z.EncBinary() - _ = yym1909 + yym2058 := z.EncBinary() + _ = yym2058 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1910 := !z.EncBinary() - yy2arr1910 := z.EncBasicHandle().StructToArray - var yyq1910 [1]bool - _, _, _ = yysep1910, yyq1910, yy2arr1910 - const yyr1910 bool = false - yyq1910[0] = true - var yynn1910 int - if yyr1910 || yy2arr1910 { + yysep2059 := !z.EncBinary() + yy2arr2059 := z.EncBasicHandle().StructToArray + var yyq2059 [1]bool + _, _, _ = yysep2059, yyq2059, yy2arr2059 + const yyr2059 bool = false + yyq2059[0] = true + var yynn2059 int + if yyr2059 || yy2arr2059 { r.EncodeArrayStart(1) } else { - yynn1910 = 0 - for _, b := range yyq1910 { + yynn2059 = 0 + for _, b := range yyq2059 { if b { - yynn1910++ + yynn2059++ } } - r.EncodeMapStart(yynn1910) - yynn1910 = 0 + r.EncodeMapStart(yynn2059) + yynn2059 = 0 } - if yyr1910 || yy2arr1910 { + if yyr2059 || yy2arr2059 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1910[0] { - yy1912 := &x.LoadBalancer - yy1912.CodecEncodeSelf(e) + if yyq2059[0] { + yy2061 := &x.LoadBalancer + yy2061.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1910[0] { + if yyq2059[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1913 := &x.LoadBalancer - yy1913.CodecEncodeSelf(e) + yy2062 := &x.LoadBalancer + yy2062.CodecEncodeSelf(e) } } - if yyr1910 || yy2arr1910 { + if yyr2059 || yy2arr2059 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25023,25 +27163,25 @@ func (x *ServiceStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1914 := z.DecBinary() - _ = yym1914 + yym2063 := z.DecBinary() + _ = yym2063 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1915 := r.ContainerType() - if yyct1915 == codecSelferValueTypeMap1234 { - yyl1915 := r.ReadMapStart() - if yyl1915 == 0 { + yyct2064 := r.ContainerType() + if yyct2064 == codecSelferValueTypeMap1234 { + yyl2064 := r.ReadMapStart() + if yyl2064 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1915, d) + x.codecDecodeSelfFromMap(yyl2064, d) } - } else if yyct1915 == codecSelferValueTypeArray1234 { - yyl1915 := r.ReadArrayStart() - if yyl1915 == 0 { + } else if yyct2064 == codecSelferValueTypeArray1234 { + yyl2064 := r.ReadArrayStart() + if yyl2064 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1915, d) + x.codecDecodeSelfFromArray(yyl2064, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25053,12 +27193,12 @@ func (x *ServiceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1916Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1916Slc - var yyhl1916 bool = l >= 0 - for yyj1916 := 0; ; yyj1916++ { - if yyhl1916 { - if yyj1916 >= l { + var yys2065Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2065Slc + var yyhl2065 bool = l >= 0 + for yyj2065 := 0; ; yyj2065++ { + if yyhl2065 { + if yyj2065 >= l { break } } else { @@ -25067,21 +27207,21 @@ func (x *ServiceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1916Slc = r.DecodeBytes(yys1916Slc, true, true) - yys1916 := string(yys1916Slc) + yys2065Slc = r.DecodeBytes(yys2065Slc, true, true) + yys2065 := string(yys2065Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1916 { + switch yys2065 { case "loadBalancer": if r.TryDecodeAsNil() { x.LoadBalancer = LoadBalancerStatus{} } else { - yyv1917 := &x.LoadBalancer - yyv1917.CodecDecodeSelf(d) + yyv2066 := &x.LoadBalancer + yyv2066.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1916) - } // end switch yys1916 - } // end for yyj1916 + z.DecStructFieldNotFound(-1, yys2065) + } // end switch yys2065 + } // end for yyj2065 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25089,16 +27229,16 @@ func (x *ServiceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1918 int - var yyb1918 bool - var yyhl1918 bool = l >= 0 - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l + var yyj2067 int + var yyb2067 bool + var yyhl2067 bool = l >= 0 + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l } else { - yyb1918 = r.CheckBreak() + yyb2067 = r.CheckBreak() } - if yyb1918 { + if yyb2067 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25106,21 +27246,21 @@ func (x *ServiceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LoadBalancer = LoadBalancerStatus{} } else { - yyv1919 := &x.LoadBalancer - yyv1919.CodecDecodeSelf(d) + yyv2068 := &x.LoadBalancer + yyv2068.CodecDecodeSelf(d) } for { - yyj1918++ - if yyhl1918 { - yyb1918 = yyj1918 > l + yyj2067++ + if yyhl2067 { + yyb2067 = yyj2067 > l } else { - yyb1918 = r.CheckBreak() + yyb2067 = r.CheckBreak() } - if yyb1918 { + if yyb2067 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1918-1, "") + z.DecStructFieldNotFound(yyj2067-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25132,38 +27272,38 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1920 := z.EncBinary() - _ = yym1920 + yym2069 := z.EncBinary() + _ = yym2069 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1921 := !z.EncBinary() - yy2arr1921 := z.EncBasicHandle().StructToArray - var yyq1921 [1]bool - _, _, _ = yysep1921, yyq1921, yy2arr1921 - const yyr1921 bool = false - yyq1921[0] = len(x.Ingress) != 0 - var yynn1921 int - if yyr1921 || yy2arr1921 { + yysep2070 := !z.EncBinary() + yy2arr2070 := z.EncBasicHandle().StructToArray + var yyq2070 [1]bool + _, _, _ = yysep2070, yyq2070, yy2arr2070 + const yyr2070 bool = false + yyq2070[0] = len(x.Ingress) != 0 + var yynn2070 int + if yyr2070 || yy2arr2070 { r.EncodeArrayStart(1) } else { - yynn1921 = 0 - for _, b := range yyq1921 { + yynn2070 = 0 + for _, b := range yyq2070 { if b { - yynn1921++ + yynn2070++ } } - r.EncodeMapStart(yynn1921) - yynn1921 = 0 + r.EncodeMapStart(yynn2070) + yynn2070 = 0 } - if yyr1921 || yy2arr1921 { + if yyr2070 || yy2arr2070 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1921[0] { + if yyq2070[0] { if x.Ingress == nil { r.EncodeNil() } else { - yym1923 := z.EncBinary() - _ = yym1923 + yym2072 := z.EncBinary() + _ = yym2072 if false { } else { h.encSliceLoadBalancerIngress(([]LoadBalancerIngress)(x.Ingress), e) @@ -25173,15 +27313,15 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1921[0] { + if yyq2070[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ingress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Ingress == nil { r.EncodeNil() } else { - yym1924 := z.EncBinary() - _ = yym1924 + yym2073 := z.EncBinary() + _ = yym2073 if false { } else { h.encSliceLoadBalancerIngress(([]LoadBalancerIngress)(x.Ingress), e) @@ -25189,7 +27329,7 @@ func (x *LoadBalancerStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1921 || yy2arr1921 { + if yyr2070 || yy2arr2070 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25202,25 +27342,25 @@ func (x *LoadBalancerStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1925 := z.DecBinary() - _ = yym1925 + yym2074 := z.DecBinary() + _ = yym2074 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1926 := r.ContainerType() - if yyct1926 == codecSelferValueTypeMap1234 { - yyl1926 := r.ReadMapStart() - if yyl1926 == 0 { + yyct2075 := r.ContainerType() + if yyct2075 == codecSelferValueTypeMap1234 { + yyl2075 := r.ReadMapStart() + if yyl2075 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1926, d) + x.codecDecodeSelfFromMap(yyl2075, d) } - } else if yyct1926 == codecSelferValueTypeArray1234 { - yyl1926 := r.ReadArrayStart() - if yyl1926 == 0 { + } else if yyct2075 == codecSelferValueTypeArray1234 { + yyl2075 := r.ReadArrayStart() + if yyl2075 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1926, d) + x.codecDecodeSelfFromArray(yyl2075, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25232,12 +27372,12 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1927Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1927Slc - var yyhl1927 bool = l >= 0 - for yyj1927 := 0; ; yyj1927++ { - if yyhl1927 { - if yyj1927 >= l { + var yys2076Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2076Slc + var yyhl2076 bool = l >= 0 + for yyj2076 := 0; ; yyj2076++ { + if yyhl2076 { + if yyj2076 >= l { break } } else { @@ -25246,26 +27386,26 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1927Slc = r.DecodeBytes(yys1927Slc, true, true) - yys1927 := string(yys1927Slc) + yys2076Slc = r.DecodeBytes(yys2076Slc, true, true) + yys2076 := string(yys2076Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1927 { + switch yys2076 { case "ingress": if r.TryDecodeAsNil() { x.Ingress = nil } else { - yyv1928 := &x.Ingress - yym1929 := z.DecBinary() - _ = yym1929 + yyv2077 := &x.Ingress + yym2078 := z.DecBinary() + _ = yym2078 if false { } else { - h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv1928), d) + h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv2077), d) } } default: - z.DecStructFieldNotFound(-1, yys1927) - } // end switch yys1927 - } // end for yyj1927 + z.DecStructFieldNotFound(-1, yys2076) + } // end switch yys2076 + } // end for yyj2076 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25273,16 +27413,16 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1930 int - var yyb1930 bool - var yyhl1930 bool = l >= 0 - yyj1930++ - if yyhl1930 { - yyb1930 = yyj1930 > l + var yyj2079 int + var yyb2079 bool + var yyhl2079 bool = l >= 0 + yyj2079++ + if yyhl2079 { + yyb2079 = yyj2079 > l } else { - yyb1930 = r.CheckBreak() + yyb2079 = r.CheckBreak() } - if yyb1930 { + if yyb2079 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25290,26 +27430,26 @@ func (x *LoadBalancerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Ingress = nil } else { - yyv1931 := &x.Ingress - yym1932 := z.DecBinary() - _ = yym1932 + yyv2080 := &x.Ingress + yym2081 := z.DecBinary() + _ = yym2081 if false { } else { - h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv1931), d) + h.decSliceLoadBalancerIngress((*[]LoadBalancerIngress)(yyv2080), d) } } for { - yyj1930++ - if yyhl1930 { - yyb1930 = yyj1930 > l + yyj2079++ + if yyhl2079 { + yyb2079 = yyj2079 > l } else { - yyb1930 = r.CheckBreak() + yyb2079 = r.CheckBreak() } - if yyb1930 { + if yyb2079 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1930-1, "") + z.DecStructFieldNotFound(yyj2079-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25321,36 +27461,36 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1933 := z.EncBinary() - _ = yym1933 + yym2082 := z.EncBinary() + _ = yym2082 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1934 := !z.EncBinary() - yy2arr1934 := z.EncBasicHandle().StructToArray - var yyq1934 [2]bool - _, _, _ = yysep1934, yyq1934, yy2arr1934 - const yyr1934 bool = false - yyq1934[0] = x.IP != "" - yyq1934[1] = x.Hostname != "" - var yynn1934 int - if yyr1934 || yy2arr1934 { + yysep2083 := !z.EncBinary() + yy2arr2083 := z.EncBasicHandle().StructToArray + var yyq2083 [2]bool + _, _, _ = yysep2083, yyq2083, yy2arr2083 + const yyr2083 bool = false + yyq2083[0] = x.IP != "" + yyq2083[1] = x.Hostname != "" + var yynn2083 int + if yyr2083 || yy2arr2083 { r.EncodeArrayStart(2) } else { - yynn1934 = 0 - for _, b := range yyq1934 { + yynn2083 = 0 + for _, b := range yyq2083 { if b { - yynn1934++ + yynn2083++ } } - r.EncodeMapStart(yynn1934) - yynn1934 = 0 + r.EncodeMapStart(yynn2083) + yynn2083 = 0 } - if yyr1934 || yy2arr1934 { + if yyr2083 || yy2arr2083 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1934[0] { - yym1936 := z.EncBinary() - _ = yym1936 + if yyq2083[0] { + yym2085 := z.EncBinary() + _ = yym2085 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) @@ -25359,23 +27499,23 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1934[0] { + if yyq2083[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ip")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1937 := z.EncBinary() - _ = yym1937 + yym2086 := z.EncBinary() + _ = yym2086 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) } } } - if yyr1934 || yy2arr1934 { + if yyr2083 || yy2arr2083 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1934[1] { - yym1939 := z.EncBinary() - _ = yym1939 + if yyq2083[1] { + yym2088 := z.EncBinary() + _ = yym2088 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Hostname)) @@ -25384,19 +27524,19 @@ func (x *LoadBalancerIngress) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1934[1] { + if yyq2083[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostname")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1940 := z.EncBinary() - _ = yym1940 + yym2089 := z.EncBinary() + _ = yym2089 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Hostname)) } } } - if yyr1934 || yy2arr1934 { + if yyr2083 || yy2arr2083 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25409,25 +27549,25 @@ func (x *LoadBalancerIngress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1941 := z.DecBinary() - _ = yym1941 + yym2090 := z.DecBinary() + _ = yym2090 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1942 := r.ContainerType() - if yyct1942 == codecSelferValueTypeMap1234 { - yyl1942 := r.ReadMapStart() - if yyl1942 == 0 { + yyct2091 := r.ContainerType() + if yyct2091 == codecSelferValueTypeMap1234 { + yyl2091 := r.ReadMapStart() + if yyl2091 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1942, d) + x.codecDecodeSelfFromMap(yyl2091, d) } - } else if yyct1942 == codecSelferValueTypeArray1234 { - yyl1942 := r.ReadArrayStart() - if yyl1942 == 0 { + } else if yyct2091 == codecSelferValueTypeArray1234 { + yyl2091 := r.ReadArrayStart() + if yyl2091 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1942, d) + x.codecDecodeSelfFromArray(yyl2091, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25439,12 +27579,12 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1943Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1943Slc - var yyhl1943 bool = l >= 0 - for yyj1943 := 0; ; yyj1943++ { - if yyhl1943 { - if yyj1943 >= l { + var yys2092Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2092Slc + var yyhl2092 bool = l >= 0 + for yyj2092 := 0; ; yyj2092++ { + if yyhl2092 { + if yyj2092 >= l { break } } else { @@ -25453,10 +27593,10 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1943Slc = r.DecodeBytes(yys1943Slc, true, true) - yys1943 := string(yys1943Slc) + yys2092Slc = r.DecodeBytes(yys2092Slc, true, true) + yys2092 := string(yys2092Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1943 { + switch yys2092 { case "ip": if r.TryDecodeAsNil() { x.IP = "" @@ -25470,9 +27610,9 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder x.Hostname = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1943) - } // end switch yys1943 - } // end for yyj1943 + z.DecStructFieldNotFound(-1, yys2092) + } // end switch yys2092 + } // end for yyj2092 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25480,16 +27620,16 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1946 int - var yyb1946 bool - var yyhl1946 bool = l >= 0 - yyj1946++ - if yyhl1946 { - yyb1946 = yyj1946 > l + var yyj2095 int + var yyb2095 bool + var yyhl2095 bool = l >= 0 + yyj2095++ + if yyhl2095 { + yyb2095 = yyj2095 > l } else { - yyb1946 = r.CheckBreak() + yyb2095 = r.CheckBreak() } - if yyb1946 { + if yyb2095 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25499,13 +27639,13 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.IP = string(r.DecodeString()) } - yyj1946++ - if yyhl1946 { - yyb1946 = yyj1946 > l + yyj2095++ + if yyhl2095 { + yyb2095 = yyj2095 > l } else { - yyb1946 = r.CheckBreak() + yyb2095 = r.CheckBreak() } - if yyb1946 { + if yyb2095 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25516,17 +27656,17 @@ func (x *LoadBalancerIngress) codecDecodeSelfFromArray(l int, d *codec1978.Decod x.Hostname = string(r.DecodeString()) } for { - yyj1946++ - if yyhl1946 { - yyb1946 = yyj1946 > l + yyj2095++ + if yyhl2095 { + yyb2095 = yyj2095 > l } else { - yyb1946 = r.CheckBreak() + yyb2095 = r.CheckBreak() } - if yyb1946 { + if yyb2095 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1946-1, "") + z.DecStructFieldNotFound(yyj2095-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -25538,43 +27678,43 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1949 := z.EncBinary() - _ = yym1949 + yym2098 := z.EncBinary() + _ = yym2098 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1950 := !z.EncBinary() - yy2arr1950 := z.EncBasicHandle().StructToArray - var yyq1950 [8]bool - _, _, _ = yysep1950, yyq1950, yy2arr1950 - const yyr1950 bool = false - yyq1950[1] = len(x.Selector) != 0 - yyq1950[2] = x.ClusterIP != "" - yyq1950[3] = x.Type != "" - yyq1950[4] = len(x.ExternalIPs) != 0 - yyq1950[5] = len(x.DeprecatedPublicIPs) != 0 - yyq1950[6] = x.SessionAffinity != "" - yyq1950[7] = x.LoadBalancerIP != "" - var yynn1950 int - if yyr1950 || yy2arr1950 { + yysep2099 := !z.EncBinary() + yy2arr2099 := z.EncBasicHandle().StructToArray + var yyq2099 [8]bool + _, _, _ = yysep2099, yyq2099, yy2arr2099 + const yyr2099 bool = false + yyq2099[1] = len(x.Selector) != 0 + yyq2099[2] = x.ClusterIP != "" + yyq2099[3] = x.Type != "" + yyq2099[4] = len(x.ExternalIPs) != 0 + yyq2099[5] = len(x.DeprecatedPublicIPs) != 0 + yyq2099[6] = x.SessionAffinity != "" + yyq2099[7] = x.LoadBalancerIP != "" + var yynn2099 int + if yyr2099 || yy2arr2099 { r.EncodeArrayStart(8) } else { - yynn1950 = 1 - for _, b := range yyq1950 { + yynn2099 = 1 + for _, b := range yyq2099 { if b { - yynn1950++ + yynn2099++ } } - r.EncodeMapStart(yynn1950) - yynn1950 = 0 + r.EncodeMapStart(yynn2099) + yynn2099 = 0 } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Ports == nil { r.EncodeNil() } else { - yym1952 := z.EncBinary() - _ = yym1952 + yym2101 := z.EncBinary() + _ = yym2101 if false { } else { h.encSliceServicePort(([]ServicePort)(x.Ports), e) @@ -25587,22 +27727,22 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Ports == nil { r.EncodeNil() } else { - yym1953 := z.EncBinary() - _ = yym1953 + yym2102 := z.EncBinary() + _ = yym2102 if false { } else { h.encSliceServicePort(([]ServicePort)(x.Ports), e) } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[1] { + if yyq2099[1] { if x.Selector == nil { r.EncodeNil() } else { - yym1955 := z.EncBinary() - _ = yym1955 + yym2104 := z.EncBinary() + _ = yym2104 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -25612,15 +27752,15 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1950[1] { + if yyq2099[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Selector == nil { r.EncodeNil() } else { - yym1956 := z.EncBinary() - _ = yym1956 + yym2105 := z.EncBinary() + _ = yym2105 if false { } else { z.F.EncMapStringStringV(x.Selector, false, e) @@ -25628,11 +27768,11 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[2] { - yym1958 := z.EncBinary() - _ = yym1958 + if yyq2099[2] { + yym2107 := z.EncBinary() + _ = yym2107 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterIP)) @@ -25641,41 +27781,41 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1950[2] { + if yyq2099[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("clusterIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1959 := z.EncBinary() - _ = yym1959 + yym2108 := z.EncBinary() + _ = yym2108 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterIP)) } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[3] { + if yyq2099[3] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1950[3] { + if yyq2099[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[4] { + if yyq2099[4] { if x.ExternalIPs == nil { r.EncodeNil() } else { - yym1962 := z.EncBinary() - _ = yym1962 + yym2111 := z.EncBinary() + _ = yym2111 if false { } else { z.F.EncSliceStringV(x.ExternalIPs, false, e) @@ -25685,15 +27825,15 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1950[4] { + if yyq2099[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("externalIPs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ExternalIPs == nil { r.EncodeNil() } else { - yym1963 := z.EncBinary() - _ = yym1963 + yym2112 := z.EncBinary() + _ = yym2112 if false { } else { z.F.EncSliceStringV(x.ExternalIPs, false, e) @@ -25701,14 +27841,14 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[5] { + if yyq2099[5] { if x.DeprecatedPublicIPs == nil { r.EncodeNil() } else { - yym1965 := z.EncBinary() - _ = yym1965 + yym2114 := z.EncBinary() + _ = yym2114 if false { } else { z.F.EncSliceStringV(x.DeprecatedPublicIPs, false, e) @@ -25718,15 +27858,15 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1950[5] { + if yyq2099[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("deprecatedPublicIPs")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.DeprecatedPublicIPs == nil { r.EncodeNil() } else { - yym1966 := z.EncBinary() - _ = yym1966 + yym2115 := z.EncBinary() + _ = yym2115 if false { } else { z.F.EncSliceStringV(x.DeprecatedPublicIPs, false, e) @@ -25734,26 +27874,26 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[6] { + if yyq2099[6] { x.SessionAffinity.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1950[6] { + if yyq2099[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("sessionAffinity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.SessionAffinity.CodecEncodeSelf(e) } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1950[7] { - yym1969 := z.EncBinary() - _ = yym1969 + if yyq2099[7] { + yym2118 := z.EncBinary() + _ = yym2118 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.LoadBalancerIP)) @@ -25762,19 +27902,19 @@ func (x *ServiceSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1950[7] { + if yyq2099[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancerIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1970 := z.EncBinary() - _ = yym1970 + yym2119 := z.EncBinary() + _ = yym2119 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.LoadBalancerIP)) } } } - if yyr1950 || yy2arr1950 { + if yyr2099 || yy2arr2099 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -25787,25 +27927,25 @@ func (x *ServiceSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1971 := z.DecBinary() - _ = yym1971 + yym2120 := z.DecBinary() + _ = yym2120 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1972 := r.ContainerType() - if yyct1972 == codecSelferValueTypeMap1234 { - yyl1972 := r.ReadMapStart() - if yyl1972 == 0 { + yyct2121 := r.ContainerType() + if yyct2121 == codecSelferValueTypeMap1234 { + yyl2121 := r.ReadMapStart() + if yyl2121 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1972, d) + x.codecDecodeSelfFromMap(yyl2121, d) } - } else if yyct1972 == codecSelferValueTypeArray1234 { - yyl1972 := r.ReadArrayStart() - if yyl1972 == 0 { + } else if yyct2121 == codecSelferValueTypeArray1234 { + yyl2121 := r.ReadArrayStart() + if yyl2121 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1972, d) + x.codecDecodeSelfFromArray(yyl2121, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -25817,12 +27957,12 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1973Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1973Slc - var yyhl1973 bool = l >= 0 - for yyj1973 := 0; ; yyj1973++ { - if yyhl1973 { - if yyj1973 >= l { + var yys2122Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2122Slc + var yyhl2122 bool = l >= 0 + for yyj2122 := 0; ; yyj2122++ { + if yyhl2122 { + if yyj2122 >= l { break } } else { @@ -25831,32 +27971,32 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1973Slc = r.DecodeBytes(yys1973Slc, true, true) - yys1973 := string(yys1973Slc) + yys2122Slc = r.DecodeBytes(yys2122Slc, true, true) + yys2122 := string(yys2122Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1973 { + switch yys2122 { case "ports": if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1974 := &x.Ports - yym1975 := z.DecBinary() - _ = yym1975 + yyv2123 := &x.Ports + yym2124 := z.DecBinary() + _ = yym2124 if false { } else { - h.decSliceServicePort((*[]ServicePort)(yyv1974), d) + h.decSliceServicePort((*[]ServicePort)(yyv2123), d) } } case "selector": if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1976 := &x.Selector - yym1977 := z.DecBinary() - _ = yym1977 + yyv2125 := &x.Selector + yym2126 := z.DecBinary() + _ = yym2126 if false { } else { - z.F.DecMapStringStringX(yyv1976, false, d) + z.F.DecMapStringStringX(yyv2125, false, d) } } case "clusterIP": @@ -25875,24 +28015,24 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ExternalIPs = nil } else { - yyv1980 := &x.ExternalIPs - yym1981 := z.DecBinary() - _ = yym1981 + yyv2129 := &x.ExternalIPs + yym2130 := z.DecBinary() + _ = yym2130 if false { } else { - z.F.DecSliceStringX(yyv1980, false, d) + z.F.DecSliceStringX(yyv2129, false, d) } } case "deprecatedPublicIPs": if r.TryDecodeAsNil() { x.DeprecatedPublicIPs = nil } else { - yyv1982 := &x.DeprecatedPublicIPs - yym1983 := z.DecBinary() - _ = yym1983 + yyv2131 := &x.DeprecatedPublicIPs + yym2132 := z.DecBinary() + _ = yym2132 if false { } else { - z.F.DecSliceStringX(yyv1982, false, d) + z.F.DecSliceStringX(yyv2131, false, d) } } case "sessionAffinity": @@ -25908,9 +28048,9 @@ func (x *ServiceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.LoadBalancerIP = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys1973) - } // end switch yys1973 - } // end for yyj1973 + z.DecStructFieldNotFound(-1, yys2122) + } // end switch yys2122 + } // end for yyj2122 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -25918,16 +28058,16 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1986 int - var yyb1986 bool - var yyhl1986 bool = l >= 0 - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + var yyj2135 int + var yyb2135 bool + var yyhl2135 bool = l >= 0 + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25935,21 +28075,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv1987 := &x.Ports - yym1988 := z.DecBinary() - _ = yym1988 + yyv2136 := &x.Ports + yym2137 := z.DecBinary() + _ = yym2137 if false { } else { - h.decSliceServicePort((*[]ServicePort)(yyv1987), d) + h.decSliceServicePort((*[]ServicePort)(yyv2136), d) } } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25957,21 +28097,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Selector = nil } else { - yyv1989 := &x.Selector - yym1990 := z.DecBinary() - _ = yym1990 + yyv2138 := &x.Selector + yym2139 := z.DecBinary() + _ = yym2139 if false { } else { - z.F.DecMapStringStringX(yyv1989, false, d) + z.F.DecMapStringStringX(yyv2138, false, d) } } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25981,13 +28121,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ClusterIP = string(r.DecodeString()) } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -25997,13 +28137,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = ServiceType(r.DecodeString()) } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26011,21 +28151,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ExternalIPs = nil } else { - yyv1993 := &x.ExternalIPs - yym1994 := z.DecBinary() - _ = yym1994 + yyv2142 := &x.ExternalIPs + yym2143 := z.DecBinary() + _ = yym2143 if false { } else { - z.F.DecSliceStringX(yyv1993, false, d) + z.F.DecSliceStringX(yyv2142, false, d) } } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26033,21 +28173,21 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.DeprecatedPublicIPs = nil } else { - yyv1995 := &x.DeprecatedPublicIPs - yym1996 := z.DecBinary() - _ = yym1996 + yyv2144 := &x.DeprecatedPublicIPs + yym2145 := z.DecBinary() + _ = yym2145 if false { } else { - z.F.DecSliceStringX(yyv1995, false, d) + z.F.DecSliceStringX(yyv2144, false, d) } } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26057,13 +28197,13 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.SessionAffinity = ServiceAffinity(r.DecodeString()) } - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26074,17 +28214,17 @@ func (x *ServiceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.LoadBalancerIP = string(r.DecodeString()) } for { - yyj1986++ - if yyhl1986 { - yyb1986 = yyj1986 > l + yyj2135++ + if yyhl2135 { + yyb2135 = yyj2135 > l } else { - yyb1986 = r.CheckBreak() + yyb2135 = r.CheckBreak() } - if yyb1986 { + if yyb2135 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1986-1, "") + z.DecStructFieldNotFound(yyj2135-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -26096,38 +28236,38 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1999 := z.EncBinary() - _ = yym1999 + yym2148 := z.EncBinary() + _ = yym2148 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2000 := !z.EncBinary() - yy2arr2000 := z.EncBasicHandle().StructToArray - var yyq2000 [5]bool - _, _, _ = yysep2000, yyq2000, yy2arr2000 - const yyr2000 bool = false - yyq2000[0] = x.Name != "" - yyq2000[1] = x.Protocol != "" - yyq2000[3] = true - yyq2000[4] = x.NodePort != 0 - var yynn2000 int - if yyr2000 || yy2arr2000 { + yysep2149 := !z.EncBinary() + yy2arr2149 := z.EncBasicHandle().StructToArray + var yyq2149 [5]bool + _, _, _ = yysep2149, yyq2149, yy2arr2149 + const yyr2149 bool = false + yyq2149[0] = x.Name != "" + yyq2149[1] = x.Protocol != "" + yyq2149[3] = true + yyq2149[4] = x.NodePort != 0 + var yynn2149 int + if yyr2149 || yy2arr2149 { r.EncodeArrayStart(5) } else { - yynn2000 = 1 - for _, b := range yyq2000 { + yynn2149 = 1 + for _, b := range yyq2149 { if b { - yynn2000++ + yynn2149++ } } - r.EncodeMapStart(yynn2000) - yynn2000 = 0 + r.EncodeMapStart(yynn2149) + yynn2149 = 0 } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2000[0] { - yym2002 := z.EncBinary() - _ = yym2002 + if yyq2149[0] { + yym2151 := z.EncBinary() + _ = yym2151 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -26136,37 +28276,37 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2000[0] { + if yyq2149[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2003 := z.EncBinary() - _ = yym2003 + yym2152 := z.EncBinary() + _ = yym2152 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2000[1] { + if yyq2149[1] { x.Protocol.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2000[1] { + if yyq2149[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("protocol")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2006 := z.EncBinary() - _ = yym2006 + yym2155 := z.EncBinary() + _ = yym2155 if false { } else { r.EncodeInt(int64(x.Port)) @@ -26175,51 +28315,51 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2007 := z.EncBinary() - _ = yym2007 + yym2156 := z.EncBinary() + _ = yym2156 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2000[3] { - yy2009 := &x.TargetPort - yym2010 := z.EncBinary() - _ = yym2010 + if yyq2149[3] { + yy2158 := &x.TargetPort + yym2159 := z.EncBinary() + _ = yym2159 if false { - } else if z.HasExtensions() && z.EncExt(yy2009) { - } else if !yym2010 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2009) + } else if z.HasExtensions() && z.EncExt(yy2158) { + } else if !yym2159 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2158) } else { - z.EncFallback(yy2009) + z.EncFallback(yy2158) } } else { r.EncodeNil() } } else { - if yyq2000[3] { + if yyq2149[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("targetPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2011 := &x.TargetPort - yym2012 := z.EncBinary() - _ = yym2012 + yy2160 := &x.TargetPort + yym2161 := z.EncBinary() + _ = yym2161 if false { - } else if z.HasExtensions() && z.EncExt(yy2011) { - } else if !yym2012 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2011) + } else if z.HasExtensions() && z.EncExt(yy2160) { + } else if !yym2161 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2160) } else { - z.EncFallback(yy2011) + z.EncFallback(yy2160) } } } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2000[4] { - yym2014 := z.EncBinary() - _ = yym2014 + if yyq2149[4] { + yym2163 := z.EncBinary() + _ = yym2163 if false { } else { r.EncodeInt(int64(x.NodePort)) @@ -26228,19 +28368,19 @@ func (x *ServicePort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq2000[4] { + if yyq2149[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodePort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2015 := z.EncBinary() - _ = yym2015 + yym2164 := z.EncBinary() + _ = yym2164 if false { } else { r.EncodeInt(int64(x.NodePort)) } } } - if yyr2000 || yy2arr2000 { + if yyr2149 || yy2arr2149 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26253,25 +28393,25 @@ func (x *ServicePort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2016 := z.DecBinary() - _ = yym2016 + yym2165 := z.DecBinary() + _ = yym2165 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2017 := r.ContainerType() - if yyct2017 == codecSelferValueTypeMap1234 { - yyl2017 := r.ReadMapStart() - if yyl2017 == 0 { + yyct2166 := r.ContainerType() + if yyct2166 == codecSelferValueTypeMap1234 { + yyl2166 := r.ReadMapStart() + if yyl2166 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2017, d) + x.codecDecodeSelfFromMap(yyl2166, d) } - } else if yyct2017 == codecSelferValueTypeArray1234 { - yyl2017 := r.ReadArrayStart() - if yyl2017 == 0 { + } else if yyct2166 == codecSelferValueTypeArray1234 { + yyl2166 := r.ReadArrayStart() + if yyl2166 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2017, d) + x.codecDecodeSelfFromArray(yyl2166, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26283,12 +28423,12 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2018Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2018Slc - var yyhl2018 bool = l >= 0 - for yyj2018 := 0; ; yyj2018++ { - if yyhl2018 { - if yyj2018 >= l { + var yys2167Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2167Slc + var yyhl2167 bool = l >= 0 + for yyj2167 := 0; ; yyj2167++ { + if yyhl2167 { + if yyj2167 >= l { break } } else { @@ -26297,10 +28437,10 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2018Slc = r.DecodeBytes(yys2018Slc, true, true) - yys2018 := string(yys2018Slc) + yys2167Slc = r.DecodeBytes(yys2167Slc, true, true) + yys2167 := string(yys2167Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2018 { + switch yys2167 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -26323,15 +28463,15 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetPort = pkg5_intstr.IntOrString{} } else { - yyv2022 := &x.TargetPort - yym2023 := z.DecBinary() - _ = yym2023 + yyv2171 := &x.TargetPort + yym2172 := z.DecBinary() + _ = yym2172 if false { - } else if z.HasExtensions() && z.DecExt(yyv2022) { - } else if !yym2023 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2022) + } else if z.HasExtensions() && z.DecExt(yyv2171) { + } else if !yym2172 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2171) } else { - z.DecFallback(yyv2022, false) + z.DecFallback(yyv2171, false) } } case "nodePort": @@ -26341,9 +28481,9 @@ func (x *ServicePort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.NodePort = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys2018) - } // end switch yys2018 - } // end for yyj2018 + z.DecStructFieldNotFound(-1, yys2167) + } // end switch yys2167 + } // end for yyj2167 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -26351,16 +28491,16 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2025 int - var yyb2025 bool - var yyhl2025 bool = l >= 0 - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + var yyj2174 int + var yyb2174 bool + var yyhl2174 bool = l >= 0 + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26370,13 +28510,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26386,13 +28526,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Protocol = Protocol(r.DecodeString()) } - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26402,13 +28542,13 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Port = int32(r.DecodeInt(32)) } - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26416,24 +28556,24 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.TargetPort = pkg5_intstr.IntOrString{} } else { - yyv2029 := &x.TargetPort - yym2030 := z.DecBinary() - _ = yym2030 + yyv2178 := &x.TargetPort + yym2179 := z.DecBinary() + _ = yym2179 if false { - } else if z.HasExtensions() && z.DecExt(yyv2029) { - } else if !yym2030 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2029) + } else if z.HasExtensions() && z.DecExt(yyv2178) { + } else if !yym2179 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2178) } else { - z.DecFallback(yyv2029, false) + z.DecFallback(yyv2178, false) } } - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26444,17 +28584,17 @@ func (x *ServicePort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.NodePort = int32(r.DecodeInt(32)) } for { - yyj2025++ - if yyhl2025 { - yyb2025 = yyj2025 > l + yyj2174++ + if yyhl2174 { + yyb2174 = yyj2174 > l } else { - yyb2025 = r.CheckBreak() + yyb2174 = r.CheckBreak() } - if yyb2025 { + if yyb2174 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2025-1, "") + z.DecStructFieldNotFound(yyj2174-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -26466,136 +28606,136 @@ func (x *Service) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2032 := z.EncBinary() - _ = yym2032 + yym2181 := z.EncBinary() + _ = yym2181 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2033 := !z.EncBinary() - yy2arr2033 := z.EncBasicHandle().StructToArray - var yyq2033 [5]bool - _, _, _ = yysep2033, yyq2033, yy2arr2033 - const yyr2033 bool = false - yyq2033[0] = x.Kind != "" - yyq2033[1] = x.APIVersion != "" - yyq2033[2] = true - yyq2033[3] = true - yyq2033[4] = true - var yynn2033 int - if yyr2033 || yy2arr2033 { + yysep2182 := !z.EncBinary() + yy2arr2182 := z.EncBasicHandle().StructToArray + var yyq2182 [5]bool + _, _, _ = yysep2182, yyq2182, yy2arr2182 + const yyr2182 bool = false + yyq2182[0] = true + yyq2182[1] = true + yyq2182[2] = true + yyq2182[3] = x.Kind != "" + yyq2182[4] = x.APIVersion != "" + var yynn2182 int + if yyr2182 || yy2arr2182 { r.EncodeArrayStart(5) } else { - yynn2033 = 0 - for _, b := range yyq2033 { + yynn2182 = 0 + for _, b := range yyq2182 { if b { - yynn2033++ + yynn2182++ } } - r.EncodeMapStart(yynn2033) - yynn2033 = 0 + r.EncodeMapStart(yynn2182) + yynn2182 = 0 } - if yyr2033 || yy2arr2033 { + if yyr2182 || yy2arr2182 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2033[0] { - yym2035 := z.EncBinary() - _ = yym2035 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2033[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2036 := z.EncBinary() - _ = yym2036 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2033 || yy2arr2033 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2033[1] { - yym2038 := z.EncBinary() - _ = yym2038 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2033[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2039 := z.EncBinary() - _ = yym2039 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2033 || yy2arr2033 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2033[2] { - yy2041 := &x.ObjectMeta - yy2041.CodecEncodeSelf(e) + if yyq2182[0] { + yy2184 := &x.ObjectMeta + yy2184.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2033[2] { + if yyq2182[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2042 := &x.ObjectMeta - yy2042.CodecEncodeSelf(e) + yy2185 := &x.ObjectMeta + yy2185.CodecEncodeSelf(e) } } - if yyr2033 || yy2arr2033 { + if yyr2182 || yy2arr2182 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2033[3] { - yy2044 := &x.Spec - yy2044.CodecEncodeSelf(e) + if yyq2182[1] { + yy2187 := &x.Spec + yy2187.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2033[3] { + if yyq2182[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2045 := &x.Spec - yy2045.CodecEncodeSelf(e) + yy2188 := &x.Spec + yy2188.CodecEncodeSelf(e) } } - if yyr2033 || yy2arr2033 { + if yyr2182 || yy2arr2182 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2033[4] { - yy2047 := &x.Status - yy2047.CodecEncodeSelf(e) + if yyq2182[2] { + yy2190 := &x.Status + yy2190.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2033[4] { + if yyq2182[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2048 := &x.Status - yy2048.CodecEncodeSelf(e) + yy2191 := &x.Status + yy2191.CodecEncodeSelf(e) } } - if yyr2033 || yy2arr2033 { + if yyr2182 || yy2arr2182 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2182[3] { + yym2193 := z.EncBinary() + _ = yym2193 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2182[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2194 := z.EncBinary() + _ = yym2194 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2182 || yy2arr2182 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2182[4] { + yym2196 := z.EncBinary() + _ = yym2196 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2182[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2197 := z.EncBinary() + _ = yym2197 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2182 || yy2arr2182 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26608,25 +28748,25 @@ func (x *Service) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2049 := z.DecBinary() - _ = yym2049 + yym2198 := z.DecBinary() + _ = yym2198 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2050 := r.ContainerType() - if yyct2050 == codecSelferValueTypeMap1234 { - yyl2050 := r.ReadMapStart() - if yyl2050 == 0 { + yyct2199 := r.ContainerType() + if yyct2199 == codecSelferValueTypeMap1234 { + yyl2199 := r.ReadMapStart() + if yyl2199 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2050, d) + x.codecDecodeSelfFromMap(yyl2199, d) } - } else if yyct2050 == codecSelferValueTypeArray1234 { - yyl2050 := r.ReadArrayStart() - if yyl2050 == 0 { + } else if yyct2199 == codecSelferValueTypeArray1234 { + yyl2199 := r.ReadArrayStart() + if yyl2199 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2050, d) + x.codecDecodeSelfFromArray(yyl2199, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26638,12 +28778,12 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2051Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2051Slc - var yyhl2051 bool = l >= 0 - for yyj2051 := 0; ; yyj2051++ { - if yyhl2051 { - if yyj2051 >= l { + var yys2200Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2200Slc + var yyhl2200 bool = l >= 0 + for yyj2200 := 0; ; yyj2200++ { + if yyhl2200 { + if yyj2200 >= l { break } } else { @@ -26652,10 +28792,31 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2051Slc = r.DecodeBytes(yys2051Slc, true, true) - yys2051 := string(yys2051Slc) + yys2200Slc = r.DecodeBytes(yys2200Slc, true, true) + yys2200 := string(yys2200Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2051 { + switch yys2200 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2201 := &x.ObjectMeta + yyv2201.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ServiceSpec{} + } else { + yyv2202 := &x.Spec + yyv2202.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ServiceStatus{} + } else { + yyv2203 := &x.Status + yyv2203.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -26668,31 +28829,10 @@ func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2054 := &x.ObjectMeta - yyv2054.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ServiceSpec{} - } else { - yyv2055 := &x.Spec - yyv2055.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ServiceStatus{} - } else { - yyv2056 := &x.Status - yyv2056.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys2051) - } // end switch yys2051 - } // end for yyj2051 + z.DecStructFieldNotFound(-1, yys2200) + } // end switch yys2200 + } // end for yyj2200 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -26700,16 +28840,67 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2057 int - var yyb2057 bool - var yyhl2057 bool = l >= 0 - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l + var yyj2206 int + var yyb2206 bool + var yyhl2206 bool = l >= 0 + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l } else { - yyb2057 = r.CheckBreak() + yyb2206 = r.CheckBreak() } - if yyb2057 { + if yyb2206 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2207 := &x.ObjectMeta + yyv2207.CodecDecodeSelf(d) + } + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l + } else { + yyb2206 = r.CheckBreak() + } + if yyb2206 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ServiceSpec{} + } else { + yyv2208 := &x.Spec + yyv2208.CodecDecodeSelf(d) + } + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l + } else { + yyb2206 = r.CheckBreak() + } + if yyb2206 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ServiceStatus{} + } else { + yyv2209 := &x.Status + yyv2209.CodecDecodeSelf(d) + } + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l + } else { + yyb2206 = r.CheckBreak() + } + if yyb2206 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26719,13 +28910,13 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l } else { - yyb2057 = r.CheckBreak() + yyb2206 = r.CheckBreak() } - if yyb2057 { + if yyb2206 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -26735,69 +28926,18 @@ func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l - } else { - yyb2057 = r.CheckBreak() - } - if yyb2057 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2060 := &x.ObjectMeta - yyv2060.CodecDecodeSelf(d) - } - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l - } else { - yyb2057 = r.CheckBreak() - } - if yyb2057 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ServiceSpec{} - } else { - yyv2061 := &x.Spec - yyv2061.CodecDecodeSelf(d) - } - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l - } else { - yyb2057 = r.CheckBreak() - } - if yyb2057 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ServiceStatus{} - } else { - yyv2062 := &x.Status - yyv2062.CodecDecodeSelf(d) - } for { - yyj2057++ - if yyhl2057 { - yyb2057 = yyj2057 > l + yyj2206++ + if yyhl2206 { + yyb2206 = yyj2206 > l } else { - yyb2057 = r.CheckBreak() + yyb2206 = r.CheckBreak() } - if yyb2057 { + if yyb2206 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2057-1, "") + z.DecStructFieldNotFound(yyj2206-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -26809,118 +28949,68 @@ func (x *ServiceList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2063 := z.EncBinary() - _ = yym2063 + yym2212 := z.EncBinary() + _ = yym2212 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2064 := !z.EncBinary() - yy2arr2064 := z.EncBasicHandle().StructToArray - var yyq2064 [4]bool - _, _, _ = yysep2064, yyq2064, yy2arr2064 - const yyr2064 bool = false - yyq2064[0] = x.Kind != "" - yyq2064[1] = x.APIVersion != "" - yyq2064[2] = true - var yynn2064 int - if yyr2064 || yy2arr2064 { + yysep2213 := !z.EncBinary() + yy2arr2213 := z.EncBasicHandle().StructToArray + var yyq2213 [4]bool + _, _, _ = yysep2213, yyq2213, yy2arr2213 + const yyr2213 bool = false + yyq2213[0] = true + yyq2213[2] = x.Kind != "" + yyq2213[3] = x.APIVersion != "" + var yynn2213 int + if yyr2213 || yy2arr2213 { r.EncodeArrayStart(4) } else { - yynn2064 = 1 - for _, b := range yyq2064 { + yynn2213 = 1 + for _, b := range yyq2213 { if b { - yynn2064++ + yynn2213++ } } - r.EncodeMapStart(yynn2064) - yynn2064 = 0 + r.EncodeMapStart(yynn2213) + yynn2213 = 0 } - if yyr2064 || yy2arr2064 { + if yyr2213 || yy2arr2213 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2064[0] { - yym2066 := z.EncBinary() - _ = yym2066 + if yyq2213[0] { + yy2215 := &x.ListMeta + yym2216 := z.EncBinary() + _ = yym2216 if false { + } else if z.HasExtensions() && z.EncExt(yy2215) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2064[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2067 := z.EncBinary() - _ = yym2067 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2064 || yy2arr2064 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2064[1] { - yym2069 := z.EncBinary() - _ = yym2069 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2064[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2070 := z.EncBinary() - _ = yym2070 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2064 || yy2arr2064 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2064[2] { - yy2072 := &x.ListMeta - yym2073 := z.EncBinary() - _ = yym2073 - if false { - } else if z.HasExtensions() && z.EncExt(yy2072) { - } else { - z.EncFallback(yy2072) + z.EncFallback(yy2215) } } else { r.EncodeNil() } } else { - if yyq2064[2] { + if yyq2213[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2074 := &x.ListMeta - yym2075 := z.EncBinary() - _ = yym2075 + yy2217 := &x.ListMeta + yym2218 := z.EncBinary() + _ = yym2218 if false { - } else if z.HasExtensions() && z.EncExt(yy2074) { + } else if z.HasExtensions() && z.EncExt(yy2217) { } else { - z.EncFallback(yy2074) + z.EncFallback(yy2217) } } } - if yyr2064 || yy2arr2064 { + if yyr2213 || yy2arr2213 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym2077 := z.EncBinary() - _ = yym2077 + yym2220 := z.EncBinary() + _ = yym2220 if false { } else { h.encSliceService(([]Service)(x.Items), e) @@ -26933,15 +29023,65 @@ func (x *ServiceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym2078 := z.EncBinary() - _ = yym2078 + yym2221 := z.EncBinary() + _ = yym2221 if false { } else { h.encSliceService(([]Service)(x.Items), e) } } } - if yyr2064 || yy2arr2064 { + if yyr2213 || yy2arr2213 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2213[2] { + yym2223 := z.EncBinary() + _ = yym2223 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2213[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2224 := z.EncBinary() + _ = yym2224 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2213 || yy2arr2213 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2213[3] { + yym2226 := z.EncBinary() + _ = yym2226 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2213[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2227 := z.EncBinary() + _ = yym2227 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2213 || yy2arr2213 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -26954,25 +29094,25 @@ func (x *ServiceList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2079 := z.DecBinary() - _ = yym2079 + yym2228 := z.DecBinary() + _ = yym2228 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2080 := r.ContainerType() - if yyct2080 == codecSelferValueTypeMap1234 { - yyl2080 := r.ReadMapStart() - if yyl2080 == 0 { + yyct2229 := r.ContainerType() + if yyct2229 == codecSelferValueTypeMap1234 { + yyl2229 := r.ReadMapStart() + if yyl2229 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2080, d) + x.codecDecodeSelfFromMap(yyl2229, d) } - } else if yyct2080 == codecSelferValueTypeArray1234 { - yyl2080 := r.ReadArrayStart() - if yyl2080 == 0 { + } else if yyct2229 == codecSelferValueTypeArray1234 { + yyl2229 := r.ReadArrayStart() + if yyl2229 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2080, d) + x.codecDecodeSelfFromArray(yyl2229, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -26984,12 +29124,12 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2081Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2081Slc - var yyhl2081 bool = l >= 0 - for yyj2081 := 0; ; yyj2081++ { - if yyhl2081 { - if yyj2081 >= l { + var yys2230Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2230Slc + var yyhl2230 bool = l >= 0 + for yyj2230 := 0; ; yyj2230++ { + if yyhl2230 { + if yyj2230 >= l { break } } else { @@ -26998,10 +29138,35 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2081Slc = r.DecodeBytes(yys2081Slc, true, true) - yys2081 := string(yys2081Slc) + yys2230Slc = r.DecodeBytes(yys2230Slc, true, true) + yys2230 := string(yys2230Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2081 { + switch yys2230 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2231 := &x.ListMeta + yym2232 := z.DecBinary() + _ = yym2232 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2231) { + } else { + z.DecFallback(yyv2231, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2233 := &x.Items + yym2234 := z.DecBinary() + _ = yym2234 + if false { + } else { + h.decSliceService((*[]Service)(yyv2233), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27014,35 +29179,10 @@ func (x *ServiceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2084 := &x.ListMeta - yym2085 := z.DecBinary() - _ = yym2085 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2084) { - } else { - z.DecFallback(yyv2084, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2086 := &x.Items - yym2087 := z.DecBinary() - _ = yym2087 - if false { - } else { - h.decSliceService((*[]Service)(yyv2086), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2081) - } // end switch yys2081 - } // end for yyj2081 + z.DecStructFieldNotFound(-1, yys2230) + } // end switch yys2230 + } // end for yyj2230 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27050,16 +29190,61 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2088 int - var yyb2088 bool - var yyhl2088 bool = l >= 0 - yyj2088++ - if yyhl2088 { - yyb2088 = yyj2088 > l + var yyj2237 int + var yyb2237 bool + var yyhl2237 bool = l >= 0 + yyj2237++ + if yyhl2237 { + yyb2237 = yyj2237 > l } else { - yyb2088 = r.CheckBreak() + yyb2237 = r.CheckBreak() } - if yyb2088 { + if yyb2237 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2238 := &x.ListMeta + yym2239 := z.DecBinary() + _ = yym2239 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2238) { + } else { + z.DecFallback(yyv2238, false) + } + } + yyj2237++ + if yyhl2237 { + yyb2237 = yyj2237 > l + } else { + yyb2237 = r.CheckBreak() + } + if yyb2237 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2240 := &x.Items + yym2241 := z.DecBinary() + _ = yym2241 + if false { + } else { + h.decSliceService((*[]Service)(yyv2240), d) + } + } + yyj2237++ + if yyhl2237 { + yyb2237 = yyj2237 > l + } else { + yyb2237 = r.CheckBreak() + } + if yyb2237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27069,13 +29254,13 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2088++ - if yyhl2088 { - yyb2088 = yyj2088 > l + yyj2237++ + if yyhl2237 { + yyb2237 = yyj2237 > l } else { - yyb2088 = r.CheckBreak() + yyb2237 = r.CheckBreak() } - if yyb2088 { + if yyb2237 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27085,63 +29270,18 @@ func (x *ServiceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2088++ - if yyhl2088 { - yyb2088 = yyj2088 > l - } else { - yyb2088 = r.CheckBreak() - } - if yyb2088 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2091 := &x.ListMeta - yym2092 := z.DecBinary() - _ = yym2092 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2091) { - } else { - z.DecFallback(yyv2091, false) - } - } - yyj2088++ - if yyhl2088 { - yyb2088 = yyj2088 > l - } else { - yyb2088 = r.CheckBreak() - } - if yyb2088 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2093 := &x.Items - yym2094 := z.DecBinary() - _ = yym2094 - if false { - } else { - h.decSliceService((*[]Service)(yyv2093), d) - } - } for { - yyj2088++ - if yyhl2088 { - yyb2088 = yyj2088 > l + yyj2237++ + if yyhl2237 { + yyb2237 = yyj2237 > l } else { - yyb2088 = r.CheckBreak() + yyb2237 = r.CheckBreak() } - if yyb2088 { + if yyb2237 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2088-1, "") + z.DecStructFieldNotFound(yyj2237-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27153,109 +29293,59 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2095 := z.EncBinary() - _ = yym2095 + yym2244 := z.EncBinary() + _ = yym2244 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2096 := !z.EncBinary() - yy2arr2096 := z.EncBasicHandle().StructToArray - var yyq2096 [5]bool - _, _, _ = yysep2096, yyq2096, yy2arr2096 - const yyr2096 bool = false - yyq2096[0] = x.Kind != "" - yyq2096[1] = x.APIVersion != "" - yyq2096[2] = true - yyq2096[3] = len(x.Secrets) != 0 - yyq2096[4] = len(x.ImagePullSecrets) != 0 - var yynn2096 int - if yyr2096 || yy2arr2096 { + yysep2245 := !z.EncBinary() + yy2arr2245 := z.EncBasicHandle().StructToArray + var yyq2245 [5]bool + _, _, _ = yysep2245, yyq2245, yy2arr2245 + const yyr2245 bool = false + yyq2245[0] = true + yyq2245[1] = len(x.Secrets) != 0 + yyq2245[2] = len(x.ImagePullSecrets) != 0 + yyq2245[3] = x.Kind != "" + yyq2245[4] = x.APIVersion != "" + var yynn2245 int + if yyr2245 || yy2arr2245 { r.EncodeArrayStart(5) } else { - yynn2096 = 0 - for _, b := range yyq2096 { + yynn2245 = 0 + for _, b := range yyq2245 { if b { - yynn2096++ + yynn2245++ } } - r.EncodeMapStart(yynn2096) - yynn2096 = 0 + r.EncodeMapStart(yynn2245) + yynn2245 = 0 } - if yyr2096 || yy2arr2096 { + if yyr2245 || yy2arr2245 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2096[0] { - yym2098 := z.EncBinary() - _ = yym2098 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2096[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2099 := z.EncBinary() - _ = yym2099 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2096 || yy2arr2096 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2096[1] { - yym2101 := z.EncBinary() - _ = yym2101 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2096[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2102 := z.EncBinary() - _ = yym2102 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2096 || yy2arr2096 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2096[2] { - yy2104 := &x.ObjectMeta - yy2104.CodecEncodeSelf(e) + if yyq2245[0] { + yy2247 := &x.ObjectMeta + yy2247.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2096[2] { + if yyq2245[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2105 := &x.ObjectMeta - yy2105.CodecEncodeSelf(e) + yy2248 := &x.ObjectMeta + yy2248.CodecEncodeSelf(e) } } - if yyr2096 || yy2arr2096 { + if yyr2245 || yy2arr2245 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2096[3] { + if yyq2245[1] { if x.Secrets == nil { r.EncodeNil() } else { - yym2107 := z.EncBinary() - _ = yym2107 + yym2250 := z.EncBinary() + _ = yym2250 if false { } else { h.encSliceObjectReference(([]ObjectReference)(x.Secrets), e) @@ -27265,15 +29355,15 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2096[3] { + if yyq2245[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("secrets")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Secrets == nil { r.EncodeNil() } else { - yym2108 := z.EncBinary() - _ = yym2108 + yym2251 := z.EncBinary() + _ = yym2251 if false { } else { h.encSliceObjectReference(([]ObjectReference)(x.Secrets), e) @@ -27281,14 +29371,14 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2096 || yy2arr2096 { + if yyr2245 || yy2arr2245 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2096[4] { + if yyq2245[2] { if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym2110 := z.EncBinary() - _ = yym2110 + yym2253 := z.EncBinary() + _ = yym2253 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -27298,15 +29388,15 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2096[4] { + if yyq2245[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imagePullSecrets")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ImagePullSecrets == nil { r.EncodeNil() } else { - yym2111 := z.EncBinary() - _ = yym2111 + yym2254 := z.EncBinary() + _ = yym2254 if false { } else { h.encSliceLocalObjectReference(([]LocalObjectReference)(x.ImagePullSecrets), e) @@ -27314,7 +29404,57 @@ func (x *ServiceAccount) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2096 || yy2arr2096 { + if yyr2245 || yy2arr2245 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2245[3] { + yym2256 := z.EncBinary() + _ = yym2256 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2245[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2257 := z.EncBinary() + _ = yym2257 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2245 || yy2arr2245 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2245[4] { + yym2259 := z.EncBinary() + _ = yym2259 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2245[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2260 := z.EncBinary() + _ = yym2260 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2245 || yy2arr2245 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -27327,25 +29467,25 @@ func (x *ServiceAccount) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2112 := z.DecBinary() - _ = yym2112 + yym2261 := z.DecBinary() + _ = yym2261 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2113 := r.ContainerType() - if yyct2113 == codecSelferValueTypeMap1234 { - yyl2113 := r.ReadMapStart() - if yyl2113 == 0 { + yyct2262 := r.ContainerType() + if yyct2262 == codecSelferValueTypeMap1234 { + yyl2262 := r.ReadMapStart() + if yyl2262 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2113, d) + x.codecDecodeSelfFromMap(yyl2262, d) } - } else if yyct2113 == codecSelferValueTypeArray1234 { - yyl2113 := r.ReadArrayStart() - if yyl2113 == 0 { + } else if yyct2262 == codecSelferValueTypeArray1234 { + yyl2262 := r.ReadArrayStart() + if yyl2262 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2113, d) + x.codecDecodeSelfFromArray(yyl2262, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -27357,12 +29497,12 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2114Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2114Slc - var yyhl2114 bool = l >= 0 - for yyj2114 := 0; ; yyj2114++ { - if yyhl2114 { - if yyj2114 >= l { + var yys2263Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2263Slc + var yyhl2263 bool = l >= 0 + for yyj2263 := 0; ; yyj2263++ { + if yyhl2263 { + if yyj2263 >= l { break } } else { @@ -27371,10 +29511,41 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2114Slc = r.DecodeBytes(yys2114Slc, true, true) - yys2114 := string(yys2114Slc) + yys2263Slc = r.DecodeBytes(yys2263Slc, true, true) + yys2263 := string(yys2263Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2114 { + switch yys2263 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2264 := &x.ObjectMeta + yyv2264.CodecDecodeSelf(d) + } + case "secrets": + if r.TryDecodeAsNil() { + x.Secrets = nil + } else { + yyv2265 := &x.Secrets + yym2266 := z.DecBinary() + _ = yym2266 + if false { + } else { + h.decSliceObjectReference((*[]ObjectReference)(yyv2265), d) + } + } + case "imagePullSecrets": + if r.TryDecodeAsNil() { + x.ImagePullSecrets = nil + } else { + yyv2267 := &x.ImagePullSecrets + yym2268 := z.DecBinary() + _ = yym2268 + if false { + } else { + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2267), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27387,41 +29558,10 @@ func (x *ServiceAccount) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2117 := &x.ObjectMeta - yyv2117.CodecDecodeSelf(d) - } - case "secrets": - if r.TryDecodeAsNil() { - x.Secrets = nil - } else { - yyv2118 := &x.Secrets - yym2119 := z.DecBinary() - _ = yym2119 - if false { - } else { - h.decSliceObjectReference((*[]ObjectReference)(yyv2118), d) - } - } - case "imagePullSecrets": - if r.TryDecodeAsNil() { - x.ImagePullSecrets = nil - } else { - yyv2120 := &x.ImagePullSecrets - yym2121 := z.DecBinary() - _ = yym2121 - if false { - } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2120), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2114) - } // end switch yys2114 - } // end for yyj2114 + z.DecStructFieldNotFound(-1, yys2263) + } // end switch yys2263 + } // end for yyj2263 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27429,16 +29569,77 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2122 int - var yyb2122 bool - var yyhl2122 bool = l >= 0 - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l + var yyj2271 int + var yyb2271 bool + var yyhl2271 bool = l >= 0 + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l } else { - yyb2122 = r.CheckBreak() + yyb2271 = r.CheckBreak() } - if yyb2122 { + if yyb2271 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2272 := &x.ObjectMeta + yyv2272.CodecDecodeSelf(d) + } + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l + } else { + yyb2271 = r.CheckBreak() + } + if yyb2271 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Secrets = nil + } else { + yyv2273 := &x.Secrets + yym2274 := z.DecBinary() + _ = yym2274 + if false { + } else { + h.decSliceObjectReference((*[]ObjectReference)(yyv2273), d) + } + } + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l + } else { + yyb2271 = r.CheckBreak() + } + if yyb2271 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ImagePullSecrets = nil + } else { + yyv2275 := &x.ImagePullSecrets + yym2276 := z.DecBinary() + _ = yym2276 + if false { + } else { + h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2275), d) + } + } + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l + } else { + yyb2271 = r.CheckBreak() + } + if yyb2271 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27448,13 +29649,13 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l } else { - yyb2122 = r.CheckBreak() + yyb2271 = r.CheckBreak() } - if yyb2122 { + if yyb2271 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27464,79 +29665,18 @@ func (x *ServiceAccount) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l - } else { - yyb2122 = r.CheckBreak() - } - if yyb2122 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2125 := &x.ObjectMeta - yyv2125.CodecDecodeSelf(d) - } - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l - } else { - yyb2122 = r.CheckBreak() - } - if yyb2122 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Secrets = nil - } else { - yyv2126 := &x.Secrets - yym2127 := z.DecBinary() - _ = yym2127 - if false { - } else { - h.decSliceObjectReference((*[]ObjectReference)(yyv2126), d) - } - } - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l - } else { - yyb2122 = r.CheckBreak() - } - if yyb2122 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ImagePullSecrets = nil - } else { - yyv2128 := &x.ImagePullSecrets - yym2129 := z.DecBinary() - _ = yym2129 - if false { - } else { - h.decSliceLocalObjectReference((*[]LocalObjectReference)(yyv2128), d) - } - } for { - yyj2122++ - if yyhl2122 { - yyb2122 = yyj2122 > l + yyj2271++ + if yyhl2271 { + yyb2271 = yyj2271 > l } else { - yyb2122 = r.CheckBreak() + yyb2271 = r.CheckBreak() } - if yyb2122 { + if yyb2271 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2122-1, "") + z.DecStructFieldNotFound(yyj2271-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27548,118 +29688,68 @@ func (x *ServiceAccountList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2130 := z.EncBinary() - _ = yym2130 + yym2279 := z.EncBinary() + _ = yym2279 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2131 := !z.EncBinary() - yy2arr2131 := z.EncBasicHandle().StructToArray - var yyq2131 [4]bool - _, _, _ = yysep2131, yyq2131, yy2arr2131 - const yyr2131 bool = false - yyq2131[0] = x.Kind != "" - yyq2131[1] = x.APIVersion != "" - yyq2131[2] = true - var yynn2131 int - if yyr2131 || yy2arr2131 { + yysep2280 := !z.EncBinary() + yy2arr2280 := z.EncBasicHandle().StructToArray + var yyq2280 [4]bool + _, _, _ = yysep2280, yyq2280, yy2arr2280 + const yyr2280 bool = false + yyq2280[0] = true + yyq2280[2] = x.Kind != "" + yyq2280[3] = x.APIVersion != "" + var yynn2280 int + if yyr2280 || yy2arr2280 { r.EncodeArrayStart(4) } else { - yynn2131 = 1 - for _, b := range yyq2131 { + yynn2280 = 1 + for _, b := range yyq2280 { if b { - yynn2131++ + yynn2280++ } } - r.EncodeMapStart(yynn2131) - yynn2131 = 0 + r.EncodeMapStart(yynn2280) + yynn2280 = 0 } - if yyr2131 || yy2arr2131 { + if yyr2280 || yy2arr2280 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2131[0] { - yym2133 := z.EncBinary() - _ = yym2133 + if yyq2280[0] { + yy2282 := &x.ListMeta + yym2283 := z.EncBinary() + _ = yym2283 if false { + } else if z.HasExtensions() && z.EncExt(yy2282) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2131[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2134 := z.EncBinary() - _ = yym2134 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2131 || yy2arr2131 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2131[1] { - yym2136 := z.EncBinary() - _ = yym2136 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2131[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2137 := z.EncBinary() - _ = yym2137 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2131 || yy2arr2131 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2131[2] { - yy2139 := &x.ListMeta - yym2140 := z.EncBinary() - _ = yym2140 - if false { - } else if z.HasExtensions() && z.EncExt(yy2139) { - } else { - z.EncFallback(yy2139) + z.EncFallback(yy2282) } } else { r.EncodeNil() } } else { - if yyq2131[2] { + if yyq2280[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2141 := &x.ListMeta - yym2142 := z.EncBinary() - _ = yym2142 + yy2284 := &x.ListMeta + yym2285 := z.EncBinary() + _ = yym2285 if false { - } else if z.HasExtensions() && z.EncExt(yy2141) { + } else if z.HasExtensions() && z.EncExt(yy2284) { } else { - z.EncFallback(yy2141) + z.EncFallback(yy2284) } } } - if yyr2131 || yy2arr2131 { + if yyr2280 || yy2arr2280 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym2144 := z.EncBinary() - _ = yym2144 + yym2287 := z.EncBinary() + _ = yym2287 if false { } else { h.encSliceServiceAccount(([]ServiceAccount)(x.Items), e) @@ -27672,15 +29762,65 @@ func (x *ServiceAccountList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym2145 := z.EncBinary() - _ = yym2145 + yym2288 := z.EncBinary() + _ = yym2288 if false { } else { h.encSliceServiceAccount(([]ServiceAccount)(x.Items), e) } } } - if yyr2131 || yy2arr2131 { + if yyr2280 || yy2arr2280 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2280[2] { + yym2290 := z.EncBinary() + _ = yym2290 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2280[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2291 := z.EncBinary() + _ = yym2291 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2280 || yy2arr2280 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2280[3] { + yym2293 := z.EncBinary() + _ = yym2293 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2280[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2294 := z.EncBinary() + _ = yym2294 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2280 || yy2arr2280 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -27693,25 +29833,25 @@ func (x *ServiceAccountList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2146 := z.DecBinary() - _ = yym2146 + yym2295 := z.DecBinary() + _ = yym2295 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2147 := r.ContainerType() - if yyct2147 == codecSelferValueTypeMap1234 { - yyl2147 := r.ReadMapStart() - if yyl2147 == 0 { + yyct2296 := r.ContainerType() + if yyct2296 == codecSelferValueTypeMap1234 { + yyl2296 := r.ReadMapStart() + if yyl2296 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2147, d) + x.codecDecodeSelfFromMap(yyl2296, d) } - } else if yyct2147 == codecSelferValueTypeArray1234 { - yyl2147 := r.ReadArrayStart() - if yyl2147 == 0 { + } else if yyct2296 == codecSelferValueTypeArray1234 { + yyl2296 := r.ReadArrayStart() + if yyl2296 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2147, d) + x.codecDecodeSelfFromArray(yyl2296, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -27723,12 +29863,12 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2148Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2148Slc - var yyhl2148 bool = l >= 0 - for yyj2148 := 0; ; yyj2148++ { - if yyhl2148 { - if yyj2148 >= l { + var yys2297Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2297Slc + var yyhl2297 bool = l >= 0 + for yyj2297 := 0; ; yyj2297++ { + if yyhl2297 { + if yyj2297 >= l { break } } else { @@ -27737,10 +29877,35 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2148Slc = r.DecodeBytes(yys2148Slc, true, true) - yys2148 := string(yys2148Slc) + yys2297Slc = r.DecodeBytes(yys2297Slc, true, true) + yys2297 := string(yys2297Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2148 { + switch yys2297 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2298 := &x.ListMeta + yym2299 := z.DecBinary() + _ = yym2299 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2298) { + } else { + z.DecFallback(yyv2298, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2300 := &x.Items + yym2301 := z.DecBinary() + _ = yym2301 + if false { + } else { + h.decSliceServiceAccount((*[]ServiceAccount)(yyv2300), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -27753,35 +29918,10 @@ func (x *ServiceAccountList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2151 := &x.ListMeta - yym2152 := z.DecBinary() - _ = yym2152 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2151) { - } else { - z.DecFallback(yyv2151, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2153 := &x.Items - yym2154 := z.DecBinary() - _ = yym2154 - if false { - } else { - h.decSliceServiceAccount((*[]ServiceAccount)(yyv2153), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2148) - } // end switch yys2148 - } // end for yyj2148 + z.DecStructFieldNotFound(-1, yys2297) + } // end switch yys2297 + } // end for yyj2297 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -27789,16 +29929,61 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2155 int - var yyb2155 bool - var yyhl2155 bool = l >= 0 - yyj2155++ - if yyhl2155 { - yyb2155 = yyj2155 > l + var yyj2304 int + var yyb2304 bool + var yyhl2304 bool = l >= 0 + yyj2304++ + if yyhl2304 { + yyb2304 = yyj2304 > l } else { - yyb2155 = r.CheckBreak() + yyb2304 = r.CheckBreak() } - if yyb2155 { + if yyb2304 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2305 := &x.ListMeta + yym2306 := z.DecBinary() + _ = yym2306 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2305) { + } else { + z.DecFallback(yyv2305, false) + } + } + yyj2304++ + if yyhl2304 { + yyb2304 = yyj2304 > l + } else { + yyb2304 = r.CheckBreak() + } + if yyb2304 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2307 := &x.Items + yym2308 := z.DecBinary() + _ = yym2308 + if false { + } else { + h.decSliceServiceAccount((*[]ServiceAccount)(yyv2307), d) + } + } + yyj2304++ + if yyhl2304 { + yyb2304 = yyj2304 > l + } else { + yyb2304 = r.CheckBreak() + } + if yyb2304 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27808,13 +29993,13 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Kind = string(r.DecodeString()) } - yyj2155++ - if yyhl2155 { - yyb2155 = yyj2155 > l + yyj2304++ + if yyhl2304 { + yyb2304 = yyj2304 > l } else { - yyb2155 = r.CheckBreak() + yyb2304 = r.CheckBreak() } - if yyb2155 { + if yyb2304 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -27824,63 +30009,18 @@ func (x *ServiceAccountList) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.APIVersion = string(r.DecodeString()) } - yyj2155++ - if yyhl2155 { - yyb2155 = yyj2155 > l - } else { - yyb2155 = r.CheckBreak() - } - if yyb2155 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2158 := &x.ListMeta - yym2159 := z.DecBinary() - _ = yym2159 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2158) { - } else { - z.DecFallback(yyv2158, false) - } - } - yyj2155++ - if yyhl2155 { - yyb2155 = yyj2155 > l - } else { - yyb2155 = r.CheckBreak() - } - if yyb2155 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2160 := &x.Items - yym2161 := z.DecBinary() - _ = yym2161 - if false { - } else { - h.decSliceServiceAccount((*[]ServiceAccount)(yyv2160), d) - } - } for { - yyj2155++ - if yyhl2155 { - yyb2155 = yyj2155 > l + yyj2304++ + if yyhl2304 { + yyb2304 = yyj2304 > l } else { - yyb2155 = r.CheckBreak() + yyb2304 = r.CheckBreak() } - if yyb2155 { + if yyb2304 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2155-1, "") + z.DecStructFieldNotFound(yyj2304-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -27892,106 +30032,56 @@ func (x *Endpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2162 := z.EncBinary() - _ = yym2162 + yym2311 := z.EncBinary() + _ = yym2311 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2163 := !z.EncBinary() - yy2arr2163 := z.EncBasicHandle().StructToArray - var yyq2163 [4]bool - _, _, _ = yysep2163, yyq2163, yy2arr2163 - const yyr2163 bool = false - yyq2163[0] = x.Kind != "" - yyq2163[1] = x.APIVersion != "" - yyq2163[2] = true - var yynn2163 int - if yyr2163 || yy2arr2163 { + yysep2312 := !z.EncBinary() + yy2arr2312 := z.EncBasicHandle().StructToArray + var yyq2312 [4]bool + _, _, _ = yysep2312, yyq2312, yy2arr2312 + const yyr2312 bool = false + yyq2312[0] = true + yyq2312[2] = x.Kind != "" + yyq2312[3] = x.APIVersion != "" + var yynn2312 int + if yyr2312 || yy2arr2312 { r.EncodeArrayStart(4) } else { - yynn2163 = 1 - for _, b := range yyq2163 { + yynn2312 = 1 + for _, b := range yyq2312 { if b { - yynn2163++ + yynn2312++ } } - r.EncodeMapStart(yynn2163) - yynn2163 = 0 + r.EncodeMapStart(yynn2312) + yynn2312 = 0 } - if yyr2163 || yy2arr2163 { + if yyr2312 || yy2arr2312 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2163[0] { - yym2165 := z.EncBinary() - _ = yym2165 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2163[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2166 := z.EncBinary() - _ = yym2166 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2163 || yy2arr2163 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2163[1] { - yym2168 := z.EncBinary() - _ = yym2168 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2163[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2169 := z.EncBinary() - _ = yym2169 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2163 || yy2arr2163 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2163[2] { - yy2171 := &x.ObjectMeta - yy2171.CodecEncodeSelf(e) + if yyq2312[0] { + yy2314 := &x.ObjectMeta + yy2314.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2163[2] { + if yyq2312[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2172 := &x.ObjectMeta - yy2172.CodecEncodeSelf(e) + yy2315 := &x.ObjectMeta + yy2315.CodecEncodeSelf(e) } } - if yyr2163 || yy2arr2163 { + if yyr2312 || yy2arr2312 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Subsets == nil { r.EncodeNil() } else { - yym2174 := z.EncBinary() - _ = yym2174 + yym2317 := z.EncBinary() + _ = yym2317 if false { } else { h.encSliceEndpointSubset(([]EndpointSubset)(x.Subsets), e) @@ -28004,15 +30094,65 @@ func (x *Endpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x.Subsets == nil { r.EncodeNil() } else { - yym2175 := z.EncBinary() - _ = yym2175 + yym2318 := z.EncBinary() + _ = yym2318 if false { } else { h.encSliceEndpointSubset(([]EndpointSubset)(x.Subsets), e) } } } - if yyr2163 || yy2arr2163 { + if yyr2312 || yy2arr2312 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2312[2] { + yym2320 := z.EncBinary() + _ = yym2320 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2312[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2321 := z.EncBinary() + _ = yym2321 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2312 || yy2arr2312 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2312[3] { + yym2323 := z.EncBinary() + _ = yym2323 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2312[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2324 := z.EncBinary() + _ = yym2324 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2312 || yy2arr2312 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28025,25 +30165,25 @@ func (x *Endpoints) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2176 := z.DecBinary() - _ = yym2176 + yym2325 := z.DecBinary() + _ = yym2325 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2177 := r.ContainerType() - if yyct2177 == codecSelferValueTypeMap1234 { - yyl2177 := r.ReadMapStart() - if yyl2177 == 0 { + yyct2326 := r.ContainerType() + if yyct2326 == codecSelferValueTypeMap1234 { + yyl2326 := r.ReadMapStart() + if yyl2326 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2177, d) + x.codecDecodeSelfFromMap(yyl2326, d) } - } else if yyct2177 == codecSelferValueTypeArray1234 { - yyl2177 := r.ReadArrayStart() - if yyl2177 == 0 { + } else if yyct2326 == codecSelferValueTypeArray1234 { + yyl2326 := r.ReadArrayStart() + if yyl2326 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2177, d) + x.codecDecodeSelfFromArray(yyl2326, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28055,12 +30195,12 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2178Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2178Slc - var yyhl2178 bool = l >= 0 - for yyj2178 := 0; ; yyj2178++ { - if yyhl2178 { - if yyj2178 >= l { + var yys2327Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2327Slc + var yyhl2327 bool = l >= 0 + for yyj2327 := 0; ; yyj2327++ { + if yyhl2327 { + if yyj2327 >= l { break } } else { @@ -28069,10 +30209,29 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2178Slc = r.DecodeBytes(yys2178Slc, true, true) - yys2178 := string(yys2178Slc) + yys2327Slc = r.DecodeBytes(yys2327Slc, true, true) + yys2327 := string(yys2327Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2178 { + switch yys2327 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2328 := &x.ObjectMeta + yyv2328.CodecDecodeSelf(d) + } + case "subsets": + if r.TryDecodeAsNil() { + x.Subsets = nil + } else { + yyv2329 := &x.Subsets + yym2330 := z.DecBinary() + _ = yym2330 + if false { + } else { + h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2329), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -28085,29 +30244,10 @@ func (x *Endpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2181 := &x.ObjectMeta - yyv2181.CodecDecodeSelf(d) - } - case "subsets": - if r.TryDecodeAsNil() { - x.Subsets = nil - } else { - yyv2182 := &x.Subsets - yym2183 := z.DecBinary() - _ = yym2183 - if false { - } else { - h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2182), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2178) - } // end switch yys2178 - } // end for yyj2178 + z.DecStructFieldNotFound(-1, yys2327) + } // end switch yys2327 + } // end for yyj2327 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28115,16 +30255,55 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2184 int - var yyb2184 bool - var yyhl2184 bool = l >= 0 - yyj2184++ - if yyhl2184 { - yyb2184 = yyj2184 > l + var yyj2333 int + var yyb2333 bool + var yyhl2333 bool = l >= 0 + yyj2333++ + if yyhl2333 { + yyb2333 = yyj2333 > l } else { - yyb2184 = r.CheckBreak() + yyb2333 = r.CheckBreak() } - if yyb2184 { + if yyb2333 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2334 := &x.ObjectMeta + yyv2334.CodecDecodeSelf(d) + } + yyj2333++ + if yyhl2333 { + yyb2333 = yyj2333 > l + } else { + yyb2333 = r.CheckBreak() + } + if yyb2333 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Subsets = nil + } else { + yyv2335 := &x.Subsets + yym2336 := z.DecBinary() + _ = yym2336 + if false { + } else { + h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2335), d) + } + } + yyj2333++ + if yyhl2333 { + yyb2333 = yyj2333 > l + } else { + yyb2333 = r.CheckBreak() + } + if yyb2333 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28134,13 +30313,13 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2184++ - if yyhl2184 { - yyb2184 = yyj2184 > l + yyj2333++ + if yyhl2333 { + yyb2333 = yyj2333 > l } else { - yyb2184 = r.CheckBreak() + yyb2333 = r.CheckBreak() } - if yyb2184 { + if yyb2333 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28150,57 +30329,18 @@ func (x *Endpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2184++ - if yyhl2184 { - yyb2184 = yyj2184 > l - } else { - yyb2184 = r.CheckBreak() - } - if yyb2184 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2187 := &x.ObjectMeta - yyv2187.CodecDecodeSelf(d) - } - yyj2184++ - if yyhl2184 { - yyb2184 = yyj2184 > l - } else { - yyb2184 = r.CheckBreak() - } - if yyb2184 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Subsets = nil - } else { - yyv2188 := &x.Subsets - yym2189 := z.DecBinary() - _ = yym2189 - if false { - } else { - h.decSliceEndpointSubset((*[]EndpointSubset)(yyv2188), d) - } - } for { - yyj2184++ - if yyhl2184 { - yyb2184 = yyj2184 > l + yyj2333++ + if yyhl2333 { + yyb2333 = yyj2333 > l } else { - yyb2184 = r.CheckBreak() + yyb2333 = r.CheckBreak() } - if yyb2184 { + if yyb2333 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2184-1, "") + z.DecStructFieldNotFound(yyj2333-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28212,40 +30352,40 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2190 := z.EncBinary() - _ = yym2190 + yym2339 := z.EncBinary() + _ = yym2339 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2191 := !z.EncBinary() - yy2arr2191 := z.EncBasicHandle().StructToArray - var yyq2191 [3]bool - _, _, _ = yysep2191, yyq2191, yy2arr2191 - const yyr2191 bool = false - yyq2191[0] = len(x.Addresses) != 0 - yyq2191[1] = len(x.NotReadyAddresses) != 0 - yyq2191[2] = len(x.Ports) != 0 - var yynn2191 int - if yyr2191 || yy2arr2191 { + yysep2340 := !z.EncBinary() + yy2arr2340 := z.EncBasicHandle().StructToArray + var yyq2340 [3]bool + _, _, _ = yysep2340, yyq2340, yy2arr2340 + const yyr2340 bool = false + yyq2340[0] = len(x.Addresses) != 0 + yyq2340[1] = len(x.NotReadyAddresses) != 0 + yyq2340[2] = len(x.Ports) != 0 + var yynn2340 int + if yyr2340 || yy2arr2340 { r.EncodeArrayStart(3) } else { - yynn2191 = 0 - for _, b := range yyq2191 { + yynn2340 = 0 + for _, b := range yyq2340 { if b { - yynn2191++ + yynn2340++ } } - r.EncodeMapStart(yynn2191) - yynn2191 = 0 + r.EncodeMapStart(yynn2340) + yynn2340 = 0 } - if yyr2191 || yy2arr2191 { + if yyr2340 || yy2arr2340 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2191[0] { + if yyq2340[0] { if x.Addresses == nil { r.EncodeNil() } else { - yym2193 := z.EncBinary() - _ = yym2193 + yym2342 := z.EncBinary() + _ = yym2342 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.Addresses), e) @@ -28255,15 +30395,15 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2191[0] { + if yyq2340[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("addresses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Addresses == nil { r.EncodeNil() } else { - yym2194 := z.EncBinary() - _ = yym2194 + yym2343 := z.EncBinary() + _ = yym2343 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.Addresses), e) @@ -28271,14 +30411,14 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2191 || yy2arr2191 { + if yyr2340 || yy2arr2340 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2191[1] { + if yyq2340[1] { if x.NotReadyAddresses == nil { r.EncodeNil() } else { - yym2196 := z.EncBinary() - _ = yym2196 + yym2345 := z.EncBinary() + _ = yym2345 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.NotReadyAddresses), e) @@ -28288,15 +30428,15 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2191[1] { + if yyq2340[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("notReadyAddresses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.NotReadyAddresses == nil { r.EncodeNil() } else { - yym2197 := z.EncBinary() - _ = yym2197 + yym2346 := z.EncBinary() + _ = yym2346 if false { } else { h.encSliceEndpointAddress(([]EndpointAddress)(x.NotReadyAddresses), e) @@ -28304,14 +30444,14 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2191 || yy2arr2191 { + if yyr2340 || yy2arr2340 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2191[2] { + if yyq2340[2] { if x.Ports == nil { r.EncodeNil() } else { - yym2199 := z.EncBinary() - _ = yym2199 + yym2348 := z.EncBinary() + _ = yym2348 if false { } else { h.encSliceEndpointPort(([]EndpointPort)(x.Ports), e) @@ -28321,15 +30461,15 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2191[2] { + if yyq2340[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ports")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Ports == nil { r.EncodeNil() } else { - yym2200 := z.EncBinary() - _ = yym2200 + yym2349 := z.EncBinary() + _ = yym2349 if false { } else { h.encSliceEndpointPort(([]EndpointPort)(x.Ports), e) @@ -28337,7 +30477,7 @@ func (x *EndpointSubset) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2191 || yy2arr2191 { + if yyr2340 || yy2arr2340 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28350,25 +30490,25 @@ func (x *EndpointSubset) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2201 := z.DecBinary() - _ = yym2201 + yym2350 := z.DecBinary() + _ = yym2350 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2202 := r.ContainerType() - if yyct2202 == codecSelferValueTypeMap1234 { - yyl2202 := r.ReadMapStart() - if yyl2202 == 0 { + yyct2351 := r.ContainerType() + if yyct2351 == codecSelferValueTypeMap1234 { + yyl2351 := r.ReadMapStart() + if yyl2351 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2202, d) + x.codecDecodeSelfFromMap(yyl2351, d) } - } else if yyct2202 == codecSelferValueTypeArray1234 { - yyl2202 := r.ReadArrayStart() - if yyl2202 == 0 { + } else if yyct2351 == codecSelferValueTypeArray1234 { + yyl2351 := r.ReadArrayStart() + if yyl2351 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2202, d) + x.codecDecodeSelfFromArray(yyl2351, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28380,12 +30520,12 @@ func (x *EndpointSubset) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2203Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2203Slc - var yyhl2203 bool = l >= 0 - for yyj2203 := 0; ; yyj2203++ { - if yyhl2203 { - if yyj2203 >= l { + var yys2352Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2352Slc + var yyhl2352 bool = l >= 0 + for yyj2352 := 0; ; yyj2352++ { + if yyhl2352 { + if yyj2352 >= l { break } } else { @@ -28394,50 +30534,50 @@ func (x *EndpointSubset) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2203Slc = r.DecodeBytes(yys2203Slc, true, true) - yys2203 := string(yys2203Slc) + yys2352Slc = r.DecodeBytes(yys2352Slc, true, true) + yys2352 := string(yys2352Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2203 { + switch yys2352 { case "addresses": if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2204 := &x.Addresses - yym2205 := z.DecBinary() - _ = yym2205 + yyv2353 := &x.Addresses + yym2354 := z.DecBinary() + _ = yym2354 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2204), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2353), d) } } case "notReadyAddresses": if r.TryDecodeAsNil() { x.NotReadyAddresses = nil } else { - yyv2206 := &x.NotReadyAddresses - yym2207 := z.DecBinary() - _ = yym2207 + yyv2355 := &x.NotReadyAddresses + yym2356 := z.DecBinary() + _ = yym2356 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2206), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2355), d) } } case "ports": if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2208 := &x.Ports - yym2209 := z.DecBinary() - _ = yym2209 + yyv2357 := &x.Ports + yym2358 := z.DecBinary() + _ = yym2358 if false { } else { - h.decSliceEndpointPort((*[]EndpointPort)(yyv2208), d) + h.decSliceEndpointPort((*[]EndpointPort)(yyv2357), d) } } default: - z.DecStructFieldNotFound(-1, yys2203) - } // end switch yys2203 - } // end for yyj2203 + z.DecStructFieldNotFound(-1, yys2352) + } // end switch yys2352 + } // end for yyj2352 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28445,16 +30585,16 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2210 int - var yyb2210 bool - var yyhl2210 bool = l >= 0 - yyj2210++ - if yyhl2210 { - yyb2210 = yyj2210 > l + var yyj2359 int + var yyb2359 bool + var yyhl2359 bool = l >= 0 + yyj2359++ + if yyhl2359 { + yyb2359 = yyj2359 > l } else { - yyb2210 = r.CheckBreak() + yyb2359 = r.CheckBreak() } - if yyb2210 { + if yyb2359 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28462,21 +30602,21 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2211 := &x.Addresses - yym2212 := z.DecBinary() - _ = yym2212 + yyv2360 := &x.Addresses + yym2361 := z.DecBinary() + _ = yym2361 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2211), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2360), d) } } - yyj2210++ - if yyhl2210 { - yyb2210 = yyj2210 > l + yyj2359++ + if yyhl2359 { + yyb2359 = yyj2359 > l } else { - yyb2210 = r.CheckBreak() + yyb2359 = r.CheckBreak() } - if yyb2210 { + if yyb2359 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28484,21 +30624,21 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NotReadyAddresses = nil } else { - yyv2213 := &x.NotReadyAddresses - yym2214 := z.DecBinary() - _ = yym2214 + yyv2362 := &x.NotReadyAddresses + yym2363 := z.DecBinary() + _ = yym2363 if false { } else { - h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2213), d) + h.decSliceEndpointAddress((*[]EndpointAddress)(yyv2362), d) } } - yyj2210++ - if yyhl2210 { - yyb2210 = yyj2210 > l + yyj2359++ + if yyhl2359 { + yyb2359 = yyj2359 > l } else { - yyb2210 = r.CheckBreak() + yyb2359 = r.CheckBreak() } - if yyb2210 { + if yyb2359 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28506,26 +30646,26 @@ func (x *EndpointSubset) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Ports = nil } else { - yyv2215 := &x.Ports - yym2216 := z.DecBinary() - _ = yym2216 + yyv2364 := &x.Ports + yym2365 := z.DecBinary() + _ = yym2365 if false { } else { - h.decSliceEndpointPort((*[]EndpointPort)(yyv2215), d) + h.decSliceEndpointPort((*[]EndpointPort)(yyv2364), d) } } for { - yyj2210++ - if yyhl2210 { - yyb2210 = yyj2210 > l + yyj2359++ + if yyhl2359 { + yyb2359 = yyj2359 > l } else { - yyb2210 = r.CheckBreak() + yyb2359 = r.CheckBreak() } - if yyb2210 { + if yyb2359 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2210-1, "") + z.DecStructFieldNotFound(yyj2359-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28537,34 +30677,34 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2217 := z.EncBinary() - _ = yym2217 + yym2366 := z.EncBinary() + _ = yym2366 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2218 := !z.EncBinary() - yy2arr2218 := z.EncBasicHandle().StructToArray - var yyq2218 [2]bool - _, _, _ = yysep2218, yyq2218, yy2arr2218 - const yyr2218 bool = false - yyq2218[1] = x.TargetRef != nil - var yynn2218 int - if yyr2218 || yy2arr2218 { + yysep2367 := !z.EncBinary() + yy2arr2367 := z.EncBasicHandle().StructToArray + var yyq2367 [2]bool + _, _, _ = yysep2367, yyq2367, yy2arr2367 + const yyr2367 bool = false + yyq2367[1] = x.TargetRef != nil + var yynn2367 int + if yyr2367 || yy2arr2367 { r.EncodeArrayStart(2) } else { - yynn2218 = 1 - for _, b := range yyq2218 { + yynn2367 = 1 + for _, b := range yyq2367 { if b { - yynn2218++ + yynn2367++ } } - r.EncodeMapStart(yynn2218) - yynn2218 = 0 + r.EncodeMapStart(yynn2367) + yynn2367 = 0 } - if yyr2218 || yy2arr2218 { + if yyr2367 || yy2arr2367 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2220 := z.EncBinary() - _ = yym2220 + yym2369 := z.EncBinary() + _ = yym2369 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) @@ -28573,16 +30713,16 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("ip")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2221 := z.EncBinary() - _ = yym2221 + yym2370 := z.EncBinary() + _ = yym2370 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.IP)) } } - if yyr2218 || yy2arr2218 { + if yyr2367 || yy2arr2367 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2218[1] { + if yyq2367[1] { if x.TargetRef == nil { r.EncodeNil() } else { @@ -28592,7 +30732,7 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2218[1] { + if yyq2367[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("targetRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -28603,7 +30743,7 @@ func (x *EndpointAddress) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2218 || yy2arr2218 { + if yyr2367 || yy2arr2367 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28616,25 +30756,25 @@ func (x *EndpointAddress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2223 := z.DecBinary() - _ = yym2223 + yym2372 := z.DecBinary() + _ = yym2372 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2224 := r.ContainerType() - if yyct2224 == codecSelferValueTypeMap1234 { - yyl2224 := r.ReadMapStart() - if yyl2224 == 0 { + yyct2373 := r.ContainerType() + if yyct2373 == codecSelferValueTypeMap1234 { + yyl2373 := r.ReadMapStart() + if yyl2373 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2224, d) + x.codecDecodeSelfFromMap(yyl2373, d) } - } else if yyct2224 == codecSelferValueTypeArray1234 { - yyl2224 := r.ReadArrayStart() - if yyl2224 == 0 { + } else if yyct2373 == codecSelferValueTypeArray1234 { + yyl2373 := r.ReadArrayStart() + if yyl2373 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2224, d) + x.codecDecodeSelfFromArray(yyl2373, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28646,12 +30786,12 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2225Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2225Slc - var yyhl2225 bool = l >= 0 - for yyj2225 := 0; ; yyj2225++ { - if yyhl2225 { - if yyj2225 >= l { + var yys2374Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2374Slc + var yyhl2374 bool = l >= 0 + for yyj2374 := 0; ; yyj2374++ { + if yyhl2374 { + if yyj2374 >= l { break } } else { @@ -28660,10 +30800,10 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2225Slc = r.DecodeBytes(yys2225Slc, true, true) - yys2225 := string(yys2225Slc) + yys2374Slc = r.DecodeBytes(yys2374Slc, true, true) + yys2374 := string(yys2374Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2225 { + switch yys2374 { case "ip": if r.TryDecodeAsNil() { x.IP = "" @@ -28682,9 +30822,9 @@ func (x *EndpointAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.TargetRef.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys2225) - } // end switch yys2225 - } // end for yyj2225 + z.DecStructFieldNotFound(-1, yys2374) + } // end switch yys2374 + } // end for yyj2374 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28692,16 +30832,16 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2228 int - var yyb2228 bool - var yyhl2228 bool = l >= 0 - yyj2228++ - if yyhl2228 { - yyb2228 = yyj2228 > l + var yyj2377 int + var yyb2377 bool + var yyhl2377 bool = l >= 0 + yyj2377++ + if yyhl2377 { + yyb2377 = yyj2377 > l } else { - yyb2228 = r.CheckBreak() + yyb2377 = r.CheckBreak() } - if yyb2228 { + if yyb2377 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28711,13 +30851,13 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.IP = string(r.DecodeString()) } - yyj2228++ - if yyhl2228 { - yyb2228 = yyj2228 > l + yyj2377++ + if yyhl2377 { + yyb2377 = yyj2377 > l } else { - yyb2228 = r.CheckBreak() + yyb2377 = r.CheckBreak() } - if yyb2228 { + if yyb2377 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28733,17 +30873,17 @@ func (x *EndpointAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.TargetRef.CodecDecodeSelf(d) } for { - yyj2228++ - if yyhl2228 { - yyb2228 = yyj2228 > l + yyj2377++ + if yyhl2377 { + yyb2377 = yyj2377 > l } else { - yyb2228 = r.CheckBreak() + yyb2377 = r.CheckBreak() } - if yyb2228 { + if yyb2377 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2228-1, "") + z.DecStructFieldNotFound(yyj2377-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -28755,36 +30895,36 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2231 := z.EncBinary() - _ = yym2231 + yym2380 := z.EncBinary() + _ = yym2380 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2232 := !z.EncBinary() - yy2arr2232 := z.EncBasicHandle().StructToArray - var yyq2232 [3]bool - _, _, _ = yysep2232, yyq2232, yy2arr2232 - const yyr2232 bool = false - yyq2232[0] = x.Name != "" - yyq2232[2] = x.Protocol != "" - var yynn2232 int - if yyr2232 || yy2arr2232 { + yysep2381 := !z.EncBinary() + yy2arr2381 := z.EncBasicHandle().StructToArray + var yyq2381 [3]bool + _, _, _ = yysep2381, yyq2381, yy2arr2381 + const yyr2381 bool = false + yyq2381[0] = x.Name != "" + yyq2381[2] = x.Protocol != "" + var yynn2381 int + if yyr2381 || yy2arr2381 { r.EncodeArrayStart(3) } else { - yynn2232 = 1 - for _, b := range yyq2232 { + yynn2381 = 1 + for _, b := range yyq2381 { if b { - yynn2232++ + yynn2381++ } } - r.EncodeMapStart(yynn2232) - yynn2232 = 0 + r.EncodeMapStart(yynn2381) + yynn2381 = 0 } - if yyr2232 || yy2arr2232 { + if yyr2381 || yy2arr2381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2232[0] { - yym2234 := z.EncBinary() - _ = yym2234 + if yyq2381[0] { + yym2383 := z.EncBinary() + _ = yym2383 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -28793,22 +30933,22 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2232[0] { + if yyq2381[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2235 := z.EncBinary() - _ = yym2235 + yym2384 := z.EncBinary() + _ = yym2384 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr2232 || yy2arr2232 { + if yyr2381 || yy2arr2381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2237 := z.EncBinary() - _ = yym2237 + yym2386 := z.EncBinary() + _ = yym2386 if false { } else { r.EncodeInt(int64(x.Port)) @@ -28817,29 +30957,29 @@ func (x *EndpointPort) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2238 := z.EncBinary() - _ = yym2238 + yym2387 := z.EncBinary() + _ = yym2387 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2232 || yy2arr2232 { + if yyr2381 || yy2arr2381 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2232[2] { + if yyq2381[2] { x.Protocol.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2232[2] { + if yyq2381[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("protocol")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Protocol.CodecEncodeSelf(e) } } - if yyr2232 || yy2arr2232 { + if yyr2381 || yy2arr2381 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -28852,25 +30992,25 @@ func (x *EndpointPort) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2240 := z.DecBinary() - _ = yym2240 + yym2389 := z.DecBinary() + _ = yym2389 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2241 := r.ContainerType() - if yyct2241 == codecSelferValueTypeMap1234 { - yyl2241 := r.ReadMapStart() - if yyl2241 == 0 { + yyct2390 := r.ContainerType() + if yyct2390 == codecSelferValueTypeMap1234 { + yyl2390 := r.ReadMapStart() + if yyl2390 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2241, d) + x.codecDecodeSelfFromMap(yyl2390, d) } - } else if yyct2241 == codecSelferValueTypeArray1234 { - yyl2241 := r.ReadArrayStart() - if yyl2241 == 0 { + } else if yyct2390 == codecSelferValueTypeArray1234 { + yyl2390 := r.ReadArrayStart() + if yyl2390 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2241, d) + x.codecDecodeSelfFromArray(yyl2390, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -28882,12 +31022,12 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2242Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2242Slc - var yyhl2242 bool = l >= 0 - for yyj2242 := 0; ; yyj2242++ { - if yyhl2242 { - if yyj2242 >= l { + var yys2391Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2391Slc + var yyhl2391 bool = l >= 0 + for yyj2391 := 0; ; yyj2391++ { + if yyhl2391 { + if yyj2391 >= l { break } } else { @@ -28896,10 +31036,10 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2242Slc = r.DecodeBytes(yys2242Slc, true, true) - yys2242 := string(yys2242Slc) + yys2391Slc = r.DecodeBytes(yys2391Slc, true, true) + yys2391 := string(yys2391Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2242 { + switch yys2391 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -28919,9 +31059,9 @@ func (x *EndpointPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Protocol = Protocol(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2242) - } // end switch yys2242 - } // end for yyj2242 + z.DecStructFieldNotFound(-1, yys2391) + } // end switch yys2391 + } // end for yyj2391 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -28929,16 +31069,16 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2246 int - var yyb2246 bool - var yyhl2246 bool = l >= 0 - yyj2246++ - if yyhl2246 { - yyb2246 = yyj2246 > l + var yyj2395 int + var yyb2395 bool + var yyhl2395 bool = l >= 0 + yyj2395++ + if yyhl2395 { + yyb2395 = yyj2395 > l } else { - yyb2246 = r.CheckBreak() + yyb2395 = r.CheckBreak() } - if yyb2246 { + if yyb2395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28948,13 +31088,13 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Name = string(r.DecodeString()) } - yyj2246++ - if yyhl2246 { - yyb2246 = yyj2246 > l + yyj2395++ + if yyhl2395 { + yyb2395 = yyj2395 > l } else { - yyb2246 = r.CheckBreak() + yyb2395 = r.CheckBreak() } - if yyb2246 { + if yyb2395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28964,13 +31104,13 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Port = int32(r.DecodeInt(32)) } - yyj2246++ - if yyhl2246 { - yyb2246 = yyj2246 > l + yyj2395++ + if yyhl2395 { + yyb2395 = yyj2395 > l } else { - yyb2246 = r.CheckBreak() + yyb2395 = r.CheckBreak() } - if yyb2246 { + if yyb2395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -28981,17 +31121,17 @@ func (x *EndpointPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Protocol = Protocol(r.DecodeString()) } for { - yyj2246++ - if yyhl2246 { - yyb2246 = yyj2246 > l + yyj2395++ + if yyhl2395 { + yyb2395 = yyj2395 > l } else { - yyb2246 = r.CheckBreak() + yyb2395 = r.CheckBreak() } - if yyb2246 { + if yyb2395 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2246-1, "") + z.DecStructFieldNotFound(yyj2395-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29003,118 +31143,68 @@ func (x *EndpointsList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2250 := z.EncBinary() - _ = yym2250 + yym2399 := z.EncBinary() + _ = yym2399 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2251 := !z.EncBinary() - yy2arr2251 := z.EncBasicHandle().StructToArray - var yyq2251 [4]bool - _, _, _ = yysep2251, yyq2251, yy2arr2251 - const yyr2251 bool = false - yyq2251[0] = x.Kind != "" - yyq2251[1] = x.APIVersion != "" - yyq2251[2] = true - var yynn2251 int - if yyr2251 || yy2arr2251 { + yysep2400 := !z.EncBinary() + yy2arr2400 := z.EncBasicHandle().StructToArray + var yyq2400 [4]bool + _, _, _ = yysep2400, yyq2400, yy2arr2400 + const yyr2400 bool = false + yyq2400[0] = true + yyq2400[2] = x.Kind != "" + yyq2400[3] = x.APIVersion != "" + var yynn2400 int + if yyr2400 || yy2arr2400 { r.EncodeArrayStart(4) } else { - yynn2251 = 1 - for _, b := range yyq2251 { + yynn2400 = 1 + for _, b := range yyq2400 { if b { - yynn2251++ + yynn2400++ } } - r.EncodeMapStart(yynn2251) - yynn2251 = 0 + r.EncodeMapStart(yynn2400) + yynn2400 = 0 } - if yyr2251 || yy2arr2251 { + if yyr2400 || yy2arr2400 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2251[0] { - yym2253 := z.EncBinary() - _ = yym2253 + if yyq2400[0] { + yy2402 := &x.ListMeta + yym2403 := z.EncBinary() + _ = yym2403 if false { + } else if z.HasExtensions() && z.EncExt(yy2402) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2251[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2254 := z.EncBinary() - _ = yym2254 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2251 || yy2arr2251 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2251[1] { - yym2256 := z.EncBinary() - _ = yym2256 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2251[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2257 := z.EncBinary() - _ = yym2257 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2251 || yy2arr2251 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2251[2] { - yy2259 := &x.ListMeta - yym2260 := z.EncBinary() - _ = yym2260 - if false { - } else if z.HasExtensions() && z.EncExt(yy2259) { - } else { - z.EncFallback(yy2259) + z.EncFallback(yy2402) } } else { r.EncodeNil() } } else { - if yyq2251[2] { + if yyq2400[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2261 := &x.ListMeta - yym2262 := z.EncBinary() - _ = yym2262 + yy2404 := &x.ListMeta + yym2405 := z.EncBinary() + _ = yym2405 if false { - } else if z.HasExtensions() && z.EncExt(yy2261) { + } else if z.HasExtensions() && z.EncExt(yy2404) { } else { - z.EncFallback(yy2261) + z.EncFallback(yy2404) } } } - if yyr2251 || yy2arr2251 { + if yyr2400 || yy2arr2400 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym2264 := z.EncBinary() - _ = yym2264 + yym2407 := z.EncBinary() + _ = yym2407 if false { } else { h.encSliceEndpoints(([]Endpoints)(x.Items), e) @@ -29127,15 +31217,65 @@ func (x *EndpointsList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym2265 := z.EncBinary() - _ = yym2265 + yym2408 := z.EncBinary() + _ = yym2408 if false { } else { h.encSliceEndpoints(([]Endpoints)(x.Items), e) } } } - if yyr2251 || yy2arr2251 { + if yyr2400 || yy2arr2400 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2400[2] { + yym2410 := z.EncBinary() + _ = yym2410 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2400[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2411 := z.EncBinary() + _ = yym2411 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2400 || yy2arr2400 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2400[3] { + yym2413 := z.EncBinary() + _ = yym2413 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2400[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2414 := z.EncBinary() + _ = yym2414 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2400 || yy2arr2400 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29148,25 +31288,25 @@ func (x *EndpointsList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2266 := z.DecBinary() - _ = yym2266 + yym2415 := z.DecBinary() + _ = yym2415 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2267 := r.ContainerType() - if yyct2267 == codecSelferValueTypeMap1234 { - yyl2267 := r.ReadMapStart() - if yyl2267 == 0 { + yyct2416 := r.ContainerType() + if yyct2416 == codecSelferValueTypeMap1234 { + yyl2416 := r.ReadMapStart() + if yyl2416 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2267, d) + x.codecDecodeSelfFromMap(yyl2416, d) } - } else if yyct2267 == codecSelferValueTypeArray1234 { - yyl2267 := r.ReadArrayStart() - if yyl2267 == 0 { + } else if yyct2416 == codecSelferValueTypeArray1234 { + yyl2416 := r.ReadArrayStart() + if yyl2416 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2267, d) + x.codecDecodeSelfFromArray(yyl2416, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29178,12 +31318,12 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2268Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2268Slc - var yyhl2268 bool = l >= 0 - for yyj2268 := 0; ; yyj2268++ { - if yyhl2268 { - if yyj2268 >= l { + var yys2417Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2417Slc + var yyhl2417 bool = l >= 0 + for yyj2417 := 0; ; yyj2417++ { + if yyhl2417 { + if yyj2417 >= l { break } } else { @@ -29192,10 +31332,35 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2268Slc = r.DecodeBytes(yys2268Slc, true, true) - yys2268 := string(yys2268Slc) + yys2417Slc = r.DecodeBytes(yys2417Slc, true, true) + yys2417 := string(yys2417Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2268 { + switch yys2417 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2418 := &x.ListMeta + yym2419 := z.DecBinary() + _ = yym2419 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2418) { + } else { + z.DecFallback(yyv2418, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2420 := &x.Items + yym2421 := z.DecBinary() + _ = yym2421 + if false { + } else { + h.decSliceEndpoints((*[]Endpoints)(yyv2420), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -29208,35 +31373,10 @@ func (x *EndpointsList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2271 := &x.ListMeta - yym2272 := z.DecBinary() - _ = yym2272 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2271) { - } else { - z.DecFallback(yyv2271, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2273 := &x.Items - yym2274 := z.DecBinary() - _ = yym2274 - if false { - } else { - h.decSliceEndpoints((*[]Endpoints)(yyv2273), d) - } - } default: - z.DecStructFieldNotFound(-1, yys2268) - } // end switch yys2268 - } // end for yyj2268 + z.DecStructFieldNotFound(-1, yys2417) + } // end switch yys2417 + } // end for yyj2417 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29244,16 +31384,61 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2275 int - var yyb2275 bool - var yyhl2275 bool = l >= 0 - yyj2275++ - if yyhl2275 { - yyb2275 = yyj2275 > l + var yyj2424 int + var yyb2424 bool + var yyhl2424 bool = l >= 0 + yyj2424++ + if yyhl2424 { + yyb2424 = yyj2424 > l } else { - yyb2275 = r.CheckBreak() + yyb2424 = r.CheckBreak() } - if yyb2275 { + if yyb2424 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2425 := &x.ListMeta + yym2426 := z.DecBinary() + _ = yym2426 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2425) { + } else { + z.DecFallback(yyv2425, false) + } + } + yyj2424++ + if yyhl2424 { + yyb2424 = yyj2424 > l + } else { + yyb2424 = r.CheckBreak() + } + if yyb2424 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2427 := &x.Items + yym2428 := z.DecBinary() + _ = yym2428 + if false { + } else { + h.decSliceEndpoints((*[]Endpoints)(yyv2427), d) + } + } + yyj2424++ + if yyhl2424 { + yyb2424 = yyj2424 > l + } else { + yyb2424 = r.CheckBreak() + } + if yyb2424 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29263,13 +31448,13 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2275++ - if yyhl2275 { - yyb2275 = yyj2275 > l + yyj2424++ + if yyhl2424 { + yyb2424 = yyj2424 > l } else { - yyb2275 = r.CheckBreak() + yyb2424 = r.CheckBreak() } - if yyb2275 { + if yyb2424 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29279,63 +31464,18 @@ func (x *EndpointsList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2275++ - if yyhl2275 { - yyb2275 = yyj2275 > l - } else { - yyb2275 = r.CheckBreak() - } - if yyb2275 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2278 := &x.ListMeta - yym2279 := z.DecBinary() - _ = yym2279 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2278) { - } else { - z.DecFallback(yyv2278, false) - } - } - yyj2275++ - if yyhl2275 { - yyb2275 = yyj2275 > l - } else { - yyb2275 = r.CheckBreak() - } - if yyb2275 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2280 := &x.Items - yym2281 := z.DecBinary() - _ = yym2281 - if false { - } else { - h.decSliceEndpoints((*[]Endpoints)(yyv2280), d) - } - } for { - yyj2275++ - if yyhl2275 { - yyb2275 = yyj2275 > l + yyj2424++ + if yyhl2424 { + yyb2424 = yyj2424 > l } else { - yyb2275 = r.CheckBreak() + yyb2424 = r.CheckBreak() } - if yyb2275 { + if yyb2424 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2275-1, "") + z.DecStructFieldNotFound(yyj2424-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29347,38 +31487,38 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2282 := z.EncBinary() - _ = yym2282 + yym2431 := z.EncBinary() + _ = yym2431 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2283 := !z.EncBinary() - yy2arr2283 := z.EncBasicHandle().StructToArray - var yyq2283 [4]bool - _, _, _ = yysep2283, yyq2283, yy2arr2283 - const yyr2283 bool = false - yyq2283[0] = x.PodCIDR != "" - yyq2283[1] = x.ExternalID != "" - yyq2283[2] = x.ProviderID != "" - yyq2283[3] = x.Unschedulable != false - var yynn2283 int - if yyr2283 || yy2arr2283 { + yysep2432 := !z.EncBinary() + yy2arr2432 := z.EncBasicHandle().StructToArray + var yyq2432 [4]bool + _, _, _ = yysep2432, yyq2432, yy2arr2432 + const yyr2432 bool = false + yyq2432[0] = x.PodCIDR != "" + yyq2432[1] = x.ExternalID != "" + yyq2432[2] = x.ProviderID != "" + yyq2432[3] = x.Unschedulable != false + var yynn2432 int + if yyr2432 || yy2arr2432 { r.EncodeArrayStart(4) } else { - yynn2283 = 0 - for _, b := range yyq2283 { + yynn2432 = 0 + for _, b := range yyq2432 { if b { - yynn2283++ + yynn2432++ } } - r.EncodeMapStart(yynn2283) - yynn2283 = 0 + r.EncodeMapStart(yynn2432) + yynn2432 = 0 } - if yyr2283 || yy2arr2283 { + if yyr2432 || yy2arr2432 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2283[0] { - yym2285 := z.EncBinary() - _ = yym2285 + if yyq2432[0] { + yym2434 := z.EncBinary() + _ = yym2434 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) @@ -29387,23 +31527,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2283[0] { + if yyq2432[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2286 := z.EncBinary() - _ = yym2286 + yym2435 := z.EncBinary() + _ = yym2435 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) } } } - if yyr2283 || yy2arr2283 { + if yyr2432 || yy2arr2432 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2283[1] { - yym2288 := z.EncBinary() - _ = yym2288 + if yyq2432[1] { + yym2437 := z.EncBinary() + _ = yym2437 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ExternalID)) @@ -29412,23 +31552,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2283[1] { + if yyq2432[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("externalID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2289 := z.EncBinary() - _ = yym2289 + yym2438 := z.EncBinary() + _ = yym2438 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ExternalID)) } } } - if yyr2283 || yy2arr2283 { + if yyr2432 || yy2arr2432 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2283[2] { - yym2291 := z.EncBinary() - _ = yym2291 + if yyq2432[2] { + yym2440 := z.EncBinary() + _ = yym2440 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ProviderID)) @@ -29437,23 +31577,23 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2283[2] { + if yyq2432[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("providerID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2292 := z.EncBinary() - _ = yym2292 + yym2441 := z.EncBinary() + _ = yym2441 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ProviderID)) } } } - if yyr2283 || yy2arr2283 { + if yyr2432 || yy2arr2432 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2283[3] { - yym2294 := z.EncBinary() - _ = yym2294 + if yyq2432[3] { + yym2443 := z.EncBinary() + _ = yym2443 if false { } else { r.EncodeBool(bool(x.Unschedulable)) @@ -29462,19 +31602,19 @@ func (x *NodeSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeBool(false) } } else { - if yyq2283[3] { + if yyq2432[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("unschedulable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2295 := z.EncBinary() - _ = yym2295 + yym2444 := z.EncBinary() + _ = yym2444 if false { } else { r.EncodeBool(bool(x.Unschedulable)) } } } - if yyr2283 || yy2arr2283 { + if yyr2432 || yy2arr2432 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29487,25 +31627,25 @@ func (x *NodeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2296 := z.DecBinary() - _ = yym2296 + yym2445 := z.DecBinary() + _ = yym2445 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2297 := r.ContainerType() - if yyct2297 == codecSelferValueTypeMap1234 { - yyl2297 := r.ReadMapStart() - if yyl2297 == 0 { + yyct2446 := r.ContainerType() + if yyct2446 == codecSelferValueTypeMap1234 { + yyl2446 := r.ReadMapStart() + if yyl2446 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2297, d) + x.codecDecodeSelfFromMap(yyl2446, d) } - } else if yyct2297 == codecSelferValueTypeArray1234 { - yyl2297 := r.ReadArrayStart() - if yyl2297 == 0 { + } else if yyct2446 == codecSelferValueTypeArray1234 { + yyl2446 := r.ReadArrayStart() + if yyl2446 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2297, d) + x.codecDecodeSelfFromArray(yyl2446, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29517,12 +31657,12 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2298Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2298Slc - var yyhl2298 bool = l >= 0 - for yyj2298 := 0; ; yyj2298++ { - if yyhl2298 { - if yyj2298 >= l { + var yys2447Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2447Slc + var yyhl2447 bool = l >= 0 + for yyj2447 := 0; ; yyj2447++ { + if yyhl2447 { + if yyj2447 >= l { break } } else { @@ -29531,10 +31671,10 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2298Slc = r.DecodeBytes(yys2298Slc, true, true) - yys2298 := string(yys2298Slc) + yys2447Slc = r.DecodeBytes(yys2447Slc, true, true) + yys2447 := string(yys2447Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2298 { + switch yys2447 { case "podCIDR": if r.TryDecodeAsNil() { x.PodCIDR = "" @@ -29560,9 +31700,9 @@ func (x *NodeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Unschedulable = bool(r.DecodeBool()) } default: - z.DecStructFieldNotFound(-1, yys2298) - } // end switch yys2298 - } // end for yyj2298 + z.DecStructFieldNotFound(-1, yys2447) + } // end switch yys2447 + } // end for yyj2447 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29570,16 +31710,16 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2303 int - var yyb2303 bool - var yyhl2303 bool = l >= 0 - yyj2303++ - if yyhl2303 { - yyb2303 = yyj2303 > l + var yyj2452 int + var yyb2452 bool + var yyhl2452 bool = l >= 0 + yyj2452++ + if yyhl2452 { + yyb2452 = yyj2452 > l } else { - yyb2303 = r.CheckBreak() + yyb2452 = r.CheckBreak() } - if yyb2303 { + if yyb2452 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29589,13 +31729,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.PodCIDR = string(r.DecodeString()) } - yyj2303++ - if yyhl2303 { - yyb2303 = yyj2303 > l + yyj2452++ + if yyhl2452 { + yyb2452 = yyj2452 > l } else { - yyb2303 = r.CheckBreak() + yyb2452 = r.CheckBreak() } - if yyb2303 { + if yyb2452 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29605,13 +31745,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ExternalID = string(r.DecodeString()) } - yyj2303++ - if yyhl2303 { - yyb2303 = yyj2303 > l + yyj2452++ + if yyhl2452 { + yyb2452 = yyj2452 > l } else { - yyb2303 = r.CheckBreak() + yyb2452 = r.CheckBreak() } - if yyb2303 { + if yyb2452 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29621,13 +31761,13 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ProviderID = string(r.DecodeString()) } - yyj2303++ - if yyhl2303 { - yyb2303 = yyj2303 > l + yyj2452++ + if yyhl2452 { + yyb2452 = yyj2452 > l } else { - yyb2303 = r.CheckBreak() + yyb2452 = r.CheckBreak() } - if yyb2303 { + if yyb2452 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29638,17 +31778,17 @@ func (x *NodeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Unschedulable = bool(r.DecodeBool()) } for { - yyj2303++ - if yyhl2303 { - yyb2303 = yyj2303 > l + yyj2452++ + if yyhl2452 { + yyb2452 = yyj2452 > l } else { - yyb2303 = r.CheckBreak() + yyb2452 = r.CheckBreak() } - if yyb2303 { + if yyb2452 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2303-1, "") + z.DecStructFieldNotFound(yyj2452-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29660,33 +31800,33 @@ func (x *DaemonEndpoint) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2308 := z.EncBinary() - _ = yym2308 + yym2457 := z.EncBinary() + _ = yym2457 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2309 := !z.EncBinary() - yy2arr2309 := z.EncBasicHandle().StructToArray - var yyq2309 [1]bool - _, _, _ = yysep2309, yyq2309, yy2arr2309 - const yyr2309 bool = false - var yynn2309 int - if yyr2309 || yy2arr2309 { + yysep2458 := !z.EncBinary() + yy2arr2458 := z.EncBasicHandle().StructToArray + var yyq2458 [1]bool + _, _, _ = yysep2458, yyq2458, yy2arr2458 + const yyr2458 bool = false + var yynn2458 int + if yyr2458 || yy2arr2458 { r.EncodeArrayStart(1) } else { - yynn2309 = 1 - for _, b := range yyq2309 { + yynn2458 = 1 + for _, b := range yyq2458 { if b { - yynn2309++ + yynn2458++ } } - r.EncodeMapStart(yynn2309) - yynn2309 = 0 + r.EncodeMapStart(yynn2458) + yynn2458 = 0 } - if yyr2309 || yy2arr2309 { + if yyr2458 || yy2arr2458 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2311 := z.EncBinary() - _ = yym2311 + yym2460 := z.EncBinary() + _ = yym2460 if false { } else { r.EncodeInt(int64(x.Port)) @@ -29695,14 +31835,14 @@ func (x *DaemonEndpoint) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2312 := z.EncBinary() - _ = yym2312 + yym2461 := z.EncBinary() + _ = yym2461 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr2309 || yy2arr2309 { + if yyr2458 || yy2arr2458 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29715,25 +31855,25 @@ func (x *DaemonEndpoint) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2313 := z.DecBinary() - _ = yym2313 + yym2462 := z.DecBinary() + _ = yym2462 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2314 := r.ContainerType() - if yyct2314 == codecSelferValueTypeMap1234 { - yyl2314 := r.ReadMapStart() - if yyl2314 == 0 { + yyct2463 := r.ContainerType() + if yyct2463 == codecSelferValueTypeMap1234 { + yyl2463 := r.ReadMapStart() + if yyl2463 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2314, d) + x.codecDecodeSelfFromMap(yyl2463, d) } - } else if yyct2314 == codecSelferValueTypeArray1234 { - yyl2314 := r.ReadArrayStart() - if yyl2314 == 0 { + } else if yyct2463 == codecSelferValueTypeArray1234 { + yyl2463 := r.ReadArrayStart() + if yyl2463 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2314, d) + x.codecDecodeSelfFromArray(yyl2463, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29745,12 +31885,12 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2315Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2315Slc - var yyhl2315 bool = l >= 0 - for yyj2315 := 0; ; yyj2315++ { - if yyhl2315 { - if yyj2315 >= l { + var yys2464Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2464Slc + var yyhl2464 bool = l >= 0 + for yyj2464 := 0; ; yyj2464++ { + if yyhl2464 { + if yyj2464 >= l { break } } else { @@ -29759,10 +31899,10 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2315Slc = r.DecodeBytes(yys2315Slc, true, true) - yys2315 := string(yys2315Slc) + yys2464Slc = r.DecodeBytes(yys2464Slc, true, true) + yys2464 := string(yys2464Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2315 { + switch yys2464 { case "Port": if r.TryDecodeAsNil() { x.Port = 0 @@ -29770,9 +31910,9 @@ func (x *DaemonEndpoint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Port = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys2315) - } // end switch yys2315 - } // end for yyj2315 + z.DecStructFieldNotFound(-1, yys2464) + } // end switch yys2464 + } // end for yyj2464 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29780,16 +31920,16 @@ func (x *DaemonEndpoint) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2317 int - var yyb2317 bool - var yyhl2317 bool = l >= 0 - yyj2317++ - if yyhl2317 { - yyb2317 = yyj2317 > l + var yyj2466 int + var yyb2466 bool + var yyhl2466 bool = l >= 0 + yyj2466++ + if yyhl2466 { + yyb2466 = yyj2466 > l } else { - yyb2317 = r.CheckBreak() + yyb2466 = r.CheckBreak() } - if yyb2317 { + if yyb2466 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29800,17 +31940,17 @@ func (x *DaemonEndpoint) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Port = int32(r.DecodeInt(32)) } for { - yyj2317++ - if yyhl2317 { - yyb2317 = yyj2317 > l + yyj2466++ + if yyhl2466 { + yyb2466 = yyj2466 > l } else { - yyb2317 = r.CheckBreak() + yyb2466 = r.CheckBreak() } - if yyb2317 { + if yyb2466 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2317-1, "") + z.DecStructFieldNotFound(yyj2466-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29822,48 +31962,48 @@ func (x *NodeDaemonEndpoints) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2319 := z.EncBinary() - _ = yym2319 + yym2468 := z.EncBinary() + _ = yym2468 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2320 := !z.EncBinary() - yy2arr2320 := z.EncBasicHandle().StructToArray - var yyq2320 [1]bool - _, _, _ = yysep2320, yyq2320, yy2arr2320 - const yyr2320 bool = false - yyq2320[0] = true - var yynn2320 int - if yyr2320 || yy2arr2320 { + yysep2469 := !z.EncBinary() + yy2arr2469 := z.EncBasicHandle().StructToArray + var yyq2469 [1]bool + _, _, _ = yysep2469, yyq2469, yy2arr2469 + const yyr2469 bool = false + yyq2469[0] = true + var yynn2469 int + if yyr2469 || yy2arr2469 { r.EncodeArrayStart(1) } else { - yynn2320 = 0 - for _, b := range yyq2320 { + yynn2469 = 0 + for _, b := range yyq2469 { if b { - yynn2320++ + yynn2469++ } } - r.EncodeMapStart(yynn2320) - yynn2320 = 0 + r.EncodeMapStart(yynn2469) + yynn2469 = 0 } - if yyr2320 || yy2arr2320 { + if yyr2469 || yy2arr2469 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2320[0] { - yy2322 := &x.KubeletEndpoint - yy2322.CodecEncodeSelf(e) + if yyq2469[0] { + yy2471 := &x.KubeletEndpoint + yy2471.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2320[0] { + if yyq2469[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeletEndpoint")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2323 := &x.KubeletEndpoint - yy2323.CodecEncodeSelf(e) + yy2472 := &x.KubeletEndpoint + yy2472.CodecEncodeSelf(e) } } - if yyr2320 || yy2arr2320 { + if yyr2469 || yy2arr2469 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -29876,25 +32016,25 @@ func (x *NodeDaemonEndpoints) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2324 := z.DecBinary() - _ = yym2324 + yym2473 := z.DecBinary() + _ = yym2473 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2325 := r.ContainerType() - if yyct2325 == codecSelferValueTypeMap1234 { - yyl2325 := r.ReadMapStart() - if yyl2325 == 0 { + yyct2474 := r.ContainerType() + if yyct2474 == codecSelferValueTypeMap1234 { + yyl2474 := r.ReadMapStart() + if yyl2474 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2325, d) + x.codecDecodeSelfFromMap(yyl2474, d) } - } else if yyct2325 == codecSelferValueTypeArray1234 { - yyl2325 := r.ReadArrayStart() - if yyl2325 == 0 { + } else if yyct2474 == codecSelferValueTypeArray1234 { + yyl2474 := r.ReadArrayStart() + if yyl2474 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2325, d) + x.codecDecodeSelfFromArray(yyl2474, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -29906,12 +32046,12 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2326Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2326Slc - var yyhl2326 bool = l >= 0 - for yyj2326 := 0; ; yyj2326++ { - if yyhl2326 { - if yyj2326 >= l { + var yys2475Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2475Slc + var yyhl2475 bool = l >= 0 + for yyj2475 := 0; ; yyj2475++ { + if yyhl2475 { + if yyj2475 >= l { break } } else { @@ -29920,21 +32060,21 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2326Slc = r.DecodeBytes(yys2326Slc, true, true) - yys2326 := string(yys2326Slc) + yys2475Slc = r.DecodeBytes(yys2475Slc, true, true) + yys2475 := string(yys2475Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2326 { + switch yys2475 { case "kubeletEndpoint": if r.TryDecodeAsNil() { x.KubeletEndpoint = DaemonEndpoint{} } else { - yyv2327 := &x.KubeletEndpoint - yyv2327.CodecDecodeSelf(d) + yyv2476 := &x.KubeletEndpoint + yyv2476.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys2326) - } // end switch yys2326 - } // end for yyj2326 + z.DecStructFieldNotFound(-1, yys2475) + } // end switch yys2475 + } // end for yyj2475 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -29942,16 +32082,16 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2328 int - var yyb2328 bool - var yyhl2328 bool = l >= 0 - yyj2328++ - if yyhl2328 { - yyb2328 = yyj2328 > l + var yyj2477 int + var yyb2477 bool + var yyhl2477 bool = l >= 0 + yyj2477++ + if yyhl2477 { + yyb2477 = yyj2477 > l } else { - yyb2328 = r.CheckBreak() + yyb2477 = r.CheckBreak() } - if yyb2328 { + if yyb2477 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -29959,21 +32099,21 @@ func (x *NodeDaemonEndpoints) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.KubeletEndpoint = DaemonEndpoint{} } else { - yyv2329 := &x.KubeletEndpoint - yyv2329.CodecDecodeSelf(d) + yyv2478 := &x.KubeletEndpoint + yyv2478.CodecDecodeSelf(d) } for { - yyj2328++ - if yyhl2328 { - yyb2328 = yyj2328 > l + yyj2477++ + if yyhl2477 { + yyb2477 = yyj2477 > l } else { - yyb2328 = r.CheckBreak() + yyb2477 = r.CheckBreak() } - if yyb2328 { + if yyb2477 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2328-1, "") + z.DecStructFieldNotFound(yyj2477-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -29985,33 +32125,33 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2330 := z.EncBinary() - _ = yym2330 + yym2479 := z.EncBinary() + _ = yym2479 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2331 := !z.EncBinary() - yy2arr2331 := z.EncBasicHandle().StructToArray - var yyq2331 [8]bool - _, _, _ = yysep2331, yyq2331, yy2arr2331 - const yyr2331 bool = false - var yynn2331 int - if yyr2331 || yy2arr2331 { + yysep2480 := !z.EncBinary() + yy2arr2480 := z.EncBasicHandle().StructToArray + var yyq2480 [8]bool + _, _, _ = yysep2480, yyq2480, yy2arr2480 + const yyr2480 bool = false + var yynn2480 int + if yyr2480 || yy2arr2480 { r.EncodeArrayStart(8) } else { - yynn2331 = 8 - for _, b := range yyq2331 { + yynn2480 = 8 + for _, b := range yyq2480 { if b { - yynn2331++ + yynn2480++ } } - r.EncodeMapStart(yynn2331) - yynn2331 = 0 + r.EncodeMapStart(yynn2480) + yynn2480 = 0 } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2333 := z.EncBinary() - _ = yym2333 + yym2482 := z.EncBinary() + _ = yym2482 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MachineID)) @@ -30020,17 +32160,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("machineID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2334 := z.EncBinary() - _ = yym2334 + yym2483 := z.EncBinary() + _ = yym2483 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MachineID)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2336 := z.EncBinary() - _ = yym2336 + yym2485 := z.EncBinary() + _ = yym2485 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemUUID)) @@ -30039,17 +32179,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("systemUUID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2337 := z.EncBinary() - _ = yym2337 + yym2486 := z.EncBinary() + _ = yym2486 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemUUID)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2339 := z.EncBinary() - _ = yym2339 + yym2488 := z.EncBinary() + _ = yym2488 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BootID)) @@ -30058,17 +32198,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("bootID")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2340 := z.EncBinary() - _ = yym2340 + yym2489 := z.EncBinary() + _ = yym2489 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BootID)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2342 := z.EncBinary() - _ = yym2342 + yym2491 := z.EncBinary() + _ = yym2491 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KernelVersion)) @@ -30077,17 +32217,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kernelVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2343 := z.EncBinary() - _ = yym2343 + yym2492 := z.EncBinary() + _ = yym2492 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KernelVersion)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2345 := z.EncBinary() - _ = yym2345 + yym2494 := z.EncBinary() + _ = yym2494 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.OSImage)) @@ -30096,17 +32236,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("osImage")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2346 := z.EncBinary() - _ = yym2346 + yym2495 := z.EncBinary() + _ = yym2495 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.OSImage)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2348 := z.EncBinary() - _ = yym2348 + yym2497 := z.EncBinary() + _ = yym2497 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntimeVersion)) @@ -30115,17 +32255,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerRuntimeVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2349 := z.EncBinary() - _ = yym2349 + yym2498 := z.EncBinary() + _ = yym2498 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntimeVersion)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2351 := z.EncBinary() - _ = yym2351 + yym2500 := z.EncBinary() + _ = yym2500 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeletVersion)) @@ -30134,17 +32274,17 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeletVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2352 := z.EncBinary() - _ = yym2352 + yym2501 := z.EncBinary() + _ = yym2501 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeletVersion)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2354 := z.EncBinary() - _ = yym2354 + yym2503 := z.EncBinary() + _ = yym2503 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeProxyVersion)) @@ -30153,14 +32293,14 @@ func (x *NodeSystemInfo) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeProxyVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2355 := z.EncBinary() - _ = yym2355 + yym2504 := z.EncBinary() + _ = yym2504 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeProxyVersion)) } } - if yyr2331 || yy2arr2331 { + if yyr2480 || yy2arr2480 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -30173,25 +32313,25 @@ func (x *NodeSystemInfo) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2356 := z.DecBinary() - _ = yym2356 + yym2505 := z.DecBinary() + _ = yym2505 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2357 := r.ContainerType() - if yyct2357 == codecSelferValueTypeMap1234 { - yyl2357 := r.ReadMapStart() - if yyl2357 == 0 { + yyct2506 := r.ContainerType() + if yyct2506 == codecSelferValueTypeMap1234 { + yyl2506 := r.ReadMapStart() + if yyl2506 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2357, d) + x.codecDecodeSelfFromMap(yyl2506, d) } - } else if yyct2357 == codecSelferValueTypeArray1234 { - yyl2357 := r.ReadArrayStart() - if yyl2357 == 0 { + } else if yyct2506 == codecSelferValueTypeArray1234 { + yyl2506 := r.ReadArrayStart() + if yyl2506 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2357, d) + x.codecDecodeSelfFromArray(yyl2506, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -30203,12 +32343,12 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2358Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2358Slc - var yyhl2358 bool = l >= 0 - for yyj2358 := 0; ; yyj2358++ { - if yyhl2358 { - if yyj2358 >= l { + var yys2507Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2507Slc + var yyhl2507 bool = l >= 0 + for yyj2507 := 0; ; yyj2507++ { + if yyhl2507 { + if yyj2507 >= l { break } } else { @@ -30217,10 +32357,10 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2358Slc = r.DecodeBytes(yys2358Slc, true, true) - yys2358 := string(yys2358Slc) + yys2507Slc = r.DecodeBytes(yys2507Slc, true, true) + yys2507 := string(yys2507Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2358 { + switch yys2507 { case "machineID": if r.TryDecodeAsNil() { x.MachineID = "" @@ -30270,9 +32410,9 @@ func (x *NodeSystemInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.KubeProxyVersion = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2358) - } // end switch yys2358 - } // end for yyj2358 + z.DecStructFieldNotFound(-1, yys2507) + } // end switch yys2507 + } // end for yyj2507 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -30280,16 +32420,16 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2367 int - var yyb2367 bool - var yyhl2367 bool = l >= 0 - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + var yyj2516 int + var yyb2516 bool + var yyhl2516 bool = l >= 0 + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30299,13 +32439,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.MachineID = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30315,13 +32455,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.SystemUUID = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30331,13 +32471,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.BootID = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30347,13 +32487,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.KernelVersion = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30363,13 +32503,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.OSImage = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30379,13 +32519,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ContainerRuntimeVersion = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30395,13 +32535,13 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.KubeletVersion = string(r.DecodeString()) } - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30412,17 +32552,17 @@ func (x *NodeSystemInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.KubeProxyVersion = string(r.DecodeString()) } for { - yyj2367++ - if yyhl2367 { - yyb2367 = yyj2367 > l + yyj2516++ + if yyhl2516 { + yyb2516 = yyj2516 > l } else { - yyb2367 = r.CheckBreak() + yyb2516 = r.CheckBreak() } - if yyb2367 { + if yyb2516 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2367-1, "") + z.DecStructFieldNotFound(yyj2516-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -30434,39 +32574,39 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2376 := z.EncBinary() - _ = yym2376 + yym2525 := z.EncBinary() + _ = yym2525 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2377 := !z.EncBinary() - yy2arr2377 := z.EncBasicHandle().StructToArray - var yyq2377 [8]bool - _, _, _ = yysep2377, yyq2377, yy2arr2377 - const yyr2377 bool = false - yyq2377[0] = len(x.Capacity) != 0 - yyq2377[1] = len(x.Allocatable) != 0 - yyq2377[2] = x.Phase != "" - yyq2377[3] = len(x.Conditions) != 0 - yyq2377[4] = len(x.Addresses) != 0 - yyq2377[5] = true - yyq2377[6] = true - var yynn2377 int - if yyr2377 || yy2arr2377 { + yysep2526 := !z.EncBinary() + yy2arr2526 := z.EncBasicHandle().StructToArray + var yyq2526 [8]bool + _, _, _ = yysep2526, yyq2526, yy2arr2526 + const yyr2526 bool = false + yyq2526[0] = len(x.Capacity) != 0 + yyq2526[1] = len(x.Allocatable) != 0 + yyq2526[2] = x.Phase != "" + yyq2526[3] = len(x.Conditions) != 0 + yyq2526[4] = len(x.Addresses) != 0 + yyq2526[5] = true + yyq2526[6] = true + var yynn2526 int + if yyr2526 || yy2arr2526 { r.EncodeArrayStart(8) } else { - yynn2377 = 1 - for _, b := range yyq2377 { + yynn2526 = 1 + for _, b := range yyq2526 { if b { - yynn2377++ + yynn2526++ } } - r.EncodeMapStart(yynn2377) - yynn2377 = 0 + r.EncodeMapStart(yynn2526) + yynn2526 = 0 } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[0] { + if yyq2526[0] { if x.Capacity == nil { r.EncodeNil() } else { @@ -30476,7 +32616,7 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2377[0] { + if yyq2526[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capacity")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -30487,9 +32627,9 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[1] { + if yyq2526[1] { if x.Allocatable == nil { r.EncodeNil() } else { @@ -30499,7 +32639,7 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2377[1] { + if yyq2526[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("allocatable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -30510,29 +32650,29 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[2] { + if yyq2526[2] { x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2377[2] { + if yyq2526[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Phase.CodecEncodeSelf(e) } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[3] { + if yyq2526[3] { if x.Conditions == nil { r.EncodeNil() } else { - yym2382 := z.EncBinary() - _ = yym2382 + yym2531 := z.EncBinary() + _ = yym2531 if false { } else { h.encSliceNodeCondition(([]NodeCondition)(x.Conditions), e) @@ -30542,15 +32682,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2377[3] { + if yyq2526[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym2383 := z.EncBinary() - _ = yym2383 + yym2532 := z.EncBinary() + _ = yym2532 if false { } else { h.encSliceNodeCondition(([]NodeCondition)(x.Conditions), e) @@ -30558,14 +32698,14 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[4] { + if yyq2526[4] { if x.Addresses == nil { r.EncodeNil() } else { - yym2385 := z.EncBinary() - _ = yym2385 + yym2534 := z.EncBinary() + _ = yym2534 if false { } else { h.encSliceNodeAddress(([]NodeAddress)(x.Addresses), e) @@ -30575,15 +32715,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2377[4] { + if yyq2526[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("addresses")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Addresses == nil { r.EncodeNil() } else { - yym2386 := z.EncBinary() - _ = yym2386 + yym2535 := z.EncBinary() + _ = yym2535 if false { } else { h.encSliceNodeAddress(([]NodeAddress)(x.Addresses), e) @@ -30591,47 +32731,47 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[5] { - yy2388 := &x.DaemonEndpoints - yy2388.CodecEncodeSelf(e) + if yyq2526[5] { + yy2537 := &x.DaemonEndpoints + yy2537.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2377[5] { + if yyq2526[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("daemonEndpoints")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2389 := &x.DaemonEndpoints - yy2389.CodecEncodeSelf(e) + yy2538 := &x.DaemonEndpoints + yy2538.CodecEncodeSelf(e) } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2377[6] { - yy2391 := &x.NodeInfo - yy2391.CodecEncodeSelf(e) + if yyq2526[6] { + yy2540 := &x.NodeInfo + yy2540.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2377[6] { + if yyq2526[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeInfo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2392 := &x.NodeInfo - yy2392.CodecEncodeSelf(e) + yy2541 := &x.NodeInfo + yy2541.CodecEncodeSelf(e) } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Images == nil { r.EncodeNil() } else { - yym2394 := z.EncBinary() - _ = yym2394 + yym2543 := z.EncBinary() + _ = yym2543 if false { } else { h.encSliceContainerImage(([]ContainerImage)(x.Images), e) @@ -30644,15 +32784,15 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x.Images == nil { r.EncodeNil() } else { - yym2395 := z.EncBinary() - _ = yym2395 + yym2544 := z.EncBinary() + _ = yym2544 if false { } else { h.encSliceContainerImage(([]ContainerImage)(x.Images), e) } } } - if yyr2377 || yy2arr2377 { + if yyr2526 || yy2arr2526 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -30665,25 +32805,25 @@ func (x *NodeStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2396 := z.DecBinary() - _ = yym2396 + yym2545 := z.DecBinary() + _ = yym2545 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2397 := r.ContainerType() - if yyct2397 == codecSelferValueTypeMap1234 { - yyl2397 := r.ReadMapStart() - if yyl2397 == 0 { + yyct2546 := r.ContainerType() + if yyct2546 == codecSelferValueTypeMap1234 { + yyl2546 := r.ReadMapStart() + if yyl2546 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2397, d) + x.codecDecodeSelfFromMap(yyl2546, d) } - } else if yyct2397 == codecSelferValueTypeArray1234 { - yyl2397 := r.ReadArrayStart() - if yyl2397 == 0 { + } else if yyct2546 == codecSelferValueTypeArray1234 { + yyl2546 := r.ReadArrayStart() + if yyl2546 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2397, d) + x.codecDecodeSelfFromArray(yyl2546, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -30695,12 +32835,12 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2398Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2398Slc - var yyhl2398 bool = l >= 0 - for yyj2398 := 0; ; yyj2398++ { - if yyhl2398 { - if yyj2398 >= l { + var yys2547Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2547Slc + var yyhl2547 bool = l >= 0 + for yyj2547 := 0; ; yyj2547++ { + if yyhl2547 { + if yyj2547 >= l { break } } else { @@ -30709,23 +32849,23 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2398Slc = r.DecodeBytes(yys2398Slc, true, true) - yys2398 := string(yys2398Slc) + yys2547Slc = r.DecodeBytes(yys2547Slc, true, true) + yys2547 := string(yys2547Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2398 { + switch yys2547 { case "capacity": if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2399 := &x.Capacity - yyv2399.CodecDecodeSelf(d) + yyv2548 := &x.Capacity + yyv2548.CodecDecodeSelf(d) } case "allocatable": if r.TryDecodeAsNil() { x.Allocatable = nil } else { - yyv2400 := &x.Allocatable - yyv2400.CodecDecodeSelf(d) + yyv2549 := &x.Allocatable + yyv2549.CodecDecodeSelf(d) } case "phase": if r.TryDecodeAsNil() { @@ -30737,56 +32877,56 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv2402 := &x.Conditions - yym2403 := z.DecBinary() - _ = yym2403 + yyv2551 := &x.Conditions + yym2552 := z.DecBinary() + _ = yym2552 if false { } else { - h.decSliceNodeCondition((*[]NodeCondition)(yyv2402), d) + h.decSliceNodeCondition((*[]NodeCondition)(yyv2551), d) } } case "addresses": if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2404 := &x.Addresses - yym2405 := z.DecBinary() - _ = yym2405 + yyv2553 := &x.Addresses + yym2554 := z.DecBinary() + _ = yym2554 if false { } else { - h.decSliceNodeAddress((*[]NodeAddress)(yyv2404), d) + h.decSliceNodeAddress((*[]NodeAddress)(yyv2553), d) } } case "daemonEndpoints": if r.TryDecodeAsNil() { x.DaemonEndpoints = NodeDaemonEndpoints{} } else { - yyv2406 := &x.DaemonEndpoints - yyv2406.CodecDecodeSelf(d) + yyv2555 := &x.DaemonEndpoints + yyv2555.CodecDecodeSelf(d) } case "nodeInfo": if r.TryDecodeAsNil() { x.NodeInfo = NodeSystemInfo{} } else { - yyv2407 := &x.NodeInfo - yyv2407.CodecDecodeSelf(d) + yyv2556 := &x.NodeInfo + yyv2556.CodecDecodeSelf(d) } case "images": if r.TryDecodeAsNil() { x.Images = nil } else { - yyv2408 := &x.Images - yym2409 := z.DecBinary() - _ = yym2409 + yyv2557 := &x.Images + yym2558 := z.DecBinary() + _ = yym2558 if false { } else { - h.decSliceContainerImage((*[]ContainerImage)(yyv2408), d) + h.decSliceContainerImage((*[]ContainerImage)(yyv2557), d) } } default: - z.DecStructFieldNotFound(-1, yys2398) - } // end switch yys2398 - } // end for yyj2398 + z.DecStructFieldNotFound(-1, yys2547) + } // end switch yys2547 + } // end for yyj2547 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -30794,16 +32934,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2410 int - var yyb2410 bool - var yyhl2410 bool = l >= 0 - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + var yyj2559 int + var yyb2559 bool + var yyhl2559 bool = l >= 0 + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30811,16 +32951,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Capacity = nil } else { - yyv2411 := &x.Capacity - yyv2411.CodecDecodeSelf(d) + yyv2560 := &x.Capacity + yyv2560.CodecDecodeSelf(d) } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30828,16 +32968,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Allocatable = nil } else { - yyv2412 := &x.Allocatable - yyv2412.CodecDecodeSelf(d) + yyv2561 := &x.Allocatable + yyv2561.CodecDecodeSelf(d) } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30847,13 +32987,13 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Phase = NodePhase(r.DecodeString()) } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30861,21 +33001,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv2414 := &x.Conditions - yym2415 := z.DecBinary() - _ = yym2415 + yyv2563 := &x.Conditions + yym2564 := z.DecBinary() + _ = yym2564 if false { } else { - h.decSliceNodeCondition((*[]NodeCondition)(yyv2414), d) + h.decSliceNodeCondition((*[]NodeCondition)(yyv2563), d) } } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30883,21 +33023,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Addresses = nil } else { - yyv2416 := &x.Addresses - yym2417 := z.DecBinary() - _ = yym2417 + yyv2565 := &x.Addresses + yym2566 := z.DecBinary() + _ = yym2566 if false { } else { - h.decSliceNodeAddress((*[]NodeAddress)(yyv2416), d) + h.decSliceNodeAddress((*[]NodeAddress)(yyv2565), d) } } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30905,16 +33045,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.DaemonEndpoints = NodeDaemonEndpoints{} } else { - yyv2418 := &x.DaemonEndpoints - yyv2418.CodecDecodeSelf(d) + yyv2567 := &x.DaemonEndpoints + yyv2567.CodecDecodeSelf(d) } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30922,16 +33062,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.NodeInfo = NodeSystemInfo{} } else { - yyv2419 := &x.NodeInfo - yyv2419.CodecDecodeSelf(d) + yyv2568 := &x.NodeInfo + yyv2568.CodecDecodeSelf(d) } - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -30939,26 +33079,26 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Images = nil } else { - yyv2420 := &x.Images - yym2421 := z.DecBinary() - _ = yym2421 + yyv2569 := &x.Images + yym2570 := z.DecBinary() + _ = yym2570 if false { } else { - h.decSliceContainerImage((*[]ContainerImage)(yyv2420), d) + h.decSliceContainerImage((*[]ContainerImage)(yyv2569), d) } } for { - yyj2410++ - if yyhl2410 { - yyb2410 = yyj2410 > l + yyj2559++ + if yyhl2559 { + yyb2559 = yyj2559 > l } else { - yyb2410 = r.CheckBreak() + yyb2559 = r.CheckBreak() } - if yyb2410 { + if yyb2559 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2410-1, "") + z.DecStructFieldNotFound(yyj2559-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -30970,37 +33110,37 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2422 := z.EncBinary() - _ = yym2422 + yym2571 := z.EncBinary() + _ = yym2571 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2423 := !z.EncBinary() - yy2arr2423 := z.EncBasicHandle().StructToArray - var yyq2423 [2]bool - _, _, _ = yysep2423, yyq2423, yy2arr2423 - const yyr2423 bool = false - yyq2423[1] = x.Size != 0 - var yynn2423 int - if yyr2423 || yy2arr2423 { + yysep2572 := !z.EncBinary() + yy2arr2572 := z.EncBasicHandle().StructToArray + var yyq2572 [2]bool + _, _, _ = yysep2572, yyq2572, yy2arr2572 + const yyr2572 bool = false + yyq2572[1] = x.Size != 0 + var yynn2572 int + if yyr2572 || yy2arr2572 { r.EncodeArrayStart(2) } else { - yynn2423 = 1 - for _, b := range yyq2423 { + yynn2572 = 1 + for _, b := range yyq2572 { if b { - yynn2423++ + yynn2572++ } } - r.EncodeMapStart(yynn2423) - yynn2423 = 0 + r.EncodeMapStart(yynn2572) + yynn2572 = 0 } - if yyr2423 || yy2arr2423 { + if yyr2572 || yy2arr2572 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.RepoTags == nil { r.EncodeNil() } else { - yym2425 := z.EncBinary() - _ = yym2425 + yym2574 := z.EncBinary() + _ = yym2574 if false { } else { z.F.EncSliceStringV(x.RepoTags, false, e) @@ -31013,19 +33153,19 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { if x.RepoTags == nil { r.EncodeNil() } else { - yym2426 := z.EncBinary() - _ = yym2426 + yym2575 := z.EncBinary() + _ = yym2575 if false { } else { z.F.EncSliceStringV(x.RepoTags, false, e) } } } - if yyr2423 || yy2arr2423 { + if yyr2572 || yy2arr2572 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2423[1] { - yym2428 := z.EncBinary() - _ = yym2428 + if yyq2572[1] { + yym2577 := z.EncBinary() + _ = yym2577 if false { } else { r.EncodeInt(int64(x.Size)) @@ -31034,19 +33174,19 @@ func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq2423[1] { + if yyq2572[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("size")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2429 := z.EncBinary() - _ = yym2429 + yym2578 := z.EncBinary() + _ = yym2578 if false { } else { r.EncodeInt(int64(x.Size)) } } } - if yyr2423 || yy2arr2423 { + if yyr2572 || yy2arr2572 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31059,25 +33199,25 @@ func (x *ContainerImage) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2430 := z.DecBinary() - _ = yym2430 + yym2579 := z.DecBinary() + _ = yym2579 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2431 := r.ContainerType() - if yyct2431 == codecSelferValueTypeMap1234 { - yyl2431 := r.ReadMapStart() - if yyl2431 == 0 { + yyct2580 := r.ContainerType() + if yyct2580 == codecSelferValueTypeMap1234 { + yyl2580 := r.ReadMapStart() + if yyl2580 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2431, d) + x.codecDecodeSelfFromMap(yyl2580, d) } - } else if yyct2431 == codecSelferValueTypeArray1234 { - yyl2431 := r.ReadArrayStart() - if yyl2431 == 0 { + } else if yyct2580 == codecSelferValueTypeArray1234 { + yyl2580 := r.ReadArrayStart() + if yyl2580 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2431, d) + x.codecDecodeSelfFromArray(yyl2580, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31089,12 +33229,12 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2432Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2432Slc - var yyhl2432 bool = l >= 0 - for yyj2432 := 0; ; yyj2432++ { - if yyhl2432 { - if yyj2432 >= l { + var yys2581Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2581Slc + var yyhl2581 bool = l >= 0 + for yyj2581 := 0; ; yyj2581++ { + if yyhl2581 { + if yyj2581 >= l { break } } else { @@ -31103,20 +33243,20 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2432Slc = r.DecodeBytes(yys2432Slc, true, true) - yys2432 := string(yys2432Slc) + yys2581Slc = r.DecodeBytes(yys2581Slc, true, true) + yys2581 := string(yys2581Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2432 { + switch yys2581 { case "repoTags": if r.TryDecodeAsNil() { x.RepoTags = nil } else { - yyv2433 := &x.RepoTags - yym2434 := z.DecBinary() - _ = yym2434 + yyv2582 := &x.RepoTags + yym2583 := z.DecBinary() + _ = yym2583 if false { } else { - z.F.DecSliceStringX(yyv2433, false, d) + z.F.DecSliceStringX(yyv2582, false, d) } } case "size": @@ -31126,9 +33266,9 @@ func (x *ContainerImage) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Size = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys2432) - } // end switch yys2432 - } // end for yyj2432 + z.DecStructFieldNotFound(-1, yys2581) + } // end switch yys2581 + } // end for yyj2581 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -31136,16 +33276,16 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2436 int - var yyb2436 bool - var yyhl2436 bool = l >= 0 - yyj2436++ - if yyhl2436 { - yyb2436 = yyj2436 > l + var yyj2585 int + var yyb2585 bool + var yyhl2585 bool = l >= 0 + yyj2585++ + if yyhl2585 { + yyb2585 = yyj2585 > l } else { - yyb2436 = r.CheckBreak() + yyb2585 = r.CheckBreak() } - if yyb2436 { + if yyb2585 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31153,21 +33293,21 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.RepoTags = nil } else { - yyv2437 := &x.RepoTags - yym2438 := z.DecBinary() - _ = yym2438 + yyv2586 := &x.RepoTags + yym2587 := z.DecBinary() + _ = yym2587 if false { } else { - z.F.DecSliceStringX(yyv2437, false, d) + z.F.DecSliceStringX(yyv2586, false, d) } } - yyj2436++ - if yyhl2436 { - yyb2436 = yyj2436 > l + yyj2585++ + if yyhl2585 { + yyb2585 = yyj2585 > l } else { - yyb2436 = r.CheckBreak() + yyb2585 = r.CheckBreak() } - if yyb2436 { + if yyb2585 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31178,17 +33318,17 @@ func (x *ContainerImage) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Size = int64(r.DecodeInt(64)) } for { - yyj2436++ - if yyhl2436 { - yyb2436 = yyj2436 > l + yyj2585++ + if yyhl2585 { + yyb2585 = yyj2585 > l } else { - yyb2436 = r.CheckBreak() + yyb2585 = r.CheckBreak() } - if yyb2436 { + if yyb2585 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2436-1, "") + z.DecStructFieldNotFound(yyj2585-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31197,8 +33337,8 @@ func (x NodePhase) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2440 := z.EncBinary() - _ = yym2440 + yym2589 := z.EncBinary() + _ = yym2589 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31210,8 +33350,8 @@ func (x *NodePhase) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2441 := z.DecBinary() - _ = yym2441 + yym2590 := z.DecBinary() + _ = yym2590 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31223,8 +33363,8 @@ func (x NodeConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2442 := z.EncBinary() - _ = yym2442 + yym2591 := z.EncBinary() + _ = yym2591 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31236,8 +33376,8 @@ func (x *NodeConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2443 := z.DecBinary() - _ = yym2443 + yym2592 := z.DecBinary() + _ = yym2592 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31252,34 +33392,34 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2444 := z.EncBinary() - _ = yym2444 + yym2593 := z.EncBinary() + _ = yym2593 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2445 := !z.EncBinary() - yy2arr2445 := z.EncBasicHandle().StructToArray - var yyq2445 [6]bool - _, _, _ = yysep2445, yyq2445, yy2arr2445 - const yyr2445 bool = false - yyq2445[2] = true - yyq2445[3] = true - yyq2445[4] = x.Reason != "" - yyq2445[5] = x.Message != "" - var yynn2445 int - if yyr2445 || yy2arr2445 { + yysep2594 := !z.EncBinary() + yy2arr2594 := z.EncBasicHandle().StructToArray + var yyq2594 [6]bool + _, _, _ = yysep2594, yyq2594, yy2arr2594 + const yyr2594 bool = false + yyq2594[2] = true + yyq2594[3] = true + yyq2594[4] = x.Reason != "" + yyq2594[5] = x.Message != "" + var yynn2594 int + if yyr2594 || yy2arr2594 { r.EncodeArrayStart(6) } else { - yynn2445 = 2 - for _, b := range yyq2445 { + yynn2594 = 2 + for _, b := range yyq2594 { if b { - yynn2445++ + yynn2594++ } } - r.EncodeMapStart(yynn2445) - yynn2445 = 0 + r.EncodeMapStart(yynn2594) + yynn2594 = 0 } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -31288,7 +33428,7 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -31297,85 +33437,85 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2445[2] { - yy2449 := &x.LastHeartbeatTime - yym2450 := z.EncBinary() - _ = yym2450 + if yyq2594[2] { + yy2598 := &x.LastHeartbeatTime + yym2599 := z.EncBinary() + _ = yym2599 if false { - } else if z.HasExtensions() && z.EncExt(yy2449) { - } else if yym2450 { - z.EncBinaryMarshal(yy2449) - } else if !yym2450 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2449) + } else if z.HasExtensions() && z.EncExt(yy2598) { + } else if yym2599 { + z.EncBinaryMarshal(yy2598) + } else if !yym2599 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2598) } else { - z.EncFallback(yy2449) + z.EncFallback(yy2598) } } else { r.EncodeNil() } } else { - if yyq2445[2] { + if yyq2594[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastHeartbeatTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2451 := &x.LastHeartbeatTime - yym2452 := z.EncBinary() - _ = yym2452 + yy2600 := &x.LastHeartbeatTime + yym2601 := z.EncBinary() + _ = yym2601 if false { - } else if z.HasExtensions() && z.EncExt(yy2451) { - } else if yym2452 { - z.EncBinaryMarshal(yy2451) - } else if !yym2452 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2451) + } else if z.HasExtensions() && z.EncExt(yy2600) { + } else if yym2601 { + z.EncBinaryMarshal(yy2600) + } else if !yym2601 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2600) } else { - z.EncFallback(yy2451) + z.EncFallback(yy2600) } } } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2445[3] { - yy2454 := &x.LastTransitionTime - yym2455 := z.EncBinary() - _ = yym2455 + if yyq2594[3] { + yy2603 := &x.LastTransitionTime + yym2604 := z.EncBinary() + _ = yym2604 if false { - } else if z.HasExtensions() && z.EncExt(yy2454) { - } else if yym2455 { - z.EncBinaryMarshal(yy2454) - } else if !yym2455 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2454) + } else if z.HasExtensions() && z.EncExt(yy2603) { + } else if yym2604 { + z.EncBinaryMarshal(yy2603) + } else if !yym2604 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2603) } else { - z.EncFallback(yy2454) + z.EncFallback(yy2603) } } else { r.EncodeNil() } } else { - if yyq2445[3] { + if yyq2594[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2456 := &x.LastTransitionTime - yym2457 := z.EncBinary() - _ = yym2457 + yy2605 := &x.LastTransitionTime + yym2606 := z.EncBinary() + _ = yym2606 if false { - } else if z.HasExtensions() && z.EncExt(yy2456) { - } else if yym2457 { - z.EncBinaryMarshal(yy2456) - } else if !yym2457 && z.IsJSONHandle() { - z.EncJSONMarshal(yy2456) + } else if z.HasExtensions() && z.EncExt(yy2605) { + } else if yym2606 { + z.EncBinaryMarshal(yy2605) + } else if !yym2606 && z.IsJSONHandle() { + z.EncJSONMarshal(yy2605) } else { - z.EncFallback(yy2456) + z.EncFallback(yy2605) } } } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2445[4] { - yym2459 := z.EncBinary() - _ = yym2459 + if yyq2594[4] { + yym2608 := z.EncBinary() + _ = yym2608 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -31384,23 +33524,23 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2445[4] { + if yyq2594[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2460 := z.EncBinary() - _ = yym2460 + yym2609 := z.EncBinary() + _ = yym2609 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2445[5] { - yym2462 := z.EncBinary() - _ = yym2462 + if yyq2594[5] { + yym2611 := z.EncBinary() + _ = yym2611 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -31409,19 +33549,19 @@ func (x *NodeCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2445[5] { + if yyq2594[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2463 := z.EncBinary() - _ = yym2463 + yym2612 := z.EncBinary() + _ = yym2612 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr2445 || yy2arr2445 { + if yyr2594 || yy2arr2594 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31434,25 +33574,25 @@ func (x *NodeCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2464 := z.DecBinary() - _ = yym2464 + yym2613 := z.DecBinary() + _ = yym2613 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2465 := r.ContainerType() - if yyct2465 == codecSelferValueTypeMap1234 { - yyl2465 := r.ReadMapStart() - if yyl2465 == 0 { + yyct2614 := r.ContainerType() + if yyct2614 == codecSelferValueTypeMap1234 { + yyl2614 := r.ReadMapStart() + if yyl2614 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2465, d) + x.codecDecodeSelfFromMap(yyl2614, d) } - } else if yyct2465 == codecSelferValueTypeArray1234 { - yyl2465 := r.ReadArrayStart() - if yyl2465 == 0 { + } else if yyct2614 == codecSelferValueTypeArray1234 { + yyl2614 := r.ReadArrayStart() + if yyl2614 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2465, d) + x.codecDecodeSelfFromArray(yyl2614, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31464,12 +33604,12 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2466Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2466Slc - var yyhl2466 bool = l >= 0 - for yyj2466 := 0; ; yyj2466++ { - if yyhl2466 { - if yyj2466 >= l { + var yys2615Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2615Slc + var yyhl2615 bool = l >= 0 + for yyj2615 := 0; ; yyj2615++ { + if yyhl2615 { + if yyj2615 >= l { break } } else { @@ -31478,10 +33618,10 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2466Slc = r.DecodeBytes(yys2466Slc, true, true) - yys2466 := string(yys2466Slc) + yys2615Slc = r.DecodeBytes(yys2615Slc, true, true) + yys2615 := string(yys2615Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2466 { + switch yys2615 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -31498,34 +33638,34 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastHeartbeatTime = pkg2_unversioned.Time{} } else { - yyv2469 := &x.LastHeartbeatTime - yym2470 := z.DecBinary() - _ = yym2470 + yyv2618 := &x.LastHeartbeatTime + yym2619 := z.DecBinary() + _ = yym2619 if false { - } else if z.HasExtensions() && z.DecExt(yyv2469) { - } else if yym2470 { - z.DecBinaryUnmarshal(yyv2469) - } else if !yym2470 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2469) + } else if z.HasExtensions() && z.DecExt(yyv2618) { + } else if yym2619 { + z.DecBinaryUnmarshal(yyv2618) + } else if !yym2619 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2618) } else { - z.DecFallback(yyv2469, false) + z.DecFallback(yyv2618, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv2471 := &x.LastTransitionTime - yym2472 := z.DecBinary() - _ = yym2472 + yyv2620 := &x.LastTransitionTime + yym2621 := z.DecBinary() + _ = yym2621 if false { - } else if z.HasExtensions() && z.DecExt(yyv2471) { - } else if yym2472 { - z.DecBinaryUnmarshal(yyv2471) - } else if !yym2472 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2471) + } else if z.HasExtensions() && z.DecExt(yyv2620) { + } else if yym2621 { + z.DecBinaryUnmarshal(yyv2620) + } else if !yym2621 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2620) } else { - z.DecFallback(yyv2471, false) + z.DecFallback(yyv2620, false) } } case "reason": @@ -31541,9 +33681,9 @@ func (x *NodeCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2466) - } // end switch yys2466 - } // end for yyj2466 + z.DecStructFieldNotFound(-1, yys2615) + } // end switch yys2615 + } // end for yyj2615 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -31551,16 +33691,16 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2475 int - var yyb2475 bool - var yyhl2475 bool = l >= 0 - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + var yyj2624 int + var yyb2624 bool + var yyhl2624 bool = l >= 0 + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31570,13 +33710,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = NodeConditionType(r.DecodeString()) } - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31586,13 +33726,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31600,26 +33740,26 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastHeartbeatTime = pkg2_unversioned.Time{} } else { - yyv2478 := &x.LastHeartbeatTime - yym2479 := z.DecBinary() - _ = yym2479 + yyv2627 := &x.LastHeartbeatTime + yym2628 := z.DecBinary() + _ = yym2628 if false { - } else if z.HasExtensions() && z.DecExt(yyv2478) { - } else if yym2479 { - z.DecBinaryUnmarshal(yyv2478) - } else if !yym2479 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2478) + } else if z.HasExtensions() && z.DecExt(yyv2627) { + } else if yym2628 { + z.DecBinaryUnmarshal(yyv2627) + } else if !yym2628 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2627) } else { - z.DecFallback(yyv2478, false) + z.DecFallback(yyv2627, false) } } - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31627,26 +33767,26 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg2_unversioned.Time{} } else { - yyv2480 := &x.LastTransitionTime - yym2481 := z.DecBinary() - _ = yym2481 + yyv2629 := &x.LastTransitionTime + yym2630 := z.DecBinary() + _ = yym2630 if false { - } else if z.HasExtensions() && z.DecExt(yyv2480) { - } else if yym2481 { - z.DecBinaryUnmarshal(yyv2480) - } else if !yym2481 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv2480) + } else if z.HasExtensions() && z.DecExt(yyv2629) { + } else if yym2630 { + z.DecBinaryUnmarshal(yyv2629) + } else if !yym2630 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv2629) } else { - z.DecFallback(yyv2480, false) + z.DecFallback(yyv2629, false) } } - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31656,13 +33796,13 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31673,17 +33813,17 @@ func (x *NodeCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj2475++ - if yyhl2475 { - yyb2475 = yyj2475 > l + yyj2624++ + if yyhl2624 { + yyb2624 = yyj2624 > l } else { - yyb2475 = r.CheckBreak() + yyb2624 = r.CheckBreak() } - if yyb2475 { + if yyb2624 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2475-1, "") + z.DecStructFieldNotFound(yyj2624-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31692,8 +33832,8 @@ func (x NodeAddressType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2484 := z.EncBinary() - _ = yym2484 + yym2633 := z.EncBinary() + _ = yym2633 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31705,8 +33845,8 @@ func (x *NodeAddressType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2485 := z.DecBinary() - _ = yym2485 + yym2634 := z.DecBinary() + _ = yym2634 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31721,30 +33861,30 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2486 := z.EncBinary() - _ = yym2486 + yym2635 := z.EncBinary() + _ = yym2635 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2487 := !z.EncBinary() - yy2arr2487 := z.EncBasicHandle().StructToArray - var yyq2487 [2]bool - _, _, _ = yysep2487, yyq2487, yy2arr2487 - const yyr2487 bool = false - var yynn2487 int - if yyr2487 || yy2arr2487 { + yysep2636 := !z.EncBinary() + yy2arr2636 := z.EncBasicHandle().StructToArray + var yyq2636 [2]bool + _, _, _ = yysep2636, yyq2636, yy2arr2636 + const yyr2636 bool = false + var yynn2636 int + if yyr2636 || yy2arr2636 { r.EncodeArrayStart(2) } else { - yynn2487 = 2 - for _, b := range yyq2487 { + yynn2636 = 2 + for _, b := range yyq2636 { if b { - yynn2487++ + yynn2636++ } } - r.EncodeMapStart(yynn2487) - yynn2487 = 0 + r.EncodeMapStart(yynn2636) + yynn2636 = 0 } - if yyr2487 || yy2arr2487 { + if yyr2636 || yy2arr2636 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -31753,10 +33893,10 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr2487 || yy2arr2487 { + if yyr2636 || yy2arr2636 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2490 := z.EncBinary() - _ = yym2490 + yym2639 := z.EncBinary() + _ = yym2639 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) @@ -31765,14 +33905,14 @@ func (x *NodeAddress) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("address")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2491 := z.EncBinary() - _ = yym2491 + yym2640 := z.EncBinary() + _ = yym2640 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) } } - if yyr2487 || yy2arr2487 { + if yyr2636 || yy2arr2636 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -31785,25 +33925,25 @@ func (x *NodeAddress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2492 := z.DecBinary() - _ = yym2492 + yym2641 := z.DecBinary() + _ = yym2641 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2493 := r.ContainerType() - if yyct2493 == codecSelferValueTypeMap1234 { - yyl2493 := r.ReadMapStart() - if yyl2493 == 0 { + yyct2642 := r.ContainerType() + if yyct2642 == codecSelferValueTypeMap1234 { + yyl2642 := r.ReadMapStart() + if yyl2642 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2493, d) + x.codecDecodeSelfFromMap(yyl2642, d) } - } else if yyct2493 == codecSelferValueTypeArray1234 { - yyl2493 := r.ReadArrayStart() - if yyl2493 == 0 { + } else if yyct2642 == codecSelferValueTypeArray1234 { + yyl2642 := r.ReadArrayStart() + if yyl2642 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2493, d) + x.codecDecodeSelfFromArray(yyl2642, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -31815,12 +33955,12 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2494Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2494Slc - var yyhl2494 bool = l >= 0 - for yyj2494 := 0; ; yyj2494++ { - if yyhl2494 { - if yyj2494 >= l { + var yys2643Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2643Slc + var yyhl2643 bool = l >= 0 + for yyj2643 := 0; ; yyj2643++ { + if yyhl2643 { + if yyj2643 >= l { break } } else { @@ -31829,10 +33969,10 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2494Slc = r.DecodeBytes(yys2494Slc, true, true) - yys2494 := string(yys2494Slc) + yys2643Slc = r.DecodeBytes(yys2643Slc, true, true) + yys2643 := string(yys2643Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2494 { + switch yys2643 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -31846,9 +33986,9 @@ func (x *NodeAddress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Address = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2494) - } // end switch yys2494 - } // end for yyj2494 + z.DecStructFieldNotFound(-1, yys2643) + } // end switch yys2643 + } // end for yyj2643 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -31856,16 +33996,16 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2497 int - var yyb2497 bool - var yyhl2497 bool = l >= 0 - yyj2497++ - if yyhl2497 { - yyb2497 = yyj2497 > l + var yyj2646 int + var yyb2646 bool + var yyhl2646 bool = l >= 0 + yyj2646++ + if yyhl2646 { + yyb2646 = yyj2646 > l } else { - yyb2497 = r.CheckBreak() + yyb2646 = r.CheckBreak() } - if yyb2497 { + if yyb2646 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31875,13 +34015,13 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = NodeAddressType(r.DecodeString()) } - yyj2497++ - if yyhl2497 { - yyb2497 = yyj2497 > l + yyj2646++ + if yyhl2646 { + yyb2646 = yyj2646 > l } else { - yyb2497 = r.CheckBreak() + yyb2646 = r.CheckBreak() } - if yyb2497 { + if yyb2646 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -31892,17 +34032,17 @@ func (x *NodeAddress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Address = string(r.DecodeString()) } for { - yyj2497++ - if yyhl2497 { - yyb2497 = yyj2497 > l + yyj2646++ + if yyhl2646 { + yyb2646 = yyj2646 > l } else { - yyb2497 = r.CheckBreak() + yyb2646 = r.CheckBreak() } - if yyb2497 { + if yyb2646 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2497-1, "") + z.DecStructFieldNotFound(yyj2646-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -31911,8 +34051,8 @@ func (x ResourceName) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym2500 := z.EncBinary() - _ = yym2500 + yym2649 := z.EncBinary() + _ = yym2649 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31924,8 +34064,8 @@ func (x *ResourceName) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2501 := z.DecBinary() - _ = yym2501 + yym2650 := z.DecBinary() + _ = yym2650 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31940,8 +34080,8 @@ func (x ResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2502 := z.EncBinary() - _ = yym2502 + yym2651 := z.EncBinary() + _ = yym2651 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -31954,8 +34094,8 @@ func (x *ResourceList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2503 := z.DecBinary() - _ = yym2503 + yym2652 := z.DecBinary() + _ = yym2652 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -31970,136 +34110,136 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2504 := z.EncBinary() - _ = yym2504 + yym2653 := z.EncBinary() + _ = yym2653 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2505 := !z.EncBinary() - yy2arr2505 := z.EncBasicHandle().StructToArray - var yyq2505 [5]bool - _, _, _ = yysep2505, yyq2505, yy2arr2505 - const yyr2505 bool = false - yyq2505[0] = x.Kind != "" - yyq2505[1] = x.APIVersion != "" - yyq2505[2] = true - yyq2505[3] = true - yyq2505[4] = true - var yynn2505 int - if yyr2505 || yy2arr2505 { + yysep2654 := !z.EncBinary() + yy2arr2654 := z.EncBasicHandle().StructToArray + var yyq2654 [5]bool + _, _, _ = yysep2654, yyq2654, yy2arr2654 + const yyr2654 bool = false + yyq2654[0] = true + yyq2654[1] = true + yyq2654[2] = true + yyq2654[3] = x.Kind != "" + yyq2654[4] = x.APIVersion != "" + var yynn2654 int + if yyr2654 || yy2arr2654 { r.EncodeArrayStart(5) } else { - yynn2505 = 0 - for _, b := range yyq2505 { + yynn2654 = 0 + for _, b := range yyq2654 { if b { - yynn2505++ + yynn2654++ } } - r.EncodeMapStart(yynn2505) - yynn2505 = 0 + r.EncodeMapStart(yynn2654) + yynn2654 = 0 } - if yyr2505 || yy2arr2505 { + if yyr2654 || yy2arr2654 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2505[0] { - yym2507 := z.EncBinary() - _ = yym2507 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2505[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2508 := z.EncBinary() - _ = yym2508 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2505 || yy2arr2505 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2505[1] { - yym2510 := z.EncBinary() - _ = yym2510 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2505[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2511 := z.EncBinary() - _ = yym2511 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2505 || yy2arr2505 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2505[2] { - yy2513 := &x.ObjectMeta - yy2513.CodecEncodeSelf(e) + if yyq2654[0] { + yy2656 := &x.ObjectMeta + yy2656.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2505[2] { + if yyq2654[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2514 := &x.ObjectMeta - yy2514.CodecEncodeSelf(e) + yy2657 := &x.ObjectMeta + yy2657.CodecEncodeSelf(e) } } - if yyr2505 || yy2arr2505 { + if yyr2654 || yy2arr2654 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2505[3] { - yy2516 := &x.Spec - yy2516.CodecEncodeSelf(e) + if yyq2654[1] { + yy2659 := &x.Spec + yy2659.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2505[3] { + if yyq2654[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2517 := &x.Spec - yy2517.CodecEncodeSelf(e) + yy2660 := &x.Spec + yy2660.CodecEncodeSelf(e) } } - if yyr2505 || yy2arr2505 { + if yyr2654 || yy2arr2654 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2505[4] { - yy2519 := &x.Status - yy2519.CodecEncodeSelf(e) + if yyq2654[2] { + yy2662 := &x.Status + yy2662.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2505[4] { + if yyq2654[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2520 := &x.Status - yy2520.CodecEncodeSelf(e) + yy2663 := &x.Status + yy2663.CodecEncodeSelf(e) } } - if yyr2505 || yy2arr2505 { + if yyr2654 || yy2arr2654 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2654[3] { + yym2665 := z.EncBinary() + _ = yym2665 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2654[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2666 := z.EncBinary() + _ = yym2666 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2654 || yy2arr2654 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2654[4] { + yym2668 := z.EncBinary() + _ = yym2668 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2654[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2669 := z.EncBinary() + _ = yym2669 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2654 || yy2arr2654 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -32109,1755 +34249,6 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2521 := z.DecBinary() - _ = yym2521 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2522 := r.ContainerType() - if yyct2522 == codecSelferValueTypeMap1234 { - yyl2522 := r.ReadMapStart() - if yyl2522 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2522, d) - } - } else if yyct2522 == codecSelferValueTypeArray1234 { - yyl2522 := r.ReadArrayStart() - if yyl2522 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2522, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2523Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2523Slc - var yyhl2523 bool = l >= 0 - for yyj2523 := 0; ; yyj2523++ { - if yyhl2523 { - if yyj2523 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2523Slc = r.DecodeBytes(yys2523Slc, true, true) - yys2523 := string(yys2523Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2523 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2526 := &x.ObjectMeta - yyv2526.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = NodeSpec{} - } else { - yyv2527 := &x.Spec - yyv2527.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = NodeStatus{} - } else { - yyv2528 := &x.Status - yyv2528.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys2523) - } // end switch yys2523 - } // end for yyj2523 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2529 int - var yyb2529 bool - var yyhl2529 bool = l >= 0 - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2532 := &x.ObjectMeta - yyv2532.CodecDecodeSelf(d) - } - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = NodeSpec{} - } else { - yyv2533 := &x.Spec - yyv2533.CodecDecodeSelf(d) - } - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = NodeStatus{} - } else { - yyv2534 := &x.Status - yyv2534.CodecDecodeSelf(d) - } - for { - yyj2529++ - if yyhl2529 { - yyb2529 = yyj2529 > l - } else { - yyb2529 = r.CheckBreak() - } - if yyb2529 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2529-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NodeList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2535 := z.EncBinary() - _ = yym2535 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2536 := !z.EncBinary() - yy2arr2536 := z.EncBasicHandle().StructToArray - var yyq2536 [4]bool - _, _, _ = yysep2536, yyq2536, yy2arr2536 - const yyr2536 bool = false - yyq2536[0] = x.Kind != "" - yyq2536[1] = x.APIVersion != "" - yyq2536[2] = true - var yynn2536 int - if yyr2536 || yy2arr2536 { - r.EncodeArrayStart(4) - } else { - yynn2536 = 1 - for _, b := range yyq2536 { - if b { - yynn2536++ - } - } - r.EncodeMapStart(yynn2536) - yynn2536 = 0 - } - if yyr2536 || yy2arr2536 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2536[0] { - yym2538 := z.EncBinary() - _ = yym2538 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2536[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2539 := z.EncBinary() - _ = yym2539 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2536 || yy2arr2536 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2536[1] { - yym2541 := z.EncBinary() - _ = yym2541 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2536[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2542 := z.EncBinary() - _ = yym2542 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2536 || yy2arr2536 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2536[2] { - yy2544 := &x.ListMeta - yym2545 := z.EncBinary() - _ = yym2545 - if false { - } else if z.HasExtensions() && z.EncExt(yy2544) { - } else { - z.EncFallback(yy2544) - } - } else { - r.EncodeNil() - } - } else { - if yyq2536[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2546 := &x.ListMeta - yym2547 := z.EncBinary() - _ = yym2547 - if false { - } else if z.HasExtensions() && z.EncExt(yy2546) { - } else { - z.EncFallback(yy2546) - } - } - } - if yyr2536 || yy2arr2536 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2549 := z.EncBinary() - _ = yym2549 - if false { - } else { - h.encSliceNode(([]Node)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2550 := z.EncBinary() - _ = yym2550 - if false { - } else { - h.encSliceNode(([]Node)(x.Items), e) - } - } - } - if yyr2536 || yy2arr2536 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NodeList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2551 := z.DecBinary() - _ = yym2551 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2552 := r.ContainerType() - if yyct2552 == codecSelferValueTypeMap1234 { - yyl2552 := r.ReadMapStart() - if yyl2552 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2552, d) - } - } else if yyct2552 == codecSelferValueTypeArray1234 { - yyl2552 := r.ReadArrayStart() - if yyl2552 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2552, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NodeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2553Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2553Slc - var yyhl2553 bool = l >= 0 - for yyj2553 := 0; ; yyj2553++ { - if yyhl2553 { - if yyj2553 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2553Slc = r.DecodeBytes(yys2553Slc, true, true) - yys2553 := string(yys2553Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2553 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2556 := &x.ListMeta - yym2557 := z.DecBinary() - _ = yym2557 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2556) { - } else { - z.DecFallback(yyv2556, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2558 := &x.Items - yym2559 := z.DecBinary() - _ = yym2559 - if false { - } else { - h.decSliceNode((*[]Node)(yyv2558), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2553) - } // end switch yys2553 - } // end for yyj2553 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NodeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2560 int - var yyb2560 bool - var yyhl2560 bool = l >= 0 - yyj2560++ - if yyhl2560 { - yyb2560 = yyj2560 > l - } else { - yyb2560 = r.CheckBreak() - } - if yyb2560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2560++ - if yyhl2560 { - yyb2560 = yyj2560 > l - } else { - yyb2560 = r.CheckBreak() - } - if yyb2560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2560++ - if yyhl2560 { - yyb2560 = yyj2560 > l - } else { - yyb2560 = r.CheckBreak() - } - if yyb2560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2563 := &x.ListMeta - yym2564 := z.DecBinary() - _ = yym2564 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2563) { - } else { - z.DecFallback(yyv2563, false) - } - } - yyj2560++ - if yyhl2560 { - yyb2560 = yyj2560 > l - } else { - yyb2560 = r.CheckBreak() - } - if yyb2560 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2565 := &x.Items - yym2566 := z.DecBinary() - _ = yym2566 - if false { - } else { - h.decSliceNode((*[]Node)(yyv2565), d) - } - } - for { - yyj2560++ - if yyhl2560 { - yyb2560 = yyj2560 > l - } else { - yyb2560 = r.CheckBreak() - } - if yyb2560 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2560-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x FinalizerName) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym2567 := z.EncBinary() - _ = yym2567 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *FinalizerName) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2568 := z.DecBinary() - _ = yym2568 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *NamespaceSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2569 := z.EncBinary() - _ = yym2569 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2570 := !z.EncBinary() - yy2arr2570 := z.EncBasicHandle().StructToArray - var yyq2570 [1]bool - _, _, _ = yysep2570, yyq2570, yy2arr2570 - const yyr2570 bool = false - yyq2570[0] = len(x.Finalizers) != 0 - var yynn2570 int - if yyr2570 || yy2arr2570 { - r.EncodeArrayStart(1) - } else { - yynn2570 = 0 - for _, b := range yyq2570 { - if b { - yynn2570++ - } - } - r.EncodeMapStart(yynn2570) - yynn2570 = 0 - } - if yyr2570 || yy2arr2570 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2570[0] { - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym2572 := z.EncBinary() - _ = yym2572 - if false { - } else { - h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2570[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("finalizers")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym2573 := z.EncBinary() - _ = yym2573 - if false { - } else { - h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) - } - } - } - } - if yyr2570 || yy2arr2570 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2574 := z.DecBinary() - _ = yym2574 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2575 := r.ContainerType() - if yyct2575 == codecSelferValueTypeMap1234 { - yyl2575 := r.ReadMapStart() - if yyl2575 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2575, d) - } - } else if yyct2575 == codecSelferValueTypeArray1234 { - yyl2575 := r.ReadArrayStart() - if yyl2575 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2575, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2576Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2576Slc - var yyhl2576 bool = l >= 0 - for yyj2576 := 0; ; yyj2576++ { - if yyhl2576 { - if yyj2576 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2576Slc = r.DecodeBytes(yys2576Slc, true, true) - yys2576 := string(yys2576Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2576 { - case "finalizers": - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv2577 := &x.Finalizers - yym2578 := z.DecBinary() - _ = yym2578 - if false { - } else { - h.decSliceFinalizerName((*[]FinalizerName)(yyv2577), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2576) - } // end switch yys2576 - } // end for yyj2576 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2579 int - var yyb2579 bool - var yyhl2579 bool = l >= 0 - yyj2579++ - if yyhl2579 { - yyb2579 = yyj2579 > l - } else { - yyb2579 = r.CheckBreak() - } - if yyb2579 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv2580 := &x.Finalizers - yym2581 := z.DecBinary() - _ = yym2581 - if false { - } else { - h.decSliceFinalizerName((*[]FinalizerName)(yyv2580), d) - } - } - for { - yyj2579++ - if yyhl2579 { - yyb2579 = yyj2579 > l - } else { - yyb2579 = r.CheckBreak() - } - if yyb2579 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2579-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NamespaceStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2582 := z.EncBinary() - _ = yym2582 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2583 := !z.EncBinary() - yy2arr2583 := z.EncBasicHandle().StructToArray - var yyq2583 [1]bool - _, _, _ = yysep2583, yyq2583, yy2arr2583 - const yyr2583 bool = false - yyq2583[0] = x.Phase != "" - var yynn2583 int - if yyr2583 || yy2arr2583 { - r.EncodeArrayStart(1) - } else { - yynn2583 = 0 - for _, b := range yyq2583 { - if b { - yynn2583++ - } - } - r.EncodeMapStart(yynn2583) - yynn2583 = 0 - } - if yyr2583 || yy2arr2583 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2583[0] { - x.Phase.CodecEncodeSelf(e) - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2583[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("phase")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Phase.CodecEncodeSelf(e) - } - } - if yyr2583 || yy2arr2583 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2585 := z.DecBinary() - _ = yym2585 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2586 := r.ContainerType() - if yyct2586 == codecSelferValueTypeMap1234 { - yyl2586 := r.ReadMapStart() - if yyl2586 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2586, d) - } - } else if yyct2586 == codecSelferValueTypeArray1234 { - yyl2586 := r.ReadArrayStart() - if yyl2586 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2586, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2587Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2587Slc - var yyhl2587 bool = l >= 0 - for yyj2587 := 0; ; yyj2587++ { - if yyhl2587 { - if yyj2587 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2587Slc = r.DecodeBytes(yys2587Slc, true, true) - yys2587 := string(yys2587Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2587 { - case "phase": - if r.TryDecodeAsNil() { - x.Phase = "" - } else { - x.Phase = NamespacePhase(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys2587) - } // end switch yys2587 - } // end for yyj2587 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2589 int - var yyb2589 bool - var yyhl2589 bool = l >= 0 - yyj2589++ - if yyhl2589 { - yyb2589 = yyj2589 > l - } else { - yyb2589 = r.CheckBreak() - } - if yyb2589 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Phase = "" - } else { - x.Phase = NamespacePhase(r.DecodeString()) - } - for { - yyj2589++ - if yyhl2589 { - yyb2589 = yyj2589 > l - } else { - yyb2589 = r.CheckBreak() - } - if yyb2589 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2589-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x NamespacePhase) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym2591 := z.EncBinary() - _ = yym2591 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *NamespacePhase) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2592 := z.DecBinary() - _ = yym2592 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *Namespace) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2593 := z.EncBinary() - _ = yym2593 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2594 := !z.EncBinary() - yy2arr2594 := z.EncBasicHandle().StructToArray - var yyq2594 [5]bool - _, _, _ = yysep2594, yyq2594, yy2arr2594 - const yyr2594 bool = false - yyq2594[0] = x.Kind != "" - yyq2594[1] = x.APIVersion != "" - yyq2594[2] = true - yyq2594[3] = true - yyq2594[4] = true - var yynn2594 int - if yyr2594 || yy2arr2594 { - r.EncodeArrayStart(5) - } else { - yynn2594 = 0 - for _, b := range yyq2594 { - if b { - yynn2594++ - } - } - r.EncodeMapStart(yynn2594) - yynn2594 = 0 - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2594[0] { - yym2596 := z.EncBinary() - _ = yym2596 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2594[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2597 := z.EncBinary() - _ = yym2597 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2594[1] { - yym2599 := z.EncBinary() - _ = yym2599 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2594[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2600 := z.EncBinary() - _ = yym2600 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2594[2] { - yy2602 := &x.ObjectMeta - yy2602.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2594[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2603 := &x.ObjectMeta - yy2603.CodecEncodeSelf(e) - } - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2594[3] { - yy2605 := &x.Spec - yy2605.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2594[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2606 := &x.Spec - yy2606.CodecEncodeSelf(e) - } - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2594[4] { - yy2608 := &x.Status - yy2608.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2594[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2609 := &x.Status - yy2609.CodecEncodeSelf(e) - } - } - if yyr2594 || yy2arr2594 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Namespace) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2610 := z.DecBinary() - _ = yym2610 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2611 := r.ContainerType() - if yyct2611 == codecSelferValueTypeMap1234 { - yyl2611 := r.ReadMapStart() - if yyl2611 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2611, d) - } - } else if yyct2611 == codecSelferValueTypeArray1234 { - yyl2611 := r.ReadArrayStart() - if yyl2611 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2611, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Namespace) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2612Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2612Slc - var yyhl2612 bool = l >= 0 - for yyj2612 := 0; ; yyj2612++ { - if yyhl2612 { - if yyj2612 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2612Slc = r.DecodeBytes(yys2612Slc, true, true) - yys2612 := string(yys2612Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2612 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2615 := &x.ObjectMeta - yyv2615.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = NamespaceSpec{} - } else { - yyv2616 := &x.Spec - yyv2616.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = NamespaceStatus{} - } else { - yyv2617 := &x.Status - yyv2617.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys2612) - } // end switch yys2612 - } // end for yyj2612 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Namespace) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2618 int - var yyb2618 bool - var yyhl2618 bool = l >= 0 - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2621 := &x.ObjectMeta - yyv2621.CodecDecodeSelf(d) - } - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = NamespaceSpec{} - } else { - yyv2622 := &x.Spec - yyv2622.CodecDecodeSelf(d) - } - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = NamespaceStatus{} - } else { - yyv2623 := &x.Status - yyv2623.CodecDecodeSelf(d) - } - for { - yyj2618++ - if yyhl2618 { - yyb2618 = yyj2618 > l - } else { - yyb2618 = r.CheckBreak() - } - if yyb2618 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2618-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *NamespaceList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2624 := z.EncBinary() - _ = yym2624 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2625 := !z.EncBinary() - yy2arr2625 := z.EncBasicHandle().StructToArray - var yyq2625 [4]bool - _, _, _ = yysep2625, yyq2625, yy2arr2625 - const yyr2625 bool = false - yyq2625[0] = x.Kind != "" - yyq2625[1] = x.APIVersion != "" - yyq2625[2] = true - var yynn2625 int - if yyr2625 || yy2arr2625 { - r.EncodeArrayStart(4) - } else { - yynn2625 = 1 - for _, b := range yyq2625 { - if b { - yynn2625++ - } - } - r.EncodeMapStart(yynn2625) - yynn2625 = 0 - } - if yyr2625 || yy2arr2625 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2625[0] { - yym2627 := z.EncBinary() - _ = yym2627 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2625[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2628 := z.EncBinary() - _ = yym2628 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2625 || yy2arr2625 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2625[1] { - yym2630 := z.EncBinary() - _ = yym2630 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2625[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2631 := z.EncBinary() - _ = yym2631 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2625 || yy2arr2625 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2625[2] { - yy2633 := &x.ListMeta - yym2634 := z.EncBinary() - _ = yym2634 - if false { - } else if z.HasExtensions() && z.EncExt(yy2633) { - } else { - z.EncFallback(yy2633) - } - } else { - r.EncodeNil() - } - } else { - if yyq2625[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2635 := &x.ListMeta - yym2636 := z.EncBinary() - _ = yym2636 - if false { - } else if z.HasExtensions() && z.EncExt(yy2635) { - } else { - z.EncFallback(yy2635) - } - } - } - if yyr2625 || yy2arr2625 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2638 := z.EncBinary() - _ = yym2638 - if false { - } else { - h.encSliceNamespace(([]Namespace)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym2639 := z.EncBinary() - _ = yym2639 - if false { - } else { - h.encSliceNamespace(([]Namespace)(x.Items), e) - } - } - } - if yyr2625 || yy2arr2625 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *NamespaceList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2640 := z.DecBinary() - _ = yym2640 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2641 := r.ContainerType() - if yyct2641 == codecSelferValueTypeMap1234 { - yyl2641 := r.ReadMapStart() - if yyl2641 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2641, d) - } - } else if yyct2641 == codecSelferValueTypeArray1234 { - yyl2641 := r.ReadArrayStart() - if yyl2641 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2641, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *NamespaceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2642Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2642Slc - var yyhl2642 bool = l >= 0 - for yyj2642 := 0; ; yyj2642++ { - if yyhl2642 { - if yyj2642 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2642Slc = r.DecodeBytes(yys2642Slc, true, true) - yys2642 := string(yys2642Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2642 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2645 := &x.ListMeta - yym2646 := z.DecBinary() - _ = yym2646 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2645) { - } else { - z.DecFallback(yyv2645, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2647 := &x.Items - yym2648 := z.DecBinary() - _ = yym2648 - if false { - } else { - h.decSliceNamespace((*[]Namespace)(yyv2647), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys2642) - } // end switch yys2642 - } // end for yyj2642 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *NamespaceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2649 int - var yyb2649 bool - var yyhl2649 bool = l >= 0 - yyj2649++ - if yyhl2649 { - yyb2649 = yyj2649 > l - } else { - yyb2649 = r.CheckBreak() - } - if yyb2649 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2649++ - if yyhl2649 { - yyb2649 = yyj2649 > l - } else { - yyb2649 = r.CheckBreak() - } - if yyb2649 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2649++ - if yyhl2649 { - yyb2649 = yyj2649 > l - } else { - yyb2649 = r.CheckBreak() - } - if yyb2649 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv2652 := &x.ListMeta - yym2653 := z.DecBinary() - _ = yym2653 - if false { - } else if z.HasExtensions() && z.DecExt(yyv2652) { - } else { - z.DecFallback(yyv2652, false) - } - } - yyj2649++ - if yyhl2649 { - yyb2649 = yyj2649 > l - } else { - yyb2649 = r.CheckBreak() - } - if yyb2649 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv2654 := &x.Items - yym2655 := z.DecBinary() - _ = yym2655 - if false { - } else { - h.decSliceNamespace((*[]Namespace)(yyv2654), d) - } - } - for { - yyj2649++ - if yyhl2649 { - yyb2649 = yyj2649 > l - } else { - yyb2649 = r.CheckBreak() - } - if yyb2649 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2649-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Binding) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2656 := z.EncBinary() - _ = yym2656 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2657 := !z.EncBinary() - yy2arr2657 := z.EncBasicHandle().StructToArray - var yyq2657 [4]bool - _, _, _ = yysep2657, yyq2657, yy2arr2657 - const yyr2657 bool = false - yyq2657[0] = x.Kind != "" - yyq2657[1] = x.APIVersion != "" - yyq2657[2] = true - var yynn2657 int - if yyr2657 || yy2arr2657 { - r.EncodeArrayStart(4) - } else { - yynn2657 = 1 - for _, b := range yyq2657 { - if b { - yynn2657++ - } - } - r.EncodeMapStart(yynn2657) - yynn2657 = 0 - } - if yyr2657 || yy2arr2657 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2657[0] { - yym2659 := z.EncBinary() - _ = yym2659 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2657[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2660 := z.EncBinary() - _ = yym2660 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2657 || yy2arr2657 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2657[1] { - yym2662 := z.EncBinary() - _ = yym2662 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2657[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2663 := z.EncBinary() - _ = yym2663 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2657 || yy2arr2657 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2657[2] { - yy2665 := &x.ObjectMeta - yy2665.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2657[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2666 := &x.ObjectMeta - yy2666.CodecEncodeSelf(e) - } - } - if yyr2657 || yy2arr2657 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy2668 := &x.Target - yy2668.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("target")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy2669 := &x.Target - yy2669.CodecEncodeSelf(e) - } - if yyr2657 || yy2arr2657 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -33887,7 +34278,7 @@ func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -33909,6 +34300,27 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys2672 := string(yys2672Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys2672 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2673 := &x.ObjectMeta + yyv2673.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = NodeSpec{} + } else { + yyv2674 := &x.Spec + yyv2674.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = NodeStatus{} + } else { + yyv2675 := &x.Status + yyv2675.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -33921,20 +34333,6 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv2675 := &x.ObjectMeta - yyv2675.CodecDecodeSelf(d) - } - case "target": - if r.TryDecodeAsNil() { - x.Target = ObjectReference{} - } else { - yyv2676 := &x.Target - yyv2676.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys2672) } // end switch yys2672 @@ -33942,52 +34340,20 @@ func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2677 int - var yyb2677 bool - var yyhl2677 bool = l >= 0 - yyj2677++ - if yyhl2677 { - yyb2677 = yyj2677 > l + var yyj2678 int + var yyb2678 bool + var yyhl2678 bool = l >= 0 + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l } else { - yyb2677 = r.CheckBreak() + yyb2678 = r.CheckBreak() } - if yyb2677 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2677++ - if yyhl2677 { - yyb2677 = yyj2677 > l - } else { - yyb2677 = r.CheckBreak() - } - if yyb2677 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2677++ - if yyhl2677 { - yyb2677 = yyj2677 > l - } else { - yyb2677 = r.CheckBreak() - } - if yyb2677 { + if yyb2678 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -33995,263 +34361,50 @@ func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv2680 := &x.ObjectMeta - yyv2680.CodecDecodeSelf(d) + yyv2679 := &x.ObjectMeta + yyv2679.CodecDecodeSelf(d) } - yyj2677++ - if yyhl2677 { - yyb2677 = yyj2677 > l + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l } else { - yyb2677 = r.CheckBreak() + yyb2678 = r.CheckBreak() } - if yyb2677 { + if yyb2678 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Target = ObjectReference{} + x.Spec = NodeSpec{} } else { - yyv2681 := &x.Target + yyv2680 := &x.Spec + yyv2680.CodecDecodeSelf(d) + } + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l + } else { + yyb2678 = r.CheckBreak() + } + if yyb2678 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = NodeStatus{} + } else { + yyv2681 := &x.Status yyv2681.CodecDecodeSelf(d) } - for { - yyj2677++ - if yyhl2677 { - yyb2677 = yyj2677 > l - } else { - yyb2677 = r.CheckBreak() - } - if yyb2677 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2677-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l } else { - yym2682 := z.EncBinary() - _ = yym2682 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2683 := !z.EncBinary() - yy2arr2683 := z.EncBasicHandle().StructToArray - var yyq2683 [3]bool - _, _, _ = yysep2683, yyq2683, yy2arr2683 - const yyr2683 bool = false - yyq2683[0] = x.Kind != "" - yyq2683[1] = x.APIVersion != "" - var yynn2683 int - if yyr2683 || yy2arr2683 { - r.EncodeArrayStart(3) - } else { - yynn2683 = 1 - for _, b := range yyq2683 { - if b { - yynn2683++ - } - } - r.EncodeMapStart(yynn2683) - yynn2683 = 0 - } - if yyr2683 || yy2arr2683 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2683[0] { - yym2685 := z.EncBinary() - _ = yym2685 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2683[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2686 := z.EncBinary() - _ = yym2686 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2683 || yy2arr2683 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2683[1] { - yym2688 := z.EncBinary() - _ = yym2688 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2683[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2689 := z.EncBinary() - _ = yym2689 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2683 || yy2arr2683 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.GracePeriodSeconds == nil { - r.EncodeNil() - } else { - yy2691 := *x.GracePeriodSeconds - yym2692 := z.EncBinary() - _ = yym2692 - if false { - } else { - r.EncodeInt(int64(yy2691)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("gracePeriodSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.GracePeriodSeconds == nil { - r.EncodeNil() - } else { - yy2693 := *x.GracePeriodSeconds - yym2694 := z.EncBinary() - _ = yym2694 - if false { - } else { - r.EncodeInt(int64(yy2693)) - } - } - } - if yyr2683 || yy2arr2683 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } + yyb2678 = r.CheckBreak() } -} - -func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2695 := z.DecBinary() - _ = yym2695 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2696 := r.ContainerType() - if yyct2696 == codecSelferValueTypeMap1234 { - yyl2696 := r.ReadMapStart() - if yyl2696 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2696, d) - } - } else if yyct2696 == codecSelferValueTypeArray1234 { - yyl2696 := r.ReadArrayStart() - if yyl2696 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2696, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2697Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2697Slc - var yyhl2697 bool = l >= 0 - for yyj2697 := 0; ; yyj2697++ { - if yyhl2697 { - if yyj2697 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2697Slc = r.DecodeBytes(yys2697Slc, true, true) - yys2697 := string(yys2697Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2697 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "gracePeriodSeconds": - if r.TryDecodeAsNil() { - if x.GracePeriodSeconds != nil { - x.GracePeriodSeconds = nil - } - } else { - if x.GracePeriodSeconds == nil { - x.GracePeriodSeconds = new(int64) - } - yym2701 := z.DecBinary() - _ = yym2701 - if false { - } else { - *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys2697) - } // end switch yys2697 - } // end for yyj2697 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2702 int - var yyb2702 bool - var yyhl2702 bool = l >= 0 - yyj2702++ - if yyhl2702 { - yyb2702 = yyj2702 > l - } else { - yyb2702 = r.CheckBreak() - } - if yyb2702 { + if yyb2678 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34261,13 +34414,13 @@ func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj2702++ - if yyhl2702 { - yyb2702 = yyj2702 > l + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l } else { - yyb2702 = r.CheckBreak() + yyb2678 = r.CheckBreak() } - if yyb2702 { + if yyb2678 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -34277,85 +34430,116 @@ func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj2702++ - if yyhl2702 { - yyb2702 = yyj2702 > l - } else { - yyb2702 = r.CheckBreak() - } - if yyb2702 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.GracePeriodSeconds != nil { - x.GracePeriodSeconds = nil - } - } else { - if x.GracePeriodSeconds == nil { - x.GracePeriodSeconds = new(int64) - } - yym2706 := z.DecBinary() - _ = yym2706 - if false { - } else { - *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } for { - yyj2702++ - if yyhl2702 { - yyb2702 = yyj2702 > l + yyj2678++ + if yyhl2678 { + yyb2678 = yyj2678 > l } else { - yyb2702 = r.CheckBreak() + yyb2678 = r.CheckBreak() } - if yyb2702 { + if yyb2678 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2702-1, "") + z.DecStructFieldNotFound(yyj2678-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *NodeList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym2707 := z.EncBinary() - _ = yym2707 + yym2684 := z.EncBinary() + _ = yym2684 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2708 := !z.EncBinary() - yy2arr2708 := z.EncBasicHandle().StructToArray - var yyq2708 [4]bool - _, _, _ = yysep2708, yyq2708, yy2arr2708 - const yyr2708 bool = false - yyq2708[0] = x.Kind != "" - yyq2708[1] = x.APIVersion != "" - var yynn2708 int - if yyr2708 || yy2arr2708 { + yysep2685 := !z.EncBinary() + yy2arr2685 := z.EncBasicHandle().StructToArray + var yyq2685 [4]bool + _, _, _ = yysep2685, yyq2685, yy2arr2685 + const yyr2685 bool = false + yyq2685[0] = true + yyq2685[2] = x.Kind != "" + yyq2685[3] = x.APIVersion != "" + var yynn2685 int + if yyr2685 || yy2arr2685 { r.EncodeArrayStart(4) } else { - yynn2708 = 2 - for _, b := range yyq2708 { + yynn2685 = 1 + for _, b := range yyq2685 { if b { - yynn2708++ + yynn2685++ } } - r.EncodeMapStart(yynn2708) - yynn2708 = 0 + r.EncodeMapStart(yynn2685) + yynn2685 = 0 } - if yyr2708 || yy2arr2708 { + if yyr2685 || yy2arr2685 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2708[0] { - yym2710 := z.EncBinary() - _ = yym2710 + if yyq2685[0] { + yy2687 := &x.ListMeta + yym2688 := z.EncBinary() + _ = yym2688 + if false { + } else if z.HasExtensions() && z.EncExt(yy2687) { + } else { + z.EncFallback(yy2687) + } + } else { + r.EncodeNil() + } + } else { + if yyq2685[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2689 := &x.ListMeta + yym2690 := z.EncBinary() + _ = yym2690 + if false { + } else if z.HasExtensions() && z.EncExt(yy2689) { + } else { + z.EncFallback(yy2689) + } + } + } + if yyr2685 || yy2arr2685 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2692 := z.EncBinary() + _ = yym2692 + if false { + } else { + h.encSliceNode(([]Node)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2693 := z.EncBinary() + _ = yym2693 + if false { + } else { + h.encSliceNode(([]Node)(x.Items), e) + } + } + } + if yyr2685 || yy2arr2685 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2685[2] { + yym2695 := z.EncBinary() + _ = yym2695 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -34364,23 +34548,23 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2708[0] { + if yyq2685[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2711 := z.EncBinary() - _ = yym2711 + yym2696 := z.EncBinary() + _ = yym2696 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr2708 || yy2arr2708 { + if yyr2685 || yy2arr2685 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2708[1] { - yym2713 := z.EncBinary() - _ = yym2713 + if yyq2685[3] { + yym2698 := z.EncBinary() + _ = yym2698 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -34389,57 +34573,19 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2708[1] { + if yyq2685[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2714 := z.EncBinary() - _ = yym2714 + yym2699 := z.EncBinary() + _ = yym2699 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr2708 || yy2arr2708 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2716 := z.EncBinary() - _ = yym2716 - if false { - } else { - r.EncodeBool(bool(x.Export)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("export")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2717 := z.EncBinary() - _ = yym2717 - if false { - } else { - r.EncodeBool(bool(x.Export)) - } - } - if yyr2708 || yy2arr2708 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym2719 := z.EncBinary() - _ = yym2719 - if false { - } else { - r.EncodeBool(bool(x.Exact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("exact")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2720 := z.EncBinary() - _ = yym2720 - if false { - } else { - r.EncodeBool(bool(x.Exact)) - } - } - if yyr2708 || yy2arr2708 { + if yyr2685 || yy2arr2685 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -34448,29 +34594,29 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *NodeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2721 := z.DecBinary() - _ = yym2721 + yym2700 := z.DecBinary() + _ = yym2700 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2722 := r.ContainerType() - if yyct2722 == codecSelferValueTypeMap1234 { - yyl2722 := r.ReadMapStart() - if yyl2722 == 0 { + yyct2701 := r.ContainerType() + if yyct2701 == codecSelferValueTypeMap1234 { + yyl2701 := r.ReadMapStart() + if yyl2701 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2722, d) + x.codecDecodeSelfFromMap(yyl2701, d) } - } else if yyct2722 == codecSelferValueTypeArray1234 { - yyl2722 := r.ReadArrayStart() - if yyl2722 == 0 { + } else if yyct2701 == codecSelferValueTypeArray1234 { + yyl2701 := r.ReadArrayStart() + if yyl2701 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2722, d) + x.codecDecodeSelfFromArray(yyl2701, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -34478,16 +34624,16 @@ func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *NodeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2723Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2723Slc - var yyhl2723 bool = l >= 0 - for yyj2723 := 0; ; yyj2723++ { - if yyhl2723 { - if yyj2723 >= l { + var yys2702Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2702Slc + var yyhl2702 bool = l >= 0 + for yyj2702 := 0; ; yyj2702++ { + if yyhl2702 { + if yyj2702 >= l { break } } else { @@ -34496,10 +34642,35 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2723Slc = r.DecodeBytes(yys2723Slc, true, true) - yys2723 := string(yys2723Slc) + yys2702Slc = r.DecodeBytes(yys2702Slc, true, true) + yys2702 := string(yys2702Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2723 { + switch yys2702 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2703 := &x.ListMeta + yym2704 := z.DecBinary() + _ = yym2704 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2703) { + } else { + z.DecFallback(yyv2703, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2705 := &x.Items + yym2706 := z.DecBinary() + _ = yym2706 + if false { + } else { + h.decSliceNode((*[]Node)(yyv2705), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -34512,26 +34683,284 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "export": - if r.TryDecodeAsNil() { - x.Export = false - } else { - x.Export = bool(r.DecodeBool()) - } - case "exact": - if r.TryDecodeAsNil() { - x.Exact = false - } else { - x.Exact = bool(r.DecodeBool()) - } default: - z.DecStructFieldNotFound(-1, yys2723) - } // end switch yys2723 - } // end for yyj2723 + z.DecStructFieldNotFound(-1, yys2702) + } // end switch yys2702 + } // end for yyj2702 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *NodeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2709 int + var yyb2709 bool + var yyhl2709 bool = l >= 0 + yyj2709++ + if yyhl2709 { + yyb2709 = yyj2709 > l + } else { + yyb2709 = r.CheckBreak() + } + if yyb2709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2710 := &x.ListMeta + yym2711 := z.DecBinary() + _ = yym2711 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2710) { + } else { + z.DecFallback(yyv2710, false) + } + } + yyj2709++ + if yyhl2709 { + yyb2709 = yyj2709 > l + } else { + yyb2709 = r.CheckBreak() + } + if yyb2709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2712 := &x.Items + yym2713 := z.DecBinary() + _ = yym2713 + if false { + } else { + h.decSliceNode((*[]Node)(yyv2712), d) + } + } + yyj2709++ + if yyhl2709 { + yyb2709 = yyj2709 > l + } else { + yyb2709 = r.CheckBreak() + } + if yyb2709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2709++ + if yyhl2709 { + yyb2709 = yyj2709 > l + } else { + yyb2709 = r.CheckBreak() + } + if yyb2709 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2709++ + if yyhl2709 { + yyb2709 = yyj2709 > l + } else { + yyb2709 = r.CheckBreak() + } + if yyb2709 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2709-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x FinalizerName) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym2716 := z.EncBinary() + _ = yym2716 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *FinalizerName) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2717 := z.DecBinary() + _ = yym2717 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *NamespaceSpec) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2718 := z.EncBinary() + _ = yym2718 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2719 := !z.EncBinary() + yy2arr2719 := z.EncBasicHandle().StructToArray + var yyq2719 [1]bool + _, _, _ = yysep2719, yyq2719, yy2arr2719 + const yyr2719 bool = false + yyq2719[0] = len(x.Finalizers) != 0 + var yynn2719 int + if yyr2719 || yy2arr2719 { + r.EncodeArrayStart(1) + } else { + yynn2719 = 0 + for _, b := range yyq2719 { + if b { + yynn2719++ + } + } + r.EncodeMapStart(yynn2719) + yynn2719 = 0 + } + if yyr2719 || yy2arr2719 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2719[0] { + if x.Finalizers == nil { + r.EncodeNil() + } else { + yym2721 := z.EncBinary() + _ = yym2721 + if false { + } else { + h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2719[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("finalizers")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Finalizers == nil { + r.EncodeNil() + } else { + yym2722 := z.EncBinary() + _ = yym2722 + if false { + } else { + h.encSliceFinalizerName(([]FinalizerName)(x.Finalizers), e) + } + } + } + } + if yyr2719 || yy2arr2719 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NamespaceSpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2723 := z.DecBinary() + _ = yym2723 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2724 := r.ContainerType() + if yyct2724 == codecSelferValueTypeMap1234 { + yyl2724 := r.ReadMapStart() + if yyl2724 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2724, d) + } + } else if yyct2724 == codecSelferValueTypeArray1234 { + yyl2724 := r.ReadArrayStart() + if yyl2724 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2724, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NamespaceSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2725Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2725Slc + var yyhl2725 bool = l >= 0 + for yyj2725 := 0; ; yyj2725++ { + if yyhl2725 { + if yyj2725 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2725Slc = r.DecodeBytes(yys2725Slc, true, true) + yys2725 := string(yys2725Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2725 { + case "finalizers": + if r.TryDecodeAsNil() { + x.Finalizers = nil + } else { + yyv2726 := &x.Finalizers + yym2727 := z.DecBinary() + _ = yym2727 + if false { + } else { + h.decSliceFinalizerName((*[]FinalizerName)(yyv2726), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys2725) + } // end switch yys2725 + } // end for yyj2725 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -34550,57 +34979,15 @@ func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Kind = "" + x.Finalizers = nil } else { - x.Kind = string(r.DecodeString()) - } - yyj2728++ - if yyhl2728 { - yyb2728 = yyj2728 > l - } else { - yyb2728 = r.CheckBreak() - } - if yyb2728 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2728++ - if yyhl2728 { - yyb2728 = yyj2728 > l - } else { - yyb2728 = r.CheckBreak() - } - if yyb2728 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Export = false - } else { - x.Export = bool(r.DecodeBool()) - } - yyj2728++ - if yyhl2728 { - yyb2728 = yyj2728 > l - } else { - yyb2728 = r.CheckBreak() - } - if yyb2728 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Exact = false - } else { - x.Exact = bool(r.DecodeBool()) + yyv2729 := &x.Finalizers + yym2730 := z.DecBinary() + _ = yym2730 + if false { + } else { + h.decSliceFinalizerName((*[]FinalizerName)(yyv2729), d) + } } for { yyj2728++ @@ -34618,229 +35005,53 @@ func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *NamespaceStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yym2733 := z.EncBinary() - _ = yym2733 + yym2731 := z.EncBinary() + _ = yym2731 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2734 := !z.EncBinary() - yy2arr2734 := z.EncBasicHandle().StructToArray - var yyq2734 [7]bool - _, _, _ = yysep2734, yyq2734, yy2arr2734 - const yyr2734 bool = false - yyq2734[0] = x.Kind != "" - yyq2734[1] = x.APIVersion != "" - yyq2734[2] = x.LabelSelector != "" - yyq2734[3] = x.FieldSelector != "" - yyq2734[4] = x.Watch != false - yyq2734[5] = x.ResourceVersion != "" - yyq2734[6] = x.TimeoutSeconds != nil - var yynn2734 int - if yyr2734 || yy2arr2734 { - r.EncodeArrayStart(7) + yysep2732 := !z.EncBinary() + yy2arr2732 := z.EncBasicHandle().StructToArray + var yyq2732 [1]bool + _, _, _ = yysep2732, yyq2732, yy2arr2732 + const yyr2732 bool = false + yyq2732[0] = x.Phase != "" + var yynn2732 int + if yyr2732 || yy2arr2732 { + r.EncodeArrayStart(1) } else { - yynn2734 = 0 - for _, b := range yyq2734 { + yynn2732 = 0 + for _, b := range yyq2732 { if b { - yynn2734++ + yynn2732++ } } - r.EncodeMapStart(yynn2734) - yynn2734 = 0 + r.EncodeMapStart(yynn2732) + yynn2732 = 0 } - if yyr2734 || yy2arr2734 { + if yyr2732 || yy2arr2732 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[0] { - yym2736 := z.EncBinary() - _ = yym2736 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + if yyq2732[0] { + x.Phase.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2734[0] { + if yyq2732[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("phase")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2737 := z.EncBinary() - _ = yym2737 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + x.Phase.CodecEncodeSelf(e) } } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[1] { - yym2739 := z.EncBinary() - _ = yym2739 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2734[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2740 := z.EncBinary() - _ = yym2740 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[2] { - yym2742 := z.EncBinary() - _ = yym2742 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2734[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("labelSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2743 := z.EncBinary() - _ = yym2743 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) - } - } - } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[3] { - yym2745 := z.EncBinary() - _ = yym2745 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2734[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fieldSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2746 := z.EncBinary() - _ = yym2746 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) - } - } - } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[4] { - yym2748 := z.EncBinary() - _ = yym2748 - if false { - } else { - r.EncodeBool(bool(x.Watch)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2734[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("watch")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2749 := z.EncBinary() - _ = yym2749 - if false { - } else { - r.EncodeBool(bool(x.Watch)) - } - } - } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[5] { - yym2751 := z.EncBinary() - _ = yym2751 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2734[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2752 := z.EncBinary() - _ = yym2752 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } - } - if yyr2734 || yy2arr2734 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2734[6] { - if x.TimeoutSeconds == nil { - r.EncodeNil() - } else { - yy2754 := *x.TimeoutSeconds - yym2755 := z.EncBinary() - _ = yym2755 - if false { - } else { - r.EncodeInt(int64(yy2754)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2734[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.TimeoutSeconds == nil { - r.EncodeNil() - } else { - yy2756 := *x.TimeoutSeconds - yym2757 := z.EncBinary() - _ = yym2757 - if false { - } else { - r.EncodeInt(int64(yy2756)) - } - } - } - } - if yyr2734 || yy2arr2734 { + if yyr2732 || yy2arr2732 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -34849,29 +35060,29 @@ func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *NamespaceStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2758 := z.DecBinary() - _ = yym2758 + yym2734 := z.DecBinary() + _ = yym2734 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2759 := r.ContainerType() - if yyct2759 == codecSelferValueTypeMap1234 { - yyl2759 := r.ReadMapStart() - if yyl2759 == 0 { + yyct2735 := r.ContainerType() + if yyct2735 == codecSelferValueTypeMap1234 { + yyl2735 := r.ReadMapStart() + if yyl2735 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2759, d) + x.codecDecodeSelfFromMap(yyl2735, d) } - } else if yyct2759 == codecSelferValueTypeArray1234 { - yyl2759 := r.ReadArrayStart() - if yyl2759 == 0 { + } else if yyct2735 == codecSelferValueTypeArray1234 { + yyl2735 := r.ReadArrayStart() + if yyl2735 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2759, d) + x.codecDecodeSelfFromArray(yyl2735, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -34879,16 +35090,16 @@ func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *NamespaceStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2760Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2760Slc - var yyhl2760 bool = l >= 0 - for yyj2760 := 0; ; yyj2760++ { - if yyhl2760 { - if yyj2760 >= l { + var yys2736Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2736Slc + var yyhl2736 bool = l >= 0 + for yyj2736 := 0; ; yyj2736++ { + if yyhl2736 { + if yyj2736 >= l { break } } else { @@ -34897,10 +35108,306 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2760Slc = r.DecodeBytes(yys2760Slc, true, true) - yys2760 := string(yys2760Slc) + yys2736Slc = r.DecodeBytes(yys2736Slc, true, true) + yys2736 := string(yys2736Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2760 { + switch yys2736 { + case "phase": + if r.TryDecodeAsNil() { + x.Phase = "" + } else { + x.Phase = NamespacePhase(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys2736) + } // end switch yys2736 + } // end for yyj2736 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2738 int + var yyb2738 bool + var yyhl2738 bool = l >= 0 + yyj2738++ + if yyhl2738 { + yyb2738 = yyj2738 > l + } else { + yyb2738 = r.CheckBreak() + } + if yyb2738 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Phase = "" + } else { + x.Phase = NamespacePhase(r.DecodeString()) + } + for { + yyj2738++ + if yyhl2738 { + yyb2738 = yyj2738 > l + } else { + yyb2738 = r.CheckBreak() + } + if yyb2738 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2738-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x NamespacePhase) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym2740 := z.EncBinary() + _ = yym2740 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *NamespacePhase) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2741 := z.DecBinary() + _ = yym2741 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *Namespace) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2742 := z.EncBinary() + _ = yym2742 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2743 := !z.EncBinary() + yy2arr2743 := z.EncBasicHandle().StructToArray + var yyq2743 [5]bool + _, _, _ = yysep2743, yyq2743, yy2arr2743 + const yyr2743 bool = false + yyq2743[0] = true + yyq2743[1] = true + yyq2743[2] = true + yyq2743[3] = x.Kind != "" + yyq2743[4] = x.APIVersion != "" + var yynn2743 int + if yyr2743 || yy2arr2743 { + r.EncodeArrayStart(5) + } else { + yynn2743 = 0 + for _, b := range yyq2743 { + if b { + yynn2743++ + } + } + r.EncodeMapStart(yynn2743) + yynn2743 = 0 + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2743[0] { + yy2745 := &x.ObjectMeta + yy2745.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2743[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2746 := &x.ObjectMeta + yy2746.CodecEncodeSelf(e) + } + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2743[1] { + yy2748 := &x.Spec + yy2748.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2743[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2749 := &x.Spec + yy2749.CodecEncodeSelf(e) + } + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2743[2] { + yy2751 := &x.Status + yy2751.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2743[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2752 := &x.Status + yy2752.CodecEncodeSelf(e) + } + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2743[3] { + yym2754 := z.EncBinary() + _ = yym2754 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2743[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2755 := z.EncBinary() + _ = yym2755 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2743[4] { + yym2757 := z.EncBinary() + _ = yym2757 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2743[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2758 := z.EncBinary() + _ = yym2758 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2743 || yy2arr2743 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Namespace) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2759 := z.DecBinary() + _ = yym2759 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2760 := r.ContainerType() + if yyct2760 == codecSelferValueTypeMap1234 { + yyl2760 := r.ReadMapStart() + if yyl2760 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2760, d) + } + } else if yyct2760 == codecSelferValueTypeArray1234 { + yyl2760 := r.ReadArrayStart() + if yyl2760 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2760, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Namespace) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2761Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2761Slc + var yyhl2761 bool = l >= 0 + for yyj2761 := 0; ; yyj2761++ { + if yyhl2761 { + if yyj2761 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2761Slc = r.DecodeBytes(yys2761Slc, true, true) + yys2761 := string(yys2761Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2761 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2762 := &x.ObjectMeta + yyv2762.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = NamespaceSpec{} + } else { + yyv2763 := &x.Spec + yyv2763.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = NamespaceStatus{} + } else { + yyv2764 := &x.Status + yyv2764.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -34913,6 +35420,1627 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2761) + } // end switch yys2761 + } // end for yyj2761 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Namespace) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2767 int + var yyb2767 bool + var yyhl2767 bool = l >= 0 + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2768 := &x.ObjectMeta + yyv2768.CodecDecodeSelf(d) + } + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = NamespaceSpec{} + } else { + yyv2769 := &x.Spec + yyv2769.CodecDecodeSelf(d) + } + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = NamespaceStatus{} + } else { + yyv2770 := &x.Status + yyv2770.CodecDecodeSelf(d) + } + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2767++ + if yyhl2767 { + yyb2767 = yyj2767 > l + } else { + yyb2767 = r.CheckBreak() + } + if yyb2767 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2767-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *NamespaceList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2773 := z.EncBinary() + _ = yym2773 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2774 := !z.EncBinary() + yy2arr2774 := z.EncBasicHandle().StructToArray + var yyq2774 [4]bool + _, _, _ = yysep2774, yyq2774, yy2arr2774 + const yyr2774 bool = false + yyq2774[0] = true + yyq2774[2] = x.Kind != "" + yyq2774[3] = x.APIVersion != "" + var yynn2774 int + if yyr2774 || yy2arr2774 { + r.EncodeArrayStart(4) + } else { + yynn2774 = 1 + for _, b := range yyq2774 { + if b { + yynn2774++ + } + } + r.EncodeMapStart(yynn2774) + yynn2774 = 0 + } + if yyr2774 || yy2arr2774 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2774[0] { + yy2776 := &x.ListMeta + yym2777 := z.EncBinary() + _ = yym2777 + if false { + } else if z.HasExtensions() && z.EncExt(yy2776) { + } else { + z.EncFallback(yy2776) + } + } else { + r.EncodeNil() + } + } else { + if yyq2774[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2778 := &x.ListMeta + yym2779 := z.EncBinary() + _ = yym2779 + if false { + } else if z.HasExtensions() && z.EncExt(yy2778) { + } else { + z.EncFallback(yy2778) + } + } + } + if yyr2774 || yy2arr2774 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2781 := z.EncBinary() + _ = yym2781 + if false { + } else { + h.encSliceNamespace(([]Namespace)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym2782 := z.EncBinary() + _ = yym2782 + if false { + } else { + h.encSliceNamespace(([]Namespace)(x.Items), e) + } + } + } + if yyr2774 || yy2arr2774 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2774[2] { + yym2784 := z.EncBinary() + _ = yym2784 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2774[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2785 := z.EncBinary() + _ = yym2785 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2774 || yy2arr2774 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2774[3] { + yym2787 := z.EncBinary() + _ = yym2787 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2774[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2788 := z.EncBinary() + _ = yym2788 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2774 || yy2arr2774 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *NamespaceList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2789 := z.DecBinary() + _ = yym2789 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2790 := r.ContainerType() + if yyct2790 == codecSelferValueTypeMap1234 { + yyl2790 := r.ReadMapStart() + if yyl2790 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2790, d) + } + } else if yyct2790 == codecSelferValueTypeArray1234 { + yyl2790 := r.ReadArrayStart() + if yyl2790 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2790, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *NamespaceList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2791Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2791Slc + var yyhl2791 bool = l >= 0 + for yyj2791 := 0; ; yyj2791++ { + if yyhl2791 { + if yyj2791 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2791Slc = r.DecodeBytes(yys2791Slc, true, true) + yys2791 := string(yys2791Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2791 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2792 := &x.ListMeta + yym2793 := z.DecBinary() + _ = yym2793 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2792) { + } else { + z.DecFallback(yyv2792, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2794 := &x.Items + yym2795 := z.DecBinary() + _ = yym2795 + if false { + } else { + h.decSliceNamespace((*[]Namespace)(yyv2794), 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, yys2791) + } // end switch yys2791 + } // end for yyj2791 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *NamespaceList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2798 int + var yyb2798 bool + var yyhl2798 bool = l >= 0 + yyj2798++ + if yyhl2798 { + yyb2798 = yyj2798 > l + } else { + yyb2798 = r.CheckBreak() + } + if yyb2798 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv2799 := &x.ListMeta + yym2800 := z.DecBinary() + _ = yym2800 + if false { + } else if z.HasExtensions() && z.DecExt(yyv2799) { + } else { + z.DecFallback(yyv2799, false) + } + } + yyj2798++ + if yyhl2798 { + yyb2798 = yyj2798 > l + } else { + yyb2798 = r.CheckBreak() + } + if yyb2798 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv2801 := &x.Items + yym2802 := z.DecBinary() + _ = yym2802 + if false { + } else { + h.decSliceNamespace((*[]Namespace)(yyv2801), d) + } + } + yyj2798++ + if yyhl2798 { + yyb2798 = yyj2798 > l + } else { + yyb2798 = r.CheckBreak() + } + if yyb2798 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2798++ + if yyhl2798 { + yyb2798 = yyj2798 > l + } else { + yyb2798 = r.CheckBreak() + } + if yyb2798 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2798++ + if yyhl2798 { + yyb2798 = yyj2798 > l + } else { + yyb2798 = r.CheckBreak() + } + if yyb2798 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2798-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *Binding) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2805 := z.EncBinary() + _ = yym2805 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2806 := !z.EncBinary() + yy2arr2806 := z.EncBasicHandle().StructToArray + var yyq2806 [4]bool + _, _, _ = yysep2806, yyq2806, yy2arr2806 + const yyr2806 bool = false + yyq2806[0] = true + yyq2806[2] = x.Kind != "" + yyq2806[3] = x.APIVersion != "" + var yynn2806 int + if yyr2806 || yy2arr2806 { + r.EncodeArrayStart(4) + } else { + yynn2806 = 1 + for _, b := range yyq2806 { + if b { + yynn2806++ + } + } + r.EncodeMapStart(yynn2806) + yynn2806 = 0 + } + if yyr2806 || yy2arr2806 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2806[0] { + yy2808 := &x.ObjectMeta + yy2808.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq2806[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2809 := &x.ObjectMeta + yy2809.CodecEncodeSelf(e) + } + } + if yyr2806 || yy2arr2806 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy2811 := &x.Target + yy2811.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("target")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy2812 := &x.Target + yy2812.CodecEncodeSelf(e) + } + if yyr2806 || yy2arr2806 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2806[2] { + yym2814 := z.EncBinary() + _ = yym2814 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2806[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2815 := z.EncBinary() + _ = yym2815 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2806 || yy2arr2806 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2806[3] { + yym2817 := z.EncBinary() + _ = yym2817 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2806[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2818 := z.EncBinary() + _ = yym2818 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2806 || yy2arr2806 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Binding) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2819 := z.DecBinary() + _ = yym2819 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2820 := r.ContainerType() + if yyct2820 == codecSelferValueTypeMap1234 { + yyl2820 := r.ReadMapStart() + if yyl2820 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2820, d) + } + } else if yyct2820 == codecSelferValueTypeArray1234 { + yyl2820 := r.ReadArrayStart() + if yyl2820 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2820, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Binding) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2821Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2821Slc + var yyhl2821 bool = l >= 0 + for yyj2821 := 0; ; yyj2821++ { + if yyhl2821 { + if yyj2821 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2821Slc = r.DecodeBytes(yys2821Slc, true, true) + yys2821 := string(yys2821Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2821 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2822 := &x.ObjectMeta + yyv2822.CodecDecodeSelf(d) + } + case "target": + if r.TryDecodeAsNil() { + x.Target = ObjectReference{} + } else { + yyv2823 := &x.Target + yyv2823.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, yys2821) + } // end switch yys2821 + } // end for yyj2821 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Binding) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2826 int + var yyb2826 bool + var yyhl2826 bool = l >= 0 + yyj2826++ + if yyhl2826 { + yyb2826 = yyj2826 > l + } else { + yyb2826 = r.CheckBreak() + } + if yyb2826 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv2827 := &x.ObjectMeta + yyv2827.CodecDecodeSelf(d) + } + yyj2826++ + if yyhl2826 { + yyb2826 = yyj2826 > l + } else { + yyb2826 = r.CheckBreak() + } + if yyb2826 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Target = ObjectReference{} + } else { + yyv2828 := &x.Target + yyv2828.CodecDecodeSelf(d) + } + yyj2826++ + if yyhl2826 { + yyb2826 = yyj2826 > l + } else { + yyb2826 = r.CheckBreak() + } + if yyb2826 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2826++ + if yyhl2826 { + yyb2826 = yyj2826 > l + } else { + yyb2826 = r.CheckBreak() + } + if yyb2826 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2826++ + if yyhl2826 { + yyb2826 = yyj2826 > l + } else { + yyb2826 = r.CheckBreak() + } + if yyb2826 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2826-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2831 := z.EncBinary() + _ = yym2831 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2832 := !z.EncBinary() + yy2arr2832 := z.EncBasicHandle().StructToArray + var yyq2832 [3]bool + _, _, _ = yysep2832, yyq2832, yy2arr2832 + const yyr2832 bool = false + yyq2832[1] = x.Kind != "" + yyq2832[2] = x.APIVersion != "" + var yynn2832 int + if yyr2832 || yy2arr2832 { + r.EncodeArrayStart(3) + } else { + yynn2832 = 1 + for _, b := range yyq2832 { + if b { + yynn2832++ + } + } + r.EncodeMapStart(yynn2832) + yynn2832 = 0 + } + if yyr2832 || yy2arr2832 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.GracePeriodSeconds == nil { + r.EncodeNil() + } else { + yy2834 := *x.GracePeriodSeconds + yym2835 := z.EncBinary() + _ = yym2835 + if false { + } else { + r.EncodeInt(int64(yy2834)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("gracePeriodSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.GracePeriodSeconds == nil { + r.EncodeNil() + } else { + yy2836 := *x.GracePeriodSeconds + yym2837 := z.EncBinary() + _ = yym2837 + if false { + } else { + r.EncodeInt(int64(yy2836)) + } + } + } + if yyr2832 || yy2arr2832 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2832[1] { + yym2839 := z.EncBinary() + _ = yym2839 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2832[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2840 := z.EncBinary() + _ = yym2840 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2832 || yy2arr2832 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2832[2] { + yym2842 := z.EncBinary() + _ = yym2842 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2832[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2843 := z.EncBinary() + _ = yym2843 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2832 || yy2arr2832 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2844 := z.DecBinary() + _ = yym2844 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2845 := r.ContainerType() + if yyct2845 == codecSelferValueTypeMap1234 { + yyl2845 := r.ReadMapStart() + if yyl2845 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2845, d) + } + } else if yyct2845 == codecSelferValueTypeArray1234 { + yyl2845 := r.ReadArrayStart() + if yyl2845 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2845, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2846Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2846Slc + var yyhl2846 bool = l >= 0 + for yyj2846 := 0; ; yyj2846++ { + if yyhl2846 { + if yyj2846 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2846Slc = r.DecodeBytes(yys2846Slc, true, true) + yys2846 := string(yys2846Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2846 { + case "gracePeriodSeconds": + if r.TryDecodeAsNil() { + if x.GracePeriodSeconds != nil { + x.GracePeriodSeconds = nil + } + } else { + if x.GracePeriodSeconds == nil { + x.GracePeriodSeconds = new(int64) + } + yym2848 := z.DecBinary() + _ = yym2848 + if false { + } else { + *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) + } + } + 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, yys2846) + } // end switch yys2846 + } // end for yyj2846 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2851 int + var yyb2851 bool + var yyhl2851 bool = l >= 0 + yyj2851++ + if yyhl2851 { + yyb2851 = yyj2851 > l + } else { + yyb2851 = r.CheckBreak() + } + if yyb2851 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.GracePeriodSeconds != nil { + x.GracePeriodSeconds = nil + } + } else { + if x.GracePeriodSeconds == nil { + x.GracePeriodSeconds = new(int64) + } + yym2853 := z.DecBinary() + _ = yym2853 + if false { + } else { + *((*int64)(x.GracePeriodSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj2851++ + if yyhl2851 { + yyb2851 = yyj2851 > l + } else { + yyb2851 = r.CheckBreak() + } + if yyb2851 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2851++ + if yyhl2851 { + yyb2851 = yyj2851 > l + } else { + yyb2851 = r.CheckBreak() + } + if yyb2851 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2851++ + if yyhl2851 { + yyb2851 = yyj2851 > l + } else { + yyb2851 = r.CheckBreak() + } + if yyb2851 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2851-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2856 := z.EncBinary() + _ = yym2856 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2857 := !z.EncBinary() + yy2arr2857 := z.EncBasicHandle().StructToArray + var yyq2857 [4]bool + _, _, _ = yysep2857, yyq2857, yy2arr2857 + const yyr2857 bool = false + yyq2857[2] = x.Kind != "" + yyq2857[3] = x.APIVersion != "" + var yynn2857 int + if yyr2857 || yy2arr2857 { + r.EncodeArrayStart(4) + } else { + yynn2857 = 2 + for _, b := range yyq2857 { + if b { + yynn2857++ + } + } + r.EncodeMapStart(yynn2857) + yynn2857 = 0 + } + if yyr2857 || yy2arr2857 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2859 := z.EncBinary() + _ = yym2859 + if false { + } else { + r.EncodeBool(bool(x.Export)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("export")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2860 := z.EncBinary() + _ = yym2860 + if false { + } else { + r.EncodeBool(bool(x.Export)) + } + } + if yyr2857 || yy2arr2857 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym2862 := z.EncBinary() + _ = yym2862 + if false { + } else { + r.EncodeBool(bool(x.Exact)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("exact")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2863 := z.EncBinary() + _ = yym2863 + if false { + } else { + r.EncodeBool(bool(x.Exact)) + } + } + if yyr2857 || yy2arr2857 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2857[2] { + yym2865 := z.EncBinary() + _ = yym2865 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2857[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2866 := z.EncBinary() + _ = yym2866 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2857 || yy2arr2857 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2857[3] { + yym2868 := z.EncBinary() + _ = yym2868 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2857[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2869 := z.EncBinary() + _ = yym2869 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2857 || yy2arr2857 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2870 := z.DecBinary() + _ = yym2870 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2871 := r.ContainerType() + if yyct2871 == codecSelferValueTypeMap1234 { + yyl2871 := r.ReadMapStart() + if yyl2871 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2871, d) + } + } else if yyct2871 == codecSelferValueTypeArray1234 { + yyl2871 := r.ReadArrayStart() + if yyl2871 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2871, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2872Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2872Slc + var yyhl2872 bool = l >= 0 + for yyj2872 := 0; ; yyj2872++ { + if yyhl2872 { + if yyj2872 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2872Slc = r.DecodeBytes(yys2872Slc, true, true) + yys2872 := string(yys2872Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2872 { + case "export": + if r.TryDecodeAsNil() { + x.Export = false + } else { + x.Export = bool(r.DecodeBool()) + } + case "exact": + if r.TryDecodeAsNil() { + x.Exact = false + } else { + x.Exact = bool(r.DecodeBool()) + } + 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, yys2872) + } // end switch yys2872 + } // end for yyj2872 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2877 int + var yyb2877 bool + var yyhl2877 bool = l >= 0 + yyj2877++ + if yyhl2877 { + yyb2877 = yyj2877 > l + } else { + yyb2877 = r.CheckBreak() + } + if yyb2877 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Export = false + } else { + x.Export = bool(r.DecodeBool()) + } + yyj2877++ + if yyhl2877 { + yyb2877 = yyj2877 > l + } else { + yyb2877 = r.CheckBreak() + } + if yyb2877 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Exact = false + } else { + x.Exact = bool(r.DecodeBool()) + } + yyj2877++ + if yyhl2877 { + yyb2877 = yyj2877 > l + } else { + yyb2877 = r.CheckBreak() + } + if yyb2877 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2877++ + if yyhl2877 { + yyb2877 = yyj2877 > l + } else { + yyb2877 = r.CheckBreak() + } + if yyb2877 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2877++ + if yyhl2877 { + yyb2877 = yyj2877 > l + } else { + yyb2877 = r.CheckBreak() + } + if yyb2877 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2877-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2882 := z.EncBinary() + _ = yym2882 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2883 := !z.EncBinary() + yy2arr2883 := z.EncBasicHandle().StructToArray + var yyq2883 [7]bool + _, _, _ = yysep2883, yyq2883, yy2arr2883 + const yyr2883 bool = false + yyq2883[0] = x.LabelSelector != "" + yyq2883[1] = x.FieldSelector != "" + yyq2883[2] = x.Watch != false + yyq2883[3] = x.ResourceVersion != "" + yyq2883[4] = x.TimeoutSeconds != nil + yyq2883[5] = x.Kind != "" + yyq2883[6] = x.APIVersion != "" + var yynn2883 int + if yyr2883 || yy2arr2883 { + r.EncodeArrayStart(7) + } else { + yynn2883 = 0 + for _, b := range yyq2883 { + if b { + yynn2883++ + } + } + r.EncodeMapStart(yynn2883) + yynn2883 = 0 + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[0] { + yym2885 := z.EncBinary() + _ = yym2885 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2883[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("labelSelector")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2886 := z.EncBinary() + _ = yym2886 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[1] { + yym2888 := z.EncBinary() + _ = yym2888 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2883[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fieldSelector")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2889 := z.EncBinary() + _ = yym2889 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[2] { + yym2891 := z.EncBinary() + _ = yym2891 + if false { + } else { + r.EncodeBool(bool(x.Watch)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2883[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("watch")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2892 := z.EncBinary() + _ = yym2892 + if false { + } else { + r.EncodeBool(bool(x.Watch)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[3] { + yym2894 := z.EncBinary() + _ = yym2894 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2883[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2895 := z.EncBinary() + _ = yym2895 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[4] { + if x.TimeoutSeconds == nil { + r.EncodeNil() + } else { + yy2897 := *x.TimeoutSeconds + yym2898 := z.EncBinary() + _ = yym2898 + if false { + } else { + r.EncodeInt(int64(yy2897)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2883[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TimeoutSeconds == nil { + r.EncodeNil() + } else { + yy2899 := *x.TimeoutSeconds + yym2900 := z.EncBinary() + _ = yym2900 + if false { + } else { + r.EncodeInt(int64(yy2899)) + } + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[5] { + yym2902 := z.EncBinary() + _ = yym2902 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2883[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2903 := z.EncBinary() + _ = yym2903 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2883[6] { + yym2905 := z.EncBinary() + _ = yym2905 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2883[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2906 := z.EncBinary() + _ = yym2906 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2883 || yy2arr2883 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2907 := z.DecBinary() + _ = yym2907 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2908 := r.ContainerType() + if yyct2908 == codecSelferValueTypeMap1234 { + yyl2908 := r.ReadMapStart() + if yyl2908 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2908, d) + } + } else if yyct2908 == codecSelferValueTypeArray1234 { + yyl2908 := r.ReadArrayStart() + if yyl2908 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2908, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2909Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2909Slc + var yyhl2909 bool = l >= 0 + for yyj2909 := 0; ; yyj2909++ { + if yyhl2909 { + if yyj2909 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2909Slc = r.DecodeBytes(yys2909Slc, true, true) + yys2909 := string(yys2909Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2909 { case "labelSelector": if r.TryDecodeAsNil() { x.LabelSelector = "" @@ -34946,564 +37074,13 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TimeoutSeconds == nil { x.TimeoutSeconds = new(int64) } - yym2768 := z.DecBinary() - _ = yym2768 + yym2915 := z.DecBinary() + _ = yym2915 if false { } else { *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) } } - default: - z.DecStructFieldNotFound(-1, yys2760) - } // end switch yys2760 - } // end for yyj2760 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2769 int - var yyb2769 bool - var yyhl2769 bool = l >= 0 - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LabelSelector = "" - } else { - x.LabelSelector = string(r.DecodeString()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.FieldSelector = "" - } else { - x.FieldSelector = string(r.DecodeString()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Watch = false - } else { - x.Watch = bool(r.DecodeBool()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ResourceVersion = "" - } else { - x.ResourceVersion = string(r.DecodeString()) - } - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.TimeoutSeconds != nil { - x.TimeoutSeconds = nil - } - } else { - if x.TimeoutSeconds == nil { - x.TimeoutSeconds = new(int64) - } - yym2777 := z.DecBinary() - _ = yym2777 - if false { - } else { - *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) - } - } - for { - yyj2769++ - if yyhl2769 { - yyb2769 = yyj2769 > l - } else { - yyb2769 = r.CheckBreak() - } - if yyb2769 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2769-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodLogOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2778 := z.EncBinary() - _ = yym2778 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2779 := !z.EncBinary() - yy2arr2779 := z.EncBasicHandle().StructToArray - var yyq2779 [10]bool - _, _, _ = yysep2779, yyq2779, yy2arr2779 - const yyr2779 bool = false - yyq2779[0] = x.Kind != "" - yyq2779[1] = x.APIVersion != "" - yyq2779[2] = x.Container != "" - yyq2779[3] = x.Follow != false - yyq2779[4] = x.Previous != false - yyq2779[5] = x.SinceSeconds != nil - yyq2779[6] = x.SinceTime != nil - yyq2779[7] = x.Timestamps != false - yyq2779[8] = x.TailLines != nil - yyq2779[9] = x.LimitBytes != nil - var yynn2779 int - if yyr2779 || yy2arr2779 { - r.EncodeArrayStart(10) - } else { - yynn2779 = 0 - for _, b := range yyq2779 { - if b { - yynn2779++ - } - } - r.EncodeMapStart(yynn2779) - yynn2779 = 0 - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[0] { - yym2781 := z.EncBinary() - _ = yym2781 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2779[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2782 := z.EncBinary() - _ = yym2782 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[1] { - yym2784 := z.EncBinary() - _ = yym2784 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2779[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2785 := z.EncBinary() - _ = yym2785 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[2] { - yym2787 := z.EncBinary() - _ = yym2787 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2779[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2788 := z.EncBinary() - _ = yym2788 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[3] { - yym2790 := z.EncBinary() - _ = yym2790 - if false { - } else { - r.EncodeBool(bool(x.Follow)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2779[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("follow")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2791 := z.EncBinary() - _ = yym2791 - if false { - } else { - r.EncodeBool(bool(x.Follow)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[4] { - yym2793 := z.EncBinary() - _ = yym2793 - if false { - } else { - r.EncodeBool(bool(x.Previous)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2779[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("previous")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2794 := z.EncBinary() - _ = yym2794 - if false { - } else { - r.EncodeBool(bool(x.Previous)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[5] { - if x.SinceSeconds == nil { - r.EncodeNil() - } else { - yy2796 := *x.SinceSeconds - yym2797 := z.EncBinary() - _ = yym2797 - if false { - } else { - r.EncodeInt(int64(yy2796)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2779[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("sinceSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SinceSeconds == nil { - r.EncodeNil() - } else { - yy2798 := *x.SinceSeconds - yym2799 := z.EncBinary() - _ = yym2799 - if false { - } else { - r.EncodeInt(int64(yy2798)) - } - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[6] { - if x.SinceTime == nil { - r.EncodeNil() - } else { - yym2801 := z.EncBinary() - _ = yym2801 - if false { - } else if z.HasExtensions() && z.EncExt(x.SinceTime) { - } else if yym2801 { - z.EncBinaryMarshal(x.SinceTime) - } else if !yym2801 && z.IsJSONHandle() { - z.EncJSONMarshal(x.SinceTime) - } else { - z.EncFallback(x.SinceTime) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2779[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("sinceTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SinceTime == nil { - r.EncodeNil() - } else { - yym2802 := z.EncBinary() - _ = yym2802 - if false { - } else if z.HasExtensions() && z.EncExt(x.SinceTime) { - } else if yym2802 { - z.EncBinaryMarshal(x.SinceTime) - } else if !yym2802 && z.IsJSONHandle() { - z.EncJSONMarshal(x.SinceTime) - } else { - z.EncFallback(x.SinceTime) - } - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[7] { - yym2804 := z.EncBinary() - _ = yym2804 - if false { - } else { - r.EncodeBool(bool(x.Timestamps)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2779[7] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("timestamps")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2805 := z.EncBinary() - _ = yym2805 - if false { - } else { - r.EncodeBool(bool(x.Timestamps)) - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[8] { - if x.TailLines == nil { - r.EncodeNil() - } else { - yy2807 := *x.TailLines - yym2808 := z.EncBinary() - _ = yym2808 - if false { - } else { - r.EncodeInt(int64(yy2807)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2779[8] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tailLines")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.TailLines == nil { - r.EncodeNil() - } else { - yy2809 := *x.TailLines - yym2810 := z.EncBinary() - _ = yym2810 - if false { - } else { - r.EncodeInt(int64(yy2809)) - } - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2779[9] { - if x.LimitBytes == nil { - r.EncodeNil() - } else { - yy2812 := *x.LimitBytes - yym2813 := z.EncBinary() - _ = yym2813 - if false { - } else { - r.EncodeInt(int64(yy2812)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2779[9] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("limitBytes")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.LimitBytes == nil { - r.EncodeNil() - } else { - yy2814 := *x.LimitBytes - yym2815 := z.EncBinary() - _ = yym2815 - if false { - } else { - r.EncodeInt(int64(yy2814)) - } - } - } - } - if yyr2779 || yy2arr2779 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodLogOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2816 := z.DecBinary() - _ = yym2816 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2817 := r.ContainerType() - if yyct2817 == codecSelferValueTypeMap1234 { - yyl2817 := r.ReadMapStart() - if yyl2817 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2817, d) - } - } else if yyct2817 == codecSelferValueTypeArray1234 { - yyl2817 := r.ReadArrayStart() - if yyl2817 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2817, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2818Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2818Slc - var yyhl2818 bool = l >= 0 - for yyj2818 := 0; ; yyj2818++ { - if yyhl2818 { - if yyj2818 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2818Slc = r.DecodeBytes(yys2818Slc, true, true) - yys2818 := string(yys2818Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2818 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -35516,6 +37093,557 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2909) + } // end switch yys2909 + } // end for yyj2909 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2918 int + var yyb2918 bool + var yyhl2918 bool = l >= 0 + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LabelSelector = "" + } else { + x.LabelSelector = string(r.DecodeString()) + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.FieldSelector = "" + } else { + x.FieldSelector = string(r.DecodeString()) + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Watch = false + } else { + x.Watch = bool(r.DecodeBool()) + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ResourceVersion = "" + } else { + x.ResourceVersion = string(r.DecodeString()) + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.TimeoutSeconds != nil { + x.TimeoutSeconds = nil + } + } else { + if x.TimeoutSeconds == nil { + x.TimeoutSeconds = new(int64) + } + yym2924 := z.DecBinary() + _ = yym2924 + if false { + } else { + *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2918++ + if yyhl2918 { + yyb2918 = yyj2918 > l + } else { + yyb2918 = r.CheckBreak() + } + if yyb2918 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2918-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodLogOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2927 := z.EncBinary() + _ = yym2927 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2928 := !z.EncBinary() + yy2arr2928 := z.EncBasicHandle().StructToArray + var yyq2928 [10]bool + _, _, _ = yysep2928, yyq2928, yy2arr2928 + const yyr2928 bool = false + yyq2928[0] = x.Container != "" + yyq2928[1] = x.Follow != false + yyq2928[2] = x.Previous != false + yyq2928[3] = x.SinceSeconds != nil + yyq2928[4] = x.SinceTime != nil + yyq2928[5] = x.Timestamps != false + yyq2928[6] = x.TailLines != nil + yyq2928[7] = x.LimitBytes != nil + yyq2928[8] = x.Kind != "" + yyq2928[9] = x.APIVersion != "" + var yynn2928 int + if yyr2928 || yy2arr2928 { + r.EncodeArrayStart(10) + } else { + yynn2928 = 0 + for _, b := range yyq2928 { + if b { + yynn2928++ + } + } + r.EncodeMapStart(yynn2928) + yynn2928 = 0 + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[0] { + yym2930 := z.EncBinary() + _ = yym2930 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2928[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2931 := z.EncBinary() + _ = yym2931 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[1] { + yym2933 := z.EncBinary() + _ = yym2933 + if false { + } else { + r.EncodeBool(bool(x.Follow)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2928[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("follow")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2934 := z.EncBinary() + _ = yym2934 + if false { + } else { + r.EncodeBool(bool(x.Follow)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[2] { + yym2936 := z.EncBinary() + _ = yym2936 + if false { + } else { + r.EncodeBool(bool(x.Previous)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2928[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("previous")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2937 := z.EncBinary() + _ = yym2937 + if false { + } else { + r.EncodeBool(bool(x.Previous)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[3] { + if x.SinceSeconds == nil { + r.EncodeNil() + } else { + yy2939 := *x.SinceSeconds + yym2940 := z.EncBinary() + _ = yym2940 + if false { + } else { + r.EncodeInt(int64(yy2939)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2928[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("sinceSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SinceSeconds == nil { + r.EncodeNil() + } else { + yy2941 := *x.SinceSeconds + yym2942 := z.EncBinary() + _ = yym2942 + if false { + } else { + r.EncodeInt(int64(yy2941)) + } + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[4] { + if x.SinceTime == nil { + r.EncodeNil() + } else { + yym2944 := z.EncBinary() + _ = yym2944 + if false { + } else if z.HasExtensions() && z.EncExt(x.SinceTime) { + } else if yym2944 { + z.EncBinaryMarshal(x.SinceTime) + } else if !yym2944 && z.IsJSONHandle() { + z.EncJSONMarshal(x.SinceTime) + } else { + z.EncFallback(x.SinceTime) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2928[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("sinceTime")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SinceTime == nil { + r.EncodeNil() + } else { + yym2945 := z.EncBinary() + _ = yym2945 + if false { + } else if z.HasExtensions() && z.EncExt(x.SinceTime) { + } else if yym2945 { + z.EncBinaryMarshal(x.SinceTime) + } else if !yym2945 && z.IsJSONHandle() { + z.EncJSONMarshal(x.SinceTime) + } else { + z.EncFallback(x.SinceTime) + } + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[5] { + yym2947 := z.EncBinary() + _ = yym2947 + if false { + } else { + r.EncodeBool(bool(x.Timestamps)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2928[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("timestamps")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2948 := z.EncBinary() + _ = yym2948 + if false { + } else { + r.EncodeBool(bool(x.Timestamps)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[6] { + if x.TailLines == nil { + r.EncodeNil() + } else { + yy2950 := *x.TailLines + yym2951 := z.EncBinary() + _ = yym2951 + if false { + } else { + r.EncodeInt(int64(yy2950)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2928[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tailLines")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TailLines == nil { + r.EncodeNil() + } else { + yy2952 := *x.TailLines + yym2953 := z.EncBinary() + _ = yym2953 + if false { + } else { + r.EncodeInt(int64(yy2952)) + } + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[7] { + if x.LimitBytes == nil { + r.EncodeNil() + } else { + yy2955 := *x.LimitBytes + yym2956 := z.EncBinary() + _ = yym2956 + if false { + } else { + r.EncodeInt(int64(yy2955)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq2928[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("limitBytes")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.LimitBytes == nil { + r.EncodeNil() + } else { + yy2957 := *x.LimitBytes + yym2958 := z.EncBinary() + _ = yym2958 + if false { + } else { + r.EncodeInt(int64(yy2957)) + } + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[8] { + yym2960 := z.EncBinary() + _ = yym2960 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2928[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2961 := z.EncBinary() + _ = yym2961 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2928[9] { + yym2963 := z.EncBinary() + _ = yym2963 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2928[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym2964 := z.EncBinary() + _ = yym2964 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2928 || yy2arr2928 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodLogOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym2965 := z.DecBinary() + _ = yym2965 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct2966 := r.ContainerType() + if yyct2966 == codecSelferValueTypeMap1234 { + yyl2966 := r.ReadMapStart() + if yyl2966 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl2966, d) + } + } else if yyct2966 == codecSelferValueTypeArray1234 { + yyl2966 := r.ReadArrayStart() + if yyl2966 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl2966, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys2967Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys2967Slc + var yyhl2967 bool = l >= 0 + for yyj2967 := 0; ; yyj2967++ { + if yyhl2967 { + if yyj2967 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys2967Slc = r.DecodeBytes(yys2967Slc, true, true) + yys2967 := string(yys2967Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys2967 { case "container": if r.TryDecodeAsNil() { x.Container = "" @@ -35543,8 +37671,8 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.SinceSeconds == nil { x.SinceSeconds = new(int64) } - yym2825 := z.DecBinary() - _ = yym2825 + yym2972 := z.DecBinary() + _ = yym2972 if false { } else { *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) @@ -35559,13 +37687,13 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.SinceTime == nil { x.SinceTime = new(pkg2_unversioned.Time) } - yym2827 := z.DecBinary() - _ = yym2827 + yym2974 := z.DecBinary() + _ = yym2974 if false { } else if z.HasExtensions() && z.DecExt(x.SinceTime) { - } else if yym2827 { + } else if yym2974 { z.DecBinaryUnmarshal(x.SinceTime) - } else if !yym2827 && z.IsJSONHandle() { + } else if !yym2974 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.SinceTime) } else { z.DecFallback(x.SinceTime, false) @@ -35586,8 +37714,8 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TailLines == nil { x.TailLines = new(int64) } - yym2830 := z.DecBinary() - _ = yym2830 + yym2977 := z.DecBinary() + _ = yym2977 if false { } else { *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) @@ -35602,521 +37730,13 @@ func (x *PodLogOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.LimitBytes == nil { x.LimitBytes = new(int64) } - yym2832 := z.DecBinary() - _ = yym2832 + yym2979 := z.DecBinary() + _ = yym2979 if false { } else { *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) } } - default: - z.DecStructFieldNotFound(-1, yys2818) - } // end switch yys2818 - } // end for yyj2818 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodLogOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2833 int - var yyb2833 bool - var yyhl2833 bool = l >= 0 - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Follow = false - } else { - x.Follow = bool(r.DecodeBool()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Previous = false - } else { - x.Previous = bool(r.DecodeBool()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SinceSeconds != nil { - x.SinceSeconds = nil - } - } else { - if x.SinceSeconds == nil { - x.SinceSeconds = new(int64) - } - yym2840 := z.DecBinary() - _ = yym2840 - if false { - } else { - *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) - } - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SinceTime != nil { - x.SinceTime = nil - } - } else { - if x.SinceTime == nil { - x.SinceTime = new(pkg2_unversioned.Time) - } - yym2842 := z.DecBinary() - _ = yym2842 - if false { - } else if z.HasExtensions() && z.DecExt(x.SinceTime) { - } else if yym2842 { - z.DecBinaryUnmarshal(x.SinceTime) - } else if !yym2842 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.SinceTime) - } else { - z.DecFallback(x.SinceTime, false) - } - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Timestamps = false - } else { - x.Timestamps = bool(r.DecodeBool()) - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.TailLines != nil { - x.TailLines = nil - } - } else { - if x.TailLines == nil { - x.TailLines = new(int64) - } - yym2845 := z.DecBinary() - _ = yym2845 - if false { - } else { - *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) - } - } - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.LimitBytes != nil { - x.LimitBytes = nil - } - } else { - if x.LimitBytes == nil { - x.LimitBytes = new(int64) - } - yym2847 := z.DecBinary() - _ = yym2847 - if false { - } else { - *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) - } - } - for { - yyj2833++ - if yyhl2833 { - yyb2833 = yyj2833 > l - } else { - yyb2833 = r.CheckBreak() - } - if yyb2833 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2833-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodAttachOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2848 := z.EncBinary() - _ = yym2848 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2849 := !z.EncBinary() - yy2arr2849 := z.EncBasicHandle().StructToArray - var yyq2849 [7]bool - _, _, _ = yysep2849, yyq2849, yy2arr2849 - const yyr2849 bool = false - yyq2849[0] = x.Kind != "" - yyq2849[1] = x.APIVersion != "" - yyq2849[2] = x.Stdin != false - yyq2849[3] = x.Stdout != false - yyq2849[4] = x.Stderr != false - yyq2849[5] = x.TTY != false - yyq2849[6] = x.Container != "" - var yynn2849 int - if yyr2849 || yy2arr2849 { - r.EncodeArrayStart(7) - } else { - yynn2849 = 0 - for _, b := range yyq2849 { - if b { - yynn2849++ - } - } - r.EncodeMapStart(yynn2849) - yynn2849 = 0 - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[0] { - yym2851 := z.EncBinary() - _ = yym2851 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2849[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2852 := z.EncBinary() - _ = yym2852 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[1] { - yym2854 := z.EncBinary() - _ = yym2854 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2849[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2855 := z.EncBinary() - _ = yym2855 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[2] { - yym2857 := z.EncBinary() - _ = yym2857 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2849[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdin")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2858 := z.EncBinary() - _ = yym2858 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[3] { - yym2860 := z.EncBinary() - _ = yym2860 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2849[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdout")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2861 := z.EncBinary() - _ = yym2861 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[4] { - yym2863 := z.EncBinary() - _ = yym2863 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2849[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stderr")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2864 := z.EncBinary() - _ = yym2864 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[5] { - yym2866 := z.EncBinary() - _ = yym2866 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2849[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tty")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2867 := z.EncBinary() - _ = yym2867 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2849[6] { - yym2869 := z.EncBinary() - _ = yym2869 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2849[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2870 := z.EncBinary() - _ = yym2870 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - } - if yyr2849 || yy2arr2849 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodAttachOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2871 := z.DecBinary() - _ = yym2871 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2872 := r.ContainerType() - if yyct2872 == codecSelferValueTypeMap1234 { - yyl2872 := r.ReadMapStart() - if yyl2872 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2872, d) - } - } else if yyct2872 == codecSelferValueTypeArray1234 { - yyl2872 := r.ReadArrayStart() - if yyl2872 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2872, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2873Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2873Slc - var yyhl2873 bool = l >= 0 - for yyj2873 := 0; ; yyj2873++ { - if yyhl2873 { - if yyj2873 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2873Slc = r.DecodeBytes(yys2873Slc, true, true) - yys2873 := string(yys2873Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2873 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -36129,6 +37749,514 @@ func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys2967) + } // end switch yys2967 + } // end for yyj2967 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodLogOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj2982 int + var yyb2982 bool + var yyhl2982 bool = l >= 0 + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Follow = false + } else { + x.Follow = bool(r.DecodeBool()) + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Previous = false + } else { + x.Previous = bool(r.DecodeBool()) + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SinceSeconds != nil { + x.SinceSeconds = nil + } + } else { + if x.SinceSeconds == nil { + x.SinceSeconds = new(int64) + } + yym2987 := z.DecBinary() + _ = yym2987 + if false { + } else { + *((*int64)(x.SinceSeconds)) = int64(r.DecodeInt(64)) + } + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SinceTime != nil { + x.SinceTime = nil + } + } else { + if x.SinceTime == nil { + x.SinceTime = new(pkg2_unversioned.Time) + } + yym2989 := z.DecBinary() + _ = yym2989 + if false { + } else if z.HasExtensions() && z.DecExt(x.SinceTime) { + } else if yym2989 { + z.DecBinaryUnmarshal(x.SinceTime) + } else if !yym2989 && z.IsJSONHandle() { + z.DecJSONUnmarshal(x.SinceTime) + } else { + z.DecFallback(x.SinceTime, false) + } + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Timestamps = false + } else { + x.Timestamps = bool(r.DecodeBool()) + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.TailLines != nil { + x.TailLines = nil + } + } else { + if x.TailLines == nil { + x.TailLines = new(int64) + } + yym2992 := z.DecBinary() + _ = yym2992 + if false { + } else { + *((*int64)(x.TailLines)) = int64(r.DecodeInt(64)) + } + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.LimitBytes != nil { + x.LimitBytes = nil + } + } else { + if x.LimitBytes == nil { + x.LimitBytes = new(int64) + } + yym2994 := z.DecBinary() + _ = yym2994 + if false { + } else { + *((*int64)(x.LimitBytes)) = int64(r.DecodeInt(64)) + } + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj2982++ + if yyhl2982 { + yyb2982 = yyj2982 > l + } else { + yyb2982 = r.CheckBreak() + } + if yyb2982 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj2982-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodAttachOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym2997 := z.EncBinary() + _ = yym2997 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep2998 := !z.EncBinary() + yy2arr2998 := z.EncBasicHandle().StructToArray + var yyq2998 [7]bool + _, _, _ = yysep2998, yyq2998, yy2arr2998 + const yyr2998 bool = false + yyq2998[0] = x.Stdin != false + yyq2998[1] = x.Stdout != false + yyq2998[2] = x.Stderr != false + yyq2998[3] = x.TTY != false + yyq2998[4] = x.Container != "" + yyq2998[5] = x.Kind != "" + yyq2998[6] = x.APIVersion != "" + var yynn2998 int + if yyr2998 || yy2arr2998 { + r.EncodeArrayStart(7) + } else { + yynn2998 = 0 + for _, b := range yyq2998 { + if b { + yynn2998++ + } + } + r.EncodeMapStart(yynn2998) + yynn2998 = 0 + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[0] { + yym3000 := z.EncBinary() + _ = yym3000 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2998[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdin")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3001 := z.EncBinary() + _ = yym3001 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[1] { + yym3003 := z.EncBinary() + _ = yym3003 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2998[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdout")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3004 := z.EncBinary() + _ = yym3004 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[2] { + yym3006 := z.EncBinary() + _ = yym3006 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2998[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stderr")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3007 := z.EncBinary() + _ = yym3007 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[3] { + yym3009 := z.EncBinary() + _ = yym3009 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq2998[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tty")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3010 := z.EncBinary() + _ = yym3010 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[4] { + yym3012 := z.EncBinary() + _ = yym3012 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2998[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3013 := z.EncBinary() + _ = yym3013 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[5] { + yym3015 := z.EncBinary() + _ = yym3015 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2998[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3016 := z.EncBinary() + _ = yym3016 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2998[6] { + yym3018 := z.EncBinary() + _ = yym3018 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2998[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3019 := z.EncBinary() + _ = yym3019 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr2998 || yy2arr2998 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodAttachOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3020 := z.DecBinary() + _ = yym3020 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3021 := r.ContainerType() + if yyct3021 == codecSelferValueTypeMap1234 { + yyl3021 := r.ReadMapStart() + if yyl3021 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3021, d) + } + } else if yyct3021 == codecSelferValueTypeArray1234 { + yyl3021 := r.ReadArrayStart() + if yyl3021 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3021, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3022Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3022Slc + var yyhl3022 bool = l >= 0 + for yyj3022 := 0; ; yyj3022++ { + if yyhl3022 { + if yyj3022 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3022Slc = r.DecodeBytes(yys3022Slc, true, true) + yys3022 := string(yys3022Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3022 { case "stdin": if r.TryDecodeAsNil() { x.Stdin = false @@ -36159,448 +38287,6 @@ func (x *PodAttachOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Container = string(r.DecodeString()) } - default: - z.DecStructFieldNotFound(-1, yys2873) - } // end switch yys2873 - } // end for yyj2873 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodAttachOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2881 int - var yyb2881 bool - var yyhl2881 bool = l >= 0 - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdin = false - } else { - x.Stdin = bool(r.DecodeBool()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdout = false - } else { - x.Stdout = bool(r.DecodeBool()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stderr = false - } else { - x.Stderr = bool(r.DecodeBool()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TTY = false - } else { - x.TTY = bool(r.DecodeBool()) - } - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - for { - yyj2881++ - if yyhl2881 { - yyb2881 = yyj2881 > l - } else { - yyb2881 = r.CheckBreak() - } - if yyb2881 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2881-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodExecOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2889 := z.EncBinary() - _ = yym2889 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2890 := !z.EncBinary() - yy2arr2890 := z.EncBasicHandle().StructToArray - var yyq2890 [8]bool - _, _, _ = yysep2890, yyq2890, yy2arr2890 - const yyr2890 bool = false - yyq2890[0] = x.Kind != "" - yyq2890[1] = x.APIVersion != "" - yyq2890[2] = x.Stdin != false - yyq2890[3] = x.Stdout != false - yyq2890[4] = x.Stderr != false - yyq2890[5] = x.TTY != false - yyq2890[6] = x.Container != "" - var yynn2890 int - if yyr2890 || yy2arr2890 { - r.EncodeArrayStart(8) - } else { - yynn2890 = 1 - for _, b := range yyq2890 { - if b { - yynn2890++ - } - } - r.EncodeMapStart(yynn2890) - yynn2890 = 0 - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[0] { - yym2892 := z.EncBinary() - _ = yym2892 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2890[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2893 := z.EncBinary() - _ = yym2893 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[1] { - yym2895 := z.EncBinary() - _ = yym2895 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2890[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2896 := z.EncBinary() - _ = yym2896 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[2] { - yym2898 := z.EncBinary() - _ = yym2898 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2890[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdin")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2899 := z.EncBinary() - _ = yym2899 - if false { - } else { - r.EncodeBool(bool(x.Stdin)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[3] { - yym2901 := z.EncBinary() - _ = yym2901 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2890[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stdout")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2902 := z.EncBinary() - _ = yym2902 - if false { - } else { - r.EncodeBool(bool(x.Stdout)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[4] { - yym2904 := z.EncBinary() - _ = yym2904 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2890[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("stderr")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2905 := z.EncBinary() - _ = yym2905 - if false { - } else { - r.EncodeBool(bool(x.Stderr)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[5] { - yym2907 := z.EncBinary() - _ = yym2907 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2890[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("tty")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2908 := z.EncBinary() - _ = yym2908 - if false { - } else { - r.EncodeBool(bool(x.TTY)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2890[6] { - yym2910 := z.EncBinary() - _ = yym2910 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2890[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("container")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2911 := z.EncBinary() - _ = yym2911 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Container)) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Command == nil { - r.EncodeNil() - } else { - yym2913 := z.EncBinary() - _ = yym2913 - if false { - } else { - z.F.EncSliceStringV(x.Command, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("command")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Command == nil { - r.EncodeNil() - } else { - yym2914 := z.EncBinary() - _ = yym2914 - if false { - } else { - z.F.EncSliceStringV(x.Command, false, e) - } - } - } - if yyr2890 || yy2arr2890 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodExecOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2915 := z.DecBinary() - _ = yym2915 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2916 := r.ContainerType() - if yyct2916 == codecSelferValueTypeMap1234 { - yyl2916 := r.ReadMapStart() - if yyl2916 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2916, d) - } - } else if yyct2916 == codecSelferValueTypeArray1234 { - yyl2916 := r.ReadArrayStart() - if yyl2916 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2916, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2917Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2917Slc - var yyhl2917 bool = l >= 0 - for yyj2917 := 0; ; yyj2917++ { - if yyhl2917 { - if yyj2917 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2917Slc = r.DecodeBytes(yys2917Slc, true, true) - yys2917 := string(yys2917Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2917 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -36613,6 +38299,448 @@ func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys3022) + } // end switch yys3022 + } // end for yyj3022 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodAttachOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3030 int + var yyb3030 bool + var yyhl3030 bool = l >= 0 + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdin = false + } else { + x.Stdin = bool(r.DecodeBool()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdout = false + } else { + x.Stdout = bool(r.DecodeBool()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stderr = false + } else { + x.Stderr = bool(r.DecodeBool()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TTY = false + } else { + x.TTY = bool(r.DecodeBool()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3030++ + if yyhl3030 { + yyb3030 = yyj3030 > l + } else { + yyb3030 = r.CheckBreak() + } + if yyb3030 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3030-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodExecOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3038 := z.EncBinary() + _ = yym3038 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3039 := !z.EncBinary() + yy2arr3039 := z.EncBasicHandle().StructToArray + var yyq3039 [8]bool + _, _, _ = yysep3039, yyq3039, yy2arr3039 + const yyr3039 bool = false + yyq3039[0] = x.Stdin != false + yyq3039[1] = x.Stdout != false + yyq3039[2] = x.Stderr != false + yyq3039[3] = x.TTY != false + yyq3039[4] = x.Container != "" + yyq3039[6] = x.Kind != "" + yyq3039[7] = x.APIVersion != "" + var yynn3039 int + if yyr3039 || yy2arr3039 { + r.EncodeArrayStart(8) + } else { + yynn3039 = 1 + for _, b := range yyq3039 { + if b { + yynn3039++ + } + } + r.EncodeMapStart(yynn3039) + yynn3039 = 0 + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[0] { + yym3041 := z.EncBinary() + _ = yym3041 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3039[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdin")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3042 := z.EncBinary() + _ = yym3042 + if false { + } else { + r.EncodeBool(bool(x.Stdin)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[1] { + yym3044 := z.EncBinary() + _ = yym3044 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3039[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stdout")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3045 := z.EncBinary() + _ = yym3045 + if false { + } else { + r.EncodeBool(bool(x.Stdout)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[2] { + yym3047 := z.EncBinary() + _ = yym3047 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3039[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("stderr")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3048 := z.EncBinary() + _ = yym3048 + if false { + } else { + r.EncodeBool(bool(x.Stderr)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[3] { + yym3050 := z.EncBinary() + _ = yym3050 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq3039[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tty")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3051 := z.EncBinary() + _ = yym3051 + if false { + } else { + r.EncodeBool(bool(x.TTY)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[4] { + yym3053 := z.EncBinary() + _ = yym3053 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3039[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("container")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3054 := z.EncBinary() + _ = yym3054 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Container)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Command == nil { + r.EncodeNil() + } else { + yym3056 := z.EncBinary() + _ = yym3056 + if false { + } else { + z.F.EncSliceStringV(x.Command, false, e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("command")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Command == nil { + r.EncodeNil() + } else { + yym3057 := z.EncBinary() + _ = yym3057 + if false { + } else { + z.F.EncSliceStringV(x.Command, false, e) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[6] { + yym3059 := z.EncBinary() + _ = yym3059 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3039[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3060 := z.EncBinary() + _ = yym3060 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3039[7] { + yym3062 := z.EncBinary() + _ = yym3062 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3039[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3063 := z.EncBinary() + _ = yym3063 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3039 || yy2arr3039 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodExecOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3064 := z.DecBinary() + _ = yym3064 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3065 := r.ContainerType() + if yyct3065 == codecSelferValueTypeMap1234 { + yyl3065 := r.ReadMapStart() + if yyl3065 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3065, d) + } + } else if yyct3065 == codecSelferValueTypeArray1234 { + yyl3065 := r.ReadArrayStart() + if yyl3065 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3065, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3066Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3066Slc + var yyhl3066 bool = l >= 0 + for yyj3066 := 0; ; yyj3066++ { + if yyhl3066 { + if yyj3066 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3066Slc = r.DecodeBytes(yys3066Slc, true, true) + yys3066 := string(yys3066Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3066 { case "stdin": if r.TryDecodeAsNil() { x.Stdin = false @@ -36647,347 +38775,14 @@ func (x *PodExecOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Command = nil } else { - yyv2925 := &x.Command - yym2926 := z.DecBinary() - _ = yym2926 + yyv3072 := &x.Command + yym3073 := z.DecBinary() + _ = yym3073 if false { } else { - z.F.DecSliceStringX(yyv2925, false, d) + z.F.DecSliceStringX(yyv3072, false, d) } } - default: - z.DecStructFieldNotFound(-1, yys2917) - } // end switch yys2917 - } // end for yyj2917 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *PodExecOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj2927 int - var yyb2927 bool - var yyhl2927 bool = l >= 0 - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdin = false - } else { - x.Stdin = bool(r.DecodeBool()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stdout = false - } else { - x.Stdout = bool(r.DecodeBool()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Stderr = false - } else { - x.Stderr = bool(r.DecodeBool()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TTY = false - } else { - x.TTY = bool(r.DecodeBool()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Container = "" - } else { - x.Container = string(r.DecodeString()) - } - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Command = nil - } else { - yyv2935 := &x.Command - yym2936 := z.DecBinary() - _ = yym2936 - if false { - } else { - z.F.DecSliceStringX(yyv2935, false, d) - } - } - for { - yyj2927++ - if yyhl2927 { - yyb2927 = yyj2927 > l - } else { - yyb2927 = r.CheckBreak() - } - if yyb2927 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2927-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *PodProxyOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym2937 := z.EncBinary() - _ = yym2937 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2938 := !z.EncBinary() - yy2arr2938 := z.EncBasicHandle().StructToArray - var yyq2938 [3]bool - _, _, _ = yysep2938, yyq2938, yy2arr2938 - const yyr2938 bool = false - yyq2938[0] = x.Kind != "" - yyq2938[1] = x.APIVersion != "" - yyq2938[2] = x.Path != "" - var yynn2938 int - if yyr2938 || yy2arr2938 { - r.EncodeArrayStart(3) - } else { - yynn2938 = 0 - for _, b := range yyq2938 { - if b { - yynn2938++ - } - } - r.EncodeMapStart(yynn2938) - yynn2938 = 0 - } - if yyr2938 || yy2arr2938 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2938[0] { - yym2940 := z.EncBinary() - _ = yym2940 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2938[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2941 := z.EncBinary() - _ = yym2941 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2938 || yy2arr2938 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2938[1] { - yym2943 := z.EncBinary() - _ = yym2943 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2938[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2944 := z.EncBinary() - _ = yym2944 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2938 || yy2arr2938 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2938[2] { - yym2946 := z.EncBinary() - _ = yym2946 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2938[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("path")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2947 := z.EncBinary() - _ = yym2947 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } - } - if yyr2938 || yy2arr2938 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *PodProxyOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym2948 := z.DecBinary() - _ = yym2948 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2949 := r.ContainerType() - if yyct2949 == codecSelferValueTypeMap1234 { - yyl2949 := r.ReadMapStart() - if yyl2949 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl2949, d) - } - } else if yyct2949 == codecSelferValueTypeArray1234 { - yyl2949 := r.ReadArrayStart() - if yyl2949 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl2949, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys2950Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2950Slc - var yyhl2950 bool = l >= 0 - for yyj2950 := 0; ; yyj2950++ { - if yyhl2950 { - if yyj2950 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2950Slc = r.DecodeBytes(yys2950Slc, true, true) - yys2950 := string(yys2950Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2950 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -37000,33 +38795,129 @@ func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "path": - if r.TryDecodeAsNil() { - x.Path = "" - } else { - x.Path = string(r.DecodeString()) - } default: - z.DecStructFieldNotFound(-1, yys2950) - } // end switch yys2950 - } // end for yyj2950 + z.DecStructFieldNotFound(-1, yys3066) + } // end switch yys3066 + } // end for yyj3066 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *PodExecOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2954 int - var yyb2954 bool - var yyhl2954 bool = l >= 0 - yyj2954++ - if yyhl2954 { - yyb2954 = yyj2954 > l + var yyj3076 int + var yyb3076 bool + var yyhl3076 bool = l >= 0 + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l } else { - yyb2954 = r.CheckBreak() + yyb3076 = r.CheckBreak() } - if yyb2954 { + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdin = false + } else { + x.Stdin = bool(r.DecodeBool()) + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stdout = false + } else { + x.Stdout = bool(r.DecodeBool()) + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Stderr = false + } else { + x.Stderr = bool(r.DecodeBool()) + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TTY = false + } else { + x.TTY = bool(r.DecodeBool()) + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Container = "" + } else { + x.Container = string(r.DecodeString()) + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Command = nil + } else { + yyv3082 := &x.Command + yym3083 := z.DecBinary() + _ = yym3083 + if false { + } else { + z.F.DecSliceStringX(yyv3082, false, d) + } + } + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37036,13 +38927,13 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj2954++ - if yyhl2954 { - yyb2954 = yyj2954 > l + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l } else { - yyb2954 = r.CheckBreak() + yyb3076 = r.CheckBreak() } - if yyb2954 { + if yyb3076 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37052,13 +38943,230 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj2954++ - if yyhl2954 { - yyb2954 = yyj2954 > l - } else { - yyb2954 = r.CheckBreak() + for { + yyj3076++ + if yyhl3076 { + yyb3076 = yyj3076 > l + } else { + yyb3076 = r.CheckBreak() + } + if yyb3076 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3076-1, "") } - if yyb2954 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodProxyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3086 := z.EncBinary() + _ = yym3086 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3087 := !z.EncBinary() + yy2arr3087 := z.EncBasicHandle().StructToArray + var yyq3087 [3]bool + _, _, _ = yysep3087, yyq3087, yy2arr3087 + const yyr3087 bool = false + yyq3087[0] = x.Path != "" + yyq3087[1] = x.Kind != "" + yyq3087[2] = x.APIVersion != "" + var yynn3087 int + if yyr3087 || yy2arr3087 { + r.EncodeArrayStart(3) + } else { + yynn3087 = 0 + for _, b := range yyq3087 { + if b { + yynn3087++ + } + } + r.EncodeMapStart(yynn3087) + yynn3087 = 0 + } + if yyr3087 || yy2arr3087 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3087[0] { + yym3089 := z.EncBinary() + _ = yym3089 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3087[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("path")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3090 := z.EncBinary() + _ = yym3090 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } + } + if yyr3087 || yy2arr3087 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3087[1] { + yym3092 := z.EncBinary() + _ = yym3092 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3087[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3093 := z.EncBinary() + _ = yym3093 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3087 || yy2arr3087 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3087[2] { + yym3095 := z.EncBinary() + _ = yym3095 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3087[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3096 := z.EncBinary() + _ = yym3096 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3087 || yy2arr3087 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodProxyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3097 := z.DecBinary() + _ = yym3097 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3098 := r.ContainerType() + if yyct3098 == codecSelferValueTypeMap1234 { + yyl3098 := r.ReadMapStart() + if yyl3098 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3098, d) + } + } else if yyct3098 == codecSelferValueTypeArray1234 { + yyl3098 := r.ReadArrayStart() + if yyl3098 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3098, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3099Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3099Slc + var yyhl3099 bool = l >= 0 + for yyj3099 := 0; ; yyj3099++ { + if yyhl3099 { + if yyj3099 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3099Slc = r.DecodeBytes(yys3099Slc, true, true) + yys3099 := string(yys3099Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3099 { + case "path": + if r.TryDecodeAsNil() { + x.Path = "" + } else { + x.Path = string(r.DecodeString()) + } + 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, yys3099) + } // end switch yys3099 + } // end for yyj3099 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3103 int + var yyb3103 bool + var yyhl3103 bool = l >= 0 + yyj3103++ + if yyhl3103 { + yyb3103 = yyj3103 > l + } else { + yyb3103 = r.CheckBreak() + } + if yyb3103 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37068,18 +39176,50 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } + yyj3103++ + if yyhl3103 { + yyb3103 = yyj3103 > l + } else { + yyb3103 = r.CheckBreak() + } + if yyb3103 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3103++ + if yyhl3103 { + yyb3103 = yyj3103 > l + } else { + yyb3103 = r.CheckBreak() + } + if yyb3103 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj2954++ - if yyhl2954 { - yyb2954 = yyj2954 > l + yyj3103++ + if yyhl3103 { + yyb3103 = yyj3103 > l } else { - yyb2954 = r.CheckBreak() + yyb3103 = r.CheckBreak() } - if yyb2954 { + if yyb3103 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2954-1, "") + z.DecStructFieldNotFound(yyj3103-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37091,41 +39231,41 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2958 := z.EncBinary() - _ = yym2958 + yym3107 := z.EncBinary() + _ = yym3107 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep2959 := !z.EncBinary() - yy2arr2959 := z.EncBasicHandle().StructToArray - var yyq2959 [7]bool - _, _, _ = yysep2959, yyq2959, yy2arr2959 - const yyr2959 bool = false - yyq2959[0] = x.Kind != "" - yyq2959[1] = x.Namespace != "" - yyq2959[2] = x.Name != "" - yyq2959[3] = x.UID != "" - yyq2959[4] = x.APIVersion != "" - yyq2959[5] = x.ResourceVersion != "" - yyq2959[6] = x.FieldPath != "" - var yynn2959 int - if yyr2959 || yy2arr2959 { + yysep3108 := !z.EncBinary() + yy2arr3108 := z.EncBasicHandle().StructToArray + var yyq3108 [7]bool + _, _, _ = yysep3108, yyq3108, yy2arr3108 + const yyr3108 bool = false + yyq3108[0] = x.Kind != "" + yyq3108[1] = x.Namespace != "" + yyq3108[2] = x.Name != "" + yyq3108[3] = x.UID != "" + yyq3108[4] = x.APIVersion != "" + yyq3108[5] = x.ResourceVersion != "" + yyq3108[6] = x.FieldPath != "" + var yynn3108 int + if yyr3108 || yy2arr3108 { r.EncodeArrayStart(7) } else { - yynn2959 = 0 - for _, b := range yyq2959 { + yynn3108 = 0 + for _, b := range yyq3108 { if b { - yynn2959++ + yynn3108++ } } - r.EncodeMapStart(yynn2959) - yynn2959 = 0 + r.EncodeMapStart(yynn3108) + yynn3108 = 0 } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[0] { - yym2961 := z.EncBinary() - _ = yym2961 + if yyq3108[0] { + yym3110 := z.EncBinary() + _ = yym3110 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -37134,23 +39274,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[0] { + if yyq3108[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2962 := z.EncBinary() - _ = yym2962 + yym3111 := z.EncBinary() + _ = yym3111 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[1] { - yym2964 := z.EncBinary() - _ = yym2964 + if yyq3108[1] { + yym3113 := z.EncBinary() + _ = yym3113 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) @@ -37159,23 +39299,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[1] { + if yyq3108[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("namespace")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2965 := z.EncBinary() - _ = yym2965 + yym3114 := z.EncBinary() + _ = yym3114 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[2] { - yym2967 := z.EncBinary() - _ = yym2967 + if yyq3108[2] { + yym3116 := z.EncBinary() + _ = yym3116 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -37184,23 +39324,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[2] { + if yyq3108[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2968 := z.EncBinary() - _ = yym2968 + yym3117 := z.EncBinary() + _ = yym3117 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[3] { - yym2970 := z.EncBinary() - _ = yym2970 + if yyq3108[3] { + yym3119 := z.EncBinary() + _ = yym3119 if false { } else if z.HasExtensions() && z.EncExt(x.UID) { } else { @@ -37210,12 +39350,12 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[3] { + if yyq3108[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("uid")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2971 := z.EncBinary() - _ = yym2971 + yym3120 := z.EncBinary() + _ = yym3120 if false { } else if z.HasExtensions() && z.EncExt(x.UID) { } else { @@ -37223,11 +39363,11 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[4] { - yym2973 := z.EncBinary() - _ = yym2973 + if yyq3108[4] { + yym3122 := z.EncBinary() + _ = yym3122 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -37236,23 +39376,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[4] { + if yyq3108[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2974 := z.EncBinary() - _ = yym2974 + yym3123 := z.EncBinary() + _ = yym3123 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[5] { - yym2976 := z.EncBinary() - _ = yym2976 + if yyq3108[5] { + yym3125 := z.EncBinary() + _ = yym3125 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) @@ -37261,23 +39401,23 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[5] { + if yyq3108[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2977 := z.EncBinary() - _ = yym2977 + yym3126 := z.EncBinary() + _ = yym3126 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2959[6] { - yym2979 := z.EncBinary() - _ = yym2979 + if yyq3108[6] { + yym3128 := z.EncBinary() + _ = yym3128 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) @@ -37286,19 +39426,19 @@ func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq2959[6] { + if yyq3108[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym2980 := z.EncBinary() - _ = yym2980 + yym3129 := z.EncBinary() + _ = yym3129 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.FieldPath)) } } } - if yyr2959 || yy2arr2959 { + if yyr3108 || yy2arr3108 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -37311,25 +39451,25 @@ func (x *ObjectReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym2981 := z.DecBinary() - _ = yym2981 + yym3130 := z.DecBinary() + _ = yym3130 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct2982 := r.ContainerType() - if yyct2982 == codecSelferValueTypeMap1234 { - yyl2982 := r.ReadMapStart() - if yyl2982 == 0 { + yyct3131 := r.ContainerType() + if yyct3131 == codecSelferValueTypeMap1234 { + yyl3131 := r.ReadMapStart() + if yyl3131 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl2982, d) + x.codecDecodeSelfFromMap(yyl3131, d) } - } else if yyct2982 == codecSelferValueTypeArray1234 { - yyl2982 := r.ReadArrayStart() - if yyl2982 == 0 { + } else if yyct3131 == codecSelferValueTypeArray1234 { + yyl3131 := r.ReadArrayStart() + if yyl3131 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl2982, d) + x.codecDecodeSelfFromArray(yyl3131, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -37341,12 +39481,12 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys2983Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys2983Slc - var yyhl2983 bool = l >= 0 - for yyj2983 := 0; ; yyj2983++ { - if yyhl2983 { - if yyj2983 >= l { + var yys3132Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3132Slc + var yyhl3132 bool = l >= 0 + for yyj3132 := 0; ; yyj3132++ { + if yyhl3132 { + if yyj3132 >= l { break } } else { @@ -37355,10 +39495,10 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys2983Slc = r.DecodeBytes(yys2983Slc, true, true) - yys2983 := string(yys2983Slc) + yys3132Slc = r.DecodeBytes(yys3132Slc, true, true) + yys3132 := string(yys3132Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys2983 { + switch yys3132 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -37402,9 +39542,9 @@ func (x *ObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.FieldPath = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys2983) - } // end switch yys2983 - } // end for yyj2983 + z.DecStructFieldNotFound(-1, yys3132) + } // end switch yys3132 + } // end for yyj3132 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -37412,16 +39552,16 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj2991 int - var yyb2991 bool - var yyhl2991 bool = l >= 0 - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + var yyj3140 int + var yyb3140 bool + var yyhl3140 bool = l >= 0 + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37431,13 +39571,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37447,13 +39587,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Namespace = string(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37463,13 +39603,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Name = string(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37479,13 +39619,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.UID = pkg1_types.UID(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37495,13 +39635,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37511,13 +39651,13 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.ResourceVersion = string(r.DecodeString()) } - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37528,17 +39668,17 @@ func (x *ObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.FieldPath = string(r.DecodeString()) } for { - yyj2991++ - if yyhl2991 { - yyb2991 = yyj2991 > l + yyj3140++ + if yyhl3140 { + yyb3140 = yyj3140 > l } else { - yyb2991 = r.CheckBreak() + yyb3140 = r.CheckBreak() } - if yyb2991 { + if yyb3140 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj2991-1, "") + z.DecStructFieldNotFound(yyj3140-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37550,35 +39690,35 @@ func (x *LocalObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym2999 := z.EncBinary() - _ = yym2999 + yym3148 := z.EncBinary() + _ = yym3148 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3000 := !z.EncBinary() - yy2arr3000 := z.EncBasicHandle().StructToArray - var yyq3000 [1]bool - _, _, _ = yysep3000, yyq3000, yy2arr3000 - const yyr3000 bool = false - yyq3000[0] = x.Name != "" - var yynn3000 int - if yyr3000 || yy2arr3000 { + yysep3149 := !z.EncBinary() + yy2arr3149 := z.EncBasicHandle().StructToArray + var yyq3149 [1]bool + _, _, _ = yysep3149, yyq3149, yy2arr3149 + const yyr3149 bool = false + yyq3149[0] = x.Name != "" + var yynn3149 int + if yyr3149 || yy2arr3149 { r.EncodeArrayStart(1) } else { - yynn3000 = 0 - for _, b := range yyq3000 { + yynn3149 = 0 + for _, b := range yyq3149 { if b { - yynn3000++ + yynn3149++ } } - r.EncodeMapStart(yynn3000) - yynn3000 = 0 + r.EncodeMapStart(yynn3149) + yynn3149 = 0 } - if yyr3000 || yy2arr3000 { + if yyr3149 || yy2arr3149 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3000[0] { - yym3002 := z.EncBinary() - _ = yym3002 + if yyq3149[0] { + yym3151 := z.EncBinary() + _ = yym3151 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -37587,19 +39727,19 @@ func (x *LocalObjectReference) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3000[0] { + if yyq3149[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3003 := z.EncBinary() - _ = yym3003 + yym3152 := z.EncBinary() + _ = yym3152 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } } - if yyr3000 || yy2arr3000 { + if yyr3149 || yy2arr3149 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -37612,25 +39752,25 @@ func (x *LocalObjectReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3004 := z.DecBinary() - _ = yym3004 + yym3153 := z.DecBinary() + _ = yym3153 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3005 := r.ContainerType() - if yyct3005 == codecSelferValueTypeMap1234 { - yyl3005 := r.ReadMapStart() - if yyl3005 == 0 { + yyct3154 := r.ContainerType() + if yyct3154 == codecSelferValueTypeMap1234 { + yyl3154 := r.ReadMapStart() + if yyl3154 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3005, d) + x.codecDecodeSelfFromMap(yyl3154, d) } - } else if yyct3005 == codecSelferValueTypeArray1234 { - yyl3005 := r.ReadArrayStart() - if yyl3005 == 0 { + } else if yyct3154 == codecSelferValueTypeArray1234 { + yyl3154 := r.ReadArrayStart() + if yyl3154 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3005, d) + x.codecDecodeSelfFromArray(yyl3154, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -37642,12 +39782,12 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3006Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3006Slc - var yyhl3006 bool = l >= 0 - for yyj3006 := 0; ; yyj3006++ { - if yyhl3006 { - if yyj3006 >= l { + var yys3155Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3155Slc + var yyhl3155 bool = l >= 0 + for yyj3155 := 0; ; yyj3155++ { + if yyhl3155 { + if yyj3155 >= l { break } } else { @@ -37656,10 +39796,10 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3006Slc = r.DecodeBytes(yys3006Slc, true, true) - yys3006 := string(yys3006Slc) + yys3155Slc = r.DecodeBytes(yys3155Slc, true, true) + yys3155 := string(yys3155Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3006 { + switch yys3155 { case "name": if r.TryDecodeAsNil() { x.Name = "" @@ -37667,9 +39807,9 @@ func (x *LocalObjectReference) codecDecodeSelfFromMap(l int, d *codec1978.Decode x.Name = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3006) - } // end switch yys3006 - } // end for yyj3006 + z.DecStructFieldNotFound(-1, yys3155) + } // end switch yys3155 + } // end for yyj3155 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -37677,16 +39817,16 @@ func (x *LocalObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3008 int - var yyb3008 bool - var yyhl3008 bool = l >= 0 - yyj3008++ - if yyhl3008 { - yyb3008 = yyj3008 > l + var yyj3157 int + var yyb3157 bool + var yyhl3157 bool = l >= 0 + yyj3157++ + if yyhl3157 { + yyb3157 = yyj3157 > l } else { - yyb3008 = r.CheckBreak() + yyb3157 = r.CheckBreak() } - if yyb3008 { + if yyb3157 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37697,17 +39837,17 @@ func (x *LocalObjectReference) codecDecodeSelfFromArray(l int, d *codec1978.Deco x.Name = string(r.DecodeString()) } for { - yyj3008++ - if yyhl3008 { - yyb3008 = yyj3008 > l + yyj3157++ + if yyhl3157 { + yyb3157 = yyj3157 > l } else { - yyb3008 = r.CheckBreak() + yyb3157 = r.CheckBreak() } - if yyb3008 { + if yyb3157 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3008-1, "") + z.DecStructFieldNotFound(yyj3157-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37719,100 +39859,100 @@ func (x *SerializedReference) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3010 := z.EncBinary() - _ = yym3010 + yym3159 := z.EncBinary() + _ = yym3159 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3011 := !z.EncBinary() - yy2arr3011 := z.EncBasicHandle().StructToArray - var yyq3011 [3]bool - _, _, _ = yysep3011, yyq3011, yy2arr3011 - const yyr3011 bool = false - yyq3011[0] = x.Kind != "" - yyq3011[1] = x.APIVersion != "" - yyq3011[2] = true - var yynn3011 int - if yyr3011 || yy2arr3011 { + yysep3160 := !z.EncBinary() + yy2arr3160 := z.EncBasicHandle().StructToArray + var yyq3160 [3]bool + _, _, _ = yysep3160, yyq3160, yy2arr3160 + const yyr3160 bool = false + yyq3160[0] = true + yyq3160[1] = x.Kind != "" + yyq3160[2] = x.APIVersion != "" + var yynn3160 int + if yyr3160 || yy2arr3160 { r.EncodeArrayStart(3) } else { - yynn3011 = 0 - for _, b := range yyq3011 { + yynn3160 = 0 + for _, b := range yyq3160 { if b { - yynn3011++ + yynn3160++ } } - r.EncodeMapStart(yynn3011) - yynn3011 = 0 + r.EncodeMapStart(yynn3160) + yynn3160 = 0 } - if yyr3011 || yy2arr3011 { + if yyr3160 || yy2arr3160 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3011[0] { - yym3013 := z.EncBinary() - _ = yym3013 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3011[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3014 := z.EncBinary() - _ = yym3014 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3011 || yy2arr3011 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3011[1] { - yym3016 := z.EncBinary() - _ = yym3016 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3011[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3017 := z.EncBinary() - _ = yym3017 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3011 || yy2arr3011 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3011[2] { - yy3019 := &x.Reference - yy3019.CodecEncodeSelf(e) + if yyq3160[0] { + yy3162 := &x.Reference + yy3162.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3011[2] { + if yyq3160[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reference")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3020 := &x.Reference - yy3020.CodecEncodeSelf(e) + yy3163 := &x.Reference + yy3163.CodecEncodeSelf(e) } } - if yyr3011 || yy2arr3011 { + if yyr3160 || yy2arr3160 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3160[1] { + yym3165 := z.EncBinary() + _ = yym3165 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3160[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3166 := z.EncBinary() + _ = yym3166 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3160 || yy2arr3160 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3160[2] { + yym3168 := z.EncBinary() + _ = yym3168 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3160[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3169 := z.EncBinary() + _ = yym3169 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3160 || yy2arr3160 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -37825,25 +39965,25 @@ func (x *SerializedReference) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3021 := z.DecBinary() - _ = yym3021 + yym3170 := z.DecBinary() + _ = yym3170 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3022 := r.ContainerType() - if yyct3022 == codecSelferValueTypeMap1234 { - yyl3022 := r.ReadMapStart() - if yyl3022 == 0 { + yyct3171 := r.ContainerType() + if yyct3171 == codecSelferValueTypeMap1234 { + yyl3171 := r.ReadMapStart() + if yyl3171 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3022, d) + x.codecDecodeSelfFromMap(yyl3171, d) } - } else if yyct3022 == codecSelferValueTypeArray1234 { - yyl3022 := r.ReadArrayStart() - if yyl3022 == 0 { + } else if yyct3171 == codecSelferValueTypeArray1234 { + yyl3171 := r.ReadArrayStart() + if yyl3171 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3022, d) + x.codecDecodeSelfFromArray(yyl3171, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -37855,12 +39995,12 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3023Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3023Slc - var yyhl3023 bool = l >= 0 - for yyj3023 := 0; ; yyj3023++ { - if yyhl3023 { - if yyj3023 >= l { + var yys3172Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3172Slc + var yyhl3172 bool = l >= 0 + for yyj3172 := 0; ; yyj3172++ { + if yyhl3172 { + if yyj3172 >= l { break } } else { @@ -37869,10 +40009,17 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3023Slc = r.DecodeBytes(yys3023Slc, true, true) - yys3023 := string(yys3023Slc) + yys3172Slc = r.DecodeBytes(yys3172Slc, true, true) + yys3172 := string(yys3172Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3023 { + switch yys3172 { + case "reference": + if r.TryDecodeAsNil() { + x.Reference = ObjectReference{} + } else { + yyv3173 := &x.Reference + yyv3173.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -37885,17 +40032,10 @@ func (x *SerializedReference) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "reference": - if r.TryDecodeAsNil() { - x.Reference = ObjectReference{} - } else { - yyv3026 := &x.Reference - yyv3026.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys3023) - } // end switch yys3023 - } // end for yyj3023 + z.DecStructFieldNotFound(-1, yys3172) + } // end switch yys3172 + } // end for yyj3172 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -37903,16 +40043,33 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3027 int - var yyb3027 bool - var yyhl3027 bool = l >= 0 - yyj3027++ - if yyhl3027 { - yyb3027 = yyj3027 > l + var yyj3176 int + var yyb3176 bool + var yyhl3176 bool = l >= 0 + yyj3176++ + if yyhl3176 { + yyb3176 = yyj3176 > l } else { - yyb3027 = r.CheckBreak() + yyb3176 = r.CheckBreak() } - if yyb3027 { + if yyb3176 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Reference = ObjectReference{} + } else { + yyv3177 := &x.Reference + yyv3177.CodecDecodeSelf(d) + } + yyj3176++ + if yyhl3176 { + yyb3176 = yyj3176 > l + } else { + yyb3176 = r.CheckBreak() + } + if yyb3176 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37922,13 +40079,13 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj3027++ - if yyhl3027 { - yyb3027 = yyj3027 > l + yyj3176++ + if yyhl3176 { + yyb3176 = yyj3176 > l } else { - yyb3027 = r.CheckBreak() + yyb3176 = r.CheckBreak() } - if yyb3027 { + if yyb3176 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -37938,35 +40095,18 @@ func (x *SerializedReference) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj3027++ - if yyhl3027 { - yyb3027 = yyj3027 > l - } else { - yyb3027 = r.CheckBreak() - } - if yyb3027 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reference = ObjectReference{} - } else { - yyv3030 := &x.Reference - yyv3030.CodecDecodeSelf(d) - } for { - yyj3027++ - if yyhl3027 { - yyb3027 = yyj3027 > l + yyj3176++ + if yyhl3176 { + yyb3176 = yyj3176 > l } else { - yyb3027 = r.CheckBreak() + yyb3176 = r.CheckBreak() } - if yyb3027 { + if yyb3176 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3027-1, "") + z.DecStructFieldNotFound(yyj3176-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -37978,36 +40118,36 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3031 := z.EncBinary() - _ = yym3031 + yym3180 := z.EncBinary() + _ = yym3180 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3032 := !z.EncBinary() - yy2arr3032 := z.EncBasicHandle().StructToArray - var yyq3032 [2]bool - _, _, _ = yysep3032, yyq3032, yy2arr3032 - const yyr3032 bool = false - yyq3032[0] = x.Component != "" - yyq3032[1] = x.Host != "" - var yynn3032 int - if yyr3032 || yy2arr3032 { + yysep3181 := !z.EncBinary() + yy2arr3181 := z.EncBasicHandle().StructToArray + var yyq3181 [2]bool + _, _, _ = yysep3181, yyq3181, yy2arr3181 + const yyr3181 bool = false + yyq3181[0] = x.Component != "" + yyq3181[1] = x.Host != "" + var yynn3181 int + if yyr3181 || yy2arr3181 { r.EncodeArrayStart(2) } else { - yynn3032 = 0 - for _, b := range yyq3032 { + yynn3181 = 0 + for _, b := range yyq3181 { if b { - yynn3032++ + yynn3181++ } } - r.EncodeMapStart(yynn3032) - yynn3032 = 0 + r.EncodeMapStart(yynn3181) + yynn3181 = 0 } - if yyr3032 || yy2arr3032 { + if yyr3181 || yy2arr3181 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3032[0] { - yym3034 := z.EncBinary() - _ = yym3034 + if yyq3181[0] { + yym3183 := z.EncBinary() + _ = yym3183 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Component)) @@ -38016,23 +40156,23 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3032[0] { + if yyq3181[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("component")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3035 := z.EncBinary() - _ = yym3035 + yym3184 := z.EncBinary() + _ = yym3184 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Component)) } } } - if yyr3032 || yy2arr3032 { + if yyr3181 || yy2arr3181 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3032[1] { - yym3037 := z.EncBinary() - _ = yym3037 + if yyq3181[1] { + yym3186 := z.EncBinary() + _ = yym3186 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) @@ -38041,19 +40181,19 @@ func (x *EventSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3032[1] { + if yyq3181[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("host")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3038 := z.EncBinary() - _ = yym3038 + yym3187 := z.EncBinary() + _ = yym3187 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) } } } - if yyr3032 || yy2arr3032 { + if yyr3181 || yy2arr3181 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -38066,25 +40206,25 @@ func (x *EventSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3039 := z.DecBinary() - _ = yym3039 + yym3188 := z.DecBinary() + _ = yym3188 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3040 := r.ContainerType() - if yyct3040 == codecSelferValueTypeMap1234 { - yyl3040 := r.ReadMapStart() - if yyl3040 == 0 { + yyct3189 := r.ContainerType() + if yyct3189 == codecSelferValueTypeMap1234 { + yyl3189 := r.ReadMapStart() + if yyl3189 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3040, d) + x.codecDecodeSelfFromMap(yyl3189, d) } - } else if yyct3040 == codecSelferValueTypeArray1234 { - yyl3040 := r.ReadArrayStart() - if yyl3040 == 0 { + } else if yyct3189 == codecSelferValueTypeArray1234 { + yyl3189 := r.ReadArrayStart() + if yyl3189 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3040, d) + x.codecDecodeSelfFromArray(yyl3189, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -38096,12 +40236,12 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3041Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3041Slc - var yyhl3041 bool = l >= 0 - for yyj3041 := 0; ; yyj3041++ { - if yyhl3041 { - if yyj3041 >= l { + var yys3190Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3190Slc + var yyhl3190 bool = l >= 0 + for yyj3190 := 0; ; yyj3190++ { + if yyhl3190 { + if yyj3190 >= l { break } } else { @@ -38110,10 +40250,10 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3041Slc = r.DecodeBytes(yys3041Slc, true, true) - yys3041 := string(yys3041Slc) + yys3190Slc = r.DecodeBytes(yys3190Slc, true, true) + yys3190 := string(yys3190Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3041 { + switch yys3190 { case "component": if r.TryDecodeAsNil() { x.Component = "" @@ -38127,9 +40267,9 @@ func (x *EventSource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Host = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3041) - } // end switch yys3041 - } // end for yyj3041 + z.DecStructFieldNotFound(-1, yys3190) + } // end switch yys3190 + } // end for yyj3190 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -38137,16 +40277,16 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3044 int - var yyb3044 bool - var yyhl3044 bool = l >= 0 - yyj3044++ - if yyhl3044 { - yyb3044 = yyj3044 > l + var yyj3193 int + var yyb3193 bool + var yyhl3193 bool = l >= 0 + yyj3193++ + if yyhl3193 { + yyb3193 = yyj3193 > l } else { - yyb3044 = r.CheckBreak() + yyb3193 = r.CheckBreak() } - if yyb3044 { + if yyb3193 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38156,13 +40296,13 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Component = string(r.DecodeString()) } - yyj3044++ - if yyhl3044 { - yyb3044 = yyj3044 > l + yyj3193++ + if yyhl3193 { + yyb3193 = yyj3193 > l } else { - yyb3044 = r.CheckBreak() + yyb3193 = r.CheckBreak() } - if yyb3044 { + if yyb3193 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38173,17 +40313,17 @@ func (x *EventSource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Host = string(r.DecodeString()) } for { - yyj3044++ - if yyhl3044 { - yyb3044 = yyj3044 > l + yyj3193++ + if yyhl3193 { + yyb3193 = yyj3193 > l } else { - yyb3044 = r.CheckBreak() + yyb3193 = r.CheckBreak() } - if yyb3044 { + if yyb3193 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3044-1, "") + z.DecStructFieldNotFound(yyj3193-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -38195,115 +40335,65 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3047 := z.EncBinary() - _ = yym3047 + yym3196 := z.EncBinary() + _ = yym3196 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3048 := !z.EncBinary() - yy2arr3048 := z.EncBasicHandle().StructToArray - var yyq3048 [11]bool - _, _, _ = yysep3048, yyq3048, yy2arr3048 - const yyr3048 bool = false - yyq3048[0] = x.Kind != "" - yyq3048[1] = x.APIVersion != "" - yyq3048[4] = x.Reason != "" - yyq3048[5] = x.Message != "" - yyq3048[6] = true - yyq3048[7] = true - yyq3048[8] = true - yyq3048[9] = x.Count != 0 - yyq3048[10] = x.Type != "" - var yynn3048 int - if yyr3048 || yy2arr3048 { + yysep3197 := !z.EncBinary() + yy2arr3197 := z.EncBasicHandle().StructToArray + var yyq3197 [11]bool + _, _, _ = yysep3197, yyq3197, yy2arr3197 + const yyr3197 bool = false + yyq3197[2] = x.Reason != "" + yyq3197[3] = x.Message != "" + yyq3197[4] = true + yyq3197[5] = true + yyq3197[6] = true + yyq3197[7] = x.Count != 0 + yyq3197[8] = x.Type != "" + yyq3197[9] = x.Kind != "" + yyq3197[10] = x.APIVersion != "" + var yynn3197 int + if yyr3197 || yy2arr3197 { r.EncodeArrayStart(11) } else { - yynn3048 = 2 - for _, b := range yyq3048 { + yynn3197 = 2 + for _, b := range yyq3197 { if b { - yynn3048++ + yynn3197++ } } - r.EncodeMapStart(yynn3048) - yynn3048 = 0 + r.EncodeMapStart(yynn3197) + yynn3197 = 0 } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[0] { - yym3050 := z.EncBinary() - _ = yym3050 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3048[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3051 := z.EncBinary() - _ = yym3051 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3048 || yy2arr3048 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[1] { - yym3053 := z.EncBinary() - _ = yym3053 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3048[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3054 := z.EncBinary() - _ = yym3054 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3048 || yy2arr3048 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3056 := &x.ObjectMeta - yy3056.CodecEncodeSelf(e) + yy3199 := &x.ObjectMeta + yy3199.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3057 := &x.ObjectMeta - yy3057.CodecEncodeSelf(e) + yy3200 := &x.ObjectMeta + yy3200.CodecEncodeSelf(e) } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3059 := &x.InvolvedObject - yy3059.CodecEncodeSelf(e) + yy3202 := &x.InvolvedObject + yy3202.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("involvedObject")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3060 := &x.InvolvedObject - yy3060.CodecEncodeSelf(e) + yy3203 := &x.InvolvedObject + yy3203.CodecEncodeSelf(e) } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[4] { - yym3062 := z.EncBinary() - _ = yym3062 + if yyq3197[2] { + yym3205 := z.EncBinary() + _ = yym3205 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -38312,23 +40402,23 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3048[4] { + if yyq3197[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3063 := z.EncBinary() - _ = yym3063 + yym3206 := z.EncBinary() + _ = yym3206 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[5] { - yym3065 := z.EncBinary() - _ = yym3065 + if yyq3197[3] { + yym3208 := z.EncBinary() + _ = yym3208 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -38337,114 +40427,114 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3048[5] { + if yyq3197[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3066 := z.EncBinary() - _ = yym3066 + yym3209 := z.EncBinary() + _ = yym3209 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[6] { - yy3068 := &x.Source - yy3068.CodecEncodeSelf(e) + if yyq3197[4] { + yy3211 := &x.Source + yy3211.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3048[6] { + if yyq3197[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("source")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3069 := &x.Source - yy3069.CodecEncodeSelf(e) + yy3212 := &x.Source + yy3212.CodecEncodeSelf(e) } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[7] { - yy3071 := &x.FirstTimestamp - yym3072 := z.EncBinary() - _ = yym3072 + if yyq3197[5] { + yy3214 := &x.FirstTimestamp + yym3215 := z.EncBinary() + _ = yym3215 if false { - } else if z.HasExtensions() && z.EncExt(yy3071) { - } else if yym3072 { - z.EncBinaryMarshal(yy3071) - } else if !yym3072 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3071) + } else if z.HasExtensions() && z.EncExt(yy3214) { + } else if yym3215 { + z.EncBinaryMarshal(yy3214) + } else if !yym3215 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3214) } else { - z.EncFallback(yy3071) + z.EncFallback(yy3214) } } else { r.EncodeNil() } } else { - if yyq3048[7] { + if yyq3197[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("firstTimestamp")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3073 := &x.FirstTimestamp - yym3074 := z.EncBinary() - _ = yym3074 + yy3216 := &x.FirstTimestamp + yym3217 := z.EncBinary() + _ = yym3217 if false { - } else if z.HasExtensions() && z.EncExt(yy3073) { - } else if yym3074 { - z.EncBinaryMarshal(yy3073) - } else if !yym3074 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3073) + } else if z.HasExtensions() && z.EncExt(yy3216) { + } else if yym3217 { + z.EncBinaryMarshal(yy3216) + } else if !yym3217 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3216) } else { - z.EncFallback(yy3073) + z.EncFallback(yy3216) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[8] { - yy3076 := &x.LastTimestamp - yym3077 := z.EncBinary() - _ = yym3077 + if yyq3197[6] { + yy3219 := &x.LastTimestamp + yym3220 := z.EncBinary() + _ = yym3220 if false { - } else if z.HasExtensions() && z.EncExt(yy3076) { - } else if yym3077 { - z.EncBinaryMarshal(yy3076) - } else if !yym3077 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3076) + } else if z.HasExtensions() && z.EncExt(yy3219) { + } else if yym3220 { + z.EncBinaryMarshal(yy3219) + } else if !yym3220 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3219) } else { - z.EncFallback(yy3076) + z.EncFallback(yy3219) } } else { r.EncodeNil() } } else { - if yyq3048[8] { + if yyq3197[6] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTimestamp")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3078 := &x.LastTimestamp - yym3079 := z.EncBinary() - _ = yym3079 + yy3221 := &x.LastTimestamp + yym3222 := z.EncBinary() + _ = yym3222 if false { - } else if z.HasExtensions() && z.EncExt(yy3078) { - } else if yym3079 { - z.EncBinaryMarshal(yy3078) - } else if !yym3079 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3078) + } else if z.HasExtensions() && z.EncExt(yy3221) { + } else if yym3222 { + z.EncBinaryMarshal(yy3221) + } else if !yym3222 && z.IsJSONHandle() { + z.EncJSONMarshal(yy3221) } else { - z.EncFallback(yy3078) + z.EncFallback(yy3221) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[9] { - yym3081 := z.EncBinary() - _ = yym3081 + if yyq3197[7] { + yym3224 := z.EncBinary() + _ = yym3224 if false { } else { r.EncodeInt(int64(x.Count)) @@ -38453,23 +40543,23 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq3048[9] { + if yyq3197[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("count")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3082 := z.EncBinary() - _ = yym3082 + yym3225 := z.EncBinary() + _ = yym3225 if false { } else { r.EncodeInt(int64(x.Count)) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3048[10] { - yym3084 := z.EncBinary() - _ = yym3084 + if yyq3197[8] { + yym3227 := z.EncBinary() + _ = yym3227 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) @@ -38478,19 +40568,69 @@ func (x *Event) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3048[10] { + if yyq3197[8] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3085 := z.EncBinary() - _ = yym3085 + yym3228 := z.EncBinary() + _ = yym3228 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) } } } - if yyr3048 || yy2arr3048 { + if yyr3197 || yy2arr3197 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3197[9] { + yym3230 := z.EncBinary() + _ = yym3230 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3197[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3231 := z.EncBinary() + _ = yym3231 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3197 || yy2arr3197 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3197[10] { + yym3233 := z.EncBinary() + _ = yym3233 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3197[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3234 := z.EncBinary() + _ = yym3234 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3197 || yy2arr3197 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -38503,25 +40643,25 @@ func (x *Event) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3086 := z.DecBinary() - _ = yym3086 + yym3235 := z.DecBinary() + _ = yym3235 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3087 := r.ContainerType() - if yyct3087 == codecSelferValueTypeMap1234 { - yyl3087 := r.ReadMapStart() - if yyl3087 == 0 { + yyct3236 := r.ContainerType() + if yyct3236 == codecSelferValueTypeMap1234 { + yyl3236 := r.ReadMapStart() + if yyl3236 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3087, d) + x.codecDecodeSelfFromMap(yyl3236, d) } - } else if yyct3087 == codecSelferValueTypeArray1234 { - yyl3087 := r.ReadArrayStart() - if yyl3087 == 0 { + } else if yyct3236 == codecSelferValueTypeArray1234 { + yyl3236 := r.ReadArrayStart() + if yyl3236 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3087, d) + x.codecDecodeSelfFromArray(yyl3236, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -38533,12 +40673,12 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3088Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3088Slc - var yyhl3088 bool = l >= 0 - for yyj3088 := 0; ; yyj3088++ { - if yyhl3088 { - if yyj3088 >= l { + var yys3237Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3237Slc + var yyhl3237 bool = l >= 0 + for yyj3237 := 0; ; yyj3237++ { + if yyhl3237 { + if yyj3237 >= l { break } } else { @@ -38547,35 +40687,23 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3088Slc = r.DecodeBytes(yys3088Slc, true, true) - yys3088 := string(yys3088Slc) + yys3237Slc = r.DecodeBytes(yys3237Slc, true, true) + yys3237 := string(yys3237Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3088 { - 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()) - } + switch yys3237 { case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3091 := &x.ObjectMeta - yyv3091.CodecDecodeSelf(d) + yyv3238 := &x.ObjectMeta + yyv3238.CodecDecodeSelf(d) } case "involvedObject": if r.TryDecodeAsNil() { x.InvolvedObject = ObjectReference{} } else { - yyv3092 := &x.InvolvedObject - yyv3092.CodecDecodeSelf(d) + yyv3239 := &x.InvolvedObject + yyv3239.CodecDecodeSelf(d) } case "reason": if r.TryDecodeAsNil() { @@ -38593,41 +40721,41 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Source = EventSource{} } else { - yyv3095 := &x.Source - yyv3095.CodecDecodeSelf(d) + yyv3242 := &x.Source + yyv3242.CodecDecodeSelf(d) } case "firstTimestamp": if r.TryDecodeAsNil() { x.FirstTimestamp = pkg2_unversioned.Time{} } else { - yyv3096 := &x.FirstTimestamp - yym3097 := z.DecBinary() - _ = yym3097 + yyv3243 := &x.FirstTimestamp + yym3244 := z.DecBinary() + _ = yym3244 if false { - } else if z.HasExtensions() && z.DecExt(yyv3096) { - } else if yym3097 { - z.DecBinaryUnmarshal(yyv3096) - } else if !yym3097 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3096) + } else if z.HasExtensions() && z.DecExt(yyv3243) { + } else if yym3244 { + z.DecBinaryUnmarshal(yyv3243) + } else if !yym3244 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3243) } else { - z.DecFallback(yyv3096, false) + z.DecFallback(yyv3243, false) } } case "lastTimestamp": if r.TryDecodeAsNil() { x.LastTimestamp = pkg2_unversioned.Time{} } else { - yyv3098 := &x.LastTimestamp - yym3099 := z.DecBinary() - _ = yym3099 + yyv3245 := &x.LastTimestamp + yym3246 := z.DecBinary() + _ = yym3246 if false { - } else if z.HasExtensions() && z.DecExt(yyv3098) { - } else if yym3099 { - z.DecBinaryUnmarshal(yyv3098) - } else if !yym3099 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3098) + } else if z.HasExtensions() && z.DecExt(yyv3245) { + } else if yym3246 { + z.DecBinaryUnmarshal(yyv3245) + } else if !yym3246 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3245) } else { - z.DecFallback(yyv3098, false) + z.DecFallback(yyv3245, false) } } case "count": @@ -38642,10 +40770,22 @@ func (x *Event) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } + 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, yys3088) - } // end switch yys3088 - } // end for yyj3088 + z.DecStructFieldNotFound(-1, yys3237) + } // end switch yys3237 + } // end for yyj3237 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -38653,48 +40793,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3102 int - var yyb3102 bool - var yyhl3102 bool = l >= 0 - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + var yyj3251 int + var yyb3251 bool + var yyhl3251 bool = l >= 0 + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l - } else { - yyb3102 = r.CheckBreak() - } - if yyb3102 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l - } else { - yyb3102 = r.CheckBreak() - } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38702,16 +40810,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3105 := &x.ObjectMeta - yyv3105.CodecDecodeSelf(d) + yyv3252 := &x.ObjectMeta + yyv3252.CodecDecodeSelf(d) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38719,16 +40827,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.InvolvedObject = ObjectReference{} } else { - yyv3106 := &x.InvolvedObject - yyv3106.CodecDecodeSelf(d) + yyv3253 := &x.InvolvedObject + yyv3253.CodecDecodeSelf(d) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38738,13 +40846,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38754,13 +40862,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Message = string(r.DecodeString()) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38768,16 +40876,16 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Source = EventSource{} } else { - yyv3109 := &x.Source - yyv3109.CodecDecodeSelf(d) + yyv3256 := &x.Source + yyv3256.CodecDecodeSelf(d) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38785,26 +40893,26 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.FirstTimestamp = pkg2_unversioned.Time{} } else { - yyv3110 := &x.FirstTimestamp - yym3111 := z.DecBinary() - _ = yym3111 + yyv3257 := &x.FirstTimestamp + yym3258 := z.DecBinary() + _ = yym3258 if false { - } else if z.HasExtensions() && z.DecExt(yyv3110) { - } else if yym3111 { - z.DecBinaryUnmarshal(yyv3110) - } else if !yym3111 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3110) + } else if z.HasExtensions() && z.DecExt(yyv3257) { + } else if yym3258 { + z.DecBinaryUnmarshal(yyv3257) + } else if !yym3258 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3257) } else { - z.DecFallback(yyv3110, false) + z.DecFallback(yyv3257, false) } } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38812,26 +40920,26 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTimestamp = pkg2_unversioned.Time{} } else { - yyv3112 := &x.LastTimestamp - yym3113 := z.DecBinary() - _ = yym3113 + yyv3259 := &x.LastTimestamp + yym3260 := z.DecBinary() + _ = yym3260 if false { - } else if z.HasExtensions() && z.DecExt(yyv3112) { - } else if yym3113 { - z.DecBinaryUnmarshal(yyv3112) - } else if !yym3113 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3112) + } else if z.HasExtensions() && z.DecExt(yyv3259) { + } else if yym3260 { + z.DecBinaryUnmarshal(yyv3259) + } else if !yym3260 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv3259) } else { - z.DecFallback(yyv3112, false) + z.DecFallback(yyv3259, false) } } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38841,13 +40949,13 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Count = int32(r.DecodeInt(32)) } - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -38857,18 +40965,50 @@ func (x *Event) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l + } else { + yyb3251 = r.CheckBreak() + } + if yyb3251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l + } else { + yyb3251 = r.CheckBreak() + } + if yyb3251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj3102++ - if yyhl3102 { - yyb3102 = yyj3102 > l + yyj3251++ + if yyhl3251 { + yyb3251 = yyj3251 > l } else { - yyb3102 = r.CheckBreak() + yyb3251 = r.CheckBreak() } - if yyb3102 { + if yyb3251 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3102-1, "") + z.DecStructFieldNotFound(yyj3251-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -38880,118 +41020,68 @@ func (x *EventList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3116 := z.EncBinary() - _ = yym3116 + yym3265 := z.EncBinary() + _ = yym3265 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3117 := !z.EncBinary() - yy2arr3117 := z.EncBasicHandle().StructToArray - var yyq3117 [4]bool - _, _, _ = yysep3117, yyq3117, yy2arr3117 - const yyr3117 bool = false - yyq3117[0] = x.Kind != "" - yyq3117[1] = x.APIVersion != "" - yyq3117[2] = true - var yynn3117 int - if yyr3117 || yy2arr3117 { + yysep3266 := !z.EncBinary() + yy2arr3266 := z.EncBasicHandle().StructToArray + var yyq3266 [4]bool + _, _, _ = yysep3266, yyq3266, yy2arr3266 + const yyr3266 bool = false + yyq3266[0] = true + yyq3266[2] = x.Kind != "" + yyq3266[3] = x.APIVersion != "" + var yynn3266 int + if yyr3266 || yy2arr3266 { r.EncodeArrayStart(4) } else { - yynn3117 = 1 - for _, b := range yyq3117 { + yynn3266 = 1 + for _, b := range yyq3266 { if b { - yynn3117++ + yynn3266++ } } - r.EncodeMapStart(yynn3117) - yynn3117 = 0 + r.EncodeMapStart(yynn3266) + yynn3266 = 0 } - if yyr3117 || yy2arr3117 { + if yyr3266 || yy2arr3266 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3117[0] { - yym3119 := z.EncBinary() - _ = yym3119 + if yyq3266[0] { + yy3268 := &x.ListMeta + yym3269 := z.EncBinary() + _ = yym3269 if false { + } else if z.HasExtensions() && z.EncExt(yy3268) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3117[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3120 := z.EncBinary() - _ = yym3120 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3117 || yy2arr3117 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3117[1] { - yym3122 := z.EncBinary() - _ = yym3122 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3117[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3123 := z.EncBinary() - _ = yym3123 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3117 || yy2arr3117 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3117[2] { - yy3125 := &x.ListMeta - yym3126 := z.EncBinary() - _ = yym3126 - if false { - } else if z.HasExtensions() && z.EncExt(yy3125) { - } else { - z.EncFallback(yy3125) + z.EncFallback(yy3268) } } else { r.EncodeNil() } } else { - if yyq3117[2] { + if yyq3266[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3127 := &x.ListMeta - yym3128 := z.EncBinary() - _ = yym3128 + yy3270 := &x.ListMeta + yym3271 := z.EncBinary() + _ = yym3271 if false { - } else if z.HasExtensions() && z.EncExt(yy3127) { + } else if z.HasExtensions() && z.EncExt(yy3270) { } else { - z.EncFallback(yy3127) + z.EncFallback(yy3270) } } } - if yyr3117 || yy2arr3117 { + if yyr3266 || yy2arr3266 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3130 := z.EncBinary() - _ = yym3130 + yym3273 := z.EncBinary() + _ = yym3273 if false { } else { h.encSliceEvent(([]Event)(x.Items), e) @@ -39004,15 +41094,65 @@ func (x *EventList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3131 := z.EncBinary() - _ = yym3131 + yym3274 := z.EncBinary() + _ = yym3274 if false { } else { h.encSliceEvent(([]Event)(x.Items), e) } } } - if yyr3117 || yy2arr3117 { + if yyr3266 || yy2arr3266 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3266[2] { + yym3276 := z.EncBinary() + _ = yym3276 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3266[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3277 := z.EncBinary() + _ = yym3277 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3266 || yy2arr3266 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3266[3] { + yym3279 := z.EncBinary() + _ = yym3279 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3266[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3280 := z.EncBinary() + _ = yym3280 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3266 || yy2arr3266 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39025,25 +41165,25 @@ func (x *EventList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3132 := z.DecBinary() - _ = yym3132 + yym3281 := z.DecBinary() + _ = yym3281 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3133 := r.ContainerType() - if yyct3133 == codecSelferValueTypeMap1234 { - yyl3133 := r.ReadMapStart() - if yyl3133 == 0 { + yyct3282 := r.ContainerType() + if yyct3282 == codecSelferValueTypeMap1234 { + yyl3282 := r.ReadMapStart() + if yyl3282 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3133, d) + x.codecDecodeSelfFromMap(yyl3282, d) } - } else if yyct3133 == codecSelferValueTypeArray1234 { - yyl3133 := r.ReadArrayStart() - if yyl3133 == 0 { + } else if yyct3282 == codecSelferValueTypeArray1234 { + yyl3282 := r.ReadArrayStart() + if yyl3282 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3133, d) + x.codecDecodeSelfFromArray(yyl3282, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -39055,12 +41195,12 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3134Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3134Slc - var yyhl3134 bool = l >= 0 - for yyj3134 := 0; ; yyj3134++ { - if yyhl3134 { - if yyj3134 >= l { + var yys3283Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3283Slc + var yyhl3283 bool = l >= 0 + for yyj3283 := 0; ; yyj3283++ { + if yyhl3283 { + if yyj3283 >= l { break } } else { @@ -39069,10 +41209,35 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3134Slc = r.DecodeBytes(yys3134Slc, true, true) - yys3134 := string(yys3134Slc) + yys3283Slc = r.DecodeBytes(yys3283Slc, true, true) + yys3283 := string(yys3283Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3134 { + switch yys3283 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3284 := &x.ListMeta + yym3285 := z.DecBinary() + _ = yym3285 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3284) { + } else { + z.DecFallback(yyv3284, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3286 := &x.Items + yym3287 := z.DecBinary() + _ = yym3287 + if false { + } else { + h.decSliceEvent((*[]Event)(yyv3286), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -39085,35 +41250,10 @@ func (x *EventList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3137 := &x.ListMeta - yym3138 := z.DecBinary() - _ = yym3138 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3137) { - } else { - z.DecFallback(yyv3137, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3139 := &x.Items - yym3140 := z.DecBinary() - _ = yym3140 - if false { - } else { - h.decSliceEvent((*[]Event)(yyv3139), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3134) - } // end switch yys3134 - } // end for yyj3134 + z.DecStructFieldNotFound(-1, yys3283) + } // end switch yys3283 + } // end for yyj3283 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -39121,16 +41261,61 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3141 int - var yyb3141 bool - var yyhl3141 bool = l >= 0 - yyj3141++ - if yyhl3141 { - yyb3141 = yyj3141 > l + var yyj3290 int + var yyb3290 bool + var yyhl3290 bool = l >= 0 + yyj3290++ + if yyhl3290 { + yyb3290 = yyj3290 > l } else { - yyb3141 = r.CheckBreak() + yyb3290 = r.CheckBreak() } - if yyb3141 { + if yyb3290 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3291 := &x.ListMeta + yym3292 := z.DecBinary() + _ = yym3292 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3291) { + } else { + z.DecFallback(yyv3291, false) + } + } + yyj3290++ + if yyhl3290 { + yyb3290 = yyj3290 > l + } else { + yyb3290 = r.CheckBreak() + } + if yyb3290 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3293 := &x.Items + yym3294 := z.DecBinary() + _ = yym3294 + if false { + } else { + h.decSliceEvent((*[]Event)(yyv3293), d) + } + } + yyj3290++ + if yyhl3290 { + yyb3290 = yyj3290 > l + } else { + yyb3290 = r.CheckBreak() + } + if yyb3290 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39140,13 +41325,13 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3141++ - if yyhl3141 { - yyb3141 = yyj3141 > l + yyj3290++ + if yyhl3290 { + yyb3290 = yyj3290 > l } else { - yyb3141 = r.CheckBreak() + yyb3290 = r.CheckBreak() } - if yyb3141 { + if yyb3290 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39156,63 +41341,18 @@ func (x *EventList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3141++ - if yyhl3141 { - yyb3141 = yyj3141 > l - } else { - yyb3141 = r.CheckBreak() - } - if yyb3141 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3144 := &x.ListMeta - yym3145 := z.DecBinary() - _ = yym3145 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3144) { - } else { - z.DecFallback(yyv3144, false) - } - } - yyj3141++ - if yyhl3141 { - yyb3141 = yyj3141 > l - } else { - yyb3141 = r.CheckBreak() - } - if yyb3141 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3146 := &x.Items - yym3147 := z.DecBinary() - _ = yym3147 - if false { - } else { - h.decSliceEvent((*[]Event)(yyv3146), d) - } - } for { - yyj3141++ - if yyhl3141 { - yyb3141 = yyj3141 > l + yyj3290++ + if yyhl3290 { + yyb3290 = yyj3290 > l } else { - yyb3141 = r.CheckBreak() + yyb3290 = r.CheckBreak() } - if yyb3141 { + if yyb3290 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3141-1, "") + z.DecStructFieldNotFound(yyj3290-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39224,118 +41364,68 @@ func (x *List) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3148 := z.EncBinary() - _ = yym3148 + yym3297 := z.EncBinary() + _ = yym3297 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3149 := !z.EncBinary() - yy2arr3149 := z.EncBasicHandle().StructToArray - var yyq3149 [4]bool - _, _, _ = yysep3149, yyq3149, yy2arr3149 - const yyr3149 bool = false - yyq3149[0] = x.Kind != "" - yyq3149[1] = x.APIVersion != "" - yyq3149[2] = true - var yynn3149 int - if yyr3149 || yy2arr3149 { + yysep3298 := !z.EncBinary() + yy2arr3298 := z.EncBasicHandle().StructToArray + var yyq3298 [4]bool + _, _, _ = yysep3298, yyq3298, yy2arr3298 + const yyr3298 bool = false + yyq3298[0] = true + yyq3298[2] = x.Kind != "" + yyq3298[3] = x.APIVersion != "" + var yynn3298 int + if yyr3298 || yy2arr3298 { r.EncodeArrayStart(4) } else { - yynn3149 = 1 - for _, b := range yyq3149 { + yynn3298 = 1 + for _, b := range yyq3298 { if b { - yynn3149++ + yynn3298++ } } - r.EncodeMapStart(yynn3149) - yynn3149 = 0 + r.EncodeMapStart(yynn3298) + yynn3298 = 0 } - if yyr3149 || yy2arr3149 { + if yyr3298 || yy2arr3298 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3149[0] { - yym3151 := z.EncBinary() - _ = yym3151 + if yyq3298[0] { + yy3300 := &x.ListMeta + yym3301 := z.EncBinary() + _ = yym3301 if false { + } else if z.HasExtensions() && z.EncExt(yy3300) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3149[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3152 := z.EncBinary() - _ = yym3152 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3149 || yy2arr3149 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3149[1] { - yym3154 := z.EncBinary() - _ = yym3154 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3149[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3155 := z.EncBinary() - _ = yym3155 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3149 || yy2arr3149 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3149[2] { - yy3157 := &x.ListMeta - yym3158 := z.EncBinary() - _ = yym3158 - if false { - } else if z.HasExtensions() && z.EncExt(yy3157) { - } else { - z.EncFallback(yy3157) + z.EncFallback(yy3300) } } else { r.EncodeNil() } } else { - if yyq3149[2] { + if yyq3298[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3159 := &x.ListMeta - yym3160 := z.EncBinary() - _ = yym3160 + yy3302 := &x.ListMeta + yym3303 := z.EncBinary() + _ = yym3303 if false { - } else if z.HasExtensions() && z.EncExt(yy3159) { + } else if z.HasExtensions() && z.EncExt(yy3302) { } else { - z.EncFallback(yy3159) + z.EncFallback(yy3302) } } } - if yyr3149 || yy2arr3149 { + if yyr3298 || yy2arr3298 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3162 := z.EncBinary() - _ = yym3162 + yym3305 := z.EncBinary() + _ = yym3305 if false { } else { h.encSliceruntime_RawExtension(([]pkg6_runtime.RawExtension)(x.Items), e) @@ -39348,15 +41438,65 @@ func (x *List) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3163 := z.EncBinary() - _ = yym3163 + yym3306 := z.EncBinary() + _ = yym3306 if false { } else { h.encSliceruntime_RawExtension(([]pkg6_runtime.RawExtension)(x.Items), e) } } } - if yyr3149 || yy2arr3149 { + if yyr3298 || yy2arr3298 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3298[2] { + yym3308 := z.EncBinary() + _ = yym3308 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3298[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3309 := z.EncBinary() + _ = yym3309 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3298 || yy2arr3298 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3298[3] { + yym3311 := z.EncBinary() + _ = yym3311 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3298[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3312 := z.EncBinary() + _ = yym3312 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3298 || yy2arr3298 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39369,25 +41509,25 @@ func (x *List) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3164 := z.DecBinary() - _ = yym3164 + yym3313 := z.DecBinary() + _ = yym3313 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3165 := r.ContainerType() - if yyct3165 == codecSelferValueTypeMap1234 { - yyl3165 := r.ReadMapStart() - if yyl3165 == 0 { + yyct3314 := r.ContainerType() + if yyct3314 == codecSelferValueTypeMap1234 { + yyl3314 := r.ReadMapStart() + if yyl3314 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3165, d) + x.codecDecodeSelfFromMap(yyl3314, d) } - } else if yyct3165 == codecSelferValueTypeArray1234 { - yyl3165 := r.ReadArrayStart() - if yyl3165 == 0 { + } else if yyct3314 == codecSelferValueTypeArray1234 { + yyl3314 := r.ReadArrayStart() + if yyl3314 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3165, d) + x.codecDecodeSelfFromArray(yyl3314, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -39399,12 +41539,12 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3166Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3166Slc - var yyhl3166 bool = l >= 0 - for yyj3166 := 0; ; yyj3166++ { - if yyhl3166 { - if yyj3166 >= l { + var yys3315Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3315Slc + var yyhl3315 bool = l >= 0 + for yyj3315 := 0; ; yyj3315++ { + if yyhl3315 { + if yyj3315 >= l { break } } else { @@ -39413,10 +41553,35 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3166Slc = r.DecodeBytes(yys3166Slc, true, true) - yys3166 := string(yys3166Slc) + yys3315Slc = r.DecodeBytes(yys3315Slc, true, true) + yys3315 := string(yys3315Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3166 { + switch yys3315 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3316 := &x.ListMeta + yym3317 := z.DecBinary() + _ = yym3317 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3316) { + } else { + z.DecFallback(yyv3316, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3318 := &x.Items + yym3319 := z.DecBinary() + _ = yym3319 + if false { + } else { + h.decSliceruntime_RawExtension((*[]pkg6_runtime.RawExtension)(yyv3318), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -39429,35 +41594,10 @@ func (x *List) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3169 := &x.ListMeta - yym3170 := z.DecBinary() - _ = yym3170 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3169) { - } else { - z.DecFallback(yyv3169, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3171 := &x.Items - yym3172 := z.DecBinary() - _ = yym3172 - if false { - } else { - h.decSliceruntime_RawExtension((*[]pkg6_runtime.RawExtension)(yyv3171), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3166) - } // end switch yys3166 - } // end for yyj3166 + z.DecStructFieldNotFound(-1, yys3315) + } // end switch yys3315 + } // end for yyj3315 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -39465,16 +41605,61 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3173 int - var yyb3173 bool - var yyhl3173 bool = l >= 0 - yyj3173++ - if yyhl3173 { - yyb3173 = yyj3173 > l + var yyj3322 int + var yyb3322 bool + var yyhl3322 bool = l >= 0 + yyj3322++ + if yyhl3322 { + yyb3322 = yyj3322 > l } else { - yyb3173 = r.CheckBreak() + yyb3322 = r.CheckBreak() } - if yyb3173 { + if yyb3322 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3323 := &x.ListMeta + yym3324 := z.DecBinary() + _ = yym3324 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3323) { + } else { + z.DecFallback(yyv3323, false) + } + } + yyj3322++ + if yyhl3322 { + yyb3322 = yyj3322 > l + } else { + yyb3322 = r.CheckBreak() + } + if yyb3322 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3325 := &x.Items + yym3326 := z.DecBinary() + _ = yym3326 + if false { + } else { + h.decSliceruntime_RawExtension((*[]pkg6_runtime.RawExtension)(yyv3325), d) + } + } + yyj3322++ + if yyhl3322 { + yyb3322 = yyj3322 > l + } else { + yyb3322 = r.CheckBreak() + } + if yyb3322 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39484,13 +41669,13 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3173++ - if yyhl3173 { - yyb3173 = yyj3173 > l + yyj3322++ + if yyhl3322 { + yyb3322 = yyj3322 > l } else { - yyb3173 = r.CheckBreak() + yyb3322 = r.CheckBreak() } - if yyb3173 { + if yyb3322 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39500,63 +41685,18 @@ func (x *List) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3173++ - if yyhl3173 { - yyb3173 = yyj3173 > l - } else { - yyb3173 = r.CheckBreak() - } - if yyb3173 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3176 := &x.ListMeta - yym3177 := z.DecBinary() - _ = yym3177 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3176) { - } else { - z.DecFallback(yyv3176, false) - } - } - yyj3173++ - if yyhl3173 { - yyb3173 = yyj3173 > l - } else { - yyb3173 = r.CheckBreak() - } - if yyb3173 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3178 := &x.Items - yym3179 := z.DecBinary() - _ = yym3179 - if false { - } else { - h.decSliceruntime_RawExtension((*[]pkg6_runtime.RawExtension)(yyv3178), d) - } - } for { - yyj3173++ - if yyhl3173 { - yyb3173 = yyj3173 > l + yyj3322++ + if yyhl3322 { + yyb3322 = yyj3322 > l } else { - yyb3173 = r.CheckBreak() + yyb3322 = r.CheckBreak() } - if yyb3173 { + if yyb3322 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3173-1, "") + z.DecStructFieldNotFound(yyj3322-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39565,8 +41705,8 @@ func (x LimitType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym3180 := z.EncBinary() - _ = yym3180 + yym3329 := z.EncBinary() + _ = yym3329 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -39578,8 +41718,8 @@ func (x *LimitType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3181 := z.DecBinary() - _ = yym3181 + yym3330 := z.DecBinary() + _ = yym3330 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -39594,53 +41734,53 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3182 := z.EncBinary() - _ = yym3182 + yym3331 := z.EncBinary() + _ = yym3331 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3183 := !z.EncBinary() - yy2arr3183 := z.EncBasicHandle().StructToArray - var yyq3183 [6]bool - _, _, _ = yysep3183, yyq3183, yy2arr3183 - const yyr3183 bool = false - yyq3183[0] = x.Type != "" - yyq3183[1] = len(x.Max) != 0 - yyq3183[2] = len(x.Min) != 0 - yyq3183[3] = len(x.Default) != 0 - yyq3183[4] = len(x.DefaultRequest) != 0 - yyq3183[5] = len(x.MaxLimitRequestRatio) != 0 - var yynn3183 int - if yyr3183 || yy2arr3183 { + yysep3332 := !z.EncBinary() + yy2arr3332 := z.EncBasicHandle().StructToArray + var yyq3332 [6]bool + _, _, _ = yysep3332, yyq3332, yy2arr3332 + const yyr3332 bool = false + yyq3332[0] = x.Type != "" + yyq3332[1] = len(x.Max) != 0 + yyq3332[2] = len(x.Min) != 0 + yyq3332[3] = len(x.Default) != 0 + yyq3332[4] = len(x.DefaultRequest) != 0 + yyq3332[5] = len(x.MaxLimitRequestRatio) != 0 + var yynn3332 int + if yyr3332 || yy2arr3332 { r.EncodeArrayStart(6) } else { - yynn3183 = 0 - for _, b := range yyq3183 { + yynn3332 = 0 + for _, b := range yyq3332 { if b { - yynn3183++ + yynn3332++ } } - r.EncodeMapStart(yynn3183) - yynn3183 = 0 + r.EncodeMapStart(yynn3332) + yynn3332 = 0 } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[0] { + if yyq3332[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3183[0] { + if yyq3332[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[1] { + if yyq3332[1] { if x.Max == nil { r.EncodeNil() } else { @@ -39650,7 +41790,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3183[1] { + if yyq3332[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("max")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39661,9 +41801,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[2] { + if yyq3332[2] { if x.Min == nil { r.EncodeNil() } else { @@ -39673,7 +41813,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3183[2] { + if yyq3332[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("min")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39684,9 +41824,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[3] { + if yyq3332[3] { if x.Default == nil { r.EncodeNil() } else { @@ -39696,7 +41836,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3183[3] { + if yyq3332[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("default")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39707,9 +41847,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[4] { + if yyq3332[4] { if x.DefaultRequest == nil { r.EncodeNil() } else { @@ -39719,7 +41859,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3183[4] { + if yyq3332[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("defaultRequest")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39730,9 +41870,9 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3183[5] { + if yyq3332[5] { if x.MaxLimitRequestRatio == nil { r.EncodeNil() } else { @@ -39742,7 +41882,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3183[5] { + if yyq3332[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxLimitRequestRatio")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -39753,7 +41893,7 @@ func (x *LimitRangeItem) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3183 || yy2arr3183 { + if yyr3332 || yy2arr3332 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -39766,25 +41906,25 @@ func (x *LimitRangeItem) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3190 := z.DecBinary() - _ = yym3190 + yym3339 := z.DecBinary() + _ = yym3339 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3191 := r.ContainerType() - if yyct3191 == codecSelferValueTypeMap1234 { - yyl3191 := r.ReadMapStart() - if yyl3191 == 0 { + yyct3340 := r.ContainerType() + if yyct3340 == codecSelferValueTypeMap1234 { + yyl3340 := r.ReadMapStart() + if yyl3340 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3191, d) + x.codecDecodeSelfFromMap(yyl3340, d) } - } else if yyct3191 == codecSelferValueTypeArray1234 { - yyl3191 := r.ReadArrayStart() - if yyl3191 == 0 { + } else if yyct3340 == codecSelferValueTypeArray1234 { + yyl3340 := r.ReadArrayStart() + if yyl3340 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3191, d) + x.codecDecodeSelfFromArray(yyl3340, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -39796,12 +41936,12 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3192Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3192Slc - var yyhl3192 bool = l >= 0 - for yyj3192 := 0; ; yyj3192++ { - if yyhl3192 { - if yyj3192 >= l { + var yys3341Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3341Slc + var yyhl3341 bool = l >= 0 + for yyj3341 := 0; ; yyj3341++ { + if yyhl3341 { + if yyj3341 >= l { break } } else { @@ -39810,10 +41950,10 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3192Slc = r.DecodeBytes(yys3192Slc, true, true) - yys3192 := string(yys3192Slc) + yys3341Slc = r.DecodeBytes(yys3341Slc, true, true) + yys3341 := string(yys3341Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3192 { + switch yys3341 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -39824,41 +41964,41 @@ func (x *LimitRangeItem) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Max = nil } else { - yyv3194 := &x.Max - yyv3194.CodecDecodeSelf(d) + yyv3343 := &x.Max + yyv3343.CodecDecodeSelf(d) } case "min": if r.TryDecodeAsNil() { x.Min = nil } else { - yyv3195 := &x.Min - yyv3195.CodecDecodeSelf(d) + yyv3344 := &x.Min + yyv3344.CodecDecodeSelf(d) } case "default": if r.TryDecodeAsNil() { x.Default = nil } else { - yyv3196 := &x.Default - yyv3196.CodecDecodeSelf(d) + yyv3345 := &x.Default + yyv3345.CodecDecodeSelf(d) } case "defaultRequest": if r.TryDecodeAsNil() { x.DefaultRequest = nil } else { - yyv3197 := &x.DefaultRequest - yyv3197.CodecDecodeSelf(d) + yyv3346 := &x.DefaultRequest + yyv3346.CodecDecodeSelf(d) } case "maxLimitRequestRatio": if r.TryDecodeAsNil() { x.MaxLimitRequestRatio = nil } else { - yyv3198 := &x.MaxLimitRequestRatio - yyv3198.CodecDecodeSelf(d) + yyv3347 := &x.MaxLimitRequestRatio + yyv3347.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys3192) - } // end switch yys3192 - } // end for yyj3192 + z.DecStructFieldNotFound(-1, yys3341) + } // end switch yys3341 + } // end for yyj3341 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -39866,16 +42006,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3199 int - var yyb3199 bool - var yyhl3199 bool = l >= 0 - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + var yyj3348 int + var yyb3348 bool + var yyhl3348 bool = l >= 0 + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39885,13 +42025,13 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = LimitType(r.DecodeString()) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39899,16 +42039,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Max = nil } else { - yyv3201 := &x.Max - yyv3201.CodecDecodeSelf(d) + yyv3350 := &x.Max + yyv3350.CodecDecodeSelf(d) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39916,16 +42056,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Min = nil } else { - yyv3202 := &x.Min - yyv3202.CodecDecodeSelf(d) + yyv3351 := &x.Min + yyv3351.CodecDecodeSelf(d) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39933,16 +42073,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Default = nil } else { - yyv3203 := &x.Default - yyv3203.CodecDecodeSelf(d) + yyv3352 := &x.Default + yyv3352.CodecDecodeSelf(d) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39950,16 +42090,16 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.DefaultRequest = nil } else { - yyv3204 := &x.DefaultRequest - yyv3204.CodecDecodeSelf(d) + yyv3353 := &x.DefaultRequest + yyv3353.CodecDecodeSelf(d) } - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -39967,21 +42107,21 @@ func (x *LimitRangeItem) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.MaxLimitRequestRatio = nil } else { - yyv3205 := &x.MaxLimitRequestRatio - yyv3205.CodecDecodeSelf(d) + yyv3354 := &x.MaxLimitRequestRatio + yyv3354.CodecDecodeSelf(d) } for { - yyj3199++ - if yyhl3199 { - yyb3199 = yyj3199 > l + yyj3348++ + if yyhl3348 { + yyb3348 = yyj3348 > l } else { - yyb3199 = r.CheckBreak() + yyb3348 = r.CheckBreak() } - if yyb3199 { + if yyb3348 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3199-1, "") + z.DecStructFieldNotFound(yyj3348-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -39993,36 +42133,36 @@ func (x *LimitRangeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3206 := z.EncBinary() - _ = yym3206 + yym3355 := z.EncBinary() + _ = yym3355 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3207 := !z.EncBinary() - yy2arr3207 := z.EncBasicHandle().StructToArray - var yyq3207 [1]bool - _, _, _ = yysep3207, yyq3207, yy2arr3207 - const yyr3207 bool = false - var yynn3207 int - if yyr3207 || yy2arr3207 { + yysep3356 := !z.EncBinary() + yy2arr3356 := z.EncBasicHandle().StructToArray + var yyq3356 [1]bool + _, _, _ = yysep3356, yyq3356, yy2arr3356 + const yyr3356 bool = false + var yynn3356 int + if yyr3356 || yy2arr3356 { r.EncodeArrayStart(1) } else { - yynn3207 = 1 - for _, b := range yyq3207 { + yynn3356 = 1 + for _, b := range yyq3356 { if b { - yynn3207++ + yynn3356++ } } - r.EncodeMapStart(yynn3207) - yynn3207 = 0 + r.EncodeMapStart(yynn3356) + yynn3356 = 0 } - if yyr3207 || yy2arr3207 { + if yyr3356 || yy2arr3356 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Limits == nil { r.EncodeNil() } else { - yym3209 := z.EncBinary() - _ = yym3209 + yym3358 := z.EncBinary() + _ = yym3358 if false { } else { h.encSliceLimitRangeItem(([]LimitRangeItem)(x.Limits), e) @@ -40035,15 +42175,15 @@ func (x *LimitRangeSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Limits == nil { r.EncodeNil() } else { - yym3210 := z.EncBinary() - _ = yym3210 + yym3359 := z.EncBinary() + _ = yym3359 if false { } else { h.encSliceLimitRangeItem(([]LimitRangeItem)(x.Limits), e) } } } - if yyr3207 || yy2arr3207 { + if yyr3356 || yy2arr3356 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -40056,25 +42196,25 @@ func (x *LimitRangeSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3211 := z.DecBinary() - _ = yym3211 + yym3360 := z.DecBinary() + _ = yym3360 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3212 := r.ContainerType() - if yyct3212 == codecSelferValueTypeMap1234 { - yyl3212 := r.ReadMapStart() - if yyl3212 == 0 { + yyct3361 := r.ContainerType() + if yyct3361 == codecSelferValueTypeMap1234 { + yyl3361 := r.ReadMapStart() + if yyl3361 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3212, d) + x.codecDecodeSelfFromMap(yyl3361, d) } - } else if yyct3212 == codecSelferValueTypeArray1234 { - yyl3212 := r.ReadArrayStart() - if yyl3212 == 0 { + } else if yyct3361 == codecSelferValueTypeArray1234 { + yyl3361 := r.ReadArrayStart() + if yyl3361 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3212, d) + x.codecDecodeSelfFromArray(yyl3361, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -40086,12 +42226,12 @@ func (x *LimitRangeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3213Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3213Slc - var yyhl3213 bool = l >= 0 - for yyj3213 := 0; ; yyj3213++ { - if yyhl3213 { - if yyj3213 >= l { + var yys3362Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3362Slc + var yyhl3362 bool = l >= 0 + for yyj3362 := 0; ; yyj3362++ { + if yyhl3362 { + if yyj3362 >= l { break } } else { @@ -40100,26 +42240,26 @@ func (x *LimitRangeSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3213Slc = r.DecodeBytes(yys3213Slc, true, true) - yys3213 := string(yys3213Slc) + yys3362Slc = r.DecodeBytes(yys3362Slc, true, true) + yys3362 := string(yys3362Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3213 { + switch yys3362 { case "limits": if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv3214 := &x.Limits - yym3215 := z.DecBinary() - _ = yym3215 + yyv3363 := &x.Limits + yym3364 := z.DecBinary() + _ = yym3364 if false { } else { - h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3214), d) + h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3363), d) } } default: - z.DecStructFieldNotFound(-1, yys3213) - } // end switch yys3213 - } // end for yyj3213 + z.DecStructFieldNotFound(-1, yys3362) + } // end switch yys3362 + } // end for yyj3362 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -40127,16 +42267,16 @@ func (x *LimitRangeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3216 int - var yyb3216 bool - var yyhl3216 bool = l >= 0 - yyj3216++ - if yyhl3216 { - yyb3216 = yyj3216 > l + var yyj3365 int + var yyb3365 bool + var yyhl3365 bool = l >= 0 + yyj3365++ + if yyhl3365 { + yyb3365 = yyj3365 > l } else { - yyb3216 = r.CheckBreak() + yyb3365 = r.CheckBreak() } - if yyb3216 { + if yyb3365 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40144,26 +42284,26 @@ func (x *LimitRangeSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Limits = nil } else { - yyv3217 := &x.Limits - yym3218 := z.DecBinary() - _ = yym3218 + yyv3366 := &x.Limits + yym3367 := z.DecBinary() + _ = yym3367 if false { } else { - h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3217), d) + h.decSliceLimitRangeItem((*[]LimitRangeItem)(yyv3366), d) } } for { - yyj3216++ - if yyhl3216 { - yyb3216 = yyj3216 > l + yyj3365++ + if yyhl3365 { + yyb3365 = yyj3365 > l } else { - yyb3216 = r.CheckBreak() + yyb3365 = r.CheckBreak() } - if yyb3216 { + if yyb3365 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3216-1, "") + z.DecStructFieldNotFound(yyj3365-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -40175,118 +42315,118 @@ func (x *LimitRange) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3219 := z.EncBinary() - _ = yym3219 + yym3368 := z.EncBinary() + _ = yym3368 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3220 := !z.EncBinary() - yy2arr3220 := z.EncBasicHandle().StructToArray - var yyq3220 [4]bool - _, _, _ = yysep3220, yyq3220, yy2arr3220 - const yyr3220 bool = false - yyq3220[0] = x.Kind != "" - yyq3220[1] = x.APIVersion != "" - yyq3220[2] = true - yyq3220[3] = true - var yynn3220 int - if yyr3220 || yy2arr3220 { + yysep3369 := !z.EncBinary() + yy2arr3369 := z.EncBasicHandle().StructToArray + var yyq3369 [4]bool + _, _, _ = yysep3369, yyq3369, yy2arr3369 + const yyr3369 bool = false + yyq3369[0] = true + yyq3369[1] = true + yyq3369[2] = x.Kind != "" + yyq3369[3] = x.APIVersion != "" + var yynn3369 int + if yyr3369 || yy2arr3369 { r.EncodeArrayStart(4) } else { - yynn3220 = 0 - for _, b := range yyq3220 { + yynn3369 = 0 + for _, b := range yyq3369 { if b { - yynn3220++ + yynn3369++ } } - r.EncodeMapStart(yynn3220) - yynn3220 = 0 + r.EncodeMapStart(yynn3369) + yynn3369 = 0 } - if yyr3220 || yy2arr3220 { + if yyr3369 || yy2arr3369 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3220[0] { - yym3222 := z.EncBinary() - _ = yym3222 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3220[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3223 := z.EncBinary() - _ = yym3223 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3220 || yy2arr3220 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3220[1] { - yym3225 := z.EncBinary() - _ = yym3225 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3220[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3226 := z.EncBinary() - _ = yym3226 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3220 || yy2arr3220 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3220[2] { - yy3228 := &x.ObjectMeta - yy3228.CodecEncodeSelf(e) + if yyq3369[0] { + yy3371 := &x.ObjectMeta + yy3371.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3220[2] { + if yyq3369[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3229 := &x.ObjectMeta - yy3229.CodecEncodeSelf(e) + yy3372 := &x.ObjectMeta + yy3372.CodecEncodeSelf(e) } } - if yyr3220 || yy2arr3220 { + if yyr3369 || yy2arr3369 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3220[3] { - yy3231 := &x.Spec - yy3231.CodecEncodeSelf(e) + if yyq3369[1] { + yy3374 := &x.Spec + yy3374.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3220[3] { + if yyq3369[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3232 := &x.Spec - yy3232.CodecEncodeSelf(e) + yy3375 := &x.Spec + yy3375.CodecEncodeSelf(e) } } - if yyr3220 || yy2arr3220 { + if yyr3369 || yy2arr3369 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3369[2] { + yym3377 := z.EncBinary() + _ = yym3377 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3369[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3378 := z.EncBinary() + _ = yym3378 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3369 || yy2arr3369 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3369[3] { + yym3380 := z.EncBinary() + _ = yym3380 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3369[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3381 := z.EncBinary() + _ = yym3381 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3369 || yy2arr3369 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -40299,25 +42439,25 @@ func (x *LimitRange) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3233 := z.DecBinary() - _ = yym3233 + yym3382 := z.DecBinary() + _ = yym3382 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3234 := r.ContainerType() - if yyct3234 == codecSelferValueTypeMap1234 { - yyl3234 := r.ReadMapStart() - if yyl3234 == 0 { + yyct3383 := r.ContainerType() + if yyct3383 == codecSelferValueTypeMap1234 { + yyl3383 := r.ReadMapStart() + if yyl3383 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3234, d) + x.codecDecodeSelfFromMap(yyl3383, d) } - } else if yyct3234 == codecSelferValueTypeArray1234 { - yyl3234 := r.ReadArrayStart() - if yyl3234 == 0 { + } else if yyct3383 == codecSelferValueTypeArray1234 { + yyl3383 := r.ReadArrayStart() + if yyl3383 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3234, d) + x.codecDecodeSelfFromArray(yyl3383, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -40329,12 +42469,12 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3235Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3235Slc - var yyhl3235 bool = l >= 0 - for yyj3235 := 0; ; yyj3235++ { - if yyhl3235 { - if yyj3235 >= l { + var yys3384Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3384Slc + var yyhl3384 bool = l >= 0 + for yyj3384 := 0; ; yyj3384++ { + if yyhl3384 { + if yyj3384 >= l { break } } else { @@ -40343,10 +42483,24 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3235Slc = r.DecodeBytes(yys3235Slc, true, true) - yys3235 := string(yys3235Slc) + yys3384Slc = r.DecodeBytes(yys3384Slc, true, true) + yys3384 := string(yys3384Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3235 { + switch yys3384 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3385 := &x.ObjectMeta + yyv3385.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = LimitRangeSpec{} + } else { + yyv3386 := &x.Spec + yyv3386.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -40359,24 +42513,10 @@ func (x *LimitRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3238 := &x.ObjectMeta - yyv3238.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = LimitRangeSpec{} - } else { - yyv3239 := &x.Spec - yyv3239.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys3235) - } // end switch yys3235 - } // end for yyj3235 + z.DecStructFieldNotFound(-1, yys3384) + } // end switch yys3384 + } // end for yyj3384 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -40384,48 +42524,16 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3240 int - var yyb3240 bool - var yyhl3240 bool = l >= 0 - yyj3240++ - if yyhl3240 { - yyb3240 = yyj3240 > l + var yyj3389 int + var yyb3389 bool + var yyhl3389 bool = l >= 0 + yyj3389++ + if yyhl3389 { + yyb3389 = yyj3389 > l } else { - yyb3240 = r.CheckBreak() + yyb3389 = r.CheckBreak() } - if yyb3240 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3240++ - if yyhl3240 { - yyb3240 = yyj3240 > l - } else { - yyb3240 = r.CheckBreak() - } - if yyb3240 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3240++ - if yyhl3240 { - yyb3240 = yyj3240 > l - } else { - yyb3240 = r.CheckBreak() - } - if yyb3240 { + if yyb3389 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40433,16 +42541,16 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3243 := &x.ObjectMeta - yyv3243.CodecDecodeSelf(d) + yyv3390 := &x.ObjectMeta + yyv3390.CodecDecodeSelf(d) } - yyj3240++ - if yyhl3240 { - yyb3240 = yyj3240 > l + yyj3389++ + if yyhl3389 { + yyb3389 = yyj3389 > l } else { - yyb3240 = r.CheckBreak() + yyb3389 = r.CheckBreak() } - if yyb3240 { + if yyb3389 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -40450,1834 +42558,58 @@ func (x *LimitRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Spec = LimitRangeSpec{} } else { - yyv3244 := &x.Spec - yyv3244.CodecDecodeSelf(d) + yyv3391 := &x.Spec + yyv3391.CodecDecodeSelf(d) + } + yyj3389++ + if yyhl3389 { + yyb3389 = yyj3389 > l + } else { + yyb3389 = r.CheckBreak() + } + if yyb3389 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3389++ + if yyhl3389 { + yyb3389 = yyj3389 > l + } else { + yyb3389 = r.CheckBreak() + } + if yyb3389 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) } for { - yyj3240++ - if yyhl3240 { - yyb3240 = yyj3240 > l + yyj3389++ + if yyhl3389 { + yyb3389 = yyj3389 > l } else { - yyb3240 = r.CheckBreak() + yyb3389 = r.CheckBreak() } - if yyb3240 { + if yyb3389 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3240-1, "") + z.DecStructFieldNotFound(yyj3389-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } func (x *LimitRangeList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3245 := z.EncBinary() - _ = yym3245 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3246 := !z.EncBinary() - yy2arr3246 := z.EncBasicHandle().StructToArray - var yyq3246 [4]bool - _, _, _ = yysep3246, yyq3246, yy2arr3246 - const yyr3246 bool = false - yyq3246[0] = x.Kind != "" - yyq3246[1] = x.APIVersion != "" - yyq3246[2] = true - var yynn3246 int - if yyr3246 || yy2arr3246 { - r.EncodeArrayStart(4) - } else { - yynn3246 = 1 - for _, b := range yyq3246 { - if b { - yynn3246++ - } - } - r.EncodeMapStart(yynn3246) - yynn3246 = 0 - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[0] { - yym3248 := z.EncBinary() - _ = yym3248 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3246[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3249 := z.EncBinary() - _ = yym3249 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[1] { - yym3251 := z.EncBinary() - _ = yym3251 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3246[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3252 := z.EncBinary() - _ = yym3252 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3246[2] { - yy3254 := &x.ListMeta - yym3255 := z.EncBinary() - _ = yym3255 - if false { - } else if z.HasExtensions() && z.EncExt(yy3254) { - } else { - z.EncFallback(yy3254) - } - } else { - r.EncodeNil() - } - } else { - if yyq3246[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3256 := &x.ListMeta - yym3257 := z.EncBinary() - _ = yym3257 - if false { - } else if z.HasExtensions() && z.EncExt(yy3256) { - } else { - z.EncFallback(yy3256) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3259 := z.EncBinary() - _ = yym3259 - if false { - } else { - h.encSliceLimitRange(([]LimitRange)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3260 := z.EncBinary() - _ = yym3260 - if false { - } else { - h.encSliceLimitRange(([]LimitRange)(x.Items), e) - } - } - } - if yyr3246 || yy2arr3246 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *LimitRangeList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3261 := z.DecBinary() - _ = yym3261 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3262 := r.ContainerType() - if yyct3262 == codecSelferValueTypeMap1234 { - yyl3262 := r.ReadMapStart() - if yyl3262 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3262, d) - } - } else if yyct3262 == codecSelferValueTypeArray1234 { - yyl3262 := r.ReadArrayStart() - if yyl3262 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3262, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *LimitRangeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3263Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3263Slc - var yyhl3263 bool = l >= 0 - for yyj3263 := 0; ; yyj3263++ { - if yyhl3263 { - if yyj3263 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3263Slc = r.DecodeBytes(yys3263Slc, true, true) - yys3263 := string(yys3263Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3263 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3266 := &x.ListMeta - yym3267 := z.DecBinary() - _ = yym3267 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3266) { - } else { - z.DecFallback(yyv3266, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3268 := &x.Items - yym3269 := z.DecBinary() - _ = yym3269 - if false { - } else { - h.decSliceLimitRange((*[]LimitRange)(yyv3268), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3263) - } // end switch yys3263 - } // end for yyj3263 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *LimitRangeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3270 int - var yyb3270 bool - var yyhl3270 bool = l >= 0 - yyj3270++ - if yyhl3270 { - yyb3270 = yyj3270 > l - } else { - yyb3270 = r.CheckBreak() - } - if yyb3270 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3270++ - if yyhl3270 { - yyb3270 = yyj3270 > l - } else { - yyb3270 = r.CheckBreak() - } - if yyb3270 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3270++ - if yyhl3270 { - yyb3270 = yyj3270 > l - } else { - yyb3270 = r.CheckBreak() - } - if yyb3270 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3273 := &x.ListMeta - yym3274 := z.DecBinary() - _ = yym3274 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3273) { - } else { - z.DecFallback(yyv3273, false) - } - } - yyj3270++ - if yyhl3270 { - yyb3270 = yyj3270 > l - } else { - yyb3270 = r.CheckBreak() - } - if yyb3270 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3275 := &x.Items - yym3276 := z.DecBinary() - _ = yym3276 - if false { - } else { - h.decSliceLimitRange((*[]LimitRange)(yyv3275), d) - } - } - for { - yyj3270++ - if yyhl3270 { - yyb3270 = yyj3270 > l - } else { - yyb3270 = r.CheckBreak() - } - if yyb3270 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3270-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3277 := z.EncBinary() - _ = yym3277 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3278 := !z.EncBinary() - yy2arr3278 := z.EncBasicHandle().StructToArray - var yyq3278 [1]bool - _, _, _ = yysep3278, yyq3278, yy2arr3278 - const yyr3278 bool = false - yyq3278[0] = len(x.Hard) != 0 - var yynn3278 int - if yyr3278 || yy2arr3278 { - r.EncodeArrayStart(1) - } else { - yynn3278 = 0 - for _, b := range yyq3278 { - if b { - yynn3278++ - } - } - r.EncodeMapStart(yynn3278) - yynn3278 = 0 - } - if yyr3278 || yy2arr3278 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3278[0] { - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3278[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hard")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } - } - if yyr3278 || yy2arr3278 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3280 := z.DecBinary() - _ = yym3280 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3281 := r.ContainerType() - if yyct3281 == codecSelferValueTypeMap1234 { - yyl3281 := r.ReadMapStart() - if yyl3281 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3281, d) - } - } else if yyct3281 == codecSelferValueTypeArray1234 { - yyl3281 := r.ReadArrayStart() - if yyl3281 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3281, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3282Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3282Slc - var yyhl3282 bool = l >= 0 - for yyj3282 := 0; ; yyj3282++ { - if yyhl3282 { - if yyj3282 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3282Slc = r.DecodeBytes(yys3282Slc, true, true) - yys3282 := string(yys3282Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3282 { - case "hard": - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3283 := &x.Hard - yyv3283.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3282) - } // end switch yys3282 - } // end for yyj3282 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3284 int - var yyb3284 bool - var yyhl3284 bool = l >= 0 - yyj3284++ - if yyhl3284 { - yyb3284 = yyj3284 > l - } else { - yyb3284 = r.CheckBreak() - } - if yyb3284 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3285 := &x.Hard - yyv3285.CodecDecodeSelf(d) - } - for { - yyj3284++ - if yyhl3284 { - yyb3284 = yyj3284 > l - } else { - yyb3284 = r.CheckBreak() - } - if yyb3284 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3284-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3286 := z.EncBinary() - _ = yym3286 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3287 := !z.EncBinary() - yy2arr3287 := z.EncBasicHandle().StructToArray - var yyq3287 [2]bool - _, _, _ = yysep3287, yyq3287, yy2arr3287 - const yyr3287 bool = false - yyq3287[0] = len(x.Hard) != 0 - yyq3287[1] = len(x.Used) != 0 - var yynn3287 int - if yyr3287 || yy2arr3287 { - r.EncodeArrayStart(2) - } else { - yynn3287 = 0 - for _, b := range yyq3287 { - if b { - yynn3287++ - } - } - r.EncodeMapStart(yynn3287) - yynn3287 = 0 - } - if yyr3287 || yy2arr3287 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3287[0] { - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3287[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hard")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Hard == nil { - r.EncodeNil() - } else { - x.Hard.CodecEncodeSelf(e) - } - } - } - if yyr3287 || yy2arr3287 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3287[1] { - if x.Used == nil { - r.EncodeNil() - } else { - x.Used.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq3287[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("used")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Used == nil { - r.EncodeNil() - } else { - x.Used.CodecEncodeSelf(e) - } - } - } - if yyr3287 || yy2arr3287 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3290 := z.DecBinary() - _ = yym3290 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3291 := r.ContainerType() - if yyct3291 == codecSelferValueTypeMap1234 { - yyl3291 := r.ReadMapStart() - if yyl3291 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3291, d) - } - } else if yyct3291 == codecSelferValueTypeArray1234 { - yyl3291 := r.ReadArrayStart() - if yyl3291 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3291, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3292Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3292Slc - var yyhl3292 bool = l >= 0 - for yyj3292 := 0; ; yyj3292++ { - if yyhl3292 { - if yyj3292 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3292Slc = r.DecodeBytes(yys3292Slc, true, true) - yys3292 := string(yys3292Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3292 { - case "hard": - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3293 := &x.Hard - yyv3293.CodecDecodeSelf(d) - } - case "used": - if r.TryDecodeAsNil() { - x.Used = nil - } else { - yyv3294 := &x.Used - yyv3294.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3292) - } // end switch yys3292 - } // end for yyj3292 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3295 int - var yyb3295 bool - var yyhl3295 bool = l >= 0 - yyj3295++ - if yyhl3295 { - yyb3295 = yyj3295 > l - } else { - yyb3295 = r.CheckBreak() - } - if yyb3295 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Hard = nil - } else { - yyv3296 := &x.Hard - yyv3296.CodecDecodeSelf(d) - } - yyj3295++ - if yyhl3295 { - yyb3295 = yyj3295 > l - } else { - yyb3295 = r.CheckBreak() - } - if yyb3295 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Used = nil - } else { - yyv3297 := &x.Used - yyv3297.CodecDecodeSelf(d) - } - for { - yyj3295++ - if yyhl3295 { - yyb3295 = yyj3295 > l - } else { - yyb3295 = r.CheckBreak() - } - if yyb3295 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3295-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuota) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3298 := z.EncBinary() - _ = yym3298 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3299 := !z.EncBinary() - yy2arr3299 := z.EncBasicHandle().StructToArray - var yyq3299 [5]bool - _, _, _ = yysep3299, yyq3299, yy2arr3299 - const yyr3299 bool = false - yyq3299[0] = x.Kind != "" - yyq3299[1] = x.APIVersion != "" - yyq3299[2] = true - yyq3299[3] = true - yyq3299[4] = true - var yynn3299 int - if yyr3299 || yy2arr3299 { - r.EncodeArrayStart(5) - } else { - yynn3299 = 0 - for _, b := range yyq3299 { - if b { - yynn3299++ - } - } - r.EncodeMapStart(yynn3299) - yynn3299 = 0 - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3299[0] { - yym3301 := z.EncBinary() - _ = yym3301 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3299[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3302 := z.EncBinary() - _ = yym3302 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3299[1] { - yym3304 := z.EncBinary() - _ = yym3304 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3299[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3305 := z.EncBinary() - _ = yym3305 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3299[2] { - yy3307 := &x.ObjectMeta - yy3307.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3299[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3308 := &x.ObjectMeta - yy3308.CodecEncodeSelf(e) - } - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3299[3] { - yy3310 := &x.Spec - yy3310.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3299[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3311 := &x.Spec - yy3311.CodecEncodeSelf(e) - } - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3299[4] { - yy3313 := &x.Status - yy3313.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3299[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3314 := &x.Status - yy3314.CodecEncodeSelf(e) - } - } - if yyr3299 || yy2arr3299 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuota) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3315 := z.DecBinary() - _ = yym3315 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3316 := r.ContainerType() - if yyct3316 == codecSelferValueTypeMap1234 { - yyl3316 := r.ReadMapStart() - if yyl3316 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3316, d) - } - } else if yyct3316 == codecSelferValueTypeArray1234 { - yyl3316 := r.ReadArrayStart() - if yyl3316 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3316, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuota) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3317Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3317Slc - var yyhl3317 bool = l >= 0 - for yyj3317 := 0; ; yyj3317++ { - if yyhl3317 { - if yyj3317 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3317Slc = r.DecodeBytes(yys3317Slc, true, true) - yys3317 := string(yys3317Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3317 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3320 := &x.ObjectMeta - yyv3320.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ResourceQuotaSpec{} - } else { - yyv3321 := &x.Spec - yyv3321.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ResourceQuotaStatus{} - } else { - yyv3322 := &x.Status - yyv3322.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3317) - } // end switch yys3317 - } // end for yyj3317 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuota) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3323 int - var yyb3323 bool - var yyhl3323 bool = l >= 0 - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3326 := &x.ObjectMeta - yyv3326.CodecDecodeSelf(d) - } - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ResourceQuotaSpec{} - } else { - yyv3327 := &x.Spec - yyv3327.CodecDecodeSelf(d) - } - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ResourceQuotaStatus{} - } else { - yyv3328 := &x.Status - yyv3328.CodecDecodeSelf(d) - } - for { - yyj3323++ - if yyhl3323 { - yyb3323 = yyj3323 > l - } else { - yyb3323 = r.CheckBreak() - } - if yyb3323 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3323-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ResourceQuotaList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3329 := z.EncBinary() - _ = yym3329 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3330 := !z.EncBinary() - yy2arr3330 := z.EncBasicHandle().StructToArray - var yyq3330 [4]bool - _, _, _ = yysep3330, yyq3330, yy2arr3330 - const yyr3330 bool = false - yyq3330[0] = x.Kind != "" - yyq3330[1] = x.APIVersion != "" - yyq3330[2] = true - var yynn3330 int - if yyr3330 || yy2arr3330 { - r.EncodeArrayStart(4) - } else { - yynn3330 = 1 - for _, b := range yyq3330 { - if b { - yynn3330++ - } - } - r.EncodeMapStart(yynn3330) - yynn3330 = 0 - } - if yyr3330 || yy2arr3330 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3330[0] { - yym3332 := z.EncBinary() - _ = yym3332 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3330[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3333 := z.EncBinary() - _ = yym3333 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3330 || yy2arr3330 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3330[1] { - yym3335 := z.EncBinary() - _ = yym3335 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3330[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3336 := z.EncBinary() - _ = yym3336 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3330 || yy2arr3330 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3330[2] { - yy3338 := &x.ListMeta - yym3339 := z.EncBinary() - _ = yym3339 - if false { - } else if z.HasExtensions() && z.EncExt(yy3338) { - } else { - z.EncFallback(yy3338) - } - } else { - r.EncodeNil() - } - } else { - if yyq3330[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3340 := &x.ListMeta - yym3341 := z.EncBinary() - _ = yym3341 - if false { - } else if z.HasExtensions() && z.EncExt(yy3340) { - } else { - z.EncFallback(yy3340) - } - } - } - if yyr3330 || yy2arr3330 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3343 := z.EncBinary() - _ = yym3343 - if false { - } else { - h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym3344 := z.EncBinary() - _ = yym3344 - if false { - } else { - h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) - } - } - } - if yyr3330 || yy2arr3330 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ResourceQuotaList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3345 := z.DecBinary() - _ = yym3345 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3346 := r.ContainerType() - if yyct3346 == codecSelferValueTypeMap1234 { - yyl3346 := r.ReadMapStart() - if yyl3346 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3346, d) - } - } else if yyct3346 == codecSelferValueTypeArray1234 { - yyl3346 := r.ReadArrayStart() - if yyl3346 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3346, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ResourceQuotaList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3347Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3347Slc - var yyhl3347 bool = l >= 0 - for yyj3347 := 0; ; yyj3347++ { - if yyhl3347 { - if yyj3347 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3347Slc = r.DecodeBytes(yys3347Slc, true, true) - yys3347 := string(yys3347Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3347 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3350 := &x.ListMeta - yym3351 := z.DecBinary() - _ = yym3351 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3350) { - } else { - z.DecFallback(yyv3350, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3352 := &x.Items - yym3353 := z.DecBinary() - _ = yym3353 - if false { - } else { - h.decSliceResourceQuota((*[]ResourceQuota)(yyv3352), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3347) - } // end switch yys3347 - } // end for yyj3347 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ResourceQuotaList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3354 int - var yyb3354 bool - var yyhl3354 bool = l >= 0 - yyj3354++ - if yyhl3354 { - yyb3354 = yyj3354 > l - } else { - yyb3354 = r.CheckBreak() - } - if yyb3354 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3354++ - if yyhl3354 { - yyb3354 = yyj3354 > l - } else { - yyb3354 = r.CheckBreak() - } - if yyb3354 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3354++ - if yyhl3354 { - yyb3354 = yyj3354 > l - } else { - yyb3354 = r.CheckBreak() - } - if yyb3354 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3357 := &x.ListMeta - yym3358 := z.DecBinary() - _ = yym3358 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3357) { - } else { - z.DecFallback(yyv3357, false) - } - } - yyj3354++ - if yyhl3354 { - yyb3354 = yyj3354 > l - } else { - yyb3354 = r.CheckBreak() - } - if yyb3354 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3359 := &x.Items - yym3360 := z.DecBinary() - _ = yym3360 - if false { - } else { - h.decSliceResourceQuota((*[]ResourceQuota)(yyv3359), d) - } - } - for { - yyj3354++ - if yyhl3354 { - yyb3354 = yyj3354 > l - } else { - yyb3354 = r.CheckBreak() - } - if yyb3354 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3354-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym3361 := z.EncBinary() - _ = yym3361 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep3362 := !z.EncBinary() - yy2arr3362 := z.EncBasicHandle().StructToArray - var yyq3362 [5]bool - _, _, _ = yysep3362, yyq3362, yy2arr3362 - const yyr3362 bool = false - yyq3362[0] = x.Kind != "" - yyq3362[1] = x.APIVersion != "" - yyq3362[2] = true - yyq3362[3] = len(x.Data) != 0 - yyq3362[4] = x.Type != "" - var yynn3362 int - if yyr3362 || yy2arr3362 { - r.EncodeArrayStart(5) - } else { - yynn3362 = 0 - for _, b := range yyq3362 { - if b { - yynn3362++ - } - } - r.EncodeMapStart(yynn3362) - yynn3362 = 0 - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3362[0] { - yym3364 := z.EncBinary() - _ = yym3364 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3362[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3365 := z.EncBinary() - _ = yym3365 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3362[1] { - yym3367 := z.EncBinary() - _ = yym3367 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3362[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3368 := z.EncBinary() - _ = yym3368 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3362[2] { - yy3370 := &x.ObjectMeta - yy3370.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq3362[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3371 := &x.ObjectMeta - yy3371.CodecEncodeSelf(e) - } - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3362[3] { - if x.Data == nil { - r.EncodeNil() - } else { - yym3373 := z.EncBinary() - _ = yym3373 - if false { - } else { - h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq3362[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("data")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Data == nil { - r.EncodeNil() - } else { - yym3374 := z.EncBinary() - _ = yym3374 - if false { - } else { - h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) - } - } - } - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3362[4] { - x.Type.CodecEncodeSelf(e) - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3362[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("type")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Type.CodecEncodeSelf(e) - } - } - if yyr3362 || yy2arr3362 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Secret) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3376 := z.DecBinary() - _ = yym3376 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct3377 := r.ContainerType() - if yyct3377 == codecSelferValueTypeMap1234 { - yyl3377 := r.ReadMapStart() - if yyl3377 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl3377, d) - } - } else if yyct3377 == codecSelferValueTypeArray1234 { - yyl3377 := r.ReadArrayStart() - if yyl3377 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl3377, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Secret) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3378Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3378Slc - var yyhl3378 bool = l >= 0 - for yyj3378 := 0; ; yyj3378++ { - if yyhl3378 { - if yyj3378 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3378Slc = r.DecodeBytes(yys3378Slc, true, true) - yys3378 := string(yys3378Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3378 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3381 := &x.ObjectMeta - yyv3381.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3382 := &x.Data - yym3383 := z.DecBinary() - _ = yym3383 - if false { - } else { - h.decMapstringSliceuint8((*map[string][]uint8)(yyv3382), d) - } - } - case "type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = SecretType(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys3378) - } // end switch yys3378 - } // end for yyj3378 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj3385 int - var yyb3385 bool - var yyhl3385 bool = l >= 0 - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3388 := &x.ObjectMeta - yyv3388.CodecDecodeSelf(d) - } - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3389 := &x.Data - yym3390 := z.DecBinary() - _ = yym3390 - if false { - } else { - h.decMapstringSliceuint8((*map[string][]uint8)(yyv3389), d) - } - } - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = SecretType(r.DecodeString()) - } - for { - yyj3385++ - if yyhl3385 { - yyb3385 = yyj3385 > l - } else { - yyb3385 = r.CheckBreak() - } - if yyb3385 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3385-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x SecretType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym3392 := z.EncBinary() - _ = yym3392 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *SecretType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym3393 := z.DecBinary() - _ = yym3393 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -42294,9 +42626,9 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq3395 [4]bool _, _, _ = yysep3395, yyq3395, yy2arr3395 const yyr3395 bool = false - yyq3395[0] = x.Kind != "" - yyq3395[1] = x.APIVersion != "" - yyq3395[2] = true + yyq3395[0] = true + yyq3395[2] = x.Kind != "" + yyq3395[3] = x.APIVersion != "" var yynn3395 int if yyr3395 || yy2arr3395 { r.EncodeArrayStart(4) @@ -42313,79 +42645,29 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr3395 || yy2arr3395 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq3395[0] { - yym3397 := z.EncBinary() - _ = yym3397 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3395[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3397 := &x.ListMeta yym3398 := z.EncBinary() _ = yym3398 if false { + } else if z.HasExtensions() && z.EncExt(yy3397) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3395 || yy2arr3395 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3395[1] { - yym3400 := z.EncBinary() - _ = yym3400 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3395[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3401 := z.EncBinary() - _ = yym3401 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3395 || yy2arr3395 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3395[2] { - yy3403 := &x.ListMeta - yym3404 := z.EncBinary() - _ = yym3404 - if false { - } else if z.HasExtensions() && z.EncExt(yy3403) { - } else { - z.EncFallback(yy3403) + z.EncFallback(yy3397) } } else { r.EncodeNil() } } else { - if yyq3395[2] { + if yyq3395[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3405 := &x.ListMeta - yym3406 := z.EncBinary() - _ = yym3406 + yy3399 := &x.ListMeta + yym3400 := z.EncBinary() + _ = yym3400 if false { - } else if z.HasExtensions() && z.EncExt(yy3405) { + } else if z.HasExtensions() && z.EncExt(yy3399) { } else { - z.EncFallback(yy3405) + z.EncFallback(yy3399) } } } @@ -42394,11 +42676,11 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3408 := z.EncBinary() - _ = yym3408 + yym3402 := z.EncBinary() + _ = yym3402 if false { } else { - h.encSliceSecret(([]Secret)(x.Items), e) + h.encSliceLimitRange(([]LimitRange)(x.Items), e) } } } else { @@ -42408,11 +42690,61 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym3403 := z.EncBinary() + _ = yym3403 + if false { + } else { + h.encSliceLimitRange(([]LimitRange)(x.Items), e) + } + } + } + if yyr3395 || yy2arr3395 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3395[2] { + yym3405 := z.EncBinary() + _ = yym3405 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3395[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3406 := z.EncBinary() + _ = yym3406 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3395 || yy2arr3395 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3395[3] { + yym3408 := z.EncBinary() + _ = yym3408 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3395[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym3409 := z.EncBinary() _ = yym3409 if false { } else { - h.encSliceSecret(([]Secret)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -42425,7 +42757,7 @@ func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *LimitRangeList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42455,7 +42787,7 @@ func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *LimitRangeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42477,6 +42809,31 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys3412 := string(yys3412Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys3412 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3413 := &x.ListMeta + yym3414 := z.DecBinary() + _ = yym3414 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3413) { + } else { + z.DecFallback(yyv3413, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3415 := &x.Items + yym3416 := z.DecBinary() + _ = yym3416 + if false { + } else { + h.decSliceLimitRange((*[]LimitRange)(yyv3415), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -42489,31 +42846,6 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3415 := &x.ListMeta - yym3416 := z.DecBinary() - _ = yym3416 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3415) { - } else { - z.DecFallback(yyv3415, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3417 := &x.Items - yym3418 := z.DecBinary() - _ = yym3418 - if false { - } else { - h.decSliceSecret((*[]Secret)(yyv3417), d) - } - } default: z.DecStructFieldNotFound(-1, yys3412) } // end switch yys3412 @@ -42521,7 +42853,7 @@ func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *LimitRangeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -42539,6 +42871,51 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3420 := &x.ListMeta + yym3421 := z.DecBinary() + _ = yym3421 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3420) { + } else { + z.DecFallback(yyv3420, false) + } + } + yyj3419++ + if yyhl3419 { + yyb3419 = yyj3419 > l + } else { + yyb3419 = r.CheckBreak() + } + if yyb3419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3422 := &x.Items + yym3423 := z.DecBinary() + _ = yym3423 + if false { + } else { + h.decSliceLimitRange((*[]LimitRange)(yyv3422), d) + } + } + yyj3419++ + if yyhl3419 { + yyb3419 = yyj3419 > l + } else { + yyb3419 = r.CheckBreak() + } + if yyb3419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -42560,51 +42937,6 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3419++ - if yyhl3419 { - yyb3419 = yyj3419 > l - } else { - yyb3419 = r.CheckBreak() - } - if yyb3419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3422 := &x.ListMeta - yym3423 := z.DecBinary() - _ = yym3423 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3422) { - } else { - z.DecFallback(yyv3422, false) - } - } - yyj3419++ - if yyhl3419 { - yyb3419 = yyj3419 > l - } else { - yyb3419 = r.CheckBreak() - } - if yyb3419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3424 := &x.Items - yym3425 := z.DecBinary() - _ = yym3425 - if false { - } else { - h.decSliceSecret((*[]Secret)(yyv3424), d) - } - } for { yyj3419++ if yyhl3419 { @@ -42621,7 +42953,7 @@ func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *ResourceQuotaSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -42635,16 +42967,13 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep3427 := !z.EncBinary() yy2arr3427 := z.EncBasicHandle().StructToArray - var yyq3427 [4]bool + var yyq3427 [1]bool _, _, _ = yysep3427, yyq3427, yy2arr3427 const yyr3427 bool = false - yyq3427[0] = x.Kind != "" - yyq3427[1] = x.APIVersion != "" - yyq3427[2] = true - yyq3427[3] = len(x.Data) != 0 + yyq3427[0] = len(x.Hard) != 0 var yynn3427 int if yyr3427 || yy2arr3427 { - r.EncodeArrayStart(4) + r.EncodeArrayStart(1) } else { yynn3427 = 0 for _, b := range yyq3427 { @@ -42658,96 +42987,1857 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { if yyr3427 || yy2arr3427 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq3427[0] { - yym3429 := z.EncBinary() - _ = yym3429 - if false { + if x.Hard == nil { + r.EncodeNil() } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + x.Hard.CodecEncodeSelf(e) } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3427[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3430 := z.EncBinary() - _ = yym3430 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3427 || yy2arr3427 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3427[1] { - yym3432 := z.EncBinary() - _ = yym3432 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3427[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3433 := z.EncBinary() - _ = yym3433 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3427 || yy2arr3427 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3427[2] { - yy3435 := &x.ObjectMeta - yy3435.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3427[2] { + if yyq3427[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("hard")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3436 := &x.ObjectMeta - yy3436.CodecEncodeSelf(e) + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } } } if yyr3427 || yy2arr3427 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaSpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3429 := z.DecBinary() + _ = yym3429 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3430 := r.ContainerType() + if yyct3430 == codecSelferValueTypeMap1234 { + yyl3430 := r.ReadMapStart() + if yyl3430 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3430, d) + } + } else if yyct3430 == codecSelferValueTypeArray1234 { + yyl3430 := r.ReadArrayStart() + if yyl3430 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3430, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3431Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3431Slc + var yyhl3431 bool = l >= 0 + for yyj3431 := 0; ; yyj3431++ { + if yyhl3431 { + if yyj3431 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3431Slc = r.DecodeBytes(yys3431Slc, true, true) + yys3431 := string(yys3431Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3431 { + case "hard": + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3432 := &x.Hard + yyv3432.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys3431) + } // end switch yys3431 + } // end for yyj3431 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3433 int + var yyb3433 bool + var yyhl3433 bool = l >= 0 + yyj3433++ + if yyhl3433 { + yyb3433 = yyj3433 > l + } else { + yyb3433 = r.CheckBreak() + } + if yyb3433 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3434 := &x.Hard + yyv3434.CodecDecodeSelf(d) + } + for { + yyj3433++ + if yyhl3433 { + yyb3433 = yyj3433 > l + } else { + yyb3433 = r.CheckBreak() + } + if yyb3433 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3433-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuotaStatus) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3435 := z.EncBinary() + _ = yym3435 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3436 := !z.EncBinary() + yy2arr3436 := z.EncBasicHandle().StructToArray + var yyq3436 [2]bool + _, _, _ = yysep3436, yyq3436, yy2arr3436 + const yyr3436 bool = false + yyq3436[0] = len(x.Hard) != 0 + yyq3436[1] = len(x.Used) != 0 + var yynn3436 int + if yyr3436 || yy2arr3436 { + r.EncodeArrayStart(2) + } else { + yynn3436 = 0 + for _, b := range yyq3436 { + if b { + yynn3436++ + } + } + r.EncodeMapStart(yynn3436) + yynn3436 = 0 + } + if yyr3436 || yy2arr3436 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3427[3] { + if yyq3436[0] { + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq3436[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hard")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Hard == nil { + r.EncodeNil() + } else { + x.Hard.CodecEncodeSelf(e) + } + } + } + if yyr3436 || yy2arr3436 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3436[1] { + if x.Used == nil { + r.EncodeNil() + } else { + x.Used.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq3436[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("used")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Used == nil { + r.EncodeNil() + } else { + x.Used.CodecEncodeSelf(e) + } + } + } + if yyr3436 || yy2arr3436 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaStatus) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3439 := z.DecBinary() + _ = yym3439 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3440 := r.ContainerType() + if yyct3440 == codecSelferValueTypeMap1234 { + yyl3440 := r.ReadMapStart() + if yyl3440 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3440, d) + } + } else if yyct3440 == codecSelferValueTypeArray1234 { + yyl3440 := r.ReadArrayStart() + if yyl3440 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3440, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3441Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3441Slc + var yyhl3441 bool = l >= 0 + for yyj3441 := 0; ; yyj3441++ { + if yyhl3441 { + if yyj3441 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3441Slc = r.DecodeBytes(yys3441Slc, true, true) + yys3441 := string(yys3441Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3441 { + case "hard": + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3442 := &x.Hard + yyv3442.CodecDecodeSelf(d) + } + case "used": + if r.TryDecodeAsNil() { + x.Used = nil + } else { + yyv3443 := &x.Used + yyv3443.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys3441) + } // end switch yys3441 + } // end for yyj3441 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3444 int + var yyb3444 bool + var yyhl3444 bool = l >= 0 + yyj3444++ + if yyhl3444 { + yyb3444 = yyj3444 > l + } else { + yyb3444 = r.CheckBreak() + } + if yyb3444 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hard = nil + } else { + yyv3445 := &x.Hard + yyv3445.CodecDecodeSelf(d) + } + yyj3444++ + if yyhl3444 { + yyb3444 = yyj3444 > l + } else { + yyb3444 = r.CheckBreak() + } + if yyb3444 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Used = nil + } else { + yyv3446 := &x.Used + yyv3446.CodecDecodeSelf(d) + } + for { + yyj3444++ + if yyhl3444 { + yyb3444 = yyj3444 > l + } else { + yyb3444 = r.CheckBreak() + } + if yyb3444 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3444-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuota) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3447 := z.EncBinary() + _ = yym3447 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3448 := !z.EncBinary() + yy2arr3448 := z.EncBasicHandle().StructToArray + var yyq3448 [5]bool + _, _, _ = yysep3448, yyq3448, yy2arr3448 + const yyr3448 bool = false + yyq3448[0] = true + yyq3448[1] = true + yyq3448[2] = true + yyq3448[3] = x.Kind != "" + yyq3448[4] = x.APIVersion != "" + var yynn3448 int + if yyr3448 || yy2arr3448 { + r.EncodeArrayStart(5) + } else { + yynn3448 = 0 + for _, b := range yyq3448 { + if b { + yynn3448++ + } + } + r.EncodeMapStart(yynn3448) + yynn3448 = 0 + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3448[0] { + yy3450 := &x.ObjectMeta + yy3450.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3448[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3451 := &x.ObjectMeta + yy3451.CodecEncodeSelf(e) + } + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3448[1] { + yy3453 := &x.Spec + yy3453.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3448[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3454 := &x.Spec + yy3454.CodecEncodeSelf(e) + } + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3448[2] { + yy3456 := &x.Status + yy3456.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3448[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3457 := &x.Status + yy3457.CodecEncodeSelf(e) + } + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3448[3] { + yym3459 := z.EncBinary() + _ = yym3459 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3448[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3460 := z.EncBinary() + _ = yym3460 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3448[4] { + yym3462 := z.EncBinary() + _ = yym3462 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3448[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3463 := z.EncBinary() + _ = yym3463 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3448 || yy2arr3448 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuota) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3464 := z.DecBinary() + _ = yym3464 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3465 := r.ContainerType() + if yyct3465 == codecSelferValueTypeMap1234 { + yyl3465 := r.ReadMapStart() + if yyl3465 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3465, d) + } + } else if yyct3465 == codecSelferValueTypeArray1234 { + yyl3465 := r.ReadArrayStart() + if yyl3465 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3465, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuota) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3466Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3466Slc + var yyhl3466 bool = l >= 0 + for yyj3466 := 0; ; yyj3466++ { + if yyhl3466 { + if yyj3466 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3466Slc = r.DecodeBytes(yys3466Slc, true, true) + yys3466 := string(yys3466Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3466 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3467 := &x.ObjectMeta + yyv3467.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ResourceQuotaSpec{} + } else { + yyv3468 := &x.Spec + yyv3468.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ResourceQuotaStatus{} + } else { + yyv3469 := &x.Status + yyv3469.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, yys3466) + } // end switch yys3466 + } // end for yyj3466 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuota) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3472 int + var yyb3472 bool + var yyhl3472 bool = l >= 0 + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3473 := &x.ObjectMeta + yyv3473.CodecDecodeSelf(d) + } + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ResourceQuotaSpec{} + } else { + yyv3474 := &x.Spec + yyv3474.CodecDecodeSelf(d) + } + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ResourceQuotaStatus{} + } else { + yyv3475 := &x.Status + yyv3475.CodecDecodeSelf(d) + } + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3472++ + if yyhl3472 { + yyb3472 = yyj3472 > l + } else { + yyb3472 = r.CheckBreak() + } + if yyb3472 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3472-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ResourceQuotaList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3478 := z.EncBinary() + _ = yym3478 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3479 := !z.EncBinary() + yy2arr3479 := z.EncBasicHandle().StructToArray + var yyq3479 [4]bool + _, _, _ = yysep3479, yyq3479, yy2arr3479 + const yyr3479 bool = false + yyq3479[0] = true + yyq3479[2] = x.Kind != "" + yyq3479[3] = x.APIVersion != "" + var yynn3479 int + if yyr3479 || yy2arr3479 { + r.EncodeArrayStart(4) + } else { + yynn3479 = 1 + for _, b := range yyq3479 { + if b { + yynn3479++ + } + } + r.EncodeMapStart(yynn3479) + yynn3479 = 0 + } + if yyr3479 || yy2arr3479 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3479[0] { + yy3481 := &x.ListMeta + yym3482 := z.EncBinary() + _ = yym3482 + if false { + } else if z.HasExtensions() && z.EncExt(yy3481) { + } else { + z.EncFallback(yy3481) + } + } else { + r.EncodeNil() + } + } else { + if yyq3479[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3483 := &x.ListMeta + yym3484 := z.EncBinary() + _ = yym3484 + if false { + } else if z.HasExtensions() && z.EncExt(yy3483) { + } else { + z.EncFallback(yy3483) + } + } + } + if yyr3479 || yy2arr3479 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3486 := z.EncBinary() + _ = yym3486 + if false { + } else { + h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3487 := z.EncBinary() + _ = yym3487 + if false { + } else { + h.encSliceResourceQuota(([]ResourceQuota)(x.Items), e) + } + } + } + if yyr3479 || yy2arr3479 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3479[2] { + yym3489 := z.EncBinary() + _ = yym3489 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3479[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3490 := z.EncBinary() + _ = yym3490 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3479 || yy2arr3479 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3479[3] { + yym3492 := z.EncBinary() + _ = yym3492 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3479[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3493 := z.EncBinary() + _ = yym3493 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3479 || yy2arr3479 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ResourceQuotaList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3494 := z.DecBinary() + _ = yym3494 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3495 := r.ContainerType() + if yyct3495 == codecSelferValueTypeMap1234 { + yyl3495 := r.ReadMapStart() + if yyl3495 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3495, d) + } + } else if yyct3495 == codecSelferValueTypeArray1234 { + yyl3495 := r.ReadArrayStart() + if yyl3495 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3495, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ResourceQuotaList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3496Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3496Slc + var yyhl3496 bool = l >= 0 + for yyj3496 := 0; ; yyj3496++ { + if yyhl3496 { + if yyj3496 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3496Slc = r.DecodeBytes(yys3496Slc, true, true) + yys3496 := string(yys3496Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3496 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3497 := &x.ListMeta + yym3498 := z.DecBinary() + _ = yym3498 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3497) { + } else { + z.DecFallback(yyv3497, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3499 := &x.Items + yym3500 := z.DecBinary() + _ = yym3500 + if false { + } else { + h.decSliceResourceQuota((*[]ResourceQuota)(yyv3499), 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, yys3496) + } // end switch yys3496 + } // end for yyj3496 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ResourceQuotaList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3503 int + var yyb3503 bool + var yyhl3503 bool = l >= 0 + yyj3503++ + if yyhl3503 { + yyb3503 = yyj3503 > l + } else { + yyb3503 = r.CheckBreak() + } + if yyb3503 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3504 := &x.ListMeta + yym3505 := z.DecBinary() + _ = yym3505 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3504) { + } else { + z.DecFallback(yyv3504, false) + } + } + yyj3503++ + if yyhl3503 { + yyb3503 = yyj3503 > l + } else { + yyb3503 = r.CheckBreak() + } + if yyb3503 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3506 := &x.Items + yym3507 := z.DecBinary() + _ = yym3507 + if false { + } else { + h.decSliceResourceQuota((*[]ResourceQuota)(yyv3506), d) + } + } + yyj3503++ + if yyhl3503 { + yyb3503 = yyj3503 > l + } else { + yyb3503 = r.CheckBreak() + } + if yyb3503 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3503++ + if yyhl3503 { + yyb3503 = yyj3503 > l + } else { + yyb3503 = r.CheckBreak() + } + if yyb3503 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3503++ + if yyhl3503 { + yyb3503 = yyj3503 > l + } else { + yyb3503 = r.CheckBreak() + } + if yyb3503 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3503-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *Secret) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3510 := z.EncBinary() + _ = yym3510 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3511 := !z.EncBinary() + yy2arr3511 := z.EncBasicHandle().StructToArray + var yyq3511 [5]bool + _, _, _ = yysep3511, yyq3511, yy2arr3511 + const yyr3511 bool = false + yyq3511[0] = true + yyq3511[1] = len(x.Data) != 0 + yyq3511[2] = x.Type != "" + yyq3511[3] = x.Kind != "" + yyq3511[4] = x.APIVersion != "" + var yynn3511 int + if yyr3511 || yy2arr3511 { + r.EncodeArrayStart(5) + } else { + yynn3511 = 0 + for _, b := range yyq3511 { + if b { + yynn3511++ + } + } + r.EncodeMapStart(yynn3511) + yynn3511 = 0 + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3511[0] { + yy3513 := &x.ObjectMeta + yy3513.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3511[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3514 := &x.ObjectMeta + yy3514.CodecEncodeSelf(e) + } + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3511[1] { if x.Data == nil { r.EncodeNil() } else { - yym3438 := z.EncBinary() - _ = yym3438 + yym3516 := z.EncBinary() + _ = yym3516 if false { } else { - z.F.EncMapStringStringV(x.Data, false, e) + h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) } } } else { r.EncodeNil() } } else { - if yyq3427[3] { + if yyq3511[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("data")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Data == nil { r.EncodeNil() } else { - yym3439 := z.EncBinary() - _ = yym3439 + yym3517 := z.EncBinary() + _ = yym3517 + if false { + } else { + h.encMapstringSliceuint8((map[string][]uint8)(x.Data), e) + } + } + } + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3511[2] { + x.Type.CodecEncodeSelf(e) + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3511[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("type")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + x.Type.CodecEncodeSelf(e) + } + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3511[3] { + yym3520 := z.EncBinary() + _ = yym3520 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3511[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3521 := z.EncBinary() + _ = yym3521 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3511[4] { + yym3523 := z.EncBinary() + _ = yym3523 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3511[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3524 := z.EncBinary() + _ = yym3524 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3511 || yy2arr3511 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *Secret) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3525 := z.DecBinary() + _ = yym3525 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3526 := r.ContainerType() + if yyct3526 == codecSelferValueTypeMap1234 { + yyl3526 := r.ReadMapStart() + if yyl3526 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3526, d) + } + } else if yyct3526 == codecSelferValueTypeArray1234 { + yyl3526 := r.ReadArrayStart() + if yyl3526 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3526, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *Secret) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3527Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3527Slc + var yyhl3527 bool = l >= 0 + for yyj3527 := 0; ; yyj3527++ { + if yyhl3527 { + if yyj3527 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3527Slc = r.DecodeBytes(yys3527Slc, true, true) + yys3527 := string(yys3527Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3527 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3528 := &x.ObjectMeta + yyv3528.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3529 := &x.Data + yym3530 := z.DecBinary() + _ = yym3530 + if false { + } else { + h.decMapstringSliceuint8((*map[string][]uint8)(yyv3529), d) + } + } + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SecretType(r.DecodeString()) + } + 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, yys3527) + } // end switch yys3527 + } // end for yyj3527 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *Secret) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3534 int + var yyb3534 bool + var yyhl3534 bool = l >= 0 + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3535 := &x.ObjectMeta + yyv3535.CodecDecodeSelf(d) + } + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3536 := &x.Data + yym3537 := z.DecBinary() + _ = yym3537 + if false { + } else { + h.decMapstringSliceuint8((*map[string][]uint8)(yyv3536), d) + } + } + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SecretType(r.DecodeString()) + } + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3534++ + if yyhl3534 { + yyb3534 = yyj3534 > l + } else { + yyb3534 = r.CheckBreak() + } + if yyb3534 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3534-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x SecretType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym3541 := z.EncBinary() + _ = yym3541 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *SecretType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3542 := z.DecBinary() + _ = yym3542 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *SecretList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3543 := z.EncBinary() + _ = yym3543 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3544 := !z.EncBinary() + yy2arr3544 := z.EncBasicHandle().StructToArray + var yyq3544 [4]bool + _, _, _ = yysep3544, yyq3544, yy2arr3544 + const yyr3544 bool = false + yyq3544[0] = true + yyq3544[2] = x.Kind != "" + yyq3544[3] = x.APIVersion != "" + var yynn3544 int + if yyr3544 || yy2arr3544 { + r.EncodeArrayStart(4) + } else { + yynn3544 = 1 + for _, b := range yyq3544 { + if b { + yynn3544++ + } + } + r.EncodeMapStart(yynn3544) + yynn3544 = 0 + } + if yyr3544 || yy2arr3544 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3544[0] { + yy3546 := &x.ListMeta + yym3547 := z.EncBinary() + _ = yym3547 + if false { + } else if z.HasExtensions() && z.EncExt(yy3546) { + } else { + z.EncFallback(yy3546) + } + } else { + r.EncodeNil() + } + } else { + if yyq3544[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3548 := &x.ListMeta + yym3549 := z.EncBinary() + _ = yym3549 + if false { + } else if z.HasExtensions() && z.EncExt(yy3548) { + } else { + z.EncFallback(yy3548) + } + } + } + if yyr3544 || yy2arr3544 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3551 := z.EncBinary() + _ = yym3551 + if false { + } else { + h.encSliceSecret(([]Secret)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym3552 := z.EncBinary() + _ = yym3552 + if false { + } else { + h.encSliceSecret(([]Secret)(x.Items), e) + } + } + } + if yyr3544 || yy2arr3544 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3544[2] { + yym3554 := z.EncBinary() + _ = yym3554 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3544[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3555 := z.EncBinary() + _ = yym3555 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3544 || yy2arr3544 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3544[3] { + yym3557 := z.EncBinary() + _ = yym3557 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3544[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3558 := z.EncBinary() + _ = yym3558 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3544 || yy2arr3544 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *SecretList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym3559 := z.DecBinary() + _ = yym3559 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct3560 := r.ContainerType() + if yyct3560 == codecSelferValueTypeMap1234 { + yyl3560 := r.ReadMapStart() + if yyl3560 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl3560, d) + } + } else if yyct3560 == codecSelferValueTypeArray1234 { + yyl3560 := r.ReadArrayStart() + if yyl3560 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl3560, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *SecretList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys3561Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3561Slc + var yyhl3561 bool = l >= 0 + for yyj3561 := 0; ; yyj3561++ { + if yyhl3561 { + if yyj3561 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys3561Slc = r.DecodeBytes(yys3561Slc, true, true) + yys3561 := string(yys3561Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys3561 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3562 := &x.ListMeta + yym3563 := z.DecBinary() + _ = yym3563 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3562) { + } else { + z.DecFallback(yyv3562, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3564 := &x.Items + yym3565 := z.DecBinary() + _ = yym3565 + if false { + } else { + h.decSliceSecret((*[]Secret)(yyv3564), 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, yys3561) + } // end switch yys3561 + } // end for yyj3561 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *SecretList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj3568 int + var yyb3568 bool + var yyhl3568 bool = l >= 0 + yyj3568++ + if yyhl3568 { + yyb3568 = yyj3568 > l + } else { + yyb3568 = r.CheckBreak() + } + if yyb3568 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3569 := &x.ListMeta + yym3570 := z.DecBinary() + _ = yym3570 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3569) { + } else { + z.DecFallback(yyv3569, false) + } + } + yyj3568++ + if yyhl3568 { + yyb3568 = yyj3568 > l + } else { + yyb3568 = r.CheckBreak() + } + if yyb3568 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3571 := &x.Items + yym3572 := z.DecBinary() + _ = yym3572 + if false { + } else { + h.decSliceSecret((*[]Secret)(yyv3571), d) + } + } + yyj3568++ + if yyhl3568 { + yyb3568 = yyj3568 > l + } else { + yyb3568 = r.CheckBreak() + } + if yyb3568 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3568++ + if yyhl3568 { + yyb3568 = yyj3568 > l + } else { + yyb3568 = r.CheckBreak() + } + if yyb3568 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj3568++ + if yyhl3568 { + yyb3568 = yyj3568 > l + } else { + yyb3568 = r.CheckBreak() + } + if yyb3568 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj3568-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym3575 := z.EncBinary() + _ = yym3575 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep3576 := !z.EncBinary() + yy2arr3576 := z.EncBasicHandle().StructToArray + var yyq3576 [4]bool + _, _, _ = yysep3576, yyq3576, yy2arr3576 + const yyr3576 bool = false + yyq3576[0] = true + yyq3576[1] = len(x.Data) != 0 + yyq3576[2] = x.Kind != "" + yyq3576[3] = x.APIVersion != "" + var yynn3576 int + if yyr3576 || yy2arr3576 { + r.EncodeArrayStart(4) + } else { + yynn3576 = 0 + for _, b := range yyq3576 { + if b { + yynn3576++ + } + } + r.EncodeMapStart(yynn3576) + yynn3576 = 0 + } + if yyr3576 || yy2arr3576 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3576[0] { + yy3578 := &x.ObjectMeta + yy3578.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq3576[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy3579 := &x.ObjectMeta + yy3579.CodecEncodeSelf(e) + } + } + if yyr3576 || yy2arr3576 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3576[1] { + if x.Data == nil { + r.EncodeNil() + } else { + yym3581 := z.EncBinary() + _ = yym3581 + if false { + } else { + z.F.EncMapStringStringV(x.Data, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq3576[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("data")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Data == nil { + r.EncodeNil() + } else { + yym3582 := z.EncBinary() + _ = yym3582 if false { } else { z.F.EncMapStringStringV(x.Data, false, e) @@ -42755,7 +44845,57 @@ func (x *ConfigMap) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3427 || yy2arr3427 { + if yyr3576 || yy2arr3576 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3576[2] { + yym3584 := z.EncBinary() + _ = yym3584 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3576[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3585 := z.EncBinary() + _ = yym3585 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3576 || yy2arr3576 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3576[3] { + yym3587 := z.EncBinary() + _ = yym3587 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3576[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3588 := z.EncBinary() + _ = yym3588 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3576 || yy2arr3576 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -42768,25 +44908,25 @@ func (x *ConfigMap) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3440 := z.DecBinary() - _ = yym3440 + yym3589 := z.DecBinary() + _ = yym3589 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3441 := r.ContainerType() - if yyct3441 == codecSelferValueTypeMap1234 { - yyl3441 := r.ReadMapStart() - if yyl3441 == 0 { + yyct3590 := r.ContainerType() + if yyct3590 == codecSelferValueTypeMap1234 { + yyl3590 := r.ReadMapStart() + if yyl3590 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3441, d) + x.codecDecodeSelfFromMap(yyl3590, d) } - } else if yyct3441 == codecSelferValueTypeArray1234 { - yyl3441 := r.ReadArrayStart() - if yyl3441 == 0 { + } else if yyct3590 == codecSelferValueTypeArray1234 { + yyl3590 := r.ReadArrayStart() + if yyl3590 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3441, d) + x.codecDecodeSelfFromArray(yyl3590, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -42798,12 +44938,12 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3442Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3442Slc - var yyhl3442 bool = l >= 0 - for yyj3442 := 0; ; yyj3442++ { - if yyhl3442 { - if yyj3442 >= l { + var yys3591Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3591Slc + var yyhl3591 bool = l >= 0 + for yyj3591 := 0; ; yyj3591++ { + if yyhl3591 { + if yyj3591 >= l { break } } else { @@ -42812,10 +44952,29 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3442Slc = r.DecodeBytes(yys3442Slc, true, true) - yys3442 := string(yys3442Slc) + yys3591Slc = r.DecodeBytes(yys3591Slc, true, true) + yys3591 := string(yys3591Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3442 { + switch yys3591 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3592 := &x.ObjectMeta + yyv3592.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3593 := &x.Data + yym3594 := z.DecBinary() + _ = yym3594 + if false { + } else { + z.F.DecMapStringStringX(yyv3593, false, d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -42828,29 +44987,10 @@ func (x *ConfigMap) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3445 := &x.ObjectMeta - yyv3445.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3446 := &x.Data - yym3447 := z.DecBinary() - _ = yym3447 - if false { - } else { - z.F.DecMapStringStringX(yyv3446, false, d) - } - } default: - z.DecStructFieldNotFound(-1, yys3442) - } // end switch yys3442 - } // end for yyj3442 + z.DecStructFieldNotFound(-1, yys3591) + } // end switch yys3591 + } // end for yyj3591 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -42858,16 +44998,55 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3448 int - var yyb3448 bool - var yyhl3448 bool = l >= 0 - yyj3448++ - if yyhl3448 { - yyb3448 = yyj3448 > l + var yyj3597 int + var yyb3597 bool + var yyhl3597 bool = l >= 0 + yyj3597++ + if yyhl3597 { + yyb3597 = yyj3597 > l } else { - yyb3448 = r.CheckBreak() + yyb3597 = r.CheckBreak() } - if yyb3448 { + if yyb3597 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3598 := &x.ObjectMeta + yyv3598.CodecDecodeSelf(d) + } + yyj3597++ + if yyhl3597 { + yyb3597 = yyj3597 > l + } else { + yyb3597 = r.CheckBreak() + } + if yyb3597 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3599 := &x.Data + yym3600 := z.DecBinary() + _ = yym3600 + if false { + } else { + z.F.DecMapStringStringX(yyv3599, false, d) + } + } + yyj3597++ + if yyhl3597 { + yyb3597 = yyj3597 > l + } else { + yyb3597 = r.CheckBreak() + } + if yyb3597 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -42877,13 +45056,13 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3448++ - if yyhl3448 { - yyb3448 = yyj3448 > l + yyj3597++ + if yyhl3597 { + yyb3597 = yyj3597 > l } else { - yyb3448 = r.CheckBreak() + yyb3597 = r.CheckBreak() } - if yyb3448 { + if yyb3597 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -42893,57 +45072,18 @@ func (x *ConfigMap) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3448++ - if yyhl3448 { - yyb3448 = yyj3448 > l - } else { - yyb3448 = r.CheckBreak() - } - if yyb3448 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3451 := &x.ObjectMeta - yyv3451.CodecDecodeSelf(d) - } - yyj3448++ - if yyhl3448 { - yyb3448 = yyj3448 > l - } else { - yyb3448 = r.CheckBreak() - } - if yyb3448 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3452 := &x.Data - yym3453 := z.DecBinary() - _ = yym3453 - if false { - } else { - z.F.DecMapStringStringX(yyv3452, false, d) - } - } for { - yyj3448++ - if yyhl3448 { - yyb3448 = yyj3448 > l + yyj3597++ + if yyhl3597 { + yyb3597 = yyj3597 > l } else { - yyb3448 = r.CheckBreak() + yyb3597 = r.CheckBreak() } - if yyb3448 { + if yyb3597 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3448-1, "") + z.DecStructFieldNotFound(yyj3597-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -42955,120 +45095,70 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3454 := z.EncBinary() - _ = yym3454 + yym3603 := z.EncBinary() + _ = yym3603 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3455 := !z.EncBinary() - yy2arr3455 := z.EncBasicHandle().StructToArray - var yyq3455 [4]bool - _, _, _ = yysep3455, yyq3455, yy2arr3455 - const yyr3455 bool = false - yyq3455[0] = x.Kind != "" - yyq3455[1] = x.APIVersion != "" - yyq3455[2] = true - yyq3455[3] = len(x.Items) != 0 - var yynn3455 int - if yyr3455 || yy2arr3455 { + yysep3604 := !z.EncBinary() + yy2arr3604 := z.EncBasicHandle().StructToArray + var yyq3604 [4]bool + _, _, _ = yysep3604, yyq3604, yy2arr3604 + const yyr3604 bool = false + yyq3604[0] = true + yyq3604[1] = len(x.Items) != 0 + yyq3604[2] = x.Kind != "" + yyq3604[3] = x.APIVersion != "" + var yynn3604 int + if yyr3604 || yy2arr3604 { r.EncodeArrayStart(4) } else { - yynn3455 = 0 - for _, b := range yyq3455 { + yynn3604 = 0 + for _, b := range yyq3604 { if b { - yynn3455++ + yynn3604++ } } - r.EncodeMapStart(yynn3455) - yynn3455 = 0 + r.EncodeMapStart(yynn3604) + yynn3604 = 0 } - if yyr3455 || yy2arr3455 { + if yyr3604 || yy2arr3604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3455[0] { - yym3457 := z.EncBinary() - _ = yym3457 + if yyq3604[0] { + yy3606 := &x.ListMeta + yym3607 := z.EncBinary() + _ = yym3607 if false { + } else if z.HasExtensions() && z.EncExt(yy3606) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3455[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3458 := z.EncBinary() - _ = yym3458 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3455 || yy2arr3455 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3455[1] { - yym3460 := z.EncBinary() - _ = yym3460 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3455[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3461 := z.EncBinary() - _ = yym3461 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3455 || yy2arr3455 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3455[2] { - yy3463 := &x.ListMeta - yym3464 := z.EncBinary() - _ = yym3464 - if false { - } else if z.HasExtensions() && z.EncExt(yy3463) { - } else { - z.EncFallback(yy3463) + z.EncFallback(yy3606) } } else { r.EncodeNil() } } else { - if yyq3455[2] { + if yyq3604[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3465 := &x.ListMeta - yym3466 := z.EncBinary() - _ = yym3466 + yy3608 := &x.ListMeta + yym3609 := z.EncBinary() + _ = yym3609 if false { - } else if z.HasExtensions() && z.EncExt(yy3465) { + } else if z.HasExtensions() && z.EncExt(yy3608) { } else { - z.EncFallback(yy3465) + z.EncFallback(yy3608) } } } - if yyr3455 || yy2arr3455 { + if yyr3604 || yy2arr3604 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3455[3] { + if yyq3604[1] { if x.Items == nil { r.EncodeNil() } else { - yym3468 := z.EncBinary() - _ = yym3468 + yym3611 := z.EncBinary() + _ = yym3611 if false { } else { h.encSliceConfigMap(([]ConfigMap)(x.Items), e) @@ -43078,15 +45168,15 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3455[3] { + if yyq3604[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("items")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Items == nil { r.EncodeNil() } else { - yym3469 := z.EncBinary() - _ = yym3469 + yym3612 := z.EncBinary() + _ = yym3612 if false { } else { h.encSliceConfigMap(([]ConfigMap)(x.Items), e) @@ -43094,7 +45184,57 @@ func (x *ConfigMapList) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3455 || yy2arr3455 { + if yyr3604 || yy2arr3604 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3604[2] { + yym3614 := z.EncBinary() + _ = yym3614 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3604[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3615 := z.EncBinary() + _ = yym3615 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3604 || yy2arr3604 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3604[3] { + yym3617 := z.EncBinary() + _ = yym3617 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3604[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3618 := z.EncBinary() + _ = yym3618 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3604 || yy2arr3604 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -43107,25 +45247,25 @@ func (x *ConfigMapList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3470 := z.DecBinary() - _ = yym3470 + yym3619 := z.DecBinary() + _ = yym3619 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3471 := r.ContainerType() - if yyct3471 == codecSelferValueTypeMap1234 { - yyl3471 := r.ReadMapStart() - if yyl3471 == 0 { + yyct3620 := r.ContainerType() + if yyct3620 == codecSelferValueTypeMap1234 { + yyl3620 := r.ReadMapStart() + if yyl3620 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3471, d) + x.codecDecodeSelfFromMap(yyl3620, d) } - } else if yyct3471 == codecSelferValueTypeArray1234 { - yyl3471 := r.ReadArrayStart() - if yyl3471 == 0 { + } else if yyct3620 == codecSelferValueTypeArray1234 { + yyl3620 := r.ReadArrayStart() + if yyl3620 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3471, d) + x.codecDecodeSelfFromArray(yyl3620, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43137,12 +45277,12 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3472Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3472Slc - var yyhl3472 bool = l >= 0 - for yyj3472 := 0; ; yyj3472++ { - if yyhl3472 { - if yyj3472 >= l { + var yys3621Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3621Slc + var yyhl3621 bool = l >= 0 + for yyj3621 := 0; ; yyj3621++ { + if yyhl3621 { + if yyj3621 >= l { break } } else { @@ -43151,10 +45291,35 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3472Slc = r.DecodeBytes(yys3472Slc, true, true) - yys3472 := string(yys3472Slc) + yys3621Slc = r.DecodeBytes(yys3621Slc, true, true) + yys3621 := string(yys3621Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3472 { + switch yys3621 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3622 := &x.ListMeta + yym3623 := z.DecBinary() + _ = yym3623 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3622) { + } else { + z.DecFallback(yyv3622, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3624 := &x.Items + yym3625 := z.DecBinary() + _ = yym3625 + if false { + } else { + h.decSliceConfigMap((*[]ConfigMap)(yyv3624), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -43167,35 +45332,10 @@ func (x *ConfigMapList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3475 := &x.ListMeta - yym3476 := z.DecBinary() - _ = yym3476 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3475) { - } else { - z.DecFallback(yyv3475, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3477 := &x.Items - yym3478 := z.DecBinary() - _ = yym3478 - if false { - } else { - h.decSliceConfigMap((*[]ConfigMap)(yyv3477), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3472) - } // end switch yys3472 - } // end for yyj3472 + z.DecStructFieldNotFound(-1, yys3621) + } // end switch yys3621 + } // end for yyj3621 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43203,16 +45343,61 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3479 int - var yyb3479 bool - var yyhl3479 bool = l >= 0 - yyj3479++ - if yyhl3479 { - yyb3479 = yyj3479 > l + var yyj3628 int + var yyb3628 bool + var yyhl3628 bool = l >= 0 + yyj3628++ + if yyhl3628 { + yyb3628 = yyj3628 > l } else { - yyb3479 = r.CheckBreak() + yyb3628 = r.CheckBreak() } - if yyb3479 { + if yyb3628 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3629 := &x.ListMeta + yym3630 := z.DecBinary() + _ = yym3630 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3629) { + } else { + z.DecFallback(yyv3629, false) + } + } + yyj3628++ + if yyhl3628 { + yyb3628 = yyj3628 > l + } else { + yyb3628 = r.CheckBreak() + } + if yyb3628 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3631 := &x.Items + yym3632 := z.DecBinary() + _ = yym3632 + if false { + } else { + h.decSliceConfigMap((*[]ConfigMap)(yyv3631), d) + } + } + yyj3628++ + if yyhl3628 { + yyb3628 = yyj3628 > l + } else { + yyb3628 = r.CheckBreak() + } + if yyb3628 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43222,13 +45407,13 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj3479++ - if yyhl3479 { - yyb3479 = yyj3479 > l + yyj3628++ + if yyhl3628 { + yyb3628 = yyj3628 > l } else { - yyb3479 = r.CheckBreak() + yyb3628 = r.CheckBreak() } - if yyb3479 { + if yyb3628 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43238,63 +45423,18 @@ func (x *ConfigMapList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj3479++ - if yyhl3479 { - yyb3479 = yyj3479 > l - } else { - yyb3479 = r.CheckBreak() - } - if yyb3479 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3482 := &x.ListMeta - yym3483 := z.DecBinary() - _ = yym3483 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3482) { - } else { - z.DecFallback(yyv3482, false) - } - } - yyj3479++ - if yyhl3479 { - yyb3479 = yyj3479 > l - } else { - yyb3479 = r.CheckBreak() - } - if yyb3479 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3484 := &x.Items - yym3485 := z.DecBinary() - _ = yym3485 - if false { - } else { - h.decSliceConfigMap((*[]ConfigMap)(yyv3484), d) - } - } for { - yyj3479++ - if yyhl3479 { - yyb3479 = yyj3479 > l + yyj3628++ + if yyhl3628 { + yyb3628 = yyj3628 > l } else { - yyb3479 = r.CheckBreak() + yyb3628 = r.CheckBreak() } - if yyb3479 { + if yyb3628 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3479-1, "") + z.DecStructFieldNotFound(yyj3628-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43303,8 +45443,8 @@ func (x ComponentConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym3486 := z.EncBinary() - _ = yym3486 + yym3635 := z.EncBinary() + _ = yym3635 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -43316,8 +45456,8 @@ func (x *ComponentConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3487 := z.DecBinary() - _ = yym3487 + yym3636 := z.DecBinary() + _ = yym3636 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -43332,32 +45472,32 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3488 := z.EncBinary() - _ = yym3488 + yym3637 := z.EncBinary() + _ = yym3637 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3489 := !z.EncBinary() - yy2arr3489 := z.EncBasicHandle().StructToArray - var yyq3489 [4]bool - _, _, _ = yysep3489, yyq3489, yy2arr3489 - const yyr3489 bool = false - yyq3489[2] = x.Message != "" - yyq3489[3] = x.Error != "" - var yynn3489 int - if yyr3489 || yy2arr3489 { + yysep3638 := !z.EncBinary() + yy2arr3638 := z.EncBasicHandle().StructToArray + var yyq3638 [4]bool + _, _, _ = yysep3638, yyq3638, yy2arr3638 + const yyr3638 bool = false + yyq3638[2] = x.Message != "" + yyq3638[3] = x.Error != "" + var yynn3638 int + if yyr3638 || yy2arr3638 { r.EncodeArrayStart(4) } else { - yynn3489 = 2 - for _, b := range yyq3489 { + yynn3638 = 2 + for _, b := range yyq3638 { if b { - yynn3489++ + yynn3638++ } } - r.EncodeMapStart(yynn3489) - yynn3489 = 0 + r.EncodeMapStart(yynn3638) + yynn3638 = 0 } - if yyr3489 || yy2arr3489 { + if yyr3638 || yy2arr3638 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -43366,7 +45506,7 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr3489 || yy2arr3489 { + if yyr3638 || yy2arr3638 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Status.CodecEncodeSelf(e) } else { @@ -43375,11 +45515,11 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Status.CodecEncodeSelf(e) } - if yyr3489 || yy2arr3489 { + if yyr3638 || yy2arr3638 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3489[2] { - yym3493 := z.EncBinary() - _ = yym3493 + if yyq3638[2] { + yym3642 := z.EncBinary() + _ = yym3642 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -43388,23 +45528,23 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3489[2] { + if yyq3638[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3494 := z.EncBinary() - _ = yym3494 + yym3643 := z.EncBinary() + _ = yym3643 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr3489 || yy2arr3489 { + if yyr3638 || yy2arr3638 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3489[3] { - yym3496 := z.EncBinary() - _ = yym3496 + if yyq3638[3] { + yym3645 := z.EncBinary() + _ = yym3645 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Error)) @@ -43413,19 +45553,19 @@ func (x *ComponentCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3489[3] { + if yyq3638[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("error")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3497 := z.EncBinary() - _ = yym3497 + yym3646 := z.EncBinary() + _ = yym3646 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Error)) } } } - if yyr3489 || yy2arr3489 { + if yyr3638 || yy2arr3638 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -43438,25 +45578,25 @@ func (x *ComponentCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3498 := z.DecBinary() - _ = yym3498 + yym3647 := z.DecBinary() + _ = yym3647 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3499 := r.ContainerType() - if yyct3499 == codecSelferValueTypeMap1234 { - yyl3499 := r.ReadMapStart() - if yyl3499 == 0 { + yyct3648 := r.ContainerType() + if yyct3648 == codecSelferValueTypeMap1234 { + yyl3648 := r.ReadMapStart() + if yyl3648 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3499, d) + x.codecDecodeSelfFromMap(yyl3648, d) } - } else if yyct3499 == codecSelferValueTypeArray1234 { - yyl3499 := r.ReadArrayStart() - if yyl3499 == 0 { + } else if yyct3648 == codecSelferValueTypeArray1234 { + yyl3648 := r.ReadArrayStart() + if yyl3648 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3499, d) + x.codecDecodeSelfFromArray(yyl3648, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43468,12 +45608,12 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3500Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3500Slc - var yyhl3500 bool = l >= 0 - for yyj3500 := 0; ; yyj3500++ { - if yyhl3500 { - if yyj3500 >= l { + var yys3649Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3649Slc + var yyhl3649 bool = l >= 0 + for yyj3649 := 0; ; yyj3649++ { + if yyhl3649 { + if yyj3649 >= l { break } } else { @@ -43482,10 +45622,10 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3500Slc = r.DecodeBytes(yys3500Slc, true, true) - yys3500 := string(yys3500Slc) + yys3649Slc = r.DecodeBytes(yys3649Slc, true, true) + yys3649 := string(yys3649Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3500 { + switch yys3649 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -43511,9 +45651,9 @@ func (x *ComponentCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.Error = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3500) - } // end switch yys3500 - } // end for yyj3500 + z.DecStructFieldNotFound(-1, yys3649) + } // end switch yys3649 + } // end for yyj3649 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43521,16 +45661,16 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3505 int - var yyb3505 bool - var yyhl3505 bool = l >= 0 - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + var yyj3654 int + var yyb3654 bool + var yyhl3654 bool = l >= 0 + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43540,13 +45680,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Type = ComponentConditionType(r.DecodeString()) } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43556,13 +45696,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Status = ConditionStatus(r.DecodeString()) } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43572,13 +45712,13 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Message = string(r.DecodeString()) } - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43589,17 +45729,17 @@ func (x *ComponentCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.Error = string(r.DecodeString()) } for { - yyj3505++ - if yyhl3505 { - yyb3505 = yyj3505 > l + yyj3654++ + if yyhl3654 { + yyb3654 = yyj3654 > l } else { - yyb3505 = r.CheckBreak() + yyb3654 = r.CheckBreak() } - if yyb3505 { + if yyb3654 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3505-1, "") + z.DecStructFieldNotFound(yyj3654-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43611,108 +45751,58 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3510 := z.EncBinary() - _ = yym3510 + yym3659 := z.EncBinary() + _ = yym3659 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3511 := !z.EncBinary() - yy2arr3511 := z.EncBasicHandle().StructToArray - var yyq3511 [4]bool - _, _, _ = yysep3511, yyq3511, yy2arr3511 - const yyr3511 bool = false - yyq3511[0] = x.Kind != "" - yyq3511[1] = x.APIVersion != "" - yyq3511[2] = true - yyq3511[3] = len(x.Conditions) != 0 - var yynn3511 int - if yyr3511 || yy2arr3511 { + yysep3660 := !z.EncBinary() + yy2arr3660 := z.EncBasicHandle().StructToArray + var yyq3660 [4]bool + _, _, _ = yysep3660, yyq3660, yy2arr3660 + const yyr3660 bool = false + yyq3660[0] = true + yyq3660[1] = len(x.Conditions) != 0 + yyq3660[2] = x.Kind != "" + yyq3660[3] = x.APIVersion != "" + var yynn3660 int + if yyr3660 || yy2arr3660 { r.EncodeArrayStart(4) } else { - yynn3511 = 0 - for _, b := range yyq3511 { + yynn3660 = 0 + for _, b := range yyq3660 { if b { - yynn3511++ + yynn3660++ } } - r.EncodeMapStart(yynn3511) - yynn3511 = 0 + r.EncodeMapStart(yynn3660) + yynn3660 = 0 } - if yyr3511 || yy2arr3511 { + if yyr3660 || yy2arr3660 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3511[0] { - yym3513 := z.EncBinary() - _ = yym3513 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3511[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3514 := z.EncBinary() - _ = yym3514 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3511 || yy2arr3511 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3511[1] { - yym3516 := z.EncBinary() - _ = yym3516 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3511[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3517 := z.EncBinary() - _ = yym3517 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3511 || yy2arr3511 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3511[2] { - yy3519 := &x.ObjectMeta - yy3519.CodecEncodeSelf(e) + if yyq3660[0] { + yy3662 := &x.ObjectMeta + yy3662.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3511[2] { + if yyq3660[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3520 := &x.ObjectMeta - yy3520.CodecEncodeSelf(e) + yy3663 := &x.ObjectMeta + yy3663.CodecEncodeSelf(e) } } - if yyr3511 || yy2arr3511 { + if yyr3660 || yy2arr3660 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3511[3] { + if yyq3660[1] { if x.Conditions == nil { r.EncodeNil() } else { - yym3522 := z.EncBinary() - _ = yym3522 + yym3665 := z.EncBinary() + _ = yym3665 if false { } else { h.encSliceComponentCondition(([]ComponentCondition)(x.Conditions), e) @@ -43722,15 +45812,15 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3511[3] { + if yyq3660[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym3523 := z.EncBinary() - _ = yym3523 + yym3666 := z.EncBinary() + _ = yym3666 if false { } else { h.encSliceComponentCondition(([]ComponentCondition)(x.Conditions), e) @@ -43738,7 +45828,57 @@ func (x *ComponentStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3511 || yy2arr3511 { + if yyr3660 || yy2arr3660 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3660[2] { + yym3668 := z.EncBinary() + _ = yym3668 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3660[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3669 := z.EncBinary() + _ = yym3669 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3660 || yy2arr3660 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3660[3] { + yym3671 := z.EncBinary() + _ = yym3671 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3660[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3672 := z.EncBinary() + _ = yym3672 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3660 || yy2arr3660 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -43751,25 +45891,25 @@ func (x *ComponentStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3524 := z.DecBinary() - _ = yym3524 + yym3673 := z.DecBinary() + _ = yym3673 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3525 := r.ContainerType() - if yyct3525 == codecSelferValueTypeMap1234 { - yyl3525 := r.ReadMapStart() - if yyl3525 == 0 { + yyct3674 := r.ContainerType() + if yyct3674 == codecSelferValueTypeMap1234 { + yyl3674 := r.ReadMapStart() + if yyl3674 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3525, d) + x.codecDecodeSelfFromMap(yyl3674, d) } - } else if yyct3525 == codecSelferValueTypeArray1234 { - yyl3525 := r.ReadArrayStart() - if yyl3525 == 0 { + } else if yyct3674 == codecSelferValueTypeArray1234 { + yyl3674 := r.ReadArrayStart() + if yyl3674 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3525, d) + x.codecDecodeSelfFromArray(yyl3674, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -43781,12 +45921,12 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3526Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3526Slc - var yyhl3526 bool = l >= 0 - for yyj3526 := 0; ; yyj3526++ { - if yyhl3526 { - if yyj3526 >= l { + var yys3675Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3675Slc + var yyhl3675 bool = l >= 0 + for yyj3675 := 0; ; yyj3675++ { + if yyhl3675 { + if yyj3675 >= l { break } } else { @@ -43795,10 +45935,29 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3526Slc = r.DecodeBytes(yys3526Slc, true, true) - yys3526 := string(yys3526Slc) + yys3675Slc = r.DecodeBytes(yys3675Slc, true, true) + yys3675 := string(yys3675Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3526 { + switch yys3675 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3676 := &x.ObjectMeta + yyv3676.CodecDecodeSelf(d) + } + case "conditions": + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv3677 := &x.Conditions + yym3678 := z.DecBinary() + _ = yym3678 + if false { + } else { + h.decSliceComponentCondition((*[]ComponentCondition)(yyv3677), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -43811,29 +45970,10 @@ func (x *ComponentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3529 := &x.ObjectMeta - yyv3529.CodecDecodeSelf(d) - } - case "conditions": - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv3530 := &x.Conditions - yym3531 := z.DecBinary() - _ = yym3531 - if false { - } else { - h.decSliceComponentCondition((*[]ComponentCondition)(yyv3530), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3526) - } // end switch yys3526 - } // end for yyj3526 + z.DecStructFieldNotFound(-1, yys3675) + } // end switch yys3675 + } // end for yyj3675 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -43841,16 +45981,55 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3532 int - var yyb3532 bool - var yyhl3532 bool = l >= 0 - yyj3532++ - if yyhl3532 { - yyb3532 = yyj3532 > l + var yyj3681 int + var yyb3681 bool + var yyhl3681 bool = l >= 0 + yyj3681++ + if yyhl3681 { + yyb3681 = yyj3681 > l } else { - yyb3532 = r.CheckBreak() + yyb3681 = r.CheckBreak() } - if yyb3532 { + if yyb3681 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3682 := &x.ObjectMeta + yyv3682.CodecDecodeSelf(d) + } + yyj3681++ + if yyhl3681 { + yyb3681 = yyj3681 > l + } else { + yyb3681 = r.CheckBreak() + } + if yyb3681 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Conditions = nil + } else { + yyv3683 := &x.Conditions + yym3684 := z.DecBinary() + _ = yym3684 + if false { + } else { + h.decSliceComponentCondition((*[]ComponentCondition)(yyv3683), d) + } + } + yyj3681++ + if yyhl3681 { + yyb3681 = yyj3681 > l + } else { + yyb3681 = r.CheckBreak() + } + if yyb3681 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43860,13 +46039,13 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Kind = string(r.DecodeString()) } - yyj3532++ - if yyhl3532 { - yyb3532 = yyj3532 > l + yyj3681++ + if yyhl3681 { + yyb3681 = yyj3681 > l } else { - yyb3532 = r.CheckBreak() + yyb3681 = r.CheckBreak() } - if yyb3532 { + if yyb3681 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -43876,57 +46055,18 @@ func (x *ComponentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - yyj3532++ - if yyhl3532 { - yyb3532 = yyj3532 > l - } else { - yyb3532 = r.CheckBreak() - } - if yyb3532 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3535 := &x.ObjectMeta - yyv3535.CodecDecodeSelf(d) - } - yyj3532++ - if yyhl3532 { - yyb3532 = yyj3532 > l - } else { - yyb3532 = r.CheckBreak() - } - if yyb3532 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv3536 := &x.Conditions - yym3537 := z.DecBinary() - _ = yym3537 - if false { - } else { - h.decSliceComponentCondition((*[]ComponentCondition)(yyv3536), d) - } - } for { - yyj3532++ - if yyhl3532 { - yyb3532 = yyj3532 > l + yyj3681++ + if yyhl3681 { + yyb3681 = yyj3681 > l } else { - yyb3532 = r.CheckBreak() + yyb3681 = r.CheckBreak() } - if yyb3532 { + if yyb3681 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3532-1, "") + z.DecStructFieldNotFound(yyj3681-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -43938,118 +46078,68 @@ func (x *ComponentStatusList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3538 := z.EncBinary() - _ = yym3538 + yym3687 := z.EncBinary() + _ = yym3687 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3539 := !z.EncBinary() - yy2arr3539 := z.EncBasicHandle().StructToArray - var yyq3539 [4]bool - _, _, _ = yysep3539, yyq3539, yy2arr3539 - const yyr3539 bool = false - yyq3539[0] = x.Kind != "" - yyq3539[1] = x.APIVersion != "" - yyq3539[2] = true - var yynn3539 int - if yyr3539 || yy2arr3539 { + yysep3688 := !z.EncBinary() + yy2arr3688 := z.EncBasicHandle().StructToArray + var yyq3688 [4]bool + _, _, _ = yysep3688, yyq3688, yy2arr3688 + const yyr3688 bool = false + yyq3688[0] = true + yyq3688[2] = x.Kind != "" + yyq3688[3] = x.APIVersion != "" + var yynn3688 int + if yyr3688 || yy2arr3688 { r.EncodeArrayStart(4) } else { - yynn3539 = 1 - for _, b := range yyq3539 { + yynn3688 = 1 + for _, b := range yyq3688 { if b { - yynn3539++ + yynn3688++ } } - r.EncodeMapStart(yynn3539) - yynn3539 = 0 + r.EncodeMapStart(yynn3688) + yynn3688 = 0 } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[0] { - yym3541 := z.EncBinary() - _ = yym3541 + if yyq3688[0] { + yy3690 := &x.ListMeta + yym3691 := z.EncBinary() + _ = yym3691 if false { + } else if z.HasExtensions() && z.EncExt(yy3690) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3539[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3542 := z.EncBinary() - _ = yym3542 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3539 || yy2arr3539 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[1] { - yym3544 := z.EncBinary() - _ = yym3544 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3539[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3545 := z.EncBinary() - _ = yym3545 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3539 || yy2arr3539 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3539[2] { - yy3547 := &x.ListMeta - yym3548 := z.EncBinary() - _ = yym3548 - if false { - } else if z.HasExtensions() && z.EncExt(yy3547) { - } else { - z.EncFallback(yy3547) + z.EncFallback(yy3690) } } else { r.EncodeNil() } } else { - if yyq3539[2] { + if yyq3688[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3549 := &x.ListMeta - yym3550 := z.EncBinary() - _ = yym3550 + yy3692 := &x.ListMeta + yym3693 := z.EncBinary() + _ = yym3693 if false { - } else if z.HasExtensions() && z.EncExt(yy3549) { + } else if z.HasExtensions() && z.EncExt(yy3692) { } else { - z.EncFallback(yy3549) + z.EncFallback(yy3692) } } } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym3552 := z.EncBinary() - _ = yym3552 + yym3695 := z.EncBinary() + _ = yym3695 if false { } else { h.encSliceComponentStatus(([]ComponentStatus)(x.Items), e) @@ -44062,15 +46152,65 @@ func (x *ComponentStatusList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym3553 := z.EncBinary() - _ = yym3553 + yym3696 := z.EncBinary() + _ = yym3696 if false { } else { h.encSliceComponentStatus(([]ComponentStatus)(x.Items), e) } } } - if yyr3539 || yy2arr3539 { + if yyr3688 || yy2arr3688 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3688[2] { + yym3698 := z.EncBinary() + _ = yym3698 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3688[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3699 := z.EncBinary() + _ = yym3699 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3688 || yy2arr3688 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3688[3] { + yym3701 := z.EncBinary() + _ = yym3701 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3688[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3702 := z.EncBinary() + _ = yym3702 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3688 || yy2arr3688 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44083,25 +46223,25 @@ func (x *ComponentStatusList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3554 := z.DecBinary() - _ = yym3554 + yym3703 := z.DecBinary() + _ = yym3703 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3555 := r.ContainerType() - if yyct3555 == codecSelferValueTypeMap1234 { - yyl3555 := r.ReadMapStart() - if yyl3555 == 0 { + yyct3704 := r.ContainerType() + if yyct3704 == codecSelferValueTypeMap1234 { + yyl3704 := r.ReadMapStart() + if yyl3704 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3555, d) + x.codecDecodeSelfFromMap(yyl3704, d) } - } else if yyct3555 == codecSelferValueTypeArray1234 { - yyl3555 := r.ReadArrayStart() - if yyl3555 == 0 { + } else if yyct3704 == codecSelferValueTypeArray1234 { + yyl3704 := r.ReadArrayStart() + if yyl3704 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3555, d) + x.codecDecodeSelfFromArray(yyl3704, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44113,12 +46253,12 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3556Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3556Slc - var yyhl3556 bool = l >= 0 - for yyj3556 := 0; ; yyj3556++ { - if yyhl3556 { - if yyj3556 >= l { + var yys3705Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3705Slc + var yyhl3705 bool = l >= 0 + for yyj3705 := 0; ; yyj3705++ { + if yyhl3705 { + if yyj3705 >= l { break } } else { @@ -44127,10 +46267,35 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3556Slc = r.DecodeBytes(yys3556Slc, true, true) - yys3556 := string(yys3556Slc) + yys3705Slc = r.DecodeBytes(yys3705Slc, true, true) + yys3705 := string(yys3705Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3556 { + switch yys3705 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3706 := &x.ListMeta + yym3707 := z.DecBinary() + _ = yym3707 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3706) { + } else { + z.DecFallback(yyv3706, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3708 := &x.Items + yym3709 := z.DecBinary() + _ = yym3709 + if false { + } else { + h.decSliceComponentStatus((*[]ComponentStatus)(yyv3708), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -44143,35 +46308,10 @@ func (x *ComponentStatusList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3559 := &x.ListMeta - yym3560 := z.DecBinary() - _ = yym3560 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3559) { - } else { - z.DecFallback(yyv3559, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3561 := &x.Items - yym3562 := z.DecBinary() - _ = yym3562 - if false { - } else { - h.decSliceComponentStatus((*[]ComponentStatus)(yyv3561), d) - } - } default: - z.DecStructFieldNotFound(-1, yys3556) - } // end switch yys3556 - } // end for yyj3556 + z.DecStructFieldNotFound(-1, yys3705) + } // end switch yys3705 + } // end for yyj3705 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44179,16 +46319,61 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3563 int - var yyb3563 bool - var yyhl3563 bool = l >= 0 - yyj3563++ - if yyhl3563 { - yyb3563 = yyj3563 > l + var yyj3712 int + var yyb3712 bool + var yyhl3712 bool = l >= 0 + yyj3712++ + if yyhl3712 { + yyb3712 = yyj3712 > l } else { - yyb3563 = r.CheckBreak() + yyb3712 = r.CheckBreak() } - if yyb3563 { + if yyb3712 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg2_unversioned.ListMeta{} + } else { + yyv3713 := &x.ListMeta + yym3714 := z.DecBinary() + _ = yym3714 + if false { + } else if z.HasExtensions() && z.DecExt(yyv3713) { + } else { + z.DecFallback(yyv3713, false) + } + } + yyj3712++ + if yyhl3712 { + yyb3712 = yyj3712 > l + } else { + yyb3712 = r.CheckBreak() + } + if yyb3712 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv3715 := &x.Items + yym3716 := z.DecBinary() + _ = yym3716 + if false { + } else { + h.decSliceComponentStatus((*[]ComponentStatus)(yyv3715), d) + } + } + yyj3712++ + if yyhl3712 { + yyb3712 = yyj3712 > l + } else { + yyb3712 = r.CheckBreak() + } + if yyb3712 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44198,13 +46383,13 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj3563++ - if yyhl3563 { - yyb3563 = yyj3563 > l + yyj3712++ + if yyhl3712 { + yyb3712 = yyj3712 > l } else { - yyb3563 = r.CheckBreak() + yyb3712 = r.CheckBreak() } - if yyb3563 { + if yyb3712 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44214,63 +46399,18 @@ func (x *ComponentStatusList) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj3563++ - if yyhl3563 { - yyb3563 = yyj3563 > l - } else { - yyb3563 = r.CheckBreak() - } - if yyb3563 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv3566 := &x.ListMeta - yym3567 := z.DecBinary() - _ = yym3567 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3566) { - } else { - z.DecFallback(yyv3566, false) - } - } - yyj3563++ - if yyhl3563 { - yyb3563 = yyj3563 > l - } else { - yyb3563 = r.CheckBreak() - } - if yyb3563 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv3568 := &x.Items - yym3569 := z.DecBinary() - _ = yym3569 - if false { - } else { - h.decSliceComponentStatus((*[]ComponentStatus)(yyv3568), d) - } - } for { - yyj3563++ - if yyhl3563 { - yyb3563 = yyj3563 > l + yyj3712++ + if yyhl3712 { + yyb3712 = yyj3712 > l } else { - yyb3563 = r.CheckBreak() + yyb3712 = r.CheckBreak() } - if yyb3563 { + if yyb3712 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3563-1, "") + z.DecStructFieldNotFound(yyj3712-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -44282,38 +46422,38 @@ func (x *DownwardAPIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3570 := z.EncBinary() - _ = yym3570 + yym3719 := z.EncBinary() + _ = yym3719 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3571 := !z.EncBinary() - yy2arr3571 := z.EncBasicHandle().StructToArray - var yyq3571 [1]bool - _, _, _ = yysep3571, yyq3571, yy2arr3571 - const yyr3571 bool = false - yyq3571[0] = len(x.Items) != 0 - var yynn3571 int - if yyr3571 || yy2arr3571 { + yysep3720 := !z.EncBinary() + yy2arr3720 := z.EncBasicHandle().StructToArray + var yyq3720 [1]bool + _, _, _ = yysep3720, yyq3720, yy2arr3720 + const yyr3720 bool = false + yyq3720[0] = len(x.Items) != 0 + var yynn3720 int + if yyr3720 || yy2arr3720 { r.EncodeArrayStart(1) } else { - yynn3571 = 0 - for _, b := range yyq3571 { + yynn3720 = 0 + for _, b := range yyq3720 { if b { - yynn3571++ + yynn3720++ } } - r.EncodeMapStart(yynn3571) - yynn3571 = 0 + r.EncodeMapStart(yynn3720) + yynn3720 = 0 } - if yyr3571 || yy2arr3571 { + if yyr3720 || yy2arr3720 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3571[0] { + if yyq3720[0] { if x.Items == nil { r.EncodeNil() } else { - yym3573 := z.EncBinary() - _ = yym3573 + yym3722 := z.EncBinary() + _ = yym3722 if false { } else { h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) @@ -44323,15 +46463,15 @@ func (x *DownwardAPIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3571[0] { + if yyq3720[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("items")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Items == nil { r.EncodeNil() } else { - yym3574 := z.EncBinary() - _ = yym3574 + yym3723 := z.EncBinary() + _ = yym3723 if false { } else { h.encSliceDownwardAPIVolumeFile(([]DownwardAPIVolumeFile)(x.Items), e) @@ -44339,7 +46479,7 @@ func (x *DownwardAPIVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3571 || yy2arr3571 { + if yyr3720 || yy2arr3720 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44352,25 +46492,25 @@ func (x *DownwardAPIVolumeSource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3575 := z.DecBinary() - _ = yym3575 + yym3724 := z.DecBinary() + _ = yym3724 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3576 := r.ContainerType() - if yyct3576 == codecSelferValueTypeMap1234 { - yyl3576 := r.ReadMapStart() - if yyl3576 == 0 { + yyct3725 := r.ContainerType() + if yyct3725 == codecSelferValueTypeMap1234 { + yyl3725 := r.ReadMapStart() + if yyl3725 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3576, d) + x.codecDecodeSelfFromMap(yyl3725, d) } - } else if yyct3576 == codecSelferValueTypeArray1234 { - yyl3576 := r.ReadArrayStart() - if yyl3576 == 0 { + } else if yyct3725 == codecSelferValueTypeArray1234 { + yyl3725 := r.ReadArrayStart() + if yyl3725 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3576, d) + x.codecDecodeSelfFromArray(yyl3725, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44382,12 +46522,12 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3577Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3577Slc - var yyhl3577 bool = l >= 0 - for yyj3577 := 0; ; yyj3577++ { - if yyhl3577 { - if yyj3577 >= l { + var yys3726Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3726Slc + var yyhl3726 bool = l >= 0 + for yyj3726 := 0; ; yyj3726++ { + if yyhl3726 { + if yyj3726 >= l { break } } else { @@ -44396,26 +46536,26 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3577Slc = r.DecodeBytes(yys3577Slc, true, true) - yys3577 := string(yys3577Slc) + yys3726Slc = r.DecodeBytes(yys3726Slc, true, true) + yys3726 := string(yys3726Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3577 { + switch yys3726 { case "items": if r.TryDecodeAsNil() { x.Items = nil } else { - yyv3578 := &x.Items - yym3579 := z.DecBinary() - _ = yym3579 + yyv3727 := &x.Items + yym3728 := z.DecBinary() + _ = yym3728 if false { } else { - h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv3578), d) + h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv3727), d) } } default: - z.DecStructFieldNotFound(-1, yys3577) - } // end switch yys3577 - } // end for yyj3577 + z.DecStructFieldNotFound(-1, yys3726) + } // end switch yys3726 + } // end for yyj3726 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44423,16 +46563,16 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3580 int - var yyb3580 bool - var yyhl3580 bool = l >= 0 - yyj3580++ - if yyhl3580 { - yyb3580 = yyj3580 > l + var yyj3729 int + var yyb3729 bool + var yyhl3729 bool = l >= 0 + yyj3729++ + if yyhl3729 { + yyb3729 = yyj3729 > l } else { - yyb3580 = r.CheckBreak() + yyb3729 = r.CheckBreak() } - if yyb3580 { + if yyb3729 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44440,26 +46580,26 @@ func (x *DownwardAPIVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.Items = nil } else { - yyv3581 := &x.Items - yym3582 := z.DecBinary() - _ = yym3582 + yyv3730 := &x.Items + yym3731 := z.DecBinary() + _ = yym3731 if false { } else { - h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv3581), d) + h.decSliceDownwardAPIVolumeFile((*[]DownwardAPIVolumeFile)(yyv3730), d) } } for { - yyj3580++ - if yyhl3580 { - yyb3580 = yyj3580 > l + yyj3729++ + if yyhl3729 { + yyb3729 = yyj3729 > l } else { - yyb3580 = r.CheckBreak() + yyb3729 = r.CheckBreak() } - if yyb3580 { + if yyb3729 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3580-1, "") + z.DecStructFieldNotFound(yyj3729-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -44471,33 +46611,33 @@ func (x *DownwardAPIVolumeFile) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3583 := z.EncBinary() - _ = yym3583 + yym3732 := z.EncBinary() + _ = yym3732 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3584 := !z.EncBinary() - yy2arr3584 := z.EncBasicHandle().StructToArray - var yyq3584 [2]bool - _, _, _ = yysep3584, yyq3584, yy2arr3584 - const yyr3584 bool = false - var yynn3584 int - if yyr3584 || yy2arr3584 { + yysep3733 := !z.EncBinary() + yy2arr3733 := z.EncBasicHandle().StructToArray + var yyq3733 [2]bool + _, _, _ = yysep3733, yyq3733, yy2arr3733 + const yyr3733 bool = false + var yynn3733 int + if yyr3733 || yy2arr3733 { r.EncodeArrayStart(2) } else { - yynn3584 = 2 - for _, b := range yyq3584 { + yynn3733 = 2 + for _, b := range yyq3733 { if b { - yynn3584++ + yynn3733++ } } - r.EncodeMapStart(yynn3584) - yynn3584 = 0 + r.EncodeMapStart(yynn3733) + yynn3733 = 0 } - if yyr3584 || yy2arr3584 { + if yyr3733 || yy2arr3733 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym3586 := z.EncBinary() - _ = yym3586 + yym3735 := z.EncBinary() + _ = yym3735 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -44506,25 +46646,25 @@ func (x *DownwardAPIVolumeFile) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3587 := z.EncBinary() - _ = yym3587 + yym3736 := z.EncBinary() + _ = yym3736 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } - if yyr3584 || yy2arr3584 { + if yyr3733 || yy2arr3733 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3589 := &x.FieldRef - yy3589.CodecEncodeSelf(e) + yy3738 := &x.FieldRef + yy3738.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fieldRef")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3590 := &x.FieldRef - yy3590.CodecEncodeSelf(e) + yy3739 := &x.FieldRef + yy3739.CodecEncodeSelf(e) } - if yyr3584 || yy2arr3584 { + if yyr3733 || yy2arr3733 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44537,25 +46677,25 @@ func (x *DownwardAPIVolumeFile) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3591 := z.DecBinary() - _ = yym3591 + yym3740 := z.DecBinary() + _ = yym3740 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3592 := r.ContainerType() - if yyct3592 == codecSelferValueTypeMap1234 { - yyl3592 := r.ReadMapStart() - if yyl3592 == 0 { + yyct3741 := r.ContainerType() + if yyct3741 == codecSelferValueTypeMap1234 { + yyl3741 := r.ReadMapStart() + if yyl3741 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3592, d) + x.codecDecodeSelfFromMap(yyl3741, d) } - } else if yyct3592 == codecSelferValueTypeArray1234 { - yyl3592 := r.ReadArrayStart() - if yyl3592 == 0 { + } else if yyct3741 == codecSelferValueTypeArray1234 { + yyl3741 := r.ReadArrayStart() + if yyl3741 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3592, d) + x.codecDecodeSelfFromArray(yyl3741, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44567,12 +46707,12 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3593Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3593Slc - var yyhl3593 bool = l >= 0 - for yyj3593 := 0; ; yyj3593++ { - if yyhl3593 { - if yyj3593 >= l { + var yys3742Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3742Slc + var yyhl3742 bool = l >= 0 + for yyj3742 := 0; ; yyj3742++ { + if yyhl3742 { + if yyj3742 >= l { break } } else { @@ -44581,10 +46721,10 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3593Slc = r.DecodeBytes(yys3593Slc, true, true) - yys3593 := string(yys3593Slc) + yys3742Slc = r.DecodeBytes(yys3742Slc, true, true) + yys3742 := string(yys3742Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3593 { + switch yys3742 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -44595,13 +46735,13 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromMap(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.FieldRef = ObjectFieldSelector{} } else { - yyv3595 := &x.FieldRef - yyv3595.CodecDecodeSelf(d) + yyv3744 := &x.FieldRef + yyv3744.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys3593) - } // end switch yys3593 - } // end for yyj3593 + z.DecStructFieldNotFound(-1, yys3742) + } // end switch yys3742 + } // end for yyj3742 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44609,16 +46749,16 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3596 int - var yyb3596 bool - var yyhl3596 bool = l >= 0 - yyj3596++ - if yyhl3596 { - yyb3596 = yyj3596 > l + var yyj3745 int + var yyb3745 bool + var yyhl3745 bool = l >= 0 + yyj3745++ + if yyhl3745 { + yyb3745 = yyj3745 > l } else { - yyb3596 = r.CheckBreak() + yyb3745 = r.CheckBreak() } - if yyb3596 { + if yyb3745 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44628,13 +46768,13 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Path = string(r.DecodeString()) } - yyj3596++ - if yyhl3596 { - yyb3596 = yyj3596 > l + yyj3745++ + if yyhl3745 { + yyb3745 = yyj3745 > l } else { - yyb3596 = r.CheckBreak() + yyb3745 = r.CheckBreak() } - if yyb3596 { + if yyb3745 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -44642,21 +46782,21 @@ func (x *DownwardAPIVolumeFile) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.FieldRef = ObjectFieldSelector{} } else { - yyv3598 := &x.FieldRef - yyv3598.CodecDecodeSelf(d) + yyv3747 := &x.FieldRef + yyv3747.CodecDecodeSelf(d) } for { - yyj3596++ - if yyhl3596 { - yyb3596 = yyj3596 > l + yyj3745++ + if yyhl3745 { + yyb3745 = yyj3745 > l } else { - yyb3596 = r.CheckBreak() + yyb3745 = r.CheckBreak() } - if yyb3596 { + if yyb3745 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3596-1, "") + z.DecStructFieldNotFound(yyj3745-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -44668,37 +46808,37 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3599 := z.EncBinary() - _ = yym3599 + yym3748 := z.EncBinary() + _ = yym3748 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3600 := !z.EncBinary() - yy2arr3600 := z.EncBasicHandle().StructToArray - var yyq3600 [5]bool - _, _, _ = yysep3600, yyq3600, yy2arr3600 - const yyr3600 bool = false - yyq3600[0] = x.Capabilities != nil - yyq3600[1] = x.Privileged != nil - yyq3600[2] = x.SELinuxOptions != nil - yyq3600[3] = x.RunAsUser != nil - yyq3600[4] = x.RunAsNonRoot != nil - var yynn3600 int - if yyr3600 || yy2arr3600 { + yysep3749 := !z.EncBinary() + yy2arr3749 := z.EncBasicHandle().StructToArray + var yyq3749 [5]bool + _, _, _ = yysep3749, yyq3749, yy2arr3749 + const yyr3749 bool = false + yyq3749[0] = x.Capabilities != nil + yyq3749[1] = x.Privileged != nil + yyq3749[2] = x.SELinuxOptions != nil + yyq3749[3] = x.RunAsUser != nil + yyq3749[4] = x.RunAsNonRoot != nil + var yynn3749 int + if yyr3749 || yy2arr3749 { r.EncodeArrayStart(5) } else { - yynn3600 = 0 - for _, b := range yyq3600 { + yynn3749 = 0 + for _, b := range yyq3749 { if b { - yynn3600++ + yynn3749++ } } - r.EncodeMapStart(yynn3600) - yynn3600 = 0 + r.EncodeMapStart(yynn3749) + yynn3749 = 0 } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3600[0] { + if yyq3749[0] { if x.Capabilities == nil { r.EncodeNil() } else { @@ -44708,7 +46848,7 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3600[0] { + if yyq3749[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("capabilities")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -44719,44 +46859,44 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3600[1] { + if yyq3749[1] { if x.Privileged == nil { r.EncodeNil() } else { - yy3603 := *x.Privileged - yym3604 := z.EncBinary() - _ = yym3604 + yy3752 := *x.Privileged + yym3753 := z.EncBinary() + _ = yym3753 if false { } else { - r.EncodeBool(bool(yy3603)) + r.EncodeBool(bool(yy3752)) } } } else { r.EncodeNil() } } else { - if yyq3600[1] { + if yyq3749[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("privileged")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Privileged == nil { r.EncodeNil() } else { - yy3605 := *x.Privileged - yym3606 := z.EncBinary() - _ = yym3606 + yy3754 := *x.Privileged + yym3755 := z.EncBinary() + _ = yym3755 if false { } else { - r.EncodeBool(bool(yy3605)) + r.EncodeBool(bool(yy3754)) } } } } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3600[2] { + if yyq3749[2] { if x.SELinuxOptions == nil { r.EncodeNil() } else { @@ -44766,7 +46906,7 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq3600[2] { + if yyq3749[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -44777,77 +46917,77 @@ func (x *SecurityContext) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3600[3] { + if yyq3749[3] { if x.RunAsUser == nil { r.EncodeNil() } else { - yy3609 := *x.RunAsUser - yym3610 := z.EncBinary() - _ = yym3610 + yy3758 := *x.RunAsUser + yym3759 := z.EncBinary() + _ = yym3759 if false { } else { - r.EncodeInt(int64(yy3609)) + r.EncodeInt(int64(yy3758)) } } } else { r.EncodeNil() } } else { - if yyq3600[3] { + if yyq3749[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsUser == nil { r.EncodeNil() } else { - yy3611 := *x.RunAsUser - yym3612 := z.EncBinary() - _ = yym3612 + yy3760 := *x.RunAsUser + yym3761 := z.EncBinary() + _ = yym3761 if false { } else { - r.EncodeInt(int64(yy3611)) + r.EncodeInt(int64(yy3760)) } } } } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3600[4] { + if yyq3749[4] { if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy3614 := *x.RunAsNonRoot - yym3615 := z.EncBinary() - _ = yym3615 + yy3763 := *x.RunAsNonRoot + yym3764 := z.EncBinary() + _ = yym3764 if false { } else { - r.EncodeBool(bool(yy3614)) + r.EncodeBool(bool(yy3763)) } } } else { r.EncodeNil() } } else { - if yyq3600[4] { + if yyq3749[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("runAsNonRoot")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RunAsNonRoot == nil { r.EncodeNil() } else { - yy3616 := *x.RunAsNonRoot - yym3617 := z.EncBinary() - _ = yym3617 + yy3765 := *x.RunAsNonRoot + yym3766 := z.EncBinary() + _ = yym3766 if false { } else { - r.EncodeBool(bool(yy3616)) + r.EncodeBool(bool(yy3765)) } } } } - if yyr3600 || yy2arr3600 { + if yyr3749 || yy2arr3749 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -44860,25 +47000,25 @@ func (x *SecurityContext) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3618 := z.DecBinary() - _ = yym3618 + yym3767 := z.DecBinary() + _ = yym3767 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3619 := r.ContainerType() - if yyct3619 == codecSelferValueTypeMap1234 { - yyl3619 := r.ReadMapStart() - if yyl3619 == 0 { + yyct3768 := r.ContainerType() + if yyct3768 == codecSelferValueTypeMap1234 { + yyl3768 := r.ReadMapStart() + if yyl3768 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3619, d) + x.codecDecodeSelfFromMap(yyl3768, d) } - } else if yyct3619 == codecSelferValueTypeArray1234 { - yyl3619 := r.ReadArrayStart() - if yyl3619 == 0 { + } else if yyct3768 == codecSelferValueTypeArray1234 { + yyl3768 := r.ReadArrayStart() + if yyl3768 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3619, d) + x.codecDecodeSelfFromArray(yyl3768, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -44890,12 +47030,12 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3620Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3620Slc - var yyhl3620 bool = l >= 0 - for yyj3620 := 0; ; yyj3620++ { - if yyhl3620 { - if yyj3620 >= l { + var yys3769Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3769Slc + var yyhl3769 bool = l >= 0 + for yyj3769 := 0; ; yyj3769++ { + if yyhl3769 { + if yyj3769 >= l { break } } else { @@ -44904,10 +47044,10 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3620Slc = r.DecodeBytes(yys3620Slc, true, true) - yys3620 := string(yys3620Slc) + yys3769Slc = r.DecodeBytes(yys3769Slc, true, true) + yys3769 := string(yys3769Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3620 { + switch yys3769 { case "capabilities": if r.TryDecodeAsNil() { if x.Capabilities != nil { @@ -44928,8 +47068,8 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Privileged == nil { x.Privileged = new(bool) } - yym3623 := z.DecBinary() - _ = yym3623 + yym3772 := z.DecBinary() + _ = yym3772 if false { } else { *((*bool)(x.Privileged)) = r.DecodeBool() @@ -44955,8 +47095,8 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym3626 := z.DecBinary() - _ = yym3626 + yym3775 := z.DecBinary() + _ = yym3775 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) @@ -44971,17 +47111,17 @@ func (x *SecurityContext) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym3628 := z.DecBinary() - _ = yym3628 + yym3777 := z.DecBinary() + _ = yym3777 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } default: - z.DecStructFieldNotFound(-1, yys3620) - } // end switch yys3620 - } // end for yyj3620 + z.DecStructFieldNotFound(-1, yys3769) + } // end switch yys3769 + } // end for yyj3769 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -44989,16 +47129,16 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3629 int - var yyb3629 bool - var yyhl3629 bool = l >= 0 - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + var yyj3778 int + var yyb3778 bool + var yyhl3778 bool = l >= 0 + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45013,13 +47153,13 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.Capabilities.CodecDecodeSelf(d) } - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45032,20 +47172,20 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.Privileged == nil { x.Privileged = new(bool) } - yym3632 := z.DecBinary() - _ = yym3632 + yym3781 := z.DecBinary() + _ = yym3781 if false { } else { *((*bool)(x.Privileged)) = r.DecodeBool() } } - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45060,13 +47200,13 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } x.SELinuxOptions.CodecDecodeSelf(d) } - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45079,20 +47219,20 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.RunAsUser == nil { x.RunAsUser = new(int64) } - yym3635 := z.DecBinary() - _ = yym3635 + yym3784 := z.DecBinary() + _ = yym3784 if false { } else { *((*int64)(x.RunAsUser)) = int64(r.DecodeInt(64)) } } - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45105,25 +47245,25 @@ func (x *SecurityContext) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if x.RunAsNonRoot == nil { x.RunAsNonRoot = new(bool) } - yym3637 := z.DecBinary() - _ = yym3637 + yym3786 := z.DecBinary() + _ = yym3786 if false { } else { *((*bool)(x.RunAsNonRoot)) = r.DecodeBool() } } for { - yyj3629++ - if yyhl3629 { - yyb3629 = yyj3629 > l + yyj3778++ + if yyhl3778 { + yyb3778 = yyj3778 > l } else { - yyb3629 = r.CheckBreak() + yyb3778 = r.CheckBreak() } - if yyb3629 { + if yyb3778 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3629-1, "") + z.DecStructFieldNotFound(yyj3778-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45135,38 +47275,38 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3638 := z.EncBinary() - _ = yym3638 + yym3787 := z.EncBinary() + _ = yym3787 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3639 := !z.EncBinary() - yy2arr3639 := z.EncBasicHandle().StructToArray - var yyq3639 [4]bool - _, _, _ = yysep3639, yyq3639, yy2arr3639 - const yyr3639 bool = false - yyq3639[0] = x.User != "" - yyq3639[1] = x.Role != "" - yyq3639[2] = x.Type != "" - yyq3639[3] = x.Level != "" - var yynn3639 int - if yyr3639 || yy2arr3639 { + yysep3788 := !z.EncBinary() + yy2arr3788 := z.EncBasicHandle().StructToArray + var yyq3788 [4]bool + _, _, _ = yysep3788, yyq3788, yy2arr3788 + const yyr3788 bool = false + yyq3788[0] = x.User != "" + yyq3788[1] = x.Role != "" + yyq3788[2] = x.Type != "" + yyq3788[3] = x.Level != "" + var yynn3788 int + if yyr3788 || yy2arr3788 { r.EncodeArrayStart(4) } else { - yynn3639 = 0 - for _, b := range yyq3639 { + yynn3788 = 0 + for _, b := range yyq3788 { if b { - yynn3639++ + yynn3788++ } } - r.EncodeMapStart(yynn3639) - yynn3639 = 0 + r.EncodeMapStart(yynn3788) + yynn3788 = 0 } - if yyr3639 || yy2arr3639 { + if yyr3788 || yy2arr3788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3639[0] { - yym3641 := z.EncBinary() - _ = yym3641 + if yyq3788[0] { + yym3790 := z.EncBinary() + _ = yym3790 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) @@ -45175,23 +47315,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3639[0] { + if yyq3788[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("user")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3642 := z.EncBinary() - _ = yym3642 + yym3791 := z.EncBinary() + _ = yym3791 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.User)) } } } - if yyr3639 || yy2arr3639 { + if yyr3788 || yy2arr3788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3639[1] { - yym3644 := z.EncBinary() - _ = yym3644 + if yyq3788[1] { + yym3793 := z.EncBinary() + _ = yym3793 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Role)) @@ -45200,23 +47340,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3639[1] { + if yyq3788[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("role")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3645 := z.EncBinary() - _ = yym3645 + yym3794 := z.EncBinary() + _ = yym3794 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Role)) } } } - if yyr3639 || yy2arr3639 { + if yyr3788 || yy2arr3788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3639[2] { - yym3647 := z.EncBinary() - _ = yym3647 + if yyq3788[2] { + yym3796 := z.EncBinary() + _ = yym3796 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) @@ -45225,23 +47365,23 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3639[2] { + if yyq3788[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3648 := z.EncBinary() - _ = yym3648 + yym3797 := z.EncBinary() + _ = yym3797 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Type)) } } } - if yyr3639 || yy2arr3639 { + if yyr3788 || yy2arr3788 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3639[3] { - yym3650 := z.EncBinary() - _ = yym3650 + if yyq3788[3] { + yym3799 := z.EncBinary() + _ = yym3799 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Level)) @@ -45250,19 +47390,19 @@ func (x *SELinuxOptions) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq3639[3] { + if yyq3788[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("level")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3651 := z.EncBinary() - _ = yym3651 + yym3800 := z.EncBinary() + _ = yym3800 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Level)) } } } - if yyr3639 || yy2arr3639 { + if yyr3788 || yy2arr3788 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -45275,25 +47415,25 @@ func (x *SELinuxOptions) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3652 := z.DecBinary() - _ = yym3652 + yym3801 := z.DecBinary() + _ = yym3801 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3653 := r.ContainerType() - if yyct3653 == codecSelferValueTypeMap1234 { - yyl3653 := r.ReadMapStart() - if yyl3653 == 0 { + yyct3802 := r.ContainerType() + if yyct3802 == codecSelferValueTypeMap1234 { + yyl3802 := r.ReadMapStart() + if yyl3802 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3653, d) + x.codecDecodeSelfFromMap(yyl3802, d) } - } else if yyct3653 == codecSelferValueTypeArray1234 { - yyl3653 := r.ReadArrayStart() - if yyl3653 == 0 { + } else if yyct3802 == codecSelferValueTypeArray1234 { + yyl3802 := r.ReadArrayStart() + if yyl3802 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3653, d) + x.codecDecodeSelfFromArray(yyl3802, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -45305,12 +47445,12 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3654Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3654Slc - var yyhl3654 bool = l >= 0 - for yyj3654 := 0; ; yyj3654++ { - if yyhl3654 { - if yyj3654 >= l { + var yys3803Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3803Slc + var yyhl3803 bool = l >= 0 + for yyj3803 := 0; ; yyj3803++ { + if yyhl3803 { + if yyj3803 >= l { break } } else { @@ -45319,10 +47459,10 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3654Slc = r.DecodeBytes(yys3654Slc, true, true) - yys3654 := string(yys3654Slc) + yys3803Slc = r.DecodeBytes(yys3803Slc, true, true) + yys3803 := string(yys3803Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3654 { + switch yys3803 { case "user": if r.TryDecodeAsNil() { x.User = "" @@ -45348,9 +47488,9 @@ func (x *SELinuxOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Level = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys3654) - } // end switch yys3654 - } // end for yyj3654 + z.DecStructFieldNotFound(-1, yys3803) + } // end switch yys3803 + } // end for yyj3803 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -45358,16 +47498,16 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3659 int - var yyb3659 bool - var yyhl3659 bool = l >= 0 - yyj3659++ - if yyhl3659 { - yyb3659 = yyj3659 > l + var yyj3808 int + var yyb3808 bool + var yyhl3808 bool = l >= 0 + yyj3808++ + if yyhl3808 { + yyb3808 = yyj3808 > l } else { - yyb3659 = r.CheckBreak() + yyb3808 = r.CheckBreak() } - if yyb3659 { + if yyb3808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45377,13 +47517,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.User = string(r.DecodeString()) } - yyj3659++ - if yyhl3659 { - yyb3659 = yyj3659 > l + yyj3808++ + if yyhl3808 { + yyb3808 = yyj3808 > l } else { - yyb3659 = r.CheckBreak() + yyb3808 = r.CheckBreak() } - if yyb3659 { + if yyb3808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45393,13 +47533,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Role = string(r.DecodeString()) } - yyj3659++ - if yyhl3659 { - yyb3659 = yyj3659 > l + yyj3808++ + if yyhl3808 { + yyb3808 = yyj3808 > l } else { - yyb3659 = r.CheckBreak() + yyb3808 = r.CheckBreak() } - if yyb3659 { + if yyb3808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45409,13 +47549,13 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = string(r.DecodeString()) } - yyj3659++ - if yyhl3659 { - yyb3659 = yyj3659 > l + yyj3808++ + if yyhl3808 { + yyb3808 = yyj3808 > l } else { - yyb3659 = r.CheckBreak() + yyb3808 = r.CheckBreak() } - if yyb3659 { + if yyb3808 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45426,17 +47566,17 @@ func (x *SELinuxOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Level = string(r.DecodeString()) } for { - yyj3659++ - if yyhl3659 { - yyb3659 = yyj3659 > l + yyj3808++ + if yyhl3808 { + yyb3808 = yyj3808 > l } else { - yyb3659 = r.CheckBreak() + yyb3808 = r.CheckBreak() } - if yyb3659 { + if yyb3808 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3659-1, "") + z.DecStructFieldNotFound(yyj3808-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45448,103 +47588,53 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym3664 := z.EncBinary() - _ = yym3664 + yym3813 := z.EncBinary() + _ = yym3813 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep3665 := !z.EncBinary() - yy2arr3665 := z.EncBasicHandle().StructToArray - var yyq3665 [5]bool - _, _, _ = yysep3665, yyq3665, yy2arr3665 - const yyr3665 bool = false - yyq3665[0] = x.Kind != "" - yyq3665[1] = x.APIVersion != "" - yyq3665[2] = true - var yynn3665 int - if yyr3665 || yy2arr3665 { + yysep3814 := !z.EncBinary() + yy2arr3814 := z.EncBasicHandle().StructToArray + var yyq3814 [5]bool + _, _, _ = yysep3814, yyq3814, yy2arr3814 + const yyr3814 bool = false + yyq3814[0] = true + yyq3814[3] = x.Kind != "" + yyq3814[4] = x.APIVersion != "" + var yynn3814 int + if yyr3814 || yy2arr3814 { r.EncodeArrayStart(5) } else { - yynn3665 = 2 - for _, b := range yyq3665 { + yynn3814 = 2 + for _, b := range yyq3814 { if b { - yynn3665++ + yynn3814++ } } - r.EncodeMapStart(yynn3665) - yynn3665 = 0 + r.EncodeMapStart(yynn3814) + yynn3814 = 0 } - if yyr3665 || yy2arr3665 { + if yyr3814 || yy2arr3814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3665[0] { - yym3667 := z.EncBinary() - _ = yym3667 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3665[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3668 := z.EncBinary() - _ = yym3668 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr3665 || yy2arr3665 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3665[1] { - yym3670 := z.EncBinary() - _ = yym3670 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq3665[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3671 := z.EncBinary() - _ = yym3671 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr3665 || yy2arr3665 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq3665[2] { - yy3673 := &x.ObjectMeta - yy3673.CodecEncodeSelf(e) + if yyq3814[0] { + yy3816 := &x.ObjectMeta + yy3816.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq3665[2] { + if yyq3814[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy3674 := &x.ObjectMeta - yy3674.CodecEncodeSelf(e) + yy3817 := &x.ObjectMeta + yy3817.CodecEncodeSelf(e) } } - if yyr3665 || yy2arr3665 { + if yyr3814 || yy2arr3814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym3676 := z.EncBinary() - _ = yym3676 + yym3819 := z.EncBinary() + _ = yym3819 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Range)) @@ -45553,20 +47643,20 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("range")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym3677 := z.EncBinary() - _ = yym3677 + yym3820 := z.EncBinary() + _ = yym3820 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Range)) } } - if yyr3665 || yy2arr3665 { + if yyr3814 || yy2arr3814 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Data == nil { r.EncodeNil() } else { - yym3679 := z.EncBinary() - _ = yym3679 + yym3822 := z.EncBinary() + _ = yym3822 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -45579,15 +47669,65 @@ func (x *RangeAllocation) CodecEncodeSelf(e *codec1978.Encoder) { if x.Data == nil { r.EncodeNil() } else { - yym3680 := z.EncBinary() - _ = yym3680 + yym3823 := z.EncBinary() + _ = yym3823 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) } } } - if yyr3665 || yy2arr3665 { + if yyr3814 || yy2arr3814 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3814[3] { + yym3825 := z.EncBinary() + _ = yym3825 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3814[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3826 := z.EncBinary() + _ = yym3826 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr3814 || yy2arr3814 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq3814[4] { + yym3828 := z.EncBinary() + _ = yym3828 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq3814[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym3829 := z.EncBinary() + _ = yym3829 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr3814 || yy2arr3814 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -45600,25 +47740,25 @@ func (x *RangeAllocation) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym3681 := z.DecBinary() - _ = yym3681 + yym3830 := z.DecBinary() + _ = yym3830 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct3682 := r.ContainerType() - if yyct3682 == codecSelferValueTypeMap1234 { - yyl3682 := r.ReadMapStart() - if yyl3682 == 0 { + yyct3831 := r.ContainerType() + if yyct3831 == codecSelferValueTypeMap1234 { + yyl3831 := r.ReadMapStart() + if yyl3831 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl3682, d) + x.codecDecodeSelfFromMap(yyl3831, d) } - } else if yyct3682 == codecSelferValueTypeArray1234 { - yyl3682 := r.ReadArrayStart() - if yyl3682 == 0 { + } else if yyct3831 == codecSelferValueTypeArray1234 { + yyl3831 := r.ReadArrayStart() + if yyl3831 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl3682, d) + x.codecDecodeSelfFromArray(yyl3831, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -45630,12 +47770,12 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys3683Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3683Slc - var yyhl3683 bool = l >= 0 - for yyj3683 := 0; ; yyj3683++ { - if yyhl3683 { - if yyj3683 >= l { + var yys3832Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3832Slc + var yyhl3832 bool = l >= 0 + for yyj3832 := 0; ; yyj3832++ { + if yyhl3832 { + if yyj3832 >= l { break } } else { @@ -45644,10 +47784,35 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys3683Slc = r.DecodeBytes(yys3683Slc, true, true) - yys3683 := string(yys3683Slc) + yys3832Slc = r.DecodeBytes(yys3832Slc, true, true) + yys3832 := string(yys3832Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys3683 { + switch yys3832 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = ObjectMeta{} + } else { + yyv3833 := &x.ObjectMeta + yyv3833.CodecDecodeSelf(d) + } + case "range": + if r.TryDecodeAsNil() { + x.Range = "" + } else { + x.Range = string(r.DecodeString()) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv3835 := &x.Data + yym3836 := z.DecBinary() + _ = yym3836 + if false { + } else { + *yyv3835 = r.DecodeBytes(*(*[]byte)(yyv3835), false, false) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -45660,35 +47825,10 @@ func (x *RangeAllocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = ObjectMeta{} - } else { - yyv3686 := &x.ObjectMeta - yyv3686.CodecDecodeSelf(d) - } - case "range": - if r.TryDecodeAsNil() { - x.Range = "" - } else { - x.Range = string(r.DecodeString()) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv3688 := &x.Data - yym3689 := z.DecBinary() - _ = yym3689 - if false { - } else { - *yyv3688 = r.DecodeBytes(*(*[]byte)(yyv3688), false, false) - } - } default: - z.DecStructFieldNotFound(-1, yys3683) - } // end switch yys3683 - } // end for yyj3683 + z.DecStructFieldNotFound(-1, yys3832) + } // end switch yys3832 + } // end for yyj3832 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -45696,48 +47836,16 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj3690 int - var yyb3690 bool - var yyhl3690 bool = l >= 0 - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l + var yyj3839 int + var yyb3839 bool + var yyhl3839 bool = l >= 0 + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l } else { - yyb3690 = r.CheckBreak() + yyb3839 = r.CheckBreak() } - if yyb3690 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l - } else { - yyb3690 = r.CheckBreak() - } - if yyb3690 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l - } else { - yyb3690 = r.CheckBreak() - } - if yyb3690 { + if yyb3839 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45745,16 +47853,16 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.ObjectMeta = ObjectMeta{} } else { - yyv3693 := &x.ObjectMeta - yyv3693.CodecDecodeSelf(d) + yyv3840 := &x.ObjectMeta + yyv3840.CodecDecodeSelf(d) } - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l } else { - yyb3690 = r.CheckBreak() + yyb3839 = r.CheckBreak() } - if yyb3690 { + if yyb3839 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45764,13 +47872,13 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Range = string(r.DecodeString()) } - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l } else { - yyb3690 = r.CheckBreak() + yyb3839 = r.CheckBreak() } - if yyb3690 { + if yyb3839 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -45778,26 +47886,58 @@ func (x *RangeAllocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Data = nil } else { - yyv3695 := &x.Data - yym3696 := z.DecBinary() - _ = yym3696 + yyv3842 := &x.Data + yym3843 := z.DecBinary() + _ = yym3843 if false { } else { - *yyv3695 = r.DecodeBytes(*(*[]byte)(yyv3695), false, false) + *yyv3842 = r.DecodeBytes(*(*[]byte)(yyv3842), false, false) } } + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l + } else { + yyb3839 = r.CheckBreak() + } + if yyb3839 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l + } else { + yyb3839 = r.CheckBreak() + } + if yyb3839 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj3690++ - if yyhl3690 { - yyb3690 = yyj3690 > l + yyj3839++ + if yyhl3839 { + yyb3839 = yyj3839 > l } else { - yyb3690 = r.CheckBreak() + yyb3839 = r.CheckBreak() } - if yyb3690 { + if yyb3839 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj3690-1, "") + z.DecStructFieldNotFound(yyj3839-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45807,9 +47947,9 @@ func (x codecSelfer1234) encSlicePersistentVolumeAccessMode(v []PersistentVolume z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3697 := range v { + for _, yyv3846 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3697.CodecEncodeSelf(e) + yyv3846.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -45819,2895 +47959,12 @@ func (x codecSelfer1234) decSlicePersistentVolumeAccessMode(v *[]PersistentVolum z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3698 := *v - yyh3698, yyl3698 := z.DecSliceHelperStart() - var yyc3698 bool - if yyl3698 == 0 { - if yyv3698 == nil { - yyv3698 = []PersistentVolumeAccessMode{} - yyc3698 = true - } else if len(yyv3698) != 0 { - yyv3698 = yyv3698[:0] - yyc3698 = true - } - } else if yyl3698 > 0 { - var yyrr3698, yyrl3698 int - var yyrt3698 bool - if yyl3698 > cap(yyv3698) { - - yyrl3698, yyrt3698 = z.DecInferLen(yyl3698, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3698 { - if yyrl3698 <= cap(yyv3698) { - yyv3698 = yyv3698[:yyrl3698] - } else { - yyv3698 = make([]PersistentVolumeAccessMode, yyrl3698) - } - } else { - yyv3698 = make([]PersistentVolumeAccessMode, yyrl3698) - } - yyc3698 = true - yyrr3698 = len(yyv3698) - } else if yyl3698 != len(yyv3698) { - yyv3698 = yyv3698[:yyl3698] - yyc3698 = true - } - yyj3698 := 0 - for ; yyj3698 < yyrr3698; yyj3698++ { - yyh3698.ElemContainerState(yyj3698) - if r.TryDecodeAsNil() { - yyv3698[yyj3698] = "" - } else { - yyv3698[yyj3698] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } - if yyrt3698 { - for ; yyj3698 < yyl3698; yyj3698++ { - yyv3698 = append(yyv3698, "") - yyh3698.ElemContainerState(yyj3698) - if r.TryDecodeAsNil() { - yyv3698[yyj3698] = "" - } else { - yyv3698[yyj3698] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } - } - - } else { - yyj3698 := 0 - for ; !r.CheckBreak(); yyj3698++ { - - if yyj3698 >= len(yyv3698) { - yyv3698 = append(yyv3698, "") // var yyz3698 PersistentVolumeAccessMode - yyc3698 = true - } - yyh3698.ElemContainerState(yyj3698) - if yyj3698 < len(yyv3698) { - if r.TryDecodeAsNil() { - yyv3698[yyj3698] = "" - } else { - yyv3698[yyj3698] = PersistentVolumeAccessMode(r.DecodeString()) - } - - } else { - z.DecSwallow() - } - - } - if yyj3698 < len(yyv3698) { - yyv3698 = yyv3698[:yyj3698] - yyc3698 = true - } else if yyj3698 == 0 && yyv3698 == nil { - yyv3698 = []PersistentVolumeAccessMode{} - yyc3698 = true - } - } - yyh3698.End() - if yyc3698 { - *v = yyv3698 - } -} - -func (x codecSelfer1234) encSlicePersistentVolume(v []PersistentVolume, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3702 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3703 := &yyv3702 - yy3703.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePersistentVolume(v *[]PersistentVolume, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3704 := *v - yyh3704, yyl3704 := z.DecSliceHelperStart() - var yyc3704 bool - if yyl3704 == 0 { - if yyv3704 == nil { - yyv3704 = []PersistentVolume{} - yyc3704 = true - } else if len(yyv3704) != 0 { - yyv3704 = yyv3704[:0] - yyc3704 = true - } - } else if yyl3704 > 0 { - var yyrr3704, yyrl3704 int - var yyrt3704 bool - if yyl3704 > cap(yyv3704) { - - yyrg3704 := len(yyv3704) > 0 - yyv23704 := yyv3704 - yyrl3704, yyrt3704 = z.DecInferLen(yyl3704, z.DecBasicHandle().MaxInitLen, 392) - if yyrt3704 { - if yyrl3704 <= cap(yyv3704) { - yyv3704 = yyv3704[:yyrl3704] - } else { - yyv3704 = make([]PersistentVolume, yyrl3704) - } - } else { - yyv3704 = make([]PersistentVolume, yyrl3704) - } - yyc3704 = true - yyrr3704 = len(yyv3704) - if yyrg3704 { - copy(yyv3704, yyv23704) - } - } else if yyl3704 != len(yyv3704) { - yyv3704 = yyv3704[:yyl3704] - yyc3704 = true - } - yyj3704 := 0 - for ; yyj3704 < yyrr3704; yyj3704++ { - yyh3704.ElemContainerState(yyj3704) - if r.TryDecodeAsNil() { - yyv3704[yyj3704] = PersistentVolume{} - } else { - yyv3705 := &yyv3704[yyj3704] - yyv3705.CodecDecodeSelf(d) - } - - } - if yyrt3704 { - for ; yyj3704 < yyl3704; yyj3704++ { - yyv3704 = append(yyv3704, PersistentVolume{}) - yyh3704.ElemContainerState(yyj3704) - if r.TryDecodeAsNil() { - yyv3704[yyj3704] = PersistentVolume{} - } else { - yyv3706 := &yyv3704[yyj3704] - yyv3706.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3704 := 0 - for ; !r.CheckBreak(); yyj3704++ { - - if yyj3704 >= len(yyv3704) { - yyv3704 = append(yyv3704, PersistentVolume{}) // var yyz3704 PersistentVolume - yyc3704 = true - } - yyh3704.ElemContainerState(yyj3704) - if yyj3704 < len(yyv3704) { - if r.TryDecodeAsNil() { - yyv3704[yyj3704] = PersistentVolume{} - } else { - yyv3707 := &yyv3704[yyj3704] - yyv3707.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3704 < len(yyv3704) { - yyv3704 = yyv3704[:yyj3704] - yyc3704 = true - } else if yyj3704 == 0 && yyv3704 == nil { - yyv3704 = []PersistentVolume{} - yyc3704 = true - } - } - yyh3704.End() - if yyc3704 { - *v = yyv3704 - } -} - -func (x codecSelfer1234) encSlicePersistentVolumeClaim(v []PersistentVolumeClaim, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3708 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3709 := &yyv3708 - yy3709.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePersistentVolumeClaim(v *[]PersistentVolumeClaim, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3710 := *v - yyh3710, yyl3710 := z.DecSliceHelperStart() - var yyc3710 bool - if yyl3710 == 0 { - if yyv3710 == nil { - yyv3710 = []PersistentVolumeClaim{} - yyc3710 = true - } else if len(yyv3710) != 0 { - yyv3710 = yyv3710[:0] - yyc3710 = true - } - } else if yyl3710 > 0 { - var yyrr3710, yyrl3710 int - var yyrt3710 bool - if yyl3710 > cap(yyv3710) { - - yyrg3710 := len(yyv3710) > 0 - yyv23710 := yyv3710 - yyrl3710, yyrt3710 = z.DecInferLen(yyl3710, z.DecBasicHandle().MaxInitLen, 296) - if yyrt3710 { - if yyrl3710 <= cap(yyv3710) { - yyv3710 = yyv3710[:yyrl3710] - } else { - yyv3710 = make([]PersistentVolumeClaim, yyrl3710) - } - } else { - yyv3710 = make([]PersistentVolumeClaim, yyrl3710) - } - yyc3710 = true - yyrr3710 = len(yyv3710) - if yyrg3710 { - copy(yyv3710, yyv23710) - } - } else if yyl3710 != len(yyv3710) { - yyv3710 = yyv3710[:yyl3710] - yyc3710 = true - } - yyj3710 := 0 - for ; yyj3710 < yyrr3710; yyj3710++ { - yyh3710.ElemContainerState(yyj3710) - if r.TryDecodeAsNil() { - yyv3710[yyj3710] = PersistentVolumeClaim{} - } else { - yyv3711 := &yyv3710[yyj3710] - yyv3711.CodecDecodeSelf(d) - } - - } - if yyrt3710 { - for ; yyj3710 < yyl3710; yyj3710++ { - yyv3710 = append(yyv3710, PersistentVolumeClaim{}) - yyh3710.ElemContainerState(yyj3710) - if r.TryDecodeAsNil() { - yyv3710[yyj3710] = PersistentVolumeClaim{} - } else { - yyv3712 := &yyv3710[yyj3710] - yyv3712.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3710 := 0 - for ; !r.CheckBreak(); yyj3710++ { - - if yyj3710 >= len(yyv3710) { - yyv3710 = append(yyv3710, PersistentVolumeClaim{}) // var yyz3710 PersistentVolumeClaim - yyc3710 = true - } - yyh3710.ElemContainerState(yyj3710) - if yyj3710 < len(yyv3710) { - if r.TryDecodeAsNil() { - yyv3710[yyj3710] = PersistentVolumeClaim{} - } else { - yyv3713 := &yyv3710[yyj3710] - yyv3713.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3710 < len(yyv3710) { - yyv3710 = yyv3710[:yyj3710] - yyc3710 = true - } else if yyj3710 == 0 && yyv3710 == nil { - yyv3710 = []PersistentVolumeClaim{} - yyc3710 = true - } - } - yyh3710.End() - if yyc3710 { - *v = yyv3710 - } -} - -func (x codecSelfer1234) encSliceCapability(v []Capability, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3714 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3714.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceCapability(v *[]Capability, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3715 := *v - yyh3715, yyl3715 := z.DecSliceHelperStart() - var yyc3715 bool - if yyl3715 == 0 { - if yyv3715 == nil { - yyv3715 = []Capability{} - yyc3715 = true - } else if len(yyv3715) != 0 { - yyv3715 = yyv3715[:0] - yyc3715 = true - } - } else if yyl3715 > 0 { - var yyrr3715, yyrl3715 int - var yyrt3715 bool - if yyl3715 > cap(yyv3715) { - - yyrl3715, yyrt3715 = z.DecInferLen(yyl3715, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3715 { - if yyrl3715 <= cap(yyv3715) { - yyv3715 = yyv3715[:yyrl3715] - } else { - yyv3715 = make([]Capability, yyrl3715) - } - } else { - yyv3715 = make([]Capability, yyrl3715) - } - yyc3715 = true - yyrr3715 = len(yyv3715) - } else if yyl3715 != len(yyv3715) { - yyv3715 = yyv3715[:yyl3715] - yyc3715 = true - } - yyj3715 := 0 - for ; yyj3715 < yyrr3715; yyj3715++ { - yyh3715.ElemContainerState(yyj3715) - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = "" - } else { - yyv3715[yyj3715] = Capability(r.DecodeString()) - } - - } - if yyrt3715 { - for ; yyj3715 < yyl3715; yyj3715++ { - yyv3715 = append(yyv3715, "") - yyh3715.ElemContainerState(yyj3715) - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = "" - } else { - yyv3715[yyj3715] = Capability(r.DecodeString()) - } - - } - } - - } else { - yyj3715 := 0 - for ; !r.CheckBreak(); yyj3715++ { - - if yyj3715 >= len(yyv3715) { - yyv3715 = append(yyv3715, "") // var yyz3715 Capability - yyc3715 = true - } - yyh3715.ElemContainerState(yyj3715) - if yyj3715 < len(yyv3715) { - if r.TryDecodeAsNil() { - yyv3715[yyj3715] = "" - } else { - yyv3715[yyj3715] = Capability(r.DecodeString()) - } - - } else { - z.DecSwallow() - } - - } - if yyj3715 < len(yyv3715) { - yyv3715 = yyv3715[:yyj3715] - yyc3715 = true - } else if yyj3715 == 0 && yyv3715 == nil { - yyv3715 = []Capability{} - yyc3715 = true - } - } - yyh3715.End() - if yyc3715 { - *v = yyv3715 - } -} - -func (x codecSelfer1234) encSliceContainerPort(v []ContainerPort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3719 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3720 := &yyv3719 - yy3720.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainerPort(v *[]ContainerPort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3721 := *v - yyh3721, yyl3721 := z.DecSliceHelperStart() - var yyc3721 bool - if yyl3721 == 0 { - if yyv3721 == nil { - yyv3721 = []ContainerPort{} - yyc3721 = true - } else if len(yyv3721) != 0 { - yyv3721 = yyv3721[:0] - yyc3721 = true - } - } else if yyl3721 > 0 { - var yyrr3721, yyrl3721 int - var yyrt3721 bool - if yyl3721 > cap(yyv3721) { - - yyrg3721 := len(yyv3721) > 0 - yyv23721 := yyv3721 - yyrl3721, yyrt3721 = z.DecInferLen(yyl3721, z.DecBasicHandle().MaxInitLen, 56) - if yyrt3721 { - if yyrl3721 <= cap(yyv3721) { - yyv3721 = yyv3721[:yyrl3721] - } else { - yyv3721 = make([]ContainerPort, yyrl3721) - } - } else { - yyv3721 = make([]ContainerPort, yyrl3721) - } - yyc3721 = true - yyrr3721 = len(yyv3721) - if yyrg3721 { - copy(yyv3721, yyv23721) - } - } else if yyl3721 != len(yyv3721) { - yyv3721 = yyv3721[:yyl3721] - yyc3721 = true - } - yyj3721 := 0 - for ; yyj3721 < yyrr3721; yyj3721++ { - yyh3721.ElemContainerState(yyj3721) - if r.TryDecodeAsNil() { - yyv3721[yyj3721] = ContainerPort{} - } else { - yyv3722 := &yyv3721[yyj3721] - yyv3722.CodecDecodeSelf(d) - } - - } - if yyrt3721 { - for ; yyj3721 < yyl3721; yyj3721++ { - yyv3721 = append(yyv3721, ContainerPort{}) - yyh3721.ElemContainerState(yyj3721) - if r.TryDecodeAsNil() { - yyv3721[yyj3721] = ContainerPort{} - } else { - yyv3723 := &yyv3721[yyj3721] - yyv3723.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3721 := 0 - for ; !r.CheckBreak(); yyj3721++ { - - if yyj3721 >= len(yyv3721) { - yyv3721 = append(yyv3721, ContainerPort{}) // var yyz3721 ContainerPort - yyc3721 = true - } - yyh3721.ElemContainerState(yyj3721) - if yyj3721 < len(yyv3721) { - if r.TryDecodeAsNil() { - yyv3721[yyj3721] = ContainerPort{} - } else { - yyv3724 := &yyv3721[yyj3721] - yyv3724.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3721 < len(yyv3721) { - yyv3721 = yyv3721[:yyj3721] - yyc3721 = true - } else if yyj3721 == 0 && yyv3721 == nil { - yyv3721 = []ContainerPort{} - yyc3721 = true - } - } - yyh3721.End() - if yyc3721 { - *v = yyv3721 - } -} - -func (x codecSelfer1234) encSliceEnvVar(v []EnvVar, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3725 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3726 := &yyv3725 - yy3726.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEnvVar(v *[]EnvVar, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3727 := *v - yyh3727, yyl3727 := z.DecSliceHelperStart() - var yyc3727 bool - if yyl3727 == 0 { - if yyv3727 == nil { - yyv3727 = []EnvVar{} - yyc3727 = true - } else if len(yyv3727) != 0 { - yyv3727 = yyv3727[:0] - yyc3727 = true - } - } else if yyl3727 > 0 { - var yyrr3727, yyrl3727 int - var yyrt3727 bool - if yyl3727 > cap(yyv3727) { - - yyrg3727 := len(yyv3727) > 0 - yyv23727 := yyv3727 - yyrl3727, yyrt3727 = z.DecInferLen(yyl3727, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3727 { - if yyrl3727 <= cap(yyv3727) { - yyv3727 = yyv3727[:yyrl3727] - } else { - yyv3727 = make([]EnvVar, yyrl3727) - } - } else { - yyv3727 = make([]EnvVar, yyrl3727) - } - yyc3727 = true - yyrr3727 = len(yyv3727) - if yyrg3727 { - copy(yyv3727, yyv23727) - } - } else if yyl3727 != len(yyv3727) { - yyv3727 = yyv3727[:yyl3727] - yyc3727 = true - } - yyj3727 := 0 - for ; yyj3727 < yyrr3727; yyj3727++ { - yyh3727.ElemContainerState(yyj3727) - if r.TryDecodeAsNil() { - yyv3727[yyj3727] = EnvVar{} - } else { - yyv3728 := &yyv3727[yyj3727] - yyv3728.CodecDecodeSelf(d) - } - - } - if yyrt3727 { - for ; yyj3727 < yyl3727; yyj3727++ { - yyv3727 = append(yyv3727, EnvVar{}) - yyh3727.ElemContainerState(yyj3727) - if r.TryDecodeAsNil() { - yyv3727[yyj3727] = EnvVar{} - } else { - yyv3729 := &yyv3727[yyj3727] - yyv3729.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3727 := 0 - for ; !r.CheckBreak(); yyj3727++ { - - if yyj3727 >= len(yyv3727) { - yyv3727 = append(yyv3727, EnvVar{}) // var yyz3727 EnvVar - yyc3727 = true - } - yyh3727.ElemContainerState(yyj3727) - if yyj3727 < len(yyv3727) { - if r.TryDecodeAsNil() { - yyv3727[yyj3727] = EnvVar{} - } else { - yyv3730 := &yyv3727[yyj3727] - yyv3730.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3727 < len(yyv3727) { - yyv3727 = yyv3727[:yyj3727] - yyc3727 = true - } else if yyj3727 == 0 && yyv3727 == nil { - yyv3727 = []EnvVar{} - yyc3727 = true - } - } - yyh3727.End() - if yyc3727 { - *v = yyv3727 - } -} - -func (x codecSelfer1234) encSliceVolumeMount(v []VolumeMount, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3731 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3732 := &yyv3731 - yy3732.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceVolumeMount(v *[]VolumeMount, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3733 := *v - yyh3733, yyl3733 := z.DecSliceHelperStart() - var yyc3733 bool - if yyl3733 == 0 { - if yyv3733 == nil { - yyv3733 = []VolumeMount{} - yyc3733 = true - } else if len(yyv3733) != 0 { - yyv3733 = yyv3733[:0] - yyc3733 = true - } - } else if yyl3733 > 0 { - var yyrr3733, yyrl3733 int - var yyrt3733 bool - if yyl3733 > cap(yyv3733) { - - yyrg3733 := len(yyv3733) > 0 - yyv23733 := yyv3733 - yyrl3733, yyrt3733 = z.DecInferLen(yyl3733, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3733 { - if yyrl3733 <= cap(yyv3733) { - yyv3733 = yyv3733[:yyrl3733] - } else { - yyv3733 = make([]VolumeMount, yyrl3733) - } - } else { - yyv3733 = make([]VolumeMount, yyrl3733) - } - yyc3733 = true - yyrr3733 = len(yyv3733) - if yyrg3733 { - copy(yyv3733, yyv23733) - } - } else if yyl3733 != len(yyv3733) { - yyv3733 = yyv3733[:yyl3733] - yyc3733 = true - } - yyj3733 := 0 - for ; yyj3733 < yyrr3733; yyj3733++ { - yyh3733.ElemContainerState(yyj3733) - if r.TryDecodeAsNil() { - yyv3733[yyj3733] = VolumeMount{} - } else { - yyv3734 := &yyv3733[yyj3733] - yyv3734.CodecDecodeSelf(d) - } - - } - if yyrt3733 { - for ; yyj3733 < yyl3733; yyj3733++ { - yyv3733 = append(yyv3733, VolumeMount{}) - yyh3733.ElemContainerState(yyj3733) - if r.TryDecodeAsNil() { - yyv3733[yyj3733] = VolumeMount{} - } else { - yyv3735 := &yyv3733[yyj3733] - yyv3735.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3733 := 0 - for ; !r.CheckBreak(); yyj3733++ { - - if yyj3733 >= len(yyv3733) { - yyv3733 = append(yyv3733, VolumeMount{}) // var yyz3733 VolumeMount - yyc3733 = true - } - yyh3733.ElemContainerState(yyj3733) - if yyj3733 < len(yyv3733) { - if r.TryDecodeAsNil() { - yyv3733[yyj3733] = VolumeMount{} - } else { - yyv3736 := &yyv3733[yyj3733] - yyv3736.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3733 < len(yyv3733) { - yyv3733 = yyv3733[:yyj3733] - yyc3733 = true - } else if yyj3733 == 0 && yyv3733 == nil { - yyv3733 = []VolumeMount{} - yyc3733 = true - } - } - yyh3733.End() - if yyc3733 { - *v = yyv3733 - } -} - -func (x codecSelfer1234) encSliceVolume(v []Volume, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3737 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3738 := &yyv3737 - yy3738.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceVolume(v *[]Volume, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3739 := *v - yyh3739, yyl3739 := z.DecSliceHelperStart() - var yyc3739 bool - if yyl3739 == 0 { - if yyv3739 == nil { - yyv3739 = []Volume{} - yyc3739 = true - } else if len(yyv3739) != 0 { - yyv3739 = yyv3739[:0] - yyc3739 = true - } - } else if yyl3739 > 0 { - var yyrr3739, yyrl3739 int - var yyrt3739 bool - if yyl3739 > cap(yyv3739) { - - yyrg3739 := len(yyv3739) > 0 - yyv23739 := yyv3739 - yyrl3739, yyrt3739 = z.DecInferLen(yyl3739, z.DecBasicHandle().MaxInitLen, 152) - if yyrt3739 { - if yyrl3739 <= cap(yyv3739) { - yyv3739 = yyv3739[:yyrl3739] - } else { - yyv3739 = make([]Volume, yyrl3739) - } - } else { - yyv3739 = make([]Volume, yyrl3739) - } - yyc3739 = true - yyrr3739 = len(yyv3739) - if yyrg3739 { - copy(yyv3739, yyv23739) - } - } else if yyl3739 != len(yyv3739) { - yyv3739 = yyv3739[:yyl3739] - yyc3739 = true - } - yyj3739 := 0 - for ; yyj3739 < yyrr3739; yyj3739++ { - yyh3739.ElemContainerState(yyj3739) - if r.TryDecodeAsNil() { - yyv3739[yyj3739] = Volume{} - } else { - yyv3740 := &yyv3739[yyj3739] - yyv3740.CodecDecodeSelf(d) - } - - } - if yyrt3739 { - for ; yyj3739 < yyl3739; yyj3739++ { - yyv3739 = append(yyv3739, Volume{}) - yyh3739.ElemContainerState(yyj3739) - if r.TryDecodeAsNil() { - yyv3739[yyj3739] = Volume{} - } else { - yyv3741 := &yyv3739[yyj3739] - yyv3741.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3739 := 0 - for ; !r.CheckBreak(); yyj3739++ { - - if yyj3739 >= len(yyv3739) { - yyv3739 = append(yyv3739, Volume{}) // var yyz3739 Volume - yyc3739 = true - } - yyh3739.ElemContainerState(yyj3739) - if yyj3739 < len(yyv3739) { - if r.TryDecodeAsNil() { - yyv3739[yyj3739] = Volume{} - } else { - yyv3742 := &yyv3739[yyj3739] - yyv3742.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3739 < len(yyv3739) { - yyv3739 = yyv3739[:yyj3739] - yyc3739 = true - } else if yyj3739 == 0 && yyv3739 == nil { - yyv3739 = []Volume{} - yyc3739 = true - } - } - yyh3739.End() - if yyc3739 { - *v = yyv3739 - } -} - -func (x codecSelfer1234) encSliceContainer(v []Container, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3743 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3744 := &yyv3743 - yy3744.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainer(v *[]Container, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3745 := *v - yyh3745, yyl3745 := z.DecSliceHelperStart() - var yyc3745 bool - if yyl3745 == 0 { - if yyv3745 == nil { - yyv3745 = []Container{} - yyc3745 = true - } else if len(yyv3745) != 0 { - yyv3745 = yyv3745[:0] - yyc3745 = true - } - } else if yyl3745 > 0 { - var yyrr3745, yyrl3745 int - var yyrt3745 bool - if yyl3745 > cap(yyv3745) { - - yyrg3745 := len(yyv3745) > 0 - yyv23745 := yyv3745 - yyrl3745, yyrt3745 = z.DecInferLen(yyl3745, z.DecBasicHandle().MaxInitLen, 256) - if yyrt3745 { - if yyrl3745 <= cap(yyv3745) { - yyv3745 = yyv3745[:yyrl3745] - } else { - yyv3745 = make([]Container, yyrl3745) - } - } else { - yyv3745 = make([]Container, yyrl3745) - } - yyc3745 = true - yyrr3745 = len(yyv3745) - if yyrg3745 { - copy(yyv3745, yyv23745) - } - } else if yyl3745 != len(yyv3745) { - yyv3745 = yyv3745[:yyl3745] - yyc3745 = true - } - yyj3745 := 0 - for ; yyj3745 < yyrr3745; yyj3745++ { - yyh3745.ElemContainerState(yyj3745) - if r.TryDecodeAsNil() { - yyv3745[yyj3745] = Container{} - } else { - yyv3746 := &yyv3745[yyj3745] - yyv3746.CodecDecodeSelf(d) - } - - } - if yyrt3745 { - for ; yyj3745 < yyl3745; yyj3745++ { - yyv3745 = append(yyv3745, Container{}) - yyh3745.ElemContainerState(yyj3745) - if r.TryDecodeAsNil() { - yyv3745[yyj3745] = Container{} - } else { - yyv3747 := &yyv3745[yyj3745] - yyv3747.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3745 := 0 - for ; !r.CheckBreak(); yyj3745++ { - - if yyj3745 >= len(yyv3745) { - yyv3745 = append(yyv3745, Container{}) // var yyz3745 Container - yyc3745 = true - } - yyh3745.ElemContainerState(yyj3745) - if yyj3745 < len(yyv3745) { - if r.TryDecodeAsNil() { - yyv3745[yyj3745] = Container{} - } else { - yyv3748 := &yyv3745[yyj3745] - yyv3748.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3745 < len(yyv3745) { - yyv3745 = yyv3745[:yyj3745] - yyc3745 = true - } else if yyj3745 == 0 && yyv3745 == nil { - yyv3745 = []Container{} - yyc3745 = true - } - } - yyh3745.End() - if yyc3745 { - *v = yyv3745 - } -} - -func (x codecSelfer1234) encSliceLocalObjectReference(v []LocalObjectReference, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3749 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3750 := &yyv3749 - yy3750.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceLocalObjectReference(v *[]LocalObjectReference, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3751 := *v - yyh3751, yyl3751 := z.DecSliceHelperStart() - var yyc3751 bool - if yyl3751 == 0 { - if yyv3751 == nil { - yyv3751 = []LocalObjectReference{} - yyc3751 = true - } else if len(yyv3751) != 0 { - yyv3751 = yyv3751[:0] - yyc3751 = true - } - } else if yyl3751 > 0 { - var yyrr3751, yyrl3751 int - var yyrt3751 bool - if yyl3751 > cap(yyv3751) { - - yyrg3751 := len(yyv3751) > 0 - yyv23751 := yyv3751 - yyrl3751, yyrt3751 = z.DecInferLen(yyl3751, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3751 { - if yyrl3751 <= cap(yyv3751) { - yyv3751 = yyv3751[:yyrl3751] - } else { - yyv3751 = make([]LocalObjectReference, yyrl3751) - } - } else { - yyv3751 = make([]LocalObjectReference, yyrl3751) - } - yyc3751 = true - yyrr3751 = len(yyv3751) - if yyrg3751 { - copy(yyv3751, yyv23751) - } - } else if yyl3751 != len(yyv3751) { - yyv3751 = yyv3751[:yyl3751] - yyc3751 = true - } - yyj3751 := 0 - for ; yyj3751 < yyrr3751; yyj3751++ { - yyh3751.ElemContainerState(yyj3751) - if r.TryDecodeAsNil() { - yyv3751[yyj3751] = LocalObjectReference{} - } else { - yyv3752 := &yyv3751[yyj3751] - yyv3752.CodecDecodeSelf(d) - } - - } - if yyrt3751 { - for ; yyj3751 < yyl3751; yyj3751++ { - yyv3751 = append(yyv3751, LocalObjectReference{}) - yyh3751.ElemContainerState(yyj3751) - if r.TryDecodeAsNil() { - yyv3751[yyj3751] = LocalObjectReference{} - } else { - yyv3753 := &yyv3751[yyj3751] - yyv3753.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3751 := 0 - for ; !r.CheckBreak(); yyj3751++ { - - if yyj3751 >= len(yyv3751) { - yyv3751 = append(yyv3751, LocalObjectReference{}) // var yyz3751 LocalObjectReference - yyc3751 = true - } - yyh3751.ElemContainerState(yyj3751) - if yyj3751 < len(yyv3751) { - if r.TryDecodeAsNil() { - yyv3751[yyj3751] = LocalObjectReference{} - } else { - yyv3754 := &yyv3751[yyj3751] - yyv3754.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3751 < len(yyv3751) { - yyv3751 = yyv3751[:yyj3751] - yyc3751 = true - } else if yyj3751 == 0 && yyv3751 == nil { - yyv3751 = []LocalObjectReference{} - yyc3751 = true - } - } - yyh3751.End() - if yyc3751 { - *v = yyv3751 - } -} - -func (x codecSelfer1234) encSlicePodCondition(v []PodCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3755 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3756 := &yyv3755 - yy3756.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePodCondition(v *[]PodCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3757 := *v - yyh3757, yyl3757 := z.DecSliceHelperStart() - var yyc3757 bool - if yyl3757 == 0 { - if yyv3757 == nil { - yyv3757 = []PodCondition{} - yyc3757 = true - } else if len(yyv3757) != 0 { - yyv3757 = yyv3757[:0] - yyc3757 = true - } - } else if yyl3757 > 0 { - var yyrr3757, yyrl3757 int - var yyrt3757 bool - if yyl3757 > cap(yyv3757) { - - yyrg3757 := len(yyv3757) > 0 - yyv23757 := yyv3757 - yyrl3757, yyrt3757 = z.DecInferLen(yyl3757, z.DecBasicHandle().MaxInitLen, 112) - if yyrt3757 { - if yyrl3757 <= cap(yyv3757) { - yyv3757 = yyv3757[:yyrl3757] - } else { - yyv3757 = make([]PodCondition, yyrl3757) - } - } else { - yyv3757 = make([]PodCondition, yyrl3757) - } - yyc3757 = true - yyrr3757 = len(yyv3757) - if yyrg3757 { - copy(yyv3757, yyv23757) - } - } else if yyl3757 != len(yyv3757) { - yyv3757 = yyv3757[:yyl3757] - yyc3757 = true - } - yyj3757 := 0 - for ; yyj3757 < yyrr3757; yyj3757++ { - yyh3757.ElemContainerState(yyj3757) - if r.TryDecodeAsNil() { - yyv3757[yyj3757] = PodCondition{} - } else { - yyv3758 := &yyv3757[yyj3757] - yyv3758.CodecDecodeSelf(d) - } - - } - if yyrt3757 { - for ; yyj3757 < yyl3757; yyj3757++ { - yyv3757 = append(yyv3757, PodCondition{}) - yyh3757.ElemContainerState(yyj3757) - if r.TryDecodeAsNil() { - yyv3757[yyj3757] = PodCondition{} - } else { - yyv3759 := &yyv3757[yyj3757] - yyv3759.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3757 := 0 - for ; !r.CheckBreak(); yyj3757++ { - - if yyj3757 >= len(yyv3757) { - yyv3757 = append(yyv3757, PodCondition{}) // var yyz3757 PodCondition - yyc3757 = true - } - yyh3757.ElemContainerState(yyj3757) - if yyj3757 < len(yyv3757) { - if r.TryDecodeAsNil() { - yyv3757[yyj3757] = PodCondition{} - } else { - yyv3760 := &yyv3757[yyj3757] - yyv3760.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3757 < len(yyv3757) { - yyv3757 = yyv3757[:yyj3757] - yyc3757 = true - } else if yyj3757 == 0 && yyv3757 == nil { - yyv3757 = []PodCondition{} - yyc3757 = true - } - } - yyh3757.End() - if yyc3757 { - *v = yyv3757 - } -} - -func (x codecSelfer1234) encSliceContainerStatus(v []ContainerStatus, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3761 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3762 := &yyv3761 - yy3762.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceContainerStatus(v *[]ContainerStatus, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3763 := *v - yyh3763, yyl3763 := z.DecSliceHelperStart() - var yyc3763 bool - if yyl3763 == 0 { - if yyv3763 == nil { - yyv3763 = []ContainerStatus{} - yyc3763 = true - } else if len(yyv3763) != 0 { - yyv3763 = yyv3763[:0] - yyc3763 = true - } - } else if yyl3763 > 0 { - var yyrr3763, yyrl3763 int - var yyrt3763 bool - if yyl3763 > cap(yyv3763) { - - yyrg3763 := len(yyv3763) > 0 - yyv23763 := yyv3763 - yyrl3763, yyrt3763 = z.DecInferLen(yyl3763, z.DecBasicHandle().MaxInitLen, 120) - if yyrt3763 { - if yyrl3763 <= cap(yyv3763) { - yyv3763 = yyv3763[:yyrl3763] - } else { - yyv3763 = make([]ContainerStatus, yyrl3763) - } - } else { - yyv3763 = make([]ContainerStatus, yyrl3763) - } - yyc3763 = true - yyrr3763 = len(yyv3763) - if yyrg3763 { - copy(yyv3763, yyv23763) - } - } else if yyl3763 != len(yyv3763) { - yyv3763 = yyv3763[:yyl3763] - yyc3763 = true - } - yyj3763 := 0 - for ; yyj3763 < yyrr3763; yyj3763++ { - yyh3763.ElemContainerState(yyj3763) - if r.TryDecodeAsNil() { - yyv3763[yyj3763] = ContainerStatus{} - } else { - yyv3764 := &yyv3763[yyj3763] - yyv3764.CodecDecodeSelf(d) - } - - } - if yyrt3763 { - for ; yyj3763 < yyl3763; yyj3763++ { - yyv3763 = append(yyv3763, ContainerStatus{}) - yyh3763.ElemContainerState(yyj3763) - if r.TryDecodeAsNil() { - yyv3763[yyj3763] = ContainerStatus{} - } else { - yyv3765 := &yyv3763[yyj3763] - yyv3765.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3763 := 0 - for ; !r.CheckBreak(); yyj3763++ { - - if yyj3763 >= len(yyv3763) { - yyv3763 = append(yyv3763, ContainerStatus{}) // var yyz3763 ContainerStatus - yyc3763 = true - } - yyh3763.ElemContainerState(yyj3763) - if yyj3763 < len(yyv3763) { - if r.TryDecodeAsNil() { - yyv3763[yyj3763] = ContainerStatus{} - } else { - yyv3766 := &yyv3763[yyj3763] - yyv3766.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3763 < len(yyv3763) { - yyv3763 = yyv3763[:yyj3763] - yyc3763 = true - } else if yyj3763 == 0 && yyv3763 == nil { - yyv3763 = []ContainerStatus{} - yyc3763 = true - } - } - yyh3763.End() - if yyc3763 { - *v = yyv3763 - } -} - -func (x codecSelfer1234) encSlicePod(v []Pod, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3767 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3768 := &yyv3767 - yy3768.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePod(v *[]Pod, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3769 := *v - yyh3769, yyl3769 := z.DecSliceHelperStart() - var yyc3769 bool - if yyl3769 == 0 { - if yyv3769 == nil { - yyv3769 = []Pod{} - yyc3769 = true - } else if len(yyv3769) != 0 { - yyv3769 = yyv3769[:0] - yyc3769 = true - } - } else if yyl3769 > 0 { - var yyrr3769, yyrl3769 int - var yyrt3769 bool - if yyl3769 > cap(yyv3769) { - - yyrg3769 := len(yyv3769) > 0 - yyv23769 := yyv3769 - yyrl3769, yyrt3769 = z.DecInferLen(yyl3769, z.DecBasicHandle().MaxInitLen, 520) - if yyrt3769 { - if yyrl3769 <= cap(yyv3769) { - yyv3769 = yyv3769[:yyrl3769] - } else { - yyv3769 = make([]Pod, yyrl3769) - } - } else { - yyv3769 = make([]Pod, yyrl3769) - } - yyc3769 = true - yyrr3769 = len(yyv3769) - if yyrg3769 { - copy(yyv3769, yyv23769) - } - } else if yyl3769 != len(yyv3769) { - yyv3769 = yyv3769[:yyl3769] - yyc3769 = true - } - yyj3769 := 0 - for ; yyj3769 < yyrr3769; yyj3769++ { - yyh3769.ElemContainerState(yyj3769) - if r.TryDecodeAsNil() { - yyv3769[yyj3769] = Pod{} - } else { - yyv3770 := &yyv3769[yyj3769] - yyv3770.CodecDecodeSelf(d) - } - - } - if yyrt3769 { - for ; yyj3769 < yyl3769; yyj3769++ { - yyv3769 = append(yyv3769, Pod{}) - yyh3769.ElemContainerState(yyj3769) - if r.TryDecodeAsNil() { - yyv3769[yyj3769] = Pod{} - } else { - yyv3771 := &yyv3769[yyj3769] - yyv3771.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3769 := 0 - for ; !r.CheckBreak(); yyj3769++ { - - if yyj3769 >= len(yyv3769) { - yyv3769 = append(yyv3769, Pod{}) // var yyz3769 Pod - yyc3769 = true - } - yyh3769.ElemContainerState(yyj3769) - if yyj3769 < len(yyv3769) { - if r.TryDecodeAsNil() { - yyv3769[yyj3769] = Pod{} - } else { - yyv3772 := &yyv3769[yyj3769] - yyv3772.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3769 < len(yyv3769) { - yyv3769 = yyv3769[:yyj3769] - yyc3769 = true - } else if yyj3769 == 0 && yyv3769 == nil { - yyv3769 = []Pod{} - yyc3769 = true - } - } - yyh3769.End() - if yyc3769 { - *v = yyv3769 - } -} - -func (x codecSelfer1234) encSlicePodTemplate(v []PodTemplate, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3773 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3774 := &yyv3773 - yy3774.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSlicePodTemplate(v *[]PodTemplate, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3775 := *v - yyh3775, yyl3775 := z.DecSliceHelperStart() - var yyc3775 bool - if yyl3775 == 0 { - if yyv3775 == nil { - yyv3775 = []PodTemplate{} - yyc3775 = true - } else if len(yyv3775) != 0 { - yyv3775 = yyv3775[:0] - yyc3775 = true - } - } else if yyl3775 > 0 { - var yyrr3775, yyrl3775 int - var yyrt3775 bool - if yyl3775 > cap(yyv3775) { - - yyrg3775 := len(yyv3775) > 0 - yyv23775 := yyv3775 - yyrl3775, yyrt3775 = z.DecInferLen(yyl3775, z.DecBasicHandle().MaxInitLen, 544) - if yyrt3775 { - if yyrl3775 <= cap(yyv3775) { - yyv3775 = yyv3775[:yyrl3775] - } else { - yyv3775 = make([]PodTemplate, yyrl3775) - } - } else { - yyv3775 = make([]PodTemplate, yyrl3775) - } - yyc3775 = true - yyrr3775 = len(yyv3775) - if yyrg3775 { - copy(yyv3775, yyv23775) - } - } else if yyl3775 != len(yyv3775) { - yyv3775 = yyv3775[:yyl3775] - yyc3775 = true - } - yyj3775 := 0 - for ; yyj3775 < yyrr3775; yyj3775++ { - yyh3775.ElemContainerState(yyj3775) - if r.TryDecodeAsNil() { - yyv3775[yyj3775] = PodTemplate{} - } else { - yyv3776 := &yyv3775[yyj3775] - yyv3776.CodecDecodeSelf(d) - } - - } - if yyrt3775 { - for ; yyj3775 < yyl3775; yyj3775++ { - yyv3775 = append(yyv3775, PodTemplate{}) - yyh3775.ElemContainerState(yyj3775) - if r.TryDecodeAsNil() { - yyv3775[yyj3775] = PodTemplate{} - } else { - yyv3777 := &yyv3775[yyj3775] - yyv3777.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3775 := 0 - for ; !r.CheckBreak(); yyj3775++ { - - if yyj3775 >= len(yyv3775) { - yyv3775 = append(yyv3775, PodTemplate{}) // var yyz3775 PodTemplate - yyc3775 = true - } - yyh3775.ElemContainerState(yyj3775) - if yyj3775 < len(yyv3775) { - if r.TryDecodeAsNil() { - yyv3775[yyj3775] = PodTemplate{} - } else { - yyv3778 := &yyv3775[yyj3775] - yyv3778.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3775 < len(yyv3775) { - yyv3775 = yyv3775[:yyj3775] - yyc3775 = true - } else if yyj3775 == 0 && yyv3775 == nil { - yyv3775 = []PodTemplate{} - yyc3775 = true - } - } - yyh3775.End() - if yyc3775 { - *v = yyv3775 - } -} - -func (x codecSelfer1234) encSliceReplicationController(v []ReplicationController, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3779 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3780 := &yyv3779 - yy3780.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceReplicationController(v *[]ReplicationController, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3781 := *v - yyh3781, yyl3781 := z.DecSliceHelperStart() - var yyc3781 bool - if yyl3781 == 0 { - if yyv3781 == nil { - yyv3781 = []ReplicationController{} - yyc3781 = true - } else if len(yyv3781) != 0 { - yyv3781 = yyv3781[:0] - yyc3781 = true - } - } else if yyl3781 > 0 { - var yyrr3781, yyrl3781 int - var yyrt3781 bool - if yyl3781 > cap(yyv3781) { - - yyrg3781 := len(yyv3781) > 0 - yyv23781 := yyv3781 - yyrl3781, yyrt3781 = z.DecInferLen(yyl3781, z.DecBasicHandle().MaxInitLen, 232) - if yyrt3781 { - if yyrl3781 <= cap(yyv3781) { - yyv3781 = yyv3781[:yyrl3781] - } else { - yyv3781 = make([]ReplicationController, yyrl3781) - } - } else { - yyv3781 = make([]ReplicationController, yyrl3781) - } - yyc3781 = true - yyrr3781 = len(yyv3781) - if yyrg3781 { - copy(yyv3781, yyv23781) - } - } else if yyl3781 != len(yyv3781) { - yyv3781 = yyv3781[:yyl3781] - yyc3781 = true - } - yyj3781 := 0 - for ; yyj3781 < yyrr3781; yyj3781++ { - yyh3781.ElemContainerState(yyj3781) - if r.TryDecodeAsNil() { - yyv3781[yyj3781] = ReplicationController{} - } else { - yyv3782 := &yyv3781[yyj3781] - yyv3782.CodecDecodeSelf(d) - } - - } - if yyrt3781 { - for ; yyj3781 < yyl3781; yyj3781++ { - yyv3781 = append(yyv3781, ReplicationController{}) - yyh3781.ElemContainerState(yyj3781) - if r.TryDecodeAsNil() { - yyv3781[yyj3781] = ReplicationController{} - } else { - yyv3783 := &yyv3781[yyj3781] - yyv3783.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3781 := 0 - for ; !r.CheckBreak(); yyj3781++ { - - if yyj3781 >= len(yyv3781) { - yyv3781 = append(yyv3781, ReplicationController{}) // var yyz3781 ReplicationController - yyc3781 = true - } - yyh3781.ElemContainerState(yyj3781) - if yyj3781 < len(yyv3781) { - if r.TryDecodeAsNil() { - yyv3781[yyj3781] = ReplicationController{} - } else { - yyv3784 := &yyv3781[yyj3781] - yyv3784.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3781 < len(yyv3781) { - yyv3781 = yyv3781[:yyj3781] - yyc3781 = true - } else if yyj3781 == 0 && yyv3781 == nil { - yyv3781 = []ReplicationController{} - yyc3781 = true - } - } - yyh3781.End() - if yyc3781 { - *v = yyv3781 - } -} - -func (x codecSelfer1234) encSliceLoadBalancerIngress(v []LoadBalancerIngress, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3785 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3786 := &yyv3785 - yy3786.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceLoadBalancerIngress(v *[]LoadBalancerIngress, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3787 := *v - yyh3787, yyl3787 := z.DecSliceHelperStart() - var yyc3787 bool - if yyl3787 == 0 { - if yyv3787 == nil { - yyv3787 = []LoadBalancerIngress{} - yyc3787 = true - } else if len(yyv3787) != 0 { - yyv3787 = yyv3787[:0] - yyc3787 = true - } - } else if yyl3787 > 0 { - var yyrr3787, yyrl3787 int - var yyrt3787 bool - if yyl3787 > cap(yyv3787) { - - yyrg3787 := len(yyv3787) > 0 - yyv23787 := yyv3787 - yyrl3787, yyrt3787 = z.DecInferLen(yyl3787, z.DecBasicHandle().MaxInitLen, 32) - if yyrt3787 { - if yyrl3787 <= cap(yyv3787) { - yyv3787 = yyv3787[:yyrl3787] - } else { - yyv3787 = make([]LoadBalancerIngress, yyrl3787) - } - } else { - yyv3787 = make([]LoadBalancerIngress, yyrl3787) - } - yyc3787 = true - yyrr3787 = len(yyv3787) - if yyrg3787 { - copy(yyv3787, yyv23787) - } - } else if yyl3787 != len(yyv3787) { - yyv3787 = yyv3787[:yyl3787] - yyc3787 = true - } - yyj3787 := 0 - for ; yyj3787 < yyrr3787; yyj3787++ { - yyh3787.ElemContainerState(yyj3787) - if r.TryDecodeAsNil() { - yyv3787[yyj3787] = LoadBalancerIngress{} - } else { - yyv3788 := &yyv3787[yyj3787] - yyv3788.CodecDecodeSelf(d) - } - - } - if yyrt3787 { - for ; yyj3787 < yyl3787; yyj3787++ { - yyv3787 = append(yyv3787, LoadBalancerIngress{}) - yyh3787.ElemContainerState(yyj3787) - if r.TryDecodeAsNil() { - yyv3787[yyj3787] = LoadBalancerIngress{} - } else { - yyv3789 := &yyv3787[yyj3787] - yyv3789.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3787 := 0 - for ; !r.CheckBreak(); yyj3787++ { - - if yyj3787 >= len(yyv3787) { - yyv3787 = append(yyv3787, LoadBalancerIngress{}) // var yyz3787 LoadBalancerIngress - yyc3787 = true - } - yyh3787.ElemContainerState(yyj3787) - if yyj3787 < len(yyv3787) { - if r.TryDecodeAsNil() { - yyv3787[yyj3787] = LoadBalancerIngress{} - } else { - yyv3790 := &yyv3787[yyj3787] - yyv3790.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3787 < len(yyv3787) { - yyv3787 = yyv3787[:yyj3787] - yyc3787 = true - } else if yyj3787 == 0 && yyv3787 == nil { - yyv3787 = []LoadBalancerIngress{} - yyc3787 = true - } - } - yyh3787.End() - if yyc3787 { - *v = yyv3787 - } -} - -func (x codecSelfer1234) encSliceServicePort(v []ServicePort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3791 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3792 := &yyv3791 - yy3792.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServicePort(v *[]ServicePort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3793 := *v - yyh3793, yyl3793 := z.DecSliceHelperStart() - var yyc3793 bool - if yyl3793 == 0 { - if yyv3793 == nil { - yyv3793 = []ServicePort{} - yyc3793 = true - } else if len(yyv3793) != 0 { - yyv3793 = yyv3793[:0] - yyc3793 = true - } - } else if yyl3793 > 0 { - var yyrr3793, yyrl3793 int - var yyrt3793 bool - if yyl3793 > cap(yyv3793) { - - yyrg3793 := len(yyv3793) > 0 - yyv23793 := yyv3793 - yyrl3793, yyrt3793 = z.DecInferLen(yyl3793, z.DecBasicHandle().MaxInitLen, 80) - if yyrt3793 { - if yyrl3793 <= cap(yyv3793) { - yyv3793 = yyv3793[:yyrl3793] - } else { - yyv3793 = make([]ServicePort, yyrl3793) - } - } else { - yyv3793 = make([]ServicePort, yyrl3793) - } - yyc3793 = true - yyrr3793 = len(yyv3793) - if yyrg3793 { - copy(yyv3793, yyv23793) - } - } else if yyl3793 != len(yyv3793) { - yyv3793 = yyv3793[:yyl3793] - yyc3793 = true - } - yyj3793 := 0 - for ; yyj3793 < yyrr3793; yyj3793++ { - yyh3793.ElemContainerState(yyj3793) - if r.TryDecodeAsNil() { - yyv3793[yyj3793] = ServicePort{} - } else { - yyv3794 := &yyv3793[yyj3793] - yyv3794.CodecDecodeSelf(d) - } - - } - if yyrt3793 { - for ; yyj3793 < yyl3793; yyj3793++ { - yyv3793 = append(yyv3793, ServicePort{}) - yyh3793.ElemContainerState(yyj3793) - if r.TryDecodeAsNil() { - yyv3793[yyj3793] = ServicePort{} - } else { - yyv3795 := &yyv3793[yyj3793] - yyv3795.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3793 := 0 - for ; !r.CheckBreak(); yyj3793++ { - - if yyj3793 >= len(yyv3793) { - yyv3793 = append(yyv3793, ServicePort{}) // var yyz3793 ServicePort - yyc3793 = true - } - yyh3793.ElemContainerState(yyj3793) - if yyj3793 < len(yyv3793) { - if r.TryDecodeAsNil() { - yyv3793[yyj3793] = ServicePort{} - } else { - yyv3796 := &yyv3793[yyj3793] - yyv3796.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3793 < len(yyv3793) { - yyv3793 = yyv3793[:yyj3793] - yyc3793 = true - } else if yyj3793 == 0 && yyv3793 == nil { - yyv3793 = []ServicePort{} - yyc3793 = true - } - } - yyh3793.End() - if yyc3793 { - *v = yyv3793 - } -} - -func (x codecSelfer1234) encSliceService(v []Service, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3797 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3798 := &yyv3797 - yy3798.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceService(v *[]Service, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3799 := *v - yyh3799, yyl3799 := z.DecSliceHelperStart() - var yyc3799 bool - if yyl3799 == 0 { - if yyv3799 == nil { - yyv3799 = []Service{} - yyc3799 = true - } else if len(yyv3799) != 0 { - yyv3799 = yyv3799[:0] - yyc3799 = true - } - } else if yyl3799 > 0 { - var yyrr3799, yyrl3799 int - var yyrt3799 bool - if yyl3799 > cap(yyv3799) { - - yyrg3799 := len(yyv3799) > 0 - yyv23799 := yyv3799 - yyrl3799, yyrt3799 = z.DecInferLen(yyl3799, z.DecBasicHandle().MaxInitLen, 360) - if yyrt3799 { - if yyrl3799 <= cap(yyv3799) { - yyv3799 = yyv3799[:yyrl3799] - } else { - yyv3799 = make([]Service, yyrl3799) - } - } else { - yyv3799 = make([]Service, yyrl3799) - } - yyc3799 = true - yyrr3799 = len(yyv3799) - if yyrg3799 { - copy(yyv3799, yyv23799) - } - } else if yyl3799 != len(yyv3799) { - yyv3799 = yyv3799[:yyl3799] - yyc3799 = true - } - yyj3799 := 0 - for ; yyj3799 < yyrr3799; yyj3799++ { - yyh3799.ElemContainerState(yyj3799) - if r.TryDecodeAsNil() { - yyv3799[yyj3799] = Service{} - } else { - yyv3800 := &yyv3799[yyj3799] - yyv3800.CodecDecodeSelf(d) - } - - } - if yyrt3799 { - for ; yyj3799 < yyl3799; yyj3799++ { - yyv3799 = append(yyv3799, Service{}) - yyh3799.ElemContainerState(yyj3799) - if r.TryDecodeAsNil() { - yyv3799[yyj3799] = Service{} - } else { - yyv3801 := &yyv3799[yyj3799] - yyv3801.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3799 := 0 - for ; !r.CheckBreak(); yyj3799++ { - - if yyj3799 >= len(yyv3799) { - yyv3799 = append(yyv3799, Service{}) // var yyz3799 Service - yyc3799 = true - } - yyh3799.ElemContainerState(yyj3799) - if yyj3799 < len(yyv3799) { - if r.TryDecodeAsNil() { - yyv3799[yyj3799] = Service{} - } else { - yyv3802 := &yyv3799[yyj3799] - yyv3802.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3799 < len(yyv3799) { - yyv3799 = yyv3799[:yyj3799] - yyc3799 = true - } else if yyj3799 == 0 && yyv3799 == nil { - yyv3799 = []Service{} - yyc3799 = true - } - } - yyh3799.End() - if yyc3799 { - *v = yyv3799 - } -} - -func (x codecSelfer1234) encSliceObjectReference(v []ObjectReference, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3803 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3804 := &yyv3803 - yy3804.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceObjectReference(v *[]ObjectReference, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3805 := *v - yyh3805, yyl3805 := z.DecSliceHelperStart() - var yyc3805 bool - if yyl3805 == 0 { - if yyv3805 == nil { - yyv3805 = []ObjectReference{} - yyc3805 = true - } else if len(yyv3805) != 0 { - yyv3805 = yyv3805[:0] - yyc3805 = true - } - } else if yyl3805 > 0 { - var yyrr3805, yyrl3805 int - var yyrt3805 bool - if yyl3805 > cap(yyv3805) { - - yyrg3805 := len(yyv3805) > 0 - yyv23805 := yyv3805 - yyrl3805, yyrt3805 = z.DecInferLen(yyl3805, z.DecBasicHandle().MaxInitLen, 112) - if yyrt3805 { - if yyrl3805 <= cap(yyv3805) { - yyv3805 = yyv3805[:yyrl3805] - } else { - yyv3805 = make([]ObjectReference, yyrl3805) - } - } else { - yyv3805 = make([]ObjectReference, yyrl3805) - } - yyc3805 = true - yyrr3805 = len(yyv3805) - if yyrg3805 { - copy(yyv3805, yyv23805) - } - } else if yyl3805 != len(yyv3805) { - yyv3805 = yyv3805[:yyl3805] - yyc3805 = true - } - yyj3805 := 0 - for ; yyj3805 < yyrr3805; yyj3805++ { - yyh3805.ElemContainerState(yyj3805) - if r.TryDecodeAsNil() { - yyv3805[yyj3805] = ObjectReference{} - } else { - yyv3806 := &yyv3805[yyj3805] - yyv3806.CodecDecodeSelf(d) - } - - } - if yyrt3805 { - for ; yyj3805 < yyl3805; yyj3805++ { - yyv3805 = append(yyv3805, ObjectReference{}) - yyh3805.ElemContainerState(yyj3805) - if r.TryDecodeAsNil() { - yyv3805[yyj3805] = ObjectReference{} - } else { - yyv3807 := &yyv3805[yyj3805] - yyv3807.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3805 := 0 - for ; !r.CheckBreak(); yyj3805++ { - - if yyj3805 >= len(yyv3805) { - yyv3805 = append(yyv3805, ObjectReference{}) // var yyz3805 ObjectReference - yyc3805 = true - } - yyh3805.ElemContainerState(yyj3805) - if yyj3805 < len(yyv3805) { - if r.TryDecodeAsNil() { - yyv3805[yyj3805] = ObjectReference{} - } else { - yyv3808 := &yyv3805[yyj3805] - yyv3808.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3805 < len(yyv3805) { - yyv3805 = yyv3805[:yyj3805] - yyc3805 = true - } else if yyj3805 == 0 && yyv3805 == nil { - yyv3805 = []ObjectReference{} - yyc3805 = true - } - } - yyh3805.End() - if yyc3805 { - *v = yyv3805 - } -} - -func (x codecSelfer1234) encSliceServiceAccount(v []ServiceAccount, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3809 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3810 := &yyv3809 - yy3810.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServiceAccount(v *[]ServiceAccount, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3811 := *v - yyh3811, yyl3811 := z.DecSliceHelperStart() - var yyc3811 bool - if yyl3811 == 0 { - if yyv3811 == nil { - yyv3811 = []ServiceAccount{} - yyc3811 = true - } else if len(yyv3811) != 0 { - yyv3811 = yyv3811[:0] - yyc3811 = true - } - } else if yyl3811 > 0 { - var yyrr3811, yyrl3811 int - var yyrt3811 bool - if yyl3811 > cap(yyv3811) { - - yyrg3811 := len(yyv3811) > 0 - yyv23811 := yyv3811 - yyrl3811, yyrt3811 = z.DecInferLen(yyl3811, z.DecBasicHandle().MaxInitLen, 240) - if yyrt3811 { - if yyrl3811 <= cap(yyv3811) { - yyv3811 = yyv3811[:yyrl3811] - } else { - yyv3811 = make([]ServiceAccount, yyrl3811) - } - } else { - yyv3811 = make([]ServiceAccount, yyrl3811) - } - yyc3811 = true - yyrr3811 = len(yyv3811) - if yyrg3811 { - copy(yyv3811, yyv23811) - } - } else if yyl3811 != len(yyv3811) { - yyv3811 = yyv3811[:yyl3811] - yyc3811 = true - } - yyj3811 := 0 - for ; yyj3811 < yyrr3811; yyj3811++ { - yyh3811.ElemContainerState(yyj3811) - if r.TryDecodeAsNil() { - yyv3811[yyj3811] = ServiceAccount{} - } else { - yyv3812 := &yyv3811[yyj3811] - yyv3812.CodecDecodeSelf(d) - } - - } - if yyrt3811 { - for ; yyj3811 < yyl3811; yyj3811++ { - yyv3811 = append(yyv3811, ServiceAccount{}) - yyh3811.ElemContainerState(yyj3811) - if r.TryDecodeAsNil() { - yyv3811[yyj3811] = ServiceAccount{} - } else { - yyv3813 := &yyv3811[yyj3811] - yyv3813.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3811 := 0 - for ; !r.CheckBreak(); yyj3811++ { - - if yyj3811 >= len(yyv3811) { - yyv3811 = append(yyv3811, ServiceAccount{}) // var yyz3811 ServiceAccount - yyc3811 = true - } - yyh3811.ElemContainerState(yyj3811) - if yyj3811 < len(yyv3811) { - if r.TryDecodeAsNil() { - yyv3811[yyj3811] = ServiceAccount{} - } else { - yyv3814 := &yyv3811[yyj3811] - yyv3814.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3811 < len(yyv3811) { - yyv3811 = yyv3811[:yyj3811] - yyc3811 = true - } else if yyj3811 == 0 && yyv3811 == nil { - yyv3811 = []ServiceAccount{} - yyc3811 = true - } - } - yyh3811.End() - if yyc3811 { - *v = yyv3811 - } -} - -func (x codecSelfer1234) encSliceEndpointSubset(v []EndpointSubset, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3815 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3816 := &yyv3815 - yy3816.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointSubset(v *[]EndpointSubset, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3817 := *v - yyh3817, yyl3817 := z.DecSliceHelperStart() - var yyc3817 bool - if yyl3817 == 0 { - if yyv3817 == nil { - yyv3817 = []EndpointSubset{} - yyc3817 = true - } else if len(yyv3817) != 0 { - yyv3817 = yyv3817[:0] - yyc3817 = true - } - } else if yyl3817 > 0 { - var yyrr3817, yyrl3817 int - var yyrt3817 bool - if yyl3817 > cap(yyv3817) { - - yyrg3817 := len(yyv3817) > 0 - yyv23817 := yyv3817 - yyrl3817, yyrt3817 = z.DecInferLen(yyl3817, z.DecBasicHandle().MaxInitLen, 72) - if yyrt3817 { - if yyrl3817 <= cap(yyv3817) { - yyv3817 = yyv3817[:yyrl3817] - } else { - yyv3817 = make([]EndpointSubset, yyrl3817) - } - } else { - yyv3817 = make([]EndpointSubset, yyrl3817) - } - yyc3817 = true - yyrr3817 = len(yyv3817) - if yyrg3817 { - copy(yyv3817, yyv23817) - } - } else if yyl3817 != len(yyv3817) { - yyv3817 = yyv3817[:yyl3817] - yyc3817 = true - } - yyj3817 := 0 - for ; yyj3817 < yyrr3817; yyj3817++ { - yyh3817.ElemContainerState(yyj3817) - if r.TryDecodeAsNil() { - yyv3817[yyj3817] = EndpointSubset{} - } else { - yyv3818 := &yyv3817[yyj3817] - yyv3818.CodecDecodeSelf(d) - } - - } - if yyrt3817 { - for ; yyj3817 < yyl3817; yyj3817++ { - yyv3817 = append(yyv3817, EndpointSubset{}) - yyh3817.ElemContainerState(yyj3817) - if r.TryDecodeAsNil() { - yyv3817[yyj3817] = EndpointSubset{} - } else { - yyv3819 := &yyv3817[yyj3817] - yyv3819.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3817 := 0 - for ; !r.CheckBreak(); yyj3817++ { - - if yyj3817 >= len(yyv3817) { - yyv3817 = append(yyv3817, EndpointSubset{}) // var yyz3817 EndpointSubset - yyc3817 = true - } - yyh3817.ElemContainerState(yyj3817) - if yyj3817 < len(yyv3817) { - if r.TryDecodeAsNil() { - yyv3817[yyj3817] = EndpointSubset{} - } else { - yyv3820 := &yyv3817[yyj3817] - yyv3820.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3817 < len(yyv3817) { - yyv3817 = yyv3817[:yyj3817] - yyc3817 = true - } else if yyj3817 == 0 && yyv3817 == nil { - yyv3817 = []EndpointSubset{} - yyc3817 = true - } - } - yyh3817.End() - if yyc3817 { - *v = yyv3817 - } -} - -func (x codecSelfer1234) encSliceEndpointAddress(v []EndpointAddress, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3821 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3822 := &yyv3821 - yy3822.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointAddress(v *[]EndpointAddress, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3823 := *v - yyh3823, yyl3823 := z.DecSliceHelperStart() - var yyc3823 bool - if yyl3823 == 0 { - if yyv3823 == nil { - yyv3823 = []EndpointAddress{} - yyc3823 = true - } else if len(yyv3823) != 0 { - yyv3823 = yyv3823[:0] - yyc3823 = true - } - } else if yyl3823 > 0 { - var yyrr3823, yyrl3823 int - var yyrt3823 bool - if yyl3823 > cap(yyv3823) { - - yyrg3823 := len(yyv3823) > 0 - yyv23823 := yyv3823 - yyrl3823, yyrt3823 = z.DecInferLen(yyl3823, z.DecBasicHandle().MaxInitLen, 24) - if yyrt3823 { - if yyrl3823 <= cap(yyv3823) { - yyv3823 = yyv3823[:yyrl3823] - } else { - yyv3823 = make([]EndpointAddress, yyrl3823) - } - } else { - yyv3823 = make([]EndpointAddress, yyrl3823) - } - yyc3823 = true - yyrr3823 = len(yyv3823) - if yyrg3823 { - copy(yyv3823, yyv23823) - } - } else if yyl3823 != len(yyv3823) { - yyv3823 = yyv3823[:yyl3823] - yyc3823 = true - } - yyj3823 := 0 - for ; yyj3823 < yyrr3823; yyj3823++ { - yyh3823.ElemContainerState(yyj3823) - if r.TryDecodeAsNil() { - yyv3823[yyj3823] = EndpointAddress{} - } else { - yyv3824 := &yyv3823[yyj3823] - yyv3824.CodecDecodeSelf(d) - } - - } - if yyrt3823 { - for ; yyj3823 < yyl3823; yyj3823++ { - yyv3823 = append(yyv3823, EndpointAddress{}) - yyh3823.ElemContainerState(yyj3823) - if r.TryDecodeAsNil() { - yyv3823[yyj3823] = EndpointAddress{} - } else { - yyv3825 := &yyv3823[yyj3823] - yyv3825.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3823 := 0 - for ; !r.CheckBreak(); yyj3823++ { - - if yyj3823 >= len(yyv3823) { - yyv3823 = append(yyv3823, EndpointAddress{}) // var yyz3823 EndpointAddress - yyc3823 = true - } - yyh3823.ElemContainerState(yyj3823) - if yyj3823 < len(yyv3823) { - if r.TryDecodeAsNil() { - yyv3823[yyj3823] = EndpointAddress{} - } else { - yyv3826 := &yyv3823[yyj3823] - yyv3826.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3823 < len(yyv3823) { - yyv3823 = yyv3823[:yyj3823] - yyc3823 = true - } else if yyj3823 == 0 && yyv3823 == nil { - yyv3823 = []EndpointAddress{} - yyc3823 = true - } - } - yyh3823.End() - if yyc3823 { - *v = yyv3823 - } -} - -func (x codecSelfer1234) encSliceEndpointPort(v []EndpointPort, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3827 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3828 := &yyv3827 - yy3828.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpointPort(v *[]EndpointPort, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3829 := *v - yyh3829, yyl3829 := z.DecSliceHelperStart() - var yyc3829 bool - if yyl3829 == 0 { - if yyv3829 == nil { - yyv3829 = []EndpointPort{} - yyc3829 = true - } else if len(yyv3829) != 0 { - yyv3829 = yyv3829[:0] - yyc3829 = true - } - } else if yyl3829 > 0 { - var yyrr3829, yyrl3829 int - var yyrt3829 bool - if yyl3829 > cap(yyv3829) { - - yyrg3829 := len(yyv3829) > 0 - yyv23829 := yyv3829 - yyrl3829, yyrt3829 = z.DecInferLen(yyl3829, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3829 { - if yyrl3829 <= cap(yyv3829) { - yyv3829 = yyv3829[:yyrl3829] - } else { - yyv3829 = make([]EndpointPort, yyrl3829) - } - } else { - yyv3829 = make([]EndpointPort, yyrl3829) - } - yyc3829 = true - yyrr3829 = len(yyv3829) - if yyrg3829 { - copy(yyv3829, yyv23829) - } - } else if yyl3829 != len(yyv3829) { - yyv3829 = yyv3829[:yyl3829] - yyc3829 = true - } - yyj3829 := 0 - for ; yyj3829 < yyrr3829; yyj3829++ { - yyh3829.ElemContainerState(yyj3829) - if r.TryDecodeAsNil() { - yyv3829[yyj3829] = EndpointPort{} - } else { - yyv3830 := &yyv3829[yyj3829] - yyv3830.CodecDecodeSelf(d) - } - - } - if yyrt3829 { - for ; yyj3829 < yyl3829; yyj3829++ { - yyv3829 = append(yyv3829, EndpointPort{}) - yyh3829.ElemContainerState(yyj3829) - if r.TryDecodeAsNil() { - yyv3829[yyj3829] = EndpointPort{} - } else { - yyv3831 := &yyv3829[yyj3829] - yyv3831.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3829 := 0 - for ; !r.CheckBreak(); yyj3829++ { - - if yyj3829 >= len(yyv3829) { - yyv3829 = append(yyv3829, EndpointPort{}) // var yyz3829 EndpointPort - yyc3829 = true - } - yyh3829.ElemContainerState(yyj3829) - if yyj3829 < len(yyv3829) { - if r.TryDecodeAsNil() { - yyv3829[yyj3829] = EndpointPort{} - } else { - yyv3832 := &yyv3829[yyj3829] - yyv3832.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3829 < len(yyv3829) { - yyv3829 = yyv3829[:yyj3829] - yyc3829 = true - } else if yyj3829 == 0 && yyv3829 == nil { - yyv3829 = []EndpointPort{} - yyc3829 = true - } - } - yyh3829.End() - if yyc3829 { - *v = yyv3829 - } -} - -func (x codecSelfer1234) encSliceEndpoints(v []Endpoints, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3833 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3834 := &yyv3833 - yy3834.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceEndpoints(v *[]Endpoints, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3835 := *v - yyh3835, yyl3835 := z.DecSliceHelperStart() - var yyc3835 bool - if yyl3835 == 0 { - if yyv3835 == nil { - yyv3835 = []Endpoints{} - yyc3835 = true - } else if len(yyv3835) != 0 { - yyv3835 = yyv3835[:0] - yyc3835 = true - } - } else if yyl3835 > 0 { - var yyrr3835, yyrl3835 int - var yyrt3835 bool - if yyl3835 > cap(yyv3835) { - - yyrg3835 := len(yyv3835) > 0 - yyv23835 := yyv3835 - yyrl3835, yyrt3835 = z.DecInferLen(yyl3835, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3835 { - if yyrl3835 <= cap(yyv3835) { - yyv3835 = yyv3835[:yyrl3835] - } else { - yyv3835 = make([]Endpoints, yyrl3835) - } - } else { - yyv3835 = make([]Endpoints, yyrl3835) - } - yyc3835 = true - yyrr3835 = len(yyv3835) - if yyrg3835 { - copy(yyv3835, yyv23835) - } - } else if yyl3835 != len(yyv3835) { - yyv3835 = yyv3835[:yyl3835] - yyc3835 = true - } - yyj3835 := 0 - for ; yyj3835 < yyrr3835; yyj3835++ { - yyh3835.ElemContainerState(yyj3835) - if r.TryDecodeAsNil() { - yyv3835[yyj3835] = Endpoints{} - } else { - yyv3836 := &yyv3835[yyj3835] - yyv3836.CodecDecodeSelf(d) - } - - } - if yyrt3835 { - for ; yyj3835 < yyl3835; yyj3835++ { - yyv3835 = append(yyv3835, Endpoints{}) - yyh3835.ElemContainerState(yyj3835) - if r.TryDecodeAsNil() { - yyv3835[yyj3835] = Endpoints{} - } else { - yyv3837 := &yyv3835[yyj3835] - yyv3837.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3835 := 0 - for ; !r.CheckBreak(); yyj3835++ { - - if yyj3835 >= len(yyv3835) { - yyv3835 = append(yyv3835, Endpoints{}) // var yyz3835 Endpoints - yyc3835 = true - } - yyh3835.ElemContainerState(yyj3835) - if yyj3835 < len(yyv3835) { - if r.TryDecodeAsNil() { - yyv3835[yyj3835] = Endpoints{} - } else { - yyv3838 := &yyv3835[yyj3835] - yyv3838.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3835 < len(yyv3835) { - yyv3835 = yyv3835[:yyj3835] - yyc3835 = true - } else if yyj3835 == 0 && yyv3835 == nil { - yyv3835 = []Endpoints{} - yyc3835 = true - } - } - yyh3835.End() - if yyc3835 { - *v = yyv3835 - } -} - -func (x codecSelfer1234) encSliceNodeCondition(v []NodeCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3839 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3840 := &yyv3839 - yy3840.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3841 := *v - yyh3841, yyl3841 := z.DecSliceHelperStart() - var yyc3841 bool - if yyl3841 == 0 { - if yyv3841 == nil { - yyv3841 = []NodeCondition{} - yyc3841 = true - } else if len(yyv3841) != 0 { - yyv3841 = yyv3841[:0] - yyc3841 = true - } - } else if yyl3841 > 0 { - var yyrr3841, yyrl3841 int - var yyrt3841 bool - if yyl3841 > cap(yyv3841) { - - yyrg3841 := len(yyv3841) > 0 - yyv23841 := yyv3841 - yyrl3841, yyrt3841 = z.DecInferLen(yyl3841, z.DecBasicHandle().MaxInitLen, 112) - if yyrt3841 { - if yyrl3841 <= cap(yyv3841) { - yyv3841 = yyv3841[:yyrl3841] - } else { - yyv3841 = make([]NodeCondition, yyrl3841) - } - } else { - yyv3841 = make([]NodeCondition, yyrl3841) - } - yyc3841 = true - yyrr3841 = len(yyv3841) - if yyrg3841 { - copy(yyv3841, yyv23841) - } - } else if yyl3841 != len(yyv3841) { - yyv3841 = yyv3841[:yyl3841] - yyc3841 = true - } - yyj3841 := 0 - for ; yyj3841 < yyrr3841; yyj3841++ { - yyh3841.ElemContainerState(yyj3841) - if r.TryDecodeAsNil() { - yyv3841[yyj3841] = NodeCondition{} - } else { - yyv3842 := &yyv3841[yyj3841] - yyv3842.CodecDecodeSelf(d) - } - - } - if yyrt3841 { - for ; yyj3841 < yyl3841; yyj3841++ { - yyv3841 = append(yyv3841, NodeCondition{}) - yyh3841.ElemContainerState(yyj3841) - if r.TryDecodeAsNil() { - yyv3841[yyj3841] = NodeCondition{} - } else { - yyv3843 := &yyv3841[yyj3841] - yyv3843.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj3841 := 0 - for ; !r.CheckBreak(); yyj3841++ { - - if yyj3841 >= len(yyv3841) { - yyv3841 = append(yyv3841, NodeCondition{}) // var yyz3841 NodeCondition - yyc3841 = true - } - yyh3841.ElemContainerState(yyj3841) - if yyj3841 < len(yyv3841) { - if r.TryDecodeAsNil() { - yyv3841[yyj3841] = NodeCondition{} - } else { - yyv3844 := &yyv3841[yyj3841] - yyv3844.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj3841 < len(yyv3841) { - yyv3841 = yyv3841[:yyj3841] - yyc3841 = true - } else if yyj3841 == 0 && yyv3841 == nil { - yyv3841 = []NodeCondition{} - yyc3841 = true - } - } - yyh3841.End() - if yyc3841 { - *v = yyv3841 - } -} - -func (x codecSelfer1234) encSliceNodeAddress(v []NodeAddress, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3845 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3846 := &yyv3845 - yy3846.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yyv3847 := *v yyh3847, yyl3847 := z.DecSliceHelperStart() var yyc3847 bool if yyl3847 == 0 { if yyv3847 == nil { - yyv3847 = []NodeAddress{} + yyv3847 = []PersistentVolumeAccessMode{} yyc3847 = true } else if len(yyv3847) != 0 { yyv3847 = yyv3847[:0] @@ -48718,23 +47975,18 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco var yyrt3847 bool if yyl3847 > cap(yyv3847) { - yyrg3847 := len(yyv3847) > 0 - yyv23847 := yyv3847 - yyrl3847, yyrt3847 = z.DecInferLen(yyl3847, z.DecBasicHandle().MaxInitLen, 32) + yyrl3847, yyrt3847 = z.DecInferLen(yyl3847, z.DecBasicHandle().MaxInitLen, 16) if yyrt3847 { if yyrl3847 <= cap(yyv3847) { yyv3847 = yyv3847[:yyrl3847] } else { - yyv3847 = make([]NodeAddress, yyrl3847) + yyv3847 = make([]PersistentVolumeAccessMode, yyrl3847) } } else { - yyv3847 = make([]NodeAddress, yyrl3847) + yyv3847 = make([]PersistentVolumeAccessMode, yyrl3847) } yyc3847 = true yyrr3847 = len(yyv3847) - if yyrg3847 { - copy(yyv3847, yyv23847) - } } else if yyl3847 != len(yyv3847) { yyv3847 = yyv3847[:yyl3847] yyc3847 = true @@ -48743,22 +47995,20 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco for ; yyj3847 < yyrr3847; yyj3847++ { yyh3847.ElemContainerState(yyj3847) if r.TryDecodeAsNil() { - yyv3847[yyj3847] = NodeAddress{} + yyv3847[yyj3847] = "" } else { - yyv3848 := &yyv3847[yyj3847] - yyv3848.CodecDecodeSelf(d) + yyv3847[yyj3847] = PersistentVolumeAccessMode(r.DecodeString()) } } if yyrt3847 { for ; yyj3847 < yyl3847; yyj3847++ { - yyv3847 = append(yyv3847, NodeAddress{}) + yyv3847 = append(yyv3847, "") yyh3847.ElemContainerState(yyj3847) if r.TryDecodeAsNil() { - yyv3847[yyj3847] = NodeAddress{} + yyv3847[yyj3847] = "" } else { - yyv3849 := &yyv3847[yyj3847] - yyv3849.CodecDecodeSelf(d) + yyv3847[yyj3847] = PersistentVolumeAccessMode(r.DecodeString()) } } @@ -48769,16 +48019,15 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco for ; !r.CheckBreak(); yyj3847++ { if yyj3847 >= len(yyv3847) { - yyv3847 = append(yyv3847, NodeAddress{}) // var yyz3847 NodeAddress + yyv3847 = append(yyv3847, "") // var yyz3847 PersistentVolumeAccessMode yyc3847 = true } yyh3847.ElemContainerState(yyj3847) if yyj3847 < len(yyv3847) { if r.TryDecodeAsNil() { - yyv3847[yyj3847] = NodeAddress{} + yyv3847[yyj3847] = "" } else { - yyv3850 := &yyv3847[yyj3847] - yyv3850.CodecDecodeSelf(d) + yyv3847[yyj3847] = PersistentVolumeAccessMode(r.DecodeString()) } } else { @@ -48790,7 +48039,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco yyv3847 = yyv3847[:yyj3847] yyc3847 = true } else if yyj3847 == 0 && yyv3847 == nil { - yyv3847 = []NodeAddress{} + yyv3847 = []PersistentVolumeAccessMode{} yyc3847 = true } } @@ -48800,7 +48049,7 @@ func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Deco } } -func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePersistentVolume(v []PersistentVolume, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -48813,7 +48062,7 @@ func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978 z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePersistentVolume(v *[]PersistentVolume, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -48823,7 +48072,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 var yyc3853 bool if yyl3853 == 0 { if yyv3853 == nil { - yyv3853 = []ContainerImage{} + yyv3853 = []PersistentVolume{} yyc3853 = true } else if len(yyv3853) != 0 { yyv3853 = yyv3853[:0] @@ -48836,15 +48085,15 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 yyrg3853 := len(yyv3853) > 0 yyv23853 := yyv3853 - yyrl3853, yyrt3853 = z.DecInferLen(yyl3853, z.DecBasicHandle().MaxInitLen, 32) + yyrl3853, yyrt3853 = z.DecInferLen(yyl3853, z.DecBasicHandle().MaxInitLen, 400) if yyrt3853 { if yyrl3853 <= cap(yyv3853) { yyv3853 = yyv3853[:yyrl3853] } else { - yyv3853 = make([]ContainerImage, yyrl3853) + yyv3853 = make([]PersistentVolume, yyrl3853) } } else { - yyv3853 = make([]ContainerImage, yyrl3853) + yyv3853 = make([]PersistentVolume, yyrl3853) } yyc3853 = true yyrr3853 = len(yyv3853) @@ -48859,7 +48108,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 for ; yyj3853 < yyrr3853; yyj3853++ { yyh3853.ElemContainerState(yyj3853) if r.TryDecodeAsNil() { - yyv3853[yyj3853] = ContainerImage{} + yyv3853[yyj3853] = PersistentVolume{} } else { yyv3854 := &yyv3853[yyj3853] yyv3854.CodecDecodeSelf(d) @@ -48868,10 +48117,10 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 } if yyrt3853 { for ; yyj3853 < yyl3853; yyj3853++ { - yyv3853 = append(yyv3853, ContainerImage{}) + yyv3853 = append(yyv3853, PersistentVolume{}) yyh3853.ElemContainerState(yyj3853) if r.TryDecodeAsNil() { - yyv3853[yyj3853] = ContainerImage{} + yyv3853[yyj3853] = PersistentVolume{} } else { yyv3855 := &yyv3853[yyj3853] yyv3855.CodecDecodeSelf(d) @@ -48885,13 +48134,13 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 for ; !r.CheckBreak(); yyj3853++ { if yyj3853 >= len(yyv3853) { - yyv3853 = append(yyv3853, ContainerImage{}) // var yyz3853 ContainerImage + yyv3853 = append(yyv3853, PersistentVolume{}) // var yyz3853 PersistentVolume yyc3853 = true } yyh3853.ElemContainerState(yyj3853) if yyj3853 < len(yyv3853) { if r.TryDecodeAsNil() { - yyv3853[yyj3853] = ContainerImage{} + yyv3853[yyj3853] = PersistentVolume{} } else { yyv3856 := &yyv3853[yyj3853] yyv3856.CodecDecodeSelf(d) @@ -48906,7 +48155,7 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 yyv3853 = yyv3853[:yyj3853] yyc3853 = true } else if yyj3853 == 0 && yyv3853 == nil { - yyv3853 = []ContainerImage{} + yyv3853 = []PersistentVolume{} yyc3853 = true } } @@ -48916,215 +48165,101 @@ func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec197 } } -func (x codecSelfer1234) encResourceList(v ResourceList, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePersistentVolumeClaim(v []PersistentVolumeClaim, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk3857, yyv3857 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - yyk3857.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + r.EncodeArrayStart(len(v)) + for _, yyv3857 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) yy3858 := &yyv3857 - yym3859 := z.EncBinary() - _ = yym3859 - if false { - } else if z.HasExtensions() && z.EncExt(yy3858) { - } else if !yym3859 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3858) - } else { - z.EncFallback(yy3858) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x codecSelfer1234) decResourceList(v *ResourceList, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv3860 := *v - yyl3860 := r.ReadMapStart() - yybh3860 := z.DecBasicHandle() - if yyv3860 == nil { - yyrl3860, _ := z.DecInferLen(yyl3860, yybh3860.MaxInitLen, 40) - yyv3860 = make(map[ResourceName]pkg3_resource.Quantity, yyrl3860) - *v = yyv3860 - } - var yymk3860 ResourceName - var yymv3860 pkg3_resource.Quantity - var yymg3860 bool - if yybh3860.MapValueReset { - yymg3860 = true - } - if yyl3860 > 0 { - for yyj3860 := 0; yyj3860 < yyl3860; yyj3860++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk3860 = "" - } else { - yymk3860 = ResourceName(r.DecodeString()) - } - - if yymg3860 { - yymv3860 = yyv3860[yymk3860] - } else { - yymv3860 = pkg3_resource.Quantity{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv3860 = pkg3_resource.Quantity{} - } else { - yyv3862 := &yymv3860 - yym3863 := z.DecBinary() - _ = yym3863 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3862) { - } else if !yym3863 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3862) - } else { - z.DecFallback(yyv3862, false) - } - } - - if yyv3860 != nil { - yyv3860[yymk3860] = yymv3860 - } - } - } else if yyl3860 < 0 { - for yyj3860 := 0; !r.CheckBreak(); yyj3860++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk3860 = "" - } else { - yymk3860 = ResourceName(r.DecodeString()) - } - - if yymg3860 { - yymv3860 = yyv3860[yymk3860] - } else { - yymv3860 = pkg3_resource.Quantity{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv3860 = pkg3_resource.Quantity{} - } else { - yyv3865 := &yymv3860 - yym3866 := z.DecBinary() - _ = yym3866 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3865) { - } else if !yym3866 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3865) - } else { - z.DecFallback(yyv3865, false) - } - } - - if yyv3860 != nil { - yyv3860[yymk3860] = yymv3860 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x codecSelfer1234) encSliceNode(v []Node, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv3867 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3868 := &yyv3867 - yy3868.CodecEncodeSelf(e) + yy3858.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePersistentVolumeClaim(v *[]PersistentVolumeClaim, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3869 := *v - yyh3869, yyl3869 := z.DecSliceHelperStart() - var yyc3869 bool - if yyl3869 == 0 { - if yyv3869 == nil { - yyv3869 = []Node{} - yyc3869 = true - } else if len(yyv3869) != 0 { - yyv3869 = yyv3869[:0] - yyc3869 = true + yyv3859 := *v + yyh3859, yyl3859 := z.DecSliceHelperStart() + var yyc3859 bool + if yyl3859 == 0 { + if yyv3859 == nil { + yyv3859 = []PersistentVolumeClaim{} + yyc3859 = true + } else if len(yyv3859) != 0 { + yyv3859 = yyv3859[:0] + yyc3859 = true } - } else if yyl3869 > 0 { - var yyrr3869, yyrl3869 int - var yyrt3869 bool - if yyl3869 > cap(yyv3869) { + } else if yyl3859 > 0 { + var yyrr3859, yyrl3859 int + var yyrt3859 bool + if yyl3859 > cap(yyv3859) { - yyrg3869 := len(yyv3869) > 0 - yyv23869 := yyv3869 - yyrl3869, yyrt3869 = z.DecInferLen(yyl3869, z.DecBasicHandle().MaxInitLen, 488) - if yyrt3869 { - if yyrl3869 <= cap(yyv3869) { - yyv3869 = yyv3869[:yyrl3869] + yyrg3859 := len(yyv3859) > 0 + yyv23859 := yyv3859 + yyrl3859, yyrt3859 = z.DecInferLen(yyl3859, z.DecBasicHandle().MaxInitLen, 296) + if yyrt3859 { + if yyrl3859 <= cap(yyv3859) { + yyv3859 = yyv3859[:yyrl3859] } else { - yyv3869 = make([]Node, yyrl3869) + yyv3859 = make([]PersistentVolumeClaim, yyrl3859) } } else { - yyv3869 = make([]Node, yyrl3869) + yyv3859 = make([]PersistentVolumeClaim, yyrl3859) } - yyc3869 = true - yyrr3869 = len(yyv3869) - if yyrg3869 { - copy(yyv3869, yyv23869) + yyc3859 = true + yyrr3859 = len(yyv3859) + if yyrg3859 { + copy(yyv3859, yyv23859) } - } else if yyl3869 != len(yyv3869) { - yyv3869 = yyv3869[:yyl3869] - yyc3869 = true + } else if yyl3859 != len(yyv3859) { + yyv3859 = yyv3859[:yyl3859] + yyc3859 = true } - yyj3869 := 0 - for ; yyj3869 < yyrr3869; yyj3869++ { - yyh3869.ElemContainerState(yyj3869) + yyj3859 := 0 + for ; yyj3859 < yyrr3859; yyj3859++ { + yyh3859.ElemContainerState(yyj3859) if r.TryDecodeAsNil() { - yyv3869[yyj3869] = Node{} + yyv3859[yyj3859] = PersistentVolumeClaim{} } else { - yyv3870 := &yyv3869[yyj3869] - yyv3870.CodecDecodeSelf(d) + yyv3860 := &yyv3859[yyj3859] + yyv3860.CodecDecodeSelf(d) } } - if yyrt3869 { - for ; yyj3869 < yyl3869; yyj3869++ { - yyv3869 = append(yyv3869, Node{}) - yyh3869.ElemContainerState(yyj3869) + if yyrt3859 { + for ; yyj3859 < yyl3859; yyj3859++ { + yyv3859 = append(yyv3859, PersistentVolumeClaim{}) + yyh3859.ElemContainerState(yyj3859) if r.TryDecodeAsNil() { - yyv3869[yyj3869] = Node{} + yyv3859[yyj3859] = PersistentVolumeClaim{} } else { - yyv3871 := &yyv3869[yyj3869] - yyv3871.CodecDecodeSelf(d) + yyv3861 := &yyv3859[yyj3859] + yyv3861.CodecDecodeSelf(d) } } } } else { - yyj3869 := 0 - for ; !r.CheckBreak(); yyj3869++ { + yyj3859 := 0 + for ; !r.CheckBreak(); yyj3859++ { - if yyj3869 >= len(yyv3869) { - yyv3869 = append(yyv3869, Node{}) // var yyz3869 Node - yyc3869 = true + if yyj3859 >= len(yyv3859) { + yyv3859 = append(yyv3859, PersistentVolumeClaim{}) // var yyz3859 PersistentVolumeClaim + yyc3859 = true } - yyh3869.ElemContainerState(yyj3869) - if yyj3869 < len(yyv3869) { + yyh3859.ElemContainerState(yyj3859) + if yyj3859 < len(yyv3859) { if r.TryDecodeAsNil() { - yyv3869[yyj3869] = Node{} + yyv3859[yyj3859] = PersistentVolumeClaim{} } else { - yyv3872 := &yyv3869[yyj3869] - yyv3872.CodecDecodeSelf(d) + yyv3862 := &yyv3859[yyj3859] + yyv3862.CodecDecodeSelf(d) } } else { @@ -49132,106 +48267,115 @@ func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) { } } - if yyj3869 < len(yyv3869) { - yyv3869 = yyv3869[:yyj3869] - yyc3869 = true - } else if yyj3869 == 0 && yyv3869 == nil { - yyv3869 = []Node{} - yyc3869 = true + if yyj3859 < len(yyv3859) { + yyv3859 = yyv3859[:yyj3859] + yyc3859 = true + } else if yyj3859 == 0 && yyv3859 == nil { + yyv3859 = []PersistentVolumeClaim{} + yyc3859 = true } } - yyh3869.End() - if yyc3869 { - *v = yyv3869 + yyh3859.End() + if yyc3859 { + *v = yyv3859 } } -func (x codecSelfer1234) encSliceFinalizerName(v []FinalizerName, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceHTTPHeader(v []HTTPHeader, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3873 := range v { + for _, yyv3863 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yyv3873.CodecEncodeSelf(e) + yy3864 := &yyv3863 + yy3864.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceFinalizerName(v *[]FinalizerName, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceHTTPHeader(v *[]HTTPHeader, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3874 := *v - yyh3874, yyl3874 := z.DecSliceHelperStart() - var yyc3874 bool - if yyl3874 == 0 { - if yyv3874 == nil { - yyv3874 = []FinalizerName{} - yyc3874 = true - } else if len(yyv3874) != 0 { - yyv3874 = yyv3874[:0] - yyc3874 = true + yyv3865 := *v + yyh3865, yyl3865 := z.DecSliceHelperStart() + var yyc3865 bool + if yyl3865 == 0 { + if yyv3865 == nil { + yyv3865 = []HTTPHeader{} + yyc3865 = true + } else if len(yyv3865) != 0 { + yyv3865 = yyv3865[:0] + yyc3865 = true } - } else if yyl3874 > 0 { - var yyrr3874, yyrl3874 int - var yyrt3874 bool - if yyl3874 > cap(yyv3874) { + } else if yyl3865 > 0 { + var yyrr3865, yyrl3865 int + var yyrt3865 bool + if yyl3865 > cap(yyv3865) { - yyrl3874, yyrt3874 = z.DecInferLen(yyl3874, z.DecBasicHandle().MaxInitLen, 16) - if yyrt3874 { - if yyrl3874 <= cap(yyv3874) { - yyv3874 = yyv3874[:yyrl3874] + yyrg3865 := len(yyv3865) > 0 + yyv23865 := yyv3865 + yyrl3865, yyrt3865 = z.DecInferLen(yyl3865, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3865 { + if yyrl3865 <= cap(yyv3865) { + yyv3865 = yyv3865[:yyrl3865] } else { - yyv3874 = make([]FinalizerName, yyrl3874) + yyv3865 = make([]HTTPHeader, yyrl3865) } } else { - yyv3874 = make([]FinalizerName, yyrl3874) + yyv3865 = make([]HTTPHeader, yyrl3865) } - yyc3874 = true - yyrr3874 = len(yyv3874) - } else if yyl3874 != len(yyv3874) { - yyv3874 = yyv3874[:yyl3874] - yyc3874 = true + yyc3865 = true + yyrr3865 = len(yyv3865) + if yyrg3865 { + copy(yyv3865, yyv23865) + } + } else if yyl3865 != len(yyv3865) { + yyv3865 = yyv3865[:yyl3865] + yyc3865 = true } - yyj3874 := 0 - for ; yyj3874 < yyrr3874; yyj3874++ { - yyh3874.ElemContainerState(yyj3874) + yyj3865 := 0 + for ; yyj3865 < yyrr3865; yyj3865++ { + yyh3865.ElemContainerState(yyj3865) if r.TryDecodeAsNil() { - yyv3874[yyj3874] = "" + yyv3865[yyj3865] = HTTPHeader{} } else { - yyv3874[yyj3874] = FinalizerName(r.DecodeString()) + yyv3866 := &yyv3865[yyj3865] + yyv3866.CodecDecodeSelf(d) } } - if yyrt3874 { - for ; yyj3874 < yyl3874; yyj3874++ { - yyv3874 = append(yyv3874, "") - yyh3874.ElemContainerState(yyj3874) + if yyrt3865 { + for ; yyj3865 < yyl3865; yyj3865++ { + yyv3865 = append(yyv3865, HTTPHeader{}) + yyh3865.ElemContainerState(yyj3865) if r.TryDecodeAsNil() { - yyv3874[yyj3874] = "" + yyv3865[yyj3865] = HTTPHeader{} } else { - yyv3874[yyj3874] = FinalizerName(r.DecodeString()) + yyv3867 := &yyv3865[yyj3865] + yyv3867.CodecDecodeSelf(d) } } } } else { - yyj3874 := 0 - for ; !r.CheckBreak(); yyj3874++ { + yyj3865 := 0 + for ; !r.CheckBreak(); yyj3865++ { - if yyj3874 >= len(yyv3874) { - yyv3874 = append(yyv3874, "") // var yyz3874 FinalizerName - yyc3874 = true + if yyj3865 >= len(yyv3865) { + yyv3865 = append(yyv3865, HTTPHeader{}) // var yyz3865 HTTPHeader + yyc3865 = true } - yyh3874.ElemContainerState(yyj3874) - if yyj3874 < len(yyv3874) { + yyh3865.ElemContainerState(yyj3865) + if yyj3865 < len(yyv3865) { if r.TryDecodeAsNil() { - yyv3874[yyj3874] = "" + yyv3865[yyj3865] = HTTPHeader{} } else { - yyv3874[yyj3874] = FinalizerName(r.DecodeString()) + yyv3868 := &yyv3865[yyj3865] + yyv3868.CodecDecodeSelf(d) } } else { @@ -49239,115 +48383,106 @@ func (x codecSelfer1234) decSliceFinalizerName(v *[]FinalizerName, d *codec1978. } } - if yyj3874 < len(yyv3874) { - yyv3874 = yyv3874[:yyj3874] - yyc3874 = true - } else if yyj3874 == 0 && yyv3874 == nil { - yyv3874 = []FinalizerName{} - yyc3874 = true + if yyj3865 < len(yyv3865) { + yyv3865 = yyv3865[:yyj3865] + yyc3865 = true + } else if yyj3865 == 0 && yyv3865 == nil { + yyv3865 = []HTTPHeader{} + yyc3865 = true } } - yyh3874.End() - if yyc3874 { - *v = yyv3874 + yyh3865.End() + if yyc3865 { + *v = yyv3865 } } -func (x codecSelfer1234) encSliceNamespace(v []Namespace, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceCapability(v []Capability, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3878 := range v { + for _, yyv3869 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3879 := &yyv3878 - yy3879.CodecEncodeSelf(e) + yyv3869.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceNamespace(v *[]Namespace, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceCapability(v *[]Capability, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3880 := *v - yyh3880, yyl3880 := z.DecSliceHelperStart() - var yyc3880 bool - if yyl3880 == 0 { - if yyv3880 == nil { - yyv3880 = []Namespace{} - yyc3880 = true - } else if len(yyv3880) != 0 { - yyv3880 = yyv3880[:0] - yyc3880 = true + yyv3870 := *v + yyh3870, yyl3870 := z.DecSliceHelperStart() + var yyc3870 bool + if yyl3870 == 0 { + if yyv3870 == nil { + yyv3870 = []Capability{} + yyc3870 = true + } else if len(yyv3870) != 0 { + yyv3870 = yyv3870[:0] + yyc3870 = true } - } else if yyl3880 > 0 { - var yyrr3880, yyrl3880 int - var yyrt3880 bool - if yyl3880 > cap(yyv3880) { + } else if yyl3870 > 0 { + var yyrr3870, yyrl3870 int + var yyrt3870 bool + if yyl3870 > cap(yyv3870) { - yyrg3880 := len(yyv3880) > 0 - yyv23880 := yyv3880 - yyrl3880, yyrt3880 = z.DecInferLen(yyl3880, z.DecBasicHandle().MaxInitLen, 232) - if yyrt3880 { - if yyrl3880 <= cap(yyv3880) { - yyv3880 = yyv3880[:yyrl3880] + yyrl3870, yyrt3870 = z.DecInferLen(yyl3870, z.DecBasicHandle().MaxInitLen, 16) + if yyrt3870 { + if yyrl3870 <= cap(yyv3870) { + yyv3870 = yyv3870[:yyrl3870] } else { - yyv3880 = make([]Namespace, yyrl3880) + yyv3870 = make([]Capability, yyrl3870) } } else { - yyv3880 = make([]Namespace, yyrl3880) + yyv3870 = make([]Capability, yyrl3870) } - yyc3880 = true - yyrr3880 = len(yyv3880) - if yyrg3880 { - copy(yyv3880, yyv23880) - } - } else if yyl3880 != len(yyv3880) { - yyv3880 = yyv3880[:yyl3880] - yyc3880 = true + yyc3870 = true + yyrr3870 = len(yyv3870) + } else if yyl3870 != len(yyv3870) { + yyv3870 = yyv3870[:yyl3870] + yyc3870 = true } - yyj3880 := 0 - for ; yyj3880 < yyrr3880; yyj3880++ { - yyh3880.ElemContainerState(yyj3880) + yyj3870 := 0 + for ; yyj3870 < yyrr3870; yyj3870++ { + yyh3870.ElemContainerState(yyj3870) if r.TryDecodeAsNil() { - yyv3880[yyj3880] = Namespace{} + yyv3870[yyj3870] = "" } else { - yyv3881 := &yyv3880[yyj3880] - yyv3881.CodecDecodeSelf(d) + yyv3870[yyj3870] = Capability(r.DecodeString()) } } - if yyrt3880 { - for ; yyj3880 < yyl3880; yyj3880++ { - yyv3880 = append(yyv3880, Namespace{}) - yyh3880.ElemContainerState(yyj3880) + if yyrt3870 { + for ; yyj3870 < yyl3870; yyj3870++ { + yyv3870 = append(yyv3870, "") + yyh3870.ElemContainerState(yyj3870) if r.TryDecodeAsNil() { - yyv3880[yyj3880] = Namespace{} + yyv3870[yyj3870] = "" } else { - yyv3882 := &yyv3880[yyj3880] - yyv3882.CodecDecodeSelf(d) + yyv3870[yyj3870] = Capability(r.DecodeString()) } } } } else { - yyj3880 := 0 - for ; !r.CheckBreak(); yyj3880++ { + yyj3870 := 0 + for ; !r.CheckBreak(); yyj3870++ { - if yyj3880 >= len(yyv3880) { - yyv3880 = append(yyv3880, Namespace{}) // var yyz3880 Namespace - yyc3880 = true + if yyj3870 >= len(yyv3870) { + yyv3870 = append(yyv3870, "") // var yyz3870 Capability + yyc3870 = true } - yyh3880.ElemContainerState(yyj3880) - if yyj3880 < len(yyv3880) { + yyh3870.ElemContainerState(yyj3870) + if yyj3870 < len(yyv3870) { if r.TryDecodeAsNil() { - yyv3880[yyj3880] = Namespace{} + yyv3870[yyj3870] = "" } else { - yyv3883 := &yyv3880[yyj3880] - yyv3883.CodecDecodeSelf(d) + yyv3870[yyj3870] = Capability(r.DecodeString()) } } else { @@ -49355,115 +48490,115 @@ func (x codecSelfer1234) decSliceNamespace(v *[]Namespace, d *codec1978.Decoder) } } - if yyj3880 < len(yyv3880) { - yyv3880 = yyv3880[:yyj3880] - yyc3880 = true - } else if yyj3880 == 0 && yyv3880 == nil { - yyv3880 = []Namespace{} - yyc3880 = true + if yyj3870 < len(yyv3870) { + yyv3870 = yyv3870[:yyj3870] + yyc3870 = true + } else if yyj3870 == 0 && yyv3870 == nil { + yyv3870 = []Capability{} + yyc3870 = true } } - yyh3880.End() - if yyc3880 { - *v = yyv3880 + yyh3870.End() + if yyc3870 { + *v = yyv3870 } } -func (x codecSelfer1234) encSliceEvent(v []Event, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceContainerPort(v []ContainerPort, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3884 := range v { + for _, yyv3874 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3885 := &yyv3884 - yy3885.CodecEncodeSelf(e) + yy3875 := &yyv3874 + yy3875.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceEvent(v *[]Event, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceContainerPort(v *[]ContainerPort, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3886 := *v - yyh3886, yyl3886 := z.DecSliceHelperStart() - var yyc3886 bool - if yyl3886 == 0 { - if yyv3886 == nil { - yyv3886 = []Event{} - yyc3886 = true - } else if len(yyv3886) != 0 { - yyv3886 = yyv3886[:0] - yyc3886 = true + yyv3876 := *v + yyh3876, yyl3876 := z.DecSliceHelperStart() + var yyc3876 bool + if yyl3876 == 0 { + if yyv3876 == nil { + yyv3876 = []ContainerPort{} + yyc3876 = true + } else if len(yyv3876) != 0 { + yyv3876 = yyv3876[:0] + yyc3876 = true } - } else if yyl3886 > 0 { - var yyrr3886, yyrl3886 int - var yyrt3886 bool - if yyl3886 > cap(yyv3886) { + } else if yyl3876 > 0 { + var yyrr3876, yyrl3876 int + var yyrt3876 bool + if yyl3876 > cap(yyv3876) { - yyrg3886 := len(yyv3886) > 0 - yyv23886 := yyv3886 - yyrl3886, yyrt3886 = z.DecInferLen(yyl3886, z.DecBasicHandle().MaxInitLen, 440) - if yyrt3886 { - if yyrl3886 <= cap(yyv3886) { - yyv3886 = yyv3886[:yyrl3886] + yyrg3876 := len(yyv3876) > 0 + yyv23876 := yyv3876 + yyrl3876, yyrt3876 = z.DecInferLen(yyl3876, z.DecBasicHandle().MaxInitLen, 56) + if yyrt3876 { + if yyrl3876 <= cap(yyv3876) { + yyv3876 = yyv3876[:yyrl3876] } else { - yyv3886 = make([]Event, yyrl3886) + yyv3876 = make([]ContainerPort, yyrl3876) } } else { - yyv3886 = make([]Event, yyrl3886) + yyv3876 = make([]ContainerPort, yyrl3876) } - yyc3886 = true - yyrr3886 = len(yyv3886) - if yyrg3886 { - copy(yyv3886, yyv23886) + yyc3876 = true + yyrr3876 = len(yyv3876) + if yyrg3876 { + copy(yyv3876, yyv23876) } - } else if yyl3886 != len(yyv3886) { - yyv3886 = yyv3886[:yyl3886] - yyc3886 = true + } else if yyl3876 != len(yyv3876) { + yyv3876 = yyv3876[:yyl3876] + yyc3876 = true } - yyj3886 := 0 - for ; yyj3886 < yyrr3886; yyj3886++ { - yyh3886.ElemContainerState(yyj3886) + yyj3876 := 0 + for ; yyj3876 < yyrr3876; yyj3876++ { + yyh3876.ElemContainerState(yyj3876) if r.TryDecodeAsNil() { - yyv3886[yyj3886] = Event{} + yyv3876[yyj3876] = ContainerPort{} } else { - yyv3887 := &yyv3886[yyj3886] - yyv3887.CodecDecodeSelf(d) + yyv3877 := &yyv3876[yyj3876] + yyv3877.CodecDecodeSelf(d) } } - if yyrt3886 { - for ; yyj3886 < yyl3886; yyj3886++ { - yyv3886 = append(yyv3886, Event{}) - yyh3886.ElemContainerState(yyj3886) + if yyrt3876 { + for ; yyj3876 < yyl3876; yyj3876++ { + yyv3876 = append(yyv3876, ContainerPort{}) + yyh3876.ElemContainerState(yyj3876) if r.TryDecodeAsNil() { - yyv3886[yyj3886] = Event{} + yyv3876[yyj3876] = ContainerPort{} } else { - yyv3888 := &yyv3886[yyj3886] - yyv3888.CodecDecodeSelf(d) + yyv3878 := &yyv3876[yyj3876] + yyv3878.CodecDecodeSelf(d) } } } } else { - yyj3886 := 0 - for ; !r.CheckBreak(); yyj3886++ { + yyj3876 := 0 + for ; !r.CheckBreak(); yyj3876++ { - if yyj3886 >= len(yyv3886) { - yyv3886 = append(yyv3886, Event{}) // var yyz3886 Event - yyc3886 = true + if yyj3876 >= len(yyv3876) { + yyv3876 = append(yyv3876, ContainerPort{}) // var yyz3876 ContainerPort + yyc3876 = true } - yyh3886.ElemContainerState(yyj3886) - if yyj3886 < len(yyv3886) { + yyh3876.ElemContainerState(yyj3876) + if yyj3876 < len(yyv3876) { if r.TryDecodeAsNil() { - yyv3886[yyj3886] = Event{} + yyv3876[yyj3876] = ContainerPort{} } else { - yyv3889 := &yyv3886[yyj3886] - yyv3889.CodecDecodeSelf(d) + yyv3879 := &yyv3876[yyj3876] + yyv3879.CodecDecodeSelf(d) } } else { @@ -49471,147 +48606,115 @@ func (x codecSelfer1234) decSliceEvent(v *[]Event, d *codec1978.Decoder) { } } - if yyj3886 < len(yyv3886) { - yyv3886 = yyv3886[:yyj3886] - yyc3886 = true - } else if yyj3886 == 0 && yyv3886 == nil { - yyv3886 = []Event{} - yyc3886 = true + if yyj3876 < len(yyv3876) { + yyv3876 = yyv3876[:yyj3876] + yyc3876 = true + } else if yyj3876 == 0 && yyv3876 == nil { + yyv3876 = []ContainerPort{} + yyc3876 = true } } - yyh3886.End() - if yyc3886 { - *v = yyv3886 + yyh3876.End() + if yyc3876 { + *v = yyv3876 } } -func (x codecSelfer1234) encSliceruntime_RawExtension(v []pkg6_runtime.RawExtension, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceEnvVar(v []EnvVar, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3890 := range v { + for _, yyv3880 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3891 := &yyv3890 - yym3892 := z.EncBinary() - _ = yym3892 - if false { - } else if z.HasExtensions() && z.EncExt(yy3891) { - } else if !yym3892 && z.IsJSONHandle() { - z.EncJSONMarshal(yy3891) - } else { - z.EncFallback(yy3891) - } + yy3881 := &yyv3880 + yy3881.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceruntime_RawExtension(v *[]pkg6_runtime.RawExtension, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceEnvVar(v *[]EnvVar, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3893 := *v - yyh3893, yyl3893 := z.DecSliceHelperStart() - var yyc3893 bool - if yyl3893 == 0 { - if yyv3893 == nil { - yyv3893 = []pkg6_runtime.RawExtension{} - yyc3893 = true - } else if len(yyv3893) != 0 { - yyv3893 = yyv3893[:0] - yyc3893 = true + yyv3882 := *v + yyh3882, yyl3882 := z.DecSliceHelperStart() + var yyc3882 bool + if yyl3882 == 0 { + if yyv3882 == nil { + yyv3882 = []EnvVar{} + yyc3882 = true + } else if len(yyv3882) != 0 { + yyv3882 = yyv3882[:0] + yyc3882 = true } - } else if yyl3893 > 0 { - var yyrr3893, yyrl3893 int - var yyrt3893 bool - if yyl3893 > cap(yyv3893) { + } else if yyl3882 > 0 { + var yyrr3882, yyrl3882 int + var yyrt3882 bool + if yyl3882 > cap(yyv3882) { - yyrg3893 := len(yyv3893) > 0 - yyv23893 := yyv3893 - yyrl3893, yyrt3893 = z.DecInferLen(yyl3893, z.DecBasicHandle().MaxInitLen, 40) - if yyrt3893 { - if yyrl3893 <= cap(yyv3893) { - yyv3893 = yyv3893[:yyrl3893] + yyrg3882 := len(yyv3882) > 0 + yyv23882 := yyv3882 + yyrl3882, yyrt3882 = z.DecInferLen(yyl3882, z.DecBasicHandle().MaxInitLen, 40) + if yyrt3882 { + if yyrl3882 <= cap(yyv3882) { + yyv3882 = yyv3882[:yyrl3882] } else { - yyv3893 = make([]pkg6_runtime.RawExtension, yyrl3893) + yyv3882 = make([]EnvVar, yyrl3882) } } else { - yyv3893 = make([]pkg6_runtime.RawExtension, yyrl3893) + yyv3882 = make([]EnvVar, yyrl3882) } - yyc3893 = true - yyrr3893 = len(yyv3893) - if yyrg3893 { - copy(yyv3893, yyv23893) + yyc3882 = true + yyrr3882 = len(yyv3882) + if yyrg3882 { + copy(yyv3882, yyv23882) } - } else if yyl3893 != len(yyv3893) { - yyv3893 = yyv3893[:yyl3893] - yyc3893 = true + } else if yyl3882 != len(yyv3882) { + yyv3882 = yyv3882[:yyl3882] + yyc3882 = true } - yyj3893 := 0 - for ; yyj3893 < yyrr3893; yyj3893++ { - yyh3893.ElemContainerState(yyj3893) + yyj3882 := 0 + for ; yyj3882 < yyrr3882; yyj3882++ { + yyh3882.ElemContainerState(yyj3882) if r.TryDecodeAsNil() { - yyv3893[yyj3893] = pkg6_runtime.RawExtension{} + yyv3882[yyj3882] = EnvVar{} } else { - yyv3894 := &yyv3893[yyj3893] - yym3895 := z.DecBinary() - _ = yym3895 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3894) { - } else if !yym3895 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3894) - } else { - z.DecFallback(yyv3894, false) - } + yyv3883 := &yyv3882[yyj3882] + yyv3883.CodecDecodeSelf(d) } } - if yyrt3893 { - for ; yyj3893 < yyl3893; yyj3893++ { - yyv3893 = append(yyv3893, pkg6_runtime.RawExtension{}) - yyh3893.ElemContainerState(yyj3893) + if yyrt3882 { + for ; yyj3882 < yyl3882; yyj3882++ { + yyv3882 = append(yyv3882, EnvVar{}) + yyh3882.ElemContainerState(yyj3882) if r.TryDecodeAsNil() { - yyv3893[yyj3893] = pkg6_runtime.RawExtension{} + yyv3882[yyj3882] = EnvVar{} } else { - yyv3896 := &yyv3893[yyj3893] - yym3897 := z.DecBinary() - _ = yym3897 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3896) { - } else if !yym3897 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3896) - } else { - z.DecFallback(yyv3896, false) - } + yyv3884 := &yyv3882[yyj3882] + yyv3884.CodecDecodeSelf(d) } } } } else { - yyj3893 := 0 - for ; !r.CheckBreak(); yyj3893++ { + yyj3882 := 0 + for ; !r.CheckBreak(); yyj3882++ { - if yyj3893 >= len(yyv3893) { - yyv3893 = append(yyv3893, pkg6_runtime.RawExtension{}) // var yyz3893 pkg6_runtime.RawExtension - yyc3893 = true + if yyj3882 >= len(yyv3882) { + yyv3882 = append(yyv3882, EnvVar{}) // var yyz3882 EnvVar + yyc3882 = true } - yyh3893.ElemContainerState(yyj3893) - if yyj3893 < len(yyv3893) { + yyh3882.ElemContainerState(yyj3882) + if yyj3882 < len(yyv3882) { if r.TryDecodeAsNil() { - yyv3893[yyj3893] = pkg6_runtime.RawExtension{} + yyv3882[yyj3882] = EnvVar{} } else { - yyv3898 := &yyv3893[yyj3893] - yym3899 := z.DecBinary() - _ = yym3899 - if false { - } else if z.HasExtensions() && z.DecExt(yyv3898) { - } else if !yym3899 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv3898) - } else { - z.DecFallback(yyv3898, false) - } + yyv3885 := &yyv3882[yyj3882] + yyv3885.CodecDecodeSelf(d) } } else { @@ -49619,115 +48722,115 @@ func (x codecSelfer1234) decSliceruntime_RawExtension(v *[]pkg6_runtime.RawExten } } - if yyj3893 < len(yyv3893) { - yyv3893 = yyv3893[:yyj3893] - yyc3893 = true - } else if yyj3893 == 0 && yyv3893 == nil { - yyv3893 = []pkg6_runtime.RawExtension{} - yyc3893 = true + if yyj3882 < len(yyv3882) { + yyv3882 = yyv3882[:yyj3882] + yyc3882 = true + } else if yyj3882 == 0 && yyv3882 == nil { + yyv3882 = []EnvVar{} + yyc3882 = true } } - yyh3893.End() - if yyc3893 { - *v = yyv3893 + yyh3882.End() + if yyc3882 { + *v = yyv3882 } } -func (x codecSelfer1234) encSliceLimitRangeItem(v []LimitRangeItem, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceVolumeMount(v []VolumeMount, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3900 := range v { + for _, yyv3886 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3901 := &yyv3900 - yy3901.CodecEncodeSelf(e) + yy3887 := &yyv3886 + yy3887.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceLimitRangeItem(v *[]LimitRangeItem, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceVolumeMount(v *[]VolumeMount, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3902 := *v - yyh3902, yyl3902 := z.DecSliceHelperStart() - var yyc3902 bool - if yyl3902 == 0 { - if yyv3902 == nil { - yyv3902 = []LimitRangeItem{} - yyc3902 = true - } else if len(yyv3902) != 0 { - yyv3902 = yyv3902[:0] - yyc3902 = true + yyv3888 := *v + yyh3888, yyl3888 := z.DecSliceHelperStart() + var yyc3888 bool + if yyl3888 == 0 { + if yyv3888 == nil { + yyv3888 = []VolumeMount{} + yyc3888 = true + } else if len(yyv3888) != 0 { + yyv3888 = yyv3888[:0] + yyc3888 = true } - } else if yyl3902 > 0 { - var yyrr3902, yyrl3902 int - var yyrt3902 bool - if yyl3902 > cap(yyv3902) { + } else if yyl3888 > 0 { + var yyrr3888, yyrl3888 int + var yyrt3888 bool + if yyl3888 > cap(yyv3888) { - yyrg3902 := len(yyv3902) > 0 - yyv23902 := yyv3902 - yyrl3902, yyrt3902 = z.DecInferLen(yyl3902, z.DecBasicHandle().MaxInitLen, 56) - if yyrt3902 { - if yyrl3902 <= cap(yyv3902) { - yyv3902 = yyv3902[:yyrl3902] + yyrg3888 := len(yyv3888) > 0 + yyv23888 := yyv3888 + yyrl3888, yyrt3888 = z.DecInferLen(yyl3888, z.DecBasicHandle().MaxInitLen, 40) + if yyrt3888 { + if yyrl3888 <= cap(yyv3888) { + yyv3888 = yyv3888[:yyrl3888] } else { - yyv3902 = make([]LimitRangeItem, yyrl3902) + yyv3888 = make([]VolumeMount, yyrl3888) } } else { - yyv3902 = make([]LimitRangeItem, yyrl3902) + yyv3888 = make([]VolumeMount, yyrl3888) } - yyc3902 = true - yyrr3902 = len(yyv3902) - if yyrg3902 { - copy(yyv3902, yyv23902) + yyc3888 = true + yyrr3888 = len(yyv3888) + if yyrg3888 { + copy(yyv3888, yyv23888) } - } else if yyl3902 != len(yyv3902) { - yyv3902 = yyv3902[:yyl3902] - yyc3902 = true + } else if yyl3888 != len(yyv3888) { + yyv3888 = yyv3888[:yyl3888] + yyc3888 = true } - yyj3902 := 0 - for ; yyj3902 < yyrr3902; yyj3902++ { - yyh3902.ElemContainerState(yyj3902) + yyj3888 := 0 + for ; yyj3888 < yyrr3888; yyj3888++ { + yyh3888.ElemContainerState(yyj3888) if r.TryDecodeAsNil() { - yyv3902[yyj3902] = LimitRangeItem{} + yyv3888[yyj3888] = VolumeMount{} } else { - yyv3903 := &yyv3902[yyj3902] - yyv3903.CodecDecodeSelf(d) + yyv3889 := &yyv3888[yyj3888] + yyv3889.CodecDecodeSelf(d) } } - if yyrt3902 { - for ; yyj3902 < yyl3902; yyj3902++ { - yyv3902 = append(yyv3902, LimitRangeItem{}) - yyh3902.ElemContainerState(yyj3902) + if yyrt3888 { + for ; yyj3888 < yyl3888; yyj3888++ { + yyv3888 = append(yyv3888, VolumeMount{}) + yyh3888.ElemContainerState(yyj3888) if r.TryDecodeAsNil() { - yyv3902[yyj3902] = LimitRangeItem{} + yyv3888[yyj3888] = VolumeMount{} } else { - yyv3904 := &yyv3902[yyj3902] - yyv3904.CodecDecodeSelf(d) + yyv3890 := &yyv3888[yyj3888] + yyv3890.CodecDecodeSelf(d) } } } } else { - yyj3902 := 0 - for ; !r.CheckBreak(); yyj3902++ { + yyj3888 := 0 + for ; !r.CheckBreak(); yyj3888++ { - if yyj3902 >= len(yyv3902) { - yyv3902 = append(yyv3902, LimitRangeItem{}) // var yyz3902 LimitRangeItem - yyc3902 = true + if yyj3888 >= len(yyv3888) { + yyv3888 = append(yyv3888, VolumeMount{}) // var yyz3888 VolumeMount + yyc3888 = true } - yyh3902.ElemContainerState(yyj3902) - if yyj3902 < len(yyv3902) { + yyh3888.ElemContainerState(yyj3888) + if yyj3888 < len(yyv3888) { if r.TryDecodeAsNil() { - yyv3902[yyj3902] = LimitRangeItem{} + yyv3888[yyj3888] = VolumeMount{} } else { - yyv3905 := &yyv3902[yyj3902] - yyv3905.CodecDecodeSelf(d) + yyv3891 := &yyv3888[yyj3888] + yyv3891.CodecDecodeSelf(d) } } else { @@ -49735,115 +48838,115 @@ func (x codecSelfer1234) decSliceLimitRangeItem(v *[]LimitRangeItem, d *codec197 } } - if yyj3902 < len(yyv3902) { - yyv3902 = yyv3902[:yyj3902] - yyc3902 = true - } else if yyj3902 == 0 && yyv3902 == nil { - yyv3902 = []LimitRangeItem{} - yyc3902 = true + if yyj3888 < len(yyv3888) { + yyv3888 = yyv3888[:yyj3888] + yyc3888 = true + } else if yyj3888 == 0 && yyv3888 == nil { + yyv3888 = []VolumeMount{} + yyc3888 = true } } - yyh3902.End() - if yyc3902 { - *v = yyv3902 + yyh3888.End() + if yyc3888 { + *v = yyv3888 } } -func (x codecSelfer1234) encSliceLimitRange(v []LimitRange, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceNodeSelectorTerm(v []NodeSelectorTerm, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3906 := range v { + for _, yyv3892 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3907 := &yyv3906 - yy3907.CodecEncodeSelf(e) + yy3893 := &yyv3892 + yy3893.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceLimitRange(v *[]LimitRange, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceNodeSelectorTerm(v *[]NodeSelectorTerm, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3908 := *v - yyh3908, yyl3908 := z.DecSliceHelperStart() - var yyc3908 bool - if yyl3908 == 0 { - if yyv3908 == nil { - yyv3908 = []LimitRange{} - yyc3908 = true - } else if len(yyv3908) != 0 { - yyv3908 = yyv3908[:0] - yyc3908 = true + yyv3894 := *v + yyh3894, yyl3894 := z.DecSliceHelperStart() + var yyc3894 bool + if yyl3894 == 0 { + if yyv3894 == nil { + yyv3894 = []NodeSelectorTerm{} + yyc3894 = true + } else if len(yyv3894) != 0 { + yyv3894 = yyv3894[:0] + yyc3894 = true } - } else if yyl3908 > 0 { - var yyrr3908, yyrl3908 int - var yyrt3908 bool - if yyl3908 > cap(yyv3908) { + } else if yyl3894 > 0 { + var yyrr3894, yyrl3894 int + var yyrt3894 bool + if yyl3894 > cap(yyv3894) { - yyrg3908 := len(yyv3908) > 0 - yyv23908 := yyv3908 - yyrl3908, yyrt3908 = z.DecInferLen(yyl3908, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3908 { - if yyrl3908 <= cap(yyv3908) { - yyv3908 = yyv3908[:yyrl3908] + yyrg3894 := len(yyv3894) > 0 + yyv23894 := yyv3894 + yyrl3894, yyrt3894 = z.DecInferLen(yyl3894, z.DecBasicHandle().MaxInitLen, 24) + if yyrt3894 { + if yyrl3894 <= cap(yyv3894) { + yyv3894 = yyv3894[:yyrl3894] } else { - yyv3908 = make([]LimitRange, yyrl3908) + yyv3894 = make([]NodeSelectorTerm, yyrl3894) } } else { - yyv3908 = make([]LimitRange, yyrl3908) + yyv3894 = make([]NodeSelectorTerm, yyrl3894) } - yyc3908 = true - yyrr3908 = len(yyv3908) - if yyrg3908 { - copy(yyv3908, yyv23908) + yyc3894 = true + yyrr3894 = len(yyv3894) + if yyrg3894 { + copy(yyv3894, yyv23894) } - } else if yyl3908 != len(yyv3908) { - yyv3908 = yyv3908[:yyl3908] - yyc3908 = true + } else if yyl3894 != len(yyv3894) { + yyv3894 = yyv3894[:yyl3894] + yyc3894 = true } - yyj3908 := 0 - for ; yyj3908 < yyrr3908; yyj3908++ { - yyh3908.ElemContainerState(yyj3908) + yyj3894 := 0 + for ; yyj3894 < yyrr3894; yyj3894++ { + yyh3894.ElemContainerState(yyj3894) if r.TryDecodeAsNil() { - yyv3908[yyj3908] = LimitRange{} + yyv3894[yyj3894] = NodeSelectorTerm{} } else { - yyv3909 := &yyv3908[yyj3908] - yyv3909.CodecDecodeSelf(d) + yyv3895 := &yyv3894[yyj3894] + yyv3895.CodecDecodeSelf(d) } } - if yyrt3908 { - for ; yyj3908 < yyl3908; yyj3908++ { - yyv3908 = append(yyv3908, LimitRange{}) - yyh3908.ElemContainerState(yyj3908) + if yyrt3894 { + for ; yyj3894 < yyl3894; yyj3894++ { + yyv3894 = append(yyv3894, NodeSelectorTerm{}) + yyh3894.ElemContainerState(yyj3894) if r.TryDecodeAsNil() { - yyv3908[yyj3908] = LimitRange{} + yyv3894[yyj3894] = NodeSelectorTerm{} } else { - yyv3910 := &yyv3908[yyj3908] - yyv3910.CodecDecodeSelf(d) + yyv3896 := &yyv3894[yyj3894] + yyv3896.CodecDecodeSelf(d) } } } } else { - yyj3908 := 0 - for ; !r.CheckBreak(); yyj3908++ { + yyj3894 := 0 + for ; !r.CheckBreak(); yyj3894++ { - if yyj3908 >= len(yyv3908) { - yyv3908 = append(yyv3908, LimitRange{}) // var yyz3908 LimitRange - yyc3908 = true + if yyj3894 >= len(yyv3894) { + yyv3894 = append(yyv3894, NodeSelectorTerm{}) // var yyz3894 NodeSelectorTerm + yyc3894 = true } - yyh3908.ElemContainerState(yyj3908) - if yyj3908 < len(yyv3908) { + yyh3894.ElemContainerState(yyj3894) + if yyj3894 < len(yyv3894) { if r.TryDecodeAsNil() { - yyv3908[yyj3908] = LimitRange{} + yyv3894[yyj3894] = NodeSelectorTerm{} } else { - yyv3911 := &yyv3908[yyj3908] - yyv3911.CodecDecodeSelf(d) + yyv3897 := &yyv3894[yyj3894] + yyv3897.CodecDecodeSelf(d) } } else { @@ -49851,115 +48954,115 @@ func (x codecSelfer1234) decSliceLimitRange(v *[]LimitRange, d *codec1978.Decode } } - if yyj3908 < len(yyv3908) { - yyv3908 = yyv3908[:yyj3908] - yyc3908 = true - } else if yyj3908 == 0 && yyv3908 == nil { - yyv3908 = []LimitRange{} - yyc3908 = true + if yyj3894 < len(yyv3894) { + yyv3894 = yyv3894[:yyj3894] + yyc3894 = true + } else if yyj3894 == 0 && yyv3894 == nil { + yyv3894 = []NodeSelectorTerm{} + yyc3894 = true } } - yyh3908.End() - if yyc3908 { - *v = yyv3908 + yyh3894.End() + if yyc3894 { + *v = yyv3894 } } -func (x codecSelfer1234) encSliceResourceQuota(v []ResourceQuota, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceNodeSelectorRequirement(v []NodeSelectorRequirement, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv3912 := range v { + for _, yyv3898 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy3913 := &yyv3912 - yy3913.CodecEncodeSelf(e) + yy3899 := &yyv3898 + yy3899.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceResourceQuota(v *[]ResourceQuota, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceNodeSelectorRequirement(v *[]NodeSelectorRequirement, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3914 := *v - yyh3914, yyl3914 := z.DecSliceHelperStart() - var yyc3914 bool - if yyl3914 == 0 { - if yyv3914 == nil { - yyv3914 = []ResourceQuota{} - yyc3914 = true - } else if len(yyv3914) != 0 { - yyv3914 = yyv3914[:0] - yyc3914 = true + yyv3900 := *v + yyh3900, yyl3900 := z.DecSliceHelperStart() + var yyc3900 bool + if yyl3900 == 0 { + if yyv3900 == nil { + yyv3900 = []NodeSelectorRequirement{} + yyc3900 = true + } else if len(yyv3900) != 0 { + yyv3900 = yyv3900[:0] + yyc3900 = true } - } else if yyl3914 > 0 { - var yyrr3914, yyrl3914 int - var yyrt3914 bool - if yyl3914 > cap(yyv3914) { + } else if yyl3900 > 0 { + var yyrr3900, yyrl3900 int + var yyrt3900 bool + if yyl3900 > cap(yyv3900) { - yyrg3914 := len(yyv3914) > 0 - yyv23914 := yyv3914 - yyrl3914, yyrt3914 = z.DecInferLen(yyl3914, z.DecBasicHandle().MaxInitLen, 216) - if yyrt3914 { - if yyrl3914 <= cap(yyv3914) { - yyv3914 = yyv3914[:yyrl3914] + yyrg3900 := len(yyv3900) > 0 + yyv23900 := yyv3900 + yyrl3900, yyrt3900 = z.DecInferLen(yyl3900, z.DecBasicHandle().MaxInitLen, 56) + if yyrt3900 { + if yyrl3900 <= cap(yyv3900) { + yyv3900 = yyv3900[:yyrl3900] } else { - yyv3914 = make([]ResourceQuota, yyrl3914) + yyv3900 = make([]NodeSelectorRequirement, yyrl3900) } } else { - yyv3914 = make([]ResourceQuota, yyrl3914) + yyv3900 = make([]NodeSelectorRequirement, yyrl3900) } - yyc3914 = true - yyrr3914 = len(yyv3914) - if yyrg3914 { - copy(yyv3914, yyv23914) + yyc3900 = true + yyrr3900 = len(yyv3900) + if yyrg3900 { + copy(yyv3900, yyv23900) } - } else if yyl3914 != len(yyv3914) { - yyv3914 = yyv3914[:yyl3914] - yyc3914 = true + } else if yyl3900 != len(yyv3900) { + yyv3900 = yyv3900[:yyl3900] + yyc3900 = true } - yyj3914 := 0 - for ; yyj3914 < yyrr3914; yyj3914++ { - yyh3914.ElemContainerState(yyj3914) + yyj3900 := 0 + for ; yyj3900 < yyrr3900; yyj3900++ { + yyh3900.ElemContainerState(yyj3900) if r.TryDecodeAsNil() { - yyv3914[yyj3914] = ResourceQuota{} + yyv3900[yyj3900] = NodeSelectorRequirement{} } else { - yyv3915 := &yyv3914[yyj3914] - yyv3915.CodecDecodeSelf(d) + yyv3901 := &yyv3900[yyj3900] + yyv3901.CodecDecodeSelf(d) } } - if yyrt3914 { - for ; yyj3914 < yyl3914; yyj3914++ { - yyv3914 = append(yyv3914, ResourceQuota{}) - yyh3914.ElemContainerState(yyj3914) + if yyrt3900 { + for ; yyj3900 < yyl3900; yyj3900++ { + yyv3900 = append(yyv3900, NodeSelectorRequirement{}) + yyh3900.ElemContainerState(yyj3900) if r.TryDecodeAsNil() { - yyv3914[yyj3914] = ResourceQuota{} + yyv3900[yyj3900] = NodeSelectorRequirement{} } else { - yyv3916 := &yyv3914[yyj3914] - yyv3916.CodecDecodeSelf(d) + yyv3902 := &yyv3900[yyj3900] + yyv3902.CodecDecodeSelf(d) } } } } else { - yyj3914 := 0 - for ; !r.CheckBreak(); yyj3914++ { + yyj3900 := 0 + for ; !r.CheckBreak(); yyj3900++ { - if yyj3914 >= len(yyv3914) { - yyv3914 = append(yyv3914, ResourceQuota{}) // var yyz3914 ResourceQuota - yyc3914 = true + if yyj3900 >= len(yyv3900) { + yyv3900 = append(yyv3900, NodeSelectorRequirement{}) // var yyz3900 NodeSelectorRequirement + yyc3900 = true } - yyh3914.ElemContainerState(yyj3914) - if yyj3914 < len(yyv3914) { + yyh3900.ElemContainerState(yyj3900) + if yyj3900 < len(yyv3900) { if r.TryDecodeAsNil() { - yyv3914[yyj3914] = ResourceQuota{} + yyv3900[yyj3900] = NodeSelectorRequirement{} } else { - yyv3917 := &yyv3914[yyj3914] - yyv3917.CodecDecodeSelf(d) + yyv3903 := &yyv3900[yyj3900] + yyv3903.CodecDecodeSelf(d) } } else { @@ -49967,134 +49070,485 @@ func (x codecSelfer1234) decSliceResourceQuota(v *[]ResourceQuota, d *codec1978. } } - if yyj3914 < len(yyv3914) { - yyv3914 = yyv3914[:yyj3914] - yyc3914 = true - } else if yyj3914 == 0 && yyv3914 == nil { - yyv3914 = []ResourceQuota{} - yyc3914 = true + if yyj3900 < len(yyv3900) { + yyv3900 = yyv3900[:yyj3900] + yyc3900 = true + } else if yyj3900 == 0 && yyv3900 == nil { + yyv3900 = []NodeSelectorRequirement{} + yyc3900 = true } } - yyh3914.End() - if yyc3914 { - *v = yyv3914 + yyh3900.End() + if yyc3900 { + *v = yyv3900 } } -func (x codecSelfer1234) encMapstringSliceuint8(v map[string][]uint8, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePreferredSchedulingTerm(v []PreferredSchedulingTerm, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk3918, yyv3918 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - yym3919 := z.EncBinary() - _ = yym3919 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(yyk3918)) + r.EncodeArrayStart(len(v)) + for _, yyv3904 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3905 := &yyv3904 + yy3905.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePreferredSchedulingTerm(v *[]PreferredSchedulingTerm, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3906 := *v + yyh3906, yyl3906 := z.DecSliceHelperStart() + var yyc3906 bool + if yyl3906 == 0 { + if yyv3906 == nil { + yyv3906 = []PreferredSchedulingTerm{} + yyc3906 = true + } else if len(yyv3906) != 0 { + yyv3906 = yyv3906[:0] + yyc3906 = true } - z.EncSendContainerState(codecSelfer_containerMapValue1234) + } else if yyl3906 > 0 { + var yyrr3906, yyrl3906 int + var yyrt3906 bool + if yyl3906 > cap(yyv3906) { + + yyrg3906 := len(yyv3906) > 0 + yyv23906 := yyv3906 + yyrl3906, yyrt3906 = z.DecInferLen(yyl3906, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3906 { + if yyrl3906 <= cap(yyv3906) { + yyv3906 = yyv3906[:yyrl3906] + } else { + yyv3906 = make([]PreferredSchedulingTerm, yyrl3906) + } + } else { + yyv3906 = make([]PreferredSchedulingTerm, yyrl3906) + } + yyc3906 = true + yyrr3906 = len(yyv3906) + if yyrg3906 { + copy(yyv3906, yyv23906) + } + } else if yyl3906 != len(yyv3906) { + yyv3906 = yyv3906[:yyl3906] + yyc3906 = true + } + yyj3906 := 0 + for ; yyj3906 < yyrr3906; yyj3906++ { + yyh3906.ElemContainerState(yyj3906) + if r.TryDecodeAsNil() { + yyv3906[yyj3906] = PreferredSchedulingTerm{} + } else { + yyv3907 := &yyv3906[yyj3906] + yyv3907.CodecDecodeSelf(d) + } + + } + if yyrt3906 { + for ; yyj3906 < yyl3906; yyj3906++ { + yyv3906 = append(yyv3906, PreferredSchedulingTerm{}) + yyh3906.ElemContainerState(yyj3906) + if r.TryDecodeAsNil() { + yyv3906[yyj3906] = PreferredSchedulingTerm{} + } else { + yyv3908 := &yyv3906[yyj3906] + yyv3908.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3906 := 0 + for ; !r.CheckBreak(); yyj3906++ { + + if yyj3906 >= len(yyv3906) { + yyv3906 = append(yyv3906, PreferredSchedulingTerm{}) // var yyz3906 PreferredSchedulingTerm + yyc3906 = true + } + yyh3906.ElemContainerState(yyj3906) + if yyj3906 < len(yyv3906) { + if r.TryDecodeAsNil() { + yyv3906[yyj3906] = PreferredSchedulingTerm{} + } else { + yyv3909 := &yyv3906[yyj3906] + yyv3909.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3906 < len(yyv3906) { + yyv3906 = yyv3906[:yyj3906] + yyc3906 = true + } else if yyj3906 == 0 && yyv3906 == nil { + yyv3906 = []PreferredSchedulingTerm{} + yyc3906 = true + } + } + yyh3906.End() + if yyc3906 { + *v = yyv3906 + } +} + +func (x codecSelfer1234) encSliceVolume(v []Volume, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3910 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3911 := &yyv3910 + yy3911.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceVolume(v *[]Volume, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3912 := *v + yyh3912, yyl3912 := z.DecSliceHelperStart() + var yyc3912 bool + if yyl3912 == 0 { + if yyv3912 == nil { + yyv3912 = []Volume{} + yyc3912 = true + } else if len(yyv3912) != 0 { + yyv3912 = yyv3912[:0] + yyc3912 = true + } + } else if yyl3912 > 0 { + var yyrr3912, yyrl3912 int + var yyrt3912 bool + if yyl3912 > cap(yyv3912) { + + yyrg3912 := len(yyv3912) > 0 + yyv23912 := yyv3912 + yyrl3912, yyrt3912 = z.DecInferLen(yyl3912, z.DecBasicHandle().MaxInitLen, 160) + if yyrt3912 { + if yyrl3912 <= cap(yyv3912) { + yyv3912 = yyv3912[:yyrl3912] + } else { + yyv3912 = make([]Volume, yyrl3912) + } + } else { + yyv3912 = make([]Volume, yyrl3912) + } + yyc3912 = true + yyrr3912 = len(yyv3912) + if yyrg3912 { + copy(yyv3912, yyv23912) + } + } else if yyl3912 != len(yyv3912) { + yyv3912 = yyv3912[:yyl3912] + yyc3912 = true + } + yyj3912 := 0 + for ; yyj3912 < yyrr3912; yyj3912++ { + yyh3912.ElemContainerState(yyj3912) + if r.TryDecodeAsNil() { + yyv3912[yyj3912] = Volume{} + } else { + yyv3913 := &yyv3912[yyj3912] + yyv3913.CodecDecodeSelf(d) + } + + } + if yyrt3912 { + for ; yyj3912 < yyl3912; yyj3912++ { + yyv3912 = append(yyv3912, Volume{}) + yyh3912.ElemContainerState(yyj3912) + if r.TryDecodeAsNil() { + yyv3912[yyj3912] = Volume{} + } else { + yyv3914 := &yyv3912[yyj3912] + yyv3914.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3912 := 0 + for ; !r.CheckBreak(); yyj3912++ { + + if yyj3912 >= len(yyv3912) { + yyv3912 = append(yyv3912, Volume{}) // var yyz3912 Volume + yyc3912 = true + } + yyh3912.ElemContainerState(yyj3912) + if yyj3912 < len(yyv3912) { + if r.TryDecodeAsNil() { + yyv3912[yyj3912] = Volume{} + } else { + yyv3915 := &yyv3912[yyj3912] + yyv3915.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3912 < len(yyv3912) { + yyv3912 = yyv3912[:yyj3912] + yyc3912 = true + } else if yyj3912 == 0 && yyv3912 == nil { + yyv3912 = []Volume{} + yyc3912 = true + } + } + yyh3912.End() + if yyc3912 { + *v = yyv3912 + } +} + +func (x codecSelfer1234) encSliceContainer(v []Container, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3916 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3917 := &yyv3916 + yy3917.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainer(v *[]Container, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3918 := *v + yyh3918, yyl3918 := z.DecSliceHelperStart() + var yyc3918 bool + if yyl3918 == 0 { if yyv3918 == nil { - r.EncodeNil() - } else { - yym3920 := z.EncBinary() - _ = yym3920 - if false { + yyv3918 = []Container{} + yyc3918 = true + } else if len(yyv3918) != 0 { + yyv3918 = yyv3918[:0] + yyc3918 = true + } + } else if yyl3918 > 0 { + var yyrr3918, yyrl3918 int + var yyrt3918 bool + if yyl3918 > cap(yyv3918) { + + yyrg3918 := len(yyv3918) > 0 + yyv23918 := yyv3918 + yyrl3918, yyrt3918 = z.DecInferLen(yyl3918, z.DecBasicHandle().MaxInitLen, 256) + if yyrt3918 { + if yyrl3918 <= cap(yyv3918) { + yyv3918 = yyv3918[:yyrl3918] + } else { + yyv3918 = make([]Container, yyrl3918) + } } else { - r.EncodeStringBytes(codecSelferC_RAW1234, []byte(yyv3918)) + yyv3918 = make([]Container, yyrl3918) + } + yyc3918 = true + yyrr3918 = len(yyv3918) + if yyrg3918 { + copy(yyv3918, yyv23918) + } + } else if yyl3918 != len(yyv3918) { + yyv3918 = yyv3918[:yyl3918] + yyc3918 = true + } + yyj3918 := 0 + for ; yyj3918 < yyrr3918; yyj3918++ { + yyh3918.ElemContainerState(yyj3918) + if r.TryDecodeAsNil() { + yyv3918[yyj3918] = Container{} + } else { + yyv3919 := &yyv3918[yyj3918] + yyv3919.CodecDecodeSelf(d) + } + + } + if yyrt3918 { + for ; yyj3918 < yyl3918; yyj3918++ { + yyv3918 = append(yyv3918, Container{}) + yyh3918.ElemContainerState(yyj3918) + if r.TryDecodeAsNil() { + yyv3918[yyj3918] = Container{} + } else { + yyv3920 := &yyv3918[yyj3918] + yyv3920.CodecDecodeSelf(d) + } + } } + + } else { + yyj3918 := 0 + for ; !r.CheckBreak(); yyj3918++ { + + if yyj3918 >= len(yyv3918) { + yyv3918 = append(yyv3918, Container{}) // var yyz3918 Container + yyc3918 = true + } + yyh3918.ElemContainerState(yyj3918) + if yyj3918 < len(yyv3918) { + if r.TryDecodeAsNil() { + yyv3918[yyj3918] = Container{} + } else { + yyv3921 := &yyv3918[yyj3918] + yyv3921.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3918 < len(yyv3918) { + yyv3918 = yyv3918[:yyj3918] + yyc3918 = true + } else if yyj3918 == 0 && yyv3918 == nil { + yyv3918 = []Container{} + yyc3918 = true + } + } + yyh3918.End() + if yyc3918 { + *v = yyv3918 } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) } -func (x codecSelfer1234) decMapstringSliceuint8(v *map[string][]uint8, d *codec1978.Decoder) { +func (x codecSelfer1234) encSliceLocalObjectReference(v []LocalObjectReference, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3922 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3923 := &yyv3922 + yy3923.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLocalObjectReference(v *[]LocalObjectReference, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv3921 := *v - yyl3921 := r.ReadMapStart() - yybh3921 := z.DecBasicHandle() - if yyv3921 == nil { - yyrl3921, _ := z.DecInferLen(yyl3921, yybh3921.MaxInitLen, 40) - yyv3921 = make(map[string][]uint8, yyrl3921) - *v = yyv3921 - } - var yymk3921 string - var yymv3921 []uint8 - var yymg3921 bool - if yybh3921.MapValueReset { - yymg3921 = true - } - if yyl3921 > 0 { - for yyj3921 := 0; yyj3921 < yyl3921; yyj3921++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk3921 = "" - } else { - yymk3921 = string(r.DecodeString()) - } + yyv3924 := *v + yyh3924, yyl3924 := z.DecSliceHelperStart() + var yyc3924 bool + if yyl3924 == 0 { + if yyv3924 == nil { + yyv3924 = []LocalObjectReference{} + yyc3924 = true + } else if len(yyv3924) != 0 { + yyv3924 = yyv3924[:0] + yyc3924 = true + } + } else if yyl3924 > 0 { + var yyrr3924, yyrl3924 int + var yyrt3924 bool + if yyl3924 > cap(yyv3924) { - if yymg3921 { - yymv3921 = yyv3921[yymk3921] - } else { - yymv3921 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv3921 = nil - } else { - yyv3923 := &yymv3921 - yym3924 := z.DecBinary() - _ = yym3924 - if false { + yyrg3924 := len(yyv3924) > 0 + yyv23924 := yyv3924 + yyrl3924, yyrt3924 = z.DecInferLen(yyl3924, z.DecBasicHandle().MaxInitLen, 16) + if yyrt3924 { + if yyrl3924 <= cap(yyv3924) { + yyv3924 = yyv3924[:yyrl3924] } else { - *yyv3923 = r.DecodeBytes(*(*[]byte)(yyv3923), false, false) + yyv3924 = make([]LocalObjectReference, yyrl3924) } + } else { + yyv3924 = make([]LocalObjectReference, yyrl3924) + } + yyc3924 = true + yyrr3924 = len(yyv3924) + if yyrg3924 { + copy(yyv3924, yyv23924) + } + } else if yyl3924 != len(yyv3924) { + yyv3924 = yyv3924[:yyl3924] + yyc3924 = true + } + yyj3924 := 0 + for ; yyj3924 < yyrr3924; yyj3924++ { + yyh3924.ElemContainerState(yyj3924) + if r.TryDecodeAsNil() { + yyv3924[yyj3924] = LocalObjectReference{} + } else { + yyv3925 := &yyv3924[yyj3924] + yyv3925.CodecDecodeSelf(d) } - if yyv3921 != nil { - yyv3921[yymk3921] = yymv3921 + } + if yyrt3924 { + for ; yyj3924 < yyl3924; yyj3924++ { + yyv3924 = append(yyv3924, LocalObjectReference{}) + yyh3924.ElemContainerState(yyj3924) + if r.TryDecodeAsNil() { + yyv3924[yyj3924] = LocalObjectReference{} + } else { + yyv3926 := &yyv3924[yyj3924] + yyv3926.CodecDecodeSelf(d) + } + } } - } else if yyl3921 < 0 { - for yyj3921 := 0; !r.CheckBreak(); yyj3921++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk3921 = "" - } else { - yymk3921 = string(r.DecodeString()) - } - if yymg3921 { - yymv3921 = yyv3921[yymk3921] - } else { - yymv3921 = nil + } else { + yyj3924 := 0 + for ; !r.CheckBreak(); yyj3924++ { + + if yyj3924 >= len(yyv3924) { + yyv3924 = append(yyv3924, LocalObjectReference{}) // var yyz3924 LocalObjectReference + yyc3924 = true } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv3921 = nil - } else { - yyv3926 := &yymv3921 - yym3927 := z.DecBinary() - _ = yym3927 - if false { + yyh3924.ElemContainerState(yyj3924) + if yyj3924 < len(yyv3924) { + if r.TryDecodeAsNil() { + yyv3924[yyj3924] = LocalObjectReference{} } else { - *yyv3926 = r.DecodeBytes(*(*[]byte)(yyv3926), false, false) + yyv3927 := &yyv3924[yyj3924] + yyv3927.CodecDecodeSelf(d) } + + } else { + z.DecSwallow() } - if yyv3921 != nil { - yyv3921[yymk3921] = yymv3921 - } } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) + if yyj3924 < len(yyv3924) { + yyv3924 = yyv3924[:yyj3924] + yyc3924 = true + } else if yyj3924 == 0 && yyv3924 == nil { + yyv3924 = []LocalObjectReference{} + yyc3924 = true + } + } + yyh3924.End() + if yyc3924 { + *v = yyv3924 + } } -func (x codecSelfer1234) encSliceSecret(v []Secret, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePodCondition(v []PodCondition, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -50107,7 +49561,7 @@ func (x codecSelfer1234) encSliceSecret(v []Secret, e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePodCondition(v *[]PodCondition, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -50117,7 +49571,7 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { var yyc3930 bool if yyl3930 == 0 { if yyv3930 == nil { - yyv3930 = []Secret{} + yyv3930 = []PodCondition{} yyc3930 = true } else if len(yyv3930) != 0 { yyv3930 = yyv3930[:0] @@ -50130,15 +49584,15 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { yyrg3930 := len(yyv3930) > 0 yyv23930 := yyv3930 - yyrl3930, yyrt3930 = z.DecInferLen(yyl3930, z.DecBasicHandle().MaxInitLen, 216) + yyrl3930, yyrt3930 = z.DecInferLen(yyl3930, z.DecBasicHandle().MaxInitLen, 112) if yyrt3930 { if yyrl3930 <= cap(yyv3930) { yyv3930 = yyv3930[:yyrl3930] } else { - yyv3930 = make([]Secret, yyrl3930) + yyv3930 = make([]PodCondition, yyrl3930) } } else { - yyv3930 = make([]Secret, yyrl3930) + yyv3930 = make([]PodCondition, yyrl3930) } yyc3930 = true yyrr3930 = len(yyv3930) @@ -50153,7 +49607,7 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { for ; yyj3930 < yyrr3930; yyj3930++ { yyh3930.ElemContainerState(yyj3930) if r.TryDecodeAsNil() { - yyv3930[yyj3930] = Secret{} + yyv3930[yyj3930] = PodCondition{} } else { yyv3931 := &yyv3930[yyj3930] yyv3931.CodecDecodeSelf(d) @@ -50162,10 +49616,10 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { } if yyrt3930 { for ; yyj3930 < yyl3930; yyj3930++ { - yyv3930 = append(yyv3930, Secret{}) + yyv3930 = append(yyv3930, PodCondition{}) yyh3930.ElemContainerState(yyj3930) if r.TryDecodeAsNil() { - yyv3930[yyj3930] = Secret{} + yyv3930[yyj3930] = PodCondition{} } else { yyv3932 := &yyv3930[yyj3930] yyv3932.CodecDecodeSelf(d) @@ -50179,13 +49633,13 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { for ; !r.CheckBreak(); yyj3930++ { if yyj3930 >= len(yyv3930) { - yyv3930 = append(yyv3930, Secret{}) // var yyz3930 Secret + yyv3930 = append(yyv3930, PodCondition{}) // var yyz3930 PodCondition yyc3930 = true } yyh3930.ElemContainerState(yyj3930) if yyj3930 < len(yyv3930) { if r.TryDecodeAsNil() { - yyv3930[yyj3930] = Secret{} + yyv3930[yyj3930] = PodCondition{} } else { yyv3933 := &yyv3930[yyj3930] yyv3933.CodecDecodeSelf(d) @@ -50200,7 +49654,7 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { yyv3930 = yyv3930[:yyj3930] yyc3930 = true } else if yyj3930 == 0 && yyv3930 == nil { - yyv3930 = []Secret{} + yyv3930 = []PodCondition{} yyc3930 = true } } @@ -50210,7 +49664,7 @@ func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { } } -func (x codecSelfer1234) encSliceConfigMap(v []ConfigMap, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceContainerStatus(v []ContainerStatus, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -50223,7 +49677,7 @@ func (x codecSelfer1234) encSliceConfigMap(v []ConfigMap, e *codec1978.Encoder) z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceContainerStatus(v *[]ContainerStatus, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -50233,7 +49687,7 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) var yyc3936 bool if yyl3936 == 0 { if yyv3936 == nil { - yyv3936 = []ConfigMap{} + yyv3936 = []ContainerStatus{} yyc3936 = true } else if len(yyv3936) != 0 { yyv3936 = yyv3936[:0] @@ -50246,15 +49700,15 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) yyrg3936 := len(yyv3936) > 0 yyv23936 := yyv3936 - yyrl3936, yyrt3936 = z.DecInferLen(yyl3936, z.DecBasicHandle().MaxInitLen, 200) + yyrl3936, yyrt3936 = z.DecInferLen(yyl3936, z.DecBasicHandle().MaxInitLen, 120) if yyrt3936 { if yyrl3936 <= cap(yyv3936) { yyv3936 = yyv3936[:yyrl3936] } else { - yyv3936 = make([]ConfigMap, yyrl3936) + yyv3936 = make([]ContainerStatus, yyrl3936) } } else { - yyv3936 = make([]ConfigMap, yyrl3936) + yyv3936 = make([]ContainerStatus, yyrl3936) } yyc3936 = true yyrr3936 = len(yyv3936) @@ -50269,7 +49723,7 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) for ; yyj3936 < yyrr3936; yyj3936++ { yyh3936.ElemContainerState(yyj3936) if r.TryDecodeAsNil() { - yyv3936[yyj3936] = ConfigMap{} + yyv3936[yyj3936] = ContainerStatus{} } else { yyv3937 := &yyv3936[yyj3936] yyv3937.CodecDecodeSelf(d) @@ -50278,10 +49732,10 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) } if yyrt3936 { for ; yyj3936 < yyl3936; yyj3936++ { - yyv3936 = append(yyv3936, ConfigMap{}) + yyv3936 = append(yyv3936, ContainerStatus{}) yyh3936.ElemContainerState(yyj3936) if r.TryDecodeAsNil() { - yyv3936[yyj3936] = ConfigMap{} + yyv3936[yyj3936] = ContainerStatus{} } else { yyv3938 := &yyv3936[yyj3936] yyv3938.CodecDecodeSelf(d) @@ -50295,13 +49749,13 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) for ; !r.CheckBreak(); yyj3936++ { if yyj3936 >= len(yyv3936) { - yyv3936 = append(yyv3936, ConfigMap{}) // var yyz3936 ConfigMap + yyv3936 = append(yyv3936, ContainerStatus{}) // var yyz3936 ContainerStatus yyc3936 = true } yyh3936.ElemContainerState(yyj3936) if yyj3936 < len(yyv3936) { if r.TryDecodeAsNil() { - yyv3936[yyj3936] = ConfigMap{} + yyv3936[yyj3936] = ContainerStatus{} } else { yyv3939 := &yyv3936[yyj3936] yyv3939.CodecDecodeSelf(d) @@ -50316,7 +49770,7 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) yyv3936 = yyv3936[:yyj3936] yyc3936 = true } else if yyj3936 == 0 && yyv3936 == nil { - yyv3936 = []ConfigMap{} + yyv3936 = []ContainerStatus{} yyc3936 = true } } @@ -50326,7 +49780,7 @@ func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) } } -func (x codecSelfer1234) encSliceComponentCondition(v []ComponentCondition, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePod(v []Pod, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -50339,7 +49793,7 @@ func (x codecSelfer1234) encSliceComponentCondition(v []ComponentCondition, e *c z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePod(v *[]Pod, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -50349,7 +49803,7 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * var yyc3942 bool if yyl3942 == 0 { if yyv3942 == nil { - yyv3942 = []ComponentCondition{} + yyv3942 = []Pod{} yyc3942 = true } else if len(yyv3942) != 0 { yyv3942 = yyv3942[:0] @@ -50362,15 +49816,15 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * yyrg3942 := len(yyv3942) > 0 yyv23942 := yyv3942 - yyrl3942, yyrt3942 = z.DecInferLen(yyl3942, z.DecBasicHandle().MaxInitLen, 64) + yyrl3942, yyrt3942 = z.DecInferLen(yyl3942, z.DecBasicHandle().MaxInitLen, 520) if yyrt3942 { if yyrl3942 <= cap(yyv3942) { yyv3942 = yyv3942[:yyrl3942] } else { - yyv3942 = make([]ComponentCondition, yyrl3942) + yyv3942 = make([]Pod, yyrl3942) } } else { - yyv3942 = make([]ComponentCondition, yyrl3942) + yyv3942 = make([]Pod, yyrl3942) } yyc3942 = true yyrr3942 = len(yyv3942) @@ -50385,7 +49839,7 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * for ; yyj3942 < yyrr3942; yyj3942++ { yyh3942.ElemContainerState(yyj3942) if r.TryDecodeAsNil() { - yyv3942[yyj3942] = ComponentCondition{} + yyv3942[yyj3942] = Pod{} } else { yyv3943 := &yyv3942[yyj3942] yyv3943.CodecDecodeSelf(d) @@ -50394,10 +49848,10 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * } if yyrt3942 { for ; yyj3942 < yyl3942; yyj3942++ { - yyv3942 = append(yyv3942, ComponentCondition{}) + yyv3942 = append(yyv3942, Pod{}) yyh3942.ElemContainerState(yyj3942) if r.TryDecodeAsNil() { - yyv3942[yyj3942] = ComponentCondition{} + yyv3942[yyj3942] = Pod{} } else { yyv3944 := &yyv3942[yyj3942] yyv3944.CodecDecodeSelf(d) @@ -50411,13 +49865,13 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * for ; !r.CheckBreak(); yyj3942++ { if yyj3942 >= len(yyv3942) { - yyv3942 = append(yyv3942, ComponentCondition{}) // var yyz3942 ComponentCondition + yyv3942 = append(yyv3942, Pod{}) // var yyz3942 Pod yyc3942 = true } yyh3942.ElemContainerState(yyj3942) if yyj3942 < len(yyv3942) { if r.TryDecodeAsNil() { - yyv3942[yyj3942] = ComponentCondition{} + yyv3942[yyj3942] = Pod{} } else { yyv3945 := &yyv3942[yyj3942] yyv3945.CodecDecodeSelf(d) @@ -50432,7 +49886,7 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * yyv3942 = yyv3942[:yyj3942] yyc3942 = true } else if yyj3942 == 0 && yyv3942 == nil { - yyv3942 = []ComponentCondition{} + yyv3942 = []Pod{} yyc3942 = true } } @@ -50442,7 +49896,7 @@ func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d * } } -func (x codecSelfer1234) encSliceComponentStatus(v []ComponentStatus, e *codec1978.Encoder) { +func (x codecSelfer1234) encSlicePodTemplate(v []PodTemplate, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -50455,7 +49909,7 @@ func (x codecSelfer1234) encSliceComponentStatus(v []ComponentStatus, e *codec19 z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1978.Decoder) { +func (x codecSelfer1234) decSlicePodTemplate(v *[]PodTemplate, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -50465,7 +49919,7 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 var yyc3948 bool if yyl3948 == 0 { if yyv3948 == nil { - yyv3948 = []ComponentStatus{} + yyv3948 = []PodTemplate{} yyc3948 = true } else if len(yyv3948) != 0 { yyv3948 = yyv3948[:0] @@ -50478,15 +49932,15 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 yyrg3948 := len(yyv3948) > 0 yyv23948 := yyv3948 - yyrl3948, yyrt3948 = z.DecInferLen(yyl3948, z.DecBasicHandle().MaxInitLen, 216) + yyrl3948, yyrt3948 = z.DecInferLen(yyl3948, z.DecBasicHandle().MaxInitLen, 544) if yyrt3948 { if yyrl3948 <= cap(yyv3948) { yyv3948 = yyv3948[:yyrl3948] } else { - yyv3948 = make([]ComponentStatus, yyrl3948) + yyv3948 = make([]PodTemplate, yyrl3948) } } else { - yyv3948 = make([]ComponentStatus, yyrl3948) + yyv3948 = make([]PodTemplate, yyrl3948) } yyc3948 = true yyrr3948 = len(yyv3948) @@ -50501,7 +49955,7 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 for ; yyj3948 < yyrr3948; yyj3948++ { yyh3948.ElemContainerState(yyj3948) if r.TryDecodeAsNil() { - yyv3948[yyj3948] = ComponentStatus{} + yyv3948[yyj3948] = PodTemplate{} } else { yyv3949 := &yyv3948[yyj3948] yyv3949.CodecDecodeSelf(d) @@ -50510,10 +49964,10 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 } if yyrt3948 { for ; yyj3948 < yyl3948; yyj3948++ { - yyv3948 = append(yyv3948, ComponentStatus{}) + yyv3948 = append(yyv3948, PodTemplate{}) yyh3948.ElemContainerState(yyj3948) if r.TryDecodeAsNil() { - yyv3948[yyj3948] = ComponentStatus{} + yyv3948[yyj3948] = PodTemplate{} } else { yyv3950 := &yyv3948[yyj3948] yyv3950.CodecDecodeSelf(d) @@ -50527,13 +49981,13 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 for ; !r.CheckBreak(); yyj3948++ { if yyj3948 >= len(yyv3948) { - yyv3948 = append(yyv3948, ComponentStatus{}) // var yyz3948 ComponentStatus + yyv3948 = append(yyv3948, PodTemplate{}) // var yyz3948 PodTemplate yyc3948 = true } yyh3948.ElemContainerState(yyj3948) if yyj3948 < len(yyv3948) { if r.TryDecodeAsNil() { - yyv3948[yyj3948] = ComponentStatus{} + yyv3948[yyj3948] = PodTemplate{} } else { yyv3951 := &yyv3948[yyj3948] yyv3951.CodecDecodeSelf(d) @@ -50548,7 +50002,7 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 yyv3948 = yyv3948[:yyj3948] yyc3948 = true } else if yyj3948 == 0 && yyv3948 == nil { - yyv3948 = []ComponentStatus{} + yyv3948 = []PodTemplate{} yyc3948 = true } } @@ -50558,7 +50012,7 @@ func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1 } } -func (x codecSelfer1234) encSliceDownwardAPIVolumeFile(v []DownwardAPIVolumeFile, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceReplicationController(v []ReplicationController, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -50571,7 +50025,7 @@ func (x codecSelfer1234) encSliceDownwardAPIVolumeFile(v []DownwardAPIVolumeFile z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFile, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceReplicationController(v *[]ReplicationController, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -50581,7 +50035,7 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil var yyc3954 bool if yyl3954 == 0 { if yyv3954 == nil { - yyv3954 = []DownwardAPIVolumeFile{} + yyv3954 = []ReplicationController{} yyc3954 = true } else if len(yyv3954) != 0 { yyv3954 = yyv3954[:0] @@ -50594,15 +50048,15 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil yyrg3954 := len(yyv3954) > 0 yyv23954 := yyv3954 - yyrl3954, yyrt3954 = z.DecInferLen(yyl3954, z.DecBasicHandle().MaxInitLen, 48) + yyrl3954, yyrt3954 = z.DecInferLen(yyl3954, z.DecBasicHandle().MaxInitLen, 232) if yyrt3954 { if yyrl3954 <= cap(yyv3954) { yyv3954 = yyv3954[:yyrl3954] } else { - yyv3954 = make([]DownwardAPIVolumeFile, yyrl3954) + yyv3954 = make([]ReplicationController, yyrl3954) } } else { - yyv3954 = make([]DownwardAPIVolumeFile, yyrl3954) + yyv3954 = make([]ReplicationController, yyrl3954) } yyc3954 = true yyrr3954 = len(yyv3954) @@ -50617,7 +50071,7 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil for ; yyj3954 < yyrr3954; yyj3954++ { yyh3954.ElemContainerState(yyj3954) if r.TryDecodeAsNil() { - yyv3954[yyj3954] = DownwardAPIVolumeFile{} + yyv3954[yyj3954] = ReplicationController{} } else { yyv3955 := &yyv3954[yyj3954] yyv3955.CodecDecodeSelf(d) @@ -50626,10 +50080,10 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil } if yyrt3954 { for ; yyj3954 < yyl3954; yyj3954++ { - yyv3954 = append(yyv3954, DownwardAPIVolumeFile{}) + yyv3954 = append(yyv3954, ReplicationController{}) yyh3954.ElemContainerState(yyj3954) if r.TryDecodeAsNil() { - yyv3954[yyj3954] = DownwardAPIVolumeFile{} + yyv3954[yyj3954] = ReplicationController{} } else { yyv3956 := &yyv3954[yyj3954] yyv3956.CodecDecodeSelf(d) @@ -50643,13 +50097,13 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil for ; !r.CheckBreak(); yyj3954++ { if yyj3954 >= len(yyv3954) { - yyv3954 = append(yyv3954, DownwardAPIVolumeFile{}) // var yyz3954 DownwardAPIVolumeFile + yyv3954 = append(yyv3954, ReplicationController{}) // var yyz3954 ReplicationController yyc3954 = true } yyh3954.ElemContainerState(yyj3954) if yyj3954 < len(yyv3954) { if r.TryDecodeAsNil() { - yyv3954[yyj3954] = DownwardAPIVolumeFile{} + yyv3954[yyj3954] = ReplicationController{} } else { yyv3957 := &yyv3954[yyj3954] yyv3957.CodecDecodeSelf(d) @@ -50664,7 +50118,7 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil yyv3954 = yyv3954[:yyj3954] yyc3954 = true } else if yyj3954 == 0 && yyv3954 == nil { - yyv3954 = []DownwardAPIVolumeFile{} + yyv3954 = []ReplicationController{} yyc3954 = true } } @@ -50673,3 +50127,3153 @@ func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFil *v = yyv3954 } } + +func (x codecSelfer1234) encSliceLoadBalancerIngress(v []LoadBalancerIngress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3958 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3959 := &yyv3958 + yy3959.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLoadBalancerIngress(v *[]LoadBalancerIngress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3960 := *v + yyh3960, yyl3960 := z.DecSliceHelperStart() + var yyc3960 bool + if yyl3960 == 0 { + if yyv3960 == nil { + yyv3960 = []LoadBalancerIngress{} + yyc3960 = true + } else if len(yyv3960) != 0 { + yyv3960 = yyv3960[:0] + yyc3960 = true + } + } else if yyl3960 > 0 { + var yyrr3960, yyrl3960 int + var yyrt3960 bool + if yyl3960 > cap(yyv3960) { + + yyrg3960 := len(yyv3960) > 0 + yyv23960 := yyv3960 + yyrl3960, yyrt3960 = z.DecInferLen(yyl3960, z.DecBasicHandle().MaxInitLen, 32) + if yyrt3960 { + if yyrl3960 <= cap(yyv3960) { + yyv3960 = yyv3960[:yyrl3960] + } else { + yyv3960 = make([]LoadBalancerIngress, yyrl3960) + } + } else { + yyv3960 = make([]LoadBalancerIngress, yyrl3960) + } + yyc3960 = true + yyrr3960 = len(yyv3960) + if yyrg3960 { + copy(yyv3960, yyv23960) + } + } else if yyl3960 != len(yyv3960) { + yyv3960 = yyv3960[:yyl3960] + yyc3960 = true + } + yyj3960 := 0 + for ; yyj3960 < yyrr3960; yyj3960++ { + yyh3960.ElemContainerState(yyj3960) + if r.TryDecodeAsNil() { + yyv3960[yyj3960] = LoadBalancerIngress{} + } else { + yyv3961 := &yyv3960[yyj3960] + yyv3961.CodecDecodeSelf(d) + } + + } + if yyrt3960 { + for ; yyj3960 < yyl3960; yyj3960++ { + yyv3960 = append(yyv3960, LoadBalancerIngress{}) + yyh3960.ElemContainerState(yyj3960) + if r.TryDecodeAsNil() { + yyv3960[yyj3960] = LoadBalancerIngress{} + } else { + yyv3962 := &yyv3960[yyj3960] + yyv3962.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3960 := 0 + for ; !r.CheckBreak(); yyj3960++ { + + if yyj3960 >= len(yyv3960) { + yyv3960 = append(yyv3960, LoadBalancerIngress{}) // var yyz3960 LoadBalancerIngress + yyc3960 = true + } + yyh3960.ElemContainerState(yyj3960) + if yyj3960 < len(yyv3960) { + if r.TryDecodeAsNil() { + yyv3960[yyj3960] = LoadBalancerIngress{} + } else { + yyv3963 := &yyv3960[yyj3960] + yyv3963.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3960 < len(yyv3960) { + yyv3960 = yyv3960[:yyj3960] + yyc3960 = true + } else if yyj3960 == 0 && yyv3960 == nil { + yyv3960 = []LoadBalancerIngress{} + yyc3960 = true + } + } + yyh3960.End() + if yyc3960 { + *v = yyv3960 + } +} + +func (x codecSelfer1234) encSliceServicePort(v []ServicePort, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3964 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3965 := &yyv3964 + yy3965.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceServicePort(v *[]ServicePort, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3966 := *v + yyh3966, yyl3966 := z.DecSliceHelperStart() + var yyc3966 bool + if yyl3966 == 0 { + if yyv3966 == nil { + yyv3966 = []ServicePort{} + yyc3966 = true + } else if len(yyv3966) != 0 { + yyv3966 = yyv3966[:0] + yyc3966 = true + } + } else if yyl3966 > 0 { + var yyrr3966, yyrl3966 int + var yyrt3966 bool + if yyl3966 > cap(yyv3966) { + + yyrg3966 := len(yyv3966) > 0 + yyv23966 := yyv3966 + yyrl3966, yyrt3966 = z.DecInferLen(yyl3966, z.DecBasicHandle().MaxInitLen, 80) + if yyrt3966 { + if yyrl3966 <= cap(yyv3966) { + yyv3966 = yyv3966[:yyrl3966] + } else { + yyv3966 = make([]ServicePort, yyrl3966) + } + } else { + yyv3966 = make([]ServicePort, yyrl3966) + } + yyc3966 = true + yyrr3966 = len(yyv3966) + if yyrg3966 { + copy(yyv3966, yyv23966) + } + } else if yyl3966 != len(yyv3966) { + yyv3966 = yyv3966[:yyl3966] + yyc3966 = true + } + yyj3966 := 0 + for ; yyj3966 < yyrr3966; yyj3966++ { + yyh3966.ElemContainerState(yyj3966) + if r.TryDecodeAsNil() { + yyv3966[yyj3966] = ServicePort{} + } else { + yyv3967 := &yyv3966[yyj3966] + yyv3967.CodecDecodeSelf(d) + } + + } + if yyrt3966 { + for ; yyj3966 < yyl3966; yyj3966++ { + yyv3966 = append(yyv3966, ServicePort{}) + yyh3966.ElemContainerState(yyj3966) + if r.TryDecodeAsNil() { + yyv3966[yyj3966] = ServicePort{} + } else { + yyv3968 := &yyv3966[yyj3966] + yyv3968.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3966 := 0 + for ; !r.CheckBreak(); yyj3966++ { + + if yyj3966 >= len(yyv3966) { + yyv3966 = append(yyv3966, ServicePort{}) // var yyz3966 ServicePort + yyc3966 = true + } + yyh3966.ElemContainerState(yyj3966) + if yyj3966 < len(yyv3966) { + if r.TryDecodeAsNil() { + yyv3966[yyj3966] = ServicePort{} + } else { + yyv3969 := &yyv3966[yyj3966] + yyv3969.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3966 < len(yyv3966) { + yyv3966 = yyv3966[:yyj3966] + yyc3966 = true + } else if yyj3966 == 0 && yyv3966 == nil { + yyv3966 = []ServicePort{} + yyc3966 = true + } + } + yyh3966.End() + if yyc3966 { + *v = yyv3966 + } +} + +func (x codecSelfer1234) encSliceService(v []Service, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3970 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3971 := &yyv3970 + yy3971.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceService(v *[]Service, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3972 := *v + yyh3972, yyl3972 := z.DecSliceHelperStart() + var yyc3972 bool + if yyl3972 == 0 { + if yyv3972 == nil { + yyv3972 = []Service{} + yyc3972 = true + } else if len(yyv3972) != 0 { + yyv3972 = yyv3972[:0] + yyc3972 = true + } + } else if yyl3972 > 0 { + var yyrr3972, yyrl3972 int + var yyrt3972 bool + if yyl3972 > cap(yyv3972) { + + yyrg3972 := len(yyv3972) > 0 + yyv23972 := yyv3972 + yyrl3972, yyrt3972 = z.DecInferLen(yyl3972, z.DecBasicHandle().MaxInitLen, 360) + if yyrt3972 { + if yyrl3972 <= cap(yyv3972) { + yyv3972 = yyv3972[:yyrl3972] + } else { + yyv3972 = make([]Service, yyrl3972) + } + } else { + yyv3972 = make([]Service, yyrl3972) + } + yyc3972 = true + yyrr3972 = len(yyv3972) + if yyrg3972 { + copy(yyv3972, yyv23972) + } + } else if yyl3972 != len(yyv3972) { + yyv3972 = yyv3972[:yyl3972] + yyc3972 = true + } + yyj3972 := 0 + for ; yyj3972 < yyrr3972; yyj3972++ { + yyh3972.ElemContainerState(yyj3972) + if r.TryDecodeAsNil() { + yyv3972[yyj3972] = Service{} + } else { + yyv3973 := &yyv3972[yyj3972] + yyv3973.CodecDecodeSelf(d) + } + + } + if yyrt3972 { + for ; yyj3972 < yyl3972; yyj3972++ { + yyv3972 = append(yyv3972, Service{}) + yyh3972.ElemContainerState(yyj3972) + if r.TryDecodeAsNil() { + yyv3972[yyj3972] = Service{} + } else { + yyv3974 := &yyv3972[yyj3972] + yyv3974.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3972 := 0 + for ; !r.CheckBreak(); yyj3972++ { + + if yyj3972 >= len(yyv3972) { + yyv3972 = append(yyv3972, Service{}) // var yyz3972 Service + yyc3972 = true + } + yyh3972.ElemContainerState(yyj3972) + if yyj3972 < len(yyv3972) { + if r.TryDecodeAsNil() { + yyv3972[yyj3972] = Service{} + } else { + yyv3975 := &yyv3972[yyj3972] + yyv3975.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3972 < len(yyv3972) { + yyv3972 = yyv3972[:yyj3972] + yyc3972 = true + } else if yyj3972 == 0 && yyv3972 == nil { + yyv3972 = []Service{} + yyc3972 = true + } + } + yyh3972.End() + if yyc3972 { + *v = yyv3972 + } +} + +func (x codecSelfer1234) encSliceObjectReference(v []ObjectReference, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3976 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3977 := &yyv3976 + yy3977.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceObjectReference(v *[]ObjectReference, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3978 := *v + yyh3978, yyl3978 := z.DecSliceHelperStart() + var yyc3978 bool + if yyl3978 == 0 { + if yyv3978 == nil { + yyv3978 = []ObjectReference{} + yyc3978 = true + } else if len(yyv3978) != 0 { + yyv3978 = yyv3978[:0] + yyc3978 = true + } + } else if yyl3978 > 0 { + var yyrr3978, yyrl3978 int + var yyrt3978 bool + if yyl3978 > cap(yyv3978) { + + yyrg3978 := len(yyv3978) > 0 + yyv23978 := yyv3978 + yyrl3978, yyrt3978 = z.DecInferLen(yyl3978, z.DecBasicHandle().MaxInitLen, 112) + if yyrt3978 { + if yyrl3978 <= cap(yyv3978) { + yyv3978 = yyv3978[:yyrl3978] + } else { + yyv3978 = make([]ObjectReference, yyrl3978) + } + } else { + yyv3978 = make([]ObjectReference, yyrl3978) + } + yyc3978 = true + yyrr3978 = len(yyv3978) + if yyrg3978 { + copy(yyv3978, yyv23978) + } + } else if yyl3978 != len(yyv3978) { + yyv3978 = yyv3978[:yyl3978] + yyc3978 = true + } + yyj3978 := 0 + for ; yyj3978 < yyrr3978; yyj3978++ { + yyh3978.ElemContainerState(yyj3978) + if r.TryDecodeAsNil() { + yyv3978[yyj3978] = ObjectReference{} + } else { + yyv3979 := &yyv3978[yyj3978] + yyv3979.CodecDecodeSelf(d) + } + + } + if yyrt3978 { + for ; yyj3978 < yyl3978; yyj3978++ { + yyv3978 = append(yyv3978, ObjectReference{}) + yyh3978.ElemContainerState(yyj3978) + if r.TryDecodeAsNil() { + yyv3978[yyj3978] = ObjectReference{} + } else { + yyv3980 := &yyv3978[yyj3978] + yyv3980.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3978 := 0 + for ; !r.CheckBreak(); yyj3978++ { + + if yyj3978 >= len(yyv3978) { + yyv3978 = append(yyv3978, ObjectReference{}) // var yyz3978 ObjectReference + yyc3978 = true + } + yyh3978.ElemContainerState(yyj3978) + if yyj3978 < len(yyv3978) { + if r.TryDecodeAsNil() { + yyv3978[yyj3978] = ObjectReference{} + } else { + yyv3981 := &yyv3978[yyj3978] + yyv3981.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3978 < len(yyv3978) { + yyv3978 = yyv3978[:yyj3978] + yyc3978 = true + } else if yyj3978 == 0 && yyv3978 == nil { + yyv3978 = []ObjectReference{} + yyc3978 = true + } + } + yyh3978.End() + if yyc3978 { + *v = yyv3978 + } +} + +func (x codecSelfer1234) encSliceServiceAccount(v []ServiceAccount, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3982 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3983 := &yyv3982 + yy3983.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceServiceAccount(v *[]ServiceAccount, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3984 := *v + yyh3984, yyl3984 := z.DecSliceHelperStart() + var yyc3984 bool + if yyl3984 == 0 { + if yyv3984 == nil { + yyv3984 = []ServiceAccount{} + yyc3984 = true + } else if len(yyv3984) != 0 { + yyv3984 = yyv3984[:0] + yyc3984 = true + } + } else if yyl3984 > 0 { + var yyrr3984, yyrl3984 int + var yyrt3984 bool + if yyl3984 > cap(yyv3984) { + + yyrg3984 := len(yyv3984) > 0 + yyv23984 := yyv3984 + yyrl3984, yyrt3984 = z.DecInferLen(yyl3984, z.DecBasicHandle().MaxInitLen, 240) + if yyrt3984 { + if yyrl3984 <= cap(yyv3984) { + yyv3984 = yyv3984[:yyrl3984] + } else { + yyv3984 = make([]ServiceAccount, yyrl3984) + } + } else { + yyv3984 = make([]ServiceAccount, yyrl3984) + } + yyc3984 = true + yyrr3984 = len(yyv3984) + if yyrg3984 { + copy(yyv3984, yyv23984) + } + } else if yyl3984 != len(yyv3984) { + yyv3984 = yyv3984[:yyl3984] + yyc3984 = true + } + yyj3984 := 0 + for ; yyj3984 < yyrr3984; yyj3984++ { + yyh3984.ElemContainerState(yyj3984) + if r.TryDecodeAsNil() { + yyv3984[yyj3984] = ServiceAccount{} + } else { + yyv3985 := &yyv3984[yyj3984] + yyv3985.CodecDecodeSelf(d) + } + + } + if yyrt3984 { + for ; yyj3984 < yyl3984; yyj3984++ { + yyv3984 = append(yyv3984, ServiceAccount{}) + yyh3984.ElemContainerState(yyj3984) + if r.TryDecodeAsNil() { + yyv3984[yyj3984] = ServiceAccount{} + } else { + yyv3986 := &yyv3984[yyj3984] + yyv3986.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3984 := 0 + for ; !r.CheckBreak(); yyj3984++ { + + if yyj3984 >= len(yyv3984) { + yyv3984 = append(yyv3984, ServiceAccount{}) // var yyz3984 ServiceAccount + yyc3984 = true + } + yyh3984.ElemContainerState(yyj3984) + if yyj3984 < len(yyv3984) { + if r.TryDecodeAsNil() { + yyv3984[yyj3984] = ServiceAccount{} + } else { + yyv3987 := &yyv3984[yyj3984] + yyv3987.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3984 < len(yyv3984) { + yyv3984 = yyv3984[:yyj3984] + yyc3984 = true + } else if yyj3984 == 0 && yyv3984 == nil { + yyv3984 = []ServiceAccount{} + yyc3984 = true + } + } + yyh3984.End() + if yyc3984 { + *v = yyv3984 + } +} + +func (x codecSelfer1234) encSliceEndpointSubset(v []EndpointSubset, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3988 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3989 := &yyv3988 + yy3989.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointSubset(v *[]EndpointSubset, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3990 := *v + yyh3990, yyl3990 := z.DecSliceHelperStart() + var yyc3990 bool + if yyl3990 == 0 { + if yyv3990 == nil { + yyv3990 = []EndpointSubset{} + yyc3990 = true + } else if len(yyv3990) != 0 { + yyv3990 = yyv3990[:0] + yyc3990 = true + } + } else if yyl3990 > 0 { + var yyrr3990, yyrl3990 int + var yyrt3990 bool + if yyl3990 > cap(yyv3990) { + + yyrg3990 := len(yyv3990) > 0 + yyv23990 := yyv3990 + yyrl3990, yyrt3990 = z.DecInferLen(yyl3990, z.DecBasicHandle().MaxInitLen, 72) + if yyrt3990 { + if yyrl3990 <= cap(yyv3990) { + yyv3990 = yyv3990[:yyrl3990] + } else { + yyv3990 = make([]EndpointSubset, yyrl3990) + } + } else { + yyv3990 = make([]EndpointSubset, yyrl3990) + } + yyc3990 = true + yyrr3990 = len(yyv3990) + if yyrg3990 { + copy(yyv3990, yyv23990) + } + } else if yyl3990 != len(yyv3990) { + yyv3990 = yyv3990[:yyl3990] + yyc3990 = true + } + yyj3990 := 0 + for ; yyj3990 < yyrr3990; yyj3990++ { + yyh3990.ElemContainerState(yyj3990) + if r.TryDecodeAsNil() { + yyv3990[yyj3990] = EndpointSubset{} + } else { + yyv3991 := &yyv3990[yyj3990] + yyv3991.CodecDecodeSelf(d) + } + + } + if yyrt3990 { + for ; yyj3990 < yyl3990; yyj3990++ { + yyv3990 = append(yyv3990, EndpointSubset{}) + yyh3990.ElemContainerState(yyj3990) + if r.TryDecodeAsNil() { + yyv3990[yyj3990] = EndpointSubset{} + } else { + yyv3992 := &yyv3990[yyj3990] + yyv3992.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3990 := 0 + for ; !r.CheckBreak(); yyj3990++ { + + if yyj3990 >= len(yyv3990) { + yyv3990 = append(yyv3990, EndpointSubset{}) // var yyz3990 EndpointSubset + yyc3990 = true + } + yyh3990.ElemContainerState(yyj3990) + if yyj3990 < len(yyv3990) { + if r.TryDecodeAsNil() { + yyv3990[yyj3990] = EndpointSubset{} + } else { + yyv3993 := &yyv3990[yyj3990] + yyv3993.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3990 < len(yyv3990) { + yyv3990 = yyv3990[:yyj3990] + yyc3990 = true + } else if yyj3990 == 0 && yyv3990 == nil { + yyv3990 = []EndpointSubset{} + yyc3990 = true + } + } + yyh3990.End() + if yyc3990 { + *v = yyv3990 + } +} + +func (x codecSelfer1234) encSliceEndpointAddress(v []EndpointAddress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv3994 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy3995 := &yyv3994 + yy3995.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointAddress(v *[]EndpointAddress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv3996 := *v + yyh3996, yyl3996 := z.DecSliceHelperStart() + var yyc3996 bool + if yyl3996 == 0 { + if yyv3996 == nil { + yyv3996 = []EndpointAddress{} + yyc3996 = true + } else if len(yyv3996) != 0 { + yyv3996 = yyv3996[:0] + yyc3996 = true + } + } else if yyl3996 > 0 { + var yyrr3996, yyrl3996 int + var yyrt3996 bool + if yyl3996 > cap(yyv3996) { + + yyrg3996 := len(yyv3996) > 0 + yyv23996 := yyv3996 + yyrl3996, yyrt3996 = z.DecInferLen(yyl3996, z.DecBasicHandle().MaxInitLen, 24) + if yyrt3996 { + if yyrl3996 <= cap(yyv3996) { + yyv3996 = yyv3996[:yyrl3996] + } else { + yyv3996 = make([]EndpointAddress, yyrl3996) + } + } else { + yyv3996 = make([]EndpointAddress, yyrl3996) + } + yyc3996 = true + yyrr3996 = len(yyv3996) + if yyrg3996 { + copy(yyv3996, yyv23996) + } + } else if yyl3996 != len(yyv3996) { + yyv3996 = yyv3996[:yyl3996] + yyc3996 = true + } + yyj3996 := 0 + for ; yyj3996 < yyrr3996; yyj3996++ { + yyh3996.ElemContainerState(yyj3996) + if r.TryDecodeAsNil() { + yyv3996[yyj3996] = EndpointAddress{} + } else { + yyv3997 := &yyv3996[yyj3996] + yyv3997.CodecDecodeSelf(d) + } + + } + if yyrt3996 { + for ; yyj3996 < yyl3996; yyj3996++ { + yyv3996 = append(yyv3996, EndpointAddress{}) + yyh3996.ElemContainerState(yyj3996) + if r.TryDecodeAsNil() { + yyv3996[yyj3996] = EndpointAddress{} + } else { + yyv3998 := &yyv3996[yyj3996] + yyv3998.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj3996 := 0 + for ; !r.CheckBreak(); yyj3996++ { + + if yyj3996 >= len(yyv3996) { + yyv3996 = append(yyv3996, EndpointAddress{}) // var yyz3996 EndpointAddress + yyc3996 = true + } + yyh3996.ElemContainerState(yyj3996) + if yyj3996 < len(yyv3996) { + if r.TryDecodeAsNil() { + yyv3996[yyj3996] = EndpointAddress{} + } else { + yyv3999 := &yyv3996[yyj3996] + yyv3999.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj3996 < len(yyv3996) { + yyv3996 = yyv3996[:yyj3996] + yyc3996 = true + } else if yyj3996 == 0 && yyv3996 == nil { + yyv3996 = []EndpointAddress{} + yyc3996 = true + } + } + yyh3996.End() + if yyc3996 { + *v = yyv3996 + } +} + +func (x codecSelfer1234) encSliceEndpointPort(v []EndpointPort, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4000 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4001 := &yyv4000 + yy4001.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpointPort(v *[]EndpointPort, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4002 := *v + yyh4002, yyl4002 := z.DecSliceHelperStart() + var yyc4002 bool + if yyl4002 == 0 { + if yyv4002 == nil { + yyv4002 = []EndpointPort{} + yyc4002 = true + } else if len(yyv4002) != 0 { + yyv4002 = yyv4002[:0] + yyc4002 = true + } + } else if yyl4002 > 0 { + var yyrr4002, yyrl4002 int + var yyrt4002 bool + if yyl4002 > cap(yyv4002) { + + yyrg4002 := len(yyv4002) > 0 + yyv24002 := yyv4002 + yyrl4002, yyrt4002 = z.DecInferLen(yyl4002, z.DecBasicHandle().MaxInitLen, 40) + if yyrt4002 { + if yyrl4002 <= cap(yyv4002) { + yyv4002 = yyv4002[:yyrl4002] + } else { + yyv4002 = make([]EndpointPort, yyrl4002) + } + } else { + yyv4002 = make([]EndpointPort, yyrl4002) + } + yyc4002 = true + yyrr4002 = len(yyv4002) + if yyrg4002 { + copy(yyv4002, yyv24002) + } + } else if yyl4002 != len(yyv4002) { + yyv4002 = yyv4002[:yyl4002] + yyc4002 = true + } + yyj4002 := 0 + for ; yyj4002 < yyrr4002; yyj4002++ { + yyh4002.ElemContainerState(yyj4002) + if r.TryDecodeAsNil() { + yyv4002[yyj4002] = EndpointPort{} + } else { + yyv4003 := &yyv4002[yyj4002] + yyv4003.CodecDecodeSelf(d) + } + + } + if yyrt4002 { + for ; yyj4002 < yyl4002; yyj4002++ { + yyv4002 = append(yyv4002, EndpointPort{}) + yyh4002.ElemContainerState(yyj4002) + if r.TryDecodeAsNil() { + yyv4002[yyj4002] = EndpointPort{} + } else { + yyv4004 := &yyv4002[yyj4002] + yyv4004.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4002 := 0 + for ; !r.CheckBreak(); yyj4002++ { + + if yyj4002 >= len(yyv4002) { + yyv4002 = append(yyv4002, EndpointPort{}) // var yyz4002 EndpointPort + yyc4002 = true + } + yyh4002.ElemContainerState(yyj4002) + if yyj4002 < len(yyv4002) { + if r.TryDecodeAsNil() { + yyv4002[yyj4002] = EndpointPort{} + } else { + yyv4005 := &yyv4002[yyj4002] + yyv4005.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4002 < len(yyv4002) { + yyv4002 = yyv4002[:yyj4002] + yyc4002 = true + } else if yyj4002 == 0 && yyv4002 == nil { + yyv4002 = []EndpointPort{} + yyc4002 = true + } + } + yyh4002.End() + if yyc4002 { + *v = yyv4002 + } +} + +func (x codecSelfer1234) encSliceEndpoints(v []Endpoints, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4006 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4007 := &yyv4006 + yy4007.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEndpoints(v *[]Endpoints, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4008 := *v + yyh4008, yyl4008 := z.DecSliceHelperStart() + var yyc4008 bool + if yyl4008 == 0 { + if yyv4008 == nil { + yyv4008 = []Endpoints{} + yyc4008 = true + } else if len(yyv4008) != 0 { + yyv4008 = yyv4008[:0] + yyc4008 = true + } + } else if yyl4008 > 0 { + var yyrr4008, yyrl4008 int + var yyrt4008 bool + if yyl4008 > cap(yyv4008) { + + yyrg4008 := len(yyv4008) > 0 + yyv24008 := yyv4008 + yyrl4008, yyrt4008 = z.DecInferLen(yyl4008, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4008 { + if yyrl4008 <= cap(yyv4008) { + yyv4008 = yyv4008[:yyrl4008] + } else { + yyv4008 = make([]Endpoints, yyrl4008) + } + } else { + yyv4008 = make([]Endpoints, yyrl4008) + } + yyc4008 = true + yyrr4008 = len(yyv4008) + if yyrg4008 { + copy(yyv4008, yyv24008) + } + } else if yyl4008 != len(yyv4008) { + yyv4008 = yyv4008[:yyl4008] + yyc4008 = true + } + yyj4008 := 0 + for ; yyj4008 < yyrr4008; yyj4008++ { + yyh4008.ElemContainerState(yyj4008) + if r.TryDecodeAsNil() { + yyv4008[yyj4008] = Endpoints{} + } else { + yyv4009 := &yyv4008[yyj4008] + yyv4009.CodecDecodeSelf(d) + } + + } + if yyrt4008 { + for ; yyj4008 < yyl4008; yyj4008++ { + yyv4008 = append(yyv4008, Endpoints{}) + yyh4008.ElemContainerState(yyj4008) + if r.TryDecodeAsNil() { + yyv4008[yyj4008] = Endpoints{} + } else { + yyv4010 := &yyv4008[yyj4008] + yyv4010.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4008 := 0 + for ; !r.CheckBreak(); yyj4008++ { + + if yyj4008 >= len(yyv4008) { + yyv4008 = append(yyv4008, Endpoints{}) // var yyz4008 Endpoints + yyc4008 = true + } + yyh4008.ElemContainerState(yyj4008) + if yyj4008 < len(yyv4008) { + if r.TryDecodeAsNil() { + yyv4008[yyj4008] = Endpoints{} + } else { + yyv4011 := &yyv4008[yyj4008] + yyv4011.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4008 < len(yyv4008) { + yyv4008 = yyv4008[:yyj4008] + yyc4008 = true + } else if yyj4008 == 0 && yyv4008 == nil { + yyv4008 = []Endpoints{} + yyc4008 = true + } + } + yyh4008.End() + if yyc4008 { + *v = yyv4008 + } +} + +func (x codecSelfer1234) encSliceNodeCondition(v []NodeCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4012 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4013 := &yyv4012 + yy4013.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeCondition(v *[]NodeCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4014 := *v + yyh4014, yyl4014 := z.DecSliceHelperStart() + var yyc4014 bool + if yyl4014 == 0 { + if yyv4014 == nil { + yyv4014 = []NodeCondition{} + yyc4014 = true + } else if len(yyv4014) != 0 { + yyv4014 = yyv4014[:0] + yyc4014 = true + } + } else if yyl4014 > 0 { + var yyrr4014, yyrl4014 int + var yyrt4014 bool + if yyl4014 > cap(yyv4014) { + + yyrg4014 := len(yyv4014) > 0 + yyv24014 := yyv4014 + yyrl4014, yyrt4014 = z.DecInferLen(yyl4014, z.DecBasicHandle().MaxInitLen, 112) + if yyrt4014 { + if yyrl4014 <= cap(yyv4014) { + yyv4014 = yyv4014[:yyrl4014] + } else { + yyv4014 = make([]NodeCondition, yyrl4014) + } + } else { + yyv4014 = make([]NodeCondition, yyrl4014) + } + yyc4014 = true + yyrr4014 = len(yyv4014) + if yyrg4014 { + copy(yyv4014, yyv24014) + } + } else if yyl4014 != len(yyv4014) { + yyv4014 = yyv4014[:yyl4014] + yyc4014 = true + } + yyj4014 := 0 + for ; yyj4014 < yyrr4014; yyj4014++ { + yyh4014.ElemContainerState(yyj4014) + if r.TryDecodeAsNil() { + yyv4014[yyj4014] = NodeCondition{} + } else { + yyv4015 := &yyv4014[yyj4014] + yyv4015.CodecDecodeSelf(d) + } + + } + if yyrt4014 { + for ; yyj4014 < yyl4014; yyj4014++ { + yyv4014 = append(yyv4014, NodeCondition{}) + yyh4014.ElemContainerState(yyj4014) + if r.TryDecodeAsNil() { + yyv4014[yyj4014] = NodeCondition{} + } else { + yyv4016 := &yyv4014[yyj4014] + yyv4016.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4014 := 0 + for ; !r.CheckBreak(); yyj4014++ { + + if yyj4014 >= len(yyv4014) { + yyv4014 = append(yyv4014, NodeCondition{}) // var yyz4014 NodeCondition + yyc4014 = true + } + yyh4014.ElemContainerState(yyj4014) + if yyj4014 < len(yyv4014) { + if r.TryDecodeAsNil() { + yyv4014[yyj4014] = NodeCondition{} + } else { + yyv4017 := &yyv4014[yyj4014] + yyv4017.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4014 < len(yyv4014) { + yyv4014 = yyv4014[:yyj4014] + yyc4014 = true + } else if yyj4014 == 0 && yyv4014 == nil { + yyv4014 = []NodeCondition{} + yyc4014 = true + } + } + yyh4014.End() + if yyc4014 { + *v = yyv4014 + } +} + +func (x codecSelfer1234) encSliceNodeAddress(v []NodeAddress, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4018 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4019 := &yyv4018 + yy4019.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNodeAddress(v *[]NodeAddress, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4020 := *v + yyh4020, yyl4020 := z.DecSliceHelperStart() + var yyc4020 bool + if yyl4020 == 0 { + if yyv4020 == nil { + yyv4020 = []NodeAddress{} + yyc4020 = true + } else if len(yyv4020) != 0 { + yyv4020 = yyv4020[:0] + yyc4020 = true + } + } else if yyl4020 > 0 { + var yyrr4020, yyrl4020 int + var yyrt4020 bool + if yyl4020 > cap(yyv4020) { + + yyrg4020 := len(yyv4020) > 0 + yyv24020 := yyv4020 + yyrl4020, yyrt4020 = z.DecInferLen(yyl4020, z.DecBasicHandle().MaxInitLen, 32) + if yyrt4020 { + if yyrl4020 <= cap(yyv4020) { + yyv4020 = yyv4020[:yyrl4020] + } else { + yyv4020 = make([]NodeAddress, yyrl4020) + } + } else { + yyv4020 = make([]NodeAddress, yyrl4020) + } + yyc4020 = true + yyrr4020 = len(yyv4020) + if yyrg4020 { + copy(yyv4020, yyv24020) + } + } else if yyl4020 != len(yyv4020) { + yyv4020 = yyv4020[:yyl4020] + yyc4020 = true + } + yyj4020 := 0 + for ; yyj4020 < yyrr4020; yyj4020++ { + yyh4020.ElemContainerState(yyj4020) + if r.TryDecodeAsNil() { + yyv4020[yyj4020] = NodeAddress{} + } else { + yyv4021 := &yyv4020[yyj4020] + yyv4021.CodecDecodeSelf(d) + } + + } + if yyrt4020 { + for ; yyj4020 < yyl4020; yyj4020++ { + yyv4020 = append(yyv4020, NodeAddress{}) + yyh4020.ElemContainerState(yyj4020) + if r.TryDecodeAsNil() { + yyv4020[yyj4020] = NodeAddress{} + } else { + yyv4022 := &yyv4020[yyj4020] + yyv4022.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4020 := 0 + for ; !r.CheckBreak(); yyj4020++ { + + if yyj4020 >= len(yyv4020) { + yyv4020 = append(yyv4020, NodeAddress{}) // var yyz4020 NodeAddress + yyc4020 = true + } + yyh4020.ElemContainerState(yyj4020) + if yyj4020 < len(yyv4020) { + if r.TryDecodeAsNil() { + yyv4020[yyj4020] = NodeAddress{} + } else { + yyv4023 := &yyv4020[yyj4020] + yyv4023.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4020 < len(yyv4020) { + yyv4020 = yyv4020[:yyj4020] + yyc4020 = true + } else if yyj4020 == 0 && yyv4020 == nil { + yyv4020 = []NodeAddress{} + yyc4020 = true + } + } + yyh4020.End() + if yyc4020 { + *v = yyv4020 + } +} + +func (x codecSelfer1234) encSliceContainerImage(v []ContainerImage, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4024 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4025 := &yyv4024 + yy4025.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceContainerImage(v *[]ContainerImage, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4026 := *v + yyh4026, yyl4026 := z.DecSliceHelperStart() + var yyc4026 bool + if yyl4026 == 0 { + if yyv4026 == nil { + yyv4026 = []ContainerImage{} + yyc4026 = true + } else if len(yyv4026) != 0 { + yyv4026 = yyv4026[:0] + yyc4026 = true + } + } else if yyl4026 > 0 { + var yyrr4026, yyrl4026 int + var yyrt4026 bool + if yyl4026 > cap(yyv4026) { + + yyrg4026 := len(yyv4026) > 0 + yyv24026 := yyv4026 + yyrl4026, yyrt4026 = z.DecInferLen(yyl4026, z.DecBasicHandle().MaxInitLen, 32) + if yyrt4026 { + if yyrl4026 <= cap(yyv4026) { + yyv4026 = yyv4026[:yyrl4026] + } else { + yyv4026 = make([]ContainerImage, yyrl4026) + } + } else { + yyv4026 = make([]ContainerImage, yyrl4026) + } + yyc4026 = true + yyrr4026 = len(yyv4026) + if yyrg4026 { + copy(yyv4026, yyv24026) + } + } else if yyl4026 != len(yyv4026) { + yyv4026 = yyv4026[:yyl4026] + yyc4026 = true + } + yyj4026 := 0 + for ; yyj4026 < yyrr4026; yyj4026++ { + yyh4026.ElemContainerState(yyj4026) + if r.TryDecodeAsNil() { + yyv4026[yyj4026] = ContainerImage{} + } else { + yyv4027 := &yyv4026[yyj4026] + yyv4027.CodecDecodeSelf(d) + } + + } + if yyrt4026 { + for ; yyj4026 < yyl4026; yyj4026++ { + yyv4026 = append(yyv4026, ContainerImage{}) + yyh4026.ElemContainerState(yyj4026) + if r.TryDecodeAsNil() { + yyv4026[yyj4026] = ContainerImage{} + } else { + yyv4028 := &yyv4026[yyj4026] + yyv4028.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4026 := 0 + for ; !r.CheckBreak(); yyj4026++ { + + if yyj4026 >= len(yyv4026) { + yyv4026 = append(yyv4026, ContainerImage{}) // var yyz4026 ContainerImage + yyc4026 = true + } + yyh4026.ElemContainerState(yyj4026) + if yyj4026 < len(yyv4026) { + if r.TryDecodeAsNil() { + yyv4026[yyj4026] = ContainerImage{} + } else { + yyv4029 := &yyv4026[yyj4026] + yyv4029.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4026 < len(yyv4026) { + yyv4026 = yyv4026[:yyj4026] + yyc4026 = true + } else if yyj4026 == 0 && yyv4026 == nil { + yyv4026 = []ContainerImage{} + yyc4026 = true + } + } + yyh4026.End() + if yyc4026 { + *v = yyv4026 + } +} + +func (x codecSelfer1234) encResourceList(v ResourceList, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeMapStart(len(v)) + for yyk4030, yyv4030 := range v { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + yyk4030.CodecEncodeSelf(e) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy4031 := &yyv4030 + yym4032 := z.EncBinary() + _ = yym4032 + if false { + } else if z.HasExtensions() && z.EncExt(yy4031) { + } else if !yym4032 && z.IsJSONHandle() { + z.EncJSONMarshal(yy4031) + } else { + z.EncFallback(yy4031) + } + } + z.EncSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) decResourceList(v *ResourceList, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4033 := *v + yyl4033 := r.ReadMapStart() + yybh4033 := z.DecBasicHandle() + if yyv4033 == nil { + yyrl4033, _ := z.DecInferLen(yyl4033, yybh4033.MaxInitLen, 40) + yyv4033 = make(map[ResourceName]pkg3_resource.Quantity, yyrl4033) + *v = yyv4033 + } + var yymk4033 ResourceName + var yymv4033 pkg3_resource.Quantity + var yymg4033 bool + if yybh4033.MapValueReset { + yymg4033 = true + } + if yyl4033 > 0 { + for yyj4033 := 0; yyj4033 < yyl4033; yyj4033++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk4033 = "" + } else { + yymk4033 = ResourceName(r.DecodeString()) + } + + if yymg4033 { + yymv4033 = yyv4033[yymk4033] + } else { + yymv4033 = pkg3_resource.Quantity{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv4033 = pkg3_resource.Quantity{} + } else { + yyv4035 := &yymv4033 + yym4036 := z.DecBinary() + _ = yym4036 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4035) { + } else if !yym4036 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4035) + } else { + z.DecFallback(yyv4035, false) + } + } + + if yyv4033 != nil { + yyv4033[yymk4033] = yymv4033 + } + } + } else if yyl4033 < 0 { + for yyj4033 := 0; !r.CheckBreak(); yyj4033++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk4033 = "" + } else { + yymk4033 = ResourceName(r.DecodeString()) + } + + if yymg4033 { + yymv4033 = yyv4033[yymk4033] + } else { + yymv4033 = pkg3_resource.Quantity{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv4033 = pkg3_resource.Quantity{} + } else { + yyv4038 := &yymv4033 + yym4039 := z.DecBinary() + _ = yym4039 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4038) { + } else if !yym4039 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4038) + } else { + z.DecFallback(yyv4038, false) + } + } + + if yyv4033 != nil { + yyv4033[yymk4033] = yymv4033 + } + } + } // else len==0: TODO: Should we clear map entries? + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) encSliceNode(v []Node, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4040 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4041 := &yyv4040 + yy4041.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4042 := *v + yyh4042, yyl4042 := z.DecSliceHelperStart() + var yyc4042 bool + if yyl4042 == 0 { + if yyv4042 == nil { + yyv4042 = []Node{} + yyc4042 = true + } else if len(yyv4042) != 0 { + yyv4042 = yyv4042[:0] + yyc4042 = true + } + } else if yyl4042 > 0 { + var yyrr4042, yyrl4042 int + var yyrt4042 bool + if yyl4042 > cap(yyv4042) { + + yyrg4042 := len(yyv4042) > 0 + yyv24042 := yyv4042 + yyrl4042, yyrt4042 = z.DecInferLen(yyl4042, z.DecBasicHandle().MaxInitLen, 488) + if yyrt4042 { + if yyrl4042 <= cap(yyv4042) { + yyv4042 = yyv4042[:yyrl4042] + } else { + yyv4042 = make([]Node, yyrl4042) + } + } else { + yyv4042 = make([]Node, yyrl4042) + } + yyc4042 = true + yyrr4042 = len(yyv4042) + if yyrg4042 { + copy(yyv4042, yyv24042) + } + } else if yyl4042 != len(yyv4042) { + yyv4042 = yyv4042[:yyl4042] + yyc4042 = true + } + yyj4042 := 0 + for ; yyj4042 < yyrr4042; yyj4042++ { + yyh4042.ElemContainerState(yyj4042) + if r.TryDecodeAsNil() { + yyv4042[yyj4042] = Node{} + } else { + yyv4043 := &yyv4042[yyj4042] + yyv4043.CodecDecodeSelf(d) + } + + } + if yyrt4042 { + for ; yyj4042 < yyl4042; yyj4042++ { + yyv4042 = append(yyv4042, Node{}) + yyh4042.ElemContainerState(yyj4042) + if r.TryDecodeAsNil() { + yyv4042[yyj4042] = Node{} + } else { + yyv4044 := &yyv4042[yyj4042] + yyv4044.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4042 := 0 + for ; !r.CheckBreak(); yyj4042++ { + + if yyj4042 >= len(yyv4042) { + yyv4042 = append(yyv4042, Node{}) // var yyz4042 Node + yyc4042 = true + } + yyh4042.ElemContainerState(yyj4042) + if yyj4042 < len(yyv4042) { + if r.TryDecodeAsNil() { + yyv4042[yyj4042] = Node{} + } else { + yyv4045 := &yyv4042[yyj4042] + yyv4045.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4042 < len(yyv4042) { + yyv4042 = yyv4042[:yyj4042] + yyc4042 = true + } else if yyj4042 == 0 && yyv4042 == nil { + yyv4042 = []Node{} + yyc4042 = true + } + } + yyh4042.End() + if yyc4042 { + *v = yyv4042 + } +} + +func (x codecSelfer1234) encSliceFinalizerName(v []FinalizerName, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4046 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yyv4046.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceFinalizerName(v *[]FinalizerName, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4047 := *v + yyh4047, yyl4047 := z.DecSliceHelperStart() + var yyc4047 bool + if yyl4047 == 0 { + if yyv4047 == nil { + yyv4047 = []FinalizerName{} + yyc4047 = true + } else if len(yyv4047) != 0 { + yyv4047 = yyv4047[:0] + yyc4047 = true + } + } else if yyl4047 > 0 { + var yyrr4047, yyrl4047 int + var yyrt4047 bool + if yyl4047 > cap(yyv4047) { + + yyrl4047, yyrt4047 = z.DecInferLen(yyl4047, z.DecBasicHandle().MaxInitLen, 16) + if yyrt4047 { + if yyrl4047 <= cap(yyv4047) { + yyv4047 = yyv4047[:yyrl4047] + } else { + yyv4047 = make([]FinalizerName, yyrl4047) + } + } else { + yyv4047 = make([]FinalizerName, yyrl4047) + } + yyc4047 = true + yyrr4047 = len(yyv4047) + } else if yyl4047 != len(yyv4047) { + yyv4047 = yyv4047[:yyl4047] + yyc4047 = true + } + yyj4047 := 0 + for ; yyj4047 < yyrr4047; yyj4047++ { + yyh4047.ElemContainerState(yyj4047) + if r.TryDecodeAsNil() { + yyv4047[yyj4047] = "" + } else { + yyv4047[yyj4047] = FinalizerName(r.DecodeString()) + } + + } + if yyrt4047 { + for ; yyj4047 < yyl4047; yyj4047++ { + yyv4047 = append(yyv4047, "") + yyh4047.ElemContainerState(yyj4047) + if r.TryDecodeAsNil() { + yyv4047[yyj4047] = "" + } else { + yyv4047[yyj4047] = FinalizerName(r.DecodeString()) + } + + } + } + + } else { + yyj4047 := 0 + for ; !r.CheckBreak(); yyj4047++ { + + if yyj4047 >= len(yyv4047) { + yyv4047 = append(yyv4047, "") // var yyz4047 FinalizerName + yyc4047 = true + } + yyh4047.ElemContainerState(yyj4047) + if yyj4047 < len(yyv4047) { + if r.TryDecodeAsNil() { + yyv4047[yyj4047] = "" + } else { + yyv4047[yyj4047] = FinalizerName(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj4047 < len(yyv4047) { + yyv4047 = yyv4047[:yyj4047] + yyc4047 = true + } else if yyj4047 == 0 && yyv4047 == nil { + yyv4047 = []FinalizerName{} + yyc4047 = true + } + } + yyh4047.End() + if yyc4047 { + *v = yyv4047 + } +} + +func (x codecSelfer1234) encSliceNamespace(v []Namespace, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4051 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4052 := &yyv4051 + yy4052.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceNamespace(v *[]Namespace, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4053 := *v + yyh4053, yyl4053 := z.DecSliceHelperStart() + var yyc4053 bool + if yyl4053 == 0 { + if yyv4053 == nil { + yyv4053 = []Namespace{} + yyc4053 = true + } else if len(yyv4053) != 0 { + yyv4053 = yyv4053[:0] + yyc4053 = true + } + } else if yyl4053 > 0 { + var yyrr4053, yyrl4053 int + var yyrt4053 bool + if yyl4053 > cap(yyv4053) { + + yyrg4053 := len(yyv4053) > 0 + yyv24053 := yyv4053 + yyrl4053, yyrt4053 = z.DecInferLen(yyl4053, z.DecBasicHandle().MaxInitLen, 232) + if yyrt4053 { + if yyrl4053 <= cap(yyv4053) { + yyv4053 = yyv4053[:yyrl4053] + } else { + yyv4053 = make([]Namespace, yyrl4053) + } + } else { + yyv4053 = make([]Namespace, yyrl4053) + } + yyc4053 = true + yyrr4053 = len(yyv4053) + if yyrg4053 { + copy(yyv4053, yyv24053) + } + } else if yyl4053 != len(yyv4053) { + yyv4053 = yyv4053[:yyl4053] + yyc4053 = true + } + yyj4053 := 0 + for ; yyj4053 < yyrr4053; yyj4053++ { + yyh4053.ElemContainerState(yyj4053) + if r.TryDecodeAsNil() { + yyv4053[yyj4053] = Namespace{} + } else { + yyv4054 := &yyv4053[yyj4053] + yyv4054.CodecDecodeSelf(d) + } + + } + if yyrt4053 { + for ; yyj4053 < yyl4053; yyj4053++ { + yyv4053 = append(yyv4053, Namespace{}) + yyh4053.ElemContainerState(yyj4053) + if r.TryDecodeAsNil() { + yyv4053[yyj4053] = Namespace{} + } else { + yyv4055 := &yyv4053[yyj4053] + yyv4055.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4053 := 0 + for ; !r.CheckBreak(); yyj4053++ { + + if yyj4053 >= len(yyv4053) { + yyv4053 = append(yyv4053, Namespace{}) // var yyz4053 Namespace + yyc4053 = true + } + yyh4053.ElemContainerState(yyj4053) + if yyj4053 < len(yyv4053) { + if r.TryDecodeAsNil() { + yyv4053[yyj4053] = Namespace{} + } else { + yyv4056 := &yyv4053[yyj4053] + yyv4056.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4053 < len(yyv4053) { + yyv4053 = yyv4053[:yyj4053] + yyc4053 = true + } else if yyj4053 == 0 && yyv4053 == nil { + yyv4053 = []Namespace{} + yyc4053 = true + } + } + yyh4053.End() + if yyc4053 { + *v = yyv4053 + } +} + +func (x codecSelfer1234) encSliceEvent(v []Event, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4057 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4058 := &yyv4057 + yy4058.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceEvent(v *[]Event, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4059 := *v + yyh4059, yyl4059 := z.DecSliceHelperStart() + var yyc4059 bool + if yyl4059 == 0 { + if yyv4059 == nil { + yyv4059 = []Event{} + yyc4059 = true + } else if len(yyv4059) != 0 { + yyv4059 = yyv4059[:0] + yyc4059 = true + } + } else if yyl4059 > 0 { + var yyrr4059, yyrl4059 int + var yyrt4059 bool + if yyl4059 > cap(yyv4059) { + + yyrg4059 := len(yyv4059) > 0 + yyv24059 := yyv4059 + yyrl4059, yyrt4059 = z.DecInferLen(yyl4059, z.DecBasicHandle().MaxInitLen, 440) + if yyrt4059 { + if yyrl4059 <= cap(yyv4059) { + yyv4059 = yyv4059[:yyrl4059] + } else { + yyv4059 = make([]Event, yyrl4059) + } + } else { + yyv4059 = make([]Event, yyrl4059) + } + yyc4059 = true + yyrr4059 = len(yyv4059) + if yyrg4059 { + copy(yyv4059, yyv24059) + } + } else if yyl4059 != len(yyv4059) { + yyv4059 = yyv4059[:yyl4059] + yyc4059 = true + } + yyj4059 := 0 + for ; yyj4059 < yyrr4059; yyj4059++ { + yyh4059.ElemContainerState(yyj4059) + if r.TryDecodeAsNil() { + yyv4059[yyj4059] = Event{} + } else { + yyv4060 := &yyv4059[yyj4059] + yyv4060.CodecDecodeSelf(d) + } + + } + if yyrt4059 { + for ; yyj4059 < yyl4059; yyj4059++ { + yyv4059 = append(yyv4059, Event{}) + yyh4059.ElemContainerState(yyj4059) + if r.TryDecodeAsNil() { + yyv4059[yyj4059] = Event{} + } else { + yyv4061 := &yyv4059[yyj4059] + yyv4061.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4059 := 0 + for ; !r.CheckBreak(); yyj4059++ { + + if yyj4059 >= len(yyv4059) { + yyv4059 = append(yyv4059, Event{}) // var yyz4059 Event + yyc4059 = true + } + yyh4059.ElemContainerState(yyj4059) + if yyj4059 < len(yyv4059) { + if r.TryDecodeAsNil() { + yyv4059[yyj4059] = Event{} + } else { + yyv4062 := &yyv4059[yyj4059] + yyv4062.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4059 < len(yyv4059) { + yyv4059 = yyv4059[:yyj4059] + yyc4059 = true + } else if yyj4059 == 0 && yyv4059 == nil { + yyv4059 = []Event{} + yyc4059 = true + } + } + yyh4059.End() + if yyc4059 { + *v = yyv4059 + } +} + +func (x codecSelfer1234) encSliceruntime_RawExtension(v []pkg6_runtime.RawExtension, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4063 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4064 := &yyv4063 + yym4065 := z.EncBinary() + _ = yym4065 + if false { + } else if z.HasExtensions() && z.EncExt(yy4064) { + } else if !yym4065 && z.IsJSONHandle() { + z.EncJSONMarshal(yy4064) + } else { + z.EncFallback(yy4064) + } + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceruntime_RawExtension(v *[]pkg6_runtime.RawExtension, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4066 := *v + yyh4066, yyl4066 := z.DecSliceHelperStart() + var yyc4066 bool + if yyl4066 == 0 { + if yyv4066 == nil { + yyv4066 = []pkg6_runtime.RawExtension{} + yyc4066 = true + } else if len(yyv4066) != 0 { + yyv4066 = yyv4066[:0] + yyc4066 = true + } + } else if yyl4066 > 0 { + var yyrr4066, yyrl4066 int + var yyrt4066 bool + if yyl4066 > cap(yyv4066) { + + yyrg4066 := len(yyv4066) > 0 + yyv24066 := yyv4066 + yyrl4066, yyrt4066 = z.DecInferLen(yyl4066, z.DecBasicHandle().MaxInitLen, 40) + if yyrt4066 { + if yyrl4066 <= cap(yyv4066) { + yyv4066 = yyv4066[:yyrl4066] + } else { + yyv4066 = make([]pkg6_runtime.RawExtension, yyrl4066) + } + } else { + yyv4066 = make([]pkg6_runtime.RawExtension, yyrl4066) + } + yyc4066 = true + yyrr4066 = len(yyv4066) + if yyrg4066 { + copy(yyv4066, yyv24066) + } + } else if yyl4066 != len(yyv4066) { + yyv4066 = yyv4066[:yyl4066] + yyc4066 = true + } + yyj4066 := 0 + for ; yyj4066 < yyrr4066; yyj4066++ { + yyh4066.ElemContainerState(yyj4066) + if r.TryDecodeAsNil() { + yyv4066[yyj4066] = pkg6_runtime.RawExtension{} + } else { + yyv4067 := &yyv4066[yyj4066] + yym4068 := z.DecBinary() + _ = yym4068 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4067) { + } else if !yym4068 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4067) + } else { + z.DecFallback(yyv4067, false) + } + } + + } + if yyrt4066 { + for ; yyj4066 < yyl4066; yyj4066++ { + yyv4066 = append(yyv4066, pkg6_runtime.RawExtension{}) + yyh4066.ElemContainerState(yyj4066) + if r.TryDecodeAsNil() { + yyv4066[yyj4066] = pkg6_runtime.RawExtension{} + } else { + yyv4069 := &yyv4066[yyj4066] + yym4070 := z.DecBinary() + _ = yym4070 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4069) { + } else if !yym4070 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4069) + } else { + z.DecFallback(yyv4069, false) + } + } + + } + } + + } else { + yyj4066 := 0 + for ; !r.CheckBreak(); yyj4066++ { + + if yyj4066 >= len(yyv4066) { + yyv4066 = append(yyv4066, pkg6_runtime.RawExtension{}) // var yyz4066 pkg6_runtime.RawExtension + yyc4066 = true + } + yyh4066.ElemContainerState(yyj4066) + if yyj4066 < len(yyv4066) { + if r.TryDecodeAsNil() { + yyv4066[yyj4066] = pkg6_runtime.RawExtension{} + } else { + yyv4071 := &yyv4066[yyj4066] + yym4072 := z.DecBinary() + _ = yym4072 + if false { + } else if z.HasExtensions() && z.DecExt(yyv4071) { + } else if !yym4072 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv4071) + } else { + z.DecFallback(yyv4071, false) + } + } + + } else { + z.DecSwallow() + } + + } + if yyj4066 < len(yyv4066) { + yyv4066 = yyv4066[:yyj4066] + yyc4066 = true + } else if yyj4066 == 0 && yyv4066 == nil { + yyv4066 = []pkg6_runtime.RawExtension{} + yyc4066 = true + } + } + yyh4066.End() + if yyc4066 { + *v = yyv4066 + } +} + +func (x codecSelfer1234) encSliceLimitRangeItem(v []LimitRangeItem, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4073 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4074 := &yyv4073 + yy4074.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLimitRangeItem(v *[]LimitRangeItem, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4075 := *v + yyh4075, yyl4075 := z.DecSliceHelperStart() + var yyc4075 bool + if yyl4075 == 0 { + if yyv4075 == nil { + yyv4075 = []LimitRangeItem{} + yyc4075 = true + } else if len(yyv4075) != 0 { + yyv4075 = yyv4075[:0] + yyc4075 = true + } + } else if yyl4075 > 0 { + var yyrr4075, yyrl4075 int + var yyrt4075 bool + if yyl4075 > cap(yyv4075) { + + yyrg4075 := len(yyv4075) > 0 + yyv24075 := yyv4075 + yyrl4075, yyrt4075 = z.DecInferLen(yyl4075, z.DecBasicHandle().MaxInitLen, 56) + if yyrt4075 { + if yyrl4075 <= cap(yyv4075) { + yyv4075 = yyv4075[:yyrl4075] + } else { + yyv4075 = make([]LimitRangeItem, yyrl4075) + } + } else { + yyv4075 = make([]LimitRangeItem, yyrl4075) + } + yyc4075 = true + yyrr4075 = len(yyv4075) + if yyrg4075 { + copy(yyv4075, yyv24075) + } + } else if yyl4075 != len(yyv4075) { + yyv4075 = yyv4075[:yyl4075] + yyc4075 = true + } + yyj4075 := 0 + for ; yyj4075 < yyrr4075; yyj4075++ { + yyh4075.ElemContainerState(yyj4075) + if r.TryDecodeAsNil() { + yyv4075[yyj4075] = LimitRangeItem{} + } else { + yyv4076 := &yyv4075[yyj4075] + yyv4076.CodecDecodeSelf(d) + } + + } + if yyrt4075 { + for ; yyj4075 < yyl4075; yyj4075++ { + yyv4075 = append(yyv4075, LimitRangeItem{}) + yyh4075.ElemContainerState(yyj4075) + if r.TryDecodeAsNil() { + yyv4075[yyj4075] = LimitRangeItem{} + } else { + yyv4077 := &yyv4075[yyj4075] + yyv4077.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4075 := 0 + for ; !r.CheckBreak(); yyj4075++ { + + if yyj4075 >= len(yyv4075) { + yyv4075 = append(yyv4075, LimitRangeItem{}) // var yyz4075 LimitRangeItem + yyc4075 = true + } + yyh4075.ElemContainerState(yyj4075) + if yyj4075 < len(yyv4075) { + if r.TryDecodeAsNil() { + yyv4075[yyj4075] = LimitRangeItem{} + } else { + yyv4078 := &yyv4075[yyj4075] + yyv4078.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4075 < len(yyv4075) { + yyv4075 = yyv4075[:yyj4075] + yyc4075 = true + } else if yyj4075 == 0 && yyv4075 == nil { + yyv4075 = []LimitRangeItem{} + yyc4075 = true + } + } + yyh4075.End() + if yyc4075 { + *v = yyv4075 + } +} + +func (x codecSelfer1234) encSliceLimitRange(v []LimitRange, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4079 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4080 := &yyv4079 + yy4080.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceLimitRange(v *[]LimitRange, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4081 := *v + yyh4081, yyl4081 := z.DecSliceHelperStart() + var yyc4081 bool + if yyl4081 == 0 { + if yyv4081 == nil { + yyv4081 = []LimitRange{} + yyc4081 = true + } else if len(yyv4081) != 0 { + yyv4081 = yyv4081[:0] + yyc4081 = true + } + } else if yyl4081 > 0 { + var yyrr4081, yyrl4081 int + var yyrt4081 bool + if yyl4081 > cap(yyv4081) { + + yyrg4081 := len(yyv4081) > 0 + yyv24081 := yyv4081 + yyrl4081, yyrt4081 = z.DecInferLen(yyl4081, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4081 { + if yyrl4081 <= cap(yyv4081) { + yyv4081 = yyv4081[:yyrl4081] + } else { + yyv4081 = make([]LimitRange, yyrl4081) + } + } else { + yyv4081 = make([]LimitRange, yyrl4081) + } + yyc4081 = true + yyrr4081 = len(yyv4081) + if yyrg4081 { + copy(yyv4081, yyv24081) + } + } else if yyl4081 != len(yyv4081) { + yyv4081 = yyv4081[:yyl4081] + yyc4081 = true + } + yyj4081 := 0 + for ; yyj4081 < yyrr4081; yyj4081++ { + yyh4081.ElemContainerState(yyj4081) + if r.TryDecodeAsNil() { + yyv4081[yyj4081] = LimitRange{} + } else { + yyv4082 := &yyv4081[yyj4081] + yyv4082.CodecDecodeSelf(d) + } + + } + if yyrt4081 { + for ; yyj4081 < yyl4081; yyj4081++ { + yyv4081 = append(yyv4081, LimitRange{}) + yyh4081.ElemContainerState(yyj4081) + if r.TryDecodeAsNil() { + yyv4081[yyj4081] = LimitRange{} + } else { + yyv4083 := &yyv4081[yyj4081] + yyv4083.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4081 := 0 + for ; !r.CheckBreak(); yyj4081++ { + + if yyj4081 >= len(yyv4081) { + yyv4081 = append(yyv4081, LimitRange{}) // var yyz4081 LimitRange + yyc4081 = true + } + yyh4081.ElemContainerState(yyj4081) + if yyj4081 < len(yyv4081) { + if r.TryDecodeAsNil() { + yyv4081[yyj4081] = LimitRange{} + } else { + yyv4084 := &yyv4081[yyj4081] + yyv4084.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4081 < len(yyv4081) { + yyv4081 = yyv4081[:yyj4081] + yyc4081 = true + } else if yyj4081 == 0 && yyv4081 == nil { + yyv4081 = []LimitRange{} + yyc4081 = true + } + } + yyh4081.End() + if yyc4081 { + *v = yyv4081 + } +} + +func (x codecSelfer1234) encSliceResourceQuota(v []ResourceQuota, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4085 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4086 := &yyv4085 + yy4086.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceResourceQuota(v *[]ResourceQuota, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4087 := *v + yyh4087, yyl4087 := z.DecSliceHelperStart() + var yyc4087 bool + if yyl4087 == 0 { + if yyv4087 == nil { + yyv4087 = []ResourceQuota{} + yyc4087 = true + } else if len(yyv4087) != 0 { + yyv4087 = yyv4087[:0] + yyc4087 = true + } + } else if yyl4087 > 0 { + var yyrr4087, yyrl4087 int + var yyrt4087 bool + if yyl4087 > cap(yyv4087) { + + yyrg4087 := len(yyv4087) > 0 + yyv24087 := yyv4087 + yyrl4087, yyrt4087 = z.DecInferLen(yyl4087, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4087 { + if yyrl4087 <= cap(yyv4087) { + yyv4087 = yyv4087[:yyrl4087] + } else { + yyv4087 = make([]ResourceQuota, yyrl4087) + } + } else { + yyv4087 = make([]ResourceQuota, yyrl4087) + } + yyc4087 = true + yyrr4087 = len(yyv4087) + if yyrg4087 { + copy(yyv4087, yyv24087) + } + } else if yyl4087 != len(yyv4087) { + yyv4087 = yyv4087[:yyl4087] + yyc4087 = true + } + yyj4087 := 0 + for ; yyj4087 < yyrr4087; yyj4087++ { + yyh4087.ElemContainerState(yyj4087) + if r.TryDecodeAsNil() { + yyv4087[yyj4087] = ResourceQuota{} + } else { + yyv4088 := &yyv4087[yyj4087] + yyv4088.CodecDecodeSelf(d) + } + + } + if yyrt4087 { + for ; yyj4087 < yyl4087; yyj4087++ { + yyv4087 = append(yyv4087, ResourceQuota{}) + yyh4087.ElemContainerState(yyj4087) + if r.TryDecodeAsNil() { + yyv4087[yyj4087] = ResourceQuota{} + } else { + yyv4089 := &yyv4087[yyj4087] + yyv4089.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4087 := 0 + for ; !r.CheckBreak(); yyj4087++ { + + if yyj4087 >= len(yyv4087) { + yyv4087 = append(yyv4087, ResourceQuota{}) // var yyz4087 ResourceQuota + yyc4087 = true + } + yyh4087.ElemContainerState(yyj4087) + if yyj4087 < len(yyv4087) { + if r.TryDecodeAsNil() { + yyv4087[yyj4087] = ResourceQuota{} + } else { + yyv4090 := &yyv4087[yyj4087] + yyv4090.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4087 < len(yyv4087) { + yyv4087 = yyv4087[:yyj4087] + yyc4087 = true + } else if yyj4087 == 0 && yyv4087 == nil { + yyv4087 = []ResourceQuota{} + yyc4087 = true + } + } + yyh4087.End() + if yyc4087 { + *v = yyv4087 + } +} + +func (x codecSelfer1234) encMapstringSliceuint8(v map[string][]uint8, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeMapStart(len(v)) + for yyk4091, yyv4091 := range v { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + yym4092 := z.EncBinary() + _ = yym4092 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(yyk4091)) + } + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyv4091 == nil { + r.EncodeNil() + } else { + yym4093 := z.EncBinary() + _ = yym4093 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW1234, []byte(yyv4091)) + } + } + } + z.EncSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) decMapstringSliceuint8(v *map[string][]uint8, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4094 := *v + yyl4094 := r.ReadMapStart() + yybh4094 := z.DecBasicHandle() + if yyv4094 == nil { + yyrl4094, _ := z.DecInferLen(yyl4094, yybh4094.MaxInitLen, 40) + yyv4094 = make(map[string][]uint8, yyrl4094) + *v = yyv4094 + } + var yymk4094 string + var yymv4094 []uint8 + var yymg4094 bool + if yybh4094.MapValueReset { + yymg4094 = true + } + if yyl4094 > 0 { + for yyj4094 := 0; yyj4094 < yyl4094; yyj4094++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk4094 = "" + } else { + yymk4094 = string(r.DecodeString()) + } + + if yymg4094 { + yymv4094 = yyv4094[yymk4094] + } else { + yymv4094 = nil + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv4094 = nil + } else { + yyv4096 := &yymv4094 + yym4097 := z.DecBinary() + _ = yym4097 + if false { + } else { + *yyv4096 = r.DecodeBytes(*(*[]byte)(yyv4096), false, false) + } + } + + if yyv4094 != nil { + yyv4094[yymk4094] = yymv4094 + } + } + } else if yyl4094 < 0 { + for yyj4094 := 0; !r.CheckBreak(); yyj4094++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk4094 = "" + } else { + yymk4094 = string(r.DecodeString()) + } + + if yymg4094 { + yymv4094 = yyv4094[yymk4094] + } else { + yymv4094 = nil + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv4094 = nil + } else { + yyv4099 := &yymv4094 + yym4100 := z.DecBinary() + _ = yym4100 + if false { + } else { + *yyv4099 = r.DecodeBytes(*(*[]byte)(yyv4099), false, false) + } + } + + if yyv4094 != nil { + yyv4094[yymk4094] = yymv4094 + } + } + } // else len==0: TODO: Should we clear map entries? + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) encSliceSecret(v []Secret, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4101 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4102 := &yyv4101 + yy4102.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceSecret(v *[]Secret, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4103 := *v + yyh4103, yyl4103 := z.DecSliceHelperStart() + var yyc4103 bool + if yyl4103 == 0 { + if yyv4103 == nil { + yyv4103 = []Secret{} + yyc4103 = true + } else if len(yyv4103) != 0 { + yyv4103 = yyv4103[:0] + yyc4103 = true + } + } else if yyl4103 > 0 { + var yyrr4103, yyrl4103 int + var yyrt4103 bool + if yyl4103 > cap(yyv4103) { + + yyrg4103 := len(yyv4103) > 0 + yyv24103 := yyv4103 + yyrl4103, yyrt4103 = z.DecInferLen(yyl4103, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4103 { + if yyrl4103 <= cap(yyv4103) { + yyv4103 = yyv4103[:yyrl4103] + } else { + yyv4103 = make([]Secret, yyrl4103) + } + } else { + yyv4103 = make([]Secret, yyrl4103) + } + yyc4103 = true + yyrr4103 = len(yyv4103) + if yyrg4103 { + copy(yyv4103, yyv24103) + } + } else if yyl4103 != len(yyv4103) { + yyv4103 = yyv4103[:yyl4103] + yyc4103 = true + } + yyj4103 := 0 + for ; yyj4103 < yyrr4103; yyj4103++ { + yyh4103.ElemContainerState(yyj4103) + if r.TryDecodeAsNil() { + yyv4103[yyj4103] = Secret{} + } else { + yyv4104 := &yyv4103[yyj4103] + yyv4104.CodecDecodeSelf(d) + } + + } + if yyrt4103 { + for ; yyj4103 < yyl4103; yyj4103++ { + yyv4103 = append(yyv4103, Secret{}) + yyh4103.ElemContainerState(yyj4103) + if r.TryDecodeAsNil() { + yyv4103[yyj4103] = Secret{} + } else { + yyv4105 := &yyv4103[yyj4103] + yyv4105.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4103 := 0 + for ; !r.CheckBreak(); yyj4103++ { + + if yyj4103 >= len(yyv4103) { + yyv4103 = append(yyv4103, Secret{}) // var yyz4103 Secret + yyc4103 = true + } + yyh4103.ElemContainerState(yyj4103) + if yyj4103 < len(yyv4103) { + if r.TryDecodeAsNil() { + yyv4103[yyj4103] = Secret{} + } else { + yyv4106 := &yyv4103[yyj4103] + yyv4106.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4103 < len(yyv4103) { + yyv4103 = yyv4103[:yyj4103] + yyc4103 = true + } else if yyj4103 == 0 && yyv4103 == nil { + yyv4103 = []Secret{} + yyc4103 = true + } + } + yyh4103.End() + if yyc4103 { + *v = yyv4103 + } +} + +func (x codecSelfer1234) encSliceConfigMap(v []ConfigMap, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4107 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4108 := &yyv4107 + yy4108.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceConfigMap(v *[]ConfigMap, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4109 := *v + yyh4109, yyl4109 := z.DecSliceHelperStart() + var yyc4109 bool + if yyl4109 == 0 { + if yyv4109 == nil { + yyv4109 = []ConfigMap{} + yyc4109 = true + } else if len(yyv4109) != 0 { + yyv4109 = yyv4109[:0] + yyc4109 = true + } + } else if yyl4109 > 0 { + var yyrr4109, yyrl4109 int + var yyrt4109 bool + if yyl4109 > cap(yyv4109) { + + yyrg4109 := len(yyv4109) > 0 + yyv24109 := yyv4109 + yyrl4109, yyrt4109 = z.DecInferLen(yyl4109, z.DecBasicHandle().MaxInitLen, 200) + if yyrt4109 { + if yyrl4109 <= cap(yyv4109) { + yyv4109 = yyv4109[:yyrl4109] + } else { + yyv4109 = make([]ConfigMap, yyrl4109) + } + } else { + yyv4109 = make([]ConfigMap, yyrl4109) + } + yyc4109 = true + yyrr4109 = len(yyv4109) + if yyrg4109 { + copy(yyv4109, yyv24109) + } + } else if yyl4109 != len(yyv4109) { + yyv4109 = yyv4109[:yyl4109] + yyc4109 = true + } + yyj4109 := 0 + for ; yyj4109 < yyrr4109; yyj4109++ { + yyh4109.ElemContainerState(yyj4109) + if r.TryDecodeAsNil() { + yyv4109[yyj4109] = ConfigMap{} + } else { + yyv4110 := &yyv4109[yyj4109] + yyv4110.CodecDecodeSelf(d) + } + + } + if yyrt4109 { + for ; yyj4109 < yyl4109; yyj4109++ { + yyv4109 = append(yyv4109, ConfigMap{}) + yyh4109.ElemContainerState(yyj4109) + if r.TryDecodeAsNil() { + yyv4109[yyj4109] = ConfigMap{} + } else { + yyv4111 := &yyv4109[yyj4109] + yyv4111.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4109 := 0 + for ; !r.CheckBreak(); yyj4109++ { + + if yyj4109 >= len(yyv4109) { + yyv4109 = append(yyv4109, ConfigMap{}) // var yyz4109 ConfigMap + yyc4109 = true + } + yyh4109.ElemContainerState(yyj4109) + if yyj4109 < len(yyv4109) { + if r.TryDecodeAsNil() { + yyv4109[yyj4109] = ConfigMap{} + } else { + yyv4112 := &yyv4109[yyj4109] + yyv4112.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4109 < len(yyv4109) { + yyv4109 = yyv4109[:yyj4109] + yyc4109 = true + } else if yyj4109 == 0 && yyv4109 == nil { + yyv4109 = []ConfigMap{} + yyc4109 = true + } + } + yyh4109.End() + if yyc4109 { + *v = yyv4109 + } +} + +func (x codecSelfer1234) encSliceComponentCondition(v []ComponentCondition, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4113 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4114 := &yyv4113 + yy4114.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceComponentCondition(v *[]ComponentCondition, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4115 := *v + yyh4115, yyl4115 := z.DecSliceHelperStart() + var yyc4115 bool + if yyl4115 == 0 { + if yyv4115 == nil { + yyv4115 = []ComponentCondition{} + yyc4115 = true + } else if len(yyv4115) != 0 { + yyv4115 = yyv4115[:0] + yyc4115 = true + } + } else if yyl4115 > 0 { + var yyrr4115, yyrl4115 int + var yyrt4115 bool + if yyl4115 > cap(yyv4115) { + + yyrg4115 := len(yyv4115) > 0 + yyv24115 := yyv4115 + yyrl4115, yyrt4115 = z.DecInferLen(yyl4115, z.DecBasicHandle().MaxInitLen, 64) + if yyrt4115 { + if yyrl4115 <= cap(yyv4115) { + yyv4115 = yyv4115[:yyrl4115] + } else { + yyv4115 = make([]ComponentCondition, yyrl4115) + } + } else { + yyv4115 = make([]ComponentCondition, yyrl4115) + } + yyc4115 = true + yyrr4115 = len(yyv4115) + if yyrg4115 { + copy(yyv4115, yyv24115) + } + } else if yyl4115 != len(yyv4115) { + yyv4115 = yyv4115[:yyl4115] + yyc4115 = true + } + yyj4115 := 0 + for ; yyj4115 < yyrr4115; yyj4115++ { + yyh4115.ElemContainerState(yyj4115) + if r.TryDecodeAsNil() { + yyv4115[yyj4115] = ComponentCondition{} + } else { + yyv4116 := &yyv4115[yyj4115] + yyv4116.CodecDecodeSelf(d) + } + + } + if yyrt4115 { + for ; yyj4115 < yyl4115; yyj4115++ { + yyv4115 = append(yyv4115, ComponentCondition{}) + yyh4115.ElemContainerState(yyj4115) + if r.TryDecodeAsNil() { + yyv4115[yyj4115] = ComponentCondition{} + } else { + yyv4117 := &yyv4115[yyj4115] + yyv4117.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4115 := 0 + for ; !r.CheckBreak(); yyj4115++ { + + if yyj4115 >= len(yyv4115) { + yyv4115 = append(yyv4115, ComponentCondition{}) // var yyz4115 ComponentCondition + yyc4115 = true + } + yyh4115.ElemContainerState(yyj4115) + if yyj4115 < len(yyv4115) { + if r.TryDecodeAsNil() { + yyv4115[yyj4115] = ComponentCondition{} + } else { + yyv4118 := &yyv4115[yyj4115] + yyv4118.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4115 < len(yyv4115) { + yyv4115 = yyv4115[:yyj4115] + yyc4115 = true + } else if yyj4115 == 0 && yyv4115 == nil { + yyv4115 = []ComponentCondition{} + yyc4115 = true + } + } + yyh4115.End() + if yyc4115 { + *v = yyv4115 + } +} + +func (x codecSelfer1234) encSliceComponentStatus(v []ComponentStatus, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4119 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4120 := &yyv4119 + yy4120.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceComponentStatus(v *[]ComponentStatus, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4121 := *v + yyh4121, yyl4121 := z.DecSliceHelperStart() + var yyc4121 bool + if yyl4121 == 0 { + if yyv4121 == nil { + yyv4121 = []ComponentStatus{} + yyc4121 = true + } else if len(yyv4121) != 0 { + yyv4121 = yyv4121[:0] + yyc4121 = true + } + } else if yyl4121 > 0 { + var yyrr4121, yyrl4121 int + var yyrt4121 bool + if yyl4121 > cap(yyv4121) { + + yyrg4121 := len(yyv4121) > 0 + yyv24121 := yyv4121 + yyrl4121, yyrt4121 = z.DecInferLen(yyl4121, z.DecBasicHandle().MaxInitLen, 216) + if yyrt4121 { + if yyrl4121 <= cap(yyv4121) { + yyv4121 = yyv4121[:yyrl4121] + } else { + yyv4121 = make([]ComponentStatus, yyrl4121) + } + } else { + yyv4121 = make([]ComponentStatus, yyrl4121) + } + yyc4121 = true + yyrr4121 = len(yyv4121) + if yyrg4121 { + copy(yyv4121, yyv24121) + } + } else if yyl4121 != len(yyv4121) { + yyv4121 = yyv4121[:yyl4121] + yyc4121 = true + } + yyj4121 := 0 + for ; yyj4121 < yyrr4121; yyj4121++ { + yyh4121.ElemContainerState(yyj4121) + if r.TryDecodeAsNil() { + yyv4121[yyj4121] = ComponentStatus{} + } else { + yyv4122 := &yyv4121[yyj4121] + yyv4122.CodecDecodeSelf(d) + } + + } + if yyrt4121 { + for ; yyj4121 < yyl4121; yyj4121++ { + yyv4121 = append(yyv4121, ComponentStatus{}) + yyh4121.ElemContainerState(yyj4121) + if r.TryDecodeAsNil() { + yyv4121[yyj4121] = ComponentStatus{} + } else { + yyv4123 := &yyv4121[yyj4121] + yyv4123.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4121 := 0 + for ; !r.CheckBreak(); yyj4121++ { + + if yyj4121 >= len(yyv4121) { + yyv4121 = append(yyv4121, ComponentStatus{}) // var yyz4121 ComponentStatus + yyc4121 = true + } + yyh4121.ElemContainerState(yyj4121) + if yyj4121 < len(yyv4121) { + if r.TryDecodeAsNil() { + yyv4121[yyj4121] = ComponentStatus{} + } else { + yyv4124 := &yyv4121[yyj4121] + yyv4124.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4121 < len(yyv4121) { + yyv4121 = yyv4121[:yyj4121] + yyc4121 = true + } else if yyj4121 == 0 && yyv4121 == nil { + yyv4121 = []ComponentStatus{} + yyc4121 = true + } + } + yyh4121.End() + if yyc4121 { + *v = yyv4121 + } +} + +func (x codecSelfer1234) encSliceDownwardAPIVolumeFile(v []DownwardAPIVolumeFile, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv4125 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy4126 := &yyv4125 + yy4126.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceDownwardAPIVolumeFile(v *[]DownwardAPIVolumeFile, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv4127 := *v + yyh4127, yyl4127 := z.DecSliceHelperStart() + var yyc4127 bool + if yyl4127 == 0 { + if yyv4127 == nil { + yyv4127 = []DownwardAPIVolumeFile{} + yyc4127 = true + } else if len(yyv4127) != 0 { + yyv4127 = yyv4127[:0] + yyc4127 = true + } + } else if yyl4127 > 0 { + var yyrr4127, yyrl4127 int + var yyrt4127 bool + if yyl4127 > cap(yyv4127) { + + yyrg4127 := len(yyv4127) > 0 + yyv24127 := yyv4127 + yyrl4127, yyrt4127 = z.DecInferLen(yyl4127, z.DecBasicHandle().MaxInitLen, 48) + if yyrt4127 { + if yyrl4127 <= cap(yyv4127) { + yyv4127 = yyv4127[:yyrl4127] + } else { + yyv4127 = make([]DownwardAPIVolumeFile, yyrl4127) + } + } else { + yyv4127 = make([]DownwardAPIVolumeFile, yyrl4127) + } + yyc4127 = true + yyrr4127 = len(yyv4127) + if yyrg4127 { + copy(yyv4127, yyv24127) + } + } else if yyl4127 != len(yyv4127) { + yyv4127 = yyv4127[:yyl4127] + yyc4127 = true + } + yyj4127 := 0 + for ; yyj4127 < yyrr4127; yyj4127++ { + yyh4127.ElemContainerState(yyj4127) + if r.TryDecodeAsNil() { + yyv4127[yyj4127] = DownwardAPIVolumeFile{} + } else { + yyv4128 := &yyv4127[yyj4127] + yyv4128.CodecDecodeSelf(d) + } + + } + if yyrt4127 { + for ; yyj4127 < yyl4127; yyj4127++ { + yyv4127 = append(yyv4127, DownwardAPIVolumeFile{}) + yyh4127.ElemContainerState(yyj4127) + if r.TryDecodeAsNil() { + yyv4127[yyj4127] = DownwardAPIVolumeFile{} + } else { + yyv4129 := &yyv4127[yyj4127] + yyv4129.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj4127 := 0 + for ; !r.CheckBreak(); yyj4127++ { + + if yyj4127 >= len(yyv4127) { + yyv4127 = append(yyv4127, DownwardAPIVolumeFile{}) // var yyz4127 DownwardAPIVolumeFile + yyc4127 = true + } + yyh4127.ElemContainerState(yyj4127) + if yyj4127 < len(yyv4127) { + if r.TryDecodeAsNil() { + yyv4127[yyj4127] = DownwardAPIVolumeFile{} + } else { + yyv4130 := &yyv4127[yyj4127] + yyv4130.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj4127 < len(yyv4127) { + yyv4127 = yyv4127[:yyj4127] + yyc4127 = true + } else if yyj4127 == 0 && yyv4127 == nil { + yyv4127 = []DownwardAPIVolumeFile{} + yyc4127 = true + } + } + yyh4127.End() + if yyc4127 { + *v = yyv4127 + } +} diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 0f8b93817b5..e07164816ca 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -261,6 +261,8 @@ type VolumeSource struct { DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty"` // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. FC *FCVolumeSource `json:"fc,omitempty"` + // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` } // PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. @@ -319,6 +321,8 @@ type PersistentVolumeSource struct { // provisioned/attached using a exec based plugin. This is an // alpha feature and may change in future. FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty"` + // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` } // PersistentVolume (PV) is a storage resource provisioned by an administrator. @@ -538,7 +542,7 @@ type RBDVolumeSource struct { RBDImage string `json:"image"` // 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". + // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd // TODO: how do we prevent errors in the filesystem from compromising the machine FSType string `json:"fsType,omitempty"` @@ -573,9 +577,9 @@ type CinderVolumeSource struct { // volume id used to identify the volume in cinder // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md VolumeID string `json:"volumeID"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Only ext3 and ext4 are allowed + // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md FSType string `json:"fsType,omitempty"` // Optional: Defaults to false (read/write). ReadOnly here will force @@ -644,10 +648,10 @@ type GCEPersistentDiskVolumeSource struct { PDName string `json:"pdName"` // 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". + // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk // TODO: how do we prevent errors in the filesystem from compromising the machine - FSType string `json:"fsType"` + FSType string `json:"fsType,omitempty"` // The partition in the volume that you want to mount. // If omitted, the default is to mount by volume name. // Examples: For volume /dev/sda1, you specify the partition as "1". @@ -665,9 +669,9 @@ type GCEPersistentDiskVolumeSource struct { type FlexVolumeSource struct { // Driver is the name of the driver to use for this volume. Driver string `json:"driver"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. FSType string `json:"fsType,omitempty"` // Optional: SecretRef is reference to the authentication secret for User, default is empty. SecretRef *LocalObjectReference `json:"secretRef,omitempty"` @@ -690,10 +694,10 @@ type AWSElasticBlockStoreVolumeSource struct { VolumeID string `json:"volumeID"` // 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". + // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore // TODO: how do we prevent errors in the filesystem from compromising the machine - FSType string `json:"fsType"` + FSType string `json:"fsType,omitempty"` // The partition in the volume that you want to mount. // If omitted, the default is to mount by volume name. // Examples: For volume /dev/sda1, you specify the partition as "1". @@ -764,10 +768,10 @@ type ISCSIVolumeSource struct { ISCSIInterface string `json:"iscsiInterface,omitempty"` // 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". + // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi // TODO: how do we prevent errors in the filesystem from compromising the machine - FSType string `json:"fsType"` + FSType string `json:"fsType,omitempty"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. ReadOnly bool `json:"readOnly,omitempty"` @@ -781,16 +785,27 @@ type FCVolumeSource struct { TargetWWNs []string `json:"targetWWNs"` // Required: FC target lun number Lun *int32 `json:"lun"` - // Required: Filesystem type to mount. + // Filesystem type to mount. // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs" + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // TODO: how do we prevent errors in the filesystem from compromising the machine - FSType string `json:"fsType"` + FSType string `json:"fsType,omitempty"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. ReadOnly bool `json:"readOnly,omitempty"` } +// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. +type AzureFileVolumeSource struct { + // the name of secret that contains Azure Storage Account Name and Key + SecretName string `json:"secretName"` + // Share Name + ShareName string `json:"shareName"` + // Defaults to false (read/write). ReadOnly here will force + // the ReadOnly setting in VolumeMounts. + ReadOnly bool `json:"readOnly,omitempty"` +} + // ContainerPort represents a network port in a single container. type ContainerPort struct { // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each @@ -877,6 +892,14 @@ type SecretKeySelector struct { Key string `json:"key"` } +// HTTPHeader describes a custom header to be used in HTTP probes +type HTTPHeader struct { + // The header field name + Name string `json:"name"` + // The header field value + Value string `json:"value"` +} + // HTTPGetAction describes an action based on HTTP Get requests. type HTTPGetAction struct { // Path to access on the HTTP server. @@ -885,11 +908,14 @@ type HTTPGetAction struct { // Number must be in the range 1 to 65535. // Name must be an IANA_SVC_NAME. Port intstr.IntOrString `json:"port"` - // Host name to connect to, defaults to the pod IP. + // Host name to connect to, defaults to the pod IP. You probably want to set + // "Host" in httpHeaders instead. Host string `json:"host,omitempty"` // Scheme to use for connecting to the host. // Defaults to HTTP. Scheme URIScheme `json:"scheme,omitempty"` + // Custom headers to set in the request. HTTP allows repeated headers. + HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"` } // URIScheme identifies the scheme used for connection to a host for Get actions @@ -1273,6 +1299,94 @@ const ( DefaultTerminationGracePeriodSeconds = 30 ) +// A node selector represents the union of the results of one or more label queries +// over a set of nodes; that is, it represents the OR of the selectors represented +// by the node selector terms. +type NodeSelector struct { + //Required. A list of node selector terms. The terms are ORed. + NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"` +} + +// A null or empty node selector term matches no objects. +type NodeSelectorTerm struct { + //Required. A list of node selector requirements. The requirements are ANDed. + MatchExpressions []NodeSelectorRequirement `json:"matchExpressions"` +} + +// A node selector requirement is a selector that contains values, a key, and an operator +// that relates the key and values. +type NodeSelectorRequirement struct { + // The label key that the selector applies to. + Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` + // Represents a key's relationship to a set of values. + // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + Operator NodeSelectorOperator `json:"operator"` + // An array of string values. If the operator is In or NotIn, + // the values array must be non-empty. If the operator is Exists or DoesNotExist, + // the values array must be empty. If the operator is Gt or Lt, the values + // array must have a single element, which will be interpreted as an integer. + // This array is replaced during a strategic merge patch. + Values []string `json:"values,omitempty"` +} + +// A node selector operator is the set of operators that can be used in +// a node selector requirement. +type NodeSelectorOperator string + +const ( + NodeSelectorOpIn NodeSelectorOperator = "In" + NodeSelectorOpNotIn NodeSelectorOperator = "NotIn" + NodeSelectorOpExists NodeSelectorOperator = "Exists" + NodeSelectorOpDoesNotExist NodeSelectorOperator = "DoesNotExist" + NodeSelectorOpGt NodeSelectorOperator = "Gt" + NodeSelectorOpLt NodeSelectorOperator = "Lt" +) + +// Affinity is a group of affinity scheduling requirements, +// including node affinity and inter pod affinity. +type Affinity struct { + // Describes node affinity scheduling requirements for the pod. + NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"` +} + +// Node affinity is a group of node affinity scheduling requirements. +// If RequiredDuringSchedulingRequiredDuringExecution and +// RequiredDuringSchedulingIgnoredDuringExecution are both set, +// then both node selectors must be satisfied. +type NodeAffinity struct { + // If the affinity requirements specified by this field are not met at + // scheduling time, the pod will not be scheduled onto the node. + // If the affinity requirements specified by this field cease to be met + // at some point during pod execution (e.g. due to an update), the system + // will try to eventually evict the pod from its node. + RequiredDuringSchedulingRequiredDuringExecution *NodeSelector `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` + // If the affinity requirements specified by this field are not met at + // scheduling time, the pod will not be scheduled onto the node. + // If the affinity requirements specified by this field cease to be met + // at some point during pod execution (e.g. due to an update), the system + // may or may not try to eventually evict the pod from its node. + RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` + // The scheduler will prefer to schedule pods to nodes that satisfy + // the affinity expressions specified by this field, but it may choose + // a node that violates one or more of the expressions. The node that is + // most preferred is the one with the greatest sum of weights, i.e. + // for each node that meets all of the scheduling requirements (resource + // request, requiredDuringScheduling affinity expressions, etc.), + // compute a sum by iterating through the elements of this field and adding + // "weight" to the sum if the node matches the corresponding matchExpressions; the + // node(s) with the highest sum are the most preferred. + PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +// An empty preferred scheduling term matches all objects with implicit weight 0 +// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). +type PreferredSchedulingTerm struct { + // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + Weight int `json:"weight"` + // A node selector term, associated with the corresponding weight. + Preference NodeSelectorTerm `json:"preference"` +} + // PodSpec is a description of a pod. type PodSpec struct { // List of volumes that can be mounted by containers belonging to the pod. @@ -2554,6 +2668,21 @@ const ( // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets DockerConfigKey = ".dockercfg" + + // SecretTypeTLS contains information about a TLS client or server secret. It + // is primarily used with TLS termination of the Ingress resource, but may be + // used in other types. + // + // Required fields: + // - Secret.Data["tls.key"] - TLS private key. + // Secret.Data["tls.crt"] - TLS certificate. + // 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 = "tls.crt" + // TLSPrivateKeyKey is the key for the private key field in a TLS secret. + TLSPrivateKeyKey = "tls.key" ) // SecretList is a list of Secret. diff --git a/pkg/api/v1/types_swagger_doc_generated.go b/pkg/api/v1/types_swagger_doc_generated.go index d1c6aea9b47..98fb742819b 100644 --- a/pkg/api/v1/types_swagger_doc_generated.go +++ b/pkg/api/v1/types_swagger_doc_generated.go @@ -30,7 +30,7 @@ package v1 var map_AWSElasticBlockStoreVolumeSource = map[string]string{ "": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist and be formatted before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "volumeID": "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore", - "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore", + "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#awselasticblockstore", "partition": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", "readOnly": "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore", } @@ -39,6 +39,26 @@ func (AWSElasticBlockStoreVolumeSource) SwaggerDoc() map[string]string { return map_AWSElasticBlockStoreVolumeSource } +var map_Affinity = map[string]string{ + "": "Affinity is a group of affinity scheduling requirements, including node affinity and inter pod affinity.", + "nodeAffinity": "Describes node affinity scheduling requirements for the pod.", +} + +func (Affinity) SwaggerDoc() map[string]string { + return map_Affinity +} + +var map_AzureFileVolumeSource = map[string]string{ + "": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", + "secretName": "the name of secret that contains Azure Storage Account Name and Key", + "shareName": "Share Name", + "readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", +} + +func (AzureFileVolumeSource) SwaggerDoc() map[string]string { + return map_AzureFileVolumeSource +} + var map_Binding = map[string]string{ "": "Binding ties one object to another. For example, a pod is bound to a node by a scheduler.", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", @@ -76,7 +96,7 @@ func (CephFSVolumeSource) SwaggerDoc() map[string]string { var map_CinderVolumeSource = map[string]string{ "": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", "volumeID": "volume id used to identify the volume in cinder More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "fsType": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Only ext3 and ext4 are allowed More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", + "fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", } @@ -435,7 +455,7 @@ var map_FCVolumeSource = map[string]string{ "": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "targetWWNs": "Required: FC target world wide names (WWNs)", "lun": "Required: FC target lun number", - "fsType": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"", + "fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", } @@ -446,7 +466,7 @@ func (FCVolumeSource) SwaggerDoc() map[string]string { var map_FlexVolumeSource = map[string]string{ "": "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.", "driver": "Driver is the name of the driver to use for this volume.", - "fsType": "Required: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\"", + "fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", "secretRef": "Optional: SecretRef is reference to the authentication secret for User, default is empty.", "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "options": "Optional: Extra command options if any.", @@ -468,7 +488,7 @@ func (FlockerVolumeSource) SwaggerDoc() map[string]string { var map_GCEPersistentDiskVolumeSource = map[string]string{ "": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist and be formatted before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once. GCE PDs support ownership management and SELinux relabeling.", "pdName": "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk", - "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk", + "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#gcepersistentdisk", "partition": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk", "readOnly": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk", } @@ -500,17 +520,28 @@ func (GlusterfsVolumeSource) SwaggerDoc() map[string]string { } var map_HTTPGetAction = map[string]string{ - "": "HTTPGetAction describes an action based on HTTP Get requests.", - "path": "Path to access on the HTTP server.", - "port": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - "host": "Host name to connect to, defaults to the pod IP.", - "scheme": "Scheme to use for connecting to the host. Defaults to HTTP.", + "": "HTTPGetAction describes an action based on HTTP Get requests.", + "path": "Path to access on the HTTP server.", + "port": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", + "host": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", + "scheme": "Scheme to use for connecting to the host. Defaults to HTTP.", + "httpHeaders": "Custom headers to set in the request. HTTP allows repeated headers.", } func (HTTPGetAction) SwaggerDoc() map[string]string { return map_HTTPGetAction } +var map_HTTPHeader = map[string]string{ + "": "HTTPHeader describes a custom header to be used in HTTP probes", + "name": "The header field name", + "value": "The header field value", +} + +func (HTTPHeader) SwaggerDoc() map[string]string { + return map_HTTPHeader +} + var map_Handler = map[string]string{ "": "Handler defines a specific action that should be taken", "exec": "One and only one of the following should be specified. Exec specifies the action to take.", @@ -537,7 +568,7 @@ var map_ISCSIVolumeSource = map[string]string{ "iqn": "Target iSCSI Qualified Name.", "lun": "iSCSI target lun number.", "iscsiInterface": "Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport.", - "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi", + "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#iscsi", "readOnly": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", } @@ -720,6 +751,17 @@ func (NodeAddress) SwaggerDoc() map[string]string { return map_NodeAddress } +var map_NodeAffinity = map[string]string{ + "": "Node affinity is a group of node affinity scheduling requirements. If RequiredDuringSchedulingRequiredDuringExecution and RequiredDuringSchedulingIgnoredDuringExecution are both set, then both node selectors must be satisfied.", + "requiredDuringSchedulingRequiredDuringExecution": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system will try to eventually evict the pod from its node.", + "requiredDuringSchedulingIgnoredDuringExecution": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.", + "preferredDuringSchedulingIgnoredDuringExecution": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", +} + +func (NodeAffinity) SwaggerDoc() map[string]string { + return map_NodeAffinity +} + var map_NodeCondition = map[string]string{ "": "NodeCondition contains condition infromation for a node.", "type": "Type of node condition.", @@ -753,6 +795,35 @@ func (NodeList) SwaggerDoc() map[string]string { return map_NodeList } +var map_NodeSelector = map[string]string{ + "": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", + "nodeSelectorTerms": "Required. A list of node selector terms. The terms are ORed.", +} + +func (NodeSelector) SwaggerDoc() map[string]string { + return map_NodeSelector +} + +var map_NodeSelectorRequirement = map[string]string{ + "": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", + "key": "The label key that the selector applies to.", + "operator": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", + "values": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", +} + +func (NodeSelectorRequirement) SwaggerDoc() map[string]string { + return map_NodeSelectorRequirement +} + +var map_NodeSelectorTerm = map[string]string{ + "": "A null or empty node selector term matches no objects.", + "matchExpressions": "Required. A list of node selector requirements. The requirements are ANDed.", +} + +func (NodeSelectorTerm) SwaggerDoc() map[string]string { + return map_NodeSelectorTerm +} + var map_NodeSpec = map[string]string{ "": "NodeSpec describes the attributes that a node is created with.", "podCIDR": "PodCIDR represents the pod IP range assigned to the node.", @@ -930,6 +1001,7 @@ var map_PersistentVolumeSource = map[string]string{ "fc": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", "flocker": "Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", "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.", + "azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", } func (PersistentVolumeSource) SwaggerDoc() map[string]string { @@ -1138,6 +1210,16 @@ func (PodTemplateSpec) SwaggerDoc() map[string]string { return map_PodTemplateSpec } +var map_PreferredSchedulingTerm = map[string]string{ + "": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", + "weight": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", + "preference": "A node selector term, associated with the corresponding weight.", +} + +func (PreferredSchedulingTerm) SwaggerDoc() map[string]string { + return map_PreferredSchedulingTerm +} + var map_Probe = map[string]string{ "": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", "initialDelaySeconds": "Number of seconds after the container has started before liveness probes are initiated. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes", @@ -1155,7 +1237,7 @@ 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", - "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\". More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd", + "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", @@ -1471,6 +1553,7 @@ var map_VolumeSource = map[string]string{ "flocker": "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", "downwardAPI": "DownwardAPI represents downward API about the pod that should populate this volume", "fc": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", + "azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", } func (VolumeSource) SwaggerDoc() map[string]string { diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 17013ee7e20..ff38e7fa09c 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -97,6 +97,10 @@ func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) fie if totalSize > (int64)(totalAnnotationSizeLimitB) { allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB)) } + + if annotations[api.AffinityAnnotationKey] != "" { + allErrs = append(allErrs, ValidateAffinityInPodAnnotations(annotations, fldPath)...) + } return allErrs } @@ -275,7 +279,7 @@ func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn Val } } else { if len(meta.Namespace) != 0 { - allErrs = append(allErrs, field.Forbidden(fldPath, "not allowed on this type")) + allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "not allowed on this type")) } } allErrs = append(allErrs, ValidateNonnegativeField(meta.Generation, fldPath.Child("generation"))...) @@ -490,6 +494,10 @@ func validateVolumeSource(source *api.VolumeSource, fldPath *field.Path) field.E numVolumes++ allErrs = append(allErrs, validateFlexVolumeSource(source.FlexVolume, fldPath.Child("flexVolume"))...) } + if source.AzureFile != nil { + numVolumes++ + allErrs = append(allErrs, validateAzureFile(source.AzureFile, fldPath.Child("azureFile"))...) + } if numVolumes == 0 { allErrs = append(allErrs, field.Required(fldPath, "must specify a volume type")) } @@ -524,9 +532,6 @@ func validateISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, fldPath *field.Path if len(iscsi.IQN) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("iqn"), "")) } - if len(iscsi.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } if iscsi.Lun < 0 || iscsi.Lun > 255 { allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), iscsi.Lun, InclusiveRangeErrorMsg(0, 255))) } @@ -539,10 +544,6 @@ func validateFCVolumeSource(fc *api.FCVolumeSource, fldPath *field.Path) field.E allErrs = append(allErrs, field.Required(fldPath.Child("targetWWNs"), "")) } - if len(fc.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } - if fc.Lun == nil { allErrs = append(allErrs, field.Required(fldPath.Child("lun"), "")) } else { @@ -558,9 +559,6 @@ func validateGCEPersistentDiskVolumeSource(pd *api.GCEPersistentDiskVolumeSource if len(pd.PDName) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("pdName"), "")) } - if len(pd.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } if pd.Partition < 0 || pd.Partition > 255 { allErrs = append(allErrs, field.Invalid(fldPath.Child("partition"), pd.Partition, pdPartitionErrorMsg)) } @@ -572,9 +570,6 @@ func validateAWSElasticBlockStoreVolumeSource(PD *api.AWSElasticBlockStoreVolume if len(PD.VolumeID) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("volumeID"), "")) } - if len(PD.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } if PD.Partition < 0 || PD.Partition > 255 { allErrs = append(allErrs, field.Invalid(fldPath.Child("partition"), PD.Partition, pdPartitionErrorMsg)) } @@ -678,9 +673,6 @@ func validateRBDVolumeSource(rbd *api.RBDVolumeSource, fldPath *field.Path) fiel if len(rbd.RBDImage) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("image"), "")) } - if len(rbd.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } return allErrs } @@ -689,9 +681,6 @@ func validateCinderVolumeSource(cd *api.CinderVolumeSource, fldPath *field.Path) if len(cd.VolumeID) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("volumeID"), "")) } - if len(cd.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) - } return allErrs } @@ -708,8 +697,16 @@ func validateFlexVolumeSource(fv *api.FlexVolumeSource, fldPath *field.Path) fie if len(fv.Driver) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("driver"), "")) } - if len(fv.FSType) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("fsType"), "")) + return allErrs +} + +func validateAzureFile(azure *api.AzureFileVolumeSource, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if azure.SecretName == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("secretName"), "")) + } + if azure.ShareName == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("shareName"), "")) } return allErrs } @@ -838,6 +835,10 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList { numVolumes++ allErrs = append(allErrs, validateFlexVolumeSource(pv.Spec.FlexVolume, specPath.Child("flexVolume"))...) } + if pv.Spec.AzureFile != nil { + numVolumes++ + allErrs = append(allErrs, validateAzureFile(pv.Spec.AzureFile, specPath.Child("azureFile"))...) + } if numVolumes == 0 { allErrs = append(allErrs, field.Required(specPath, "must specify a volume type")) } @@ -1124,6 +1125,11 @@ func validateHTTPGetAction(http *api.HTTPGetAction, fldPath *field.Path) field.E 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()))) } + 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))) + } + } return allErrors } @@ -1346,6 +1352,102 @@ func ValidatePodSpec(spec *api.PodSpec, fldPath *field.Path) field.ErrorList { return allErrs } +// ValidateNodeSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data +func ValidateNodeSelectorRequirement(rq api.NodeSelectorRequirement, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + switch rq.Operator { + case api.NodeSelectorOpIn, api.NodeSelectorOpNotIn: + if len(rq.Values) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'")) + } + case api.NodeSelectorOpExists, api.NodeSelectorOpDoesNotExist: + if len(rq.Values) > 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'")) + } + + case api.NodeSelectorOpGt, api.NodeSelectorOpLt: + if len(rq.Values) != 1 { + allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified single value when `operator` is 'Lt' or 'Gt'")) + } + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), rq.Operator, "not a valid selector operator")) + } + allErrs = append(allErrs, ValidateLabelName(rq.Key, fldPath.Child("key"))...) + return allErrs +} + +// ValidateNodeSelectorTerm tests that the specified node selector term has valid data +func ValidateNodeSelectorTerm(term api.NodeSelectorTerm, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if len(term.MatchExpressions) == 0 { + return append(allErrs, field.Required(fldPath.Child("matchExpressions"), "must have at least one node selector requirement")) + } + for j, req := range term.MatchExpressions { + allErrs = append(allErrs, ValidateNodeSelectorRequirement(req, fldPath.Child("matchExpressions").Index(j))...) + } + return allErrs +} + +// ValidateNodeSelector tests that the specified nodeSelector fields has valid data +func ValidateNodeSelector(nodeSelector *api.NodeSelector, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + termFldPath := fldPath.Child("nodeSelectorTerms") + if len(nodeSelector.NodeSelectorTerms) == 0 { + return append(allErrs, field.Required(termFldPath, "must have at least one node selector term")) + } + + for i, term := range nodeSelector.NodeSelectorTerms { + allErrs = append(allErrs, ValidateNodeSelectorTerm(term, termFldPath.Index(i))...) + } + + return allErrs +} + +// ValidatePreferredSchedulingTerms tests that the specified SoftNodeAffinity fields has valid data +func ValidatePreferredSchedulingTerms(terms []api.PreferredSchedulingTerm, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + for i, term := range terms { + if term.Weight <= 0 || term.Weight > 100 { + allErrs = append(allErrs, field.Invalid(fldPath.Index(i).Child("weight"), term.Weight, "must be in the range 1-100")) + } + + allErrs = append(allErrs, ValidateNodeSelectorTerm(term.Preference, fldPath.Index(i).Child("preference"))...) + } + return allErrs +} + +// ValidateAffinityInPodAnnotations tests that the serialized Affinity in Pod.Annotations has valid data +func ValidateAffinityInPodAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + affinity, err := api.GetAffinityFromPodAnnotations(annotations) + if err != nil { + allErrs = append(allErrs, field.Invalid(fldPath, api.AffinityAnnotationKey, err.Error())) + return allErrs + } + + if affinity.NodeAffinity != nil { + na := affinity.NodeAffinity + if na.RequiredDuringSchedulingRequiredDuringExecution != nil { + allErrs = append(allErrs, ValidateNodeSelector(na.RequiredDuringSchedulingRequiredDuringExecution, fldPath.Child("requiredDuringSchedulingRequiredDuringExecution"))...) + } + + if na.RequiredDuringSchedulingIgnoredDuringExecution != nil { + allErrs = append(allErrs, ValidateNodeSelector(na.RequiredDuringSchedulingIgnoredDuringExecution, fldPath.Child("requiredDuringSchedulingIgnoredDuringExecution"))...) + } + + if len(na.PreferredDuringSchedulingIgnoredDuringExecution) > 0 { + allErrs = append(allErrs, ValidatePreferredSchedulingTerms(na.PreferredDuringSchedulingIgnoredDuringExecution, fldPath.Child("preferredDuringSchedulingIgnoredDuringExecution"))...) + + } + } + + return allErrs +} + // ValidatePodSecurityContext test that the specified PodSecurityContext has valid data. func ValidatePodSecurityContext(securityContext *api.PodSecurityContext, spec *api.PodSpec, specPath, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -1380,20 +1482,58 @@ func ValidatePodUpdate(newPod, oldPod *api.Pod) field.ErrorList { allErrs = append(allErrs, field.Forbidden(specPath.Child("containers"), "pod updates may not add or remove containers")) return allErrs } - pod := *newPod - // Tricky, we need to copy the container list so that we don't overwrite the update + + // validate updateable fields: + // 1. containers[*].image + // 2. spec.activeDeadlineSeconds + + // validate updated container images + for i, ctr := range newPod.Spec.Containers { + if len(ctr.Image) == 0 { + allErrs = append(allErrs, field.Required(specPath.Child("containers").Index(i).Child("image"), "")) + } + } + + // validate updated spec.activeDeadlineSeconds. two types of updates are allowed: + // 1. from nil to a positive value + // 2. from a positive value to a lesser, non-negative value + if newPod.Spec.ActiveDeadlineSeconds != nil { + newActiveDeadlineSeconds := *newPod.Spec.ActiveDeadlineSeconds + if newActiveDeadlineSeconds < 0 { + allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newActiveDeadlineSeconds, isNegativeErrorMsg)) + return allErrs + } + if oldPod.Spec.ActiveDeadlineSeconds != nil { + oldActiveDeadlineSeconds := *oldPod.Spec.ActiveDeadlineSeconds + if oldActiveDeadlineSeconds < newActiveDeadlineSeconds { + allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newActiveDeadlineSeconds, "must be less than or equal to previous value")) + return allErrs + } + } + } else if oldPod.Spec.ActiveDeadlineSeconds != nil { + allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newPod.Spec.ActiveDeadlineSeconds, "must not update from a positive integer to nil value")) + } + + // handle updateable fields by munging those fields prior to deep equal comparison. + mungedPod := *newPod + // munge containers[*].image var newContainers []api.Container - for ix, container := range pod.Spec.Containers { + for ix, container := range mungedPod.Spec.Containers { container.Image = oldPod.Spec.Containers[ix].Image newContainers = append(newContainers, container) } - pod.Spec.Containers = newContainers - if !api.Semantic.DeepEqual(pod.Spec, oldPod.Spec) { + mungedPod.Spec.Containers = newContainers + // munge spec.activeDeadlineSeconds + mungedPod.Spec.ActiveDeadlineSeconds = nil + if oldPod.Spec.ActiveDeadlineSeconds != nil { + activeDeadlineSeconds := *oldPod.Spec.ActiveDeadlineSeconds + mungedPod.Spec.ActiveDeadlineSeconds = &activeDeadlineSeconds + } + if !api.Semantic.DeepEqual(mungedPod.Spec, oldPod.Spec) { //TODO: Pinpoint the specific field that causes the invalid error after we have strategic merge diff - allErrs = append(allErrs, field.Forbidden(specPath, "pod updates may not change fields other than `containers[*].image`")) + allErrs = append(allErrs, field.Forbidden(specPath, "pod updates may not change fields other than `containers[*].image` or `spec.activeDeadlineSeconds`")) } - newPod.Status = oldPod.Status return allErrs } @@ -1510,12 +1650,18 @@ func ValidateService(service *api.Service) field.ErrorList { if service.Spec.Type == api.ServiceTypeLoadBalancer { portsPath := specPath.Child("ports") + includeProtocols := sets.NewString() for i := range service.Spec.Ports { portPath := portsPath.Index(i) if !supportedPortProtocols.Has(string(service.Spec.Ports[i].Protocol)) { allErrs = append(allErrs, field.Invalid(portPath.Child("protocol"), service.Spec.Ports[i].Protocol, "cannot create an external load balancer with non-TCP/UDP ports")) + } else { + includeProtocols.Insert(string(service.Spec.Ports[i].Protocol)) } } + if includeProtocols.Len() > 1 { + allErrs = append(allErrs, field.Invalid(portsPath, service.Spec.Ports, "cannot create an external load balancer with mix protocols")) + } } if service.Spec.Type == api.ServiceTypeClusterIP { @@ -1736,13 +1882,19 @@ func ValidateNodeUpdate(node, oldNode *api.Node) field.ErrorList { addresses[address] = true } + if len(oldNode.Spec.PodCIDR) == 0 { + // Allow the controller manager to assign a CIDR to a node if it doesn't have one. + oldNode.Spec.PodCIDR = node.Spec.PodCIDR + } else { + if oldNode.Spec.PodCIDR != node.Spec.PodCIDR { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "podCIDR"), "node updates may not change podCIDR except from \"\" to valid")) + } + } // TODO: move reset function to its own location // Ignore metadata changes now that they have been tested oldNode.ObjectMeta = node.ObjectMeta // Allow users to update capacity oldNode.Status.Capacity = node.Status.Capacity - // Allow the controller manager to assign a CIDR to a node. - oldNode.Spec.PodCIDR = node.Spec.PodCIDR // Allow users to unschedule node oldNode.Spec.Unschedulable = node.Spec.Unschedulable // Clear status @@ -1973,6 +2125,14 @@ func ValidateSecret(secret *api.Secret) field.ErrorList { break } + case api.SecretTypeTLS: + if _, exists := secret.Data[api.TLSCertKey]; !exists { + allErrs = append(allErrs, field.Required(dataPath.Key(api.TLSCertKey), "")) + } + if _, exists := secret.Data[api.TLSPrivateKeyKey]; !exists { + allErrs = append(allErrs, field.Required(dataPath.Key(api.TLSPrivateKeyKey), "")) + } + // TODO: Verify that the key matches the cert. default: // no-op } diff --git a/pkg/api/validation/validation_test.go b/pkg/api/validation/validation_test.go index 69e02012e3f..7094cbb7359 100644 --- a/pkg/api/validation/validation_test.go +++ b/pkg/api/validation/validation_test.go @@ -509,6 +509,7 @@ func TestValidateVolumes(t *testing.T) { }}}}, {Name: "fc", VolumeSource: api.VolumeSource{FC: &api.FCVolumeSource{[]string{"some_wwn"}, &lun, "ext4", false}}}, {Name: "flexvolume", VolumeSource: api.VolumeSource{FlexVolume: &api.FlexVolumeSource{Driver: "kubernetes.io/blue", FSType: "ext4"}}}, + {Name: "azure", VolumeSource: api.VolumeSource{AzureFile: &api.AzureFileVolumeSource{"key", "share", false}}}, } names, errs := validateVolumes(successCase, field.NewPath("field")) if len(errs) != 0 { @@ -557,6 +558,8 @@ func TestValidateVolumes(t *testing.T) { zeroWWN := api.VolumeSource{FC: &api.FCVolumeSource{[]string{}, &lun, "ext4", false}} emptyLun := api.VolumeSource{FC: &api.FCVolumeSource{[]string{"wwn"}, nil, "ext4", false}} slashInName := api.VolumeSource{Flocker: &api.FlockerVolumeSource{DatasetName: "foo/bar"}} + emptyAzureSecret := api.VolumeSource{AzureFile: &api.AzureFileVolumeSource{"", "share", false}} + emptyAzureShare := api.VolumeSource{AzureFile: &api.AzureFileVolumeSource{"name", "", false}} errorCases := map[string]struct { V []api.Volume T field.ErrorType @@ -678,6 +681,16 @@ func TestValidateVolumes(t *testing.T) { field.ErrorTypeInvalid, "gitRepo.directory", "", }, + "empty secret": { + []api.Volume{{Name: "emptyaccount", VolumeSource: emptyAzureSecret}}, + field.ErrorTypeRequired, + "azureFile.secretName", "", + }, + "empty share": { + []api.Volume{{Name: "emptyaccount", VolumeSource: emptyAzureShare}}, + field.ErrorTypeRequired, + "azureFile.shareName", "", + }, } for k, v := range errorCases { _, errs := validateVolumes(v.V, field.NewPath("field")) @@ -1082,6 +1095,8 @@ func TestValidateHandler(t *testing.T) { {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromInt(1), Host: "", Scheme: "HTTP"}}, {HTTPGet: &api.HTTPGetAction{Path: "/foo", Port: intstr.FromInt(65535), Host: "host", Scheme: "HTTP"}}, {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP"}}, + {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []api.HTTPHeader{{"Host", "foo.example.com"}}}}, + {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []api.HTTPHeader{{"X-Forwarded-For", "1.2.3.4"}, {"X-Forwarded-For", "5.6.7.8"}}}}, } for _, h := range successCases { if errs := validateHandler(&h, field.NewPath("field")); len(errs) != 0 { @@ -1095,6 +1110,8 @@ func TestValidateHandler(t *testing.T) { {HTTPGet: &api.HTTPGetAction{Path: "", Port: intstr.FromInt(0), Host: ""}}, {HTTPGet: &api.HTTPGetAction{Path: "/foo", Port: intstr.FromInt(65536), Host: "host"}}, {HTTPGet: &api.HTTPGetAction{Path: "", Port: intstr.FromString(""), Host: ""}}, + {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []api.HTTPHeader{{"Host:", "foo.example.com"}}}}, + {HTTPGet: &api.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []api.HTTPHeader{{"X_Forwarded_For", "foo.example.com"}}}}, } for _, h := range errorCases { if errs := validateHandler(&h, field.NewPath("field")); len(errs) == 0 { @@ -1550,6 +1567,12 @@ func TestValidatePodSpec(t *testing.T) { RestartPolicy: api.RestartPolicyAlways, DNSPolicy: api.DNSClusterFirst, }, + { // Populate Affinity. + Volumes: []api.Volume{{Name: "vol", VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}}}, + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, } for i := range successCases { if errs := ValidatePodSpec(&successCases[i], field.NewPath("field")); len(errs) != 0 { @@ -1712,6 +1735,50 @@ func TestValidatePod(t *testing.T) { NodeName: "foobar", }, }, + { // Serialized affinity requirements in annotations. + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "key1", + "operator": "Exists" + }] + }] + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "key2", + "operator": "In", + "values": ["value1", "value2"] + }] + }] + }, + "preferredDuringSchedulingIgnoredDuringExecution": [ + { + "weight": 10, + "preference": {"matchExpressions": [ + { + "key": "foo", + "operator": "In", "values": ["bar"] + } + ]} + } + ] + }}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, } for _, pod := range successCases { if errs := ValidatePod(&pod); len(errs) != 0 { @@ -1756,6 +1823,111 @@ func TestValidatePod(t *testing.T) { Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, }, }, + "invalid json of affinity in pod annotations": { + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + `, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, + "invalid node selector requirement in affinity in pod annotations, operator can't be null": { + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": {"requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "key1", + }] + }] + }}}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, + "invalid preferredSchedulingTerm in affinity in pod annotations, weight should be in range 1-100": { + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": {"preferredDuringSchedulingIgnoredDuringExecution": [ + { + "weight": 199, + "preference": {"matchExpressions": [ + { + "key": "foo", + "operator": "In", + "values": ["bar"] + } + ]} + } + ]}}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, + "invalid requiredDuringSchedulingRequiredDuringExecution node selector, nodeSelectorTerms must have at least one term": { + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [] + }, + }}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, + "invalid requiredDuringSchedulingRequiredDuringExecution node selector term, matchExpressions must have at least one node selector requirement": { + ObjectMeta: api.ObjectMeta{ + Name: "123", + Namespace: "ns", + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [] + }] + }, + }}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, } for k, v := range errorCases { if errs := ValidatePod(&v); len(errs) == 0 { @@ -1765,9 +1937,17 @@ func TestValidatePod(t *testing.T) { } func TestValidatePodUpdate(t *testing.T) { - now := unversioned.Now() - grace := int64(30) - grace2 := int64(31) + var ( + activeDeadlineSecondsZero = int64(0) + activeDeadlineSecondsNegative = int64(-30) + activeDeadlineSecondsPositive = int64(30) + activeDeadlineSecondsLarger = int64(31) + + now = unversioned.Now() + grace = int64(30) + grace2 = int64(31) + ) + tests := []struct { a api.Pod b api.Pod @@ -1902,6 +2082,150 @@ func TestValidatePodUpdate(t *testing.T) { true, "image change", }, + { + api.Pod{ + ObjectMeta: api.ObjectMeta{Name: "foo"}, + Spec: api.PodSpec{ + Containers: []api.Container{ + {}, + }, + }, + }, + api.Pod{ + ObjectMeta: api.ObjectMeta{Name: "foo"}, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Image: "foo:V2", + }, + }, + }, + }, + false, + "image change to empty", + }, + { + api.Pod{ + Spec: api.PodSpec{}, + }, + api.Pod{ + Spec: api.PodSpec{}, + }, + true, + "activeDeadlineSeconds no change, nil", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + true, + "activeDeadlineSeconds no change, set", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + api.Pod{}, + true, + "activeDeadlineSeconds change to positive from nil", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsLarger, + }, + }, + true, + "activeDeadlineSeconds change to smaller positive", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsLarger, + }, + }, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + false, + "activeDeadlineSeconds change to larger positive", + }, + + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsNegative, + }, + }, + api.Pod{}, + false, + "activeDeadlineSeconds change to negative from nil", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsNegative, + }, + }, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + false, + "activeDeadlineSeconds change to negative from positive", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsZero, + }, + }, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + true, + "activeDeadlineSeconds change to zero from positive", + }, + { + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsZero, + }, + }, + api.Pod{}, + true, + "activeDeadlineSeconds change to zero from nil", + }, + { + api.Pod{}, + api.Pod{ + Spec: api.PodSpec{ + ActiveDeadlineSeconds: &activeDeadlineSecondsPositive, + }, + }, + false, + "activeDeadlineSeconds change to nil from positive", + }, + { api.Pod{ ObjectMeta: api.ObjectMeta{Name: "foo"}, @@ -1990,11 +2314,11 @@ func TestValidatePodUpdate(t *testing.T) { errs := ValidatePodUpdate(&test.a, &test.b) if test.isValid { if len(errs) != 0 { - t.Errorf("unexpected invalid: %s %v, %v", test.test, test.a, test.b) + t.Errorf("unexpected invalid: %s (%+v)\nA: %+v\nB: %+v", test.test, errs, test.a, test.b) } } else { if len(errs) == 0 { - t.Errorf("unexpected valid: %s %v, %v", test.test, test.a, test.b) + t.Errorf("unexpected valid: %s\nA: %+v\nB: %+v", test.test, test.a, test.b) } } } @@ -2269,10 +2593,18 @@ func TestValidateService(t *testing.T) { name: "valid load balancer protocol UDP 2", tweakSvc: func(s *api.Service) { s.Spec.Type = api.ServiceTypeLoadBalancer - s.Spec.Ports = append(s.Spec.Ports, api.ServicePort{Name: "q", Port: 12345, Protocol: "UDP", TargetPort: intstr.FromInt(12345)}) + s.Spec.Ports[0] = api.ServicePort{Name: "q", Port: 12345, Protocol: "UDP", TargetPort: intstr.FromInt(12345)} }, numErrs: 0, }, + { + name: "invalid load balancer with mix protocol", + tweakSvc: func(s *api.Service) { + s.Spec.Type = api.ServiceTypeLoadBalancer + s.Spec.Ports = append(s.Spec.Ports, api.ServicePort{Name: "q", Port: 12345, Protocol: "UDP", TargetPort: intstr.FromInt(12345)}) + }, + numErrs: 1, + }, { name: "valid 1", tweakSvc: func(s *api.Service) { @@ -3090,6 +3422,36 @@ func TestValidateNodeUpdate(t *testing.T) { Labels: map[string]string{"foo": "baz"}, }, }, true}, + {api.Node{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: api.NodeSpec{ + PodCIDR: "", + }, + }, api.Node{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: api.NodeSpec{ + PodCIDR: "192.168.0.0/16", + }, + }, true}, + {api.Node{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: api.NodeSpec{ + PodCIDR: "192.123.0.0/16", + }, + }, api.Node{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: api.NodeSpec{ + PodCIDR: "192.168.0.0/16", + }, + }, false}, {api.Node{ ObjectMeta: api.ObjectMeta{ Name: "foo", @@ -4394,6 +4756,52 @@ func TestValidateEndpoints(t *testing.T) { } } +func TestValidateTLSSecret(t *testing.T) { + successCases := map[string]api.Secret{ + "emtpy certificate chain": { + ObjectMeta: api.ObjectMeta{Name: "tls-cert", Namespace: "namespace"}, + Data: map[string][]byte{ + api.TLSCertKey: []byte("public key"), + api.TLSPrivateKeyKey: []byte("private key"), + }, + }, + } + for k, v := range successCases { + if errs := ValidateSecret(&v); len(errs) != 0 { + t.Errorf("Expected success for %s, got %v", k, errs) + } + } + errorCases := map[string]struct { + secrets api.Secret + errorType field.ErrorType + errorDetail string + }{ + "missing public key": { + secrets: api.Secret{ + ObjectMeta: api.ObjectMeta{Name: "tls-cert"}, + Data: map[string][]byte{ + api.TLSCertKey: []byte("public key"), + }, + }, + errorType: "FieldValueRequired", + }, + "missing private key": { + secrets: api.Secret{ + ObjectMeta: api.ObjectMeta{Name: "tls-cert"}, + Data: map[string][]byte{ + api.TLSCertKey: []byte("public key"), + }, + }, + errorType: "FieldValueRequired", + }, + } + for k, v := range errorCases { + if errs := ValidateSecret(&v.secrets); len(errs) == 0 || errs[0].Type != v.errorType || !strings.Contains(errs[0].Detail, v.errorDetail) { + t.Errorf("[%s] Expected error type %s with detail %q, got %v", k, v.errorType, v.errorDetail, errs) + } + } +} + func TestValidateSecurityContext(t *testing.T) { priv := false var runAsUser int64 = 1 diff --git a/pkg/apis/authorization/types.generated.go b/pkg/apis/authorization/types.generated.go index 668b9dfc3bb..b3bafcf27cf 100644 --- a/pkg/apis/authorization/types.generated.go +++ b/pkg/apis/authorization/types.generated.go @@ -82,8 +82,8 @@ func (x *SubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [4]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" + yyq2[2] = x.Kind != "" + yyq2[3] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { r.EncodeArrayStart(4) @@ -99,75 +99,75 @@ func (x *SubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy10 := &x.Spec - yy10.CodecEncodeSelf(e) + yy4 := &x.Spec + yy4.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.Spec - yy11.CodecEncodeSelf(e) + yy5 := &x.Spec + yy5.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy13 := &x.Status - yy13.CodecEncodeSelf(e) + yy7 := &x.Status + yy7.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy14 := &x.Status - yy14.CodecEncodeSelf(e) + yy8 := &x.Status + yy8.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + 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) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym13 := z.EncBinary() + _ = yym13 + 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) + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) @@ -230,6 +230,20 @@ func (x *SubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder yys17 := string(yys17Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys17 { + case "Spec": + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv18 := &x.Spec + yyv18.CodecDecodeSelf(d) + } + case "Status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv19 := &x.Status + yyv19.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -242,20 +256,6 @@ func (x *SubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "Spec": - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv20 := &x.Spec - yyv20.CodecDecodeSelf(d) - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv21 := &x.Status - yyv21.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys17) } // end switch yys17 @@ -281,6 +281,40 @@ func (x *SubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.Decod return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv23 := &x.Spec + yyv23.CodecDecodeSelf(d) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv24 := &x.Status + yyv24.CodecDecodeSelf(d) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -302,40 +336,6 @@ func (x *SubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv25 := &x.Spec - yyv25.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv26 := &x.Status - yyv26.CodecDecodeSelf(d) - } for { yyj22++ if yyhl22 { @@ -369,8 +369,8 @@ func (x *SelfSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq28 [4]bool _, _, _ = yysep28, yyq28, yy2arr28 const yyr28 bool = false - yyq28[0] = x.Kind != "" - yyq28[1] = x.APIVersion != "" + yyq28[2] = x.Kind != "" + yyq28[3] = x.APIVersion != "" var yynn28 int if yyr28 || yy2arr28 { r.EncodeArrayStart(4) @@ -386,75 +386,75 @@ func (x *SelfSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr28 || yy2arr28 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq28[0] { - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq28[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr28 || yy2arr28 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq28[1] { - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq28[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr28 || yy2arr28 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy36 := &x.Spec - yy36.CodecEncodeSelf(e) + yy30 := &x.Spec + yy30.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy37 := &x.Spec - yy37.CodecEncodeSelf(e) + yy31 := &x.Spec + yy31.CodecEncodeSelf(e) } if yyr28 || yy2arr28 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy39 := &x.Status - yy39.CodecEncodeSelf(e) + yy33 := &x.Status + yy33.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy40 := &x.Status - yy40.CodecEncodeSelf(e) + yy34 := &x.Status + yy34.CodecEncodeSelf(e) + } + if yyr28 || yy2arr28 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq28[2] { + yym36 := z.EncBinary() + _ = yym36 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq28[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym37 := z.EncBinary() + _ = yym37 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr28 || yy2arr28 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq28[3] { + yym39 := z.EncBinary() + _ = yym39 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq28[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym40 := z.EncBinary() + _ = yym40 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } } if yyr28 || yy2arr28 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) @@ -517,6 +517,20 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Dec yys43 := string(yys43Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys43 { + case "Spec": + if r.TryDecodeAsNil() { + x.Spec = SelfSubjectAccessReviewSpec{} + } else { + yyv44 := &x.Spec + yyv44.CodecDecodeSelf(d) + } + case "Status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv45 := &x.Status + yyv45.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -529,20 +543,6 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - case "Spec": - if r.TryDecodeAsNil() { - x.Spec = SelfSubjectAccessReviewSpec{} - } else { - yyv46 := &x.Spec - yyv46.CodecDecodeSelf(d) - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv47 := &x.Status - yyv47.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys43) } // end switch yys43 @@ -568,6 +568,40 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.D return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SelfSubjectAccessReviewSpec{} + } else { + yyv49 := &x.Spec + yyv49.CodecDecodeSelf(d) + } + yyj48++ + if yyhl48 { + yyb48 = yyj48 > l + } else { + yyb48 = r.CheckBreak() + } + if yyb48 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv50 := &x.Status + yyv50.CodecDecodeSelf(d) + } + yyj48++ + if yyhl48 { + yyb48 = yyj48 > l + } else { + yyb48 = r.CheckBreak() + } + if yyb48 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -589,40 +623,6 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SelfSubjectAccessReviewSpec{} - } else { - yyv51 := &x.Spec - yyv51.CodecDecodeSelf(d) - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv52 := &x.Status - yyv52.CodecDecodeSelf(d) - } for { yyj48++ if yyhl48 { @@ -656,8 +656,8 @@ func (x *LocalSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq54 [4]bool _, _, _ = yysep54, yyq54, yy2arr54 const yyr54 bool = false - yyq54[0] = x.Kind != "" - yyq54[1] = x.APIVersion != "" + yyq54[2] = x.Kind != "" + yyq54[3] = x.APIVersion != "" var yynn54 int if yyr54 || yy2arr54 { r.EncodeArrayStart(4) @@ -673,75 +673,75 @@ func (x *LocalSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr54 || yy2arr54 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq54[0] { - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq54[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr54 || yy2arr54 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq54[1] { - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq54[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym60 := z.EncBinary() - _ = yym60 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr54 || yy2arr54 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy62 := &x.Spec - yy62.CodecEncodeSelf(e) + yy56 := &x.Spec + yy56.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy63 := &x.Spec - yy63.CodecEncodeSelf(e) + yy57 := &x.Spec + yy57.CodecEncodeSelf(e) } if yyr54 || yy2arr54 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy65 := &x.Status - yy65.CodecEncodeSelf(e) + yy59 := &x.Status + yy59.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy66 := &x.Status - yy66.CodecEncodeSelf(e) + yy60 := &x.Status + yy60.CodecEncodeSelf(e) + } + if yyr54 || yy2arr54 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq54[2] { + yym62 := z.EncBinary() + _ = yym62 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq54[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym63 := z.EncBinary() + _ = yym63 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr54 || yy2arr54 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq54[3] { + yym65 := z.EncBinary() + _ = yym65 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq54[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym66 := z.EncBinary() + _ = yym66 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } } if yyr54 || yy2arr54 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) @@ -804,6 +804,20 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.De yys69 := string(yys69Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys69 { + case "Spec": + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv70 := &x.Spec + yyv70.CodecDecodeSelf(d) + } + case "Status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv71 := &x.Status + yyv71.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -816,20 +830,6 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - case "Spec": - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv72 := &x.Spec - yyv72.CodecDecodeSelf(d) - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv73 := &x.Status - yyv73.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys69) } // end switch yys69 @@ -855,6 +855,40 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978. return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv75 := &x.Spec + yyv75.CodecDecodeSelf(d) + } + yyj74++ + if yyhl74 { + yyb74 = yyj74 > l + } else { + yyb74 = r.CheckBreak() + } + if yyb74 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv76 := &x.Status + yyv76.CodecDecodeSelf(d) + } + yyj74++ + if yyhl74 { + yyb74 = yyj74 > l + } else { + yyb74 = r.CheckBreak() + } + if yyb74 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -876,40 +910,6 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.APIVersion = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l - } else { - yyb74 = r.CheckBreak() - } - if yyb74 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv77 := &x.Spec - yyv77.CodecDecodeSelf(d) - } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l - } else { - yyb74 = r.CheckBreak() - } - if yyb74 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv78 := &x.Status - yyv78.CodecDecodeSelf(d) - } for { yyj74++ if yyhl74 { diff --git a/pkg/apis/authorization/v1beta1/types.generated.go b/pkg/apis/authorization/v1beta1/types.generated.go index 75ebcf8a789..2ae7252c14b 100644 --- a/pkg/apis/authorization/v1beta1/types.generated.go +++ b/pkg/apis/authorization/v1beta1/types.generated.go @@ -82,9 +82,9 @@ func (x *SubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [4]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" - yyq2[3] = true + yyq2[1] = true + yyq2[2] = x.Kind != "" + yyq2[3] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { r.EncodeArrayStart(4) @@ -100,80 +100,80 @@ func (x *SubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy10 := &x.Spec - yy10.CodecEncodeSelf(e) + yy4 := &x.Spec + yy4.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.Spec - yy11.CodecEncodeSelf(e) + yy5 := &x.Spec + yy5.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[3] { - yy13 := &x.Status - yy13.CodecEncodeSelf(e) + if yyq2[1] { + yy7 := &x.Status + yy7.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2[3] { + if yyq2[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy14 := &x.Status - yy14.CodecEncodeSelf(e) + yy8 := &x.Status + yy8.CodecEncodeSelf(e) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + 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) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym13 := z.EncBinary() + _ = yym13 + 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) + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr2 || yy2arr2 { @@ -237,6 +237,20 @@ func (x *SubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder yys17 := string(yys17Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys17 { + case "spec": + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv18 := &x.Spec + yyv18.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv19 := &x.Status + yyv19.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -249,20 +263,6 @@ func (x *SubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv20 := &x.Spec - yyv20.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv21 := &x.Status - yyv21.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys17) } // end switch yys17 @@ -288,6 +288,40 @@ func (x *SubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.Decod return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv23 := &x.Spec + yyv23.CodecDecodeSelf(d) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv24 := &x.Status + yyv24.CodecDecodeSelf(d) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -309,40 +343,6 @@ func (x *SubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv25 := &x.Spec - yyv25.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv26 := &x.Status - yyv26.CodecDecodeSelf(d) - } for { yyj22++ if yyhl22 { @@ -376,9 +376,9 @@ func (x *SelfSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq28 [4]bool _, _, _ = yysep28, yyq28, yy2arr28 const yyr28 bool = false - yyq28[0] = x.Kind != "" - yyq28[1] = x.APIVersion != "" - yyq28[3] = true + yyq28[1] = true + yyq28[2] = x.Kind != "" + yyq28[3] = x.APIVersion != "" var yynn28 int if yyr28 || yy2arr28 { r.EncodeArrayStart(4) @@ -394,80 +394,80 @@ func (x *SelfSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr28 || yy2arr28 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq28[0] { - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq28[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr28 || yy2arr28 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq28[1] { - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq28[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr28 || yy2arr28 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy36 := &x.Spec - yy36.CodecEncodeSelf(e) + yy30 := &x.Spec + yy30.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy37 := &x.Spec - yy37.CodecEncodeSelf(e) + yy31 := &x.Spec + yy31.CodecEncodeSelf(e) } if yyr28 || yy2arr28 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq28[3] { - yy39 := &x.Status - yy39.CodecEncodeSelf(e) + if yyq28[1] { + yy33 := &x.Status + yy33.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq28[3] { + if yyq28[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy40 := &x.Status - yy40.CodecEncodeSelf(e) + yy34 := &x.Status + yy34.CodecEncodeSelf(e) + } + } + if yyr28 || yy2arr28 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq28[2] { + yym36 := z.EncBinary() + _ = yym36 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq28[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym37 := z.EncBinary() + _ = yym37 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr28 || yy2arr28 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq28[3] { + yym39 := z.EncBinary() + _ = yym39 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq28[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym40 := z.EncBinary() + _ = yym40 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr28 || yy2arr28 { @@ -531,6 +531,20 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Dec yys43 := string(yys43Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys43 { + case "spec": + if r.TryDecodeAsNil() { + x.Spec = SelfSubjectAccessReviewSpec{} + } else { + yyv44 := &x.Spec + yyv44.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv45 := &x.Status + yyv45.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -543,20 +557,6 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = SelfSubjectAccessReviewSpec{} - } else { - yyv46 := &x.Spec - yyv46.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv47 := &x.Status - yyv47.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys43) } // end switch yys43 @@ -582,6 +582,40 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.D return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SelfSubjectAccessReviewSpec{} + } else { + yyv49 := &x.Spec + yyv49.CodecDecodeSelf(d) + } + yyj48++ + if yyhl48 { + yyb48 = yyj48 > l + } else { + yyb48 = r.CheckBreak() + } + if yyb48 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv50 := &x.Status + yyv50.CodecDecodeSelf(d) + } + yyj48++ + if yyhl48 { + yyb48 = yyj48 > l + } else { + yyb48 = r.CheckBreak() + } + if yyb48 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -603,40 +637,6 @@ func (x *SelfSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SelfSubjectAccessReviewSpec{} - } else { - yyv51 := &x.Spec - yyv51.CodecDecodeSelf(d) - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv52 := &x.Status - yyv52.CodecDecodeSelf(d) - } for { yyj48++ if yyhl48 { @@ -670,9 +670,9 @@ func (x *LocalSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { var yyq54 [4]bool _, _, _ = yysep54, yyq54, yy2arr54 const yyr54 bool = false - yyq54[0] = x.Kind != "" - yyq54[1] = x.APIVersion != "" - yyq54[3] = true + yyq54[1] = true + yyq54[2] = x.Kind != "" + yyq54[3] = x.APIVersion != "" var yynn54 int if yyr54 || yy2arr54 { r.EncodeArrayStart(4) @@ -688,80 +688,80 @@ func (x *LocalSubjectAccessReview) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr54 || yy2arr54 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq54[0] { - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq54[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr54 || yy2arr54 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq54[1] { - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq54[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym60 := z.EncBinary() - _ = yym60 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr54 || yy2arr54 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy62 := &x.Spec - yy62.CodecEncodeSelf(e) + yy56 := &x.Spec + yy56.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy63 := &x.Spec - yy63.CodecEncodeSelf(e) + yy57 := &x.Spec + yy57.CodecEncodeSelf(e) } if yyr54 || yy2arr54 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq54[3] { - yy65 := &x.Status - yy65.CodecEncodeSelf(e) + if yyq54[1] { + yy59 := &x.Status + yy59.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq54[3] { + if yyq54[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy66 := &x.Status - yy66.CodecEncodeSelf(e) + yy60 := &x.Status + yy60.CodecEncodeSelf(e) + } + } + if yyr54 || yy2arr54 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq54[2] { + yym62 := z.EncBinary() + _ = yym62 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq54[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym63 := z.EncBinary() + _ = yym63 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr54 || yy2arr54 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq54[3] { + yym65 := z.EncBinary() + _ = yym65 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq54[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym66 := z.EncBinary() + _ = yym66 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr54 || yy2arr54 { @@ -825,6 +825,20 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.De yys69 := string(yys69Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys69 { + case "spec": + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv70 := &x.Spec + yyv70.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv71 := &x.Status + yyv71.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -837,20 +851,6 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromMap(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv72 := &x.Spec - yyv72.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv73 := &x.Status - yyv73.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys69) } // end switch yys69 @@ -876,6 +876,40 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978. return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = SubjectAccessReviewSpec{} + } else { + yyv75 := &x.Spec + yyv75.CodecDecodeSelf(d) + } + yyj74++ + if yyhl74 { + yyb74 = yyj74 > l + } else { + yyb74 = r.CheckBreak() + } + if yyb74 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = SubjectAccessReviewStatus{} + } else { + yyv76 := &x.Status + yyv76.CodecDecodeSelf(d) + } + yyj74++ + if yyhl74 { + yyb74 = yyj74 > l + } else { + yyb74 = r.CheckBreak() + } + if yyb74 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -897,40 +931,6 @@ func (x *LocalSubjectAccessReview) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.APIVersion = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l - } else { - yyb74 = r.CheckBreak() - } - if yyb74 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = SubjectAccessReviewSpec{} - } else { - yyv77 := &x.Spec - yyv77.CodecDecodeSelf(d) - } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l - } else { - yyb74 = r.CheckBreak() - } - if yyb74 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = SubjectAccessReviewStatus{} - } else { - yyv78 := &x.Status - yyv78.CodecDecodeSelf(d) - } for { yyj74++ if yyhl74 { diff --git a/pkg/apis/componentconfig/helpers.go b/pkg/apis/componentconfig/helpers.go index 43e77931cae..edd9c797593 100644 --- a/pkg/apis/componentconfig/helpers.go +++ b/pkg/apis/componentconfig/helpers.go @@ -54,8 +54,7 @@ func (v IPVar) Type() string { } func (m *ProxyMode) Set(s string) error { - nm := ProxyMode(s) - m = &nm + *m = ProxyMode(s) return nil } diff --git a/pkg/apis/componentconfig/register.go b/pkg/apis/componentconfig/register.go index eaf67580996..3604129a651 100644 --- a/pkg/apis/componentconfig/register.go +++ b/pkg/apis/componentconfig/register.go @@ -45,7 +45,9 @@ func addKnownTypes(scheme *runtime.Scheme) { // TODO this will get cleaned up with the scheme types are fixed scheme.AddKnownTypes(SchemeGroupVersion, &KubeProxyConfiguration{}, + &KubeSchedulerConfiguration{}, ) } -func (obj *KubeProxyConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *KubeProxyConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *KubeSchedulerConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/componentconfig/types.generated.go b/pkg/apis/componentconfig/types.generated.go index 08c28edb10b..7a3bd1a8ce5 100644 --- a/pkg/apis/componentconfig/types.generated.go +++ b/pkg/apis/componentconfig/types.generated.go @@ -81,16 +81,16 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [17]bool + var yyq2 [18]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" + yyq2[16] = x.Kind != "" + yyq2[17] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(17) + r.EncodeArrayStart(18) } else { - yynn2 = 15 + yynn2 = 16 for _, b := range yyq2 { if b { yynn2++ @@ -101,58 +101,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym10 := z.EncBinary() - _ = yym10 + yym4 := z.EncBinary() + _ = yym4 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) @@ -161,8 +111,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("bindAddress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym11 := z.EncBinary() - _ = yym11 + yym5 := z.EncBinary() + _ = yym5 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) @@ -170,8 +120,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym13 := z.EncBinary() - _ = yym13 + yym7 := z.EncBinary() + _ = yym7 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) @@ -180,8 +130,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzBindAddress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) @@ -189,8 +139,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym16 := z.EncBinary() - _ = yym16 + yym10 := z.EncBinary() + _ = yym10 if false { } else { r.EncodeInt(int64(x.HealthzPort)) @@ -199,8 +149,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { r.EncodeInt(int64(x.HealthzPort)) @@ -208,8 +158,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym19 := z.EncBinary() - _ = yym19 + yym13 := z.EncBinary() + _ = yym13 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) @@ -218,8 +168,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostnameOverride")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym20 := z.EncBinary() - _ = yym20 + yym14 := z.EncBinary() + _ = yym14 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) @@ -227,35 +177,64 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy22 := &x.IPTablesSyncPeriod - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.EncExt(yy22) { - } else if !yym23 && z.IsJSONHandle() { - z.EncJSONMarshal(yy22) + if x.IPTablesMasqueradeBit == nil { + r.EncodeNil() } else { - z.EncFallback(yy22) + yy16 := *x.IPTablesMasqueradeBit + yym17 := z.EncBinary() + _ = yym17 + if false { + } else { + r.EncodeInt(int64(yy16)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("iptablesMasqueradeBit")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.IPTablesMasqueradeBit == nil { + r.EncodeNil() + } else { + yy18 := *x.IPTablesMasqueradeBit + yym19 := z.EncBinary() + _ = yym19 + if false { + } else { + r.EncodeInt(int64(yy18)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy21 := &x.IPTablesSyncPeriod + yym22 := z.EncBinary() + _ = yym22 + if false { + } else if z.HasExtensions() && z.EncExt(yy21) { + } else if !yym22 && z.IsJSONHandle() { + z.EncJSONMarshal(yy21) + } else { + z.EncFallback(yy21) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iptablesSyncPeriodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy24 := &x.IPTablesSyncPeriod - yym25 := z.EncBinary() - _ = yym25 + yy23 := &x.IPTablesSyncPeriod + yym24 := z.EncBinary() + _ = yym24 if false { - } else if z.HasExtensions() && z.EncExt(yy24) { - } else if !yym25 && z.IsJSONHandle() { - z.EncJSONMarshal(yy24) + } else if z.HasExtensions() && z.EncExt(yy23) { + } else if !yym24 && z.IsJSONHandle() { + z.EncJSONMarshal(yy23) } else { - z.EncFallback(yy24) + z.EncFallback(yy23) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym27 := z.EncBinary() - _ = yym27 + yym26 := z.EncBinary() + _ = yym26 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) @@ -264,8 +243,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeconfigPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym28 := z.EncBinary() - _ = yym28 + yym27 := z.EncBinary() + _ = yym27 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) @@ -273,8 +252,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym30 := z.EncBinary() - _ = yym30 + yym29 := z.EncBinary() + _ = yym29 if false { } else { r.EncodeBool(bool(x.MasqueradeAll)) @@ -283,8 +262,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("masqueradeAll")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym31 := z.EncBinary() - _ = yym31 + yym30 := z.EncBinary() + _ = yym30 if false { } else { r.EncodeBool(bool(x.MasqueradeAll)) @@ -292,8 +271,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym33 := z.EncBinary() - _ = yym33 + yym32 := z.EncBinary() + _ = yym32 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Master)) @@ -302,8 +281,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("master")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 + yym33 := z.EncBinary() + _ = yym33 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Master)) @@ -314,12 +293,12 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x.OOMScoreAdj == nil { r.EncodeNil() } else { - yy36 := *x.OOMScoreAdj - yym37 := z.EncBinary() - _ = yym37 + yy35 := *x.OOMScoreAdj + yym36 := z.EncBinary() + _ = yym36 if false { } else { - r.EncodeInt(int64(yy36)) + r.EncodeInt(int64(yy35)) } } } else { @@ -329,12 +308,12 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x.OOMScoreAdj == nil { r.EncodeNil() } else { - yy38 := *x.OOMScoreAdj - yym39 := z.EncBinary() - _ = yym39 + yy37 := *x.OOMScoreAdj + yym38 := z.EncBinary() + _ = yym38 if false { } else { - r.EncodeInt(int64(yy38)) + r.EncodeInt(int64(yy37)) } } } @@ -349,8 +328,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym42 := z.EncBinary() - _ = yym42 + yym41 := z.EncBinary() + _ = yym41 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) @@ -359,8 +338,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("portRange")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym43 := z.EncBinary() - _ = yym43 + yym42 := z.EncBinary() + _ = yym42 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) @@ -368,8 +347,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym45 := z.EncBinary() - _ = yym45 + yym44 := z.EncBinary() + _ = yym44 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) @@ -378,8 +357,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceContainer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym46 := z.EncBinary() - _ = yym46 + yym45 := z.EncBinary() + _ = yym45 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) @@ -387,35 +366,35 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy48 := &x.UDPIdleTimeout - yym49 := z.EncBinary() - _ = yym49 + yy47 := &x.UDPIdleTimeout + yym48 := z.EncBinary() + _ = yym48 if false { - } else if z.HasExtensions() && z.EncExt(yy48) { - } else if !yym49 && z.IsJSONHandle() { - z.EncJSONMarshal(yy48) + } else if z.HasExtensions() && z.EncExt(yy47) { + } else if !yym48 && z.IsJSONHandle() { + z.EncJSONMarshal(yy47) } else { - z.EncFallback(yy48) + z.EncFallback(yy47) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("udpTimeoutMilliseconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy50 := &x.UDPIdleTimeout - yym51 := z.EncBinary() - _ = yym51 + yy49 := &x.UDPIdleTimeout + yym50 := z.EncBinary() + _ = yym50 if false { - } else if z.HasExtensions() && z.EncExt(yy50) { - } else if !yym51 && z.IsJSONHandle() { - z.EncJSONMarshal(yy50) + } else if z.HasExtensions() && z.EncExt(yy49) { + } else if !yym50 && z.IsJSONHandle() { + z.EncJSONMarshal(yy49) } else { - z.EncFallback(yy50) + z.EncFallback(yy49) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym53 := z.EncBinary() - _ = yym53 + yym52 := z.EncBinary() + _ = yym52 if false { } else { r.EncodeInt(int64(x.ConntrackMax)) @@ -424,8 +403,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conntrackMax")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym54 := z.EncBinary() - _ = yym54 + yym53 := z.EncBinary() + _ = yym53 if false { } else { r.EncodeInt(int64(x.ConntrackMax)) @@ -433,29 +412,79 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy56 := &x.ConntrackTCPEstablishedTimeout - yym57 := z.EncBinary() - _ = yym57 + yy55 := &x.ConntrackTCPEstablishedTimeout + yym56 := z.EncBinary() + _ = yym56 if false { - } else if z.HasExtensions() && z.EncExt(yy56) { - } else if !yym57 && z.IsJSONHandle() { - z.EncJSONMarshal(yy56) + } else if z.HasExtensions() && z.EncExt(yy55) { + } else if !yym56 && z.IsJSONHandle() { + z.EncJSONMarshal(yy55) } else { - z.EncFallback(yy56) + z.EncFallback(yy55) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conntrackTCPEstablishedTimeout")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy58 := &x.ConntrackTCPEstablishedTimeout - yym59 := z.EncBinary() - _ = yym59 + yy57 := &x.ConntrackTCPEstablishedTimeout + yym58 := z.EncBinary() + _ = yym58 if false { - } else if z.HasExtensions() && z.EncExt(yy58) { - } else if !yym59 && z.IsJSONHandle() { - z.EncJSONMarshal(yy58) + } else if z.HasExtensions() && z.EncExt(yy57) { + } else if !yym58 && z.IsJSONHandle() { + z.EncJSONMarshal(yy57) } else { - z.EncFallback(yy58) + z.EncFallback(yy57) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[16] { + yym60 := z.EncBinary() + _ = yym60 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[16] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym61 := z.EncBinary() + _ = yym61 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[17] { + yym63 := z.EncBinary() + _ = yym63 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[17] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym64 := z.EncBinary() + _ = yym64 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr2 || yy2arr2 { @@ -471,25 +500,25 @@ func (x *KubeProxyConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym60 := z.DecBinary() - _ = yym60 + yym65 := z.DecBinary() + _ = yym65 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct61 := r.ContainerType() - if yyct61 == codecSelferValueTypeMap1234 { - yyl61 := r.ReadMapStart() - if yyl61 == 0 { + yyct66 := r.ContainerType() + if yyct66 == codecSelferValueTypeMap1234 { + yyl66 := r.ReadMapStart() + if yyl66 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl61, d) + x.codecDecodeSelfFromMap(yyl66, d) } - } else if yyct61 == codecSelferValueTypeArray1234 { - yyl61 := r.ReadArrayStart() - if yyl61 == 0 { + } else if yyct66 == codecSelferValueTypeArray1234 { + yyl66 := r.ReadArrayStart() + if yyl66 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl61, d) + x.codecDecodeSelfFromArray(yyl66, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -501,12 +530,12 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys62Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys62Slc - var yyhl62 bool = l >= 0 - for yyj62 := 0; ; yyj62++ { - if yyhl62 { - if yyj62 >= l { + var yys67Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys67Slc + var yyhl67 bool = l >= 0 + for yyj67 := 0; ; yyj67++ { + if yyhl67 { + if yyj67 >= l { break } } else { @@ -515,22 +544,10 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys62Slc = r.DecodeBytes(yys62Slc, true, true) - yys62 := string(yys62Slc) + yys67Slc = r.DecodeBytes(yys67Slc, true, true) + yys67 := string(yys67Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys62 { - 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()) - } + switch yys67 { case "bindAddress": if r.TryDecodeAsNil() { x.BindAddress = "" @@ -555,19 +572,35 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.HostnameOverride = string(r.DecodeString()) } + case "iptablesMasqueradeBit": + if r.TryDecodeAsNil() { + if x.IPTablesMasqueradeBit != nil { + x.IPTablesMasqueradeBit = nil + } + } else { + if x.IPTablesMasqueradeBit == nil { + x.IPTablesMasqueradeBit = new(int) + } + yym73 := z.DecBinary() + _ = yym73 + if false { + } else { + *((*int)(x.IPTablesMasqueradeBit)) = int(r.DecodeInt(codecSelferBitsize1234)) + } + } case "iptablesSyncPeriodSeconds": if r.TryDecodeAsNil() { x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv69 := &x.IPTablesSyncPeriod - yym70 := z.DecBinary() - _ = yym70 + yyv74 := &x.IPTablesSyncPeriod + yym75 := z.DecBinary() + _ = yym75 if false { - } else if z.HasExtensions() && z.DecExt(yyv69) { - } else if !yym70 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv69) + } else if z.HasExtensions() && z.DecExt(yyv74) { + } else if !yym75 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv74) } else { - z.DecFallback(yyv69, false) + z.DecFallback(yyv74, false) } } case "kubeconfigPath": @@ -597,8 +630,8 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if x.OOMScoreAdj == nil { x.OOMScoreAdj = new(int) } - yym75 := z.DecBinary() - _ = yym75 + yym80 := z.DecBinary() + _ = yym80 if false { } else { *((*int)(x.OOMScoreAdj)) = int(r.DecodeInt(codecSelferBitsize1234)) @@ -626,15 +659,15 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.UDPIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv79 := &x.UDPIdleTimeout - yym80 := z.DecBinary() - _ = yym80 + yyv84 := &x.UDPIdleTimeout + yym85 := z.DecBinary() + _ = yym85 if false { - } else if z.HasExtensions() && z.DecExt(yyv79) { - } else if !yym80 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv79) + } else if z.HasExtensions() && z.DecExt(yyv84) { + } else if !yym85 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv84) } else { - z.DecFallback(yyv79, false) + z.DecFallback(yyv84, false) } } case "conntrackMax": @@ -647,21 +680,33 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} } else { - yyv82 := &x.ConntrackTCPEstablishedTimeout - yym83 := z.DecBinary() - _ = yym83 + yyv87 := &x.ConntrackTCPEstablishedTimeout + yym88 := z.DecBinary() + _ = yym88 if false { - } else if z.HasExtensions() && z.DecExt(yyv82) { - } else if !yym83 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv82) + } else if z.HasExtensions() && z.DecExt(yyv87) { + } else if !yym88 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv87) } else { - z.DecFallback(yyv82, false) + z.DecFallback(yyv87, false) } } + 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, yys62) - } // end switch yys62 - } // end for yyj62 + z.DecStructFieldNotFound(-1, yys67) + } // end switch yys67 + } // end for yyj67 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -669,48 +714,16 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj84 int - var yyb84 bool - var yyhl84 bool = l >= 0 - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + var yyj91 int + var yyb91 bool + var yyhl91 bool = l >= 0 + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l - } else { - yyb84 = r.CheckBreak() - } - if yyb84 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l - } else { - yyb84 = r.CheckBreak() - } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -720,13 +733,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.BindAddress = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -736,13 +749,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HealthzBindAddress = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -752,13 +765,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HealthzPort = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -768,13 +781,39 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HostnameOverride = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.IPTablesMasqueradeBit != nil { + x.IPTablesMasqueradeBit = nil + } + } else { + if x.IPTablesMasqueradeBit == nil { + x.IPTablesMasqueradeBit = new(int) + } + yym97 := z.DecBinary() + _ = yym97 + if false { + } else { + *((*int)(x.IPTablesMasqueradeBit)) = int(r.DecodeInt(codecSelferBitsize1234)) + } + } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -782,24 +821,24 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv91 := &x.IPTablesSyncPeriod - yym92 := z.DecBinary() - _ = yym92 + yyv98 := &x.IPTablesSyncPeriod + yym99 := z.DecBinary() + _ = yym99 if false { - } else if z.HasExtensions() && z.DecExt(yyv91) { - } else if !yym92 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv91) + } else if z.HasExtensions() && z.DecExt(yyv98) { + } else if !yym99 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv98) } else { - z.DecFallback(yyv91, false) + z.DecFallback(yyv98, false) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -809,13 +848,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.KubeconfigPath = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -825,13 +864,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.MasqueradeAll = bool(r.DecodeBool()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -841,13 +880,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Master = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -860,20 +899,20 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if x.OOMScoreAdj == nil { x.OOMScoreAdj = new(int) } - yym97 := z.DecBinary() - _ = yym97 + yym104 := z.DecBinary() + _ = yym104 if false { } else { *((*int)(x.OOMScoreAdj)) = int(r.DecodeInt(codecSelferBitsize1234)) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -883,13 +922,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Mode = ProxyMode(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -899,13 +938,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.PortRange = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -915,13 +954,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.ResourceContainer = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -929,24 +968,24 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.UDPIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv101 := &x.UDPIdleTimeout - yym102 := z.DecBinary() - _ = yym102 + yyv108 := &x.UDPIdleTimeout + yym109 := z.DecBinary() + _ = yym109 if false { - } else if z.HasExtensions() && z.DecExt(yyv101) { - } else if !yym102 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv101) + } else if z.HasExtensions() && z.DecExt(yyv108) { + } else if !yym109 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv108) } else { - z.DecFallback(yyv101, false) + z.DecFallback(yyv108, false) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -956,13 +995,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.ConntrackMax = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -970,29 +1009,61 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} } else { - yyv104 := &x.ConntrackTCPEstablishedTimeout - yym105 := z.DecBinary() - _ = yym105 + yyv111 := &x.ConntrackTCPEstablishedTimeout + yym112 := z.DecBinary() + _ = yym112 if false { - } else if z.HasExtensions() && z.DecExt(yyv104) { - } else if !yym105 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv104) + } else if z.HasExtensions() && z.DecExt(yyv111) { + } else if !yym112 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv111) } else { - z.DecFallback(yyv104, false) + z.DecFallback(yyv111, false) } } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj84-1, "") + z.DecStructFieldNotFound(yyj91-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1001,8 +1072,8 @@ func (x ProxyMode) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym106 := z.EncBinary() - _ = yym106 + yym115 := z.EncBinary() + _ = yym115 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -1014,8 +1085,8 @@ func (x *ProxyMode) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym107 := z.DecBinary() - _ = yym107 + yym116 := z.DecBinary() + _ = yym116 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -1030,41 +1101,41 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym108 := z.EncBinary() - _ = yym108 + yym117 := z.EncBinary() + _ = yym117 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep109 := !z.EncBinary() - yy2arr109 := z.EncBasicHandle().StructToArray - var yyq109 [71]bool - _, _, _ = yysep109, yyq109, yy2arr109 - const yyr109 bool = false - yyq109[45] = x.CloudProvider != "" - yyq109[46] = x.CloudConfigFile != "" - yyq109[47] = x.ResourceContainer != "" - yyq109[48] = x.CgroupRoot != "" - yyq109[50] = x.RktPath != "" - yyq109[51] = x.RktStage1Image != "" - yyq109[67] = true - yyq109[68] = x.NodeIP != "" - var yynn109 int - if yyr109 || yy2arr109 { - r.EncodeArrayStart(71) + yysep118 := !z.EncBinary() + yy2arr118 := z.EncBasicHandle().StructToArray + var yyq118 [74]bool + _, _, _ = yysep118, yyq118, yy2arr118 + const yyr118 bool = false + yyq118[46] = x.CloudProvider != "" + yyq118[47] = x.CloudConfigFile != "" + yyq118[48] = x.ResourceContainer != "" + yyq118[49] = x.CgroupRoot != "" + yyq118[51] = x.RktPath != "" + yyq118[52] = x.RktStage1Image != "" + yyq118[69] = true + yyq118[70] = x.NodeIP != "" + var yynn118 int + if yyr118 || yy2arr118 { + r.EncodeArrayStart(74) } else { - yynn109 = 63 - for _, b := range yyq109 { + yynn118 = 66 + for _, b := range yyq118 { if b { - yynn109++ + yynn118++ } } - r.EncodeMapStart(yynn109) - yynn109 = 0 + r.EncodeMapStart(yynn118) + yynn118 = 0 } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym111 := z.EncBinary() - _ = yym111 + yym120 := z.EncBinary() + _ = yym120 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Config)) @@ -1073,98 +1144,98 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("config")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym112 := z.EncBinary() - _ = yym112 + yym121 := z.EncBinary() + _ = yym121 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Config)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy114 := &x.SyncFrequency - yym115 := z.EncBinary() - _ = yym115 + yy123 := &x.SyncFrequency + yym124 := z.EncBinary() + _ = yym124 if false { - } else if z.HasExtensions() && z.EncExt(yy114) { - } else if !yym115 && z.IsJSONHandle() { - z.EncJSONMarshal(yy114) + } else if z.HasExtensions() && z.EncExt(yy123) { + } else if !yym124 && z.IsJSONHandle() { + z.EncJSONMarshal(yy123) } else { - z.EncFallback(yy114) + z.EncFallback(yy123) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("syncFrequency")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy116 := &x.SyncFrequency - yym117 := z.EncBinary() - _ = yym117 + yy125 := &x.SyncFrequency + yym126 := z.EncBinary() + _ = yym126 if false { - } else if z.HasExtensions() && z.EncExt(yy116) { - } else if !yym117 && z.IsJSONHandle() { - z.EncJSONMarshal(yy116) + } else if z.HasExtensions() && z.EncExt(yy125) { + } else if !yym126 && z.IsJSONHandle() { + z.EncJSONMarshal(yy125) } else { - z.EncFallback(yy116) + z.EncFallback(yy125) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy119 := &x.FileCheckFrequency - yym120 := z.EncBinary() - _ = yym120 + yy128 := &x.FileCheckFrequency + yym129 := z.EncBinary() + _ = yym129 if false { - } else if z.HasExtensions() && z.EncExt(yy119) { - } else if !yym120 && z.IsJSONHandle() { - z.EncJSONMarshal(yy119) + } else if z.HasExtensions() && z.EncExt(yy128) { + } else if !yym129 && z.IsJSONHandle() { + z.EncJSONMarshal(yy128) } else { - z.EncFallback(yy119) + z.EncFallback(yy128) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("fileCheckFrequency")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy121 := &x.FileCheckFrequency - yym122 := z.EncBinary() - _ = yym122 + yy130 := &x.FileCheckFrequency + yym131 := z.EncBinary() + _ = yym131 if false { - } else if z.HasExtensions() && z.EncExt(yy121) { - } else if !yym122 && z.IsJSONHandle() { - z.EncJSONMarshal(yy121) + } else if z.HasExtensions() && z.EncExt(yy130) { + } else if !yym131 && z.IsJSONHandle() { + z.EncJSONMarshal(yy130) } else { - z.EncFallback(yy121) + z.EncFallback(yy130) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy124 := &x.HTTPCheckFrequency - yym125 := z.EncBinary() - _ = yym125 + yy133 := &x.HTTPCheckFrequency + yym134 := z.EncBinary() + _ = yym134 if false { - } else if z.HasExtensions() && z.EncExt(yy124) { - } else if !yym125 && z.IsJSONHandle() { - z.EncJSONMarshal(yy124) + } else if z.HasExtensions() && z.EncExt(yy133) { + } else if !yym134 && z.IsJSONHandle() { + z.EncJSONMarshal(yy133) } else { - z.EncFallback(yy124) + z.EncFallback(yy133) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("httpCheckFrequency")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy126 := &x.HTTPCheckFrequency - yym127 := z.EncBinary() - _ = yym127 + yy135 := &x.HTTPCheckFrequency + yym136 := z.EncBinary() + _ = yym136 if false { - } else if z.HasExtensions() && z.EncExt(yy126) { - } else if !yym127 && z.IsJSONHandle() { - z.EncJSONMarshal(yy126) + } else if z.HasExtensions() && z.EncExt(yy135) { + } else if !yym136 && z.IsJSONHandle() { + z.EncJSONMarshal(yy135) } else { - z.EncFallback(yy126) + z.EncFallback(yy135) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym129 := z.EncBinary() - _ = yym129 + yym138 := z.EncBinary() + _ = yym138 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ManifestURL)) @@ -1173,17 +1244,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("manifestURL")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym130 := z.EncBinary() - _ = yym130 + yym139 := z.EncBinary() + _ = yym139 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ManifestURL)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym132 := z.EncBinary() - _ = yym132 + yym141 := z.EncBinary() + _ = yym141 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ManifestURLHeader)) @@ -1192,17 +1263,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("manifestURLHeader")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym133 := z.EncBinary() - _ = yym133 + yym142 := z.EncBinary() + _ = yym142 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ManifestURLHeader)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym135 := z.EncBinary() - _ = yym135 + yym144 := z.EncBinary() + _ = yym144 if false { } else { r.EncodeBool(bool(x.EnableServer)) @@ -1211,17 +1282,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("enableServer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym136 := z.EncBinary() - _ = yym136 + yym145 := z.EncBinary() + _ = yym145 if false { } else { r.EncodeBool(bool(x.EnableServer)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym138 := z.EncBinary() - _ = yym138 + yym147 := z.EncBinary() + _ = yym147 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) @@ -1230,17 +1301,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("address")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym139 := z.EncBinary() - _ = yym139 + yym148 := z.EncBinary() + _ = yym148 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym141 := z.EncBinary() - _ = yym141 + yym150 := z.EncBinary() + _ = yym150 if false { } else { r.EncodeUint(uint64(x.Port)) @@ -1249,17 +1320,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym142 := z.EncBinary() - _ = yym142 + yym151 := z.EncBinary() + _ = yym151 if false { } else { r.EncodeUint(uint64(x.Port)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym144 := z.EncBinary() - _ = yym144 + yym153 := z.EncBinary() + _ = yym153 if false { } else { r.EncodeUint(uint64(x.ReadOnlyPort)) @@ -1268,17 +1339,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("readOnlyPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym145 := z.EncBinary() - _ = yym145 + yym154 := z.EncBinary() + _ = yym154 if false { } else { r.EncodeUint(uint64(x.ReadOnlyPort)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym147 := z.EncBinary() - _ = yym147 + yym156 := z.EncBinary() + _ = yym156 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TLSCertFile)) @@ -1287,17 +1358,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tLSCertFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym148 := z.EncBinary() - _ = yym148 + yym157 := z.EncBinary() + _ = yym157 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TLSCertFile)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym150 := z.EncBinary() - _ = yym150 + yym159 := z.EncBinary() + _ = yym159 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TLSPrivateKeyFile)) @@ -1306,17 +1377,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("tLSPrivateKeyFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym151 := z.EncBinary() - _ = yym151 + yym160 := z.EncBinary() + _ = yym160 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.TLSPrivateKeyFile)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym153 := z.EncBinary() - _ = yym153 + yym162 := z.EncBinary() + _ = yym162 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CertDirectory)) @@ -1325,17 +1396,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("certDirectory")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym154 := z.EncBinary() - _ = yym154 + yym163 := z.EncBinary() + _ = yym163 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CertDirectory)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym156 := z.EncBinary() - _ = yym156 + yym165 := z.EncBinary() + _ = yym165 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) @@ -1344,17 +1415,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostnameOverride")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym157 := z.EncBinary() - _ = yym157 + yym166 := z.EncBinary() + _ = yym166 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym159 := z.EncBinary() - _ = yym159 + yym168 := z.EncBinary() + _ = yym168 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodInfraContainerImage)) @@ -1363,17 +1434,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podInfraContainerImage")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym160 := z.EncBinary() - _ = yym160 + yym169 := z.EncBinary() + _ = yym169 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodInfraContainerImage)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym162 := z.EncBinary() - _ = yym162 + yym171 := z.EncBinary() + _ = yym171 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DockerEndpoint)) @@ -1382,17 +1453,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("dockerEndpoint")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym163 := z.EncBinary() - _ = yym163 + yym172 := z.EncBinary() + _ = yym172 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DockerEndpoint)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym165 := z.EncBinary() - _ = yym165 + yym174 := z.EncBinary() + _ = yym174 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RootDirectory)) @@ -1401,17 +1472,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rootDirectory")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym166 := z.EncBinary() - _ = yym166 + yym175 := z.EncBinary() + _ = yym175 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RootDirectory)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym168 := z.EncBinary() - _ = yym168 + yym177 := z.EncBinary() + _ = yym177 if false { } else { r.EncodeBool(bool(x.AllowPrivileged)) @@ -1420,17 +1491,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("allowPrivileged")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym169 := z.EncBinary() - _ = yym169 + yym178 := z.EncBinary() + _ = yym178 if false { } else { r.EncodeBool(bool(x.AllowPrivileged)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym171 := z.EncBinary() - _ = yym171 + yym180 := z.EncBinary() + _ = yym180 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostNetworkSources)) @@ -1439,17 +1510,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostNetworkSources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym172 := z.EncBinary() - _ = yym172 + yym181 := z.EncBinary() + _ = yym181 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostNetworkSources)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym174 := z.EncBinary() - _ = yym174 + yym183 := z.EncBinary() + _ = yym183 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostPIDSources)) @@ -1458,17 +1529,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostPIDSources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym175 := z.EncBinary() - _ = yym175 + yym184 := z.EncBinary() + _ = yym184 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostPIDSources)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym177 := z.EncBinary() - _ = yym177 + yym186 := z.EncBinary() + _ = yym186 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIPCSources)) @@ -1477,17 +1548,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostIPCSources")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym178 := z.EncBinary() - _ = yym178 + yym187 := z.EncBinary() + _ = yym187 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostIPCSources)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym180 := z.EncBinary() - _ = yym180 + yym189 := z.EncBinary() + _ = yym189 if false { } else { r.EncodeFloat64(float64(x.RegistryPullQPS)) @@ -1496,17 +1567,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("registryPullQPS")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym181 := z.EncBinary() - _ = yym181 + yym190 := z.EncBinary() + _ = yym190 if false { } else { r.EncodeFloat64(float64(x.RegistryPullQPS)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym183 := z.EncBinary() - _ = yym183 + yym192 := z.EncBinary() + _ = yym192 if false { } else { r.EncodeInt(int64(x.RegistryBurst)) @@ -1515,17 +1586,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("registryBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym184 := z.EncBinary() - _ = yym184 + yym193 := z.EncBinary() + _ = yym193 if false { } else { r.EncodeInt(int64(x.RegistryBurst)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym186 := z.EncBinary() - _ = yym186 + yym195 := z.EncBinary() + _ = yym195 if false { } else { r.EncodeFloat32(float32(x.EventRecordQPS)) @@ -1534,17 +1605,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("eventRecordQPS")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym187 := z.EncBinary() - _ = yym187 + yym196 := z.EncBinary() + _ = yym196 if false { } else { r.EncodeFloat32(float32(x.EventRecordQPS)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym189 := z.EncBinary() - _ = yym189 + yym198 := z.EncBinary() + _ = yym198 if false { } else { r.EncodeInt(int64(x.EventBurst)) @@ -1553,17 +1624,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("eventBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym190 := z.EncBinary() - _ = yym190 + yym199 := z.EncBinary() + _ = yym199 if false { } else { r.EncodeInt(int64(x.EventBurst)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym192 := z.EncBinary() - _ = yym192 + yym201 := z.EncBinary() + _ = yym201 if false { } else { r.EncodeBool(bool(x.EnableDebuggingHandlers)) @@ -1572,44 +1643,44 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("enableDebuggingHandlers")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym193 := z.EncBinary() - _ = yym193 + yym202 := z.EncBinary() + _ = yym202 if false { } else { r.EncodeBool(bool(x.EnableDebuggingHandlers)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy195 := &x.MinimumGCAge - yym196 := z.EncBinary() - _ = yym196 + yy204 := &x.MinimumGCAge + yym205 := z.EncBinary() + _ = yym205 if false { - } else if z.HasExtensions() && z.EncExt(yy195) { - } else if !yym196 && z.IsJSONHandle() { - z.EncJSONMarshal(yy195) + } else if z.HasExtensions() && z.EncExt(yy204) { + } else if !yym205 && z.IsJSONHandle() { + z.EncJSONMarshal(yy204) } else { - z.EncFallback(yy195) + z.EncFallback(yy204) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minimumGCAge")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy197 := &x.MinimumGCAge - yym198 := z.EncBinary() - _ = yym198 + yy206 := &x.MinimumGCAge + yym207 := z.EncBinary() + _ = yym207 if false { - } else if z.HasExtensions() && z.EncExt(yy197) { - } else if !yym198 && z.IsJSONHandle() { - z.EncJSONMarshal(yy197) + } else if z.HasExtensions() && z.EncExt(yy206) { + } else if !yym207 && z.IsJSONHandle() { + z.EncJSONMarshal(yy206) } else { - z.EncFallback(yy197) + z.EncFallback(yy206) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym200 := z.EncBinary() - _ = yym200 + yym209 := z.EncBinary() + _ = yym209 if false { } else { r.EncodeInt(int64(x.MaxPerPodContainerCount)) @@ -1618,17 +1689,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxPerPodContainerCount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym201 := z.EncBinary() - _ = yym201 + yym210 := z.EncBinary() + _ = yym210 if false { } else { r.EncodeInt(int64(x.MaxPerPodContainerCount)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym203 := z.EncBinary() - _ = yym203 + yym212 := z.EncBinary() + _ = yym212 if false { } else { r.EncodeInt(int64(x.MaxContainerCount)) @@ -1637,17 +1708,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxContainerCount")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym204 := z.EncBinary() - _ = yym204 + yym213 := z.EncBinary() + _ = yym213 if false { } else { r.EncodeInt(int64(x.MaxContainerCount)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym206 := z.EncBinary() - _ = yym206 + yym215 := z.EncBinary() + _ = yym215 if false { } else { r.EncodeUint(uint64(x.CAdvisorPort)) @@ -1656,17 +1727,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cAdvisorPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym207 := z.EncBinary() - _ = yym207 + yym216 := z.EncBinary() + _ = yym216 if false { } else { r.EncodeUint(uint64(x.CAdvisorPort)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym209 := z.EncBinary() - _ = yym209 + yym218 := z.EncBinary() + _ = yym218 if false { } else { r.EncodeInt(int64(x.HealthzPort)) @@ -1675,17 +1746,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym210 := z.EncBinary() - _ = yym210 + yym219 := z.EncBinary() + _ = yym219 if false { } else { r.EncodeInt(int64(x.HealthzPort)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym212 := z.EncBinary() - _ = yym212 + yym221 := z.EncBinary() + _ = yym221 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) @@ -1694,17 +1765,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzBindAddress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym213 := z.EncBinary() - _ = yym213 + yym222 := z.EncBinary() + _ = yym222 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym215 := z.EncBinary() - _ = yym215 + yym224 := z.EncBinary() + _ = yym224 if false { } else { r.EncodeInt(int64(x.OOMScoreAdj)) @@ -1713,17 +1784,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("oomScoreAdj")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym216 := z.EncBinary() - _ = yym216 + yym225 := z.EncBinary() + _ = yym225 if false { } else { r.EncodeInt(int64(x.OOMScoreAdj)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym218 := z.EncBinary() - _ = yym218 + yym227 := z.EncBinary() + _ = yym227 if false { } else { r.EncodeBool(bool(x.RegisterNode)) @@ -1732,17 +1803,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("registerNode")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym219 := z.EncBinary() - _ = yym219 + yym228 := z.EncBinary() + _ = yym228 if false { } else { r.EncodeBool(bool(x.RegisterNode)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym221 := z.EncBinary() - _ = yym221 + yym230 := z.EncBinary() + _ = yym230 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterDomain)) @@ -1751,17 +1822,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("clusterDomain")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym222 := z.EncBinary() - _ = yym222 + yym231 := z.EncBinary() + _ = yym231 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterDomain)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym224 := z.EncBinary() - _ = yym224 + yym233 := z.EncBinary() + _ = yym233 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MasterServiceNamespace)) @@ -1770,17 +1841,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("masterServiceNamespace")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym225 := z.EncBinary() - _ = yym225 + yym234 := z.EncBinary() + _ = yym234 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.MasterServiceNamespace)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym227 := z.EncBinary() - _ = yym227 + yym236 := z.EncBinary() + _ = yym236 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterDNS)) @@ -1789,71 +1860,71 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("clusterDNS")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym228 := z.EncBinary() - _ = yym228 + yym237 := z.EncBinary() + _ = yym237 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ClusterDNS)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy230 := &x.StreamingConnectionIdleTimeout - yym231 := z.EncBinary() - _ = yym231 + yy239 := &x.StreamingConnectionIdleTimeout + yym240 := z.EncBinary() + _ = yym240 if false { - } else if z.HasExtensions() && z.EncExt(yy230) { - } else if !yym231 && z.IsJSONHandle() { - z.EncJSONMarshal(yy230) + } else if z.HasExtensions() && z.EncExt(yy239) { + } else if !yym240 && z.IsJSONHandle() { + z.EncJSONMarshal(yy239) } else { - z.EncFallback(yy230) + z.EncFallback(yy239) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("streamingConnectionIdleTimeout")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy232 := &x.StreamingConnectionIdleTimeout - yym233 := z.EncBinary() - _ = yym233 + yy241 := &x.StreamingConnectionIdleTimeout + yym242 := z.EncBinary() + _ = yym242 if false { - } else if z.HasExtensions() && z.EncExt(yy232) { - } else if !yym233 && z.IsJSONHandle() { - z.EncJSONMarshal(yy232) + } else if z.HasExtensions() && z.EncExt(yy241) { + } else if !yym242 && z.IsJSONHandle() { + z.EncJSONMarshal(yy241) } else { - z.EncFallback(yy232) + z.EncFallback(yy241) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy235 := &x.NodeStatusUpdateFrequency - yym236 := z.EncBinary() - _ = yym236 + yy244 := &x.NodeStatusUpdateFrequency + yym245 := z.EncBinary() + _ = yym245 if false { - } else if z.HasExtensions() && z.EncExt(yy235) { - } else if !yym236 && z.IsJSONHandle() { - z.EncJSONMarshal(yy235) + } else if z.HasExtensions() && z.EncExt(yy244) { + } else if !yym245 && z.IsJSONHandle() { + z.EncJSONMarshal(yy244) } else { - z.EncFallback(yy235) + z.EncFallback(yy244) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeStatusUpdateFrequency")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy237 := &x.NodeStatusUpdateFrequency - yym238 := z.EncBinary() - _ = yym238 + yy246 := &x.NodeStatusUpdateFrequency + yym247 := z.EncBinary() + _ = yym247 if false { - } else if z.HasExtensions() && z.EncExt(yy237) { - } else if !yym238 && z.IsJSONHandle() { - z.EncJSONMarshal(yy237) + } else if z.HasExtensions() && z.EncExt(yy246) { + } else if !yym247 && z.IsJSONHandle() { + z.EncJSONMarshal(yy246) } else { - z.EncFallback(yy237) + z.EncFallback(yy246) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym240 := z.EncBinary() - _ = yym240 + yym249 := z.EncBinary() + _ = yym249 if false { } else { r.EncodeInt(int64(x.ImageGCHighThresholdPercent)) @@ -1862,17 +1933,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imageGCHighThresholdPercent")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym241 := z.EncBinary() - _ = yym241 + yym250 := z.EncBinary() + _ = yym250 if false { } else { r.EncodeInt(int64(x.ImageGCHighThresholdPercent)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym243 := z.EncBinary() - _ = yym243 + yym252 := z.EncBinary() + _ = yym252 if false { } else { r.EncodeInt(int64(x.ImageGCLowThresholdPercent)) @@ -1881,17 +1952,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("imageGCLowThresholdPercent")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym244 := z.EncBinary() - _ = yym244 + yym253 := z.EncBinary() + _ = yym253 if false { } else { r.EncodeInt(int64(x.ImageGCLowThresholdPercent)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym246 := z.EncBinary() - _ = yym246 + yym255 := z.EncBinary() + _ = yym255 if false { } else { r.EncodeInt(int64(x.LowDiskSpaceThresholdMB)) @@ -1900,17 +1971,44 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lowDiskSpaceThresholdMB")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym247 := z.EncBinary() - _ = yym247 + yym256 := z.EncBinary() + _ = yym256 if false { } else { r.EncodeInt(int64(x.LowDiskSpaceThresholdMB)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym249 := z.EncBinary() - _ = yym249 + yy258 := &x.VolumeStatsAggPeriod + yym259 := z.EncBinary() + _ = yym259 + if false { + } else if z.HasExtensions() && z.EncExt(yy258) { + } else if !yym259 && z.IsJSONHandle() { + z.EncJSONMarshal(yy258) + } else { + z.EncFallback(yy258) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("VolumeStatsAggPeriod")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy260 := &x.VolumeStatsAggPeriod + yym261 := z.EncBinary() + _ = yym261 + if false { + } else if z.HasExtensions() && z.EncExt(yy260) { + } else if !yym261 && z.IsJSONHandle() { + z.EncJSONMarshal(yy260) + } else { + z.EncFallback(yy260) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym263 := z.EncBinary() + _ = yym263 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NetworkPluginName)) @@ -1919,17 +2017,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("networkPluginName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym250 := z.EncBinary() - _ = yym250 + yym264 := z.EncBinary() + _ = yym264 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NetworkPluginName)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym252 := z.EncBinary() - _ = yym252 + yym266 := z.EncBinary() + _ = yym266 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NetworkPluginDir)) @@ -1938,17 +2036,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("networkPluginDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym253 := z.EncBinary() - _ = yym253 + yym267 := z.EncBinary() + _ = yym267 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NetworkPluginDir)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym255 := z.EncBinary() - _ = yym255 + yym269 := z.EncBinary() + _ = yym269 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumePluginDir)) @@ -1957,18 +2055,18 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("volumePluginDir")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym256 := z.EncBinary() - _ = yym256 + yym270 := z.EncBinary() + _ = yym270 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.VolumePluginDir)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[45] { - yym258 := z.EncBinary() - _ = yym258 + if yyq118[46] { + yym272 := z.EncBinary() + _ = yym272 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CloudProvider)) @@ -1977,23 +2075,23 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[45] { + if yyq118[46] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cloudProvider")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym259 := z.EncBinary() - _ = yym259 + yym273 := z.EncBinary() + _ = yym273 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CloudProvider)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[46] { - yym261 := z.EncBinary() - _ = yym261 + if yyq118[47] { + yym275 := z.EncBinary() + _ = yym275 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CloudConfigFile)) @@ -2002,23 +2100,23 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[46] { + if yyq118[47] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cloudConfigFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym262 := z.EncBinary() - _ = yym262 + yym276 := z.EncBinary() + _ = yym276 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CloudConfigFile)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[47] { - yym264 := z.EncBinary() - _ = yym264 + if yyq118[48] { + yym278 := z.EncBinary() + _ = yym278 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) @@ -2027,23 +2125,23 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[47] { + if yyq118[48] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceContainer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym265 := z.EncBinary() - _ = yym265 + yym279 := z.EncBinary() + _ = yym279 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[48] { - yym267 := z.EncBinary() - _ = yym267 + if yyq118[49] { + yym281 := z.EncBinary() + _ = yym281 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CgroupRoot)) @@ -2052,22 +2150,22 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[48] { + if yyq118[49] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cgroupRoot")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym268 := z.EncBinary() - _ = yym268 + yym282 := z.EncBinary() + _ = yym282 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.CgroupRoot)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym270 := z.EncBinary() - _ = yym270 + yym284 := z.EncBinary() + _ = yym284 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntime)) @@ -2076,18 +2174,18 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerRuntime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym271 := z.EncBinary() - _ = yym271 + yym285 := z.EncBinary() + _ = yym285 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ContainerRuntime)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[50] { - yym273 := z.EncBinary() - _ = yym273 + if yyq118[51] { + yym287 := z.EncBinary() + _ = yym287 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RktPath)) @@ -2096,23 +2194,23 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[50] { + if yyq118[51] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rktPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym274 := z.EncBinary() - _ = yym274 + yym288 := z.EncBinary() + _ = yym288 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RktPath)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[51] { - yym276 := z.EncBinary() - _ = yym276 + if yyq118[52] { + yym290 := z.EncBinary() + _ = yym290 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RktStage1Image)) @@ -2121,22 +2219,22 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[51] { + if yyq118[52] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rktStage1Image")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym277 := z.EncBinary() - _ = yym277 + yym291 := z.EncBinary() + _ = yym291 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.RktStage1Image)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym279 := z.EncBinary() - _ = yym279 + yym293 := z.EncBinary() + _ = yym293 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemContainer)) @@ -2145,17 +2243,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("systemContainer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym280 := z.EncBinary() - _ = yym280 + yym294 := z.EncBinary() + _ = yym294 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SystemContainer)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym282 := z.EncBinary() - _ = yym282 + yym296 := z.EncBinary() + _ = yym296 if false { } else { r.EncodeBool(bool(x.ConfigureCBR0)) @@ -2164,17 +2262,36 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("configureCbr0")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym283 := z.EncBinary() - _ = yym283 + yym297 := z.EncBinary() + _ = yym297 if false { } else { r.EncodeBool(bool(x.ConfigureCBR0)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym285 := z.EncBinary() - _ = yym285 + yym299 := z.EncBinary() + _ = yym299 + if false { + } else { + r.EncodeBool(bool(x.HairpinMode)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("configureHairpinMode")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym300 := z.EncBinary() + _ = yym300 + if false { + } else { + r.EncodeBool(bool(x.HairpinMode)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym302 := z.EncBinary() + _ = yym302 if false { } else { r.EncodeInt(int64(x.MaxPods)) @@ -2183,17 +2300,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxPods")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym286 := z.EncBinary() - _ = yym286 + yym303 := z.EncBinary() + _ = yym303 if false { } else { r.EncodeInt(int64(x.MaxPods)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym288 := z.EncBinary() - _ = yym288 + yym305 := z.EncBinary() + _ = yym305 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DockerExecHandlerName)) @@ -2202,17 +2319,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("dockerExecHandlerName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym289 := z.EncBinary() - _ = yym289 + yym306 := z.EncBinary() + _ = yym306 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.DockerExecHandlerName)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym291 := z.EncBinary() - _ = yym291 + yym308 := z.EncBinary() + _ = yym308 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) @@ -2221,17 +2338,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("podCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym292 := z.EncBinary() - _ = yym292 + yym309 := z.EncBinary() + _ = yym309 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PodCIDR)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym294 := z.EncBinary() - _ = yym294 + yym311 := z.EncBinary() + _ = yym311 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResolverConfig)) @@ -2240,17 +2357,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resolvConf")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym295 := z.EncBinary() - _ = yym295 + yym312 := z.EncBinary() + _ = yym312 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResolverConfig)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym297 := z.EncBinary() - _ = yym297 + yym314 := z.EncBinary() + _ = yym314 if false { } else { r.EncodeBool(bool(x.CPUCFSQuota)) @@ -2259,17 +2376,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("cpuCFSQuota")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym298 := z.EncBinary() - _ = yym298 + yym315 := z.EncBinary() + _ = yym315 if false { } else { r.EncodeBool(bool(x.CPUCFSQuota)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym300 := z.EncBinary() - _ = yym300 + yym317 := z.EncBinary() + _ = yym317 if false { } else { r.EncodeBool(bool(x.Containerized)) @@ -2278,17 +2395,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("containerized")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym301 := z.EncBinary() - _ = yym301 + yym318 := z.EncBinary() + _ = yym318 if false { } else { r.EncodeBool(bool(x.Containerized)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym303 := z.EncBinary() - _ = yym303 + yym320 := z.EncBinary() + _ = yym320 if false { } else { r.EncodeUint(uint64(x.MaxOpenFiles)) @@ -2297,17 +2414,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxOpenFiles")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym304 := z.EncBinary() - _ = yym304 + yym321 := z.EncBinary() + _ = yym321 if false { } else { r.EncodeUint(uint64(x.MaxOpenFiles)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym306 := z.EncBinary() - _ = yym306 + yym323 := z.EncBinary() + _ = yym323 if false { } else { r.EncodeBool(bool(x.ReconcileCIDR)) @@ -2316,17 +2433,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reconcileCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym307 := z.EncBinary() - _ = yym307 + yym324 := z.EncBinary() + _ = yym324 if false { } else { r.EncodeBool(bool(x.ReconcileCIDR)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym309 := z.EncBinary() - _ = yym309 + yym326 := z.EncBinary() + _ = yym326 if false { } else { r.EncodeBool(bool(x.RegisterSchedulable)) @@ -2335,17 +2452,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("registerSchedulable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym310 := z.EncBinary() - _ = yym310 + yym327 := z.EncBinary() + _ = yym327 if false { } else { r.EncodeBool(bool(x.RegisterSchedulable)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym312 := z.EncBinary() - _ = yym312 + yym329 := z.EncBinary() + _ = yym329 if false { } else { r.EncodeFloat32(float32(x.KubeAPIQPS)) @@ -2354,17 +2471,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym313 := z.EncBinary() - _ = yym313 + yym330 := z.EncBinary() + _ = yym330 if false { } else { r.EncodeFloat32(float32(x.KubeAPIQPS)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym315 := z.EncBinary() - _ = yym315 + yym332 := z.EncBinary() + _ = yym332 if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) @@ -2373,17 +2490,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeAPIBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym316 := z.EncBinary() - _ = yym316 + yym333 := z.EncBinary() + _ = yym333 if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym318 := z.EncBinary() - _ = yym318 + yym335 := z.EncBinary() + _ = yym335 if false { } else { r.EncodeBool(bool(x.SerializeImagePulls)) @@ -2392,17 +2509,17 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serializeImagePulls")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym319 := z.EncBinary() - _ = yym319 + yym336 := z.EncBinary() + _ = yym336 if false { } else { r.EncodeBool(bool(x.SerializeImagePulls)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym321 := z.EncBinary() - _ = yym321 + yym338 := z.EncBinary() + _ = yym338 if false { } else { r.EncodeBool(bool(x.ExperimentalFlannelOverlay)) @@ -2411,51 +2528,51 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("experimentalFlannelOverlay")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym322 := z.EncBinary() - _ = yym322 + yym339 := z.EncBinary() + _ = yym339 if false { } else { r.EncodeBool(bool(x.ExperimentalFlannelOverlay)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[67] { - yy324 := &x.OutOfDiskTransitionFrequency - yym325 := z.EncBinary() - _ = yym325 + if yyq118[69] { + yy341 := &x.OutOfDiskTransitionFrequency + yym342 := z.EncBinary() + _ = yym342 if false { - } else if z.HasExtensions() && z.EncExt(yy324) { - } else if !yym325 && z.IsJSONHandle() { - z.EncJSONMarshal(yy324) + } else if z.HasExtensions() && z.EncExt(yy341) { + } else if !yym342 && z.IsJSONHandle() { + z.EncJSONMarshal(yy341) } else { - z.EncFallback(yy324) + z.EncFallback(yy341) } } else { r.EncodeNil() } } else { - if yyq109[67] { + if yyq118[69] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("outOfDiskTransitionFrequency")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy326 := &x.OutOfDiskTransitionFrequency - yym327 := z.EncBinary() - _ = yym327 + yy343 := &x.OutOfDiskTransitionFrequency + yym344 := z.EncBinary() + _ = yym344 if false { - } else if z.HasExtensions() && z.EncExt(yy326) { - } else if !yym327 && z.IsJSONHandle() { - z.EncJSONMarshal(yy326) + } else if z.HasExtensions() && z.EncExt(yy343) { + } else if !yym344 && z.IsJSONHandle() { + z.EncJSONMarshal(yy343) } else { - z.EncFallback(yy326) + z.EncFallback(yy343) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq109[68] { - yym329 := z.EncBinary() - _ = yym329 + if yyq118[70] { + yym346 := z.EncBinary() + _ = yym346 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeIP)) @@ -2464,25 +2581,25 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq109[68] { + if yyq118[70] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nodeIP")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym330 := z.EncBinary() - _ = yym330 + yym347 := z.EncBinary() + _ = yym347 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NodeIP)) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.NodeLabels == nil { r.EncodeNil() } else { - yym332 := z.EncBinary() - _ = yym332 + yym349 := z.EncBinary() + _ = yym349 if false { } else { z.F.EncMapStringStringV(x.NodeLabels, false, e) @@ -2495,18 +2612,18 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x.NodeLabels == nil { r.EncodeNil() } else { - yym333 := z.EncBinary() - _ = yym333 + yym350 := z.EncBinary() + _ = yym350 if false { } else { z.F.EncMapStringStringV(x.NodeLabels, false, e) } } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym335 := z.EncBinary() - _ = yym335 + yym352 := z.EncBinary() + _ = yym352 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NonMasqueradeCIDR)) @@ -2515,14 +2632,33 @@ func (x *KubeletConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("nonMasqueradeCIDR")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym336 := z.EncBinary() - _ = yym336 + yym353 := z.EncBinary() + _ = yym353 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.NonMasqueradeCIDR)) } } - if yyr109 || yy2arr109 { + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym355 := z.EncBinary() + _ = yym355 + if false { + } else { + r.EncodeBool(bool(x.EnableCustomMetrics)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("enableCustomMetrics")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym356 := z.EncBinary() + _ = yym356 + if false { + } else { + r.EncodeBool(bool(x.EnableCustomMetrics)) + } + } + if yyr118 || yy2arr118 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -2535,25 +2671,25 @@ func (x *KubeletConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym337 := z.DecBinary() - _ = yym337 + yym357 := z.DecBinary() + _ = yym357 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct338 := r.ContainerType() - if yyct338 == codecSelferValueTypeMap1234 { - yyl338 := r.ReadMapStart() - if yyl338 == 0 { + yyct358 := r.ContainerType() + if yyct358 == codecSelferValueTypeMap1234 { + yyl358 := r.ReadMapStart() + if yyl358 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl338, d) + x.codecDecodeSelfFromMap(yyl358, d) } - } else if yyct338 == codecSelferValueTypeArray1234 { - yyl338 := r.ReadArrayStart() - if yyl338 == 0 { + } else if yyct358 == codecSelferValueTypeArray1234 { + yyl358 := r.ReadArrayStart() + if yyl358 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl338, d) + x.codecDecodeSelfFromArray(yyl358, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -2565,12 +2701,12 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys339Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys339Slc - var yyhl339 bool = l >= 0 - for yyj339 := 0; ; yyj339++ { - if yyhl339 { - if yyj339 >= l { + var yys359Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys359Slc + var yyhl359 bool = l >= 0 + for yyj359 := 0; ; yyj359++ { + if yyhl359 { + if yyj359 >= l { break } } else { @@ -2579,10 +2715,10 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys339Slc = r.DecodeBytes(yys339Slc, true, true) - yys339 := string(yys339Slc) + yys359Slc = r.DecodeBytes(yys359Slc, true, true) + yys359 := string(yys359Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys339 { + switch yys359 { case "config": if r.TryDecodeAsNil() { x.Config = "" @@ -2593,45 +2729,45 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.SyncFrequency = pkg1_unversioned.Duration{} } else { - yyv341 := &x.SyncFrequency - yym342 := z.DecBinary() - _ = yym342 + yyv361 := &x.SyncFrequency + yym362 := z.DecBinary() + _ = yym362 if false { - } else if z.HasExtensions() && z.DecExt(yyv341) { - } else if !yym342 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv341) + } else if z.HasExtensions() && z.DecExt(yyv361) { + } else if !yym362 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv361) } else { - z.DecFallback(yyv341, false) + z.DecFallback(yyv361, false) } } case "fileCheckFrequency": if r.TryDecodeAsNil() { x.FileCheckFrequency = pkg1_unversioned.Duration{} } else { - yyv343 := &x.FileCheckFrequency - yym344 := z.DecBinary() - _ = yym344 + yyv363 := &x.FileCheckFrequency + yym364 := z.DecBinary() + _ = yym364 if false { - } else if z.HasExtensions() && z.DecExt(yyv343) { - } else if !yym344 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv343) + } else if z.HasExtensions() && z.DecExt(yyv363) { + } else if !yym364 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv363) } else { - z.DecFallback(yyv343, false) + z.DecFallback(yyv363, false) } } case "httpCheckFrequency": if r.TryDecodeAsNil() { x.HTTPCheckFrequency = pkg1_unversioned.Duration{} } else { - yyv345 := &x.HTTPCheckFrequency - yym346 := z.DecBinary() - _ = yym346 + yyv365 := &x.HTTPCheckFrequency + yym366 := z.DecBinary() + _ = yym366 if false { - } else if z.HasExtensions() && z.DecExt(yyv345) { - } else if !yym346 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv345) + } else if z.HasExtensions() && z.DecExt(yyv365) { + } else if !yym366 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv365) } else { - z.DecFallback(yyv345, false) + z.DecFallback(yyv365, false) } } case "manifestURL": @@ -2770,15 +2906,15 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.MinimumGCAge = pkg1_unversioned.Duration{} } else { - yyv369 := &x.MinimumGCAge - yym370 := z.DecBinary() - _ = yym370 + yyv389 := &x.MinimumGCAge + yym390 := z.DecBinary() + _ = yym390 if false { - } else if z.HasExtensions() && z.DecExt(yyv369) { - } else if !yym370 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv369) + } else if z.HasExtensions() && z.DecExt(yyv389) { + } else if !yym390 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv389) } else { - z.DecFallback(yyv369, false) + z.DecFallback(yyv389, false) } } case "maxPerPodContainerCount": @@ -2845,30 +2981,30 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.StreamingConnectionIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv381 := &x.StreamingConnectionIdleTimeout - yym382 := z.DecBinary() - _ = yym382 + yyv401 := &x.StreamingConnectionIdleTimeout + yym402 := z.DecBinary() + _ = yym402 if false { - } else if z.HasExtensions() && z.DecExt(yyv381) { - } else if !yym382 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv381) + } else if z.HasExtensions() && z.DecExt(yyv401) { + } else if !yym402 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv401) } else { - z.DecFallback(yyv381, false) + z.DecFallback(yyv401, false) } } case "nodeStatusUpdateFrequency": if r.TryDecodeAsNil() { x.NodeStatusUpdateFrequency = pkg1_unversioned.Duration{} } else { - yyv383 := &x.NodeStatusUpdateFrequency - yym384 := z.DecBinary() - _ = yym384 + yyv403 := &x.NodeStatusUpdateFrequency + yym404 := z.DecBinary() + _ = yym404 if false { - } else if z.HasExtensions() && z.DecExt(yyv383) { - } else if !yym384 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv383) + } else if z.HasExtensions() && z.DecExt(yyv403) { + } else if !yym404 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv403) } else { - z.DecFallback(yyv383, false) + z.DecFallback(yyv403, false) } } case "imageGCHighThresholdPercent": @@ -2889,6 +3025,21 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode } else { x.LowDiskSpaceThresholdMB = int(r.DecodeInt(codecSelferBitsize1234)) } + case "VolumeStatsAggPeriod": + if r.TryDecodeAsNil() { + x.VolumeStatsAggPeriod = pkg1_unversioned.Duration{} + } else { + yyv408 := &x.VolumeStatsAggPeriod + yym409 := z.DecBinary() + _ = yym409 + if false { + } else if z.HasExtensions() && z.DecExt(yyv408) { + } else if !yym409 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv408) + } else { + z.DecFallback(yyv408, false) + } + } case "networkPluginName": if r.TryDecodeAsNil() { x.NetworkPluginName = "" @@ -2961,6 +3112,12 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode } else { x.ConfigureCBR0 = bool(r.DecodeBool()) } + case "configureHairpinMode": + if r.TryDecodeAsNil() { + x.HairpinMode = false + } else { + x.HairpinMode = bool(r.DecodeBool()) + } case "maxPods": if r.TryDecodeAsNil() { x.MaxPods = 0 @@ -3043,15 +3200,15 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.OutOfDiskTransitionFrequency = pkg1_unversioned.Duration{} } else { - yyv413 := &x.OutOfDiskTransitionFrequency - yym414 := z.DecBinary() - _ = yym414 + yyv436 := &x.OutOfDiskTransitionFrequency + yym437 := z.DecBinary() + _ = yym437 if false { - } else if z.HasExtensions() && z.DecExt(yyv413) { - } else if !yym414 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv413) + } else if z.HasExtensions() && z.DecExt(yyv436) { + } else if !yym437 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv436) } else { - z.DecFallback(yyv413, false) + z.DecFallback(yyv436, false) } } case "nodeIP": @@ -3064,12 +3221,12 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.NodeLabels = nil } else { - yyv416 := &x.NodeLabels - yym417 := z.DecBinary() - _ = yym417 + yyv439 := &x.NodeLabels + yym440 := z.DecBinary() + _ = yym440 if false { } else { - z.F.DecMapStringStringX(yyv416, false, d) + z.F.DecMapStringStringX(yyv439, false, d) } } case "nonMasqueradeCIDR": @@ -3078,10 +3235,16 @@ func (x *KubeletConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decode } else { x.NonMasqueradeCIDR = string(r.DecodeString()) } + case "enableCustomMetrics": + if r.TryDecodeAsNil() { + x.EnableCustomMetrics = false + } else { + x.EnableCustomMetrics = bool(r.DecodeBool()) + } default: - z.DecStructFieldNotFound(-1, yys339) - } // end switch yys339 - } // end for yyj339 + z.DecStructFieldNotFound(-1, yys359) + } // end switch yys359 + } // end for yyj359 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -3089,16 +3252,16 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj419 int - var yyb419 bool - var yyhl419 bool = l >= 0 - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + var yyj443 int + var yyb443 bool + var yyhl443 bool = l >= 0 + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3108,13 +3271,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.Config = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3122,24 +3285,24 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.SyncFrequency = pkg1_unversioned.Duration{} } else { - yyv421 := &x.SyncFrequency - yym422 := z.DecBinary() - _ = yym422 + yyv445 := &x.SyncFrequency + yym446 := z.DecBinary() + _ = yym446 if false { - } else if z.HasExtensions() && z.DecExt(yyv421) { - } else if !yym422 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv421) + } else if z.HasExtensions() && z.DecExt(yyv445) { + } else if !yym446 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv445) } else { - z.DecFallback(yyv421, false) + z.DecFallback(yyv445, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3147,24 +3310,24 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.FileCheckFrequency = pkg1_unversioned.Duration{} } else { - yyv423 := &x.FileCheckFrequency - yym424 := z.DecBinary() - _ = yym424 + yyv447 := &x.FileCheckFrequency + yym448 := z.DecBinary() + _ = yym448 if false { - } else if z.HasExtensions() && z.DecExt(yyv423) { - } else if !yym424 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv423) + } else if z.HasExtensions() && z.DecExt(yyv447) { + } else if !yym448 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv447) } else { - z.DecFallback(yyv423, false) + z.DecFallback(yyv447, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3172,384 +3335,7 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.HTTPCheckFrequency = pkg1_unversioned.Duration{} } else { - yyv425 := &x.HTTPCheckFrequency - yym426 := z.DecBinary() - _ = yym426 - if false { - } else if z.HasExtensions() && z.DecExt(yyv425) { - } else if !yym426 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv425) - } else { - z.DecFallback(yyv425, false) - } - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ManifestURL = "" - } else { - x.ManifestURL = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ManifestURLHeader = "" - } else { - x.ManifestURLHeader = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.EnableServer = false - } else { - x.EnableServer = bool(r.DecodeBool()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Address = "" - } else { - x.Address = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Port = 0 - } else { - x.Port = uint(r.DecodeUint(codecSelferBitsize1234)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ReadOnlyPort = 0 - } else { - x.ReadOnlyPort = uint(r.DecodeUint(codecSelferBitsize1234)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TLSCertFile = "" - } else { - x.TLSCertFile = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.TLSPrivateKeyFile = "" - } else { - x.TLSPrivateKeyFile = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.CertDirectory = "" - } else { - x.CertDirectory = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HostnameOverride = "" - } else { - x.HostnameOverride = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PodInfraContainerImage = "" - } else { - x.PodInfraContainerImage = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.DockerEndpoint = "" - } else { - x.DockerEndpoint = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RootDirectory = "" - } else { - x.RootDirectory = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.AllowPrivileged = false - } else { - x.AllowPrivileged = bool(r.DecodeBool()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HostNetworkSources = "" - } else { - x.HostNetworkSources = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HostPIDSources = "" - } else { - x.HostPIDSources = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HostIPCSources = "" - } else { - x.HostIPCSources = string(r.DecodeString()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RegistryPullQPS = 0 - } else { - x.RegistryPullQPS = float64(r.DecodeFloat(false)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RegistryBurst = 0 - } else { - x.RegistryBurst = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.EventRecordQPS = 0 - } else { - x.EventRecordQPS = float32(r.DecodeFloat(true)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.EventBurst = 0 - } else { - x.EventBurst = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.EnableDebuggingHandlers = false - } else { - x.EnableDebuggingHandlers = bool(r.DecodeBool()) - } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l - } else { - yyb419 = r.CheckBreak() - } - if yyb419 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MinimumGCAge = pkg1_unversioned.Duration{} - } else { - yyv449 := &x.MinimumGCAge + yyv449 := &x.HTTPCheckFrequency yym450 := z.DecBinary() _ = yym450 if false { @@ -3560,13 +3346,390 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco z.DecFallback(yyv449, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ManifestURL = "" + } else { + x.ManifestURL = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ManifestURLHeader = "" + } else { + x.ManifestURLHeader = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.EnableServer = false + } else { + x.EnableServer = bool(r.DecodeBool()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Address = "" + } else { + x.Address = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Port = 0 + } else { + x.Port = uint(r.DecodeUint(codecSelferBitsize1234)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ReadOnlyPort = 0 + } else { + x.ReadOnlyPort = uint(r.DecodeUint(codecSelferBitsize1234)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TLSCertFile = "" + } else { + x.TLSCertFile = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TLSPrivateKeyFile = "" + } else { + x.TLSPrivateKeyFile = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.CertDirectory = "" + } else { + x.CertDirectory = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostnameOverride = "" + } else { + x.HostnameOverride = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PodInfraContainerImage = "" + } else { + x.PodInfraContainerImage = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.DockerEndpoint = "" + } else { + x.DockerEndpoint = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RootDirectory = "" + } else { + x.RootDirectory = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.AllowPrivileged = false + } else { + x.AllowPrivileged = bool(r.DecodeBool()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostNetworkSources = "" + } else { + x.HostNetworkSources = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostPIDSources = "" + } else { + x.HostPIDSources = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostIPCSources = "" + } else { + x.HostIPCSources = string(r.DecodeString()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RegistryPullQPS = 0 + } else { + x.RegistryPullQPS = float64(r.DecodeFloat(false)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RegistryBurst = 0 + } else { + x.RegistryBurst = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.EventRecordQPS = 0 + } else { + x.EventRecordQPS = float32(r.DecodeFloat(true)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.EventBurst = 0 + } else { + x.EventBurst = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.EnableDebuggingHandlers = false + } else { + x.EnableDebuggingHandlers = bool(r.DecodeBool()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.MinimumGCAge = pkg1_unversioned.Duration{} + } else { + yyv473 := &x.MinimumGCAge + yym474 := z.DecBinary() + _ = yym474 + if false { + } else if z.HasExtensions() && z.DecExt(yyv473) { + } else if !yym474 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv473) + } else { + z.DecFallback(yyv473, false) + } + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3576,13 +3739,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.MaxPerPodContainerCount = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3592,13 +3755,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.MaxContainerCount = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3608,13 +3771,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.CAdvisorPort = uint(r.DecodeUint(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3624,13 +3787,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.HealthzPort = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3640,13 +3803,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.HealthzBindAddress = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3656,13 +3819,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.OOMScoreAdj = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3672,13 +3835,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.RegisterNode = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3688,13 +3851,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ClusterDomain = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3704,13 +3867,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.MasterServiceNamespace = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3720,13 +3883,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ClusterDNS = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3734,24 +3897,24 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.StreamingConnectionIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv461 := &x.StreamingConnectionIdleTimeout - yym462 := z.DecBinary() - _ = yym462 + yyv485 := &x.StreamingConnectionIdleTimeout + yym486 := z.DecBinary() + _ = yym486 if false { - } else if z.HasExtensions() && z.DecExt(yyv461) { - } else if !yym462 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv461) + } else if z.HasExtensions() && z.DecExt(yyv485) { + } else if !yym486 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv485) } else { - z.DecFallback(yyv461, false) + z.DecFallback(yyv485, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3759,24 +3922,24 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.NodeStatusUpdateFrequency = pkg1_unversioned.Duration{} } else { - yyv463 := &x.NodeStatusUpdateFrequency - yym464 := z.DecBinary() - _ = yym464 + yyv487 := &x.NodeStatusUpdateFrequency + yym488 := z.DecBinary() + _ = yym488 if false { - } else if z.HasExtensions() && z.DecExt(yyv463) { - } else if !yym464 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv463) + } else if z.HasExtensions() && z.DecExt(yyv487) { + } else if !yym488 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv487) } else { - z.DecFallback(yyv463, false) + z.DecFallback(yyv487, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3786,13 +3949,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ImageGCHighThresholdPercent = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3802,13 +3965,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ImageGCLowThresholdPercent = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3818,13 +3981,38 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.LowDiskSpaceThresholdMB = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.VolumeStatsAggPeriod = pkg1_unversioned.Duration{} + } else { + yyv492 := &x.VolumeStatsAggPeriod + yym493 := z.DecBinary() + _ = yym493 + if false { + } else if z.HasExtensions() && z.DecExt(yyv492) { + } else if !yym493 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv492) + } else { + z.DecFallback(yyv492, false) + } + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3834,13 +4022,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.NetworkPluginName = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3850,13 +4038,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.NetworkPluginDir = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3866,13 +4054,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.VolumePluginDir = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3882,13 +4070,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.CloudProvider = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3898,13 +4086,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.CloudConfigFile = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3914,13 +4102,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ResourceContainer = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3930,13 +4118,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.CgroupRoot = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3946,13 +4134,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ContainerRuntime = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3962,13 +4150,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.RktPath = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3978,13 +4166,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.RktStage1Image = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -3994,13 +4182,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.SystemContainer = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4010,13 +4198,29 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ConfigureCBR0 = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HairpinMode = false + } else { + x.HairpinMode = bool(r.DecodeBool()) + } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4026,13 +4230,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.MaxPods = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4042,13 +4246,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.DockerExecHandlerName = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4058,13 +4262,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.PodCIDR = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4074,13 +4278,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ResolverConfig = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4090,13 +4294,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.CPUCFSQuota = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4106,13 +4310,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.Containerized = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4122,13 +4326,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.MaxOpenFiles = uint64(r.DecodeUint(64)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4138,13 +4342,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ReconcileCIDR = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4154,13 +4358,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.RegisterSchedulable = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4170,13 +4374,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.KubeAPIQPS = float32(r.DecodeFloat(true)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4186,13 +4390,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4202,13 +4406,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.SerializeImagePulls = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4218,13 +4422,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.ExperimentalFlannelOverlay = bool(r.DecodeBool()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4232,24 +4436,24 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.OutOfDiskTransitionFrequency = pkg1_unversioned.Duration{} } else { - yyv493 := &x.OutOfDiskTransitionFrequency - yym494 := z.DecBinary() - _ = yym494 + yyv520 := &x.OutOfDiskTransitionFrequency + yym521 := z.DecBinary() + _ = yym521 if false { - } else if z.HasExtensions() && z.DecExt(yyv493) { - } else if !yym494 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv493) + } else if z.HasExtensions() && z.DecExt(yyv520) { + } else if !yym521 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv520) } else { - z.DecFallback(yyv493, false) + z.DecFallback(yyv520, false) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4259,13 +4463,13 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.NodeIP = string(r.DecodeString()) } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4273,21 +4477,21 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.NodeLabels = nil } else { - yyv496 := &x.NodeLabels - yym497 := z.DecBinary() - _ = yym497 + yyv523 := &x.NodeLabels + yym524 := z.DecBinary() + _ = yym524 if false { } else { - z.F.DecMapStringStringX(yyv496, false, d) + z.F.DecMapStringStringX(yyv523, false, d) } } - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4297,18 +4501,34 @@ func (x *KubeletConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Deco } else { x.NonMasqueradeCIDR = string(r.DecodeString()) } + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l + } else { + yyb443 = r.CheckBreak() + } + if yyb443 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.EnableCustomMetrics = false + } else { + x.EnableCustomMetrics = bool(r.DecodeBool()) + } for { - yyj419++ - if yyhl419 { - yyb419 = yyj419 > l + yyj443++ + if yyhl443 { + yyb443 = yyj443 > l } else { - yyb419 = r.CheckBreak() + yyb443 = r.CheckBreak() } - if yyb419 { + if yyb443 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj419-1, "") + z.DecStructFieldNotFound(yyj443-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4320,33 +4540,35 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym499 := z.EncBinary() - _ = yym499 + yym527 := z.EncBinary() + _ = yym527 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep500 := !z.EncBinary() - yy2arr500 := z.EncBasicHandle().StructToArray - var yyq500 [9]bool - _, _, _ = yysep500, yyq500, yy2arr500 - const yyr500 bool = false - var yynn500 int - if yyr500 || yy2arr500 { - r.EncodeArrayStart(9) + yysep528 := !z.EncBinary() + yy2arr528 := z.EncBasicHandle().StructToArray + var yyq528 [11]bool + _, _, _ = yysep528, yyq528, yy2arr528 + const yyr528 bool = false + yyq528[9] = x.Kind != "" + yyq528[10] = x.APIVersion != "" + var yynn528 int + if yyr528 || yy2arr528 { + r.EncodeArrayStart(11) } else { - yynn500 = 9 - for _, b := range yyq500 { + yynn528 = 9 + for _, b := range yyq528 { if b { - yynn500++ + yynn528++ } } - r.EncodeMapStart(yynn500) - yynn500 = 0 + r.EncodeMapStart(yynn528) + yynn528 = 0 } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym502 := z.EncBinary() - _ = yym502 + yym530 := z.EncBinary() + _ = yym530 if false { } else { r.EncodeInt(int64(x.Port)) @@ -4355,17 +4577,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("port")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym503 := z.EncBinary() - _ = yym503 + yym531 := z.EncBinary() + _ = yym531 if false { } else { r.EncodeInt(int64(x.Port)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym505 := z.EncBinary() - _ = yym505 + yym533 := z.EncBinary() + _ = yym533 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) @@ -4374,17 +4596,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("address")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym506 := z.EncBinary() - _ = yym506 + yym534 := z.EncBinary() + _ = yym534 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Address)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym508 := z.EncBinary() - _ = yym508 + yym536 := z.EncBinary() + _ = yym536 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) @@ -4393,17 +4615,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("algorithmProvider")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym509 := z.EncBinary() - _ = yym509 + yym537 := z.EncBinary() + _ = yym537 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym511 := z.EncBinary() - _ = yym511 + yym539 := z.EncBinary() + _ = yym539 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) @@ -4412,17 +4634,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("policyConfigFile")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym512 := z.EncBinary() - _ = yym512 + yym540 := z.EncBinary() + _ = yym540 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym514 := z.EncBinary() - _ = yym514 + yym542 := z.EncBinary() + _ = yym542 if false { } else { r.EncodeBool(bool(x.EnableProfiling)) @@ -4431,17 +4653,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("enableProfiling")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym515 := z.EncBinary() - _ = yym515 + yym543 := z.EncBinary() + _ = yym543 if false { } else { r.EncodeBool(bool(x.EnableProfiling)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym517 := z.EncBinary() - _ = yym517 + yym545 := z.EncBinary() + _ = yym545 if false { } else { r.EncodeFloat32(float32(x.KubeAPIQPS)) @@ -4450,17 +4672,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym518 := z.EncBinary() - _ = yym518 + yym546 := z.EncBinary() + _ = yym546 if false { } else { r.EncodeFloat32(float32(x.KubeAPIQPS)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym520 := z.EncBinary() - _ = yym520 + yym548 := z.EncBinary() + _ = yym548 if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) @@ -4469,17 +4691,17 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeAPIBurst")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym521 := z.EncBinary() - _ = yym521 + yym549 := z.EncBinary() + _ = yym549 if false { } else { r.EncodeInt(int64(x.KubeAPIBurst)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym523 := z.EncBinary() - _ = yym523 + yym551 := z.EncBinary() + _ = yym551 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) @@ -4488,25 +4710,75 @@ func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("schedulerName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym524 := z.EncBinary() - _ = yym524 + yym552 := z.EncBinary() + _ = yym552 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) } } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy526 := &x.LeaderElection - yy526.CodecEncodeSelf(e) + yy554 := &x.LeaderElection + yy554.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("leaderElection")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy527 := &x.LeaderElection - yy527.CodecEncodeSelf(e) + yy555 := &x.LeaderElection + yy555.CodecEncodeSelf(e) } - if yyr500 || yy2arr500 { + if yyr528 || yy2arr528 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq528[9] { + yym557 := z.EncBinary() + _ = yym557 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq528[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym558 := z.EncBinary() + _ = yym558 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr528 || yy2arr528 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq528[10] { + yym560 := z.EncBinary() + _ = yym560 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq528[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym561 := z.EncBinary() + _ = yym561 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr528 || yy2arr528 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -4519,25 +4791,25 @@ func (x *KubeSchedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym528 := z.DecBinary() - _ = yym528 + yym562 := z.DecBinary() + _ = yym562 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct529 := r.ContainerType() - if yyct529 == codecSelferValueTypeMap1234 { - yyl529 := r.ReadMapStart() - if yyl529 == 0 { + yyct563 := r.ContainerType() + if yyct563 == codecSelferValueTypeMap1234 { + yyl563 := r.ReadMapStart() + if yyl563 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl529, d) + x.codecDecodeSelfFromMap(yyl563, d) } - } else if yyct529 == codecSelferValueTypeArray1234 { - yyl529 := r.ReadArrayStart() - if yyl529 == 0 { + } else if yyct563 == codecSelferValueTypeArray1234 { + yyl563 := r.ReadArrayStart() + if yyl563 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl529, d) + x.codecDecodeSelfFromArray(yyl563, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4549,12 +4821,12 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys530Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys530Slc - var yyhl530 bool = l >= 0 - for yyj530 := 0; ; yyj530++ { - if yyhl530 { - if yyj530 >= l { + var yys564Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys564Slc + var yyhl564 bool = l >= 0 + for yyj564 := 0; ; yyj564++ { + if yyhl564 { + if yyj564 >= l { break } } else { @@ -4563,10 +4835,10 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978. } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys530Slc = r.DecodeBytes(yys530Slc, true, true) - yys530 := string(yys530Slc) + yys564Slc = r.DecodeBytes(yys564Slc, true, true) + yys564 := string(yys564Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys530 { + switch yys564 { case "port": if r.TryDecodeAsNil() { x.Port = 0 @@ -4619,13 +4891,25 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978. if r.TryDecodeAsNil() { x.LeaderElection = LeaderElectionConfiguration{} } else { - yyv539 := &x.LeaderElection - yyv539.CodecDecodeSelf(d) + yyv573 := &x.LeaderElection + yyv573.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, yys530) - } // end switch yys530 - } // end for yyj530 + z.DecStructFieldNotFound(-1, yys564) + } // end switch yys564 + } // end for yyj564 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -4633,16 +4917,16 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj540 int - var yyb540 bool - var yyhl540 bool = l >= 0 - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + var yyj576 int + var yyb576 bool + var yyhl576 bool = l >= 0 + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4652,13 +4936,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.Port = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4668,13 +4952,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.Address = string(r.DecodeString()) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4684,13 +4968,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.AlgorithmProvider = string(r.DecodeString()) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4700,13 +4984,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.PolicyConfigFile = string(r.DecodeString()) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4716,13 +5000,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.EnableProfiling = bool(r.DecodeBool()) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4732,13 +5016,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.KubeAPIQPS = float32(r.DecodeFloat(true)) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4748,13 +5032,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4764,13 +5048,13 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 } else { x.SchedulerName = string(r.DecodeString()) } - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -4778,21 +5062,53 @@ func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec197 if r.TryDecodeAsNil() { x.LeaderElection = LeaderElectionConfiguration{} } else { - yyv549 := &x.LeaderElection - yyv549.CodecDecodeSelf(d) + yyv585 := &x.LeaderElection + yyv585.CodecDecodeSelf(d) + } + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l + } else { + yyb576 = r.CheckBreak() + } + if yyb576 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l + } else { + yyb576 = r.CheckBreak() + } + if yyb576 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) } for { - yyj540++ - if yyhl540 { - yyb540 = yyj540 > l + yyj576++ + if yyhl576 { + yyb576 = yyj576 > l } else { - yyb540 = r.CheckBreak() + yyb576 = r.CheckBreak() } - if yyb540 { + if yyb576 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj540-1, "") + z.DecStructFieldNotFound(yyj576-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -4804,33 +5120,33 @@ func (x *LeaderElectionConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym550 := z.EncBinary() - _ = yym550 + yym588 := z.EncBinary() + _ = yym588 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep551 := !z.EncBinary() - yy2arr551 := z.EncBasicHandle().StructToArray - var yyq551 [4]bool - _, _, _ = yysep551, yyq551, yy2arr551 - const yyr551 bool = false - var yynn551 int - if yyr551 || yy2arr551 { + yysep589 := !z.EncBinary() + yy2arr589 := z.EncBasicHandle().StructToArray + var yyq589 [4]bool + _, _, _ = yysep589, yyq589, yy2arr589 + const yyr589 bool = false + var yynn589 int + if yyr589 || yy2arr589 { r.EncodeArrayStart(4) } else { - yynn551 = 4 - for _, b := range yyq551 { + yynn589 = 4 + for _, b := range yyq589 { if b { - yynn551++ + yynn589++ } } - r.EncodeMapStart(yynn551) - yynn551 = 0 + r.EncodeMapStart(yynn589) + yynn589 = 0 } - if yyr551 || yy2arr551 { + if yyr589 || yy2arr589 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym553 := z.EncBinary() - _ = yym553 + yym591 := z.EncBinary() + _ = yym591 if false { } else { r.EncodeBool(bool(x.LeaderElect)) @@ -4839,95 +5155,95 @@ func (x *LeaderElectionConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("leaderElect")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym554 := z.EncBinary() - _ = yym554 + yym592 := z.EncBinary() + _ = yym592 if false { } else { r.EncodeBool(bool(x.LeaderElect)) } } - if yyr551 || yy2arr551 { + if yyr589 || yy2arr589 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy556 := &x.LeaseDuration - yym557 := z.EncBinary() - _ = yym557 + yy594 := &x.LeaseDuration + yym595 := z.EncBinary() + _ = yym595 if false { - } else if z.HasExtensions() && z.EncExt(yy556) { - } else if !yym557 && z.IsJSONHandle() { - z.EncJSONMarshal(yy556) + } else if z.HasExtensions() && z.EncExt(yy594) { + } else if !yym595 && z.IsJSONHandle() { + z.EncJSONMarshal(yy594) } else { - z.EncFallback(yy556) + z.EncFallback(yy594) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("leaseDuration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy558 := &x.LeaseDuration - yym559 := z.EncBinary() - _ = yym559 + yy596 := &x.LeaseDuration + yym597 := z.EncBinary() + _ = yym597 if false { - } else if z.HasExtensions() && z.EncExt(yy558) { - } else if !yym559 && z.IsJSONHandle() { - z.EncJSONMarshal(yy558) + } else if z.HasExtensions() && z.EncExt(yy596) { + } else if !yym597 && z.IsJSONHandle() { + z.EncJSONMarshal(yy596) } else { - z.EncFallback(yy558) + z.EncFallback(yy596) } } - if yyr551 || yy2arr551 { + if yyr589 || yy2arr589 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy561 := &x.RenewDeadline - yym562 := z.EncBinary() - _ = yym562 + yy599 := &x.RenewDeadline + yym600 := z.EncBinary() + _ = yym600 if false { - } else if z.HasExtensions() && z.EncExt(yy561) { - } else if !yym562 && z.IsJSONHandle() { - z.EncJSONMarshal(yy561) + } else if z.HasExtensions() && z.EncExt(yy599) { + } else if !yym600 && z.IsJSONHandle() { + z.EncJSONMarshal(yy599) } else { - z.EncFallback(yy561) + z.EncFallback(yy599) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("renewDeadline")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy563 := &x.RenewDeadline - yym564 := z.EncBinary() - _ = yym564 + yy601 := &x.RenewDeadline + yym602 := z.EncBinary() + _ = yym602 if false { - } else if z.HasExtensions() && z.EncExt(yy563) { - } else if !yym564 && z.IsJSONHandle() { - z.EncJSONMarshal(yy563) + } else if z.HasExtensions() && z.EncExt(yy601) { + } else if !yym602 && z.IsJSONHandle() { + z.EncJSONMarshal(yy601) } else { - z.EncFallback(yy563) + z.EncFallback(yy601) } } - if yyr551 || yy2arr551 { + if yyr589 || yy2arr589 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy566 := &x.RetryPeriod - yym567 := z.EncBinary() - _ = yym567 + yy604 := &x.RetryPeriod + yym605 := z.EncBinary() + _ = yym605 if false { - } else if z.HasExtensions() && z.EncExt(yy566) { - } else if !yym567 && z.IsJSONHandle() { - z.EncJSONMarshal(yy566) + } else if z.HasExtensions() && z.EncExt(yy604) { + } else if !yym605 && z.IsJSONHandle() { + z.EncJSONMarshal(yy604) } else { - z.EncFallback(yy566) + z.EncFallback(yy604) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("retryPeriod")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy568 := &x.RetryPeriod - yym569 := z.EncBinary() - _ = yym569 + yy606 := &x.RetryPeriod + yym607 := z.EncBinary() + _ = yym607 if false { - } else if z.HasExtensions() && z.EncExt(yy568) { - } else if !yym569 && z.IsJSONHandle() { - z.EncJSONMarshal(yy568) + } else if z.HasExtensions() && z.EncExt(yy606) { + } else if !yym607 && z.IsJSONHandle() { + z.EncJSONMarshal(yy606) } else { - z.EncFallback(yy568) + z.EncFallback(yy606) } } - if yyr551 || yy2arr551 { + if yyr589 || yy2arr589 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -4940,25 +5256,25 @@ func (x *LeaderElectionConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym570 := z.DecBinary() - _ = yym570 + yym608 := z.DecBinary() + _ = yym608 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct571 := r.ContainerType() - if yyct571 == codecSelferValueTypeMap1234 { - yyl571 := r.ReadMapStart() - if yyl571 == 0 { + yyct609 := r.ContainerType() + if yyct609 == codecSelferValueTypeMap1234 { + yyl609 := r.ReadMapStart() + if yyl609 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl571, d) + x.codecDecodeSelfFromMap(yyl609, d) } - } else if yyct571 == codecSelferValueTypeArray1234 { - yyl571 := r.ReadArrayStart() - if yyl571 == 0 { + } else if yyct609 == codecSelferValueTypeArray1234 { + yyl609 := r.ReadArrayStart() + if yyl609 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl571, d) + x.codecDecodeSelfFromArray(yyl609, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -4970,12 +5286,12 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromMap(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys572Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys572Slc - var yyhl572 bool = l >= 0 - for yyj572 := 0; ; yyj572++ { - if yyhl572 { - if yyj572 >= l { + var yys610Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys610Slc + var yyhl610 bool = l >= 0 + for yyj610 := 0; ; yyj610++ { + if yyhl610 { + if yyj610 >= l { break } } else { @@ -4984,10 +5300,10 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromMap(l int, d *codec1978 } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys572Slc = r.DecodeBytes(yys572Slc, true, true) - yys572 := string(yys572Slc) + yys610Slc = r.DecodeBytes(yys610Slc, true, true) + yys610 := string(yys610Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys572 { + switch yys610 { case "leaderElect": if r.TryDecodeAsNil() { x.LeaderElect = false @@ -4998,51 +5314,51 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromMap(l int, d *codec1978 if r.TryDecodeAsNil() { x.LeaseDuration = pkg1_unversioned.Duration{} } else { - yyv574 := &x.LeaseDuration - yym575 := z.DecBinary() - _ = yym575 + yyv612 := &x.LeaseDuration + yym613 := z.DecBinary() + _ = yym613 if false { - } else if z.HasExtensions() && z.DecExt(yyv574) { - } else if !yym575 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv574) + } else if z.HasExtensions() && z.DecExt(yyv612) { + } else if !yym613 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv612) } else { - z.DecFallback(yyv574, false) + z.DecFallback(yyv612, false) } } case "renewDeadline": if r.TryDecodeAsNil() { x.RenewDeadline = pkg1_unversioned.Duration{} } else { - yyv576 := &x.RenewDeadline - yym577 := z.DecBinary() - _ = yym577 + yyv614 := &x.RenewDeadline + yym615 := z.DecBinary() + _ = yym615 if false { - } else if z.HasExtensions() && z.DecExt(yyv576) { - } else if !yym577 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv576) + } else if z.HasExtensions() && z.DecExt(yyv614) { + } else if !yym615 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv614) } else { - z.DecFallback(yyv576, false) + z.DecFallback(yyv614, false) } } case "retryPeriod": if r.TryDecodeAsNil() { x.RetryPeriod = pkg1_unversioned.Duration{} } else { - yyv578 := &x.RetryPeriod - yym579 := z.DecBinary() - _ = yym579 + yyv616 := &x.RetryPeriod + yym617 := z.DecBinary() + _ = yym617 if false { - } else if z.HasExtensions() && z.DecExt(yyv578) { - } else if !yym579 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv578) + } else if z.HasExtensions() && z.DecExt(yyv616) { + } else if !yym617 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv616) } else { - z.DecFallback(yyv578, false) + z.DecFallback(yyv616, false) } } default: - z.DecStructFieldNotFound(-1, yys572) - } // end switch yys572 - } // end for yyj572 + z.DecStructFieldNotFound(-1, yys610) + } // end switch yys610 + } // end for yyj610 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -5050,16 +5366,16 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec19 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj580 int - var yyb580 bool - var yyhl580 bool = l >= 0 - yyj580++ - if yyhl580 { - yyb580 = yyj580 > l + var yyj618 int + var yyb618 bool + var yyhl618 bool = l >= 0 + yyj618++ + if yyhl618 { + yyb618 = yyj618 > l } else { - yyb580 = r.CheckBreak() + yyb618 = r.CheckBreak() } - if yyb580 { + if yyb618 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5069,13 +5385,13 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec19 } else { x.LeaderElect = bool(r.DecodeBool()) } - yyj580++ - if yyhl580 { - yyb580 = yyj580 > l + yyj618++ + if yyhl618 { + yyb618 = yyj618 > l } else { - yyb580 = r.CheckBreak() + yyb618 = r.CheckBreak() } - if yyb580 { + if yyb618 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5083,24 +5399,24 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.LeaseDuration = pkg1_unversioned.Duration{} } else { - yyv582 := &x.LeaseDuration - yym583 := z.DecBinary() - _ = yym583 + yyv620 := &x.LeaseDuration + yym621 := z.DecBinary() + _ = yym621 if false { - } else if z.HasExtensions() && z.DecExt(yyv582) { - } else if !yym583 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv582) + } else if z.HasExtensions() && z.DecExt(yyv620) { + } else if !yym621 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv620) } else { - z.DecFallback(yyv582, false) + z.DecFallback(yyv620, false) } } - yyj580++ - if yyhl580 { - yyb580 = yyj580 > l + yyj618++ + if yyhl618 { + yyb618 = yyj618 > l } else { - yyb580 = r.CheckBreak() + yyb618 = r.CheckBreak() } - if yyb580 { + if yyb618 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5108,24 +5424,24 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.RenewDeadline = pkg1_unversioned.Duration{} } else { - yyv584 := &x.RenewDeadline - yym585 := z.DecBinary() - _ = yym585 + yyv622 := &x.RenewDeadline + yym623 := z.DecBinary() + _ = yym623 if false { - } else if z.HasExtensions() && z.DecExt(yyv584) { - } else if !yym585 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv584) + } else if z.HasExtensions() && z.DecExt(yyv622) { + } else if !yym623 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv622) } else { - z.DecFallback(yyv584, false) + z.DecFallback(yyv622, false) } } - yyj580++ - if yyhl580 { - yyb580 = yyj580 > l + yyj618++ + if yyhl618 { + yyb618 = yyj618 > l } else { - yyb580 = r.CheckBreak() + yyb618 = r.CheckBreak() } - if yyb580 { + if yyb618 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5133,29 +5449,29 @@ func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec19 if r.TryDecodeAsNil() { x.RetryPeriod = pkg1_unversioned.Duration{} } else { - yyv586 := &x.RetryPeriod - yym587 := z.DecBinary() - _ = yym587 + yyv624 := &x.RetryPeriod + yym625 := z.DecBinary() + _ = yym625 if false { - } else if z.HasExtensions() && z.DecExt(yyv586) { - } else if !yym587 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv586) + } else if z.HasExtensions() && z.DecExt(yyv624) { + } else if !yym625 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv624) } else { - z.DecFallback(yyv586, false) + z.DecFallback(yyv624, false) } } for { - yyj580++ - if yyhl580 { - yyb580 = yyj580 > l + yyj618++ + if yyhl618 { + yyb618 = yyj618 > l } else { - yyb580 = r.CheckBreak() + yyb618 = r.CheckBreak() } - if yyb580 { + if yyb618 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj580-1, "") + z.DecStructFieldNotFound(yyj618-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index af6417a8893..0a3f0451410 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -31,6 +31,9 @@ type KubeProxyConfiguration struct { HealthzPort int `json:"healthzPort"` // hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname. HostnameOverride string `json:"hostnameOverride"` + // iptablesMasqueradeBit is the bit of the iptables fwmark space to use for SNAT if using + // the pure iptables proxy mode. Values must be within the range [0, 31]. + IPTablesMasqueradeBit *int `json:"iptablesMasqueradeBit"` // iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m', // '2h22m'). Must be greater than 0. IPTablesSyncPeriod unversioned.Duration `json:"iptablesSyncPeriodSeconds"` @@ -63,9 +66,9 @@ type KubeProxyConfiguration struct { } // Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' -// (experimental). If blank, look at the Node object on the Kubernetes API and respect the +// (newer, faster). If blank, look at the Node object on the Kubernetes API and respect the // 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the -// best-available proxy (currently userspace, but may change in future versions). If the +// best-available proxy (currently iptables, but may change in future versions). If the // iptables proxy is selected, regardless of how, but the system's kernel or iptables // versions are insufficient, this always falls back to the userspace proxy. type ProxyMode string @@ -205,6 +208,8 @@ type KubeletConfiguration struct { // maintain. When disk space falls below this threshold, new pods would // be rejected. LowDiskSpaceThresholdMB int `json:"lowDiskSpaceThresholdMB"` + // How frequently to calculate and cache volume disk usage for all pods + VolumeStatsAggPeriod unversioned.Duration `json:volumeStatsAggPeriod` // networkPluginName is the name of the network plugin to be invoked for // various events in kubelet/pod lifecycle NetworkPluginName string `json:"networkPluginName"` @@ -239,6 +244,11 @@ type KubeletConfiguration struct { // configureCBR0 enables the kublet to configure cbr0 based on // Node.Spec.PodCIDR. ConfigureCBR0 bool `json:"configureCbr0"` + // Should the kubelet set the hairpin flag on veth interfaces for containers + // it creates? Setting this flag allows endpoints in a Service to + // loadbalance back to themselves if they should try to access their own + // Service. + HairpinMode bool `json:"configureHairpinMode"` // maxPods is the number of pods that can run on this Kubelet. MaxPods int `json:"maxPods"` // dockerExecHandlerName is the handler to use when executing a command @@ -288,9 +298,13 @@ type KubeletConfiguration struct { NodeLabels map[string]string `json:"nodeLabels"` // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. NonMasqueradeCIDR string `json:"nonMasqueradeCIDR"` + // enable gathering custom metrics. + EnableCustomMetrics bool `json:"enableCustomMetrics"` } type KubeSchedulerConfiguration struct { + unversioned.TypeMeta + // port is the port that the scheduler's http service runs on. Port int `json:"port"` // address is the IP address to serve on. diff --git a/pkg/apis/componentconfig/v1alpha1/conversion_generated.go b/pkg/apis/componentconfig/v1alpha1/conversion_generated.go index e3d565a4977..b4bff5c816d 100644 --- a/pkg/apis/componentconfig/v1alpha1/conversion_generated.go +++ b/pkg/apis/componentconfig/v1alpha1/conversion_generated.go @@ -37,6 +37,12 @@ func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyCon out.HealthzBindAddress = in.HealthzBindAddress out.HealthzPort = int32(in.HealthzPort) out.HostnameOverride = in.HostnameOverride + if in.IPTablesMasqueradeBit != nil { + out.IPTablesMasqueradeBit = new(int32) + *out.IPTablesMasqueradeBit = int32(*in.IPTablesMasqueradeBit) + } else { + out.IPTablesMasqueradeBit = nil + } if err := s.Convert(&in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, 0); err != nil { return err } @@ -66,6 +72,56 @@ func Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfigu return autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in, out, s) } +func autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*componentconfig.KubeSchedulerConfiguration))(in) + } + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + out.Port = in.Port + out.Address = in.Address + out.AlgorithmProvider = in.AlgorithmProvider + out.PolicyConfigFile = in.PolicyConfigFile + if err := api.Convert_bool_To_bool_ref(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { + return err + } + out.KubeAPIQPS = in.KubeAPIQPS + out.KubeAPIBurst = in.KubeAPIBurst + out.SchedulerName = in.SchedulerName + if err := Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + return err + } + return nil +} + +func Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { + return autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in, out, s) +} + +func autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*componentconfig.LeaderElectionConfiguration))(in) + } + if err := api.Convert_bool_To_bool_ref(&in.LeaderElect, &out.LeaderElect, s); err != nil { + return err + } + if err := s.Convert(&in.LeaseDuration, &out.LeaseDuration, 0); err != nil { + return err + } + if err := s.Convert(&in.RenewDeadline, &out.RenewDeadline, 0); err != nil { + return err + } + if err := s.Convert(&in.RetryPeriod, &out.RetryPeriod, 0); err != nil { + return err + } + return nil +} + +func Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { + return autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in, out, s) +} + func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*KubeProxyConfiguration))(in) @@ -77,6 +133,12 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon out.HealthzBindAddress = in.HealthzBindAddress out.HealthzPort = int(in.HealthzPort) out.HostnameOverride = in.HostnameOverride + if in.IPTablesMasqueradeBit != nil { + out.IPTablesMasqueradeBit = new(int) + *out.IPTablesMasqueradeBit = int(*in.IPTablesMasqueradeBit) + } else { + out.IPTablesMasqueradeBit = nil + } if err := s.Convert(&in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, 0); err != nil { return err } @@ -106,10 +168,64 @@ func Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfigu return autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in, out, s) } +func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*KubeSchedulerConfiguration))(in) + } + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + out.Port = in.Port + out.Address = in.Address + out.AlgorithmProvider = in.AlgorithmProvider + out.PolicyConfigFile = in.PolicyConfigFile + if err := api.Convert_bool_ref_To_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { + return err + } + out.KubeAPIQPS = in.KubeAPIQPS + out.KubeAPIBurst = in.KubeAPIBurst + out.SchedulerName = in.SchedulerName + if err := Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + return err + } + return nil +} + +func Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in, out, s) +} + +func autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*LeaderElectionConfiguration))(in) + } + if err := api.Convert_bool_ref_To_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil { + return err + } + if err := s.Convert(&in.LeaseDuration, &out.LeaseDuration, 0); err != nil { + return err + } + if err := s.Convert(&in.RenewDeadline, &out.RenewDeadline, 0); err != nil { + return err + } + if err := s.Convert(&in.RetryPeriod, &out.RetryPeriod, 0); err != nil { + return err + } + return nil +} + +func Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in, out, s) +} + func init() { err := api.Scheme.AddGeneratedConversionFuncs( autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration, + autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration, + autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration, autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration, + autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration, + autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration, ) if err != nil { // If one of the conversion functions is malformed, detect it immediately. diff --git a/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go b/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go index 8e105a22e3f..92849134260 100644 --- a/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go +++ b/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go @@ -43,6 +43,12 @@ func deepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku out.HealthzBindAddress = in.HealthzBindAddress out.HealthzPort = in.HealthzPort out.HostnameOverride = in.HostnameOverride + if in.IPTablesMasqueradeBit != nil { + out.IPTablesMasqueradeBit = new(int32) + *out.IPTablesMasqueradeBit = *in.IPTablesMasqueradeBit + } else { + out.IPTablesMasqueradeBit = nil + } if err := deepCopy_unversioned_Duration(in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, c); err != nil { return err } @@ -68,11 +74,55 @@ func deepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku return nil } +func deepCopy_v1alpha1_KubeSchedulerConfiguration(in KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, c *conversion.Cloner) error { + if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { + return err + } + out.Port = in.Port + out.Address = in.Address + out.AlgorithmProvider = in.AlgorithmProvider + out.PolicyConfigFile = in.PolicyConfigFile + if in.EnableProfiling != nil { + out.EnableProfiling = new(bool) + *out.EnableProfiling = *in.EnableProfiling + } else { + out.EnableProfiling = nil + } + out.KubeAPIQPS = in.KubeAPIQPS + out.KubeAPIBurst = in.KubeAPIBurst + out.SchedulerName = in.SchedulerName + if err := deepCopy_v1alpha1_LeaderElectionConfiguration(in.LeaderElection, &out.LeaderElection, c); err != nil { + return err + } + return nil +} + +func deepCopy_v1alpha1_LeaderElectionConfiguration(in LeaderElectionConfiguration, out *LeaderElectionConfiguration, c *conversion.Cloner) error { + if in.LeaderElect != nil { + out.LeaderElect = new(bool) + *out.LeaderElect = *in.LeaderElect + } else { + out.LeaderElect = nil + } + if err := deepCopy_unversioned_Duration(in.LeaseDuration, &out.LeaseDuration, c); err != nil { + return err + } + if err := deepCopy_unversioned_Duration(in.RenewDeadline, &out.RenewDeadline, c); err != nil { + return err + } + if err := deepCopy_unversioned_Duration(in.RetryPeriod, &out.RetryPeriod, c); err != nil { + return err + } + return nil +} + func init() { err := api.Scheme.AddGeneratedDeepCopyFuncs( deepCopy_unversioned_Duration, deepCopy_unversioned_TypeMeta, deepCopy_v1alpha1_KubeProxyConfiguration, + deepCopy_v1alpha1_KubeSchedulerConfiguration, + deepCopy_v1alpha1_LeaderElectionConfiguration, ) if err != nil { // if one of the deep copy functions is malformed, detect it immediately. diff --git a/pkg/apis/componentconfig/v1alpha1/defaults.go b/pkg/apis/componentconfig/v1alpha1/defaults.go index 0ce963f9263..af35c7d3884 100644 --- a/pkg/apis/componentconfig/v1alpha1/defaults.go +++ b/pkg/apis/componentconfig/v1alpha1/defaults.go @@ -19,8 +19,10 @@ package v1alpha1 import ( "time" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/kubelet/qos" + "k8s.io/kubernetes/pkg/master/ports" "k8s.io/kubernetes/pkg/runtime" ) @@ -40,8 +42,57 @@ func addDefaultingFuncs(scheme *runtime.Scheme) { temp := int32(qos.KubeProxyOOMScoreAdj) obj.OOMScoreAdj = &temp } + if obj.ResourceContainer == "" { + obj.ResourceContainer = "/kube-proxy" + } if obj.IPTablesSyncPeriod.Duration == 0 { - obj.IPTablesSyncPeriod = unversioned.Duration{5 * time.Second} + obj.IPTablesSyncPeriod = unversioned.Duration{30 * time.Second} + } + zero := unversioned.Duration{} + if obj.UDPIdleTimeout == zero { + obj.UDPIdleTimeout = unversioned.Duration{250 * time.Millisecond} + } + if obj.ConntrackMax == 0 { + obj.ConntrackMax = 256 * 1024 // 4x default (64k) + } + if obj.IPTablesMasqueradeBit == nil { + temp := int32(14) + obj.IPTablesMasqueradeBit = &temp + } + if obj.ConntrackTCPEstablishedTimeout == zero { + obj.ConntrackTCPEstablishedTimeout = unversioned.Duration{Duration: 24 * time.Hour} // 1 day (1/5 default) + } + }, + func(obj *KubeSchedulerConfiguration) { + if obj.Port == 0 { + obj.Port = ports.SchedulerPort + } + if obj.Address == "" { + obj.Address = "0.0.0.0" + } + if obj.AlgorithmProvider == "" { + obj.AlgorithmProvider = "DefaultProvider" + } + if obj.KubeAPIQPS == 0 { + obj.KubeAPIQPS = 50.0 + } + if obj.KubeAPIBurst == 0 { + obj.KubeAPIBurst = 100 + } + if obj.SchedulerName == "" { + obj.SchedulerName = api.DefaultSchedulerName + } + }, + func(obj *LeaderElectionConfiguration) { + zero := unversioned.Duration{} + if obj.LeaseDuration == zero { + obj.LeaseDuration = unversioned.Duration{15 * time.Second} + } + if obj.RenewDeadline == zero { + obj.RenewDeadline = unversioned.Duration{10 * time.Second} + } + if obj.RetryPeriod == zero { + obj.RetryPeriod = unversioned.Duration{2 * time.Second} } }, ) diff --git a/pkg/apis/componentconfig/v1alpha1/register.go b/pkg/apis/componentconfig/v1alpha1/register.go index ab0bdd5fa8f..4510fac9263 100644 --- a/pkg/apis/componentconfig/v1alpha1/register.go +++ b/pkg/apis/componentconfig/v1alpha1/register.go @@ -35,7 +35,9 @@ func AddToScheme(scheme *runtime.Scheme) { func addKnownTypes(scheme *runtime.Scheme) { scheme.AddKnownTypes(SchemeGroupVersion, &KubeProxyConfiguration{}, + &KubeSchedulerConfiguration{}, ) } -func (obj *KubeProxyConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *KubeProxyConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *KubeSchedulerConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/componentconfig/v1alpha1/types.generated.go b/pkg/apis/componentconfig/v1alpha1/types.generated.go index 0d426891cc1..a25f860c2e0 100644 --- a/pkg/apis/componentconfig/v1alpha1/types.generated.go +++ b/pkg/apis/componentconfig/v1alpha1/types.generated.go @@ -81,16 +81,16 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [17]bool + var yyq2 [18]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" + yyq2[16] = x.Kind != "" + yyq2[17] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { - r.EncodeArrayStart(17) + r.EncodeArrayStart(18) } else { - yynn2 = 15 + yynn2 = 16 for _, b := range yyq2 { if b { yynn2++ @@ -101,58 +101,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym10 := z.EncBinary() - _ = yym10 + yym4 := z.EncBinary() + _ = yym4 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) @@ -161,8 +111,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("bindAddress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym11 := z.EncBinary() - _ = yym11 + yym5 := z.EncBinary() + _ = yym5 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) @@ -170,8 +120,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym13 := z.EncBinary() - _ = yym13 + yym7 := z.EncBinary() + _ = yym7 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) @@ -180,8 +130,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzBindAddress")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) @@ -189,8 +139,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym16 := z.EncBinary() - _ = yym16 + yym10 := z.EncBinary() + _ = yym10 if false { } else { r.EncodeInt(int64(x.HealthzPort)) @@ -199,8 +149,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("healthzPort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { r.EncodeInt(int64(x.HealthzPort)) @@ -208,8 +158,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym19 := z.EncBinary() - _ = yym19 + yym13 := z.EncBinary() + _ = yym13 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) @@ -218,8 +168,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("hostnameOverride")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym20 := z.EncBinary() - _ = yym20 + yym14 := z.EncBinary() + _ = yym14 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) @@ -227,35 +177,64 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy22 := &x.IPTablesSyncPeriod - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.EncExt(yy22) { - } else if !yym23 && z.IsJSONHandle() { - z.EncJSONMarshal(yy22) + if x.IPTablesMasqueradeBit == nil { + r.EncodeNil() } else { - z.EncFallback(yy22) + yy16 := *x.IPTablesMasqueradeBit + yym17 := z.EncBinary() + _ = yym17 + if false { + } else { + r.EncodeInt(int64(yy16)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("iptablesMasqueradeBit")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.IPTablesMasqueradeBit == nil { + r.EncodeNil() + } else { + yy18 := *x.IPTablesMasqueradeBit + yym19 := z.EncBinary() + _ = yym19 + if false { + } else { + r.EncodeInt(int64(yy18)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy21 := &x.IPTablesSyncPeriod + yym22 := z.EncBinary() + _ = yym22 + if false { + } else if z.HasExtensions() && z.EncExt(yy21) { + } else if !yym22 && z.IsJSONHandle() { + z.EncJSONMarshal(yy21) + } else { + z.EncFallback(yy21) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("iptablesSyncPeriodSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy24 := &x.IPTablesSyncPeriod - yym25 := z.EncBinary() - _ = yym25 + yy23 := &x.IPTablesSyncPeriod + yym24 := z.EncBinary() + _ = yym24 if false { - } else if z.HasExtensions() && z.EncExt(yy24) { - } else if !yym25 && z.IsJSONHandle() { - z.EncJSONMarshal(yy24) + } else if z.HasExtensions() && z.EncExt(yy23) { + } else if !yym24 && z.IsJSONHandle() { + z.EncJSONMarshal(yy23) } else { - z.EncFallback(yy24) + z.EncFallback(yy23) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym27 := z.EncBinary() - _ = yym27 + yym26 := z.EncBinary() + _ = yym26 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) @@ -264,8 +243,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kubeconfigPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym28 := z.EncBinary() - _ = yym28 + yym27 := z.EncBinary() + _ = yym27 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) @@ -273,8 +252,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym30 := z.EncBinary() - _ = yym30 + yym29 := z.EncBinary() + _ = yym29 if false { } else { r.EncodeBool(bool(x.MasqueradeAll)) @@ -283,8 +262,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("masqueradeAll")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym31 := z.EncBinary() - _ = yym31 + yym30 := z.EncBinary() + _ = yym30 if false { } else { r.EncodeBool(bool(x.MasqueradeAll)) @@ -292,8 +271,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym33 := z.EncBinary() - _ = yym33 + yym32 := z.EncBinary() + _ = yym32 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Master)) @@ -302,8 +281,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("master")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 + yym33 := z.EncBinary() + _ = yym33 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Master)) @@ -314,12 +293,12 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x.OOMScoreAdj == nil { r.EncodeNil() } else { - yy36 := *x.OOMScoreAdj - yym37 := z.EncBinary() - _ = yym37 + yy35 := *x.OOMScoreAdj + yym36 := z.EncBinary() + _ = yym36 if false { } else { - r.EncodeInt(int64(yy36)) + r.EncodeInt(int64(yy35)) } } } else { @@ -329,12 +308,12 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { if x.OOMScoreAdj == nil { r.EncodeNil() } else { - yy38 := *x.OOMScoreAdj - yym39 := z.EncBinary() - _ = yym39 + yy37 := *x.OOMScoreAdj + yym38 := z.EncBinary() + _ = yym38 if false { } else { - r.EncodeInt(int64(yy38)) + r.EncodeInt(int64(yy37)) } } } @@ -349,8 +328,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym42 := z.EncBinary() - _ = yym42 + yym41 := z.EncBinary() + _ = yym41 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) @@ -359,8 +338,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("portRange")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym43 := z.EncBinary() - _ = yym43 + yym42 := z.EncBinary() + _ = yym42 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) @@ -368,8 +347,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym45 := z.EncBinary() - _ = yym45 + yym44 := z.EncBinary() + _ = yym44 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) @@ -378,8 +357,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("resourceContainer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym46 := z.EncBinary() - _ = yym46 + yym45 := z.EncBinary() + _ = yym45 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) @@ -387,35 +366,35 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy48 := &x.UDPIdleTimeout - yym49 := z.EncBinary() - _ = yym49 + yy47 := &x.UDPIdleTimeout + yym48 := z.EncBinary() + _ = yym48 if false { - } else if z.HasExtensions() && z.EncExt(yy48) { - } else if !yym49 && z.IsJSONHandle() { - z.EncJSONMarshal(yy48) + } else if z.HasExtensions() && z.EncExt(yy47) { + } else if !yym48 && z.IsJSONHandle() { + z.EncJSONMarshal(yy47) } else { - z.EncFallback(yy48) + z.EncFallback(yy47) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("udpTimeoutMilliseconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy50 := &x.UDPIdleTimeout - yym51 := z.EncBinary() - _ = yym51 + yy49 := &x.UDPIdleTimeout + yym50 := z.EncBinary() + _ = yym50 if false { - } else if z.HasExtensions() && z.EncExt(yy50) { - } else if !yym51 && z.IsJSONHandle() { - z.EncJSONMarshal(yy50) + } else if z.HasExtensions() && z.EncExt(yy49) { + } else if !yym50 && z.IsJSONHandle() { + z.EncJSONMarshal(yy49) } else { - z.EncFallback(yy50) + z.EncFallback(yy49) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym53 := z.EncBinary() - _ = yym53 + yym52 := z.EncBinary() + _ = yym52 if false { } else { r.EncodeInt(int64(x.ConntrackMax)) @@ -424,8 +403,8 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conntrackMax")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym54 := z.EncBinary() - _ = yym54 + yym53 := z.EncBinary() + _ = yym53 if false { } else { r.EncodeInt(int64(x.ConntrackMax)) @@ -433,29 +412,79 @@ func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy56 := &x.ConntrackTCPEstablishedTimeout - yym57 := z.EncBinary() - _ = yym57 + yy55 := &x.ConntrackTCPEstablishedTimeout + yym56 := z.EncBinary() + _ = yym56 if false { - } else if z.HasExtensions() && z.EncExt(yy56) { - } else if !yym57 && z.IsJSONHandle() { - z.EncJSONMarshal(yy56) + } else if z.HasExtensions() && z.EncExt(yy55) { + } else if !yym56 && z.IsJSONHandle() { + z.EncJSONMarshal(yy55) } else { - z.EncFallback(yy56) + z.EncFallback(yy55) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conntrackTCPEstablishedTimeout")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy58 := &x.ConntrackTCPEstablishedTimeout - yym59 := z.EncBinary() - _ = yym59 + yy57 := &x.ConntrackTCPEstablishedTimeout + yym58 := z.EncBinary() + _ = yym58 if false { - } else if z.HasExtensions() && z.EncExt(yy58) { - } else if !yym59 && z.IsJSONHandle() { - z.EncJSONMarshal(yy58) + } else if z.HasExtensions() && z.EncExt(yy57) { + } else if !yym58 && z.IsJSONHandle() { + z.EncJSONMarshal(yy57) } else { - z.EncFallback(yy58) + z.EncFallback(yy57) + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[16] { + yym60 := z.EncBinary() + _ = yym60 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[16] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym61 := z.EncBinary() + _ = yym61 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[17] { + yym63 := z.EncBinary() + _ = yym63 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[17] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym64 := z.EncBinary() + _ = yym64 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr2 || yy2arr2 { @@ -471,25 +500,25 @@ func (x *KubeProxyConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym60 := z.DecBinary() - _ = yym60 + yym65 := z.DecBinary() + _ = yym65 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct61 := r.ContainerType() - if yyct61 == codecSelferValueTypeMap1234 { - yyl61 := r.ReadMapStart() - if yyl61 == 0 { + yyct66 := r.ContainerType() + if yyct66 == codecSelferValueTypeMap1234 { + yyl66 := r.ReadMapStart() + if yyl66 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl61, d) + x.codecDecodeSelfFromMap(yyl66, d) } - } else if yyct61 == codecSelferValueTypeArray1234 { - yyl61 := r.ReadArrayStart() - if yyl61 == 0 { + } else if yyct66 == codecSelferValueTypeArray1234 { + yyl66 := r.ReadArrayStart() + if yyl66 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl61, d) + x.codecDecodeSelfFromArray(yyl66, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -501,12 +530,12 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys62Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys62Slc - var yyhl62 bool = l >= 0 - for yyj62 := 0; ; yyj62++ { - if yyhl62 { - if yyj62 >= l { + var yys67Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys67Slc + var yyhl67 bool = l >= 0 + for yyj67 := 0; ; yyj67++ { + if yyhl67 { + if yyj67 >= l { break } } else { @@ -515,22 +544,10 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys62Slc = r.DecodeBytes(yys62Slc, true, true) - yys62 := string(yys62Slc) + yys67Slc = r.DecodeBytes(yys67Slc, true, true) + yys67 := string(yys67Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys62 { - 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()) - } + switch yys67 { case "bindAddress": if r.TryDecodeAsNil() { x.BindAddress = "" @@ -555,19 +572,35 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.HostnameOverride = string(r.DecodeString()) } + case "iptablesMasqueradeBit": + if r.TryDecodeAsNil() { + if x.IPTablesMasqueradeBit != nil { + x.IPTablesMasqueradeBit = nil + } + } else { + if x.IPTablesMasqueradeBit == nil { + x.IPTablesMasqueradeBit = new(int32) + } + yym73 := z.DecBinary() + _ = yym73 + if false { + } else { + *((*int32)(x.IPTablesMasqueradeBit)) = int32(r.DecodeInt(32)) + } + } case "iptablesSyncPeriodSeconds": if r.TryDecodeAsNil() { x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv69 := &x.IPTablesSyncPeriod - yym70 := z.DecBinary() - _ = yym70 + yyv74 := &x.IPTablesSyncPeriod + yym75 := z.DecBinary() + _ = yym75 if false { - } else if z.HasExtensions() && z.DecExt(yyv69) { - } else if !yym70 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv69) + } else if z.HasExtensions() && z.DecExt(yyv74) { + } else if !yym75 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv74) } else { - z.DecFallback(yyv69, false) + z.DecFallback(yyv74, false) } } case "kubeconfigPath": @@ -597,8 +630,8 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if x.OOMScoreAdj == nil { x.OOMScoreAdj = new(int32) } - yym75 := z.DecBinary() - _ = yym75 + yym80 := z.DecBinary() + _ = yym80 if false { } else { *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32)) @@ -626,15 +659,15 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.UDPIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv79 := &x.UDPIdleTimeout - yym80 := z.DecBinary() - _ = yym80 + yyv84 := &x.UDPIdleTimeout + yym85 := z.DecBinary() + _ = yym85 if false { - } else if z.HasExtensions() && z.DecExt(yyv79) { - } else if !yym80 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv79) + } else if z.HasExtensions() && z.DecExt(yyv84) { + } else if !yym85 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv84) } else { - z.DecFallback(yyv79, false) + z.DecFallback(yyv84, false) } } case "conntrackMax": @@ -647,21 +680,33 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco if r.TryDecodeAsNil() { x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} } else { - yyv82 := &x.ConntrackTCPEstablishedTimeout - yym83 := z.DecBinary() - _ = yym83 + yyv87 := &x.ConntrackTCPEstablishedTimeout + yym88 := z.DecBinary() + _ = yym88 if false { - } else if z.HasExtensions() && z.DecExt(yyv82) { - } else if !yym83 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv82) + } else if z.HasExtensions() && z.DecExt(yyv87) { + } else if !yym88 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv87) } else { - z.DecFallback(yyv82, false) + z.DecFallback(yyv87, false) } } + 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, yys62) - } // end switch yys62 - } // end for yyj62 + z.DecStructFieldNotFound(-1, yys67) + } // end switch yys67 + } // end for yyj67 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -669,48 +714,16 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj84 int - var yyb84 bool - var yyhl84 bool = l >= 0 - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + var yyj91 int + var yyb91 bool + var yyhl91 bool = l >= 0 + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l - } else { - yyb84 = r.CheckBreak() - } - if yyb84 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l - } else { - yyb84 = r.CheckBreak() - } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -720,13 +733,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.BindAddress = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -736,13 +749,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HealthzBindAddress = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -752,13 +765,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HealthzPort = int32(r.DecodeInt(32)) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -768,13 +781,39 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.HostnameOverride = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.IPTablesMasqueradeBit != nil { + x.IPTablesMasqueradeBit = nil + } + } else { + if x.IPTablesMasqueradeBit == nil { + x.IPTablesMasqueradeBit = new(int32) + } + yym97 := z.DecBinary() + _ = yym97 + if false { + } else { + *((*int32)(x.IPTablesMasqueradeBit)) = int32(r.DecodeInt(32)) + } + } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -782,24 +821,24 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} } else { - yyv91 := &x.IPTablesSyncPeriod - yym92 := z.DecBinary() - _ = yym92 + yyv98 := &x.IPTablesSyncPeriod + yym99 := z.DecBinary() + _ = yym99 if false { - } else if z.HasExtensions() && z.DecExt(yyv91) { - } else if !yym92 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv91) + } else if z.HasExtensions() && z.DecExt(yyv98) { + } else if !yym99 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv98) } else { - z.DecFallback(yyv91, false) + z.DecFallback(yyv98, false) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -809,13 +848,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.KubeconfigPath = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -825,13 +864,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.MasqueradeAll = bool(r.DecodeBool()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -841,13 +880,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Master = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -860,20 +899,20 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if x.OOMScoreAdj == nil { x.OOMScoreAdj = new(int32) } - yym97 := z.DecBinary() - _ = yym97 + yym104 := z.DecBinary() + _ = yym104 if false { } else { *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32)) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -883,13 +922,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.Mode = ProxyMode(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -899,13 +938,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.PortRange = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -915,13 +954,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.ResourceContainer = string(r.DecodeString()) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -929,24 +968,24 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.UDPIdleTimeout = pkg1_unversioned.Duration{} } else { - yyv101 := &x.UDPIdleTimeout - yym102 := z.DecBinary() - _ = yym102 + yyv108 := &x.UDPIdleTimeout + yym109 := z.DecBinary() + _ = yym109 if false { - } else if z.HasExtensions() && z.DecExt(yyv101) { - } else if !yym102 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv101) + } else if z.HasExtensions() && z.DecExt(yyv108) { + } else if !yym109 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv108) } else { - z.DecFallback(yyv101, false) + z.DecFallback(yyv108, false) } } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -956,13 +995,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.ConntrackMax = int32(r.DecodeInt(32)) } - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -970,29 +1009,61 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} } else { - yyv104 := &x.ConntrackTCPEstablishedTimeout - yym105 := z.DecBinary() - _ = yym105 + yyv111 := &x.ConntrackTCPEstablishedTimeout + yym112 := z.DecBinary() + _ = yym112 if false { - } else if z.HasExtensions() && z.DecExt(yyv104) { - } else if !yym105 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv104) + } else if z.HasExtensions() && z.DecExt(yyv111) { + } else if !yym112 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv111) } else { - z.DecFallback(yyv104, false) + z.DecFallback(yyv111, false) } } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l + } else { + yyb91 = r.CheckBreak() + } + if yyb91 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj84++ - if yyhl84 { - yyb84 = yyj84 > l + yyj91++ + if yyhl91 { + yyb91 = yyj91 > l } else { - yyb84 = r.CheckBreak() + yyb91 = r.CheckBreak() } - if yyb84 { + if yyb91 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj84-1, "") + z.DecStructFieldNotFound(yyj91-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1001,8 +1072,8 @@ func (x ProxyMode) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym106 := z.EncBinary() - _ = yym106 + yym115 := z.EncBinary() + _ = yym115 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -1014,11 +1085,1014 @@ func (x *ProxyMode) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym107 := z.DecBinary() - _ = yym107 + yym116 := z.DecBinary() + _ = yym116 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { *((*string)(x)) = r.DecodeString() } } + +func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym117 := z.EncBinary() + _ = yym117 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep118 := !z.EncBinary() + yy2arr118 := z.EncBasicHandle().StructToArray + var yyq118 [11]bool + _, _, _ = yysep118, yyq118, yy2arr118 + const yyr118 bool = false + yyq118[9] = x.Kind != "" + yyq118[10] = x.APIVersion != "" + var yynn118 int + if yyr118 || yy2arr118 { + r.EncodeArrayStart(11) + } else { + yynn118 = 9 + for _, b := range yyq118 { + if b { + yynn118++ + } + } + r.EncodeMapStart(yynn118) + yynn118 = 0 + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym120 := z.EncBinary() + _ = yym120 + if false { + } else { + r.EncodeInt(int64(x.Port)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("port")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym121 := z.EncBinary() + _ = yym121 + if false { + } else { + r.EncodeInt(int64(x.Port)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym123 := z.EncBinary() + _ = yym123 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Address)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("address")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym124 := z.EncBinary() + _ = yym124 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Address)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym126 := z.EncBinary() + _ = yym126 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("algorithmProvider")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym127 := z.EncBinary() + _ = yym127 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym129 := z.EncBinary() + _ = yym129 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("policyConfigFile")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym130 := z.EncBinary() + _ = yym130 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.EnableProfiling == nil { + r.EncodeNil() + } else { + yy132 := *x.EnableProfiling + yym133 := z.EncBinary() + _ = yym133 + if false { + } else { + r.EncodeBool(bool(yy132)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("enableProfiling")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.EnableProfiling == nil { + r.EncodeNil() + } else { + yy134 := *x.EnableProfiling + yym135 := z.EncBinary() + _ = yym135 + if false { + } else { + r.EncodeBool(bool(yy134)) + } + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym137 := z.EncBinary() + _ = yym137 + if false { + } else { + r.EncodeFloat32(float32(x.KubeAPIQPS)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym138 := z.EncBinary() + _ = yym138 + if false { + } else { + r.EncodeFloat32(float32(x.KubeAPIQPS)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym140 := z.EncBinary() + _ = yym140 + if false { + } else { + r.EncodeInt(int64(x.KubeAPIBurst)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kubeAPIBurst")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym141 := z.EncBinary() + _ = yym141 + if false { + } else { + r.EncodeInt(int64(x.KubeAPIBurst)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym143 := z.EncBinary() + _ = yym143 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("schedulerName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym144 := z.EncBinary() + _ = yym144 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy146 := &x.LeaderElection + yy146.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("leaderElection")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy147 := &x.LeaderElection + yy147.CodecEncodeSelf(e) + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq118[9] { + yym149 := z.EncBinary() + _ = yym149 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq118[9] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym150 := z.EncBinary() + _ = yym150 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq118[10] { + yym152 := z.EncBinary() + _ = yym152 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq118[10] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym153 := z.EncBinary() + _ = yym153 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr118 || yy2arr118 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *KubeSchedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym154 := z.DecBinary() + _ = yym154 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct155 := r.ContainerType() + if yyct155 == codecSelferValueTypeMap1234 { + yyl155 := r.ReadMapStart() + if yyl155 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl155, d) + } + } else if yyct155 == codecSelferValueTypeArray1234 { + yyl155 := r.ReadArrayStart() + if yyl155 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl155, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *KubeSchedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys156Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys156Slc + var yyhl156 bool = l >= 0 + for yyj156 := 0; ; yyj156++ { + if yyhl156 { + if yyj156 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys156Slc = r.DecodeBytes(yys156Slc, true, true) + yys156 := string(yys156Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys156 { + case "port": + if r.TryDecodeAsNil() { + x.Port = 0 + } else { + x.Port = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "address": + if r.TryDecodeAsNil() { + x.Address = "" + } else { + x.Address = string(r.DecodeString()) + } + case "algorithmProvider": + if r.TryDecodeAsNil() { + x.AlgorithmProvider = "" + } else { + x.AlgorithmProvider = string(r.DecodeString()) + } + case "policyConfigFile": + if r.TryDecodeAsNil() { + x.PolicyConfigFile = "" + } else { + x.PolicyConfigFile = string(r.DecodeString()) + } + case "enableProfiling": + if r.TryDecodeAsNil() { + if x.EnableProfiling != nil { + x.EnableProfiling = nil + } + } else { + if x.EnableProfiling == nil { + x.EnableProfiling = new(bool) + } + yym162 := z.DecBinary() + _ = yym162 + if false { + } else { + *((*bool)(x.EnableProfiling)) = r.DecodeBool() + } + } + case "kubeAPIQPS": + if r.TryDecodeAsNil() { + x.KubeAPIQPS = 0 + } else { + x.KubeAPIQPS = float32(r.DecodeFloat(true)) + } + case "kubeAPIBurst": + if r.TryDecodeAsNil() { + x.KubeAPIBurst = 0 + } else { + x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "schedulerName": + if r.TryDecodeAsNil() { + x.SchedulerName = "" + } else { + x.SchedulerName = string(r.DecodeString()) + } + case "leaderElection": + if r.TryDecodeAsNil() { + x.LeaderElection = LeaderElectionConfiguration{} + } else { + yyv166 := &x.LeaderElection + yyv166.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, yys156) + } // end switch yys156 + } // end for yyj156 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj169 int + var yyb169 bool + var yyhl169 bool = l >= 0 + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Port = 0 + } else { + x.Port = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Address = "" + } else { + x.Address = string(r.DecodeString()) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.AlgorithmProvider = "" + } else { + x.AlgorithmProvider = string(r.DecodeString()) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.PolicyConfigFile = "" + } else { + x.PolicyConfigFile = string(r.DecodeString()) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.EnableProfiling != nil { + x.EnableProfiling = nil + } + } else { + if x.EnableProfiling == nil { + x.EnableProfiling = new(bool) + } + yym175 := z.DecBinary() + _ = yym175 + if false { + } else { + *((*bool)(x.EnableProfiling)) = r.DecodeBool() + } + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.KubeAPIQPS = 0 + } else { + x.KubeAPIQPS = float32(r.DecodeFloat(true)) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.KubeAPIBurst = 0 + } else { + x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SchedulerName = "" + } else { + x.SchedulerName = string(r.DecodeString()) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LeaderElection = LeaderElectionConfiguration{} + } else { + yyv179 := &x.LeaderElection + yyv179.CodecDecodeSelf(d) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj169++ + if yyhl169 { + yyb169 = yyj169 > l + } else { + yyb169 = r.CheckBreak() + } + if yyb169 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj169-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *LeaderElectionConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym182 := z.EncBinary() + _ = yym182 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep183 := !z.EncBinary() + yy2arr183 := z.EncBasicHandle().StructToArray + var yyq183 [4]bool + _, _, _ = yysep183, yyq183, yy2arr183 + const yyr183 bool = false + var yynn183 int + if yyr183 || yy2arr183 { + r.EncodeArrayStart(4) + } else { + yynn183 = 4 + for _, b := range yyq183 { + if b { + yynn183++ + } + } + r.EncodeMapStart(yynn183) + yynn183 = 0 + } + if yyr183 || yy2arr183 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.LeaderElect == nil { + r.EncodeNil() + } else { + yy185 := *x.LeaderElect + yym186 := z.EncBinary() + _ = yym186 + if false { + } else { + r.EncodeBool(bool(yy185)) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("leaderElect")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.LeaderElect == nil { + r.EncodeNil() + } else { + yy187 := *x.LeaderElect + yym188 := z.EncBinary() + _ = yym188 + if false { + } else { + r.EncodeBool(bool(yy187)) + } + } + } + if yyr183 || yy2arr183 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy190 := &x.LeaseDuration + yym191 := z.EncBinary() + _ = yym191 + if false { + } else if z.HasExtensions() && z.EncExt(yy190) { + } else if !yym191 && z.IsJSONHandle() { + z.EncJSONMarshal(yy190) + } else { + z.EncFallback(yy190) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("leaseDuration")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy192 := &x.LeaseDuration + yym193 := z.EncBinary() + _ = yym193 + if false { + } else if z.HasExtensions() && z.EncExt(yy192) { + } else if !yym193 && z.IsJSONHandle() { + z.EncJSONMarshal(yy192) + } else { + z.EncFallback(yy192) + } + } + if yyr183 || yy2arr183 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy195 := &x.RenewDeadline + yym196 := z.EncBinary() + _ = yym196 + if false { + } else if z.HasExtensions() && z.EncExt(yy195) { + } else if !yym196 && z.IsJSONHandle() { + z.EncJSONMarshal(yy195) + } else { + z.EncFallback(yy195) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("renewDeadline")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy197 := &x.RenewDeadline + yym198 := z.EncBinary() + _ = yym198 + if false { + } else if z.HasExtensions() && z.EncExt(yy197) { + } else if !yym198 && z.IsJSONHandle() { + z.EncJSONMarshal(yy197) + } else { + z.EncFallback(yy197) + } + } + if yyr183 || yy2arr183 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy200 := &x.RetryPeriod + yym201 := z.EncBinary() + _ = yym201 + if false { + } else if z.HasExtensions() && z.EncExt(yy200) { + } else if !yym201 && z.IsJSONHandle() { + z.EncJSONMarshal(yy200) + } else { + z.EncFallback(yy200) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("retryPeriod")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy202 := &x.RetryPeriod + yym203 := z.EncBinary() + _ = yym203 + if false { + } else if z.HasExtensions() && z.EncExt(yy202) { + } else if !yym203 && z.IsJSONHandle() { + z.EncJSONMarshal(yy202) + } else { + z.EncFallback(yy202) + } + } + if yyr183 || yy2arr183 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *LeaderElectionConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym204 := z.DecBinary() + _ = yym204 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct205 := r.ContainerType() + if yyct205 == codecSelferValueTypeMap1234 { + yyl205 := r.ReadMapStart() + if yyl205 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl205, d) + } + } else if yyct205 == codecSelferValueTypeArray1234 { + yyl205 := r.ReadArrayStart() + if yyl205 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl205, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *LeaderElectionConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys206Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys206Slc + var yyhl206 bool = l >= 0 + for yyj206 := 0; ; yyj206++ { + if yyhl206 { + if yyj206 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys206Slc = r.DecodeBytes(yys206Slc, true, true) + yys206 := string(yys206Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys206 { + case "leaderElect": + if r.TryDecodeAsNil() { + if x.LeaderElect != nil { + x.LeaderElect = nil + } + } else { + if x.LeaderElect == nil { + x.LeaderElect = new(bool) + } + yym208 := z.DecBinary() + _ = yym208 + if false { + } else { + *((*bool)(x.LeaderElect)) = r.DecodeBool() + } + } + case "leaseDuration": + if r.TryDecodeAsNil() { + x.LeaseDuration = pkg1_unversioned.Duration{} + } else { + yyv209 := &x.LeaseDuration + yym210 := z.DecBinary() + _ = yym210 + if false { + } else if z.HasExtensions() && z.DecExt(yyv209) { + } else if !yym210 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv209) + } else { + z.DecFallback(yyv209, false) + } + } + case "renewDeadline": + if r.TryDecodeAsNil() { + x.RenewDeadline = pkg1_unversioned.Duration{} + } else { + yyv211 := &x.RenewDeadline + yym212 := z.DecBinary() + _ = yym212 + if false { + } else if z.HasExtensions() && z.DecExt(yyv211) { + } else if !yym212 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv211) + } else { + z.DecFallback(yyv211, false) + } + } + case "retryPeriod": + if r.TryDecodeAsNil() { + x.RetryPeriod = pkg1_unversioned.Duration{} + } else { + yyv213 := &x.RetryPeriod + yym214 := z.DecBinary() + _ = yym214 + if false { + } else if z.HasExtensions() && z.DecExt(yyv213) { + } else if !yym214 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv213) + } else { + z.DecFallback(yyv213, false) + } + } + default: + z.DecStructFieldNotFound(-1, yys206) + } // end switch yys206 + } // end for yyj206 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj215 int + var yyb215 bool + var yyhl215 bool = l >= 0 + yyj215++ + if yyhl215 { + yyb215 = yyj215 > l + } else { + yyb215 = r.CheckBreak() + } + if yyb215 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.LeaderElect != nil { + x.LeaderElect = nil + } + } else { + if x.LeaderElect == nil { + x.LeaderElect = new(bool) + } + yym217 := z.DecBinary() + _ = yym217 + if false { + } else { + *((*bool)(x.LeaderElect)) = r.DecodeBool() + } + } + yyj215++ + if yyhl215 { + yyb215 = yyj215 > l + } else { + yyb215 = r.CheckBreak() + } + if yyb215 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LeaseDuration = pkg1_unversioned.Duration{} + } else { + yyv218 := &x.LeaseDuration + yym219 := z.DecBinary() + _ = yym219 + if false { + } else if z.HasExtensions() && z.DecExt(yyv218) { + } else if !yym219 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv218) + } else { + z.DecFallback(yyv218, false) + } + } + yyj215++ + if yyhl215 { + yyb215 = yyj215 > l + } else { + yyb215 = r.CheckBreak() + } + if yyb215 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RenewDeadline = pkg1_unversioned.Duration{} + } else { + yyv220 := &x.RenewDeadline + yym221 := z.DecBinary() + _ = yym221 + if false { + } else if z.HasExtensions() && z.DecExt(yyv220) { + } else if !yym221 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv220) + } else { + z.DecFallback(yyv220, false) + } + } + yyj215++ + if yyhl215 { + yyb215 = yyj215 > l + } else { + yyb215 = r.CheckBreak() + } + if yyb215 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RetryPeriod = pkg1_unversioned.Duration{} + } else { + yyv222 := &x.RetryPeriod + yym223 := z.DecBinary() + _ = yym223 + if false { + } else if z.HasExtensions() && z.DecExt(yyv222) { + } else if !yym223 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv222) + } else { + z.DecFallback(yyv222, false) + } + } + for { + yyj215++ + if yyhl215 { + yyb215 = yyj215 > l + } else { + yyb215 = r.CheckBreak() + } + if yyb215 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj215-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} diff --git a/pkg/apis/componentconfig/v1alpha1/types.go b/pkg/apis/componentconfig/v1alpha1/types.go index 9da97f84ed9..7210541ddf1 100644 --- a/pkg/apis/componentconfig/v1alpha1/types.go +++ b/pkg/apis/componentconfig/v1alpha1/types.go @@ -31,6 +31,9 @@ type KubeProxyConfiguration struct { HealthzPort int32 `json:"healthzPort"` // hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname. HostnameOverride string `json:"hostnameOverride"` + // iptablesMasqueradeBit is the bit of the iptables fwmark space to use for SNAT if using + // the pure iptables proxy mode. Values must be within the range [0, 31]. + IPTablesMasqueradeBit *int32 `json:"iptablesMasqueradeBit"` // iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m', // '2h22m'). Must be greater than 0. IPTablesSyncPeriod unversioned.Duration `json:"iptablesSyncPeriodSeconds"` @@ -74,3 +77,53 @@ const ( ProxyModeUserspace ProxyMode = "userspace" ProxyModeIPTables ProxyMode = "iptables" ) + +type KubeSchedulerConfiguration struct { + unversioned.TypeMeta + + // port is the port that the scheduler's http service runs on. + Port int `json:"port"` + // address is the IP address to serve on. + Address string `json:"address"` + // algorithmProvider is the scheduling algorithm provider to use. + AlgorithmProvider string `json:"algorithmProvider"` + // policyConfigFile is the filepath to the scheduler policy configuration. + PolicyConfigFile string `json:"policyConfigFile"` + // enableProfiling enables profiling via web interface. + EnableProfiling *bool `json:"enableProfiling"` + // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. + KubeAPIQPS float32 `json:"kubeAPIQPS"` + // kubeAPIBurst is the QPS burst to use while talking with kubernetes apiserver. + KubeAPIBurst int `json:"kubeAPIBurst"` + // schedulerName is name of the scheduler, used to select which pods + // will be processed by this scheduler, based on pod's annotation with + // key 'scheduler.alpha.kubernetes.io/name'. + SchedulerName string `json:"schedulerName"` + // leaderElection defines the configuration of leader election client. + LeaderElection LeaderElectionConfiguration `json:"leaderElection"` +} + +// LeaderElectionConfiguration defines the configuration of leader election +// clients for components that can run with leader election enabled. +type LeaderElectionConfiguration struct { + // leaderElect enables a leader election client to gain leadership + // before executing the main loop. Enable this when running replicated + // components for high availability. + LeaderElect *bool `json:"leaderElect"` + // leaseDuration is the duration that non-leader candidates will wait + // after observing a leadership renewal until attempting to acquire + // leadership of a led but unrenewed leader slot. This is effectively the + // maximum duration that a leader can be stopped before it is replaced + // by another candidate. This is only applicable if leader election is + // enabled. + LeaseDuration unversioned.Duration `json:"leaseDuration"` + // renewDeadline is the interval between attempts by the acting master to + // renew a leadership slot before it stops leading. This must be less + // than or equal to the lease duration. This is only applicable if leader + // election is enabled. + RenewDeadline unversioned.Duration `json:"renewDeadline"` + // retryPeriod is the duration the clients should wait between attempting + // acquisition and renewal of a leadership. This is only applicable if + // leader election is enabled. + RetryPeriod unversioned.Duration `json:"retryPeriod"` +} diff --git a/pkg/apis/extensions/helpers.go b/pkg/apis/extensions/helpers.go index b09d58f83ce..0e6d309e59a 100644 --- a/pkg/apis/extensions/helpers.go +++ b/pkg/apis/extensions/helpers.go @@ -16,68 +16,32 @@ limitations under the License. package extensions -import ( - "fmt" +// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). +// import ( +// "fmt" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/labels" - "k8s.io/kubernetes/pkg/util/sets" -) +// "k8s.io/kubernetes/pkg/api" +// "k8s.io/kubernetes/pkg/api/unversioned" +// ) -// LabelSelectorAsSelector converts the LabelSelector api type into a struct that implements -// labels.Selector -func LabelSelectorAsSelector(ps *LabelSelector) (labels.Selector, error) { - if ps == nil { - return labels.Nothing(), nil - } - if len(ps.MatchLabels)+len(ps.MatchExpressions) == 0 { - return labels.Everything(), nil - } - selector := labels.NewSelector() - for k, v := range ps.MatchLabels { - r, err := labels.NewRequirement(k, labels.InOperator, sets.NewString(v)) - if err != nil { - return nil, err - } - selector = selector.Add(*r) - } - for _, expr := range ps.MatchExpressions { - var op labels.Operator - switch expr.Operator { - case LabelSelectorOpIn: - op = labels.InOperator - case LabelSelectorOpNotIn: - op = labels.NotInOperator - case LabelSelectorOpExists: - op = labels.ExistsOperator - case LabelSelectorOpDoesNotExist: - op = labels.DoesNotExistOperator - default: - return nil, fmt.Errorf("%q is not a valid pod selector operator", expr.Operator) - } - r, err := labels.NewRequirement(expr.Key, op, sets.NewString(expr.Values...)) - if err != nil { - return nil, err - } - selector = selector.Add(*r) - } - return selector, nil -} - -// ScaleFromDeployment returns a scale subresource for a deployment. -func ScaleFromDeployment(deployment *Deployment) *Scale { - return &Scale{ - ObjectMeta: api.ObjectMeta{ - Name: deployment.Name, - Namespace: deployment.Namespace, - CreationTimestamp: deployment.CreationTimestamp, - }, - Spec: ScaleSpec{ - Replicas: deployment.Spec.Replicas, - }, - Status: ScaleStatus{ - Replicas: deployment.Status.Replicas, - Selector: deployment.Spec.Selector, - }, - } -} +// // ScaleFromDeployment returns a scale subresource for a deployment. +// func ScaleFromDeployment(deployment *Deployment) (*Scale, error) { +// selector, err := unversioned.LabelSelectorAsSelector(deployment.Spec.Selector) +// if err != nil { +// return nil, fmt.Errorf("failed to convert label selector to selector: %v", err) +// } +// return &Scale{ +// ObjectMeta: api.ObjectMeta{ +// Name: deployment.Name, +// Namespace: deployment.Namespace, +// CreationTimestamp: deployment.CreationTimestamp, +// }, +// Spec: ScaleSpec{ +// Replicas: deployment.Spec.Replicas, +// }, +// Status: ScaleStatus{ +// Replicas: deployment.Status.Replicas, +// Selector: selector.String(), +// }, +// }, nil +// } diff --git a/pkg/apis/extensions/install/install.go b/pkg/apis/extensions/install/install.go index 4e1477d2d0a..90d5c507335 100644 --- a/pkg/apis/extensions/install/install.go +++ b/pkg/apis/extensions/install/install.go @@ -90,7 +90,9 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error { 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() + rootScoped := sets.NewString( + "PodSecurityPolicy", + ) ignoredKinds := sets.NewString() diff --git a/pkg/apis/extensions/register.go b/pkg/apis/extensions/register.go index a35ceb9eb58..db7b937706e 100644 --- a/pkg/apis/extensions/register.go +++ b/pkg/apis/extensions/register.go @@ -70,6 +70,8 @@ func addKnownTypes(scheme *runtime.Scheme) { &ReplicaSet{}, &ReplicaSetList{}, &api.ExportOptions{}, + &PodSecurityPolicy{}, + &PodSecurityPolicyList{}, ) } @@ -94,3 +96,5 @@ func (obj *Ingress) GetObjectKind() unversioned.ObjectKind { func (obj *IngressList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } func (obj *ReplicaSet) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } func (obj *ReplicaSetList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *PodSecurityPolicy) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *PodSecurityPolicyList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/extensions/types.generated.go b/pkg/apis/extensions/types.generated.go index 3b86b8ca347..3b1c2f58d28 100644 --- a/pkg/apis/extensions/types.generated.go +++ b/pkg/apis/extensions/types.generated.go @@ -493,11 +493,11 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { var yyq31 [5]bool _, _, _ = yysep31, yyq31, yy2arr31 const yyr31 bool = false - yyq31[0] = x.Kind != "" - yyq31[1] = x.APIVersion != "" + yyq31[0] = true + yyq31[1] = true yyq31[2] = true - yyq31[3] = true - yyq31[4] = true + yyq31[3] = x.Kind != "" + yyq31[4] = x.APIVersion != "" var yynn31 int if yyr31 || yy2arr31 { r.EncodeArrayStart(5) @@ -514,57 +514,41 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[0] { - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy33 := &x.ObjectMeta + yy33.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq31[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy34 := &x.ObjectMeta + yy34.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[1] { - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy36 := &x.Spec + yy36.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq31[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy37 := &x.Spec + yy37.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[2] { - yy39 := &x.ObjectMeta + yy39 := &x.Status yy39.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -572,44 +556,60 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq31[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy40 := &x.ObjectMeta + yy40 := &x.Status yy40.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[3] { - yy42 := &x.Spec - yy42.CodecEncodeSelf(e) + yym42 := z.EncBinary() + _ = yym42 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq31[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy43 := &x.Spec - yy43.CodecEncodeSelf(e) + yym43 := z.EncBinary() + _ = yym43 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[4] { - yy45 := &x.Status - yy45.CodecEncodeSelf(e) + yym45 := z.EncBinary() + _ = yym45 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq31[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy46 := &x.Status - yy46.CodecEncodeSelf(e) + yym46 := z.EncBinary() + _ = yym46 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr31 || yy2arr31 { @@ -673,6 +673,27 @@ func (x *Scale) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys49 := string(yys49Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys49 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv50 := &x.ObjectMeta + yyv50.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ScaleSpec{} + } else { + yyv51 := &x.Spec + yyv51.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ScaleStatus{} + } else { + yyv52 := &x.Status + yyv52.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -685,27 +706,6 @@ func (x *Scale) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv52 := &x.ObjectMeta - yyv52.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ScaleSpec{} - } else { - yyv53 := &x.Spec - yyv53.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ScaleStatus{} - } else { - yyv54 := &x.Status - yyv54.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys49) } // end switch yys49 @@ -731,6 +731,57 @@ func (x *Scale) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv56 := &x.ObjectMeta + yyv56.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ScaleSpec{} + } else { + yyv57 := &x.Spec + yyv57.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ScaleStatus{} + } else { + yyv58 := &x.Status + yyv58.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -752,57 +803,6 @@ func (x *Scale) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv58 := &x.ObjectMeta - yyv58.CodecDecodeSelf(d) - } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ScaleSpec{} - } else { - yyv59 := &x.Spec - yyv59.CodecDecodeSelf(d) - } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ScaleStatus{} - } else { - yyv60 := &x.Status - yyv60.CodecDecodeSelf(d) - } for { yyj55++ if yyhl55 { @@ -3136,11 +3136,11 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { var yyq250 [5]bool _, _, _ = yysep250, yyq250, yy2arr250 const yyr250 bool = false - yyq250[0] = x.Kind != "" - yyq250[1] = x.APIVersion != "" + yyq250[0] = true + yyq250[1] = true yyq250[2] = true - yyq250[3] = true - yyq250[4] = true + yyq250[3] = x.Kind != "" + yyq250[4] = x.APIVersion != "" var yynn250 int if yyr250 || yy2arr250 { r.EncodeArrayStart(5) @@ -3157,57 +3157,41 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[0] { - yym252 := z.EncBinary() - _ = yym252 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy252 := &x.ObjectMeta + yy252.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq250[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym253 := z.EncBinary() - _ = yym253 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy253 := &x.ObjectMeta + yy253.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[1] { - yym255 := z.EncBinary() - _ = yym255 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy255 := &x.Spec + yy255.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq250[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym256 := z.EncBinary() - _ = yym256 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy256 := &x.Spec + yy256.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[2] { - yy258 := &x.ObjectMeta + yy258 := &x.Status yy258.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -3215,44 +3199,60 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq250[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy259 := &x.ObjectMeta + yy259 := &x.Status yy259.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[3] { - yy261 := &x.Spec - yy261.CodecEncodeSelf(e) + yym261 := z.EncBinary() + _ = yym261 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq250[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy262 := &x.Spec - yy262.CodecEncodeSelf(e) + yym262 := z.EncBinary() + _ = yym262 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[4] { - yy264 := &x.Status - yy264.CodecEncodeSelf(e) + yym264 := z.EncBinary() + _ = yym264 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq250[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy265 := &x.Status - yy265.CodecEncodeSelf(e) + yym265 := z.EncBinary() + _ = yym265 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr250 || yy2arr250 { @@ -3316,6 +3316,27 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Dec yys268 := string(yys268Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys268 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv269 := &x.ObjectMeta + yyv269.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = HorizontalPodAutoscalerSpec{} + } else { + yyv270 := &x.Spec + yyv270.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = HorizontalPodAutoscalerStatus{} + } else { + yyv271 := &x.Status + yyv271.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -3328,27 +3349,6 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv271 := &x.ObjectMeta - yyv271.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = HorizontalPodAutoscalerSpec{} - } else { - yyv272 := &x.Spec - yyv272.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = HorizontalPodAutoscalerStatus{} - } else { - yyv273 := &x.Status - yyv273.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys268) } // end switch yys268 @@ -3374,6 +3374,57 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.D return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv275 := &x.ObjectMeta + yyv275.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = HorizontalPodAutoscalerSpec{} + } else { + yyv276 := &x.Spec + yyv276.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = HorizontalPodAutoscalerStatus{} + } else { + yyv277 := &x.Status + yyv277.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -3395,57 +3446,6 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv277 := &x.ObjectMeta - yyv277.CodecDecodeSelf(d) - } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = HorizontalPodAutoscalerSpec{} - } else { - yyv278 := &x.Spec - yyv278.CodecDecodeSelf(d) - } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = HorizontalPodAutoscalerStatus{} - } else { - yyv279 := &x.Status - yyv279.CodecDecodeSelf(d) - } for { yyj274++ if yyhl274 { @@ -3479,9 +3479,9 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq281 [4]bool _, _, _ = yysep281, yyq281, yy2arr281 const yyr281 bool = false - yyq281[0] = x.Kind != "" - yyq281[1] = x.APIVersion != "" - yyq281[2] = true + yyq281[0] = true + yyq281[2] = x.Kind != "" + yyq281[3] = x.APIVersion != "" var yynn281 int if yyr281 || yy2arr281 { r.EncodeArrayStart(4) @@ -3498,79 +3498,29 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr281 || yy2arr281 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq281[0] { - yym283 := z.EncBinary() - _ = yym283 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq281[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy283 := &x.ListMeta yym284 := z.EncBinary() _ = yym284 if false { + } else if z.HasExtensions() && z.EncExt(yy283) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr281 || yy2arr281 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq281[1] { - yym286 := z.EncBinary() - _ = yym286 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq281[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym287 := z.EncBinary() - _ = yym287 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr281 || yy2arr281 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq281[2] { - yy289 := &x.ListMeta - yym290 := z.EncBinary() - _ = yym290 - if false { - } else if z.HasExtensions() && z.EncExt(yy289) { - } else { - z.EncFallback(yy289) + z.EncFallback(yy283) } } else { r.EncodeNil() } } else { - if yyq281[2] { + if yyq281[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy291 := &x.ListMeta - yym292 := z.EncBinary() - _ = yym292 + yy285 := &x.ListMeta + yym286 := z.EncBinary() + _ = yym286 if false { - } else if z.HasExtensions() && z.EncExt(yy291) { + } else if z.HasExtensions() && z.EncExt(yy285) { } else { - z.EncFallback(yy291) + z.EncFallback(yy285) } } } @@ -3579,8 +3529,8 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym294 := z.EncBinary() - _ = yym294 + yym288 := z.EncBinary() + _ = yym288 if false { } else { h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) @@ -3593,11 +3543,61 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym289 := z.EncBinary() + _ = yym289 + if false { + } else { + h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) + } + } + } + if yyr281 || yy2arr281 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq281[2] { + yym291 := z.EncBinary() + _ = yym291 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq281[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym292 := z.EncBinary() + _ = yym292 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr281 || yy2arr281 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq281[3] { + yym294 := z.EncBinary() + _ = yym294 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq281[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym295 := z.EncBinary() _ = yym295 if false { } else { - h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -3662,6 +3662,31 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978 yys298 := string(yys298Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys298 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv299 := &x.ListMeta + yym300 := z.DecBinary() + _ = yym300 + if false { + } else if z.HasExtensions() && z.DecExt(yyv299) { + } else { + z.DecFallback(yyv299, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv301 := &x.Items + yym302 := z.DecBinary() + _ = yym302 + if false { + } else { + h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv301), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -3674,31 +3699,6 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv301 := &x.ListMeta - yym302 := z.DecBinary() - _ = yym302 - if false { - } else if z.HasExtensions() && z.DecExt(yyv301) { - } else { - z.DecFallback(yyv301, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv303 := &x.Items - yym304 := z.DecBinary() - _ = yym304 - if false { - } else { - h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv303), d) - } - } default: z.DecStructFieldNotFound(-1, yys298) } // end switch yys298 @@ -3724,6 +3724,51 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromArray(l int, d *codec19 return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv306 := &x.ListMeta + yym307 := z.DecBinary() + _ = yym307 + if false { + } else if z.HasExtensions() && z.DecExt(yyv306) { + } else { + z.DecFallback(yyv306, false) + } + } + yyj305++ + if yyhl305 { + yyb305 = yyj305 > l + } else { + yyb305 = r.CheckBreak() + } + if yyb305 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv308 := &x.Items + yym309 := z.DecBinary() + _ = yym309 + if false { + } else { + h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv308), d) + } + } + yyj305++ + if yyhl305 { + yyb305 = yyj305 > l + } else { + yyb305 = r.CheckBreak() + } + if yyb305 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -3745,51 +3790,6 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromArray(l int, d *codec19 } else { x.APIVersion = string(r.DecodeString()) } - yyj305++ - if yyhl305 { - yyb305 = yyj305 > l - } else { - yyb305 = r.CheckBreak() - } - if yyb305 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv308 := &x.ListMeta - yym309 := z.DecBinary() - _ = yym309 - if false { - } else if z.HasExtensions() && z.DecExt(yyv308) { - } else { - z.DecFallback(yyv308, false) - } - } - yyj305++ - if yyhl305 { - yyb305 = yyj305 > l - } else { - yyb305 = r.CheckBreak() - } - if yyb305 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv310 := &x.Items - yym311 := z.DecBinary() - _ = yym311 - if false { - } else { - h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv310), d) - } - } for { yyj305++ if yyhl305 { @@ -3823,11 +3823,11 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { var yyq313 [5]bool _, _, _ = yysep313, yyq313, yy2arr313 const yyr313 bool = false - yyq313[0] = x.Kind != "" - yyq313[1] = x.APIVersion != "" - yyq313[2] = true - yyq313[3] = x.Description != "" - yyq313[4] = len(x.Versions) != 0 + yyq313[0] = true + yyq313[1] = x.Description != "" + yyq313[2] = len(x.Versions) != 0 + yyq313[3] = x.Kind != "" + yyq313[4] = x.APIVersion != "" var yynn313 int if yyr313 || yy2arr313 { r.EncodeArrayStart(5) @@ -3844,26 +3844,18 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[0] { - yym315 := z.EncBinary() - _ = yym315 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy315 := &x.ObjectMeta + yy315.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq313[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym316 := z.EncBinary() - _ = yym316 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy316 := &x.ObjectMeta + yy316.CodecEncodeSelf(e) } } if yyr313 || yy2arr313 { @@ -3873,7 +3865,7 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym318 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Description)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -3881,31 +3873,47 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq313[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("description")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym319 := z.EncBinary() _ = yym319 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Description)) } } } if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[2] { - yy321 := &x.ObjectMeta - yy321.CodecEncodeSelf(e) + if x.Versions == nil { + r.EncodeNil() + } else { + yym321 := z.EncBinary() + _ = yym321 + if false { + } else { + h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) + } + } } else { r.EncodeNil() } } else { if yyq313[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("versions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy322 := &x.ObjectMeta - yy322.CodecEncodeSelf(e) + if x.Versions == nil { + r.EncodeNil() + } else { + yym322 := z.EncBinary() + _ = yym322 + if false { + } else { + h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) + } + } } } if yyr313 || yy2arr313 { @@ -3915,7 +3923,7 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym324 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Description)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -3923,46 +3931,38 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq313[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("description")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym325 := z.EncBinary() _ = yym325 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Description)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[4] { - if x.Versions == nil { - r.EncodeNil() + yym327 := z.EncBinary() + _ = yym327 + if false { } else { - yym327 := z.EncBinary() - _ = yym327 - if false { - } else { - h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) - } + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq313[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("versions")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Versions == nil { - r.EncodeNil() + yym328 := z.EncBinary() + _ = yym328 + if false { } else { - yym328 := z.EncBinary() - _ = yym328 - if false { - } else { - h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) - } + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -4027,24 +4027,12 @@ func (x *ThirdPartyResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) yys331 := string(yys331Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys331 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv334 := &x.ObjectMeta - yyv334.CodecDecodeSelf(d) + yyv332 := &x.ObjectMeta + yyv332.CodecDecodeSelf(d) } case "description": if r.TryDecodeAsNil() { @@ -4056,14 +4044,26 @@ func (x *ThirdPartyResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Versions = nil } else { - yyv336 := &x.Versions - yym337 := z.DecBinary() - _ = yym337 + yyv334 := &x.Versions + yym335 := z.DecBinary() + _ = yym335 if false { } else { - h.decSliceAPIVersion((*[]APIVersion)(yyv336), d) + h.decSliceAPIVersion((*[]APIVersion)(yyv334), 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, yys331) } // end switch yys331 @@ -4089,43 +4089,11 @@ func (x *ThirdPartyResource) codecDecodeSelfFromArray(l int, d *codec1978.Decode return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj338++ - if yyhl338 { - yyb338 = yyj338 > l - } else { - yyb338 = r.CheckBreak() - } - if yyb338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj338++ - if yyhl338 { - yyb338 = yyj338 > l - } else { - yyb338 = r.CheckBreak() - } - if yyb338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv341 := &x.ObjectMeta - yyv341.CodecDecodeSelf(d) + yyv339 := &x.ObjectMeta + yyv339.CodecDecodeSelf(d) } yyj338++ if yyhl338 { @@ -4157,14 +4125,46 @@ func (x *ThirdPartyResource) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Versions = nil } else { - yyv343 := &x.Versions - yym344 := z.DecBinary() - _ = yym344 + yyv341 := &x.Versions + yym342 := z.DecBinary() + _ = yym342 if false { } else { - h.decSliceAPIVersion((*[]APIVersion)(yyv343), d) + h.decSliceAPIVersion((*[]APIVersion)(yyv341), d) } } + yyj338++ + if yyhl338 { + yyb338 = yyj338 > l + } else { + yyb338 = r.CheckBreak() + } + if yyb338 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj338++ + if yyhl338 { + yyb338 = yyj338 > l + } else { + yyb338 = r.CheckBreak() + } + if yyb338 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { yyj338++ if yyhl338 { @@ -4198,9 +4198,9 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq346 [4]bool _, _, _ = yysep346, yyq346, yy2arr346 const yyr346 bool = false - yyq346[0] = x.Kind != "" - yyq346[1] = x.APIVersion != "" - yyq346[2] = true + yyq346[0] = true + yyq346[2] = x.Kind != "" + yyq346[3] = x.APIVersion != "" var yynn346 int if yyr346 || yy2arr346 { r.EncodeArrayStart(4) @@ -4217,79 +4217,29 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr346 || yy2arr346 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq346[0] { - yym348 := z.EncBinary() - _ = yym348 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq346[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy348 := &x.ListMeta yym349 := z.EncBinary() _ = yym349 if false { + } else if z.HasExtensions() && z.EncExt(yy348) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr346 || yy2arr346 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq346[1] { - yym351 := z.EncBinary() - _ = yym351 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq346[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym352 := z.EncBinary() - _ = yym352 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr346 || yy2arr346 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq346[2] { - yy354 := &x.ListMeta - yym355 := z.EncBinary() - _ = yym355 - if false { - } else if z.HasExtensions() && z.EncExt(yy354) { - } else { - z.EncFallback(yy354) + z.EncFallback(yy348) } } else { r.EncodeNil() } } else { - if yyq346[2] { + if yyq346[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy356 := &x.ListMeta - yym357 := z.EncBinary() - _ = yym357 + yy350 := &x.ListMeta + yym351 := z.EncBinary() + _ = yym351 if false { - } else if z.HasExtensions() && z.EncExt(yy356) { + } else if z.HasExtensions() && z.EncExt(yy350) { } else { - z.EncFallback(yy356) + z.EncFallback(yy350) } } } @@ -4298,8 +4248,8 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym359 := z.EncBinary() - _ = yym359 + yym353 := z.EncBinary() + _ = yym353 if false { } else { h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) @@ -4312,11 +4262,61 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym354 := z.EncBinary() + _ = yym354 + if false { + } else { + h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) + } + } + } + if yyr346 || yy2arr346 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq346[2] { + yym356 := z.EncBinary() + _ = yym356 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq346[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym357 := z.EncBinary() + _ = yym357 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr346 || yy2arr346 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq346[3] { + yym359 := z.EncBinary() + _ = yym359 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq346[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym360 := z.EncBinary() _ = yym360 if false { } else { - h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -4381,6 +4381,31 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromMap(l int, d *codec1978.Deco yys363 := string(yys363Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys363 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv364 := &x.ListMeta + yym365 := z.DecBinary() + _ = yym365 + if false { + } else if z.HasExtensions() && z.DecExt(yyv364) { + } else { + z.DecFallback(yyv364, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv366 := &x.Items + yym367 := z.DecBinary() + _ = yym367 + if false { + } else { + h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv366), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4393,31 +4418,6 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv366 := &x.ListMeta - yym367 := z.DecBinary() - _ = yym367 - if false { - } else if z.HasExtensions() && z.DecExt(yyv366) { - } else { - z.DecFallback(yyv366, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv368 := &x.Items - yym369 := z.DecBinary() - _ = yym369 - if false { - } else { - h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv368), d) - } - } default: z.DecStructFieldNotFound(-1, yys363) } // end switch yys363 @@ -4443,6 +4443,51 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromArray(l int, d *codec1978.De return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv371 := &x.ListMeta + yym372 := z.DecBinary() + _ = yym372 + if false { + } else if z.HasExtensions() && z.DecExt(yyv371) { + } else { + z.DecFallback(yyv371, false) + } + } + yyj370++ + if yyhl370 { + yyb370 = yyj370 > l + } else { + yyb370 = r.CheckBreak() + } + if yyb370 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv373 := &x.Items + yym374 := z.DecBinary() + _ = yym374 + if false { + } else { + h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv373), d) + } + } + yyj370++ + if yyhl370 { + yyb370 = yyj370 > l + } else { + yyb370 = r.CheckBreak() + } + if yyb370 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -4464,51 +4509,6 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - yyj370++ - if yyhl370 { - yyb370 = yyj370 > l - } else { - yyb370 = r.CheckBreak() - } - if yyb370 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv373 := &x.ListMeta - yym374 := z.DecBinary() - _ = yym374 - if false { - } else if z.HasExtensions() && z.DecExt(yyv373) { - } else { - z.DecFallback(yyv373, false) - } - } - yyj370++ - if yyhl370 { - yyb370 = yyj370 > l - } else { - yyb370 = r.CheckBreak() - } - if yyb370 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv375 := &x.Items - yym376 := z.DecBinary() - _ = yym376 - if false { - } else { - h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv375), d) - } - } for { yyj370++ if yyhl370 { @@ -4759,10 +4759,10 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { var yyq394 [4]bool _, _, _ = yysep394, yyq394, yy2arr394 const yyr394 bool = false - yyq394[0] = x.Kind != "" - yyq394[1] = x.APIVersion != "" - yyq394[2] = true - yyq394[3] = len(x.Data) != 0 + yyq394[0] = true + yyq394[1] = len(x.Data) != 0 + yyq394[2] = x.Kind != "" + yyq394[3] = x.APIVersion != "" var yynn394 int if yyr394 || yy2arr394 { r.EncodeArrayStart(4) @@ -4779,78 +4779,28 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq394[0] { - yym396 := z.EncBinary() - _ = yym396 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq394[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym397 := z.EncBinary() - _ = yym397 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr394 || yy2arr394 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[1] { - yym399 := z.EncBinary() - _ = yym399 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq394[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym400 := z.EncBinary() - _ = yym400 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr394 || yy2arr394 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[2] { - yy402 := &x.ObjectMeta - yy402.CodecEncodeSelf(e) + yy396 := &x.ObjectMeta + yy396.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq394[2] { + if yyq394[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy403 := &x.ObjectMeta - yy403.CodecEncodeSelf(e) + yy397 := &x.ObjectMeta + yy397.CodecEncodeSelf(e) } } if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[3] { + if yyq394[1] { if x.Data == nil { r.EncodeNil() } else { - yym405 := z.EncBinary() - _ = yym405 + yym399 := z.EncBinary() + _ = yym399 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -4860,15 +4810,15 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq394[3] { + if yyq394[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("data")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Data == nil { r.EncodeNil() } else { - yym406 := z.EncBinary() - _ = yym406 + yym400 := z.EncBinary() + _ = yym400 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -4876,6 +4826,56 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { } } } + if yyr394 || yy2arr394 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq394[2] { + yym402 := z.EncBinary() + _ = yym402 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq394[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym403 := z.EncBinary() + _ = yym403 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr394 || yy2arr394 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq394[3] { + yym405 := z.EncBinary() + _ = yym405 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq394[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym406 := z.EncBinary() + _ = yym406 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -4937,6 +4937,25 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromMap(l int, d *codec1978.Deco yys409 := string(yys409Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys409 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv410 := &x.ObjectMeta + yyv410.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv411 := &x.Data + yym412 := z.DecBinary() + _ = yym412 + if false { + } else { + *yyv411 = r.DecodeBytes(*(*[]byte)(yyv411), false, false) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4949,25 +4968,6 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv412 := &x.ObjectMeta - yyv412.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv413 := &x.Data - yym414 := z.DecBinary() - _ = yym414 - if false { - } else { - *yyv413 = r.DecodeBytes(*(*[]byte)(yyv413), false, false) - } - } default: z.DecStructFieldNotFound(-1, yys409) } // end switch yys409 @@ -4993,6 +4993,45 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromArray(l int, d *codec1978.De return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv416 := &x.ObjectMeta + yyv416.CodecDecodeSelf(d) + } + yyj415++ + if yyhl415 { + yyb415 = yyj415 > l + } else { + yyb415 = r.CheckBreak() + } + if yyb415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv417 := &x.Data + yym418 := z.DecBinary() + _ = yym418 + if false { + } else { + *yyv417 = r.DecodeBytes(*(*[]byte)(yyv417), false, false) + } + } + yyj415++ + if yyhl415 { + yyb415 = yyj415 > l + } else { + yyb415 = r.CheckBreak() + } + if yyb415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -5014,45 +5053,6 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - yyj415++ - if yyhl415 { - yyb415 = yyj415 > l - } else { - yyb415 = r.CheckBreak() - } - if yyb415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv418 := &x.ObjectMeta - yyv418.CodecDecodeSelf(d) - } - yyj415++ - if yyhl415 { - yyb415 = yyj415 > l - } else { - yyb415 = r.CheckBreak() - } - if yyb415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv419 := &x.Data - yym420 := z.DecBinary() - _ = yym420 - if false { - } else { - *yyv419 = r.DecodeBytes(*(*[]byte)(yyv419), false, false) - } - } for { yyj415++ if yyhl415 { @@ -5086,11 +5086,11 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { var yyq422 [5]bool _, _, _ = yysep422, yyq422, yy2arr422 const yyr422 bool = false - yyq422[0] = x.Kind != "" - yyq422[1] = x.APIVersion != "" + yyq422[0] = true + yyq422[1] = true yyq422[2] = true - yyq422[3] = true - yyq422[4] = true + yyq422[3] = x.Kind != "" + yyq422[4] = x.APIVersion != "" var yynn422 int if yyr422 || yy2arr422 { r.EncodeArrayStart(5) @@ -5107,57 +5107,41 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[0] { - yym424 := z.EncBinary() - _ = yym424 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy424 := &x.ObjectMeta + yy424.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq422[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym425 := z.EncBinary() - _ = yym425 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy425 := &x.ObjectMeta + yy425.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[1] { - yym427 := z.EncBinary() - _ = yym427 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy427 := &x.Spec + yy427.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq422[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym428 := z.EncBinary() - _ = yym428 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy428 := &x.Spec + yy428.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[2] { - yy430 := &x.ObjectMeta + yy430 := &x.Status yy430.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -5165,44 +5149,60 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq422[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy431 := &x.ObjectMeta + yy431 := &x.Status yy431.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[3] { - yy433 := &x.Spec - yy433.CodecEncodeSelf(e) + yym433 := z.EncBinary() + _ = yym433 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq422[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy434 := &x.Spec - yy434.CodecEncodeSelf(e) + yym434 := z.EncBinary() + _ = yym434 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[4] { - yy436 := &x.Status - yy436.CodecEncodeSelf(e) + yym436 := z.EncBinary() + _ = yym436 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq422[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy437 := &x.Status - yy437.CodecEncodeSelf(e) + yym437 := z.EncBinary() + _ = yym437 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr422 || yy2arr422 { @@ -5266,6 +5266,27 @@ func (x *Deployment) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys440 := string(yys440Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys440 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv441 := &x.ObjectMeta + yyv441.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = DeploymentSpec{} + } else { + yyv442 := &x.Spec + yyv442.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = DeploymentStatus{} + } else { + yyv443 := &x.Status + yyv443.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -5278,27 +5299,6 @@ func (x *Deployment) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv443 := &x.ObjectMeta - yyv443.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = DeploymentSpec{} - } else { - yyv444 := &x.Spec - yyv444.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = DeploymentStatus{} - } else { - yyv445 := &x.Status - yyv445.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys440) } // end switch yys440 @@ -5324,6 +5324,57 @@ func (x *Deployment) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv447 := &x.ObjectMeta + yyv447.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = DeploymentSpec{} + } else { + yyv448 := &x.Spec + yyv448.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = DeploymentStatus{} + } else { + yyv449 := &x.Status + yyv449.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -5345,57 +5396,6 @@ func (x *Deployment) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv449 := &x.ObjectMeta - yyv449.CodecDecodeSelf(d) - } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = DeploymentSpec{} - } else { - yyv450 := &x.Spec - yyv450.CodecDecodeSelf(d) - } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = DeploymentStatus{} - } else { - yyv451 := &x.Status - yyv451.CodecDecodeSelf(d) - } for { yyj446++ if yyhl446 { @@ -5430,10 +5430,10 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { _, _, _ = yysep453, yyq453, yy2arr453 const yyr453 bool = false yyq453[0] = x.Replicas != 0 - yyq453[1] = len(x.Selector) != 0 + yyq453[1] = x.Selector != nil yyq453[3] = true - yyq453[4] = x.RevisionHistoryLimit != nil - yyq453[5] = x.UniqueLabelKey != "" + yyq453[4] = x.MinReadySeconds != 0 + yyq453[5] = x.RevisionHistoryLimit != nil yyq453[6] = x.Paused != false yyq453[7] = x.RollbackTo != nil var yynn453 int @@ -5483,8 +5483,9 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { yym458 := z.EncBinary() _ = yym458 if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { } else { - z.F.EncMapStringStringV(x.Selector, false, e) + z.EncFallback(x.Selector) } } } else { @@ -5501,8 +5502,9 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { yym459 := z.EncBinary() _ = yym459 if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { } else { - z.F.EncMapStringStringV(x.Selector, false, e) + z.EncFallback(x.Selector) } } } @@ -5538,60 +5540,60 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq453[4] { - if x.RevisionHistoryLimit == nil { - r.EncodeNil() + yym467 := z.EncBinary() + _ = yym467 + if false { } else { - yy467 := *x.RevisionHistoryLimit - yym468 := z.EncBinary() - _ = yym468 - if false { - } else { - r.EncodeInt(int64(yy467)) - } + r.EncodeInt(int64(x.MinReadySeconds)) } } else { - r.EncodeNil() + r.EncodeInt(0) } } else { if yyq453[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("revisionHistoryLimit")) + r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.RevisionHistoryLimit == nil { - r.EncodeNil() + yym468 := z.EncBinary() + _ = yym468 + if false { } else { - yy469 := *x.RevisionHistoryLimit - yym470 := z.EncBinary() - _ = yym470 - if false { - } else { - r.EncodeInt(int64(yy469)) - } + r.EncodeInt(int64(x.MinReadySeconds)) } } } if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq453[5] { - yym472 := z.EncBinary() - _ = yym472 - if false { + if x.RevisionHistoryLimit == nil { + r.EncodeNil() } else { - r.EncodeString(codecSelferC_UTF81234, string(x.UniqueLabelKey)) + yy470 := *x.RevisionHistoryLimit + yym471 := z.EncBinary() + _ = yym471 + if false { + } else { + r.EncodeInt(int64(yy470)) + } } } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq453[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("uniqueLabelKey")) + r.EncodeString(codecSelferC_UTF81234, string("revisionHistoryLimit")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym473 := z.EncBinary() - _ = yym473 - if false { + if x.RevisionHistoryLimit == nil { + r.EncodeNil() } else { - r.EncodeString(codecSelferC_UTF81234, string(x.UniqueLabelKey)) + yy472 := *x.RevisionHistoryLimit + yym473 := z.EncBinary() + _ = yym473 + if false { + } else { + r.EncodeInt(int64(yy472)) + } } } } @@ -5712,14 +5714,19 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } case "selector": if r.TryDecodeAsNil() { - x.Selector = nil + if x.Selector != nil { + x.Selector = nil + } } else { - yyv482 := &x.Selector + if x.Selector == nil { + x.Selector = new(pkg1_unversioned.LabelSelector) + } yym483 := z.DecBinary() _ = yym483 if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { } else { - z.F.DecMapStringStringX(yyv482, false, d) + z.DecFallback(x.Selector, false) } } case "template": @@ -5736,6 +5743,12 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yyv485 := &x.Strategy yyv485.CodecDecodeSelf(d) } + case "minReadySeconds": + if r.TryDecodeAsNil() { + x.MinReadySeconds = 0 + } else { + x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) + } case "revisionHistoryLimit": if r.TryDecodeAsNil() { if x.RevisionHistoryLimit != nil { @@ -5745,19 +5758,13 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RevisionHistoryLimit == nil { x.RevisionHistoryLimit = new(int) } - yym487 := z.DecBinary() - _ = yym487 + yym488 := z.DecBinary() + _ = yym488 if false { } else { *((*int)(x.RevisionHistoryLimit)) = int(r.DecodeInt(codecSelferBitsize1234)) } } - case "uniqueLabelKey": - if r.TryDecodeAsNil() { - x.UniqueLabelKey = "" - } else { - x.UniqueLabelKey = string(r.DecodeString()) - } case "paused": if r.TryDecodeAsNil() { x.Paused = false @@ -5817,14 +5824,19 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Selector = nil + if x.Selector != nil { + x.Selector = nil + } } else { - yyv493 := &x.Selector + if x.Selector == nil { + x.Selector = new(pkg1_unversioned.LabelSelector) + } yym494 := z.DecBinary() _ = yym494 if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { } else { - z.F.DecMapStringStringX(yyv493, false, d) + z.DecFallback(x.Selector, false) } } yyj491++ @@ -5873,19 +5885,9 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - if x.RevisionHistoryLimit != nil { - x.RevisionHistoryLimit = nil - } + x.MinReadySeconds = 0 } else { - if x.RevisionHistoryLimit == nil { - x.RevisionHistoryLimit = new(int) - } - yym498 := z.DecBinary() - _ = yym498 - if false { - } else { - *((*int)(x.RevisionHistoryLimit)) = int(r.DecodeInt(codecSelferBitsize1234)) - } + x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) } yyj491++ if yyhl491 { @@ -5899,9 +5901,19 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.UniqueLabelKey = "" + if x.RevisionHistoryLimit != nil { + x.RevisionHistoryLimit = nil + } } else { - x.UniqueLabelKey = string(r.DecodeString()) + if x.RevisionHistoryLimit == nil { + x.RevisionHistoryLimit = new(int) + } + yym499 := z.DecBinary() + _ = yym499 + if false { + } else { + *((*int)(x.RevisionHistoryLimit)) = int(r.DecodeInt(codecSelferBitsize1234)) + } } yyj491++ if yyhl491 { @@ -5973,9 +5985,9 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { var yyq503 [5]bool _, _, _ = yysep503, yyq503, yy2arr503 const yyr503 bool = false - yyq503[0] = x.Kind != "" - yyq503[1] = x.APIVersion != "" - yyq503[3] = len(x.UpdatedAnnotations) != 0 + yyq503[1] = len(x.UpdatedAnnotations) != 0 + yyq503[3] = x.Kind != "" + yyq503[4] = x.APIVersion != "" var yynn503 int if yyr503 || yy2arr503 { r.EncodeArrayStart(5) @@ -5991,58 +6003,8 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq503[0] { - yym505 := z.EncBinary() - _ = yym505 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq503[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym506 := z.EncBinary() - _ = yym506 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr503 || yy2arr503 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq503[1] { - yym508 := z.EncBinary() - _ = yym508 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq503[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym509 := z.EncBinary() - _ = yym509 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr503 || yy2arr503 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym511 := z.EncBinary() - _ = yym511 + yym505 := z.EncBinary() + _ = yym505 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -6051,8 +6013,8 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym512 := z.EncBinary() - _ = yym512 + yym506 := z.EncBinary() + _ = yym506 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -6060,12 +6022,12 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq503[3] { + if yyq503[1] { if x.UpdatedAnnotations == nil { r.EncodeNil() } else { - yym514 := z.EncBinary() - _ = yym514 + yym508 := z.EncBinary() + _ = yym508 if false { } else { z.F.EncMapStringStringV(x.UpdatedAnnotations, false, e) @@ -6075,15 +6037,15 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq503[3] { + if yyq503[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("updatedAnnotations")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.UpdatedAnnotations == nil { r.EncodeNil() } else { - yym515 := z.EncBinary() - _ = yym515 + yym509 := z.EncBinary() + _ = yym509 if false { } else { z.F.EncMapStringStringV(x.UpdatedAnnotations, false, e) @@ -6093,14 +6055,64 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy517 := &x.RollbackTo - yy517.CodecEncodeSelf(e) + yy511 := &x.RollbackTo + yy511.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rollbackTo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy518 := &x.RollbackTo - yy518.CodecEncodeSelf(e) + yy512 := &x.RollbackTo + yy512.CodecEncodeSelf(e) + } + if yyr503 || yy2arr503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq503[3] { + yym514 := z.EncBinary() + _ = yym514 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq503[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym515 := z.EncBinary() + _ = yym515 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr503 || yy2arr503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq503[4] { + yym517 := z.EncBinary() + _ = yym517 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq503[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym518 := z.EncBinary() + _ = yym518 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } } if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) @@ -6163,6 +6175,31 @@ func (x *DeploymentRollback) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) yys521 := string(yys521Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys521 { + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + case "updatedAnnotations": + if r.TryDecodeAsNil() { + x.UpdatedAnnotations = nil + } else { + yyv523 := &x.UpdatedAnnotations + yym524 := z.DecBinary() + _ = yym524 + if false { + } else { + z.F.DecMapStringStringX(yyv523, false, d) + } + } + case "rollbackTo": + if r.TryDecodeAsNil() { + x.RollbackTo = RollbackConfig{} + } else { + yyv525 := &x.RollbackTo + yyv525.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6175,31 +6212,6 @@ func (x *DeploymentRollback) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - case "updatedAnnotations": - if r.TryDecodeAsNil() { - x.UpdatedAnnotations = nil - } else { - yyv525 := &x.UpdatedAnnotations - yym526 := z.DecBinary() - _ = yym526 - if false { - } else { - z.F.DecMapStringStringX(yyv525, false, d) - } - } - case "rollbackTo": - if r.TryDecodeAsNil() { - x.RollbackTo = RollbackConfig{} - } else { - yyv527 := &x.RollbackTo - yyv527.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys521) } // end switch yys521 @@ -6225,6 +6237,61 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l + } else { + yyb528 = r.CheckBreak() + } + if yyb528 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.UpdatedAnnotations = nil + } else { + yyv530 := &x.UpdatedAnnotations + yym531 := z.DecBinary() + _ = yym531 + if false { + } else { + z.F.DecMapStringStringX(yyv530, false, d) + } + } + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l + } else { + yyb528 = r.CheckBreak() + } + if yyb528 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RollbackTo = RollbackConfig{} + } else { + yyv532 := &x.RollbackTo + yyv532.CodecDecodeSelf(d) + } + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l + } else { + yyb528 = r.CheckBreak() + } + if yyb528 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -6246,61 +6313,6 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.APIVersion = string(r.DecodeString()) } - yyj528++ - if yyhl528 { - yyb528 = yyj528 > l - } else { - yyb528 = r.CheckBreak() - } - if yyb528 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - yyj528++ - if yyhl528 { - yyb528 = yyj528 > l - } else { - yyb528 = r.CheckBreak() - } - if yyb528 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.UpdatedAnnotations = nil - } else { - yyv532 := &x.UpdatedAnnotations - yym533 := z.DecBinary() - _ = yym533 - if false { - } else { - z.F.DecMapStringStringX(yyv532, false, d) - } - } - yyj528++ - if yyhl528 { - yyb528 = yyj528 > l - } else { - yyb528 = r.CheckBreak() - } - if yyb528 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RollbackTo = RollbackConfig{} - } else { - yyv534 := &x.RollbackTo - yyv534.CodecDecodeSelf(d) - } for { yyj528++ if yyhl528 { @@ -6741,15 +6753,14 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep561 := !z.EncBinary() yy2arr561 := z.EncBasicHandle().StructToArray - var yyq561 [3]bool + var yyq561 [2]bool _, _, _ = yysep561, yyq561, yy2arr561 const yyr561 bool = false yyq561[0] = true yyq561[1] = true - yyq561[2] = x.MinReadySeconds != 0 var yynn561 int if yyr561 || yy2arr561 { - r.EncodeArrayStart(3) + r.EncodeArrayStart(2) } else { yynn561 = 0 for _, b := range yyq561 { @@ -6826,31 +6837,6 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr561 || yy2arr561 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq561[2] { - yym573 := z.EncBinary() - _ = yym573 - if false { - } else { - r.EncodeInt(int64(x.MinReadySeconds)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq561[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym574 := z.EncBinary() - _ = yym574 - if false { - } else { - r.EncodeInt(int64(x.MinReadySeconds)) - } - } - } if yyr561 || yy2arr561 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -6864,25 +6850,25 @@ func (x *RollingUpdateDeployment) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym575 := z.DecBinary() - _ = yym575 + yym572 := z.DecBinary() + _ = yym572 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct576 := r.ContainerType() - if yyct576 == codecSelferValueTypeMap1234 { - yyl576 := r.ReadMapStart() - if yyl576 == 0 { + yyct573 := r.ContainerType() + if yyct573 == codecSelferValueTypeMap1234 { + yyl573 := r.ReadMapStart() + if yyl573 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl576, d) + x.codecDecodeSelfFromMap(yyl573, d) } - } else if yyct576 == codecSelferValueTypeArray1234 { - yyl576 := r.ReadArrayStart() - if yyl576 == 0 { + } else if yyct573 == codecSelferValueTypeArray1234 { + yyl573 := r.ReadArrayStart() + if yyl573 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl576, d) + x.codecDecodeSelfFromArray(yyl573, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6894,12 +6880,12 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys577Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys577Slc - var yyhl577 bool = l >= 0 - for yyj577 := 0; ; yyj577++ { - if yyhl577 { - if yyj577 >= l { + var yys574Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys574Slc + var yyhl574 bool = l >= 0 + for yyj574 := 0; ; yyj574++ { + if yyhl574 { + if yyj574 >= l { break } } else { @@ -6908,50 +6894,44 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys577Slc = r.DecodeBytes(yys577Slc, true, true) - yys577 := string(yys577Slc) + yys574Slc = r.DecodeBytes(yys574Slc, true, true) + yys574 := string(yys574Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys577 { + switch yys574 { case "maxUnavailable": if r.TryDecodeAsNil() { x.MaxUnavailable = pkg6_intstr.IntOrString{} } else { - yyv578 := &x.MaxUnavailable - yym579 := z.DecBinary() - _ = yym579 + yyv575 := &x.MaxUnavailable + yym576 := z.DecBinary() + _ = yym576 if false { - } else if z.HasExtensions() && z.DecExt(yyv578) { - } else if !yym579 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv578) + } else if z.HasExtensions() && z.DecExt(yyv575) { + } else if !yym576 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv575) } else { - z.DecFallback(yyv578, false) + z.DecFallback(yyv575, false) } } case "maxSurge": if r.TryDecodeAsNil() { x.MaxSurge = pkg6_intstr.IntOrString{} } else { - yyv580 := &x.MaxSurge - yym581 := z.DecBinary() - _ = yym581 + yyv577 := &x.MaxSurge + yym578 := z.DecBinary() + _ = yym578 if false { - } else if z.HasExtensions() && z.DecExt(yyv580) { - } else if !yym581 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv580) + } else if z.HasExtensions() && z.DecExt(yyv577) { + } else if !yym578 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv577) } else { - z.DecFallback(yyv580, false) + z.DecFallback(yyv577, false) } } - case "minReadySeconds": - if r.TryDecodeAsNil() { - x.MinReadySeconds = 0 - } else { - x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } default: - z.DecStructFieldNotFound(-1, yys577) - } // end switch yys577 - } // end for yyj577 + z.DecStructFieldNotFound(-1, yys574) + } // end switch yys574 + } // end for yyj574 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6959,16 +6939,16 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj583 int - var yyb583 bool - var yyhl583 bool = l >= 0 - yyj583++ - if yyhl583 { - yyb583 = yyj583 > l + var yyj579 int + var yyb579 bool + var yyhl579 bool = l >= 0 + yyj579++ + if yyhl579 { + yyb579 = yyj579 > l } else { - yyb583 = r.CheckBreak() + yyb579 = r.CheckBreak() } - if yyb583 { + if yyb579 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6976,24 +6956,24 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.MaxUnavailable = pkg6_intstr.IntOrString{} } else { - yyv584 := &x.MaxUnavailable - yym585 := z.DecBinary() - _ = yym585 + yyv580 := &x.MaxUnavailable + yym581 := z.DecBinary() + _ = yym581 if false { - } else if z.HasExtensions() && z.DecExt(yyv584) { - } else if !yym585 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv584) + } else if z.HasExtensions() && z.DecExt(yyv580) { + } else if !yym581 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv580) } else { - z.DecFallback(yyv584, false) + z.DecFallback(yyv580, false) } } - yyj583++ - if yyhl583 { - yyb583 = yyj583 > l + yyj579++ + if yyhl579 { + yyb579 = yyj579 > l } else { - yyb583 = r.CheckBreak() + yyb579 = r.CheckBreak() } - if yyb583 { + if yyb579 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7001,45 +6981,29 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.MaxSurge = pkg6_intstr.IntOrString{} } else { - yyv586 := &x.MaxSurge - yym587 := z.DecBinary() - _ = yym587 + yyv582 := &x.MaxSurge + yym583 := z.DecBinary() + _ = yym583 if false { - } else if z.HasExtensions() && z.DecExt(yyv586) { - } else if !yym587 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv586) + } else if z.HasExtensions() && z.DecExt(yyv582) { + } else if !yym583 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv582) } else { - z.DecFallback(yyv586, false) + z.DecFallback(yyv582, false) } } - yyj583++ - if yyhl583 { - yyb583 = yyj583 > l - } else { - yyb583 = r.CheckBreak() - } - if yyb583 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MinReadySeconds = 0 - } else { - x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) - } for { - yyj583++ - if yyhl583 { - yyb583 = yyj583 > l + yyj579++ + if yyhl579 { + yyb579 = yyj579 > l } else { - yyb583 = r.CheckBreak() + yyb579 = r.CheckBreak() } - if yyb583 { + if yyb579 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj583-1, "") + z.DecStructFieldNotFound(yyj579-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7051,38 +7015,38 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym589 := z.EncBinary() - _ = yym589 + yym584 := z.EncBinary() + _ = yym584 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep590 := !z.EncBinary() - yy2arr590 := z.EncBasicHandle().StructToArray - var yyq590 [4]bool - _, _, _ = yysep590, yyq590, yy2arr590 - const yyr590 bool = false - yyq590[0] = x.Replicas != 0 - yyq590[1] = x.UpdatedReplicas != 0 - yyq590[2] = x.AvailableReplicas != 0 - yyq590[3] = x.UnavailableReplicas != 0 - var yynn590 int - if yyr590 || yy2arr590 { + yysep585 := !z.EncBinary() + yy2arr585 := z.EncBasicHandle().StructToArray + var yyq585 [4]bool + _, _, _ = yysep585, yyq585, yy2arr585 + const yyr585 bool = false + yyq585[0] = x.Replicas != 0 + yyq585[1] = x.UpdatedReplicas != 0 + yyq585[2] = x.AvailableReplicas != 0 + yyq585[3] = x.UnavailableReplicas != 0 + var yynn585 int + if yyr585 || yy2arr585 { r.EncodeArrayStart(4) } else { - yynn590 = 0 - for _, b := range yyq590 { + yynn585 = 0 + for _, b := range yyq585 { if b { - yynn590++ + yynn585++ } } - r.EncodeMapStart(yynn590) - yynn590 = 0 + r.EncodeMapStart(yynn585) + yynn585 = 0 } - if yyr590 || yy2arr590 { + if yyr585 || yy2arr585 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq590[0] { - yym592 := z.EncBinary() - _ = yym592 + if yyq585[0] { + yym587 := z.EncBinary() + _ = yym587 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -7091,74 +7055,74 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq590[0] { + if yyq585[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym588 := z.EncBinary() + _ = yym588 + if false { + } else { + r.EncodeInt(int64(x.Replicas)) + } + } + } + if yyr585 || yy2arr585 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq585[1] { + yym590 := z.EncBinary() + _ = yym590 + if false { + } else { + r.EncodeInt(int64(x.UpdatedReplicas)) + } + } else { + r.EncodeInt(0) + } + } else { + if yyq585[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("updatedReplicas")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym591 := z.EncBinary() + _ = yym591 + if false { + } else { + r.EncodeInt(int64(x.UpdatedReplicas)) + } + } + } + if yyr585 || yy2arr585 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq585[2] { yym593 := z.EncBinary() _ = yym593 if false { } else { - r.EncodeInt(int64(x.Replicas)) - } - } - } - if yyr590 || yy2arr590 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq590[1] { - yym595 := z.EncBinary() - _ = yym595 - if false { - } else { - r.EncodeInt(int64(x.UpdatedReplicas)) + r.EncodeInt(int64(x.AvailableReplicas)) } } else { r.EncodeInt(0) } } else { - if yyq590[1] { + if yyq585[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("updatedReplicas")) + r.EncodeString(codecSelferC_UTF81234, string("availableReplicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym594 := z.EncBinary() + _ = yym594 + if false { + } else { + r.EncodeInt(int64(x.AvailableReplicas)) + } + } + } + if yyr585 || yy2arr585 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq585[3] { yym596 := z.EncBinary() _ = yym596 if false { - } else { - r.EncodeInt(int64(x.UpdatedReplicas)) - } - } - } - if yyr590 || yy2arr590 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq590[2] { - yym598 := z.EncBinary() - _ = yym598 - if false { - } else { - r.EncodeInt(int64(x.AvailableReplicas)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq590[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("availableReplicas")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym599 := z.EncBinary() - _ = yym599 - if false { - } else { - r.EncodeInt(int64(x.AvailableReplicas)) - } - } - } - if yyr590 || yy2arr590 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq590[3] { - yym601 := z.EncBinary() - _ = yym601 - if false { } else { r.EncodeInt(int64(x.UnavailableReplicas)) } @@ -7166,19 +7130,19 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq590[3] { + if yyq585[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("unavailableReplicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym602 := z.EncBinary() - _ = yym602 + yym597 := z.EncBinary() + _ = yym597 if false { } else { r.EncodeInt(int64(x.UnavailableReplicas)) } } } - if yyr590 || yy2arr590 { + if yyr585 || yy2arr585 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7191,25 +7155,25 @@ func (x *DeploymentStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym603 := z.DecBinary() - _ = yym603 + yym598 := z.DecBinary() + _ = yym598 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct604 := r.ContainerType() - if yyct604 == codecSelferValueTypeMap1234 { - yyl604 := r.ReadMapStart() - if yyl604 == 0 { + yyct599 := r.ContainerType() + if yyct599 == codecSelferValueTypeMap1234 { + yyl599 := r.ReadMapStart() + if yyl599 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl604, d) + x.codecDecodeSelfFromMap(yyl599, d) } - } else if yyct604 == codecSelferValueTypeArray1234 { - yyl604 := r.ReadArrayStart() - if yyl604 == 0 { + } else if yyct599 == codecSelferValueTypeArray1234 { + yyl599 := r.ReadArrayStart() + if yyl599 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl604, d) + x.codecDecodeSelfFromArray(yyl599, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7221,12 +7185,12 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys605Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys605Slc - var yyhl605 bool = l >= 0 - for yyj605 := 0; ; yyj605++ { - if yyhl605 { - if yyj605 >= l { + var yys600Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys600Slc + var yyhl600 bool = l >= 0 + for yyj600 := 0; ; yyj600++ { + if yyhl600 { + if yyj600 >= l { break } } else { @@ -7235,10 +7199,10 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys605Slc = r.DecodeBytes(yys605Slc, true, true) - yys605 := string(yys605Slc) + yys600Slc = r.DecodeBytes(yys600Slc, true, true) + yys600 := string(yys600Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys605 { + switch yys600 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -7264,9 +7228,9 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.UnavailableReplicas = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys605) - } // end switch yys605 - } // end for yyj605 + z.DecStructFieldNotFound(-1, yys600) + } // end switch yys600 + } // end for yyj600 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7274,16 +7238,16 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj610 int - var yyb610 bool - var yyhl610 bool = l >= 0 - yyj610++ - if yyhl610 { - yyb610 = yyj610 > l + var yyj605 int + var yyb605 bool + var yyhl605 bool = l >= 0 + yyj605++ + if yyhl605 { + yyb605 = yyj605 > l } else { - yyb610 = r.CheckBreak() + yyb605 = r.CheckBreak() } - if yyb610 { + if yyb605 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7293,13 +7257,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Replicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj610++ - if yyhl610 { - yyb610 = yyj610 > l + yyj605++ + if yyhl605 { + yyb605 = yyj605 > l } else { - yyb610 = r.CheckBreak() + yyb605 = r.CheckBreak() } - if yyb610 { + if yyb605 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7309,13 +7273,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.UpdatedReplicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj610++ - if yyhl610 { - yyb610 = yyj610 > l + yyj605++ + if yyhl605 { + yyb605 = yyj605 > l } else { - yyb610 = r.CheckBreak() + yyb605 = r.CheckBreak() } - if yyb610 { + if yyb605 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7325,13 +7289,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.AvailableReplicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj610++ - if yyhl610 { - yyb610 = yyj610 > l + yyj605++ + if yyhl605 { + yyb605 = yyj605 > l } else { - yyb610 = r.CheckBreak() + yyb605 = r.CheckBreak() } - if yyb610 { + if yyb605 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7342,17 +7306,17 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.UnavailableReplicas = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj610++ - if yyhl610 { - yyb610 = yyj610 > l + yyj605++ + if yyhl605 { + yyb605 = yyj605 > l } else { - yyb610 = r.CheckBreak() + yyb605 = r.CheckBreak() } - if yyb610 { + if yyb605 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj610-1, "") + z.DecStructFieldNotFound(yyj605-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7364,118 +7328,68 @@ func (x *DeploymentList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym615 := z.EncBinary() - _ = yym615 + yym610 := z.EncBinary() + _ = yym610 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep616 := !z.EncBinary() - yy2arr616 := z.EncBasicHandle().StructToArray - var yyq616 [4]bool - _, _, _ = yysep616, yyq616, yy2arr616 - const yyr616 bool = false - yyq616[0] = x.Kind != "" - yyq616[1] = x.APIVersion != "" - yyq616[2] = true - var yynn616 int - if yyr616 || yy2arr616 { + yysep611 := !z.EncBinary() + yy2arr611 := z.EncBasicHandle().StructToArray + var yyq611 [4]bool + _, _, _ = yysep611, yyq611, yy2arr611 + const yyr611 bool = false + yyq611[0] = true + yyq611[2] = x.Kind != "" + yyq611[3] = x.APIVersion != "" + var yynn611 int + if yyr611 || yy2arr611 { r.EncodeArrayStart(4) } else { - yynn616 = 1 - for _, b := range yyq616 { + yynn611 = 1 + for _, b := range yyq611 { if b { - yynn616++ + yynn611++ } } - r.EncodeMapStart(yynn616) - yynn616 = 0 + r.EncodeMapStart(yynn611) + yynn611 = 0 } - if yyr616 || yy2arr616 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq616[0] { - yym618 := z.EncBinary() - _ = yym618 + if yyq611[0] { + yy613 := &x.ListMeta + yym614 := z.EncBinary() + _ = yym614 if false { + } else if z.HasExtensions() && z.EncExt(yy613) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq616[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym619 := z.EncBinary() - _ = yym619 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr616 || yy2arr616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq616[1] { - yym621 := z.EncBinary() - _ = yym621 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq616[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym622 := z.EncBinary() - _ = yym622 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr616 || yy2arr616 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq616[2] { - yy624 := &x.ListMeta - yym625 := z.EncBinary() - _ = yym625 - if false { - } else if z.HasExtensions() && z.EncExt(yy624) { - } else { - z.EncFallback(yy624) + z.EncFallback(yy613) } } else { r.EncodeNil() } } else { - if yyq616[2] { + if yyq611[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy626 := &x.ListMeta - yym627 := z.EncBinary() - _ = yym627 + yy615 := &x.ListMeta + yym616 := z.EncBinary() + _ = yym616 if false { - } else if z.HasExtensions() && z.EncExt(yy626) { + } else if z.HasExtensions() && z.EncExt(yy615) { } else { - z.EncFallback(yy626) + z.EncFallback(yy615) } } } - if yyr616 || yy2arr616 { + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym629 := z.EncBinary() - _ = yym629 + yym618 := z.EncBinary() + _ = yym618 if false { } else { h.encSliceDeployment(([]Deployment)(x.Items), e) @@ -7488,15 +7402,65 @@ func (x *DeploymentList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym630 := z.EncBinary() - _ = yym630 + yym619 := z.EncBinary() + _ = yym619 if false { } else { h.encSliceDeployment(([]Deployment)(x.Items), e) } } } - if yyr616 || yy2arr616 { + if yyr611 || yy2arr611 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq611[2] { + yym621 := z.EncBinary() + _ = yym621 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq611[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym622 := z.EncBinary() + _ = yym622 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr611 || yy2arr611 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq611[3] { + yym624 := z.EncBinary() + _ = yym624 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq611[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym625 := z.EncBinary() + _ = yym625 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr611 || yy2arr611 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7509,25 +7473,25 @@ func (x *DeploymentList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym631 := z.DecBinary() - _ = yym631 + yym626 := z.DecBinary() + _ = yym626 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct632 := r.ContainerType() - if yyct632 == codecSelferValueTypeMap1234 { - yyl632 := r.ReadMapStart() - if yyl632 == 0 { + yyct627 := r.ContainerType() + if yyct627 == codecSelferValueTypeMap1234 { + yyl627 := r.ReadMapStart() + if yyl627 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl632, d) + x.codecDecodeSelfFromMap(yyl627, d) } - } else if yyct632 == codecSelferValueTypeArray1234 { - yyl632 := r.ReadArrayStart() - if yyl632 == 0 { + } else if yyct627 == codecSelferValueTypeArray1234 { + yyl627 := r.ReadArrayStart() + if yyl627 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl632, d) + x.codecDecodeSelfFromArray(yyl627, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7539,12 +7503,12 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys633Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys633Slc - var yyhl633 bool = l >= 0 - for yyj633 := 0; ; yyj633++ { - if yyhl633 { - if yyj633 >= l { + var yys628Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys628Slc + var yyhl628 bool = l >= 0 + for yyj628 := 0; ; yyj628++ { + if yyhl628 { + if yyj628 >= l { break } } else { @@ -7553,10 +7517,35 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys633Slc = r.DecodeBytes(yys633Slc, true, true) - yys633 := string(yys633Slc) + yys628Slc = r.DecodeBytes(yys628Slc, true, true) + yys628 := string(yys628Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys633 { + switch yys628 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv629 := &x.ListMeta + yym630 := z.DecBinary() + _ = yym630 + if false { + } else if z.HasExtensions() && z.DecExt(yyv629) { + } else { + z.DecFallback(yyv629, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv631 := &x.Items + yym632 := z.DecBinary() + _ = yym632 + if false { + } else { + h.decSliceDeployment((*[]Deployment)(yyv631), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -7569,35 +7558,10 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv636 := &x.ListMeta - yym637 := z.DecBinary() - _ = yym637 - if false { - } else if z.HasExtensions() && z.DecExt(yyv636) { - } else { - z.DecFallback(yyv636, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv638 := &x.Items - yym639 := z.DecBinary() - _ = yym639 - if false { - } else { - h.decSliceDeployment((*[]Deployment)(yyv638), d) - } - } default: - z.DecStructFieldNotFound(-1, yys633) - } // end switch yys633 - } // end for yyj633 + z.DecStructFieldNotFound(-1, yys628) + } // end switch yys628 + } // end for yyj628 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7605,16 +7569,61 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj640 int - var yyb640 bool - var yyhl640 bool = l >= 0 - yyj640++ - if yyhl640 { - yyb640 = yyj640 > l + var yyj635 int + var yyb635 bool + var yyhl635 bool = l >= 0 + yyj635++ + if yyhl635 { + yyb635 = yyj635 > l } else { - yyb640 = r.CheckBreak() + yyb635 = r.CheckBreak() } - if yyb640 { + if yyb635 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv636 := &x.ListMeta + yym637 := z.DecBinary() + _ = yym637 + if false { + } else if z.HasExtensions() && z.DecExt(yyv636) { + } else { + z.DecFallback(yyv636, false) + } + } + yyj635++ + if yyhl635 { + yyb635 = yyj635 > l + } else { + yyb635 = r.CheckBreak() + } + if yyb635 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv638 := &x.Items + yym639 := z.DecBinary() + _ = yym639 + if false { + } else { + h.decSliceDeployment((*[]Deployment)(yyv638), d) + } + } + yyj635++ + if yyhl635 { + yyb635 = yyj635 > l + } else { + yyb635 = r.CheckBreak() + } + if yyb635 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7624,13 +7633,13 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj640++ - if yyhl640 { - yyb640 = yyj640 > l + yyj635++ + if yyhl635 { + yyb635 = yyj635 > l } else { - yyb640 = r.CheckBreak() + yyb635 = r.CheckBreak() } - if yyb640 { + if yyb635 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7640,63 +7649,18 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj640++ - if yyhl640 { - yyb640 = yyj640 > l - } else { - yyb640 = r.CheckBreak() - } - if yyb640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv643 := &x.ListMeta - yym644 := z.DecBinary() - _ = yym644 - if false { - } else if z.HasExtensions() && z.DecExt(yyv643) { - } else { - z.DecFallback(yyv643, false) - } - } - yyj640++ - if yyhl640 { - yyb640 = yyj640 > l - } else { - yyb640 = r.CheckBreak() - } - if yyb640 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv645 := &x.Items - yym646 := z.DecBinary() - _ = yym646 - if false { - } else { - h.decSliceDeployment((*[]Deployment)(yyv645), d) - } - } for { - yyj640++ - if yyhl640 { - yyb640 = yyj640 > l + yyj635++ + if yyhl635 { + yyb635 = yyj635 > l } else { - yyb640 = r.CheckBreak() + yyb635 = r.CheckBreak() } - if yyb640 { + if yyb635 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj640-1, "") + z.DecStructFieldNotFound(yyj635-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7708,49 +7672,49 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym647 := z.EncBinary() - _ = yym647 + yym642 := z.EncBinary() + _ = yym642 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep648 := !z.EncBinary() - yy2arr648 := z.EncBasicHandle().StructToArray - var yyq648 [2]bool - _, _, _ = yysep648, yyq648, yy2arr648 - const yyr648 bool = false - yyq648[0] = x.Type != "" - yyq648[1] = x.RollingUpdate != nil - var yynn648 int - if yyr648 || yy2arr648 { + yysep643 := !z.EncBinary() + yy2arr643 := z.EncBasicHandle().StructToArray + var yyq643 [2]bool + _, _, _ = yysep643, yyq643, yy2arr643 + const yyr643 bool = false + yyq643[0] = x.Type != "" + yyq643[1] = x.RollingUpdate != nil + var yynn643 int + if yyr643 || yy2arr643 { r.EncodeArrayStart(2) } else { - yynn648 = 0 - for _, b := range yyq648 { + yynn643 = 0 + for _, b := range yyq643 { if b { - yynn648++ + yynn643++ } } - r.EncodeMapStart(yynn648) - yynn648 = 0 + r.EncodeMapStart(yynn643) + yynn643 = 0 } - if yyr648 || yy2arr648 { + if yyr643 || yy2arr643 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq648[0] { + if yyq643[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq648[0] { + if yyq643[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr648 || yy2arr648 { + if yyr643 || yy2arr643 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq648[1] { + if yyq643[1] { if x.RollingUpdate == nil { r.EncodeNil() } else { @@ -7760,7 +7724,7 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq648[1] { + if yyq643[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rollingUpdate")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -7771,7 +7735,7 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr648 || yy2arr648 { + if yyr643 || yy2arr643 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7784,25 +7748,25 @@ func (x *DaemonSetUpdateStrategy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym651 := z.DecBinary() - _ = yym651 + yym646 := z.DecBinary() + _ = yym646 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct652 := r.ContainerType() - if yyct652 == codecSelferValueTypeMap1234 { - yyl652 := r.ReadMapStart() - if yyl652 == 0 { + yyct647 := r.ContainerType() + if yyct647 == codecSelferValueTypeMap1234 { + yyl647 := r.ReadMapStart() + if yyl647 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl652, d) + x.codecDecodeSelfFromMap(yyl647, d) } - } else if yyct652 == codecSelferValueTypeArray1234 { - yyl652 := r.ReadArrayStart() - if yyl652 == 0 { + } else if yyct647 == codecSelferValueTypeArray1234 { + yyl647 := r.ReadArrayStart() + if yyl647 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl652, d) + x.codecDecodeSelfFromArray(yyl647, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7814,12 +7778,12 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys653Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys653Slc - var yyhl653 bool = l >= 0 - for yyj653 := 0; ; yyj653++ { - if yyhl653 { - if yyj653 >= l { + var yys648Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys648Slc + var yyhl648 bool = l >= 0 + for yyj648 := 0; ; yyj648++ { + if yyhl648 { + if yyj648 >= l { break } } else { @@ -7828,10 +7792,10 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys653Slc = r.DecodeBytes(yys653Slc, true, true) - yys653 := string(yys653Slc) + yys648Slc = r.DecodeBytes(yys648Slc, true, true) + yys648 := string(yys648Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys653 { + switch yys648 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -7850,9 +7814,9 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec x.RollingUpdate.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys653) - } // end switch yys653 - } // end for yyj653 + z.DecStructFieldNotFound(-1, yys648) + } // end switch yys648 + } // end for yyj648 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7860,16 +7824,16 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj656 int - var yyb656 bool - var yyhl656 bool = l >= 0 - yyj656++ - if yyhl656 { - yyb656 = yyj656 > l + var yyj651 int + var yyb651 bool + var yyhl651 bool = l >= 0 + yyj651++ + if yyhl651 { + yyb651 = yyj651 > l } else { - yyb656 = r.CheckBreak() + yyb651 = r.CheckBreak() } - if yyb656 { + if yyb651 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7879,13 +7843,13 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.Type = DaemonSetUpdateStrategyType(r.DecodeString()) } - yyj656++ - if yyhl656 { - yyb656 = yyj656 > l + yyj651++ + if yyhl651 { + yyb651 = yyj651 > l } else { - yyb656 = r.CheckBreak() + yyb651 = r.CheckBreak() } - if yyb656 { + if yyb651 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7901,17 +7865,17 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D x.RollingUpdate.CodecDecodeSelf(d) } for { - yyj656++ - if yyhl656 { - yyb656 = yyj656 > l + yyj651++ + if yyhl651 { + yyb651 = yyj651 > l } else { - yyb656 = r.CheckBreak() + yyb651 = r.CheckBreak() } - if yyb656 { + if yyb651 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj656-1, "") + z.DecStructFieldNotFound(yyj651-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7920,8 +7884,8 @@ func (x DaemonSetUpdateStrategyType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym659 := z.EncBinary() - _ = yym659 + yym654 := z.EncBinary() + _ = yym654 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -7933,8 +7897,8 @@ func (x *DaemonSetUpdateStrategyType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym660 := z.DecBinary() - _ = yym660 + yym655 := z.DecBinary() + _ = yym655 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -7949,69 +7913,69 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym661 := z.EncBinary() - _ = yym661 + yym656 := z.EncBinary() + _ = yym656 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep662 := !z.EncBinary() - yy2arr662 := z.EncBasicHandle().StructToArray - var yyq662 [2]bool - _, _, _ = yysep662, yyq662, yy2arr662 - const yyr662 bool = false - yyq662[0] = true - yyq662[1] = x.MinReadySeconds != 0 - var yynn662 int - if yyr662 || yy2arr662 { + yysep657 := !z.EncBinary() + yy2arr657 := z.EncBasicHandle().StructToArray + var yyq657 [2]bool + _, _, _ = yysep657, yyq657, yy2arr657 + const yyr657 bool = false + yyq657[0] = true + yyq657[1] = x.MinReadySeconds != 0 + var yynn657 int + if yyr657 || yy2arr657 { r.EncodeArrayStart(2) } else { - yynn662 = 0 - for _, b := range yyq662 { + yynn657 = 0 + for _, b := range yyq657 { if b { - yynn662++ + yynn657++ } } - r.EncodeMapStart(yynn662) - yynn662 = 0 + r.EncodeMapStart(yynn657) + yynn657 = 0 } - if yyr662 || yy2arr662 { + if yyr657 || yy2arr657 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq662[0] { - yy664 := &x.MaxUnavailable - yym665 := z.EncBinary() - _ = yym665 + if yyq657[0] { + yy659 := &x.MaxUnavailable + yym660 := z.EncBinary() + _ = yym660 if false { - } else if z.HasExtensions() && z.EncExt(yy664) { - } else if !yym665 && z.IsJSONHandle() { - z.EncJSONMarshal(yy664) + } else if z.HasExtensions() && z.EncExt(yy659) { + } else if !yym660 && z.IsJSONHandle() { + z.EncJSONMarshal(yy659) } else { - z.EncFallback(yy664) + z.EncFallback(yy659) } } else { r.EncodeNil() } } else { - if yyq662[0] { + if yyq657[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxUnavailable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy666 := &x.MaxUnavailable - yym667 := z.EncBinary() - _ = yym667 + yy661 := &x.MaxUnavailable + yym662 := z.EncBinary() + _ = yym662 if false { - } else if z.HasExtensions() && z.EncExt(yy666) { - } else if !yym667 && z.IsJSONHandle() { - z.EncJSONMarshal(yy666) + } else if z.HasExtensions() && z.EncExt(yy661) { + } else if !yym662 && z.IsJSONHandle() { + z.EncJSONMarshal(yy661) } else { - z.EncFallback(yy666) + z.EncFallback(yy661) } } } - if yyr662 || yy2arr662 { + if yyr657 || yy2arr657 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq662[1] { - yym669 := z.EncBinary() - _ = yym669 + if yyq657[1] { + yym664 := z.EncBinary() + _ = yym664 if false { } else { r.EncodeInt(int64(x.MinReadySeconds)) @@ -8020,19 +7984,19 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq662[1] { + if yyq657[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym670 := z.EncBinary() - _ = yym670 + yym665 := z.EncBinary() + _ = yym665 if false { } else { r.EncodeInt(int64(x.MinReadySeconds)) } } } - if yyr662 || yy2arr662 { + if yyr657 || yy2arr657 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8045,25 +8009,25 @@ func (x *RollingUpdateDaemonSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym671 := z.DecBinary() - _ = yym671 + yym666 := z.DecBinary() + _ = yym666 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct672 := r.ContainerType() - if yyct672 == codecSelferValueTypeMap1234 { - yyl672 := r.ReadMapStart() - if yyl672 == 0 { + yyct667 := r.ContainerType() + if yyct667 == codecSelferValueTypeMap1234 { + yyl667 := r.ReadMapStart() + if yyl667 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl672, d) + x.codecDecodeSelfFromMap(yyl667, d) } - } else if yyct672 == codecSelferValueTypeArray1234 { - yyl672 := r.ReadArrayStart() - if yyl672 == 0 { + } else if yyct667 == codecSelferValueTypeArray1234 { + yyl667 := r.ReadArrayStart() + if yyl667 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl672, d) + x.codecDecodeSelfFromArray(yyl667, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8075,12 +8039,12 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys673Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys673Slc - var yyhl673 bool = l >= 0 - for yyj673 := 0; ; yyj673++ { - if yyhl673 { - if yyj673 >= l { + var yys668Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys668Slc + var yyhl668 bool = l >= 0 + for yyj668 := 0; ; yyj668++ { + if yyhl668 { + if yyj668 >= l { break } } else { @@ -8089,23 +8053,23 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys673Slc = r.DecodeBytes(yys673Slc, true, true) - yys673 := string(yys673Slc) + yys668Slc = r.DecodeBytes(yys668Slc, true, true) + yys668 := string(yys668Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys673 { + switch yys668 { case "maxUnavailable": if r.TryDecodeAsNil() { x.MaxUnavailable = pkg6_intstr.IntOrString{} } else { - yyv674 := &x.MaxUnavailable - yym675 := z.DecBinary() - _ = yym675 + yyv669 := &x.MaxUnavailable + yym670 := z.DecBinary() + _ = yym670 if false { - } else if z.HasExtensions() && z.DecExt(yyv674) { - } else if !yym675 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv674) + } else if z.HasExtensions() && z.DecExt(yyv669) { + } else if !yym670 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv669) } else { - z.DecFallback(yyv674, false) + z.DecFallback(yyv669, false) } } case "minReadySeconds": @@ -8115,9 +8079,9 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys673) - } // end switch yys673 - } // end for yyj673 + z.DecStructFieldNotFound(-1, yys668) + } // end switch yys668 + } // end for yyj668 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8125,16 +8089,16 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj677 int - var yyb677 bool - var yyhl677 bool = l >= 0 - yyj677++ - if yyhl677 { - yyb677 = yyj677 > l + var yyj672 int + var yyb672 bool + var yyhl672 bool = l >= 0 + yyj672++ + if yyhl672 { + yyb672 = yyj672 > l } else { - yyb677 = r.CheckBreak() + yyb672 = r.CheckBreak() } - if yyb677 { + if yyb672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8142,24 +8106,24 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De if r.TryDecodeAsNil() { x.MaxUnavailable = pkg6_intstr.IntOrString{} } else { - yyv678 := &x.MaxUnavailable - yym679 := z.DecBinary() - _ = yym679 + yyv673 := &x.MaxUnavailable + yym674 := z.DecBinary() + _ = yym674 if false { - } else if z.HasExtensions() && z.DecExt(yyv678) { - } else if !yym679 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv678) + } else if z.HasExtensions() && z.DecExt(yyv673) { + } else if !yym674 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv673) } else { - z.DecFallback(yyv678, false) + z.DecFallback(yyv673, false) } } - yyj677++ - if yyhl677 { - yyb677 = yyj677 > l + yyj672++ + if yyhl672 { + yyb672 = yyj672 > l } else { - yyb677 = r.CheckBreak() + yyb672 = r.CheckBreak() } - if yyb677 { + if yyb672 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8170,17 +8134,17 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De x.MinReadySeconds = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj677++ - if yyhl677 { - yyb677 = yyj677 > l + yyj672++ + if yyhl672 { + yyb672 = yyj672 > l } else { - yyb677 = r.CheckBreak() + yyb672 = r.CheckBreak() } - if yyb677 { + if yyb672 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj677-1, "") + z.DecStructFieldNotFound(yyj672-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8192,88 +8156,100 @@ func (x *DaemonSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym681 := z.EncBinary() - _ = yym681 + yym676 := z.EncBinary() + _ = yym676 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep682 := !z.EncBinary() - yy2arr682 := z.EncBasicHandle().StructToArray - var yyq682 [4]bool - _, _, _ = yysep682, yyq682, yy2arr682 - const yyr682 bool = false - yyq682[0] = x.Selector != nil - yyq682[2] = true - yyq682[3] = x.UniqueLabelKey != "" - var yynn682 int - if yyr682 || yy2arr682 { + yysep677 := !z.EncBinary() + yy2arr677 := z.EncBasicHandle().StructToArray + var yyq677 [4]bool + _, _, _ = yysep677, yyq677, yy2arr677 + const yyr677 bool = false + yyq677[0] = x.Selector != nil + yyq677[2] = true + yyq677[3] = x.UniqueLabelKey != "" + var yynn677 int + if yyr677 || yy2arr677 { r.EncodeArrayStart(4) } else { - yynn682 = 1 - for _, b := range yyq682 { + yynn677 = 1 + for _, b := range yyq677 { if b { - yynn682++ + yynn677++ } } - r.EncodeMapStart(yynn682) - yynn682 = 0 + r.EncodeMapStart(yynn677) + yynn677 = 0 } - if yyr682 || yy2arr682 { + if yyr677 || yy2arr677 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq682[0] { + if yyq677[0] { if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym679 := z.EncBinary() + _ = yym679 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } else { r.EncodeNil() } } else { - if yyq682[0] { + if yyq677[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym680 := z.EncBinary() + _ = yym680 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } } - if yyr682 || yy2arr682 { + if yyr677 || yy2arr677 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy685 := &x.Template - yy685.CodecEncodeSelf(e) + yy682 := &x.Template + yy682.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy686 := &x.Template - yy686.CodecEncodeSelf(e) + yy683 := &x.Template + yy683.CodecEncodeSelf(e) } - if yyr682 || yy2arr682 { + if yyr677 || yy2arr677 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq682[2] { - yy688 := &x.UpdateStrategy - yy688.CodecEncodeSelf(e) + if yyq677[2] { + yy685 := &x.UpdateStrategy + yy685.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq682[2] { + if yyq677[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("updateStrategy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy689 := &x.UpdateStrategy - yy689.CodecEncodeSelf(e) + yy686 := &x.UpdateStrategy + yy686.CodecEncodeSelf(e) } } - if yyr682 || yy2arr682 { + if yyr677 || yy2arr677 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq682[3] { - yym691 := z.EncBinary() - _ = yym691 + if yyq677[3] { + yym688 := z.EncBinary() + _ = yym688 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.UniqueLabelKey)) @@ -8282,19 +8258,19 @@ func (x *DaemonSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq682[3] { + if yyq677[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("uniqueLabelKey")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym692 := z.EncBinary() - _ = yym692 + yym689 := z.EncBinary() + _ = yym689 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.UniqueLabelKey)) } } } - if yyr682 || yy2arr682 { + if yyr677 || yy2arr677 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8307,25 +8283,25 @@ func (x *DaemonSetSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym693 := z.DecBinary() - _ = yym693 + yym690 := z.DecBinary() + _ = yym690 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct694 := r.ContainerType() - if yyct694 == codecSelferValueTypeMap1234 { - yyl694 := r.ReadMapStart() - if yyl694 == 0 { + yyct691 := r.ContainerType() + if yyct691 == codecSelferValueTypeMap1234 { + yyl691 := r.ReadMapStart() + if yyl691 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl694, d) + x.codecDecodeSelfFromMap(yyl691, d) } - } else if yyct694 == codecSelferValueTypeArray1234 { - yyl694 := r.ReadArrayStart() - if yyl694 == 0 { + } else if yyct691 == codecSelferValueTypeArray1234 { + yyl691 := r.ReadArrayStart() + if yyl691 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl694, d) + x.codecDecodeSelfFromArray(yyl691, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8337,12 +8313,12 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys695Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys695Slc - var yyhl695 bool = l >= 0 - for yyj695 := 0; ; yyj695++ { - if yyhl695 { - if yyj695 >= l { + var yys692Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys692Slc + var yyhl692 bool = l >= 0 + for yyj692 := 0; ; yyj692++ { + if yyhl692 { + if yyj692 >= l { break } } else { @@ -8351,10 +8327,10 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys695Slc = r.DecodeBytes(yys695Slc, true, true) - yys695 := string(yys695Slc) + yys692Slc = r.DecodeBytes(yys692Slc, true, true) + yys692 := string(yys692Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys695 { + switch yys692 { case "selector": if r.TryDecodeAsNil() { if x.Selector != nil { @@ -8362,23 +8338,29 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym694 := z.DecBinary() + _ = yym694 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } case "template": if r.TryDecodeAsNil() { x.Template = pkg2_api.PodTemplateSpec{} } else { - yyv697 := &x.Template - yyv697.CodecDecodeSelf(d) + yyv695 := &x.Template + yyv695.CodecDecodeSelf(d) } case "updateStrategy": if r.TryDecodeAsNil() { x.UpdateStrategy = DaemonSetUpdateStrategy{} } else { - yyv698 := &x.UpdateStrategy - yyv698.CodecDecodeSelf(d) + yyv696 := &x.UpdateStrategy + yyv696.CodecDecodeSelf(d) } case "uniqueLabelKey": if r.TryDecodeAsNil() { @@ -8387,9 +8369,9 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.UniqueLabelKey = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys695) - } // end switch yys695 - } // end for yyj695 + z.DecStructFieldNotFound(-1, yys692) + } // end switch yys692 + } // end for yyj692 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8397,16 +8379,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj700 int - var yyb700 bool - var yyhl700 bool = l >= 0 - yyj700++ - if yyhl700 { - yyb700 = yyj700 > l + var yyj698 int + var yyb698 bool + var yyhl698 bool = l >= 0 + yyj698++ + if yyhl698 { + yyb698 = yyj698 > l } else { - yyb700 = r.CheckBreak() + yyb698 = r.CheckBreak() } - if yyb700 { + if yyb698 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8417,17 +8399,23 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym700 := z.DecBinary() + _ = yym700 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } - yyj700++ - if yyhl700 { - yyb700 = yyj700 > l + yyj698++ + if yyhl698 { + yyb698 = yyj698 > l } else { - yyb700 = r.CheckBreak() + yyb698 = r.CheckBreak() } - if yyb700 { + if yyb698 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8435,16 +8423,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_api.PodTemplateSpec{} } else { - yyv702 := &x.Template - yyv702.CodecDecodeSelf(d) + yyv701 := &x.Template + yyv701.CodecDecodeSelf(d) } - yyj700++ - if yyhl700 { - yyb700 = yyj700 > l + yyj698++ + if yyhl698 { + yyb698 = yyj698 > l } else { - yyb700 = r.CheckBreak() + yyb698 = r.CheckBreak() } - if yyb700 { + if yyb698 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8452,16 +8440,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.UpdateStrategy = DaemonSetUpdateStrategy{} } else { - yyv703 := &x.UpdateStrategy - yyv703.CodecDecodeSelf(d) + yyv702 := &x.UpdateStrategy + yyv702.CodecDecodeSelf(d) } - yyj700++ - if yyhl700 { - yyb700 = yyj700 > l + yyj698++ + if yyhl698 { + yyb698 = yyj698 > l } else { - yyb700 = r.CheckBreak() + yyb698 = r.CheckBreak() } - if yyb700 { + if yyb698 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8472,17 +8460,17 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.UniqueLabelKey = string(r.DecodeString()) } for { - yyj700++ - if yyhl700 { - yyb700 = yyj700 > l + yyj698++ + if yyhl698 { + yyb698 = yyj698 > l } else { - yyb700 = r.CheckBreak() + yyb698 = r.CheckBreak() } - if yyb700 { + if yyb698 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj700-1, "") + z.DecStructFieldNotFound(yyj698-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8494,33 +8482,33 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym705 := z.EncBinary() - _ = yym705 + yym704 := z.EncBinary() + _ = yym704 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep706 := !z.EncBinary() - yy2arr706 := z.EncBasicHandle().StructToArray - var yyq706 [3]bool - _, _, _ = yysep706, yyq706, yy2arr706 - const yyr706 bool = false - var yynn706 int - if yyr706 || yy2arr706 { + yysep705 := !z.EncBinary() + yy2arr705 := z.EncBasicHandle().StructToArray + var yyq705 [3]bool + _, _, _ = yysep705, yyq705, yy2arr705 + const yyr705 bool = false + var yynn705 int + if yyr705 || yy2arr705 { r.EncodeArrayStart(3) } else { - yynn706 = 3 - for _, b := range yyq706 { + yynn705 = 3 + for _, b := range yyq705 { if b { - yynn706++ + yynn705++ } } - r.EncodeMapStart(yynn706) - yynn706 = 0 + r.EncodeMapStart(yynn705) + yynn705 = 0 } - if yyr706 || yy2arr706 { + if yyr705 || yy2arr705 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym708 := z.EncBinary() - _ = yym708 + yym707 := z.EncBinary() + _ = yym707 if false { } else { r.EncodeInt(int64(x.CurrentNumberScheduled)) @@ -8529,17 +8517,17 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("currentNumberScheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym709 := z.EncBinary() - _ = yym709 + yym708 := z.EncBinary() + _ = yym708 if false { } else { r.EncodeInt(int64(x.CurrentNumberScheduled)) } } - if yyr706 || yy2arr706 { + if yyr705 || yy2arr705 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym711 := z.EncBinary() - _ = yym711 + yym710 := z.EncBinary() + _ = yym710 if false { } else { r.EncodeInt(int64(x.NumberMisscheduled)) @@ -8548,17 +8536,17 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("numberMisscheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym712 := z.EncBinary() - _ = yym712 + yym711 := z.EncBinary() + _ = yym711 if false { } else { r.EncodeInt(int64(x.NumberMisscheduled)) } } - if yyr706 || yy2arr706 { + if yyr705 || yy2arr705 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym714 := z.EncBinary() - _ = yym714 + yym713 := z.EncBinary() + _ = yym713 if false { } else { r.EncodeInt(int64(x.DesiredNumberScheduled)) @@ -8567,14 +8555,14 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("desiredNumberScheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym715 := z.EncBinary() - _ = yym715 + yym714 := z.EncBinary() + _ = yym714 if false { } else { r.EncodeInt(int64(x.DesiredNumberScheduled)) } } - if yyr706 || yy2arr706 { + if yyr705 || yy2arr705 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8587,25 +8575,25 @@ func (x *DaemonSetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym716 := z.DecBinary() - _ = yym716 + yym715 := z.DecBinary() + _ = yym715 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct717 := r.ContainerType() - if yyct717 == codecSelferValueTypeMap1234 { - yyl717 := r.ReadMapStart() - if yyl717 == 0 { + yyct716 := r.ContainerType() + if yyct716 == codecSelferValueTypeMap1234 { + yyl716 := r.ReadMapStart() + if yyl716 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl717, d) + x.codecDecodeSelfFromMap(yyl716, d) } - } else if yyct717 == codecSelferValueTypeArray1234 { - yyl717 := r.ReadArrayStart() - if yyl717 == 0 { + } else if yyct716 == codecSelferValueTypeArray1234 { + yyl716 := r.ReadArrayStart() + if yyl716 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl717, d) + x.codecDecodeSelfFromArray(yyl716, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8617,12 +8605,12 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys718Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys718Slc - var yyhl718 bool = l >= 0 - for yyj718 := 0; ; yyj718++ { - if yyhl718 { - if yyj718 >= l { + var yys717Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys717Slc + var yyhl717 bool = l >= 0 + for yyj717 := 0; ; yyj717++ { + if yyhl717 { + if yyj717 >= l { break } } else { @@ -8631,10 +8619,10 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys718Slc = r.DecodeBytes(yys718Slc, true, true) - yys718 := string(yys718Slc) + yys717Slc = r.DecodeBytes(yys717Slc, true, true) + yys717 := string(yys717Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys718 { + switch yys717 { case "currentNumberScheduled": if r.TryDecodeAsNil() { x.CurrentNumberScheduled = 0 @@ -8654,9 +8642,9 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.DesiredNumberScheduled = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys718) - } // end switch yys718 - } // end for yyj718 + z.DecStructFieldNotFound(-1, yys717) + } // end switch yys717 + } // end for yyj717 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8664,16 +8652,16 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj722 int - var yyb722 bool - var yyhl722 bool = l >= 0 - yyj722++ - if yyhl722 { - yyb722 = yyj722 > l + var yyj721 int + var yyb721 bool + var yyhl721 bool = l >= 0 + yyj721++ + if yyhl721 { + yyb721 = yyj721 > l } else { - yyb722 = r.CheckBreak() + yyb721 = r.CheckBreak() } - if yyb722 { + if yyb721 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8683,13 +8671,13 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.CurrentNumberScheduled = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj722++ - if yyhl722 { - yyb722 = yyj722 > l + yyj721++ + if yyhl721 { + yyb721 = yyj721 > l } else { - yyb722 = r.CheckBreak() + yyb721 = r.CheckBreak() } - if yyb722 { + if yyb721 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8699,13 +8687,13 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.NumberMisscheduled = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj722++ - if yyhl722 { - yyb722 = yyj722 > l + yyj721++ + if yyhl721 { + yyb721 = yyj721 > l } else { - yyb722 = r.CheckBreak() + yyb721 = r.CheckBreak() } - if yyb722 { + if yyb721 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8716,17 +8704,17 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.DesiredNumberScheduled = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj722++ - if yyhl722 { - yyb722 = yyj722 > l + yyj721++ + if yyhl721 { + yyb721 = yyj721 > l } else { - yyb722 = r.CheckBreak() + yyb721 = r.CheckBreak() } - if yyb722 { + if yyb721 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj722-1, "") + z.DecStructFieldNotFound(yyj721-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8738,136 +8726,136 @@ func (x *DaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym726 := z.EncBinary() - _ = yym726 + yym725 := z.EncBinary() + _ = yym725 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep727 := !z.EncBinary() - yy2arr727 := z.EncBasicHandle().StructToArray - var yyq727 [5]bool - _, _, _ = yysep727, yyq727, yy2arr727 - const yyr727 bool = false - yyq727[0] = x.Kind != "" - yyq727[1] = x.APIVersion != "" - yyq727[2] = true - yyq727[3] = true - yyq727[4] = true - var yynn727 int - if yyr727 || yy2arr727 { + yysep726 := !z.EncBinary() + yy2arr726 := z.EncBasicHandle().StructToArray + var yyq726 [5]bool + _, _, _ = yysep726, yyq726, yy2arr726 + const yyr726 bool = false + yyq726[0] = true + yyq726[1] = true + yyq726[2] = true + yyq726[3] = x.Kind != "" + yyq726[4] = x.APIVersion != "" + var yynn726 int + if yyr726 || yy2arr726 { r.EncodeArrayStart(5) } else { - yynn727 = 0 - for _, b := range yyq727 { + yynn726 = 0 + for _, b := range yyq726 { if b { - yynn727++ + yynn726++ } } - r.EncodeMapStart(yynn727) - yynn727 = 0 + r.EncodeMapStart(yynn726) + yynn726 = 0 } - if yyr727 || yy2arr727 { + if yyr726 || yy2arr726 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq727[0] { - yym729 := z.EncBinary() - _ = yym729 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq727[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym730 := z.EncBinary() - _ = yym730 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr727 || yy2arr727 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq727[1] { - yym732 := z.EncBinary() - _ = yym732 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq727[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym733 := z.EncBinary() - _ = yym733 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr727 || yy2arr727 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq727[2] { - yy735 := &x.ObjectMeta - yy735.CodecEncodeSelf(e) + if yyq726[0] { + yy728 := &x.ObjectMeta + yy728.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq727[2] { + if yyq726[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy736 := &x.ObjectMeta - yy736.CodecEncodeSelf(e) + yy729 := &x.ObjectMeta + yy729.CodecEncodeSelf(e) } } - if yyr727 || yy2arr727 { + if yyr726 || yy2arr726 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq727[3] { - yy738 := &x.Spec - yy738.CodecEncodeSelf(e) + if yyq726[1] { + yy731 := &x.Spec + yy731.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq727[3] { + if yyq726[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy739 := &x.Spec - yy739.CodecEncodeSelf(e) + yy732 := &x.Spec + yy732.CodecEncodeSelf(e) } } - if yyr727 || yy2arr727 { + if yyr726 || yy2arr726 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq727[4] { - yy741 := &x.Status - yy741.CodecEncodeSelf(e) + if yyq726[2] { + yy734 := &x.Status + yy734.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq727[4] { + if yyq726[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy742 := &x.Status - yy742.CodecEncodeSelf(e) + yy735 := &x.Status + yy735.CodecEncodeSelf(e) } } - if yyr727 || yy2arr727 { + if yyr726 || yy2arr726 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq726[3] { + yym737 := z.EncBinary() + _ = yym737 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq726[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym738 := z.EncBinary() + _ = yym738 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr726 || yy2arr726 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq726[4] { + yym740 := z.EncBinary() + _ = yym740 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq726[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym741 := z.EncBinary() + _ = yym741 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr726 || yy2arr726 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8880,25 +8868,25 @@ func (x *DaemonSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym743 := z.DecBinary() - _ = yym743 + yym742 := z.DecBinary() + _ = yym742 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct744 := r.ContainerType() - if yyct744 == codecSelferValueTypeMap1234 { - yyl744 := r.ReadMapStart() - if yyl744 == 0 { + yyct743 := r.ContainerType() + if yyct743 == codecSelferValueTypeMap1234 { + yyl743 := r.ReadMapStart() + if yyl743 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl744, d) + x.codecDecodeSelfFromMap(yyl743, d) } - } else if yyct744 == codecSelferValueTypeArray1234 { - yyl744 := r.ReadArrayStart() - if yyl744 == 0 { + } else if yyct743 == codecSelferValueTypeArray1234 { + yyl743 := r.ReadArrayStart() + if yyl743 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl744, d) + x.codecDecodeSelfFromArray(yyl743, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8910,12 +8898,12 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys745Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys745Slc - var yyhl745 bool = l >= 0 - for yyj745 := 0; ; yyj745++ { - if yyhl745 { - if yyj745 >= l { + var yys744Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys744Slc + var yyhl744 bool = l >= 0 + for yyj744 := 0; ; yyj744++ { + if yyhl744 { + if yyj744 >= l { break } } else { @@ -8924,10 +8912,31 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys745Slc = r.DecodeBytes(yys745Slc, true, true) - yys745 := string(yys745Slc) + yys744Slc = r.DecodeBytes(yys744Slc, true, true) + yys744 := string(yys744Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys745 { + switch yys744 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv745 := &x.ObjectMeta + yyv745.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = DaemonSetSpec{} + } else { + yyv746 := &x.Spec + yyv746.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = DaemonSetStatus{} + } else { + yyv747 := &x.Status + yyv747.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -8940,31 +8949,10 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv748 := &x.ObjectMeta - yyv748.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = DaemonSetSpec{} - } else { - yyv749 := &x.Spec - yyv749.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = DaemonSetStatus{} - } else { - yyv750 := &x.Status - yyv750.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys745) - } // end switch yys745 - } // end for yyj745 + z.DecStructFieldNotFound(-1, yys744) + } // end switch yys744 + } // end for yyj744 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8972,16 +8960,67 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj751 int - var yyb751 bool - var yyhl751 bool = l >= 0 - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l + var yyj750 int + var yyb750 bool + var yyhl750 bool = l >= 0 + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l } else { - yyb751 = r.CheckBreak() + yyb750 = r.CheckBreak() } - if yyb751 { + if yyb750 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv751 := &x.ObjectMeta + yyv751.CodecDecodeSelf(d) + } + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l + } else { + yyb750 = r.CheckBreak() + } + if yyb750 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = DaemonSetSpec{} + } else { + yyv752 := &x.Spec + yyv752.CodecDecodeSelf(d) + } + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l + } else { + yyb750 = r.CheckBreak() + } + if yyb750 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = DaemonSetStatus{} + } else { + yyv753 := &x.Status + yyv753.CodecDecodeSelf(d) + } + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l + } else { + yyb750 = r.CheckBreak() + } + if yyb750 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8991,13 +9030,13 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l } else { - yyb751 = r.CheckBreak() + yyb750 = r.CheckBreak() } - if yyb751 { + if yyb750 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9007,69 +9046,18 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l - } else { - yyb751 = r.CheckBreak() - } - if yyb751 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv754 := &x.ObjectMeta - yyv754.CodecDecodeSelf(d) - } - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l - } else { - yyb751 = r.CheckBreak() - } - if yyb751 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = DaemonSetSpec{} - } else { - yyv755 := &x.Spec - yyv755.CodecDecodeSelf(d) - } - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l - } else { - yyb751 = r.CheckBreak() - } - if yyb751 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = DaemonSetStatus{} - } else { - yyv756 := &x.Status - yyv756.CodecDecodeSelf(d) - } for { - yyj751++ - if yyhl751 { - yyb751 = yyj751 > l + yyj750++ + if yyhl750 { + yyb750 = yyj750 > l } else { - yyb751 = r.CheckBreak() + yyb750 = r.CheckBreak() } - if yyb751 { + if yyb750 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj751-1, "") + z.DecStructFieldNotFound(yyj750-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9081,118 +9069,68 @@ func (x *DaemonSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym757 := z.EncBinary() - _ = yym757 + yym756 := z.EncBinary() + _ = yym756 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep758 := !z.EncBinary() - yy2arr758 := z.EncBasicHandle().StructToArray - var yyq758 [4]bool - _, _, _ = yysep758, yyq758, yy2arr758 - const yyr758 bool = false - yyq758[0] = x.Kind != "" - yyq758[1] = x.APIVersion != "" - yyq758[2] = true - var yynn758 int - if yyr758 || yy2arr758 { + yysep757 := !z.EncBinary() + yy2arr757 := z.EncBasicHandle().StructToArray + var yyq757 [4]bool + _, _, _ = yysep757, yyq757, yy2arr757 + const yyr757 bool = false + yyq757[0] = true + yyq757[2] = x.Kind != "" + yyq757[3] = x.APIVersion != "" + var yynn757 int + if yyr757 || yy2arr757 { r.EncodeArrayStart(4) } else { - yynn758 = 1 - for _, b := range yyq758 { + yynn757 = 1 + for _, b := range yyq757 { if b { - yynn758++ + yynn757++ } } - r.EncodeMapStart(yynn758) - yynn758 = 0 + r.EncodeMapStart(yynn757) + yynn757 = 0 } - if yyr758 || yy2arr758 { + if yyr757 || yy2arr757 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq758[0] { + if yyq757[0] { + yy759 := &x.ListMeta yym760 := z.EncBinary() _ = yym760 if false { + } else if z.HasExtensions() && z.EncExt(yy759) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq758[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym761 := z.EncBinary() - _ = yym761 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr758 || yy2arr758 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq758[1] { - yym763 := z.EncBinary() - _ = yym763 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq758[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym764 := z.EncBinary() - _ = yym764 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr758 || yy2arr758 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq758[2] { - yy766 := &x.ListMeta - yym767 := z.EncBinary() - _ = yym767 - if false { - } else if z.HasExtensions() && z.EncExt(yy766) { - } else { - z.EncFallback(yy766) + z.EncFallback(yy759) } } else { r.EncodeNil() } } else { - if yyq758[2] { + if yyq757[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy768 := &x.ListMeta - yym769 := z.EncBinary() - _ = yym769 + yy761 := &x.ListMeta + yym762 := z.EncBinary() + _ = yym762 if false { - } else if z.HasExtensions() && z.EncExt(yy768) { + } else if z.HasExtensions() && z.EncExt(yy761) { } else { - z.EncFallback(yy768) + z.EncFallback(yy761) } } } - if yyr758 || yy2arr758 { + if yyr757 || yy2arr757 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym771 := z.EncBinary() - _ = yym771 + yym764 := z.EncBinary() + _ = yym764 if false { } else { h.encSliceDaemonSet(([]DaemonSet)(x.Items), e) @@ -9205,15 +9143,65 @@ func (x *DaemonSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym772 := z.EncBinary() - _ = yym772 + yym765 := z.EncBinary() + _ = yym765 if false { } else { h.encSliceDaemonSet(([]DaemonSet)(x.Items), e) } } } - if yyr758 || yy2arr758 { + if yyr757 || yy2arr757 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq757[2] { + yym767 := z.EncBinary() + _ = yym767 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq757[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym768 := z.EncBinary() + _ = yym768 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr757 || yy2arr757 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq757[3] { + yym770 := z.EncBinary() + _ = yym770 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq757[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym771 := z.EncBinary() + _ = yym771 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr757 || yy2arr757 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9226,25 +9214,25 @@ func (x *DaemonSetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym773 := z.DecBinary() - _ = yym773 + yym772 := z.DecBinary() + _ = yym772 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct774 := r.ContainerType() - if yyct774 == codecSelferValueTypeMap1234 { - yyl774 := r.ReadMapStart() - if yyl774 == 0 { + yyct773 := r.ContainerType() + if yyct773 == codecSelferValueTypeMap1234 { + yyl773 := r.ReadMapStart() + if yyl773 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl774, d) + x.codecDecodeSelfFromMap(yyl773, d) } - } else if yyct774 == codecSelferValueTypeArray1234 { - yyl774 := r.ReadArrayStart() - if yyl774 == 0 { + } else if yyct773 == codecSelferValueTypeArray1234 { + yyl773 := r.ReadArrayStart() + if yyl773 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl774, d) + x.codecDecodeSelfFromArray(yyl773, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9256,12 +9244,12 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys775Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys775Slc - var yyhl775 bool = l >= 0 - for yyj775 := 0; ; yyj775++ { - if yyhl775 { - if yyj775 >= l { + var yys774Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys774Slc + var yyhl774 bool = l >= 0 + for yyj774 := 0; ; yyj774++ { + if yyhl774 { + if yyj774 >= l { break } } else { @@ -9270,10 +9258,35 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys775Slc = r.DecodeBytes(yys775Slc, true, true) - yys775 := string(yys775Slc) + yys774Slc = r.DecodeBytes(yys774Slc, true, true) + yys774 := string(yys774Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys775 { + switch yys774 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv775 := &x.ListMeta + yym776 := z.DecBinary() + _ = yym776 + if false { + } else if z.HasExtensions() && z.DecExt(yyv775) { + } else { + z.DecFallback(yyv775, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv777 := &x.Items + yym778 := z.DecBinary() + _ = yym778 + if false { + } else { + h.decSliceDaemonSet((*[]DaemonSet)(yyv777), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9286,35 +9299,10 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv778 := &x.ListMeta - yym779 := z.DecBinary() - _ = yym779 - if false { - } else if z.HasExtensions() && z.DecExt(yyv778) { - } else { - z.DecFallback(yyv778, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv780 := &x.Items - yym781 := z.DecBinary() - _ = yym781 - if false { - } else { - h.decSliceDaemonSet((*[]DaemonSet)(yyv780), d) - } - } default: - z.DecStructFieldNotFound(-1, yys775) - } // end switch yys775 - } // end for yyj775 + z.DecStructFieldNotFound(-1, yys774) + } // end switch yys774 + } // end for yyj774 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9322,16 +9310,61 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj782 int - var yyb782 bool - var yyhl782 bool = l >= 0 - yyj782++ - if yyhl782 { - yyb782 = yyj782 > l + var yyj781 int + var yyb781 bool + var yyhl781 bool = l >= 0 + yyj781++ + if yyhl781 { + yyb781 = yyj781 > l } else { - yyb782 = r.CheckBreak() + yyb781 = r.CheckBreak() } - if yyb782 { + if yyb781 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv782 := &x.ListMeta + yym783 := z.DecBinary() + _ = yym783 + if false { + } else if z.HasExtensions() && z.DecExt(yyv782) { + } else { + z.DecFallback(yyv782, false) + } + } + yyj781++ + if yyhl781 { + yyb781 = yyj781 > l + } else { + yyb781 = r.CheckBreak() + } + if yyb781 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv784 := &x.Items + yym785 := z.DecBinary() + _ = yym785 + if false { + } else { + h.decSliceDaemonSet((*[]DaemonSet)(yyv784), d) + } + } + yyj781++ + if yyhl781 { + yyb781 = yyj781 > l + } else { + yyb781 = r.CheckBreak() + } + if yyb781 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9341,13 +9374,13 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj782++ - if yyhl782 { - yyb782 = yyj782 > l + yyj781++ + if yyhl781 { + yyb781 = yyj781 > l } else { - yyb782 = r.CheckBreak() + yyb781 = r.CheckBreak() } - if yyb782 { + if yyb781 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9357,63 +9390,18 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj782++ - if yyhl782 { - yyb782 = yyj782 > l - } else { - yyb782 = r.CheckBreak() - } - if yyb782 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv785 := &x.ListMeta - yym786 := z.DecBinary() - _ = yym786 - if false { - } else if z.HasExtensions() && z.DecExt(yyv785) { - } else { - z.DecFallback(yyv785, false) - } - } - yyj782++ - if yyhl782 { - yyb782 = yyj782 > l - } else { - yyb782 = r.CheckBreak() - } - if yyb782 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv787 := &x.Items - yym788 := z.DecBinary() - _ = yym788 - if false { - } else { - h.decSliceDaemonSet((*[]DaemonSet)(yyv787), d) - } - } for { - yyj782++ - if yyhl782 { - yyb782 = yyj782 > l + yyj781++ + if yyhl781 { + yyb781 = yyj781 > l } else { - yyb782 = r.CheckBreak() + yyb781 = r.CheckBreak() } - if yyb782 { + if yyb781 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj782-1, "") + z.DecStructFieldNotFound(yyj781-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9425,118 +9413,68 @@ func (x *ThirdPartyResourceDataList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym789 := z.EncBinary() - _ = yym789 + yym788 := z.EncBinary() + _ = yym788 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep790 := !z.EncBinary() - yy2arr790 := z.EncBasicHandle().StructToArray - var yyq790 [4]bool - _, _, _ = yysep790, yyq790, yy2arr790 - const yyr790 bool = false - yyq790[0] = x.Kind != "" - yyq790[1] = x.APIVersion != "" - yyq790[2] = true - var yynn790 int - if yyr790 || yy2arr790 { + yysep789 := !z.EncBinary() + yy2arr789 := z.EncBasicHandle().StructToArray + var yyq789 [4]bool + _, _, _ = yysep789, yyq789, yy2arr789 + const yyr789 bool = false + yyq789[0] = true + yyq789[2] = x.Kind != "" + yyq789[3] = x.APIVersion != "" + var yynn789 int + if yyr789 || yy2arr789 { r.EncodeArrayStart(4) } else { - yynn790 = 1 - for _, b := range yyq790 { + yynn789 = 1 + for _, b := range yyq789 { if b { - yynn790++ + yynn789++ } } - r.EncodeMapStart(yynn790) - yynn790 = 0 + r.EncodeMapStart(yynn789) + yynn789 = 0 } - if yyr790 || yy2arr790 { + if yyr789 || yy2arr789 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq790[0] { + if yyq789[0] { + yy791 := &x.ListMeta yym792 := z.EncBinary() _ = yym792 if false { + } else if z.HasExtensions() && z.EncExt(yy791) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq790[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym793 := z.EncBinary() - _ = yym793 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr790 || yy2arr790 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq790[1] { - yym795 := z.EncBinary() - _ = yym795 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq790[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym796 := z.EncBinary() - _ = yym796 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr790 || yy2arr790 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq790[2] { - yy798 := &x.ListMeta - yym799 := z.EncBinary() - _ = yym799 - if false { - } else if z.HasExtensions() && z.EncExt(yy798) { - } else { - z.EncFallback(yy798) + z.EncFallback(yy791) } } else { r.EncodeNil() } } else { - if yyq790[2] { + if yyq789[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy800 := &x.ListMeta - yym801 := z.EncBinary() - _ = yym801 + yy793 := &x.ListMeta + yym794 := z.EncBinary() + _ = yym794 if false { - } else if z.HasExtensions() && z.EncExt(yy800) { + } else if z.HasExtensions() && z.EncExt(yy793) { } else { - z.EncFallback(yy800) + z.EncFallback(yy793) } } } - if yyr790 || yy2arr790 { + if yyr789 || yy2arr789 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym803 := z.EncBinary() - _ = yym803 + yym796 := z.EncBinary() + _ = yym796 if false { } else { h.encSliceThirdPartyResourceData(([]ThirdPartyResourceData)(x.Items), e) @@ -9549,15 +9487,65 @@ func (x *ThirdPartyResourceDataList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym804 := z.EncBinary() - _ = yym804 + yym797 := z.EncBinary() + _ = yym797 if false { } else { h.encSliceThirdPartyResourceData(([]ThirdPartyResourceData)(x.Items), e) } } } - if yyr790 || yy2arr790 { + if yyr789 || yy2arr789 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq789[2] { + yym799 := z.EncBinary() + _ = yym799 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq789[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym800 := z.EncBinary() + _ = yym800 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr789 || yy2arr789 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq789[3] { + yym802 := z.EncBinary() + _ = yym802 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq789[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym803 := z.EncBinary() + _ = yym803 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr789 || yy2arr789 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9570,25 +9558,25 @@ func (x *ThirdPartyResourceDataList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym805 := z.DecBinary() - _ = yym805 + yym804 := z.DecBinary() + _ = yym804 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct806 := r.ContainerType() - if yyct806 == codecSelferValueTypeMap1234 { - yyl806 := r.ReadMapStart() - if yyl806 == 0 { + yyct805 := r.ContainerType() + if yyct805 == codecSelferValueTypeMap1234 { + yyl805 := r.ReadMapStart() + if yyl805 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl806, d) + x.codecDecodeSelfFromMap(yyl805, d) } - } else if yyct806 == codecSelferValueTypeArray1234 { - yyl806 := r.ReadArrayStart() - if yyl806 == 0 { + } else if yyct805 == codecSelferValueTypeArray1234 { + yyl805 := r.ReadArrayStart() + if yyl805 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl806, d) + x.codecDecodeSelfFromArray(yyl805, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9600,12 +9588,12 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys807Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys807Slc - var yyhl807 bool = l >= 0 - for yyj807 := 0; ; yyj807++ { - if yyhl807 { - if yyj807 >= l { + var yys806Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys806Slc + var yyhl806 bool = l >= 0 + for yyj806 := 0; ; yyj806++ { + if yyhl806 { + if yyj806 >= l { break } } else { @@ -9614,10 +9602,35 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys807Slc = r.DecodeBytes(yys807Slc, true, true) - yys807 := string(yys807Slc) + yys806Slc = r.DecodeBytes(yys806Slc, true, true) + yys806 := string(yys806Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys807 { + switch yys806 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv807 := &x.ListMeta + yym808 := z.DecBinary() + _ = yym808 + if false { + } else if z.HasExtensions() && z.DecExt(yyv807) { + } else { + z.DecFallback(yyv807, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv809 := &x.Items + yym810 := z.DecBinary() + _ = yym810 + if false { + } else { + h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv809), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9630,35 +9643,10 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv810 := &x.ListMeta - yym811 := z.DecBinary() - _ = yym811 - if false { - } else if z.HasExtensions() && z.DecExt(yyv810) { - } else { - z.DecFallback(yyv810, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv812 := &x.Items - yym813 := z.DecBinary() - _ = yym813 - if false { - } else { - h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv812), d) - } - } default: - z.DecStructFieldNotFound(-1, yys807) - } // end switch yys807 - } // end for yyj807 + z.DecStructFieldNotFound(-1, yys806) + } // end switch yys806 + } // end for yyj806 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9666,16 +9654,61 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj814 int - var yyb814 bool - var yyhl814 bool = l >= 0 - yyj814++ - if yyhl814 { - yyb814 = yyj814 > l + var yyj813 int + var yyb813 bool + var yyhl813 bool = l >= 0 + yyj813++ + if yyhl813 { + yyb813 = yyj813 > l } else { - yyb814 = r.CheckBreak() + yyb813 = r.CheckBreak() } - if yyb814 { + if yyb813 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv814 := &x.ListMeta + yym815 := z.DecBinary() + _ = yym815 + if false { + } else if z.HasExtensions() && z.DecExt(yyv814) { + } else { + z.DecFallback(yyv814, false) + } + } + yyj813++ + if yyhl813 { + yyb813 = yyj813 > l + } else { + yyb813 = r.CheckBreak() + } + if yyb813 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv816 := &x.Items + yym817 := z.DecBinary() + _ = yym817 + if false { + } else { + h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv816), d) + } + } + yyj813++ + if yyhl813 { + yyb813 = yyj813 > l + } else { + yyb813 = r.CheckBreak() + } + if yyb813 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9685,13 +9718,13 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 } else { x.Kind = string(r.DecodeString()) } - yyj814++ - if yyhl814 { - yyb814 = yyj814 > l + yyj813++ + if yyhl813 { + yyb813 = yyj813 > l } else { - yyb814 = r.CheckBreak() + yyb813 = r.CheckBreak() } - if yyb814 { + if yyb813 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9701,63 +9734,18 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 } else { x.APIVersion = string(r.DecodeString()) } - yyj814++ - if yyhl814 { - yyb814 = yyj814 > l - } else { - yyb814 = r.CheckBreak() - } - if yyb814 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv817 := &x.ListMeta - yym818 := z.DecBinary() - _ = yym818 - if false { - } else if z.HasExtensions() && z.DecExt(yyv817) { - } else { - z.DecFallback(yyv817, false) - } - } - yyj814++ - if yyhl814 { - yyb814 = yyj814 > l - } else { - yyb814 = r.CheckBreak() - } - if yyb814 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv819 := &x.Items - yym820 := z.DecBinary() - _ = yym820 - if false { - } else { - h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv819), d) - } - } for { - yyj814++ - if yyhl814 { - yyb814 = yyj814 > l + yyj813++ + if yyhl813 { + yyb813 = yyj813 > l } else { - yyb814 = r.CheckBreak() + yyb813 = r.CheckBreak() } - if yyb814 { + if yyb813 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj814-1, "") + z.DecStructFieldNotFound(yyj813-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9769,136 +9757,136 @@ func (x *Job) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym821 := z.EncBinary() - _ = yym821 + yym820 := z.EncBinary() + _ = yym820 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep822 := !z.EncBinary() - yy2arr822 := z.EncBasicHandle().StructToArray - var yyq822 [5]bool - _, _, _ = yysep822, yyq822, yy2arr822 - const yyr822 bool = false - yyq822[0] = x.Kind != "" - yyq822[1] = x.APIVersion != "" - yyq822[2] = true - yyq822[3] = true - yyq822[4] = true - var yynn822 int - if yyr822 || yy2arr822 { + yysep821 := !z.EncBinary() + yy2arr821 := z.EncBasicHandle().StructToArray + var yyq821 [5]bool + _, _, _ = yysep821, yyq821, yy2arr821 + const yyr821 bool = false + yyq821[0] = true + yyq821[1] = true + yyq821[2] = true + yyq821[3] = x.Kind != "" + yyq821[4] = x.APIVersion != "" + var yynn821 int + if yyr821 || yy2arr821 { r.EncodeArrayStart(5) } else { - yynn822 = 0 - for _, b := range yyq822 { + yynn821 = 0 + for _, b := range yyq821 { if b { - yynn822++ + yynn821++ } } - r.EncodeMapStart(yynn822) - yynn822 = 0 + r.EncodeMapStart(yynn821) + yynn821 = 0 } - if yyr822 || yy2arr822 { + if yyr821 || yy2arr821 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq822[0] { - yym824 := z.EncBinary() - _ = yym824 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq822[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym825 := z.EncBinary() - _ = yym825 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr822 || yy2arr822 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq822[1] { - yym827 := z.EncBinary() - _ = yym827 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq822[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym828 := z.EncBinary() - _ = yym828 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr822 || yy2arr822 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq822[2] { - yy830 := &x.ObjectMeta - yy830.CodecEncodeSelf(e) + if yyq821[0] { + yy823 := &x.ObjectMeta + yy823.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq822[2] { + if yyq821[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy831 := &x.ObjectMeta - yy831.CodecEncodeSelf(e) + yy824 := &x.ObjectMeta + yy824.CodecEncodeSelf(e) } } - if yyr822 || yy2arr822 { + if yyr821 || yy2arr821 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq822[3] { - yy833 := &x.Spec - yy833.CodecEncodeSelf(e) + if yyq821[1] { + yy826 := &x.Spec + yy826.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq822[3] { + if yyq821[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy834 := &x.Spec - yy834.CodecEncodeSelf(e) + yy827 := &x.Spec + yy827.CodecEncodeSelf(e) } } - if yyr822 || yy2arr822 { + if yyr821 || yy2arr821 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq822[4] { - yy836 := &x.Status - yy836.CodecEncodeSelf(e) + if yyq821[2] { + yy829 := &x.Status + yy829.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq822[4] { + if yyq821[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy837 := &x.Status - yy837.CodecEncodeSelf(e) + yy830 := &x.Status + yy830.CodecEncodeSelf(e) } } - if yyr822 || yy2arr822 { + if yyr821 || yy2arr821 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq821[3] { + yym832 := z.EncBinary() + _ = yym832 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq821[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym833 := z.EncBinary() + _ = yym833 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr821 || yy2arr821 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq821[4] { + yym835 := z.EncBinary() + _ = yym835 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq821[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym836 := z.EncBinary() + _ = yym836 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr821 || yy2arr821 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9911,25 +9899,25 @@ func (x *Job) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym838 := z.DecBinary() - _ = yym838 + yym837 := z.DecBinary() + _ = yym837 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct839 := r.ContainerType() - if yyct839 == codecSelferValueTypeMap1234 { - yyl839 := r.ReadMapStart() - if yyl839 == 0 { + yyct838 := r.ContainerType() + if yyct838 == codecSelferValueTypeMap1234 { + yyl838 := r.ReadMapStart() + if yyl838 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl839, d) + x.codecDecodeSelfFromMap(yyl838, d) } - } else if yyct839 == codecSelferValueTypeArray1234 { - yyl839 := r.ReadArrayStart() - if yyl839 == 0 { + } else if yyct838 == codecSelferValueTypeArray1234 { + yyl838 := r.ReadArrayStart() + if yyl838 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl839, d) + x.codecDecodeSelfFromArray(yyl838, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9941,12 +9929,12 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys840Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys840Slc - var yyhl840 bool = l >= 0 - for yyj840 := 0; ; yyj840++ { - if yyhl840 { - if yyj840 >= l { + var yys839Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys839Slc + var yyhl839 bool = l >= 0 + for yyj839 := 0; ; yyj839++ { + if yyhl839 { + if yyj839 >= l { break } } else { @@ -9955,10 +9943,31 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys840Slc = r.DecodeBytes(yys840Slc, true, true) - yys840 := string(yys840Slc) + yys839Slc = r.DecodeBytes(yys839Slc, true, true) + yys839 := string(yys839Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys840 { + switch yys839 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv840 := &x.ObjectMeta + yyv840.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = JobSpec{} + } else { + yyv841 := &x.Spec + yyv841.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = JobStatus{} + } else { + yyv842 := &x.Status + yyv842.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9971,31 +9980,10 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv843 := &x.ObjectMeta - yyv843.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = JobSpec{} - } else { - yyv844 := &x.Spec - yyv844.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = JobStatus{} - } else { - yyv845 := &x.Status - yyv845.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys840) - } // end switch yys840 - } // end for yyj840 + z.DecStructFieldNotFound(-1, yys839) + } // end switch yys839 + } // end for yyj839 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10003,16 +9991,67 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj846 int - var yyb846 bool - var yyhl846 bool = l >= 0 - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l + var yyj845 int + var yyb845 bool + var yyhl845 bool = l >= 0 + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l } else { - yyb846 = r.CheckBreak() + yyb845 = r.CheckBreak() } - if yyb846 { + if yyb845 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv846 := &x.ObjectMeta + yyv846.CodecDecodeSelf(d) + } + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l + } else { + yyb845 = r.CheckBreak() + } + if yyb845 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = JobSpec{} + } else { + yyv847 := &x.Spec + yyv847.CodecDecodeSelf(d) + } + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l + } else { + yyb845 = r.CheckBreak() + } + if yyb845 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = JobStatus{} + } else { + yyv848 := &x.Status + yyv848.CodecDecodeSelf(d) + } + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l + } else { + yyb845 = r.CheckBreak() + } + if yyb845 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10022,13 +10061,13 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l } else { - yyb846 = r.CheckBreak() + yyb845 = r.CheckBreak() } - if yyb846 { + if yyb845 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10038,69 +10077,18 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l - } else { - yyb846 = r.CheckBreak() - } - if yyb846 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv849 := &x.ObjectMeta - yyv849.CodecDecodeSelf(d) - } - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l - } else { - yyb846 = r.CheckBreak() - } - if yyb846 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = JobSpec{} - } else { - yyv850 := &x.Spec - yyv850.CodecDecodeSelf(d) - } - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l - } else { - yyb846 = r.CheckBreak() - } - if yyb846 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = JobStatus{} - } else { - yyv851 := &x.Status - yyv851.CodecDecodeSelf(d) - } for { - yyj846++ - if yyhl846 { - yyb846 = yyj846 > l + yyj845++ + if yyhl845 { + yyb845 = yyj845 > l } else { - yyb846 = r.CheckBreak() + yyb845 = r.CheckBreak() } - if yyb846 { + if yyb845 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj846-1, "") + z.DecStructFieldNotFound(yyj845-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10112,118 +10100,68 @@ func (x *JobList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym852 := z.EncBinary() - _ = yym852 + yym851 := z.EncBinary() + _ = yym851 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep853 := !z.EncBinary() - yy2arr853 := z.EncBasicHandle().StructToArray - var yyq853 [4]bool - _, _, _ = yysep853, yyq853, yy2arr853 - const yyr853 bool = false - yyq853[0] = x.Kind != "" - yyq853[1] = x.APIVersion != "" - yyq853[2] = true - var yynn853 int - if yyr853 || yy2arr853 { + yysep852 := !z.EncBinary() + yy2arr852 := z.EncBasicHandle().StructToArray + var yyq852 [4]bool + _, _, _ = yysep852, yyq852, yy2arr852 + const yyr852 bool = false + yyq852[0] = true + yyq852[2] = x.Kind != "" + yyq852[3] = x.APIVersion != "" + var yynn852 int + if yyr852 || yy2arr852 { r.EncodeArrayStart(4) } else { - yynn853 = 1 - for _, b := range yyq853 { + yynn852 = 1 + for _, b := range yyq852 { if b { - yynn853++ + yynn852++ } } - r.EncodeMapStart(yynn853) - yynn853 = 0 + r.EncodeMapStart(yynn852) + yynn852 = 0 } - if yyr853 || yy2arr853 { + if yyr852 || yy2arr852 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq853[0] { + if yyq852[0] { + yy854 := &x.ListMeta yym855 := z.EncBinary() _ = yym855 if false { + } else if z.HasExtensions() && z.EncExt(yy854) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq853[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym856 := z.EncBinary() - _ = yym856 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr853 || yy2arr853 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq853[1] { - yym858 := z.EncBinary() - _ = yym858 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq853[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym859 := z.EncBinary() - _ = yym859 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr853 || yy2arr853 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq853[2] { - yy861 := &x.ListMeta - yym862 := z.EncBinary() - _ = yym862 - if false { - } else if z.HasExtensions() && z.EncExt(yy861) { - } else { - z.EncFallback(yy861) + z.EncFallback(yy854) } } else { r.EncodeNil() } } else { - if yyq853[2] { + if yyq852[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy863 := &x.ListMeta - yym864 := z.EncBinary() - _ = yym864 + yy856 := &x.ListMeta + yym857 := z.EncBinary() + _ = yym857 if false { - } else if z.HasExtensions() && z.EncExt(yy863) { + } else if z.HasExtensions() && z.EncExt(yy856) { } else { - z.EncFallback(yy863) + z.EncFallback(yy856) } } } - if yyr853 || yy2arr853 { + if yyr852 || yy2arr852 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym866 := z.EncBinary() - _ = yym866 + yym859 := z.EncBinary() + _ = yym859 if false { } else { h.encSliceJob(([]Job)(x.Items), e) @@ -10236,15 +10174,65 @@ func (x *JobList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym867 := z.EncBinary() - _ = yym867 + yym860 := z.EncBinary() + _ = yym860 if false { } else { h.encSliceJob(([]Job)(x.Items), e) } } } - if yyr853 || yy2arr853 { + if yyr852 || yy2arr852 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq852[2] { + yym862 := z.EncBinary() + _ = yym862 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq852[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym863 := z.EncBinary() + _ = yym863 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr852 || yy2arr852 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq852[3] { + yym865 := z.EncBinary() + _ = yym865 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq852[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym866 := z.EncBinary() + _ = yym866 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr852 || yy2arr852 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10257,25 +10245,25 @@ func (x *JobList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym868 := z.DecBinary() - _ = yym868 + yym867 := z.DecBinary() + _ = yym867 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct869 := r.ContainerType() - if yyct869 == codecSelferValueTypeMap1234 { - yyl869 := r.ReadMapStart() - if yyl869 == 0 { + yyct868 := r.ContainerType() + if yyct868 == codecSelferValueTypeMap1234 { + yyl868 := r.ReadMapStart() + if yyl868 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl869, d) + x.codecDecodeSelfFromMap(yyl868, d) } - } else if yyct869 == codecSelferValueTypeArray1234 { - yyl869 := r.ReadArrayStart() - if yyl869 == 0 { + } else if yyct868 == codecSelferValueTypeArray1234 { + yyl868 := r.ReadArrayStart() + if yyl868 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl869, d) + x.codecDecodeSelfFromArray(yyl868, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10287,12 +10275,12 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys870Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys870Slc - var yyhl870 bool = l >= 0 - for yyj870 := 0; ; yyj870++ { - if yyhl870 { - if yyj870 >= l { + var yys869Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys869Slc + var yyhl869 bool = l >= 0 + for yyj869 := 0; ; yyj869++ { + if yyhl869 { + if yyj869 >= l { break } } else { @@ -10301,10 +10289,35 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys870Slc = r.DecodeBytes(yys870Slc, true, true) - yys870 := string(yys870Slc) + yys869Slc = r.DecodeBytes(yys869Slc, true, true) + yys869 := string(yys869Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys870 { + switch yys869 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv870 := &x.ListMeta + yym871 := z.DecBinary() + _ = yym871 + if false { + } else if z.HasExtensions() && z.DecExt(yyv870) { + } else { + z.DecFallback(yyv870, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv872 := &x.Items + yym873 := z.DecBinary() + _ = yym873 + if false { + } else { + h.decSliceJob((*[]Job)(yyv872), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -10317,35 +10330,10 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv873 := &x.ListMeta - yym874 := z.DecBinary() - _ = yym874 - if false { - } else if z.HasExtensions() && z.DecExt(yyv873) { - } else { - z.DecFallback(yyv873, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv875 := &x.Items - yym876 := z.DecBinary() - _ = yym876 - if false { - } else { - h.decSliceJob((*[]Job)(yyv875), d) - } - } default: - z.DecStructFieldNotFound(-1, yys870) - } // end switch yys870 - } // end for yyj870 + z.DecStructFieldNotFound(-1, yys869) + } // end switch yys869 + } // end for yyj869 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10353,16 +10341,61 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj877 int - var yyb877 bool - var yyhl877 bool = l >= 0 - yyj877++ - if yyhl877 { - yyb877 = yyj877 > l + var yyj876 int + var yyb876 bool + var yyhl876 bool = l >= 0 + yyj876++ + if yyhl876 { + yyb876 = yyj876 > l } else { - yyb877 = r.CheckBreak() + yyb876 = r.CheckBreak() } - if yyb877 { + if yyb876 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv877 := &x.ListMeta + yym878 := z.DecBinary() + _ = yym878 + if false { + } else if z.HasExtensions() && z.DecExt(yyv877) { + } else { + z.DecFallback(yyv877, false) + } + } + yyj876++ + if yyhl876 { + yyb876 = yyj876 > l + } else { + yyb876 = r.CheckBreak() + } + if yyb876 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv879 := &x.Items + yym880 := z.DecBinary() + _ = yym880 + if false { + } else { + h.decSliceJob((*[]Job)(yyv879), d) + } + } + yyj876++ + if yyhl876 { + yyb876 = yyj876 > l + } else { + yyb876 = r.CheckBreak() + } + if yyb876 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10372,13 +10405,13 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj877++ - if yyhl877 { - yyb877 = yyj877 > l + yyj876++ + if yyhl876 { + yyb876 = yyj876 > l } else { - yyb877 = r.CheckBreak() + yyb876 = r.CheckBreak() } - if yyb877 { + if yyb876 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10388,63 +10421,18 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj877++ - if yyhl877 { - yyb877 = yyj877 > l - } else { - yyb877 = r.CheckBreak() - } - if yyb877 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv880 := &x.ListMeta - yym881 := z.DecBinary() - _ = yym881 - if false { - } else if z.HasExtensions() && z.DecExt(yyv880) { - } else { - z.DecFallback(yyv880, false) - } - } - yyj877++ - if yyhl877 { - yyb877 = yyj877 > l - } else { - yyb877 = r.CheckBreak() - } - if yyb877 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv882 := &x.Items - yym883 := z.DecBinary() - _ = yym883 - if false { - } else { - h.decSliceJob((*[]Job)(yyv882), d) - } - } for { - yyj877++ - if yyhl877 { - yyb877 = yyj877 > l + yyj876++ + if yyhl876 { + yyb876 = yyj876 > l } else { - yyb877 = r.CheckBreak() + yyb876 = r.CheckBreak() } - if yyb877 { + if yyb876 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj877-1, "") + z.DecStructFieldNotFound(yyj876-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10456,173 +10444,185 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym884 := z.EncBinary() - _ = yym884 + yym883 := z.EncBinary() + _ = yym883 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep885 := !z.EncBinary() - yy2arr885 := z.EncBasicHandle().StructToArray - var yyq885 [5]bool - _, _, _ = yysep885, yyq885, yy2arr885 - const yyr885 bool = false - yyq885[0] = x.Parallelism != nil - yyq885[1] = x.Completions != nil - yyq885[2] = x.ActiveDeadlineSeconds != nil - yyq885[3] = x.Selector != nil - var yynn885 int - if yyr885 || yy2arr885 { + yysep884 := !z.EncBinary() + yy2arr884 := z.EncBasicHandle().StructToArray + var yyq884 [5]bool + _, _, _ = yysep884, yyq884, yy2arr884 + const yyr884 bool = false + yyq884[0] = x.Parallelism != nil + yyq884[1] = x.Completions != nil + yyq884[2] = x.ActiveDeadlineSeconds != nil + yyq884[3] = x.Selector != nil + var yynn884 int + if yyr884 || yy2arr884 { r.EncodeArrayStart(5) } else { - yynn885 = 1 - for _, b := range yyq885 { + yynn884 = 1 + for _, b := range yyq884 { if b { - yynn885++ + yynn884++ } } - r.EncodeMapStart(yynn885) - yynn885 = 0 + r.EncodeMapStart(yynn884) + yynn884 = 0 } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq885[0] { + if yyq884[0] { if x.Parallelism == nil { r.EncodeNil() } else { - yy887 := *x.Parallelism - yym888 := z.EncBinary() - _ = yym888 + yy886 := *x.Parallelism + yym887 := z.EncBinary() + _ = yym887 if false { } else { - r.EncodeInt(int64(yy887)) + r.EncodeInt(int64(yy886)) } } } else { r.EncodeNil() } } else { - if yyq885[0] { + if yyq884[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("parallelism")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Parallelism == nil { r.EncodeNil() } else { - yy889 := *x.Parallelism - yym890 := z.EncBinary() - _ = yym890 + yy888 := *x.Parallelism + yym889 := z.EncBinary() + _ = yym889 if false { } else { - r.EncodeInt(int64(yy889)) + r.EncodeInt(int64(yy888)) } } } } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq885[1] { + if yyq884[1] { if x.Completions == nil { r.EncodeNil() } else { - yy892 := *x.Completions - yym893 := z.EncBinary() - _ = yym893 + yy891 := *x.Completions + yym892 := z.EncBinary() + _ = yym892 if false { } else { - r.EncodeInt(int64(yy892)) + r.EncodeInt(int64(yy891)) } } } else { r.EncodeNil() } } else { - if yyq885[1] { + if yyq884[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("completions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Completions == nil { r.EncodeNil() } else { - yy894 := *x.Completions - yym895 := z.EncBinary() - _ = yym895 + yy893 := *x.Completions + yym894 := z.EncBinary() + _ = yym894 if false { } else { - r.EncodeInt(int64(yy894)) + r.EncodeInt(int64(yy893)) } } } } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq885[2] { + if yyq884[2] { if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy897 := *x.ActiveDeadlineSeconds - yym898 := z.EncBinary() - _ = yym898 + yy896 := *x.ActiveDeadlineSeconds + yym897 := z.EncBinary() + _ = yym897 if false { } else { - r.EncodeInt(int64(yy897)) + r.EncodeInt(int64(yy896)) } } } else { r.EncodeNil() } } else { - if yyq885[2] { + if yyq884[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("activeDeadlineSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy899 := *x.ActiveDeadlineSeconds - yym900 := z.EncBinary() - _ = yym900 + yy898 := *x.ActiveDeadlineSeconds + yym899 := z.EncBinary() + _ = yym899 if false { } else { - r.EncodeInt(int64(yy899)) + r.EncodeInt(int64(yy898)) } } } } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq885[3] { + if yyq884[3] { if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym901 := z.EncBinary() + _ = yym901 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } else { r.EncodeNil() } } else { - if yyq885[3] { + if yyq884[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym902 := z.EncBinary() + _ = yym902 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy903 := &x.Template - yy903.CodecEncodeSelf(e) + yy904 := &x.Template + yy904.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy904 := &x.Template - yy904.CodecEncodeSelf(e) + yy905 := &x.Template + yy905.CodecEncodeSelf(e) } - if yyr885 || yy2arr885 { + if yyr884 || yy2arr884 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10635,25 +10635,25 @@ func (x *JobSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym905 := z.DecBinary() - _ = yym905 + yym906 := z.DecBinary() + _ = yym906 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct906 := r.ContainerType() - if yyct906 == codecSelferValueTypeMap1234 { - yyl906 := r.ReadMapStart() - if yyl906 == 0 { + yyct907 := r.ContainerType() + if yyct907 == codecSelferValueTypeMap1234 { + yyl907 := r.ReadMapStart() + if yyl907 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl906, d) + x.codecDecodeSelfFromMap(yyl907, d) } - } else if yyct906 == codecSelferValueTypeArray1234 { - yyl906 := r.ReadArrayStart() - if yyl906 == 0 { + } else if yyct907 == codecSelferValueTypeArray1234 { + yyl907 := r.ReadArrayStart() + if yyl907 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl906, d) + x.codecDecodeSelfFromArray(yyl907, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10665,12 +10665,12 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys907Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys907Slc - var yyhl907 bool = l >= 0 - for yyj907 := 0; ; yyj907++ { - if yyhl907 { - if yyj907 >= l { + var yys908Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys908Slc + var yyhl908 bool = l >= 0 + for yyj908 := 0; ; yyj908++ { + if yyhl908 { + if yyj908 >= l { break } } else { @@ -10679,10 +10679,10 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys907Slc = r.DecodeBytes(yys907Slc, true, true) - yys907 := string(yys907Slc) + yys908Slc = r.DecodeBytes(yys908Slc, true, true) + yys908 := string(yys908Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys907 { + switch yys908 { case "parallelism": if r.TryDecodeAsNil() { if x.Parallelism != nil { @@ -10692,8 +10692,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Parallelism == nil { x.Parallelism = new(int) } - yym909 := z.DecBinary() - _ = yym909 + yym910 := z.DecBinary() + _ = yym910 if false { } else { *((*int)(x.Parallelism)) = int(r.DecodeInt(codecSelferBitsize1234)) @@ -10708,8 +10708,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Completions == nil { x.Completions = new(int) } - yym911 := z.DecBinary() - _ = yym911 + yym912 := z.DecBinary() + _ = yym912 if false { } else { *((*int)(x.Completions)) = int(r.DecodeInt(codecSelferBitsize1234)) @@ -10724,8 +10724,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym913 := z.DecBinary() - _ = yym913 + yym914 := z.DecBinary() + _ = yym914 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) @@ -10738,21 +10738,27 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym916 := z.DecBinary() + _ = yym916 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } case "template": if r.TryDecodeAsNil() { x.Template = pkg2_api.PodTemplateSpec{} } else { - yyv915 := &x.Template - yyv915.CodecDecodeSelf(d) + yyv917 := &x.Template + yyv917.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys907) - } // end switch yys907 - } // end for yyj907 + z.DecStructFieldNotFound(-1, yys908) + } // end switch yys908 + } // end for yyj908 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10760,16 +10766,16 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj916 int - var yyb916 bool - var yyhl916 bool = l >= 0 - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + var yyj918 int + var yyb918 bool + var yyhl918 bool = l >= 0 + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10782,20 +10788,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Parallelism == nil { x.Parallelism = new(int) } - yym918 := z.DecBinary() - _ = yym918 + yym920 := z.DecBinary() + _ = yym920 if false { } else { *((*int)(x.Parallelism)) = int(r.DecodeInt(codecSelferBitsize1234)) } } - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10808,20 +10814,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Completions == nil { x.Completions = new(int) } - yym920 := z.DecBinary() - _ = yym920 + yym922 := z.DecBinary() + _ = yym922 if false { } else { *((*int)(x.Completions)) = int(r.DecodeInt(codecSelferBitsize1234)) } } - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10834,20 +10840,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym922 := z.DecBinary() - _ = yym922 + yym924 := z.DecBinary() + _ = yym924 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) } } - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10858,17 +10864,23 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym926 := z.DecBinary() + _ = yym926 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10876,21 +10888,21 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_api.PodTemplateSpec{} } else { - yyv924 := &x.Template - yyv924.CodecDecodeSelf(d) + yyv927 := &x.Template + yyv927.CodecDecodeSelf(d) } for { - yyj916++ - if yyhl916 { - yyb916 = yyj916 > l + yyj918++ + if yyhl918 { + yyb918 = yyj918 > l } else { - yyb916 = r.CheckBreak() + yyb918 = r.CheckBreak() } - if yyb916 { + if yyb918 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj916-1, "") + z.DecStructFieldNotFound(yyj918-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10902,43 +10914,43 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym925 := z.EncBinary() - _ = yym925 + yym928 := z.EncBinary() + _ = yym928 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep926 := !z.EncBinary() - yy2arr926 := z.EncBasicHandle().StructToArray - var yyq926 [6]bool - _, _, _ = yysep926, yyq926, yy2arr926 - const yyr926 bool = false - yyq926[0] = len(x.Conditions) != 0 - yyq926[1] = x.StartTime != nil - yyq926[2] = x.CompletionTime != nil - yyq926[3] = x.Active != 0 - yyq926[4] = x.Succeeded != 0 - yyq926[5] = x.Failed != 0 - var yynn926 int - if yyr926 || yy2arr926 { + yysep929 := !z.EncBinary() + yy2arr929 := z.EncBasicHandle().StructToArray + var yyq929 [6]bool + _, _, _ = yysep929, yyq929, yy2arr929 + const yyr929 bool = false + yyq929[0] = len(x.Conditions) != 0 + yyq929[1] = x.StartTime != nil + yyq929[2] = x.CompletionTime != nil + yyq929[3] = x.Active != 0 + yyq929[4] = x.Succeeded != 0 + yyq929[5] = x.Failed != 0 + var yynn929 int + if yyr929 || yy2arr929 { r.EncodeArrayStart(6) } else { - yynn926 = 0 - for _, b := range yyq926 { + yynn929 = 0 + for _, b := range yyq929 { if b { - yynn926++ + yynn929++ } } - r.EncodeMapStart(yynn926) - yynn926 = 0 + r.EncodeMapStart(yynn929) + yynn929 = 0 } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[0] { + if yyq929[0] { if x.Conditions == nil { r.EncodeNil() } else { - yym928 := z.EncBinary() - _ = yym928 + yym931 := z.EncBinary() + _ = yym931 if false { } else { h.encSliceJobCondition(([]JobCondition)(x.Conditions), e) @@ -10948,15 +10960,15 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq926[0] { + if yyq929[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym929 := z.EncBinary() - _ = yym929 + yym932 := z.EncBinary() + _ = yym932 if false { } else { h.encSliceJobCondition(([]JobCondition)(x.Conditions), e) @@ -10964,19 +10976,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[1] { + if yyq929[1] { if x.StartTime == nil { r.EncodeNil() } else { - yym931 := z.EncBinary() - _ = yym931 + yym934 := z.EncBinary() + _ = yym934 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym931 { + } else if yym934 { z.EncBinaryMarshal(x.StartTime) - } else if !yym931 && z.IsJSONHandle() { + } else if !yym934 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -10986,20 +10998,20 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq926[1] { + if yyq929[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.StartTime == nil { r.EncodeNil() } else { - yym932 := z.EncBinary() - _ = yym932 + yym935 := z.EncBinary() + _ = yym935 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym932 { + } else if yym935 { z.EncBinaryMarshal(x.StartTime) - } else if !yym932 && z.IsJSONHandle() { + } else if !yym935 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -11007,19 +11019,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[2] { + if yyq929[2] { if x.CompletionTime == nil { r.EncodeNil() } else { - yym934 := z.EncBinary() - _ = yym934 + yym937 := z.EncBinary() + _ = yym937 if false { } else if z.HasExtensions() && z.EncExt(x.CompletionTime) { - } else if yym934 { + } else if yym937 { z.EncBinaryMarshal(x.CompletionTime) - } else if !yym934 && z.IsJSONHandle() { + } else if !yym937 && z.IsJSONHandle() { z.EncJSONMarshal(x.CompletionTime) } else { z.EncFallback(x.CompletionTime) @@ -11029,20 +11041,20 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq926[2] { + if yyq929[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("completionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.CompletionTime == nil { r.EncodeNil() } else { - yym935 := z.EncBinary() - _ = yym935 + yym938 := z.EncBinary() + _ = yym938 if false { } else if z.HasExtensions() && z.EncExt(x.CompletionTime) { - } else if yym935 { + } else if yym938 { z.EncBinaryMarshal(x.CompletionTime) - } else if !yym935 && z.IsJSONHandle() { + } else if !yym938 && z.IsJSONHandle() { z.EncJSONMarshal(x.CompletionTime) } else { z.EncFallback(x.CompletionTime) @@ -11050,61 +11062,61 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[3] { - yym937 := z.EncBinary() - _ = yym937 - if false { - } else { - r.EncodeInt(int64(x.Active)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq926[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("active")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym938 := z.EncBinary() - _ = yym938 - if false { - } else { - r.EncodeInt(int64(x.Active)) - } - } - } - if yyr926 || yy2arr926 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[4] { + if yyq929[3] { yym940 := z.EncBinary() _ = yym940 if false { } else { - r.EncodeInt(int64(x.Succeeded)) + r.EncodeInt(int64(x.Active)) } } else { r.EncodeInt(0) } } else { - if yyq926[4] { + if yyq929[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("succeeded")) + r.EncodeString(codecSelferC_UTF81234, string("active")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym941 := z.EncBinary() _ = yym941 if false { + } else { + r.EncodeInt(int64(x.Active)) + } + } + } + if yyr929 || yy2arr929 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq929[4] { + yym943 := z.EncBinary() + _ = yym943 + if false { + } else { + r.EncodeInt(int64(x.Succeeded)) + } + } else { + r.EncodeInt(0) + } + } else { + if yyq929[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("succeeded")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym944 := z.EncBinary() + _ = yym944 + if false { } else { r.EncodeInt(int64(x.Succeeded)) } } } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq926[5] { - yym943 := z.EncBinary() - _ = yym943 + if yyq929[5] { + yym946 := z.EncBinary() + _ = yym946 if false { } else { r.EncodeInt(int64(x.Failed)) @@ -11113,19 +11125,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq926[5] { + if yyq929[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("failed")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym944 := z.EncBinary() - _ = yym944 + yym947 := z.EncBinary() + _ = yym947 if false { } else { r.EncodeInt(int64(x.Failed)) } } } - if yyr926 || yy2arr926 { + if yyr929 || yy2arr929 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11138,25 +11150,25 @@ func (x *JobStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym945 := z.DecBinary() - _ = yym945 + yym948 := z.DecBinary() + _ = yym948 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct946 := r.ContainerType() - if yyct946 == codecSelferValueTypeMap1234 { - yyl946 := r.ReadMapStart() - if yyl946 == 0 { + yyct949 := r.ContainerType() + if yyct949 == codecSelferValueTypeMap1234 { + yyl949 := r.ReadMapStart() + if yyl949 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl946, d) + x.codecDecodeSelfFromMap(yyl949, d) } - } else if yyct946 == codecSelferValueTypeArray1234 { - yyl946 := r.ReadArrayStart() - if yyl946 == 0 { + } else if yyct949 == codecSelferValueTypeArray1234 { + yyl949 := r.ReadArrayStart() + if yyl949 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl946, d) + x.codecDecodeSelfFromArray(yyl949, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11168,12 +11180,12 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys947Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys947Slc - var yyhl947 bool = l >= 0 - for yyj947 := 0; ; yyj947++ { - if yyhl947 { - if yyj947 >= l { + var yys950Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys950Slc + var yyhl950 bool = l >= 0 + for yyj950 := 0; ; yyj950++ { + if yyhl950 { + if yyj950 >= l { break } } else { @@ -11182,20 +11194,20 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys947Slc = r.DecodeBytes(yys947Slc, true, true) - yys947 := string(yys947Slc) + yys950Slc = r.DecodeBytes(yys950Slc, true, true) + yys950 := string(yys950Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys947 { + switch yys950 { case "conditions": if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv948 := &x.Conditions - yym949 := z.DecBinary() - _ = yym949 + yyv951 := &x.Conditions + yym952 := z.DecBinary() + _ = yym952 if false { } else { - h.decSliceJobCondition((*[]JobCondition)(yyv948), d) + h.decSliceJobCondition((*[]JobCondition)(yyv951), d) } } case "startTime": @@ -11207,13 +11219,13 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg1_unversioned.Time) } - yym951 := z.DecBinary() - _ = yym951 + yym954 := z.DecBinary() + _ = yym954 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym951 { + } else if yym954 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym951 && z.IsJSONHandle() { + } else if !yym954 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) @@ -11228,13 +11240,13 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.CompletionTime == nil { x.CompletionTime = new(pkg1_unversioned.Time) } - yym953 := z.DecBinary() - _ = yym953 + yym956 := z.DecBinary() + _ = yym956 if false { } else if z.HasExtensions() && z.DecExt(x.CompletionTime) { - } else if yym953 { + } else if yym956 { z.DecBinaryUnmarshal(x.CompletionTime) - } else if !yym953 && z.IsJSONHandle() { + } else if !yym956 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.CompletionTime) } else { z.DecFallback(x.CompletionTime, false) @@ -11259,9 +11271,9 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Failed = int(r.DecodeInt(codecSelferBitsize1234)) } default: - z.DecStructFieldNotFound(-1, yys947) - } // end switch yys947 - } // end for yyj947 + z.DecStructFieldNotFound(-1, yys950) + } // end switch yys950 + } // end for yyj950 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11269,16 +11281,16 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj957 int - var yyb957 bool - var yyhl957 bool = l >= 0 - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + var yyj960 int + var yyb960 bool + var yyhl960 bool = l >= 0 + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11286,21 +11298,21 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv958 := &x.Conditions - yym959 := z.DecBinary() - _ = yym959 + yyv961 := &x.Conditions + yym962 := z.DecBinary() + _ = yym962 if false { } else { - h.decSliceJobCondition((*[]JobCondition)(yyv958), d) + h.decSliceJobCondition((*[]JobCondition)(yyv961), d) } } - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11313,25 +11325,25 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg1_unversioned.Time) } - yym961 := z.DecBinary() - _ = yym961 + yym964 := z.DecBinary() + _ = yym964 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym961 { + } else if yym964 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym961 && z.IsJSONHandle() { + } else if !yym964 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) } } - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11344,25 +11356,25 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.CompletionTime == nil { x.CompletionTime = new(pkg1_unversioned.Time) } - yym963 := z.DecBinary() - _ = yym963 + yym966 := z.DecBinary() + _ = yym966 if false { } else if z.HasExtensions() && z.DecExt(x.CompletionTime) { - } else if yym963 { + } else if yym966 { z.DecBinaryUnmarshal(x.CompletionTime) - } else if !yym963 && z.IsJSONHandle() { + } else if !yym966 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.CompletionTime) } else { z.DecFallback(x.CompletionTime, false) } } - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11372,13 +11384,13 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Active = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11388,13 +11400,13 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Succeeded = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11405,17 +11417,17 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Failed = int(r.DecodeInt(codecSelferBitsize1234)) } for { - yyj957++ - if yyhl957 { - yyb957 = yyj957 > l + yyj960++ + if yyhl960 { + yyb960 = yyj960 > l } else { - yyb957 = r.CheckBreak() + yyb960 = r.CheckBreak() } - if yyb957 { + if yyb960 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj957-1, "") + z.DecStructFieldNotFound(yyj960-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11424,8 +11436,8 @@ func (x JobConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym967 := z.EncBinary() - _ = yym967 + yym970 := z.EncBinary() + _ = yym970 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -11437,8 +11449,8 @@ func (x *JobConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym968 := z.DecBinary() - _ = yym968 + yym971 := z.DecBinary() + _ = yym971 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -11453,34 +11465,34 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym969 := z.EncBinary() - _ = yym969 + yym972 := z.EncBinary() + _ = yym972 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep970 := !z.EncBinary() - yy2arr970 := z.EncBasicHandle().StructToArray - var yyq970 [6]bool - _, _, _ = yysep970, yyq970, yy2arr970 - const yyr970 bool = false - yyq970[2] = true - yyq970[3] = true - yyq970[4] = x.Reason != "" - yyq970[5] = x.Message != "" - var yynn970 int - if yyr970 || yy2arr970 { + yysep973 := !z.EncBinary() + yy2arr973 := z.EncBasicHandle().StructToArray + var yyq973 [6]bool + _, _, _ = yysep973, yyq973, yy2arr973 + const yyr973 bool = false + yyq973[2] = true + yyq973[3] = true + yyq973[4] = x.Reason != "" + yyq973[5] = x.Message != "" + var yynn973 int + if yyr973 || yy2arr973 { r.EncodeArrayStart(6) } else { - yynn970 = 2 - for _, b := range yyq970 { + yynn973 = 2 + for _, b := range yyq973 { if b { - yynn970++ + yynn973++ } } - r.EncodeMapStart(yynn970) - yynn970 = 0 + r.EncodeMapStart(yynn973) + yynn973 = 0 } - if yyr970 || yy2arr970 { + if yyr973 || yy2arr973 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -11489,10 +11501,10 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr970 || yy2arr970 { + if yyr973 || yy2arr973 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym973 := z.EncBinary() - _ = yym973 + yym976 := z.EncBinary() + _ = yym976 if false { } else if z.HasExtensions() && z.EncExt(x.Status) { } else { @@ -11502,55 +11514,38 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym974 := z.EncBinary() - _ = yym974 + yym977 := z.EncBinary() + _ = yym977 if false { } else if z.HasExtensions() && z.EncExt(x.Status) { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Status)) } } - if yyr970 || yy2arr970 { + if yyr973 || yy2arr973 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq970[2] { - yy976 := &x.LastProbeTime - yym977 := z.EncBinary() - _ = yym977 + if yyq973[2] { + yy979 := &x.LastProbeTime + yym980 := z.EncBinary() + _ = yym980 if false { - } else if z.HasExtensions() && z.EncExt(yy976) { - } else if yym977 { - z.EncBinaryMarshal(yy976) - } else if !yym977 && z.IsJSONHandle() { - z.EncJSONMarshal(yy976) + } else if z.HasExtensions() && z.EncExt(yy979) { + } else if yym980 { + z.EncBinaryMarshal(yy979) + } else if !yym980 && z.IsJSONHandle() { + z.EncJSONMarshal(yy979) } else { - z.EncFallback(yy976) + z.EncFallback(yy979) } } else { r.EncodeNil() } } else { - if yyq970[2] { + if yyq973[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy978 := &x.LastProbeTime - yym979 := z.EncBinary() - _ = yym979 - if false { - } else if z.HasExtensions() && z.EncExt(yy978) { - } else if yym979 { - z.EncBinaryMarshal(yy978) - } else if !yym979 && z.IsJSONHandle() { - z.EncJSONMarshal(yy978) - } else { - z.EncFallback(yy978) - } - } - } - if yyr970 || yy2arr970 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq970[3] { - yy981 := &x.LastTransitionTime + yy981 := &x.LastProbeTime yym982 := z.EncBinary() _ = yym982 if false { @@ -11562,79 +11557,96 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { } else { z.EncFallback(yy981) } + } + } + if yyr973 || yy2arr973 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq973[3] { + yy984 := &x.LastTransitionTime + yym985 := z.EncBinary() + _ = yym985 + if false { + } else if z.HasExtensions() && z.EncExt(yy984) { + } else if yym985 { + z.EncBinaryMarshal(yy984) + } else if !yym985 && z.IsJSONHandle() { + z.EncJSONMarshal(yy984) + } else { + z.EncFallback(yy984) + } } else { r.EncodeNil() } } else { - if yyq970[3] { + if yyq973[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy983 := &x.LastTransitionTime - yym984 := z.EncBinary() - _ = yym984 - if false { - } else if z.HasExtensions() && z.EncExt(yy983) { - } else if yym984 { - z.EncBinaryMarshal(yy983) - } else if !yym984 && z.IsJSONHandle() { - z.EncJSONMarshal(yy983) - } else { - z.EncFallback(yy983) - } - } - } - if yyr970 || yy2arr970 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq970[4] { - yym986 := z.EncBinary() - _ = yym986 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq970[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("reason")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy986 := &x.LastTransitionTime yym987 := z.EncBinary() _ = yym987 if false { + } else if z.HasExtensions() && z.EncExt(yy986) { + } else if yym987 { + z.EncBinaryMarshal(yy986) + } else if !yym987 && z.IsJSONHandle() { + z.EncJSONMarshal(yy986) } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + z.EncFallback(yy986) } } } - if yyr970 || yy2arr970 { + if yyr973 || yy2arr973 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq970[5] { + if yyq973[4] { yym989 := z.EncBinary() _ = yym989 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq970[5] { + if yyq973[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("message")) + r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym990 := z.EncBinary() _ = yym990 if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) + } + } + } + if yyr973 || yy2arr973 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq973[5] { + yym992 := z.EncBinary() + _ = yym992 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Message)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq973[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("message")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym993 := z.EncBinary() + _ = yym993 + if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr970 || yy2arr970 { + if yyr973 || yy2arr973 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11647,25 +11659,25 @@ func (x *JobCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym991 := z.DecBinary() - _ = yym991 + yym994 := z.DecBinary() + _ = yym994 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct992 := r.ContainerType() - if yyct992 == codecSelferValueTypeMap1234 { - yyl992 := r.ReadMapStart() - if yyl992 == 0 { + yyct995 := r.ContainerType() + if yyct995 == codecSelferValueTypeMap1234 { + yyl995 := r.ReadMapStart() + if yyl995 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl992, d) + x.codecDecodeSelfFromMap(yyl995, d) } - } else if yyct992 == codecSelferValueTypeArray1234 { - yyl992 := r.ReadArrayStart() - if yyl992 == 0 { + } else if yyct995 == codecSelferValueTypeArray1234 { + yyl995 := r.ReadArrayStart() + if yyl995 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl992, d) + x.codecDecodeSelfFromArray(yyl995, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11677,12 +11689,12 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys993Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys993Slc - var yyhl993 bool = l >= 0 - for yyj993 := 0; ; yyj993++ { - if yyhl993 { - if yyj993 >= l { + var yys996Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys996Slc + var yyhl996 bool = l >= 0 + for yyj996 := 0; ; yyj996++ { + if yyhl996 { + if yyj996 >= l { break } } else { @@ -11691,10 +11703,10 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys993Slc = r.DecodeBytes(yys993Slc, true, true) - yys993 := string(yys993Slc) + yys996Slc = r.DecodeBytes(yys996Slc, true, true) + yys996 := string(yys996Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys993 { + switch yys996 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -11711,34 +11723,34 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg1_unversioned.Time{} } else { - yyv996 := &x.LastProbeTime - yym997 := z.DecBinary() - _ = yym997 + yyv999 := &x.LastProbeTime + yym1000 := z.DecBinary() + _ = yym1000 if false { - } else if z.HasExtensions() && z.DecExt(yyv996) { - } else if yym997 { - z.DecBinaryUnmarshal(yyv996) - } else if !yym997 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv996) + } else if z.HasExtensions() && z.DecExt(yyv999) { + } else if yym1000 { + z.DecBinaryUnmarshal(yyv999) + } else if !yym1000 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv999) } else { - z.DecFallback(yyv996, false) + z.DecFallback(yyv999, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg1_unversioned.Time{} } else { - yyv998 := &x.LastTransitionTime - yym999 := z.DecBinary() - _ = yym999 + yyv1001 := &x.LastTransitionTime + yym1002 := z.DecBinary() + _ = yym1002 if false { - } else if z.HasExtensions() && z.DecExt(yyv998) { - } else if yym999 { - z.DecBinaryUnmarshal(yyv998) - } else if !yym999 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv998) + } else if z.HasExtensions() && z.DecExt(yyv1001) { + } else if yym1002 { + z.DecBinaryUnmarshal(yyv1001) + } else if !yym1002 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1001) } else { - z.DecFallback(yyv998, false) + z.DecFallback(yyv1001, false) } } case "reason": @@ -11754,9 +11766,9 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys993) - } // end switch yys993 - } // end for yyj993 + z.DecStructFieldNotFound(-1, yys996) + } // end switch yys996 + } // end for yyj996 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11764,16 +11776,16 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1002 int - var yyb1002 bool - var yyhl1002 bool = l >= 0 - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + var yyj1005 int + var yyb1005 bool + var yyhl1005 bool = l >= 0 + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11783,13 +11795,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = JobConditionType(r.DecodeString()) } - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11799,13 +11811,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = pkg2_api.ConditionStatus(r.DecodeString()) } - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11813,26 +11825,26 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg1_unversioned.Time{} } else { - yyv1005 := &x.LastProbeTime - yym1006 := z.DecBinary() - _ = yym1006 + yyv1008 := &x.LastProbeTime + yym1009 := z.DecBinary() + _ = yym1009 if false { - } else if z.HasExtensions() && z.DecExt(yyv1005) { - } else if yym1006 { - z.DecBinaryUnmarshal(yyv1005) - } else if !yym1006 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1005) + } else if z.HasExtensions() && z.DecExt(yyv1008) { + } else if yym1009 { + z.DecBinaryUnmarshal(yyv1008) + } else if !yym1009 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1008) } else { - z.DecFallback(yyv1005, false) + z.DecFallback(yyv1008, false) } } - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11840,26 +11852,26 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg1_unversioned.Time{} } else { - yyv1007 := &x.LastTransitionTime - yym1008 := z.DecBinary() - _ = yym1008 + yyv1010 := &x.LastTransitionTime + yym1011 := z.DecBinary() + _ = yym1011 if false { - } else if z.HasExtensions() && z.DecExt(yyv1007) { - } else if yym1008 { - z.DecBinaryUnmarshal(yyv1007) - } else if !yym1008 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1007) + } else if z.HasExtensions() && z.DecExt(yyv1010) { + } else if yym1011 { + z.DecBinaryUnmarshal(yyv1010) + } else if !yym1011 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1010) } else { - z.DecFallback(yyv1007, false) + z.DecFallback(yyv1010, false) } } - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11869,13 +11881,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11886,17 +11898,17 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj1002++ - if yyhl1002 { - yyb1002 = yyj1002 > l + yyj1005++ + if yyhl1005 { + yyb1005 = yyj1005 > l } else { - yyb1002 = r.CheckBreak() + yyb1005 = r.CheckBreak() } - if yyb1002 { + if yyb1005 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1002-1, "") + z.DecStructFieldNotFound(yyj1005-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11908,136 +11920,136 @@ func (x *Ingress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1011 := z.EncBinary() - _ = yym1011 + yym1014 := z.EncBinary() + _ = yym1014 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1012 := !z.EncBinary() - yy2arr1012 := z.EncBasicHandle().StructToArray - var yyq1012 [5]bool - _, _, _ = yysep1012, yyq1012, yy2arr1012 - const yyr1012 bool = false - yyq1012[0] = x.Kind != "" - yyq1012[1] = x.APIVersion != "" - yyq1012[2] = true - yyq1012[3] = true - yyq1012[4] = true - var yynn1012 int - if yyr1012 || yy2arr1012 { + yysep1015 := !z.EncBinary() + yy2arr1015 := z.EncBasicHandle().StructToArray + var yyq1015 [5]bool + _, _, _ = yysep1015, yyq1015, yy2arr1015 + const yyr1015 bool = false + yyq1015[0] = true + yyq1015[1] = true + yyq1015[2] = true + yyq1015[3] = x.Kind != "" + yyq1015[4] = x.APIVersion != "" + var yynn1015 int + if yyr1015 || yy2arr1015 { r.EncodeArrayStart(5) } else { - yynn1012 = 0 - for _, b := range yyq1012 { + yynn1015 = 0 + for _, b := range yyq1015 { if b { - yynn1012++ + yynn1015++ } } - r.EncodeMapStart(yynn1012) - yynn1012 = 0 + r.EncodeMapStart(yynn1015) + yynn1015 = 0 } - if yyr1012 || yy2arr1012 { + if yyr1015 || yy2arr1015 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1012[0] { - yym1014 := z.EncBinary() - _ = yym1014 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + if yyq1015[0] { + yy1017 := &x.ObjectMeta + yy1017.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { - if yyq1012[0] { + if yyq1015[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1015 := z.EncBinary() - _ = yym1015 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy1018 := &x.ObjectMeta + yy1018.CodecEncodeSelf(e) } } - if yyr1012 || yy2arr1012 { + if yyr1015 || yy2arr1015 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1012[1] { - yym1017 := z.EncBinary() - _ = yym1017 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1012[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1018 := z.EncBinary() - _ = yym1018 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1012 || yy2arr1012 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1012[2] { - yy1020 := &x.ObjectMeta + if yyq1015[1] { + yy1020 := &x.Spec yy1020.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1012[2] { + if yyq1015[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1021 := &x.ObjectMeta + yy1021 := &x.Spec yy1021.CodecEncodeSelf(e) } } - if yyr1012 || yy2arr1012 { + if yyr1015 || yy2arr1015 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1012[3] { - yy1023 := &x.Spec + if yyq1015[2] { + yy1023 := &x.Status yy1023.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1012[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1024 := &x.Spec - yy1024.CodecEncodeSelf(e) - } - } - if yyr1012 || yy2arr1012 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1012[4] { - yy1026 := &x.Status - yy1026.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1012[4] { + if yyq1015[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1027 := &x.Status - yy1027.CodecEncodeSelf(e) + yy1024 := &x.Status + yy1024.CodecEncodeSelf(e) } } - if yyr1012 || yy2arr1012 { + if yyr1015 || yy2arr1015 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1015[3] { + yym1026 := z.EncBinary() + _ = yym1026 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1015[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1027 := z.EncBinary() + _ = yym1027 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1015 || yy2arr1015 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1015[4] { + yym1029 := z.EncBinary() + _ = yym1029 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1015[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1030 := z.EncBinary() + _ = yym1030 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1015 || yy2arr1015 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12050,25 +12062,25 @@ func (x *Ingress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1028 := z.DecBinary() - _ = yym1028 + yym1031 := z.DecBinary() + _ = yym1031 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1029 := r.ContainerType() - if yyct1029 == codecSelferValueTypeMap1234 { - yyl1029 := r.ReadMapStart() - if yyl1029 == 0 { + yyct1032 := r.ContainerType() + if yyct1032 == codecSelferValueTypeMap1234 { + yyl1032 := r.ReadMapStart() + if yyl1032 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1029, d) + x.codecDecodeSelfFromMap(yyl1032, d) } - } else if yyct1029 == codecSelferValueTypeArray1234 { - yyl1029 := r.ReadArrayStart() - if yyl1029 == 0 { + } else if yyct1032 == codecSelferValueTypeArray1234 { + yyl1032 := r.ReadArrayStart() + if yyl1032 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1029, d) + x.codecDecodeSelfFromArray(yyl1032, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12080,12 +12092,12 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1030Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1030Slc - var yyhl1030 bool = l >= 0 - for yyj1030 := 0; ; yyj1030++ { - if yyhl1030 { - if yyj1030 >= l { + var yys1033Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1033Slc + var yyhl1033 bool = l >= 0 + for yyj1033 := 0; ; yyj1033++ { + if yyhl1033 { + if yyj1033 >= l { break } } else { @@ -12094,10 +12106,31 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1030Slc = r.DecodeBytes(yys1030Slc, true, true) - yys1030 := string(yys1030Slc) + yys1033Slc = r.DecodeBytes(yys1033Slc, true, true) + yys1033 := string(yys1033Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1030 { + switch yys1033 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1034 := &x.ObjectMeta + yyv1034.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = IngressSpec{} + } else { + yyv1035 := &x.Spec + yyv1035.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = IngressStatus{} + } else { + yyv1036 := &x.Status + yyv1036.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -12110,31 +12143,10 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1033 := &x.ObjectMeta - yyv1033.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = IngressSpec{} - } else { - yyv1034 := &x.Spec - yyv1034.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = IngressStatus{} - } else { - yyv1035 := &x.Status - yyv1035.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1030) - } // end switch yys1030 - } // end for yyj1030 + z.DecStructFieldNotFound(-1, yys1033) + } // end switch yys1033 + } // end for yyj1033 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12142,16 +12154,67 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1036 int - var yyb1036 bool - var yyhl1036 bool = l >= 0 - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l + var yyj1039 int + var yyb1039 bool + var yyhl1039 bool = l >= 0 + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l } else { - yyb1036 = r.CheckBreak() + yyb1039 = r.CheckBreak() } - if yyb1036 { + if yyb1039 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1040 := &x.ObjectMeta + yyv1040.CodecDecodeSelf(d) + } + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l + } else { + yyb1039 = r.CheckBreak() + } + if yyb1039 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = IngressSpec{} + } else { + yyv1041 := &x.Spec + yyv1041.CodecDecodeSelf(d) + } + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l + } else { + yyb1039 = r.CheckBreak() + } + if yyb1039 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = IngressStatus{} + } else { + yyv1042 := &x.Status + yyv1042.CodecDecodeSelf(d) + } + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l + } else { + yyb1039 = r.CheckBreak() + } + if yyb1039 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12161,13 +12224,13 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l } else { - yyb1036 = r.CheckBreak() + yyb1039 = r.CheckBreak() } - if yyb1036 { + if yyb1039 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12177,69 +12240,18 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l - } else { - yyb1036 = r.CheckBreak() - } - if yyb1036 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1039 := &x.ObjectMeta - yyv1039.CodecDecodeSelf(d) - } - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l - } else { - yyb1036 = r.CheckBreak() - } - if yyb1036 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = IngressSpec{} - } else { - yyv1040 := &x.Spec - yyv1040.CodecDecodeSelf(d) - } - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l - } else { - yyb1036 = r.CheckBreak() - } - if yyb1036 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = IngressStatus{} - } else { - yyv1041 := &x.Status - yyv1041.CodecDecodeSelf(d) - } for { - yyj1036++ - if yyhl1036 { - yyb1036 = yyj1036 > l + yyj1039++ + if yyhl1039 { + yyb1039 = yyj1039 > l } else { - yyb1036 = r.CheckBreak() + yyb1039 = r.CheckBreak() } - if yyb1036 { + if yyb1039 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1036-1, "") + z.DecStructFieldNotFound(yyj1039-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12251,118 +12263,68 @@ func (x *IngressList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1042 := z.EncBinary() - _ = yym1042 + yym1045 := z.EncBinary() + _ = yym1045 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1043 := !z.EncBinary() - yy2arr1043 := z.EncBasicHandle().StructToArray - var yyq1043 [4]bool - _, _, _ = yysep1043, yyq1043, yy2arr1043 - const yyr1043 bool = false - yyq1043[0] = x.Kind != "" - yyq1043[1] = x.APIVersion != "" - yyq1043[2] = true - var yynn1043 int - if yyr1043 || yy2arr1043 { + yysep1046 := !z.EncBinary() + yy2arr1046 := z.EncBasicHandle().StructToArray + var yyq1046 [4]bool + _, _, _ = yysep1046, yyq1046, yy2arr1046 + const yyr1046 bool = false + yyq1046[0] = true + yyq1046[2] = x.Kind != "" + yyq1046[3] = x.APIVersion != "" + var yynn1046 int + if yyr1046 || yy2arr1046 { r.EncodeArrayStart(4) } else { - yynn1043 = 1 - for _, b := range yyq1043 { + yynn1046 = 1 + for _, b := range yyq1046 { if b { - yynn1043++ + yynn1046++ } } - r.EncodeMapStart(yynn1043) - yynn1043 = 0 + r.EncodeMapStart(yynn1046) + yynn1046 = 0 } - if yyr1043 || yy2arr1043 { + if yyr1046 || yy2arr1046 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1043[0] { - yym1045 := z.EncBinary() - _ = yym1045 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1043[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1046 := z.EncBinary() - _ = yym1046 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1043 || yy2arr1043 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1043[1] { - yym1048 := z.EncBinary() - _ = yym1048 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1043[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyq1046[0] { + yy1048 := &x.ListMeta yym1049 := z.EncBinary() _ = yym1049 if false { + } else if z.HasExtensions() && z.EncExt(yy1048) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1043 || yy2arr1043 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1043[2] { - yy1051 := &x.ListMeta - yym1052 := z.EncBinary() - _ = yym1052 - if false { - } else if z.HasExtensions() && z.EncExt(yy1051) { - } else { - z.EncFallback(yy1051) + z.EncFallback(yy1048) } } else { r.EncodeNil() } } else { - if yyq1043[2] { + if yyq1046[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1053 := &x.ListMeta - yym1054 := z.EncBinary() - _ = yym1054 + yy1050 := &x.ListMeta + yym1051 := z.EncBinary() + _ = yym1051 if false { - } else if z.HasExtensions() && z.EncExt(yy1053) { + } else if z.HasExtensions() && z.EncExt(yy1050) { } else { - z.EncFallback(yy1053) + z.EncFallback(yy1050) } } } - if yyr1043 || yy2arr1043 { + if yyr1046 || yy2arr1046 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1056 := z.EncBinary() - _ = yym1056 + yym1053 := z.EncBinary() + _ = yym1053 if false { } else { h.encSliceIngress(([]Ingress)(x.Items), e) @@ -12375,15 +12337,65 @@ func (x *IngressList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1057 := z.EncBinary() - _ = yym1057 + yym1054 := z.EncBinary() + _ = yym1054 if false { } else { h.encSliceIngress(([]Ingress)(x.Items), e) } } } - if yyr1043 || yy2arr1043 { + if yyr1046 || yy2arr1046 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1046[2] { + yym1056 := z.EncBinary() + _ = yym1056 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1046[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1057 := z.EncBinary() + _ = yym1057 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1046 || yy2arr1046 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1046[3] { + yym1059 := z.EncBinary() + _ = yym1059 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1046[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1060 := z.EncBinary() + _ = yym1060 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1046 || yy2arr1046 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12396,25 +12408,25 @@ func (x *IngressList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1058 := z.DecBinary() - _ = yym1058 + yym1061 := z.DecBinary() + _ = yym1061 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1059 := r.ContainerType() - if yyct1059 == codecSelferValueTypeMap1234 { - yyl1059 := r.ReadMapStart() - if yyl1059 == 0 { + yyct1062 := r.ContainerType() + if yyct1062 == codecSelferValueTypeMap1234 { + yyl1062 := r.ReadMapStart() + if yyl1062 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1059, d) + x.codecDecodeSelfFromMap(yyl1062, d) } - } else if yyct1059 == codecSelferValueTypeArray1234 { - yyl1059 := r.ReadArrayStart() - if yyl1059 == 0 { + } else if yyct1062 == codecSelferValueTypeArray1234 { + yyl1062 := r.ReadArrayStart() + if yyl1062 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1059, d) + x.codecDecodeSelfFromArray(yyl1062, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12426,12 +12438,12 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1060Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1060Slc - var yyhl1060 bool = l >= 0 - for yyj1060 := 0; ; yyj1060++ { - if yyhl1060 { - if yyj1060 >= l { + var yys1063Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1063Slc + var yyhl1063 bool = l >= 0 + for yyj1063 := 0; ; yyj1063++ { + if yyhl1063 { + if yyj1063 >= l { break } } else { @@ -12440,10 +12452,35 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1060Slc = r.DecodeBytes(yys1060Slc, true, true) - yys1060 := string(yys1060Slc) + yys1063Slc = r.DecodeBytes(yys1063Slc, true, true) + yys1063 := string(yys1063Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1060 { + switch yys1063 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1064 := &x.ListMeta + yym1065 := z.DecBinary() + _ = yym1065 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1064) { + } else { + z.DecFallback(yyv1064, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1066 := &x.Items + yym1067 := z.DecBinary() + _ = yym1067 + if false { + } else { + h.decSliceIngress((*[]Ingress)(yyv1066), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -12456,35 +12493,10 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1063 := &x.ListMeta - yym1064 := z.DecBinary() - _ = yym1064 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1063) { - } else { - z.DecFallback(yyv1063, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1065 := &x.Items - yym1066 := z.DecBinary() - _ = yym1066 - if false { - } else { - h.decSliceIngress((*[]Ingress)(yyv1065), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1060) - } // end switch yys1060 - } // end for yyj1060 + z.DecStructFieldNotFound(-1, yys1063) + } // end switch yys1063 + } // end for yyj1063 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12492,16 +12504,61 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1067 int - var yyb1067 bool - var yyhl1067 bool = l >= 0 - yyj1067++ - if yyhl1067 { - yyb1067 = yyj1067 > l + var yyj1070 int + var yyb1070 bool + var yyhl1070 bool = l >= 0 + yyj1070++ + if yyhl1070 { + yyb1070 = yyj1070 > l } else { - yyb1067 = r.CheckBreak() + yyb1070 = r.CheckBreak() } - if yyb1067 { + if yyb1070 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1071 := &x.ListMeta + yym1072 := z.DecBinary() + _ = yym1072 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1071) { + } else { + z.DecFallback(yyv1071, false) + } + } + yyj1070++ + if yyhl1070 { + yyb1070 = yyj1070 > l + } else { + yyb1070 = r.CheckBreak() + } + if yyb1070 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1073 := &x.Items + yym1074 := z.DecBinary() + _ = yym1074 + if false { + } else { + h.decSliceIngress((*[]Ingress)(yyv1073), d) + } + } + yyj1070++ + if yyhl1070 { + yyb1070 = yyj1070 > l + } else { + yyb1070 = r.CheckBreak() + } + if yyb1070 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12511,13 +12568,13 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1067++ - if yyhl1067 { - yyb1067 = yyj1067 > l + yyj1070++ + if yyhl1070 { + yyb1070 = yyj1070 > l } else { - yyb1067 = r.CheckBreak() + yyb1070 = r.CheckBreak() } - if yyb1067 { + if yyb1070 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12527,63 +12584,18 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1067++ - if yyhl1067 { - yyb1067 = yyj1067 > l - } else { - yyb1067 = r.CheckBreak() - } - if yyb1067 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1070 := &x.ListMeta - yym1071 := z.DecBinary() - _ = yym1071 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1070) { - } else { - z.DecFallback(yyv1070, false) - } - } - yyj1067++ - if yyhl1067 { - yyb1067 = yyj1067 > l - } else { - yyb1067 = r.CheckBreak() - } - if yyb1067 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1072 := &x.Items - yym1073 := z.DecBinary() - _ = yym1073 - if false { - } else { - h.decSliceIngress((*[]Ingress)(yyv1072), d) - } - } for { - yyj1067++ - if yyhl1067 { - yyb1067 = yyj1067 > l + yyj1070++ + if yyhl1070 { + yyb1070 = yyj1070 > l } else { - yyb1067 = r.CheckBreak() + yyb1070 = r.CheckBreak() } - if yyb1067 { + if yyb1070 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1067-1, "") + z.DecStructFieldNotFound(yyj1070-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12595,34 +12607,35 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1074 := z.EncBinary() - _ = yym1074 + yym1077 := z.EncBinary() + _ = yym1077 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1075 := !z.EncBinary() - yy2arr1075 := z.EncBasicHandle().StructToArray - var yyq1075 [2]bool - _, _, _ = yysep1075, yyq1075, yy2arr1075 - const yyr1075 bool = false - yyq1075[0] = x.Backend != nil - yyq1075[1] = len(x.Rules) != 0 - var yynn1075 int - if yyr1075 || yy2arr1075 { - r.EncodeArrayStart(2) + yysep1078 := !z.EncBinary() + yy2arr1078 := z.EncBasicHandle().StructToArray + var yyq1078 [3]bool + _, _, _ = yysep1078, yyq1078, yy2arr1078 + const yyr1078 bool = false + yyq1078[0] = x.Backend != nil + yyq1078[1] = len(x.TLS) != 0 + yyq1078[2] = len(x.Rules) != 0 + var yynn1078 int + if yyr1078 || yy2arr1078 { + r.EncodeArrayStart(3) } else { - yynn1075 = 0 - for _, b := range yyq1075 { + yynn1078 = 0 + for _, b := range yyq1078 { if b { - yynn1075++ + yynn1078++ } } - r.EncodeMapStart(yynn1075) - yynn1075 = 0 + r.EncodeMapStart(yynn1078) + yynn1078 = 0 } - if yyr1075 || yy2arr1075 { + if yyr1078 || yy2arr1078 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1075[0] { + if yyq1078[0] { if x.Backend == nil { r.EncodeNil() } else { @@ -12632,7 +12645,7 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1075[0] { + if yyq1078[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("backend")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -12643,14 +12656,47 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1075 || yy2arr1075 { + if yyr1078 || yy2arr1078 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1075[1] { + if yyq1078[1] { + if x.TLS == nil { + r.EncodeNil() + } else { + yym1081 := z.EncBinary() + _ = yym1081 + if false { + } else { + h.encSliceIngressTLS(([]IngressTLS)(x.TLS), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1078[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tls")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TLS == nil { + r.EncodeNil() + } else { + yym1082 := z.EncBinary() + _ = yym1082 + if false { + } else { + h.encSliceIngressTLS(([]IngressTLS)(x.TLS), e) + } + } + } + } + if yyr1078 || yy2arr1078 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1078[2] { if x.Rules == nil { r.EncodeNil() } else { - yym1078 := z.EncBinary() - _ = yym1078 + yym1084 := z.EncBinary() + _ = yym1084 if false { } else { h.encSliceIngressRule(([]IngressRule)(x.Rules), e) @@ -12660,15 +12706,15 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1075[1] { + if yyq1078[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rules")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Rules == nil { r.EncodeNil() } else { - yym1079 := z.EncBinary() - _ = yym1079 + yym1085 := z.EncBinary() + _ = yym1085 if false { } else { h.encSliceIngressRule(([]IngressRule)(x.Rules), e) @@ -12676,7 +12722,7 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1075 || yy2arr1075 { + if yyr1078 || yy2arr1078 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12689,25 +12735,25 @@ func (x *IngressSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1080 := z.DecBinary() - _ = yym1080 + yym1086 := z.DecBinary() + _ = yym1086 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1081 := r.ContainerType() - if yyct1081 == codecSelferValueTypeMap1234 { - yyl1081 := r.ReadMapStart() - if yyl1081 == 0 { + yyct1087 := r.ContainerType() + if yyct1087 == codecSelferValueTypeMap1234 { + yyl1087 := r.ReadMapStart() + if yyl1087 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1081, d) + x.codecDecodeSelfFromMap(yyl1087, d) } - } else if yyct1081 == codecSelferValueTypeArray1234 { - yyl1081 := r.ReadArrayStart() - if yyl1081 == 0 { + } else if yyct1087 == codecSelferValueTypeArray1234 { + yyl1087 := r.ReadArrayStart() + if yyl1087 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1081, d) + x.codecDecodeSelfFromArray(yyl1087, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12719,12 +12765,12 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1082Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1082Slc - var yyhl1082 bool = l >= 0 - for yyj1082 := 0; ; yyj1082++ { - if yyhl1082 { - if yyj1082 >= l { + var yys1088Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1088Slc + var yyhl1088 bool = l >= 0 + for yyj1088 := 0; ; yyj1088++ { + if yyhl1088 { + if yyj1088 >= l { break } } else { @@ -12733,10 +12779,10 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1082Slc = r.DecodeBytes(yys1082Slc, true, true) - yys1082 := string(yys1082Slc) + yys1088Slc = r.DecodeBytes(yys1088Slc, true, true) + yys1088 := string(yys1088Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1082 { + switch yys1088 { case "backend": if r.TryDecodeAsNil() { if x.Backend != nil { @@ -12748,22 +12794,34 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.Backend.CodecDecodeSelf(d) } + case "tls": + if r.TryDecodeAsNil() { + x.TLS = nil + } else { + yyv1090 := &x.TLS + yym1091 := z.DecBinary() + _ = yym1091 + if false { + } else { + h.decSliceIngressTLS((*[]IngressTLS)(yyv1090), d) + } + } case "rules": if r.TryDecodeAsNil() { x.Rules = nil } else { - yyv1084 := &x.Rules - yym1085 := z.DecBinary() - _ = yym1085 + yyv1092 := &x.Rules + yym1093 := z.DecBinary() + _ = yym1093 if false { } else { - h.decSliceIngressRule((*[]IngressRule)(yyv1084), d) + h.decSliceIngressRule((*[]IngressRule)(yyv1092), d) } } default: - z.DecStructFieldNotFound(-1, yys1082) - } // end switch yys1082 - } // end for yyj1082 + z.DecStructFieldNotFound(-1, yys1088) + } // end switch yys1088 + } // end for yyj1088 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12771,16 +12829,16 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1086 int - var yyb1086 bool - var yyhl1086 bool = l >= 0 - yyj1086++ - if yyhl1086 { - yyb1086 = yyj1086 > l + var yyj1094 int + var yyb1094 bool + var yyhl1094 bool = l >= 0 + yyj1094++ + if yyhl1094 { + yyb1094 = yyj1094 > l } else { - yyb1086 = r.CheckBreak() + yyb1094 = r.CheckBreak() } - if yyb1086 { + if yyb1094 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12795,13 +12853,35 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Backend.CodecDecodeSelf(d) } - yyj1086++ - if yyhl1086 { - yyb1086 = yyj1086 > l + yyj1094++ + if yyhl1094 { + yyb1094 = yyj1094 > l } else { - yyb1086 = r.CheckBreak() + yyb1094 = r.CheckBreak() } - if yyb1086 { + if yyb1094 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TLS = nil + } else { + yyv1096 := &x.TLS + yym1097 := z.DecBinary() + _ = yym1097 + if false { + } else { + h.decSliceIngressTLS((*[]IngressTLS)(yyv1096), d) + } + } + yyj1094++ + if yyhl1094 { + yyb1094 = yyj1094 > l + } else { + yyb1094 = r.CheckBreak() + } + if yyb1094 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12809,26 +12889,263 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Rules = nil } else { - yyv1088 := &x.Rules - yym1089 := z.DecBinary() - _ = yym1089 + yyv1098 := &x.Rules + yym1099 := z.DecBinary() + _ = yym1099 if false { } else { - h.decSliceIngressRule((*[]IngressRule)(yyv1088), d) + h.decSliceIngressRule((*[]IngressRule)(yyv1098), d) } } for { - yyj1086++ - if yyhl1086 { - yyb1086 = yyj1086 > l + yyj1094++ + if yyhl1094 { + yyb1094 = yyj1094 > l } else { - yyb1086 = r.CheckBreak() + yyb1094 = r.CheckBreak() } - if yyb1086 { + if yyb1094 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1086-1, "") + z.DecStructFieldNotFound(yyj1094-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *IngressTLS) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1100 := z.EncBinary() + _ = yym1100 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1101 := !z.EncBinary() + yy2arr1101 := z.EncBasicHandle().StructToArray + var yyq1101 [2]bool + _, _, _ = yysep1101, yyq1101, yy2arr1101 + const yyr1101 bool = false + yyq1101[0] = len(x.Hosts) != 0 + yyq1101[1] = x.SecretName != "" + var yynn1101 int + if yyr1101 || yy2arr1101 { + r.EncodeArrayStart(2) + } else { + yynn1101 = 0 + for _, b := range yyq1101 { + if b { + yynn1101++ + } + } + r.EncodeMapStart(yynn1101) + yynn1101 = 0 + } + if yyr1101 || yy2arr1101 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1101[0] { + if x.Hosts == nil { + r.EncodeNil() + } else { + yym1103 := z.EncBinary() + _ = yym1103 + if false { + } else { + z.F.EncSliceStringV(x.Hosts, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1101[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hosts")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Hosts == nil { + r.EncodeNil() + } else { + yym1104 := z.EncBinary() + _ = yym1104 + if false { + } else { + z.F.EncSliceStringV(x.Hosts, false, e) + } + } + } + } + if yyr1101 || yy2arr1101 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1101[1] { + yym1106 := z.EncBinary() + _ = yym1106 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1101[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("secretName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1107 := z.EncBinary() + _ = yym1107 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } + } + if yyr1101 || yy2arr1101 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *IngressTLS) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1108 := z.DecBinary() + _ = yym1108 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1109 := r.ContainerType() + if yyct1109 == codecSelferValueTypeMap1234 { + yyl1109 := r.ReadMapStart() + if yyl1109 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1109, d) + } + } else if yyct1109 == codecSelferValueTypeArray1234 { + yyl1109 := r.ReadArrayStart() + if yyl1109 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1109, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *IngressTLS) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1110Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1110Slc + var yyhl1110 bool = l >= 0 + for yyj1110 := 0; ; yyj1110++ { + if yyhl1110 { + if yyj1110 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1110Slc = r.DecodeBytes(yys1110Slc, true, true) + yys1110 := string(yys1110Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1110 { + case "hosts": + if r.TryDecodeAsNil() { + x.Hosts = nil + } else { + yyv1111 := &x.Hosts + yym1112 := z.DecBinary() + _ = yym1112 + if false { + } else { + z.F.DecSliceStringX(yyv1111, false, d) + } + } + case "secretName": + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1110) + } // end switch yys1110 + } // end for yyj1110 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *IngressTLS) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1114 int + var yyb1114 bool + var yyhl1114 bool = l >= 0 + yyj1114++ + if yyhl1114 { + yyb1114 = yyj1114 > l + } else { + yyb1114 = r.CheckBreak() + } + if yyb1114 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hosts = nil + } else { + yyv1115 := &x.Hosts + yym1116 := z.DecBinary() + _ = yym1116 + if false { + } else { + z.F.DecSliceStringX(yyv1115, false, d) + } + } + yyj1114++ + if yyhl1114 { + yyb1114 = yyj1114 > l + } else { + yyb1114 = r.CheckBreak() + } + if yyb1114 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + for { + yyj1114++ + if yyhl1114 { + yyb1114 = yyj1114 > l + } else { + yyb1114 = r.CheckBreak() + } + if yyb1114 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1114-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12840,48 +13157,48 @@ func (x *IngressStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1090 := z.EncBinary() - _ = yym1090 + yym1118 := z.EncBinary() + _ = yym1118 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1091 := !z.EncBinary() - yy2arr1091 := z.EncBasicHandle().StructToArray - var yyq1091 [1]bool - _, _, _ = yysep1091, yyq1091, yy2arr1091 - const yyr1091 bool = false - yyq1091[0] = true - var yynn1091 int - if yyr1091 || yy2arr1091 { + yysep1119 := !z.EncBinary() + yy2arr1119 := z.EncBasicHandle().StructToArray + var yyq1119 [1]bool + _, _, _ = yysep1119, yyq1119, yy2arr1119 + const yyr1119 bool = false + yyq1119[0] = true + var yynn1119 int + if yyr1119 || yy2arr1119 { r.EncodeArrayStart(1) } else { - yynn1091 = 0 - for _, b := range yyq1091 { + yynn1119 = 0 + for _, b := range yyq1119 { if b { - yynn1091++ + yynn1119++ } } - r.EncodeMapStart(yynn1091) - yynn1091 = 0 + r.EncodeMapStart(yynn1119) + yynn1119 = 0 } - if yyr1091 || yy2arr1091 { + if yyr1119 || yy2arr1119 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1091[0] { - yy1093 := &x.LoadBalancer - yy1093.CodecEncodeSelf(e) + if yyq1119[0] { + yy1121 := &x.LoadBalancer + yy1121.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1091[0] { + if yyq1119[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1094 := &x.LoadBalancer - yy1094.CodecEncodeSelf(e) + yy1122 := &x.LoadBalancer + yy1122.CodecEncodeSelf(e) } } - if yyr1091 || yy2arr1091 { + if yyr1119 || yy2arr1119 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12894,25 +13211,25 @@ func (x *IngressStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1095 := z.DecBinary() - _ = yym1095 + yym1123 := z.DecBinary() + _ = yym1123 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1096 := r.ContainerType() - if yyct1096 == codecSelferValueTypeMap1234 { - yyl1096 := r.ReadMapStart() - if yyl1096 == 0 { + yyct1124 := r.ContainerType() + if yyct1124 == codecSelferValueTypeMap1234 { + yyl1124 := r.ReadMapStart() + if yyl1124 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1096, d) + x.codecDecodeSelfFromMap(yyl1124, d) } - } else if yyct1096 == codecSelferValueTypeArray1234 { - yyl1096 := r.ReadArrayStart() - if yyl1096 == 0 { + } else if yyct1124 == codecSelferValueTypeArray1234 { + yyl1124 := r.ReadArrayStart() + if yyl1124 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1096, d) + x.codecDecodeSelfFromArray(yyl1124, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12924,12 +13241,12 @@ func (x *IngressStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1097Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1097Slc - var yyhl1097 bool = l >= 0 - for yyj1097 := 0; ; yyj1097++ { - if yyhl1097 { - if yyj1097 >= l { + var yys1125Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1125Slc + var yyhl1125 bool = l >= 0 + for yyj1125 := 0; ; yyj1125++ { + if yyhl1125 { + if yyj1125 >= l { break } } else { @@ -12938,21 +13255,21 @@ func (x *IngressStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1097Slc = r.DecodeBytes(yys1097Slc, true, true) - yys1097 := string(yys1097Slc) + yys1125Slc = r.DecodeBytes(yys1125Slc, true, true) + yys1125 := string(yys1125Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1097 { + switch yys1125 { case "loadBalancer": if r.TryDecodeAsNil() { x.LoadBalancer = pkg2_api.LoadBalancerStatus{} } else { - yyv1098 := &x.LoadBalancer - yyv1098.CodecDecodeSelf(d) + yyv1126 := &x.LoadBalancer + yyv1126.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1097) - } // end switch yys1097 - } // end for yyj1097 + z.DecStructFieldNotFound(-1, yys1125) + } // end switch yys1125 + } // end for yyj1125 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12960,16 +13277,16 @@ func (x *IngressStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1099 int - var yyb1099 bool - var yyhl1099 bool = l >= 0 - yyj1099++ - if yyhl1099 { - yyb1099 = yyj1099 > l + var yyj1127 int + var yyb1127 bool + var yyhl1127 bool = l >= 0 + yyj1127++ + if yyhl1127 { + yyb1127 = yyj1127 > l } else { - yyb1099 = r.CheckBreak() + yyb1127 = r.CheckBreak() } - if yyb1099 { + if yyb1127 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12977,21 +13294,21 @@ func (x *IngressStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LoadBalancer = pkg2_api.LoadBalancerStatus{} } else { - yyv1100 := &x.LoadBalancer - yyv1100.CodecDecodeSelf(d) + yyv1128 := &x.LoadBalancer + yyv1128.CodecDecodeSelf(d) } for { - yyj1099++ - if yyhl1099 { - yyb1099 = yyj1099 > l + yyj1127++ + if yyhl1127 { + yyb1127 = yyj1127 > l } else { - yyb1099 = r.CheckBreak() + yyb1127 = r.CheckBreak() } - if yyb1099 { + if yyb1127 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1099-1, "") + z.DecStructFieldNotFound(yyj1127-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13003,36 +13320,36 @@ func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1101 := z.EncBinary() - _ = yym1101 + yym1129 := z.EncBinary() + _ = yym1129 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1102 := !z.EncBinary() - yy2arr1102 := z.EncBasicHandle().StructToArray - var yyq1102 [2]bool - _, _, _ = yysep1102, yyq1102, yy2arr1102 - const yyr1102 bool = false - yyq1102[0] = x.Host != "" - yyq1102[1] = x.IngressRuleValue.HTTP != nil && x.HTTP != nil - var yynn1102 int - if yyr1102 || yy2arr1102 { + yysep1130 := !z.EncBinary() + yy2arr1130 := z.EncBasicHandle().StructToArray + var yyq1130 [2]bool + _, _, _ = yysep1130, yyq1130, yy2arr1130 + const yyr1130 bool = false + yyq1130[0] = x.Host != "" + yyq1130[1] = x.IngressRuleValue.HTTP != nil && x.HTTP != nil + var yynn1130 int + if yyr1130 || yy2arr1130 { r.EncodeArrayStart(2) } else { - yynn1102 = 0 - for _, b := range yyq1102 { + yynn1130 = 0 + for _, b := range yyq1130 { if b { - yynn1102++ + yynn1130++ } } - r.EncodeMapStart(yynn1102) - yynn1102 = 0 + r.EncodeMapStart(yynn1130) + yynn1130 = 0 } - if yyr1102 || yy2arr1102 { + if yyr1130 || yy2arr1130 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1102[0] { - yym1104 := z.EncBinary() - _ = yym1104 + if yyq1130[0] { + yym1132 := z.EncBinary() + _ = yym1132 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) @@ -13041,30 +13358,30 @@ func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1102[0] { + if yyq1130[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("host")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1105 := z.EncBinary() - _ = yym1105 + yym1133 := z.EncBinary() + _ = yym1133 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Host)) } } } - var yyn1106 bool + var yyn1134 bool if x.IngressRuleValue.HTTP == nil { - yyn1106 = true - goto LABEL1106 + yyn1134 = true + goto LABEL1134 } - LABEL1106: - if yyr1102 || yy2arr1102 { - if yyn1106 { + LABEL1134: + if yyr1130 || yy2arr1130 { + if yyn1134 { r.EncodeNil() } else { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1102[1] { + if yyq1130[1] { if x.HTTP == nil { r.EncodeNil() } else { @@ -13075,11 +13392,11 @@ func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { } } } else { - if yyq1102[1] { + if yyq1130[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("http")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1106 { + if yyn1134 { r.EncodeNil() } else { if x.HTTP == nil { @@ -13090,7 +13407,7 @@ func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1102 || yy2arr1102 { + if yyr1130 || yy2arr1130 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13103,25 +13420,25 @@ func (x *IngressRule) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1107 := z.DecBinary() - _ = yym1107 + yym1135 := z.DecBinary() + _ = yym1135 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1108 := r.ContainerType() - if yyct1108 == codecSelferValueTypeMap1234 { - yyl1108 := r.ReadMapStart() - if yyl1108 == 0 { + yyct1136 := r.ContainerType() + if yyct1136 == codecSelferValueTypeMap1234 { + yyl1136 := r.ReadMapStart() + if yyl1136 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1108, d) + x.codecDecodeSelfFromMap(yyl1136, d) } - } else if yyct1108 == codecSelferValueTypeArray1234 { - yyl1108 := r.ReadArrayStart() - if yyl1108 == 0 { + } else if yyct1136 == codecSelferValueTypeArray1234 { + yyl1136 := r.ReadArrayStart() + if yyl1136 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1108, d) + x.codecDecodeSelfFromArray(yyl1136, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13133,12 +13450,12 @@ func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1109Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1109Slc - var yyhl1109 bool = l >= 0 - for yyj1109 := 0; ; yyj1109++ { - if yyhl1109 { - if yyj1109 >= l { + var yys1137Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1137Slc + var yyhl1137 bool = l >= 0 + for yyj1137 := 0; ; yyj1137++ { + if yyhl1137 { + if yyj1137 >= l { break } } else { @@ -13147,10 +13464,10 @@ func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1109Slc = r.DecodeBytes(yys1109Slc, true, true) - yys1109 := string(yys1109Slc) + yys1137Slc = r.DecodeBytes(yys1137Slc, true, true) + yys1137 := string(yys1137Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1109 { + switch yys1137 { case "host": if r.TryDecodeAsNil() { x.Host = "" @@ -13172,9 +13489,9 @@ func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1109) - } // end switch yys1109 - } // end for yyj1109 + z.DecStructFieldNotFound(-1, yys1137) + } // end switch yys1137 + } // end for yyj1137 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13182,16 +13499,16 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1112 int - var yyb1112 bool - var yyhl1112 bool = l >= 0 - yyj1112++ - if yyhl1112 { - yyb1112 = yyj1112 > l + var yyj1140 int + var yyb1140 bool + var yyhl1140 bool = l >= 0 + yyj1140++ + if yyhl1140 { + yyb1140 = yyj1140 > l } else { - yyb1112 = r.CheckBreak() + yyb1140 = r.CheckBreak() } - if yyb1112 { + if yyb1140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13204,13 +13521,13 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.IngressRuleValue.HTTP == nil { x.IngressRuleValue.HTTP = new(HTTPIngressRuleValue) } - yyj1112++ - if yyhl1112 { - yyb1112 = yyj1112 > l + yyj1140++ + if yyhl1140 { + yyb1140 = yyj1140 > l } else { - yyb1112 = r.CheckBreak() + yyb1140 = r.CheckBreak() } - if yyb1112 { + if yyb1140 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13226,17 +13543,17 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } for { - yyj1112++ - if yyhl1112 { - yyb1112 = yyj1112 > l + yyj1140++ + if yyhl1140 { + yyb1140 = yyj1140 > l } else { - yyb1112 = r.CheckBreak() + yyb1140 = r.CheckBreak() } - if yyb1112 { + if yyb1140 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1112-1, "") + z.DecStructFieldNotFound(yyj1140-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13248,33 +13565,33 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1115 := z.EncBinary() - _ = yym1115 + yym1143 := z.EncBinary() + _ = yym1143 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1116 := !z.EncBinary() - yy2arr1116 := z.EncBasicHandle().StructToArray - var yyq1116 [1]bool - _, _, _ = yysep1116, yyq1116, yy2arr1116 - const yyr1116 bool = false - yyq1116[0] = x.HTTP != nil - var yynn1116 int - if yyr1116 || yy2arr1116 { + yysep1144 := !z.EncBinary() + yy2arr1144 := z.EncBasicHandle().StructToArray + var yyq1144 [1]bool + _, _, _ = yysep1144, yyq1144, yy2arr1144 + const yyr1144 bool = false + yyq1144[0] = x.HTTP != nil + var yynn1144 int + if yyr1144 || yy2arr1144 { r.EncodeArrayStart(1) } else { - yynn1116 = 0 - for _, b := range yyq1116 { + yynn1144 = 0 + for _, b := range yyq1144 { if b { - yynn1116++ + yynn1144++ } } - r.EncodeMapStart(yynn1116) - yynn1116 = 0 + r.EncodeMapStart(yynn1144) + yynn1144 = 0 } - if yyr1116 || yy2arr1116 { + if yyr1144 || yy2arr1144 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1116[0] { + if yyq1144[0] { if x.HTTP == nil { r.EncodeNil() } else { @@ -13284,7 +13601,7 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1116[0] { + if yyq1144[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("http")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13295,7 +13612,7 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1116 || yy2arr1116 { + if yyr1144 || yy2arr1144 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13308,25 +13625,25 @@ func (x *IngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1118 := z.DecBinary() - _ = yym1118 + yym1146 := z.DecBinary() + _ = yym1146 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1119 := r.ContainerType() - if yyct1119 == codecSelferValueTypeMap1234 { - yyl1119 := r.ReadMapStart() - if yyl1119 == 0 { + yyct1147 := r.ContainerType() + if yyct1147 == codecSelferValueTypeMap1234 { + yyl1147 := r.ReadMapStart() + if yyl1147 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1119, d) + x.codecDecodeSelfFromMap(yyl1147, d) } - } else if yyct1119 == codecSelferValueTypeArray1234 { - yyl1119 := r.ReadArrayStart() - if yyl1119 == 0 { + } else if yyct1147 == codecSelferValueTypeArray1234 { + yyl1147 := r.ReadArrayStart() + if yyl1147 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1119, d) + x.codecDecodeSelfFromArray(yyl1147, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13338,12 +13655,12 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1120Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1120Slc - var yyhl1120 bool = l >= 0 - for yyj1120 := 0; ; yyj1120++ { - if yyhl1120 { - if yyj1120 >= l { + var yys1148Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1148Slc + var yyhl1148 bool = l >= 0 + for yyj1148 := 0; ; yyj1148++ { + if yyhl1148 { + if yyj1148 >= l { break } } else { @@ -13352,10 +13669,10 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1120Slc = r.DecodeBytes(yys1120Slc, true, true) - yys1120 := string(yys1120Slc) + yys1148Slc = r.DecodeBytes(yys1148Slc, true, true) + yys1148 := string(yys1148Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1120 { + switch yys1148 { case "http": if r.TryDecodeAsNil() { if x.HTTP != nil { @@ -13368,387 +13685,13 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1120) - } // end switch yys1120 - } // end for yyj1120 + z.DecStructFieldNotFound(-1, yys1148) + } // end switch yys1148 + } // end for yyj1148 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } func (x *IngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1122 int - var yyb1122 bool - var yyhl1122 bool = l >= 0 - yyj1122++ - if yyhl1122 { - yyb1122 = yyj1122 > l - } else { - yyb1122 = r.CheckBreak() - } - if yyb1122 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.HTTP != nil { - x.HTTP = nil - } - } else { - if x.HTTP == nil { - x.HTTP = new(HTTPIngressRuleValue) - } - x.HTTP.CodecDecodeSelf(d) - } - for { - yyj1122++ - if yyhl1122 { - yyb1122 = yyj1122 > l - } else { - yyb1122 = r.CheckBreak() - } - if yyb1122 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1122-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *HTTPIngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1124 := z.EncBinary() - _ = yym1124 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1125 := !z.EncBinary() - yy2arr1125 := z.EncBasicHandle().StructToArray - var yyq1125 [1]bool - _, _, _ = yysep1125, yyq1125, yy2arr1125 - const yyr1125 bool = false - var yynn1125 int - if yyr1125 || yy2arr1125 { - r.EncodeArrayStart(1) - } else { - yynn1125 = 1 - for _, b := range yyq1125 { - if b { - yynn1125++ - } - } - r.EncodeMapStart(yynn1125) - yynn1125 = 0 - } - if yyr1125 || yy2arr1125 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Paths == nil { - r.EncodeNil() - } else { - yym1127 := z.EncBinary() - _ = yym1127 - if false { - } else { - h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("paths")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Paths == nil { - r.EncodeNil() - } else { - yym1128 := z.EncBinary() - _ = yym1128 - if false { - } else { - h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) - } - } - } - if yyr1125 || yy2arr1125 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *HTTPIngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1129 := z.DecBinary() - _ = yym1129 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1130 := r.ContainerType() - if yyct1130 == codecSelferValueTypeMap1234 { - yyl1130 := r.ReadMapStart() - if yyl1130 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1130, d) - } - } else if yyct1130 == codecSelferValueTypeArray1234 { - yyl1130 := r.ReadArrayStart() - if yyl1130 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1130, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *HTTPIngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1131Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1131Slc - var yyhl1131 bool = l >= 0 - for yyj1131 := 0; ; yyj1131++ { - if yyhl1131 { - if yyj1131 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1131Slc = r.DecodeBytes(yys1131Slc, true, true) - yys1131 := string(yys1131Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1131 { - case "paths": - if r.TryDecodeAsNil() { - x.Paths = nil - } else { - yyv1132 := &x.Paths - yym1133 := z.DecBinary() - _ = yym1133 - if false { - } else { - h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1132), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys1131) - } // end switch yys1131 - } // end for yyj1131 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1134 int - var yyb1134 bool - var yyhl1134 bool = l >= 0 - yyj1134++ - if yyhl1134 { - yyb1134 = yyj1134 > l - } else { - yyb1134 = r.CheckBreak() - } - if yyb1134 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Paths = nil - } else { - yyv1135 := &x.Paths - yym1136 := z.DecBinary() - _ = yym1136 - if false { - } else { - h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1135), d) - } - } - for { - yyj1134++ - if yyhl1134 { - yyb1134 = yyj1134 > l - } else { - yyb1134 = r.CheckBreak() - } - if yyb1134 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1134-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *HTTPIngressPath) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1137 := z.EncBinary() - _ = yym1137 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1138 := !z.EncBinary() - yy2arr1138 := z.EncBasicHandle().StructToArray - var yyq1138 [2]bool - _, _, _ = yysep1138, yyq1138, yy2arr1138 - const yyr1138 bool = false - yyq1138[0] = x.Path != "" - var yynn1138 int - if yyr1138 || yy2arr1138 { - r.EncodeArrayStart(2) - } else { - yynn1138 = 1 - for _, b := range yyq1138 { - if b { - yynn1138++ - } - } - r.EncodeMapStart(yynn1138) - yynn1138 = 0 - } - if yyr1138 || yy2arr1138 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1138[0] { - yym1140 := z.EncBinary() - _ = yym1140 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1138[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("path")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1141 := z.EncBinary() - _ = yym1141 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Path)) - } - } - } - if yyr1138 || yy2arr1138 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1143 := &x.Backend - yy1143.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("backend")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1144 := &x.Backend - yy1144.CodecEncodeSelf(e) - } - if yyr1138 || yy2arr1138 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *HTTPIngressPath) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1145 := z.DecBinary() - _ = yym1145 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1146 := r.ContainerType() - if yyct1146 == codecSelferValueTypeMap1234 { - yyl1146 := r.ReadMapStart() - if yyl1146 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1146, d) - } - } else if yyct1146 == codecSelferValueTypeArray1234 { - yyl1146 := r.ReadArrayStart() - if yyl1146 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1146, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *HTTPIngressPath) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1147Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1147Slc - var yyhl1147 bool = l >= 0 - for yyj1147 := 0; ; yyj1147++ { - if yyhl1147 { - if yyj1147 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1147Slc = r.DecodeBytes(yys1147Slc, true, true) - yys1147 := string(yys1147Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1147 { - case "path": - if r.TryDecodeAsNil() { - x.Path = "" - } else { - x.Path = string(r.DecodeString()) - } - case "backend": - if r.TryDecodeAsNil() { - x.Backend = IngressBackend{} - } else { - yyv1149 := &x.Backend - yyv1149.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys1147) - } // end switch yys1147 - } // end for yyj1147 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -13767,26 +13710,14 @@ func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Path = "" + if x.HTTP != nil { + x.HTTP = nil + } } else { - x.Path = string(r.DecodeString()) - } - yyj1150++ - if yyhl1150 { - yyb1150 = yyj1150 > l - } else { - yyb1150 = r.CheckBreak() - } - if yyb1150 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Backend = IngressBackend{} - } else { - yyv1152 := &x.Backend - yyv1152.CodecDecodeSelf(d) + if x.HTTP == nil { + x.HTTP = new(HTTPIngressRuleValue) + } + x.HTTP.CodecDecodeSelf(d) } for { yyj1150++ @@ -13804,6 +13735,392 @@ func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } +func (x *HTTPIngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1152 := z.EncBinary() + _ = yym1152 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1153 := !z.EncBinary() + yy2arr1153 := z.EncBasicHandle().StructToArray + var yyq1153 [1]bool + _, _, _ = yysep1153, yyq1153, yy2arr1153 + const yyr1153 bool = false + var yynn1153 int + if yyr1153 || yy2arr1153 { + r.EncodeArrayStart(1) + } else { + yynn1153 = 1 + for _, b := range yyq1153 { + if b { + yynn1153++ + } + } + r.EncodeMapStart(yynn1153) + yynn1153 = 0 + } + if yyr1153 || yy2arr1153 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Paths == nil { + r.EncodeNil() + } else { + yym1155 := z.EncBinary() + _ = yym1155 + if false { + } else { + h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("paths")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Paths == nil { + r.EncodeNil() + } else { + yym1156 := z.EncBinary() + _ = yym1156 + if false { + } else { + h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) + } + } + } + if yyr1153 || yy2arr1153 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HTTPIngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1157 := z.DecBinary() + _ = yym1157 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1158 := r.ContainerType() + if yyct1158 == codecSelferValueTypeMap1234 { + yyl1158 := r.ReadMapStart() + if yyl1158 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1158, d) + } + } else if yyct1158 == codecSelferValueTypeArray1234 { + yyl1158 := r.ReadArrayStart() + if yyl1158 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1158, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HTTPIngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1159Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1159Slc + var yyhl1159 bool = l >= 0 + for yyj1159 := 0; ; yyj1159++ { + if yyhl1159 { + if yyj1159 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1159Slc = r.DecodeBytes(yys1159Slc, true, true) + yys1159 := string(yys1159Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1159 { + case "paths": + if r.TryDecodeAsNil() { + x.Paths = nil + } else { + yyv1160 := &x.Paths + yym1161 := z.DecBinary() + _ = yym1161 + if false { + } else { + h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1160), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1159) + } // end switch yys1159 + } // end for yyj1159 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1162 int + var yyb1162 bool + var yyhl1162 bool = l >= 0 + yyj1162++ + if yyhl1162 { + yyb1162 = yyj1162 > l + } else { + yyb1162 = r.CheckBreak() + } + if yyb1162 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Paths = nil + } else { + yyv1163 := &x.Paths + yym1164 := z.DecBinary() + _ = yym1164 + if false { + } else { + h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1163), d) + } + } + for { + yyj1162++ + if yyhl1162 { + yyb1162 = yyj1162 > l + } else { + yyb1162 = r.CheckBreak() + } + if yyb1162 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1162-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *HTTPIngressPath) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1165 := z.EncBinary() + _ = yym1165 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1166 := !z.EncBinary() + yy2arr1166 := z.EncBasicHandle().StructToArray + var yyq1166 [2]bool + _, _, _ = yysep1166, yyq1166, yy2arr1166 + const yyr1166 bool = false + yyq1166[0] = x.Path != "" + var yynn1166 int + if yyr1166 || yy2arr1166 { + r.EncodeArrayStart(2) + } else { + yynn1166 = 1 + for _, b := range yyq1166 { + if b { + yynn1166++ + } + } + r.EncodeMapStart(yynn1166) + yynn1166 = 0 + } + if yyr1166 || yy2arr1166 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1166[0] { + yym1168 := z.EncBinary() + _ = yym1168 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1166[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("path")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1169 := z.EncBinary() + _ = yym1169 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Path)) + } + } + } + if yyr1166 || yy2arr1166 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1171 := &x.Backend + yy1171.CodecEncodeSelf(e) + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("backend")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1172 := &x.Backend + yy1172.CodecEncodeSelf(e) + } + if yyr1166 || yy2arr1166 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HTTPIngressPath) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1173 := z.DecBinary() + _ = yym1173 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1174 := r.ContainerType() + if yyct1174 == codecSelferValueTypeMap1234 { + yyl1174 := r.ReadMapStart() + if yyl1174 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1174, d) + } + } else if yyct1174 == codecSelferValueTypeArray1234 { + yyl1174 := r.ReadArrayStart() + if yyl1174 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1174, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HTTPIngressPath) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1175Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1175Slc + var yyhl1175 bool = l >= 0 + for yyj1175 := 0; ; yyj1175++ { + if yyhl1175 { + if yyj1175 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1175Slc = r.DecodeBytes(yys1175Slc, true, true) + yys1175 := string(yys1175Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1175 { + case "path": + if r.TryDecodeAsNil() { + x.Path = "" + } else { + x.Path = string(r.DecodeString()) + } + case "backend": + if r.TryDecodeAsNil() { + x.Backend = IngressBackend{} + } else { + yyv1177 := &x.Backend + yyv1177.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1175) + } // end switch yys1175 + } // end for yyj1175 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1178 int + var yyb1178 bool + var yyhl1178 bool = l >= 0 + yyj1178++ + if yyhl1178 { + yyb1178 = yyj1178 > l + } else { + yyb1178 = r.CheckBreak() + } + if yyb1178 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Path = "" + } else { + x.Path = string(r.DecodeString()) + } + yyj1178++ + if yyhl1178 { + yyb1178 = yyj1178 > l + } else { + yyb1178 = r.CheckBreak() + } + if yyb1178 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Backend = IngressBackend{} + } else { + yyv1180 := &x.Backend + yyv1180.CodecDecodeSelf(d) + } + for { + yyj1178++ + if yyhl1178 { + yyb1178 = yyj1178 > l + } else { + yyb1178 = r.CheckBreak() + } + if yyb1178 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1178-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + func (x *IngressBackend) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -13811,33 +14128,33 @@ func (x *IngressBackend) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1153 := z.EncBinary() - _ = yym1153 + yym1181 := z.EncBinary() + _ = yym1181 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1154 := !z.EncBinary() - yy2arr1154 := z.EncBasicHandle().StructToArray - var yyq1154 [2]bool - _, _, _ = yysep1154, yyq1154, yy2arr1154 - const yyr1154 bool = false - var yynn1154 int - if yyr1154 || yy2arr1154 { + yysep1182 := !z.EncBinary() + yy2arr1182 := z.EncBasicHandle().StructToArray + var yyq1182 [2]bool + _, _, _ = yysep1182, yyq1182, yy2arr1182 + const yyr1182 bool = false + var yynn1182 int + if yyr1182 || yy2arr1182 { r.EncodeArrayStart(2) } else { - yynn1154 = 2 - for _, b := range yyq1154 { + yynn1182 = 2 + for _, b := range yyq1182 { if b { - yynn1154++ + yynn1182++ } } - r.EncodeMapStart(yynn1154) - yynn1154 = 0 + r.EncodeMapStart(yynn1182) + yynn1182 = 0 } - if yyr1154 || yy2arr1154 { + if yyr1182 || yy2arr1182 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1156 := z.EncBinary() - _ = yym1156 + yym1184 := z.EncBinary() + _ = yym1184 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceName)) @@ -13846,41 +14163,41 @@ func (x *IngressBackend) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1157 := z.EncBinary() - _ = yym1157 + yym1185 := z.EncBinary() + _ = yym1185 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceName)) } } - if yyr1154 || yy2arr1154 { + if yyr1182 || yy2arr1182 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1159 := &x.ServicePort - yym1160 := z.EncBinary() - _ = yym1160 + yy1187 := &x.ServicePort + yym1188 := z.EncBinary() + _ = yym1188 if false { - } else if z.HasExtensions() && z.EncExt(yy1159) { - } else if !yym1160 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1159) + } else if z.HasExtensions() && z.EncExt(yy1187) { + } else if !yym1188 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1187) } else { - z.EncFallback(yy1159) + z.EncFallback(yy1187) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("servicePort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1161 := &x.ServicePort - yym1162 := z.EncBinary() - _ = yym1162 + yy1189 := &x.ServicePort + yym1190 := z.EncBinary() + _ = yym1190 if false { - } else if z.HasExtensions() && z.EncExt(yy1161) { - } else if !yym1162 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1161) + } else if z.HasExtensions() && z.EncExt(yy1189) { + } else if !yym1190 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1189) } else { - z.EncFallback(yy1161) + z.EncFallback(yy1189) } } - if yyr1154 || yy2arr1154 { + if yyr1182 || yy2arr1182 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13893,25 +14210,25 @@ func (x *IngressBackend) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1163 := z.DecBinary() - _ = yym1163 + yym1191 := z.DecBinary() + _ = yym1191 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1164 := r.ContainerType() - if yyct1164 == codecSelferValueTypeMap1234 { - yyl1164 := r.ReadMapStart() - if yyl1164 == 0 { + yyct1192 := r.ContainerType() + if yyct1192 == codecSelferValueTypeMap1234 { + yyl1192 := r.ReadMapStart() + if yyl1192 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1164, d) + x.codecDecodeSelfFromMap(yyl1192, d) } - } else if yyct1164 == codecSelferValueTypeArray1234 { - yyl1164 := r.ReadArrayStart() - if yyl1164 == 0 { + } else if yyct1192 == codecSelferValueTypeArray1234 { + yyl1192 := r.ReadArrayStart() + if yyl1192 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1164, d) + x.codecDecodeSelfFromArray(yyl1192, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13923,12 +14240,12 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1165Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1165Slc - var yyhl1165 bool = l >= 0 - for yyj1165 := 0; ; yyj1165++ { - if yyhl1165 { - if yyj1165 >= l { + var yys1193Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1193Slc + var yyhl1193 bool = l >= 0 + for yyj1193 := 0; ; yyj1193++ { + if yyhl1193 { + if yyj1193 >= l { break } } else { @@ -13937,10 +14254,10 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1165Slc = r.DecodeBytes(yys1165Slc, true, true) - yys1165 := string(yys1165Slc) + yys1193Slc = r.DecodeBytes(yys1193Slc, true, true) + yys1193 := string(yys1193Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1165 { + switch yys1193 { case "serviceName": if r.TryDecodeAsNil() { x.ServiceName = "" @@ -13951,21 +14268,21 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ServicePort = pkg6_intstr.IntOrString{} } else { - yyv1167 := &x.ServicePort - yym1168 := z.DecBinary() - _ = yym1168 + yyv1195 := &x.ServicePort + yym1196 := z.DecBinary() + _ = yym1196 if false { - } else if z.HasExtensions() && z.DecExt(yyv1167) { - } else if !yym1168 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1167) + } else if z.HasExtensions() && z.DecExt(yyv1195) { + } else if !yym1196 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1195) } else { - z.DecFallback(yyv1167, false) + z.DecFallback(yyv1195, false) } } default: - z.DecStructFieldNotFound(-1, yys1165) - } // end switch yys1165 - } // end for yyj1165 + z.DecStructFieldNotFound(-1, yys1193) + } // end switch yys1193 + } // end for yyj1193 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13973,16 +14290,16 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1169 int - var yyb1169 bool - var yyhl1169 bool = l >= 0 - yyj1169++ - if yyhl1169 { - yyb1169 = yyj1169 > l + var yyj1197 int + var yyb1197 bool + var yyhl1197 bool = l >= 0 + yyj1197++ + if yyhl1197 { + yyb1197 = yyj1197 > l } else { - yyb1169 = r.CheckBreak() + yyb1197 = r.CheckBreak() } - if yyb1169 { + if yyb1197 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13992,13 +14309,13 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ServiceName = string(r.DecodeString()) } - yyj1169++ - if yyhl1169 { - yyb1169 = yyj1169 > l + yyj1197++ + if yyhl1197 { + yyb1197 = yyj1197 > l } else { - yyb1169 = r.CheckBreak() + yyb1197 = r.CheckBreak() } - if yyb1169 { + if yyb1197 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14006,29 +14323,29 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ServicePort = pkg6_intstr.IntOrString{} } else { - yyv1171 := &x.ServicePort - yym1172 := z.DecBinary() - _ = yym1172 + yyv1199 := &x.ServicePort + yym1200 := z.DecBinary() + _ = yym1200 if false { - } else if z.HasExtensions() && z.DecExt(yyv1171) { - } else if !yym1172 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1171) + } else if z.HasExtensions() && z.DecExt(yyv1199) { + } else if !yym1200 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1199) } else { - z.DecFallback(yyv1171, false) + z.DecFallback(yyv1199, false) } } for { - yyj1169++ - if yyhl1169 { - yyb1169 = yyj1169 > l + yyj1197++ + if yyhl1197 { + yyb1197 = yyj1197 > l } else { - yyb1169 = r.CheckBreak() + yyb1197 = r.CheckBreak() } - if yyb1169 { + if yyb1197 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1169-1, "") + z.DecStructFieldNotFound(yyj1197-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14037,8 +14354,8 @@ func (x NodeResource) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1173 := z.EncBinary() - _ = yym1173 + yym1201 := z.EncBinary() + _ = yym1201 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -14050,8 +14367,8 @@ func (x *NodeResource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1174 := z.DecBinary() - _ = yym1174 + yym1202 := z.DecBinary() + _ = yym1202 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -14066,30 +14383,30 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1175 := z.EncBinary() - _ = yym1175 + yym1203 := z.EncBinary() + _ = yym1203 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1176 := !z.EncBinary() - yy2arr1176 := z.EncBasicHandle().StructToArray - var yyq1176 [2]bool - _, _, _ = yysep1176, yyq1176, yy2arr1176 - const yyr1176 bool = false - var yynn1176 int - if yyr1176 || yy2arr1176 { + yysep1204 := !z.EncBinary() + yy2arr1204 := z.EncBasicHandle().StructToArray + var yyq1204 [2]bool + _, _, _ = yysep1204, yyq1204, yy2arr1204 + const yyr1204 bool = false + var yynn1204 int + if yyr1204 || yy2arr1204 { r.EncodeArrayStart(2) } else { - yynn1176 = 2 - for _, b := range yyq1176 { + yynn1204 = 2 + for _, b := range yyq1204 { if b { - yynn1176++ + yynn1204++ } } - r.EncodeMapStart(yynn1176) - yynn1176 = 0 + r.EncodeMapStart(yynn1204) + yynn1204 = 0 } - if yyr1176 || yy2arr1176 { + if yyr1204 || yy2arr1204 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Resource.CodecEncodeSelf(e) } else { @@ -14098,10 +14415,10 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Resource.CodecEncodeSelf(e) } - if yyr1176 || yy2arr1176 { + if yyr1204 || yy2arr1204 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1179 := z.EncBinary() - _ = yym1179 + yym1207 := z.EncBinary() + _ = yym1207 if false { } else { r.EncodeFloat64(float64(x.Value)) @@ -14110,14 +14427,14 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("value")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1180 := z.EncBinary() - _ = yym1180 + yym1208 := z.EncBinary() + _ = yym1208 if false { } else { r.EncodeFloat64(float64(x.Value)) } } - if yyr1176 || yy2arr1176 { + if yyr1204 || yy2arr1204 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14130,25 +14447,25 @@ func (x *NodeUtilization) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1181 := z.DecBinary() - _ = yym1181 + yym1209 := z.DecBinary() + _ = yym1209 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1182 := r.ContainerType() - if yyct1182 == codecSelferValueTypeMap1234 { - yyl1182 := r.ReadMapStart() - if yyl1182 == 0 { + yyct1210 := r.ContainerType() + if yyct1210 == codecSelferValueTypeMap1234 { + yyl1210 := r.ReadMapStart() + if yyl1210 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1182, d) + x.codecDecodeSelfFromMap(yyl1210, d) } - } else if yyct1182 == codecSelferValueTypeArray1234 { - yyl1182 := r.ReadArrayStart() - if yyl1182 == 0 { + } else if yyct1210 == codecSelferValueTypeArray1234 { + yyl1210 := r.ReadArrayStart() + if yyl1210 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1182, d) + x.codecDecodeSelfFromArray(yyl1210, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14160,12 +14477,12 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1183Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1183Slc - var yyhl1183 bool = l >= 0 - for yyj1183 := 0; ; yyj1183++ { - if yyhl1183 { - if yyj1183 >= l { + var yys1211Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1211Slc + var yyhl1211 bool = l >= 0 + for yyj1211 := 0; ; yyj1211++ { + if yyhl1211 { + if yyj1211 >= l { break } } else { @@ -14174,10 +14491,10 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1183Slc = r.DecodeBytes(yys1183Slc, true, true) - yys1183 := string(yys1183Slc) + yys1211Slc = r.DecodeBytes(yys1211Slc, true, true) + yys1211 := string(yys1211Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1183 { + switch yys1211 { case "resource": if r.TryDecodeAsNil() { x.Resource = "" @@ -14191,9 +14508,9 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Value = float64(r.DecodeFloat(false)) } default: - z.DecStructFieldNotFound(-1, yys1183) - } // end switch yys1183 - } // end for yyj1183 + z.DecStructFieldNotFound(-1, yys1211) + } // end switch yys1211 + } // end for yyj1211 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14201,16 +14518,16 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1186 int - var yyb1186 bool - var yyhl1186 bool = l >= 0 - yyj1186++ - if yyhl1186 { - yyb1186 = yyj1186 > l + var yyj1214 int + var yyb1214 bool + var yyhl1214 bool = l >= 0 + yyj1214++ + if yyhl1214 { + yyb1214 = yyj1214 > l } else { - yyb1186 = r.CheckBreak() + yyb1214 = r.CheckBreak() } - if yyb1186 { + if yyb1214 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14220,13 +14537,13 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Resource = NodeResource(r.DecodeString()) } - yyj1186++ - if yyhl1186 { - yyb1186 = yyj1186 > l + yyj1214++ + if yyhl1214 { + yyb1214 = yyj1214 > l } else { - yyb1186 = r.CheckBreak() + yyb1214 = r.CheckBreak() } - if yyb1186 { + if yyb1214 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14237,17 +14554,17 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.Value = float64(r.DecodeFloat(false)) } for { - yyj1186++ - if yyhl1186 { - yyb1186 = yyj1186 > l + yyj1214++ + if yyhl1214 { + yyb1214 = yyj1214 > l } else { - yyb1186 = r.CheckBreak() + yyb1214 = r.CheckBreak() } - if yyb1186 { + if yyb1214 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1186-1, "") + z.DecStructFieldNotFound(yyj1214-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14259,33 +14576,33 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1189 := z.EncBinary() - _ = yym1189 + yym1217 := z.EncBinary() + _ = yym1217 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1190 := !z.EncBinary() - yy2arr1190 := z.EncBasicHandle().StructToArray - var yyq1190 [3]bool - _, _, _ = yysep1190, yyq1190, yy2arr1190 - const yyr1190 bool = false - var yynn1190 int - if yyr1190 || yy2arr1190 { + yysep1218 := !z.EncBinary() + yy2arr1218 := z.EncBasicHandle().StructToArray + var yyq1218 [3]bool + _, _, _ = yysep1218, yyq1218, yy2arr1218 + const yyr1218 bool = false + var yynn1218 int + if yyr1218 || yy2arr1218 { r.EncodeArrayStart(3) } else { - yynn1190 = 3 - for _, b := range yyq1190 { + yynn1218 = 3 + for _, b := range yyq1218 { if b { - yynn1190++ + yynn1218++ } } - r.EncodeMapStart(yynn1190) - yynn1190 = 0 + r.EncodeMapStart(yynn1218) + yynn1218 = 0 } - if yyr1190 || yy2arr1190 { + if yyr1218 || yy2arr1218 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1192 := z.EncBinary() - _ = yym1192 + yym1220 := z.EncBinary() + _ = yym1220 if false { } else { r.EncodeInt(int64(x.MinNodes)) @@ -14294,17 +14611,17 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minNodes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1193 := z.EncBinary() - _ = yym1193 + yym1221 := z.EncBinary() + _ = yym1221 if false { } else { r.EncodeInt(int64(x.MinNodes)) } } - if yyr1190 || yy2arr1190 { + if yyr1218 || yy2arr1218 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1195 := z.EncBinary() - _ = yym1195 + yym1223 := z.EncBinary() + _ = yym1223 if false { } else { r.EncodeInt(int64(x.MaxNodes)) @@ -14313,20 +14630,20 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxNodes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1196 := z.EncBinary() - _ = yym1196 + yym1224 := z.EncBinary() + _ = yym1224 if false { } else { r.EncodeInt(int64(x.MaxNodes)) } } - if yyr1190 || yy2arr1190 { + if yyr1218 || yy2arr1218 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TargetUtilization == nil { r.EncodeNil() } else { - yym1198 := z.EncBinary() - _ = yym1198 + yym1226 := z.EncBinary() + _ = yym1226 if false { } else { h.encSliceNodeUtilization(([]NodeUtilization)(x.TargetUtilization), e) @@ -14339,15 +14656,15 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.TargetUtilization == nil { r.EncodeNil() } else { - yym1199 := z.EncBinary() - _ = yym1199 + yym1227 := z.EncBinary() + _ = yym1227 if false { } else { h.encSliceNodeUtilization(([]NodeUtilization)(x.TargetUtilization), e) } } } - if yyr1190 || yy2arr1190 { + if yyr1218 || yy2arr1218 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14360,25 +14677,25 @@ func (x *ClusterAutoscalerSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1200 := z.DecBinary() - _ = yym1200 + yym1228 := z.DecBinary() + _ = yym1228 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1201 := r.ContainerType() - if yyct1201 == codecSelferValueTypeMap1234 { - yyl1201 := r.ReadMapStart() - if yyl1201 == 0 { + yyct1229 := r.ContainerType() + if yyct1229 == codecSelferValueTypeMap1234 { + yyl1229 := r.ReadMapStart() + if yyl1229 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1201, d) + x.codecDecodeSelfFromMap(yyl1229, d) } - } else if yyct1201 == codecSelferValueTypeArray1234 { - yyl1201 := r.ReadArrayStart() - if yyl1201 == 0 { + } else if yyct1229 == codecSelferValueTypeArray1234 { + yyl1229 := r.ReadArrayStart() + if yyl1229 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1201, d) + x.codecDecodeSelfFromArray(yyl1229, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14390,12 +14707,12 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1202Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1202Slc - var yyhl1202 bool = l >= 0 - for yyj1202 := 0; ; yyj1202++ { - if yyhl1202 { - if yyj1202 >= l { + var yys1230Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1230Slc + var yyhl1230 bool = l >= 0 + for yyj1230 := 0; ; yyj1230++ { + if yyhl1230 { + if yyj1230 >= l { break } } else { @@ -14404,10 +14721,10 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1202Slc = r.DecodeBytes(yys1202Slc, true, true) - yys1202 := string(yys1202Slc) + yys1230Slc = r.DecodeBytes(yys1230Slc, true, true) + yys1230 := string(yys1230Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1202 { + switch yys1230 { case "minNodes": if r.TryDecodeAsNil() { x.MinNodes = 0 @@ -14424,18 +14741,18 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.TargetUtilization = nil } else { - yyv1205 := &x.TargetUtilization - yym1206 := z.DecBinary() - _ = yym1206 + yyv1233 := &x.TargetUtilization + yym1234 := z.DecBinary() + _ = yym1234 if false { } else { - h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1205), d) + h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1233), d) } } default: - z.DecStructFieldNotFound(-1, yys1202) - } // end switch yys1202 - } // end for yyj1202 + z.DecStructFieldNotFound(-1, yys1230) + } // end switch yys1230 + } // end for yyj1230 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14443,16 +14760,16 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1207 int - var yyb1207 bool - var yyhl1207 bool = l >= 0 - yyj1207++ - if yyhl1207 { - yyb1207 = yyj1207 > l + var yyj1235 int + var yyb1235 bool + var yyhl1235 bool = l >= 0 + yyj1235++ + if yyhl1235 { + yyb1235 = yyj1235 > l } else { - yyb1207 = r.CheckBreak() + yyb1235 = r.CheckBreak() } - if yyb1207 { + if yyb1235 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14462,13 +14779,13 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.MinNodes = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1207++ - if yyhl1207 { - yyb1207 = yyj1207 > l + yyj1235++ + if yyhl1235 { + yyb1235 = yyj1235 > l } else { - yyb1207 = r.CheckBreak() + yyb1235 = r.CheckBreak() } - if yyb1207 { + if yyb1235 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14478,13 +14795,13 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.MaxNodes = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1207++ - if yyhl1207 { - yyb1207 = yyj1207 > l + yyj1235++ + if yyhl1235 { + yyb1235 = yyj1235 > l } else { - yyb1207 = r.CheckBreak() + yyb1235 = r.CheckBreak() } - if yyb1207 { + if yyb1235 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14492,26 +14809,26 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.TargetUtilization = nil } else { - yyv1210 := &x.TargetUtilization - yym1211 := z.DecBinary() - _ = yym1211 + yyv1238 := &x.TargetUtilization + yym1239 := z.DecBinary() + _ = yym1239 if false { } else { - h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1210), d) + h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1238), d) } } for { - yyj1207++ - if yyhl1207 { - yyb1207 = yyj1207 > l + yyj1235++ + if yyhl1235 { + yyb1235 = yyj1235 > l } else { - yyb1207 = r.CheckBreak() + yyb1235 = r.CheckBreak() } - if yyb1207 { + if yyb1235 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1207-1, "") + z.DecStructFieldNotFound(yyj1235-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14523,118 +14840,118 @@ func (x *ClusterAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1212 := z.EncBinary() - _ = yym1212 + yym1240 := z.EncBinary() + _ = yym1240 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1213 := !z.EncBinary() - yy2arr1213 := z.EncBasicHandle().StructToArray - var yyq1213 [4]bool - _, _, _ = yysep1213, yyq1213, yy2arr1213 - const yyr1213 bool = false - yyq1213[0] = x.Kind != "" - yyq1213[1] = x.APIVersion != "" - yyq1213[2] = true - yyq1213[3] = true - var yynn1213 int - if yyr1213 || yy2arr1213 { + yysep1241 := !z.EncBinary() + yy2arr1241 := z.EncBasicHandle().StructToArray + var yyq1241 [4]bool + _, _, _ = yysep1241, yyq1241, yy2arr1241 + const yyr1241 bool = false + yyq1241[0] = true + yyq1241[1] = true + yyq1241[2] = x.Kind != "" + yyq1241[3] = x.APIVersion != "" + var yynn1241 int + if yyr1241 || yy2arr1241 { r.EncodeArrayStart(4) } else { - yynn1213 = 0 - for _, b := range yyq1213 { + yynn1241 = 0 + for _, b := range yyq1241 { if b { - yynn1213++ + yynn1241++ } } - r.EncodeMapStart(yynn1213) - yynn1213 = 0 + r.EncodeMapStart(yynn1241) + yynn1241 = 0 } - if yyr1213 || yy2arr1213 { + if yyr1241 || yy2arr1241 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1213[0] { - yym1215 := z.EncBinary() - _ = yym1215 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1213[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1216 := z.EncBinary() - _ = yym1216 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1213 || yy2arr1213 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1213[1] { - yym1218 := z.EncBinary() - _ = yym1218 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1213[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1219 := z.EncBinary() - _ = yym1219 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1213 || yy2arr1213 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1213[2] { - yy1221 := &x.ObjectMeta - yy1221.CodecEncodeSelf(e) + if yyq1241[0] { + yy1243 := &x.ObjectMeta + yy1243.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1213[2] { + if yyq1241[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1222 := &x.ObjectMeta - yy1222.CodecEncodeSelf(e) + yy1244 := &x.ObjectMeta + yy1244.CodecEncodeSelf(e) } } - if yyr1213 || yy2arr1213 { + if yyr1241 || yy2arr1241 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1213[3] { - yy1224 := &x.Spec - yy1224.CodecEncodeSelf(e) + if yyq1241[1] { + yy1246 := &x.Spec + yy1246.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1213[3] { + if yyq1241[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1225 := &x.Spec - yy1225.CodecEncodeSelf(e) + yy1247 := &x.Spec + yy1247.CodecEncodeSelf(e) } } - if yyr1213 || yy2arr1213 { + if yyr1241 || yy2arr1241 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1241[2] { + yym1249 := z.EncBinary() + _ = yym1249 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1241[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1250 := z.EncBinary() + _ = yym1250 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1241 || yy2arr1241 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1241[3] { + yym1252 := z.EncBinary() + _ = yym1252 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1241[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1253 := z.EncBinary() + _ = yym1253 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1241 || yy2arr1241 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14644,328 +14961,6 @@ func (x *ClusterAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *ClusterAutoscaler) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1226 := z.DecBinary() - _ = yym1226 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1227 := r.ContainerType() - if yyct1227 == codecSelferValueTypeMap1234 { - yyl1227 := r.ReadMapStart() - if yyl1227 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1227, d) - } - } else if yyct1227 == codecSelferValueTypeArray1234 { - yyl1227 := r.ReadArrayStart() - if yyl1227 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1227, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1228Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1228Slc - var yyhl1228 bool = l >= 0 - for yyj1228 := 0; ; yyj1228++ { - if yyhl1228 { - if yyj1228 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1228Slc = r.DecodeBytes(yys1228Slc, true, true) - yys1228 := string(yys1228Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1228 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1231 := &x.ObjectMeta - yyv1231.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ClusterAutoscalerSpec{} - } else { - yyv1232 := &x.Spec - yyv1232.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys1228) - } // end switch yys1228 - } // end for yyj1228 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1233 int - var yyb1233 bool - var yyhl1233 bool = l >= 0 - yyj1233++ - if yyhl1233 { - yyb1233 = yyj1233 > l - } else { - yyb1233 = r.CheckBreak() - } - if yyb1233 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj1233++ - if yyhl1233 { - yyb1233 = yyj1233 > l - } else { - yyb1233 = r.CheckBreak() - } - if yyb1233 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj1233++ - if yyhl1233 { - yyb1233 = yyj1233 > l - } else { - yyb1233 = r.CheckBreak() - } - if yyb1233 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1236 := &x.ObjectMeta - yyv1236.CodecDecodeSelf(d) - } - yyj1233++ - if yyhl1233 { - yyb1233 = yyj1233 > l - } else { - yyb1233 = r.CheckBreak() - } - if yyb1233 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ClusterAutoscalerSpec{} - } else { - yyv1237 := &x.Spec - yyv1237.CodecDecodeSelf(d) - } - for { - yyj1233++ - if yyhl1233 { - yyb1233 = yyj1233 > l - } else { - yyb1233 = r.CheckBreak() - } - if yyb1233 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1233-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1238 := z.EncBinary() - _ = yym1238 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1239 := !z.EncBinary() - yy2arr1239 := z.EncBasicHandle().StructToArray - var yyq1239 [4]bool - _, _, _ = yysep1239, yyq1239, yy2arr1239 - const yyr1239 bool = false - yyq1239[0] = x.Kind != "" - yyq1239[1] = x.APIVersion != "" - yyq1239[2] = true - var yynn1239 int - if yyr1239 || yy2arr1239 { - r.EncodeArrayStart(4) - } else { - yynn1239 = 1 - for _, b := range yyq1239 { - if b { - yynn1239++ - } - } - r.EncodeMapStart(yynn1239) - yynn1239 = 0 - } - if yyr1239 || yy2arr1239 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1239[0] { - yym1241 := z.EncBinary() - _ = yym1241 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1239[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1242 := z.EncBinary() - _ = yym1242 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1239 || yy2arr1239 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1239[1] { - yym1244 := z.EncBinary() - _ = yym1244 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1239[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1245 := z.EncBinary() - _ = yym1245 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1239 || yy2arr1239 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1239[2] { - yy1247 := &x.ListMeta - yym1248 := z.EncBinary() - _ = yym1248 - if false { - } else if z.HasExtensions() && z.EncExt(yy1247) { - } else { - z.EncFallback(yy1247) - } - } else { - r.EncodeNil() - } - } else { - if yyq1239[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1249 := &x.ListMeta - yym1250 := z.EncBinary() - _ = yym1250 - if false { - } else if z.HasExtensions() && z.EncExt(yy1249) { - } else { - z.EncFallback(yy1249) - } - } - } - if yyr1239 || yy2arr1239 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym1252 := z.EncBinary() - _ = yym1252 - if false { - } else { - h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym1253 := z.EncBinary() - _ = yym1253 - if false { - } else { - h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) - } - } - } - if yyr1239 || yy2arr1239 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterAutoscalerList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -14995,7 +14990,7 @@ func (x *ClusterAutoscalerList) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *ClusterAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -15017,6 +15012,20 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod yys1256 := string(yys1256Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys1256 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1257 := &x.ObjectMeta + yyv1257.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ClusterAutoscalerSpec{} + } else { + yyv1258 := &x.Spec + yyv1258.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -15029,31 +15038,6 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1259 := &x.ListMeta - yym1260 := z.DecBinary() - _ = yym1260 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1259) { - } else { - z.DecFallback(yyv1259, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1261 := &x.Items - yym1262 := z.DecBinary() - _ = yym1262 - if false { - } else { - h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1261), d) - } - } default: z.DecStructFieldNotFound(-1, yys1256) } // end switch yys1256 @@ -15061,20 +15045,54 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *ClusterAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1263 int - var yyb1263 bool - var yyhl1263 bool = l >= 0 - yyj1263++ - if yyhl1263 { - yyb1263 = yyj1263 > l + var yyj1261 int + var yyb1261 bool + var yyhl1261 bool = l >= 0 + yyj1261++ + if yyhl1261 { + yyb1261 = yyj1261 > l } else { - yyb1263 = r.CheckBreak() + yyb1261 = r.CheckBreak() } - if yyb1263 { + if yyb1261 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1262 := &x.ObjectMeta + yyv1262.CodecDecodeSelf(d) + } + yyj1261++ + if yyhl1261 { + yyb1261 = yyj1261 > l + } else { + yyb1261 = r.CheckBreak() + } + if yyb1261 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ClusterAutoscalerSpec{} + } else { + yyv1263 := &x.Spec + yyv1263.CodecDecodeSelf(d) + } + yyj1261++ + if yyhl1261 { + yyb1261 = yyj1261 > l + } else { + yyb1261 = r.CheckBreak() + } + if yyb1261 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15084,13 +15102,13 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj1263++ - if yyhl1263 { - yyb1263 = yyj1263 > l + yyj1261++ + if yyhl1261 { + yyb1261 = yyj1261 > l } else { - yyb1263 = r.CheckBreak() + yyb1261 = r.CheckBreak() } - if yyb1263 { + if yyb1261 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15100,13 +15118,280 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj1263++ - if yyhl1263 { - yyb1263 = yyj1263 > l - } else { - yyb1263 = r.CheckBreak() + for { + yyj1261++ + if yyhl1261 { + yyb1261 = yyj1261 > l + } else { + yyb1261 = r.CheckBreak() + } + if yyb1261 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1261-1, "") } - if yyb1263 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ClusterAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1266 := z.EncBinary() + _ = yym1266 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1267 := !z.EncBinary() + yy2arr1267 := z.EncBasicHandle().StructToArray + var yyq1267 [4]bool + _, _, _ = yysep1267, yyq1267, yy2arr1267 + const yyr1267 bool = false + yyq1267[0] = true + yyq1267[2] = x.Kind != "" + yyq1267[3] = x.APIVersion != "" + var yynn1267 int + if yyr1267 || yy2arr1267 { + r.EncodeArrayStart(4) + } else { + yynn1267 = 1 + for _, b := range yyq1267 { + if b { + yynn1267++ + } + } + r.EncodeMapStart(yynn1267) + yynn1267 = 0 + } + if yyr1267 || yy2arr1267 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1267[0] { + yy1269 := &x.ListMeta + yym1270 := z.EncBinary() + _ = yym1270 + if false { + } else if z.HasExtensions() && z.EncExt(yy1269) { + } else { + z.EncFallback(yy1269) + } + } else { + r.EncodeNil() + } + } else { + if yyq1267[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1271 := &x.ListMeta + yym1272 := z.EncBinary() + _ = yym1272 + if false { + } else if z.HasExtensions() && z.EncExt(yy1271) { + } else { + z.EncFallback(yy1271) + } + } + } + if yyr1267 || yy2arr1267 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1274 := z.EncBinary() + _ = yym1274 + if false { + } else { + h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1275 := z.EncBinary() + _ = yym1275 + if false { + } else { + h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) + } + } + } + if yyr1267 || yy2arr1267 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1267[2] { + yym1277 := z.EncBinary() + _ = yym1277 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1267[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1278 := z.EncBinary() + _ = yym1278 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1267 || yy2arr1267 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1267[3] { + yym1280 := z.EncBinary() + _ = yym1280 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1267[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1281 := z.EncBinary() + _ = yym1281 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1267 || yy2arr1267 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ClusterAutoscalerList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1282 := z.DecBinary() + _ = yym1282 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1283 := r.ContainerType() + if yyct1283 == codecSelferValueTypeMap1234 { + yyl1283 := r.ReadMapStart() + if yyl1283 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1283, d) + } + } else if yyct1283 == codecSelferValueTypeArray1234 { + yyl1283 := r.ReadArrayStart() + if yyl1283 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1283, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1284Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1284Slc + var yyhl1284 bool = l >= 0 + for yyj1284 := 0; ; yyj1284++ { + if yyhl1284 { + if yyj1284 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1284Slc = r.DecodeBytes(yys1284Slc, true, true) + yys1284 := string(yys1284Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1284 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1285 := &x.ListMeta + yym1286 := z.DecBinary() + _ = yym1286 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1285) { + } else { + z.DecFallback(yyv1285, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1287 := &x.Items + yym1288 := z.DecBinary() + _ = yym1288 + if false { + } else { + h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1287), 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, yys1284) + } // end switch yys1284 + } // end for yyj1284 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1291 int + var yyb1291 bool + var yyhl1291 bool = l >= 0 + yyj1291++ + if yyhl1291 { + yyb1291 = yyj1291 > l + } else { + yyb1291 = r.CheckBreak() + } + if yyb1291 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15114,22 +15399,22 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.ListMeta = pkg1_unversioned.ListMeta{} } else { - yyv1266 := &x.ListMeta - yym1267 := z.DecBinary() - _ = yym1267 + yyv1292 := &x.ListMeta + yym1293 := z.DecBinary() + _ = yym1293 if false { - } else if z.HasExtensions() && z.DecExt(yyv1266) { + } else if z.HasExtensions() && z.DecExt(yyv1292) { } else { - z.DecFallback(yyv1266, false) + z.DecFallback(yyv1292, false) } } - yyj1263++ - if yyhl1263 { - yyb1263 = yyj1263 > l + yyj1291++ + if yyhl1291 { + yyb1291 = yyj1291 > l } else { - yyb1263 = r.CheckBreak() + yyb1291 = r.CheckBreak() } - if yyb1263 { + if yyb1291 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15137,574 +15422,62 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.Items = nil } else { - yyv1268 := &x.Items - yym1269 := z.DecBinary() - _ = yym1269 + yyv1294 := &x.Items + yym1295 := z.DecBinary() + _ = yym1295 if false { } else { - h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1268), d) + h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1294), d) } } + yyj1291++ + if yyhl1291 { + yyb1291 = yyj1291 > l + } else { + yyb1291 = r.CheckBreak() + } + if yyb1291 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1291++ + if yyhl1291 { + yyb1291 = yyj1291 > l + } else { + yyb1291 = r.CheckBreak() + } + if yyb1291 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj1263++ - if yyhl1263 { - yyb1263 = yyj1263 > l + yyj1291++ + if yyhl1291 { + yyb1291 = yyj1291 > l } else { - yyb1263 = r.CheckBreak() + yyb1291 = r.CheckBreak() } - if yyb1263 { + if yyb1291 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1263-1, "") + z.DecStructFieldNotFound(yyj1291-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1270 := z.EncBinary() - _ = yym1270 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1271 := !z.EncBinary() - yy2arr1271 := z.EncBasicHandle().StructToArray - var yyq1271 [2]bool - _, _, _ = yysep1271, yyq1271, yy2arr1271 - const yyr1271 bool = false - yyq1271[0] = len(x.MatchLabels) != 0 - yyq1271[1] = len(x.MatchExpressions) != 0 - var yynn1271 int - if yyr1271 || yy2arr1271 { - r.EncodeArrayStart(2) - } else { - yynn1271 = 0 - for _, b := range yyq1271 { - if b { - yynn1271++ - } - } - r.EncodeMapStart(yynn1271) - yynn1271 = 0 - } - if yyr1271 || yy2arr1271 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1271[0] { - if x.MatchLabels == nil { - r.EncodeNil() - } else { - yym1273 := z.EncBinary() - _ = yym1273 - if false { - } else { - z.F.EncMapStringStringV(x.MatchLabels, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq1271[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("matchLabels")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.MatchLabels == nil { - r.EncodeNil() - } else { - yym1274 := z.EncBinary() - _ = yym1274 - if false { - } else { - z.F.EncMapStringStringV(x.MatchLabels, false, e) - } - } - } - } - if yyr1271 || yy2arr1271 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1271[1] { - if x.MatchExpressions == nil { - r.EncodeNil() - } else { - yym1276 := z.EncBinary() - _ = yym1276 - if false { - } else { - h.encSliceLabelSelectorRequirement(([]LabelSelectorRequirement)(x.MatchExpressions), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq1271[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("matchExpressions")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.MatchExpressions == nil { - r.EncodeNil() - } else { - yym1277 := z.EncBinary() - _ = yym1277 - if false { - } else { - h.encSliceLabelSelectorRequirement(([]LabelSelectorRequirement)(x.MatchExpressions), e) - } - } - } - } - if yyr1271 || yy2arr1271 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *LabelSelector) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1278 := z.DecBinary() - _ = yym1278 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1279 := r.ContainerType() - if yyct1279 == codecSelferValueTypeMap1234 { - yyl1279 := r.ReadMapStart() - if yyl1279 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1279, d) - } - } else if yyct1279 == codecSelferValueTypeArray1234 { - yyl1279 := r.ReadArrayStart() - if yyl1279 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1279, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *LabelSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1280Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1280Slc - var yyhl1280 bool = l >= 0 - for yyj1280 := 0; ; yyj1280++ { - if yyhl1280 { - if yyj1280 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1280Slc = r.DecodeBytes(yys1280Slc, true, true) - yys1280 := string(yys1280Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1280 { - case "matchLabels": - if r.TryDecodeAsNil() { - x.MatchLabels = nil - } else { - yyv1281 := &x.MatchLabels - yym1282 := z.DecBinary() - _ = yym1282 - if false { - } else { - z.F.DecMapStringStringX(yyv1281, false, d) - } - } - case "matchExpressions": - if r.TryDecodeAsNil() { - x.MatchExpressions = nil - } else { - yyv1283 := &x.MatchExpressions - yym1284 := z.DecBinary() - _ = yym1284 - if false { - } else { - h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1283), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys1280) - } // end switch yys1280 - } // end for yyj1280 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *LabelSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1285 int - var yyb1285 bool - var yyhl1285 bool = l >= 0 - yyj1285++ - if yyhl1285 { - yyb1285 = yyj1285 > l - } else { - yyb1285 = r.CheckBreak() - } - if yyb1285 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MatchLabels = nil - } else { - yyv1286 := &x.MatchLabels - yym1287 := z.DecBinary() - _ = yym1287 - if false { - } else { - z.F.DecMapStringStringX(yyv1286, false, d) - } - } - yyj1285++ - if yyhl1285 { - yyb1285 = yyj1285 > l - } else { - yyb1285 = r.CheckBreak() - } - if yyb1285 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MatchExpressions = nil - } else { - yyv1288 := &x.MatchExpressions - yym1289 := z.DecBinary() - _ = yym1289 - if false { - } else { - h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1288), d) - } - } - for { - yyj1285++ - if yyhl1285 { - yyb1285 = yyj1285 > l - } else { - yyb1285 = r.CheckBreak() - } - if yyb1285 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1285-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1290 := z.EncBinary() - _ = yym1290 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1291 := !z.EncBinary() - yy2arr1291 := z.EncBasicHandle().StructToArray - var yyq1291 [3]bool - _, _, _ = yysep1291, yyq1291, yy2arr1291 - const yyr1291 bool = false - yyq1291[2] = len(x.Values) != 0 - var yynn1291 int - if yyr1291 || yy2arr1291 { - r.EncodeArrayStart(3) - } else { - yynn1291 = 2 - for _, b := range yyq1291 { - if b { - yynn1291++ - } - } - r.EncodeMapStart(yynn1291) - yynn1291 = 0 - } - if yyr1291 || yy2arr1291 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1293 := z.EncBinary() - _ = yym1293 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("key")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1294 := z.EncBinary() - _ = yym1294 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Key)) - } - } - if yyr1291 || yy2arr1291 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - x.Operator.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("operator")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Operator.CodecEncodeSelf(e) - } - if yyr1291 || yy2arr1291 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1291[2] { - if x.Values == nil { - r.EncodeNil() - } else { - yym1297 := z.EncBinary() - _ = yym1297 - if false { - } else { - z.F.EncSliceStringV(x.Values, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq1291[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("values")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Values == nil { - r.EncodeNil() - } else { - yym1298 := z.EncBinary() - _ = yym1298 - if false { - } else { - z.F.EncSliceStringV(x.Values, false, e) - } - } - } - } - if yyr1291 || yy2arr1291 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *LabelSelectorRequirement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1299 := z.DecBinary() - _ = yym1299 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1300 := r.ContainerType() - if yyct1300 == codecSelferValueTypeMap1234 { - yyl1300 := r.ReadMapStart() - if yyl1300 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1300, d) - } - } else if yyct1300 == codecSelferValueTypeArray1234 { - yyl1300 := r.ReadArrayStart() - if yyl1300 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1300, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *LabelSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1301Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1301Slc - var yyhl1301 bool = l >= 0 - for yyj1301 := 0; ; yyj1301++ { - if yyhl1301 { - if yyj1301 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1301Slc = r.DecodeBytes(yys1301Slc, true, true) - yys1301 := string(yys1301Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1301 { - case "key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - x.Key = string(r.DecodeString()) - } - case "operator": - if r.TryDecodeAsNil() { - x.Operator = "" - } else { - x.Operator = LabelSelectorOperator(r.DecodeString()) - } - case "values": - if r.TryDecodeAsNil() { - x.Values = nil - } else { - yyv1304 := &x.Values - yym1305 := z.DecBinary() - _ = yym1305 - if false { - } else { - z.F.DecSliceStringX(yyv1304, false, d) - } - } - default: - z.DecStructFieldNotFound(-1, yys1301) - } // end switch yys1301 - } // end for yyj1301 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *LabelSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1306 int - var yyb1306 bool - var yyhl1306 bool = l >= 0 - yyj1306++ - if yyhl1306 { - yyb1306 = yyj1306 > l - } else { - yyb1306 = r.CheckBreak() - } - if yyb1306 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Key = "" - } else { - x.Key = string(r.DecodeString()) - } - yyj1306++ - if yyhl1306 { - yyb1306 = yyj1306 > l - } else { - yyb1306 = r.CheckBreak() - } - if yyb1306 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Operator = "" - } else { - x.Operator = LabelSelectorOperator(r.DecodeString()) - } - yyj1306++ - if yyhl1306 { - yyb1306 = yyj1306 > l - } else { - yyb1306 = r.CheckBreak() - } - if yyb1306 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Values = nil - } else { - yyv1309 := &x.Values - yym1310 := z.DecBinary() - _ = yym1310 - if false { - } else { - z.F.DecSliceStringX(yyv1309, false, d) - } - } - for { - yyj1306++ - if yyhl1306 { - yyb1306 = yyj1306 > l - } else { - yyb1306 = r.CheckBreak() - } - if yyb1306 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1306-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x LabelSelectorOperator) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym1311 := z.EncBinary() - _ = yym1311 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *LabelSelectorOperator) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1312 := z.DecBinary() - _ = yym1312 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - func (x *ReplicaSet) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -15712,136 +15485,136 @@ func (x *ReplicaSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1313 := z.EncBinary() - _ = yym1313 + yym1298 := z.EncBinary() + _ = yym1298 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1314 := !z.EncBinary() - yy2arr1314 := z.EncBasicHandle().StructToArray - var yyq1314 [5]bool - _, _, _ = yysep1314, yyq1314, yy2arr1314 - const yyr1314 bool = false - yyq1314[0] = x.Kind != "" - yyq1314[1] = x.APIVersion != "" - yyq1314[2] = true - yyq1314[3] = true - yyq1314[4] = true - var yynn1314 int - if yyr1314 || yy2arr1314 { + yysep1299 := !z.EncBinary() + yy2arr1299 := z.EncBasicHandle().StructToArray + var yyq1299 [5]bool + _, _, _ = yysep1299, yyq1299, yy2arr1299 + const yyr1299 bool = false + yyq1299[0] = true + yyq1299[1] = true + yyq1299[2] = true + yyq1299[3] = x.Kind != "" + yyq1299[4] = x.APIVersion != "" + var yynn1299 int + if yyr1299 || yy2arr1299 { r.EncodeArrayStart(5) } else { - yynn1314 = 0 - for _, b := range yyq1314 { + yynn1299 = 0 + for _, b := range yyq1299 { if b { - yynn1314++ + yynn1299++ } } - r.EncodeMapStart(yynn1314) - yynn1314 = 0 + r.EncodeMapStart(yynn1299) + yynn1299 = 0 } - if yyr1314 || yy2arr1314 { + if yyr1299 || yy2arr1299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1314[0] { - yym1316 := z.EncBinary() - _ = yym1316 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1314[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1317 := z.EncBinary() - _ = yym1317 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1314 || yy2arr1314 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1314[1] { - yym1319 := z.EncBinary() - _ = yym1319 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1314[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1320 := z.EncBinary() - _ = yym1320 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1314 || yy2arr1314 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1314[2] { - yy1322 := &x.ObjectMeta - yy1322.CodecEncodeSelf(e) + if yyq1299[0] { + yy1301 := &x.ObjectMeta + yy1301.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1314[2] { + if yyq1299[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1323 := &x.ObjectMeta - yy1323.CodecEncodeSelf(e) + yy1302 := &x.ObjectMeta + yy1302.CodecEncodeSelf(e) } } - if yyr1314 || yy2arr1314 { + if yyr1299 || yy2arr1299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1314[3] { - yy1325 := &x.Spec - yy1325.CodecEncodeSelf(e) + if yyq1299[1] { + yy1304 := &x.Spec + yy1304.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1314[3] { + if yyq1299[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1326 := &x.Spec - yy1326.CodecEncodeSelf(e) + yy1305 := &x.Spec + yy1305.CodecEncodeSelf(e) } } - if yyr1314 || yy2arr1314 { + if yyr1299 || yy2arr1299 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1314[4] { - yy1328 := &x.Status - yy1328.CodecEncodeSelf(e) + if yyq1299[2] { + yy1307 := &x.Status + yy1307.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1314[4] { + if yyq1299[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1329 := &x.Status - yy1329.CodecEncodeSelf(e) + yy1308 := &x.Status + yy1308.CodecEncodeSelf(e) } } - if yyr1314 || yy2arr1314 { + if yyr1299 || yy2arr1299 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1299[3] { + yym1310 := z.EncBinary() + _ = yym1310 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1299[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1311 := z.EncBinary() + _ = yym1311 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1299 || yy2arr1299 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1299[4] { + yym1313 := z.EncBinary() + _ = yym1313 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1299[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1314 := z.EncBinary() + _ = yym1314 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1299 || yy2arr1299 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15854,25 +15627,25 @@ func (x *ReplicaSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1330 := z.DecBinary() - _ = yym1330 + yym1315 := z.DecBinary() + _ = yym1315 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1331 := r.ContainerType() - if yyct1331 == codecSelferValueTypeMap1234 { - yyl1331 := r.ReadMapStart() - if yyl1331 == 0 { + yyct1316 := r.ContainerType() + if yyct1316 == codecSelferValueTypeMap1234 { + yyl1316 := r.ReadMapStart() + if yyl1316 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1331, d) + x.codecDecodeSelfFromMap(yyl1316, d) } - } else if yyct1331 == codecSelferValueTypeArray1234 { - yyl1331 := r.ReadArrayStart() - if yyl1331 == 0 { + } else if yyct1316 == codecSelferValueTypeArray1234 { + yyl1316 := r.ReadArrayStart() + if yyl1316 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1331, d) + x.codecDecodeSelfFromArray(yyl1316, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15884,12 +15657,12 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1332Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1332Slc - var yyhl1332 bool = l >= 0 - for yyj1332 := 0; ; yyj1332++ { - if yyhl1332 { - if yyj1332 >= l { + var yys1317Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1317Slc + var yyhl1317 bool = l >= 0 + for yyj1317 := 0; ; yyj1317++ { + if yyhl1317 { + if yyj1317 >= l { break } } else { @@ -15898,10 +15671,31 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1332Slc = r.DecodeBytes(yys1332Slc, true, true) - yys1332 := string(yys1332Slc) + yys1317Slc = r.DecodeBytes(yys1317Slc, true, true) + yys1317 := string(yys1317Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1332 { + switch yys1317 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1318 := &x.ObjectMeta + yyv1318.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ReplicaSetSpec{} + } else { + yyv1319 := &x.Spec + yyv1319.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ReplicaSetStatus{} + } else { + yyv1320 := &x.Status + yyv1320.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -15914,31 +15708,10 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1335 := &x.ObjectMeta - yyv1335.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ReplicaSetSpec{} - } else { - yyv1336 := &x.Spec - yyv1336.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ReplicaSetStatus{} - } else { - yyv1337 := &x.Status - yyv1337.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1332) - } // end switch yys1332 - } // end for yyj1332 + z.DecStructFieldNotFound(-1, yys1317) + } // end switch yys1317 + } // end for yyj1317 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15946,16 +15719,67 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1338 int - var yyb1338 bool - var yyhl1338 bool = l >= 0 - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + var yyj1323 int + var yyb1323 bool + var yyhl1323 bool = l >= 0 + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l } else { - yyb1338 = r.CheckBreak() + yyb1323 = r.CheckBreak() } - if yyb1338 { + if yyb1323 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1324 := &x.ObjectMeta + yyv1324.CodecDecodeSelf(d) + } + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l + } else { + yyb1323 = r.CheckBreak() + } + if yyb1323 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ReplicaSetSpec{} + } else { + yyv1325 := &x.Spec + yyv1325.CodecDecodeSelf(d) + } + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l + } else { + yyb1323 = r.CheckBreak() + } + if yyb1323 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ReplicaSetStatus{} + } else { + yyv1326 := &x.Status + yyv1326.CodecDecodeSelf(d) + } + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l + } else { + yyb1323 = r.CheckBreak() + } + if yyb1323 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15965,13 +15789,13 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l } else { - yyb1338 = r.CheckBreak() + yyb1323 = r.CheckBreak() } - if yyb1338 { + if yyb1323 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15981,69 +15805,18 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l - } else { - yyb1338 = r.CheckBreak() - } - if yyb1338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv1341 := &x.ObjectMeta - yyv1341.CodecDecodeSelf(d) - } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l - } else { - yyb1338 = r.CheckBreak() - } - if yyb1338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ReplicaSetSpec{} - } else { - yyv1342 := &x.Spec - yyv1342.CodecDecodeSelf(d) - } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l - } else { - yyb1338 = r.CheckBreak() - } - if yyb1338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ReplicaSetStatus{} - } else { - yyv1343 := &x.Status - yyv1343.CodecDecodeSelf(d) - } for { - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1323++ + if yyhl1323 { + yyb1323 = yyj1323 > l } else { - yyb1338 = r.CheckBreak() + yyb1323 = r.CheckBreak() } - if yyb1338 { + if yyb1323 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1338-1, "") + z.DecStructFieldNotFound(yyj1323-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16055,118 +15828,68 @@ func (x *ReplicaSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1344 := z.EncBinary() - _ = yym1344 + yym1329 := z.EncBinary() + _ = yym1329 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1345 := !z.EncBinary() - yy2arr1345 := z.EncBasicHandle().StructToArray - var yyq1345 [4]bool - _, _, _ = yysep1345, yyq1345, yy2arr1345 - const yyr1345 bool = false - yyq1345[0] = x.Kind != "" - yyq1345[1] = x.APIVersion != "" - yyq1345[2] = true - var yynn1345 int - if yyr1345 || yy2arr1345 { + yysep1330 := !z.EncBinary() + yy2arr1330 := z.EncBasicHandle().StructToArray + var yyq1330 [4]bool + _, _, _ = yysep1330, yyq1330, yy2arr1330 + const yyr1330 bool = false + yyq1330[0] = true + yyq1330[2] = x.Kind != "" + yyq1330[3] = x.APIVersion != "" + var yynn1330 int + if yyr1330 || yy2arr1330 { r.EncodeArrayStart(4) } else { - yynn1345 = 1 - for _, b := range yyq1345 { + yynn1330 = 1 + for _, b := range yyq1330 { if b { - yynn1345++ + yynn1330++ } } - r.EncodeMapStart(yynn1345) - yynn1345 = 0 + r.EncodeMapStart(yynn1330) + yynn1330 = 0 } - if yyr1345 || yy2arr1345 { + if yyr1330 || yy2arr1330 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1345[0] { - yym1347 := z.EncBinary() - _ = yym1347 + if yyq1330[0] { + yy1332 := &x.ListMeta + yym1333 := z.EncBinary() + _ = yym1333 if false { + } else if z.HasExtensions() && z.EncExt(yy1332) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1345[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1348 := z.EncBinary() - _ = yym1348 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1345 || yy2arr1345 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1345[1] { - yym1350 := z.EncBinary() - _ = yym1350 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1345[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1351 := z.EncBinary() - _ = yym1351 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1345 || yy2arr1345 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1345[2] { - yy1353 := &x.ListMeta - yym1354 := z.EncBinary() - _ = yym1354 - if false { - } else if z.HasExtensions() && z.EncExt(yy1353) { - } else { - z.EncFallback(yy1353) + z.EncFallback(yy1332) } } else { r.EncodeNil() } } else { - if yyq1345[2] { + if yyq1330[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1355 := &x.ListMeta - yym1356 := z.EncBinary() - _ = yym1356 + yy1334 := &x.ListMeta + yym1335 := z.EncBinary() + _ = yym1335 if false { - } else if z.HasExtensions() && z.EncExt(yy1355) { + } else if z.HasExtensions() && z.EncExt(yy1334) { } else { - z.EncFallback(yy1355) + z.EncFallback(yy1334) } } } - if yyr1345 || yy2arr1345 { + if yyr1330 || yy2arr1330 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1358 := z.EncBinary() - _ = yym1358 + yym1337 := z.EncBinary() + _ = yym1337 if false { } else { h.encSliceReplicaSet(([]ReplicaSet)(x.Items), e) @@ -16179,15 +15902,65 @@ func (x *ReplicaSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1359 := z.EncBinary() - _ = yym1359 + yym1338 := z.EncBinary() + _ = yym1338 if false { } else { h.encSliceReplicaSet(([]ReplicaSet)(x.Items), e) } } } - if yyr1345 || yy2arr1345 { + if yyr1330 || yy2arr1330 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1330[2] { + yym1340 := z.EncBinary() + _ = yym1340 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1330[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1341 := z.EncBinary() + _ = yym1341 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1330 || yy2arr1330 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1330[3] { + yym1343 := z.EncBinary() + _ = yym1343 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1330[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1344 := z.EncBinary() + _ = yym1344 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1330 || yy2arr1330 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16200,25 +15973,25 @@ func (x *ReplicaSetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1360 := z.DecBinary() - _ = yym1360 + yym1345 := z.DecBinary() + _ = yym1345 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1361 := r.ContainerType() - if yyct1361 == codecSelferValueTypeMap1234 { - yyl1361 := r.ReadMapStart() - if yyl1361 == 0 { + yyct1346 := r.ContainerType() + if yyct1346 == codecSelferValueTypeMap1234 { + yyl1346 := r.ReadMapStart() + if yyl1346 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1361, d) + x.codecDecodeSelfFromMap(yyl1346, d) } - } else if yyct1361 == codecSelferValueTypeArray1234 { - yyl1361 := r.ReadArrayStart() - if yyl1361 == 0 { + } else if yyct1346 == codecSelferValueTypeArray1234 { + yyl1346 := r.ReadArrayStart() + if yyl1346 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1361, d) + x.codecDecodeSelfFromArray(yyl1346, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16230,12 +16003,12 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1362Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1362Slc - var yyhl1362 bool = l >= 0 - for yyj1362 := 0; ; yyj1362++ { - if yyhl1362 { - if yyj1362 >= l { + var yys1347Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1347Slc + var yyhl1347 bool = l >= 0 + for yyj1347 := 0; ; yyj1347++ { + if yyhl1347 { + if yyj1347 >= l { break } } else { @@ -16244,10 +16017,35 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1362Slc = r.DecodeBytes(yys1362Slc, true, true) - yys1362 := string(yys1362Slc) + yys1347Slc = r.DecodeBytes(yys1347Slc, true, true) + yys1347 := string(yys1347Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1362 { + switch yys1347 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1348 := &x.ListMeta + yym1349 := z.DecBinary() + _ = yym1349 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1348) { + } else { + z.DecFallback(yyv1348, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1350 := &x.Items + yym1351 := z.DecBinary() + _ = yym1351 + if false { + } else { + h.decSliceReplicaSet((*[]ReplicaSet)(yyv1350), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -16260,35 +16058,10 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1365 := &x.ListMeta - yym1366 := z.DecBinary() - _ = yym1366 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1365) { - } else { - z.DecFallback(yyv1365, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1367 := &x.Items - yym1368 := z.DecBinary() - _ = yym1368 - if false { - } else { - h.decSliceReplicaSet((*[]ReplicaSet)(yyv1367), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1362) - } // end switch yys1362 - } // end for yyj1362 + z.DecStructFieldNotFound(-1, yys1347) + } // end switch yys1347 + } // end for yyj1347 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16296,16 +16069,61 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1369 int - var yyb1369 bool - var yyhl1369 bool = l >= 0 - yyj1369++ - if yyhl1369 { - yyb1369 = yyj1369 > l + var yyj1354 int + var yyb1354 bool + var yyhl1354 bool = l >= 0 + yyj1354++ + if yyhl1354 { + yyb1354 = yyj1354 > l } else { - yyb1369 = r.CheckBreak() + yyb1354 = r.CheckBreak() } - if yyb1369 { + if yyb1354 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1355 := &x.ListMeta + yym1356 := z.DecBinary() + _ = yym1356 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1355) { + } else { + z.DecFallback(yyv1355, false) + } + } + yyj1354++ + if yyhl1354 { + yyb1354 = yyj1354 > l + } else { + yyb1354 = r.CheckBreak() + } + if yyb1354 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1357 := &x.Items + yym1358 := z.DecBinary() + _ = yym1358 + if false { + } else { + h.decSliceReplicaSet((*[]ReplicaSet)(yyv1357), d) + } + } + yyj1354++ + if yyhl1354 { + yyb1354 = yyj1354 > l + } else { + yyb1354 = r.CheckBreak() + } + if yyb1354 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16315,13 +16133,13 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1369++ - if yyhl1369 { - yyb1369 = yyj1369 > l + yyj1354++ + if yyhl1354 { + yyb1354 = yyj1354 > l } else { - yyb1369 = r.CheckBreak() + yyb1354 = r.CheckBreak() } - if yyb1369 { + if yyb1354 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16331,63 +16149,18 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1369++ - if yyhl1369 { - yyb1369 = yyj1369 > l - } else { - yyb1369 = r.CheckBreak() - } - if yyb1369 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1372 := &x.ListMeta - yym1373 := z.DecBinary() - _ = yym1373 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1372) { - } else { - z.DecFallback(yyv1372, false) - } - } - yyj1369++ - if yyhl1369 { - yyb1369 = yyj1369 > l - } else { - yyb1369 = r.CheckBreak() - } - if yyb1369 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1374 := &x.Items - yym1375 := z.DecBinary() - _ = yym1375 - if false { - } else { - h.decSliceReplicaSet((*[]ReplicaSet)(yyv1374), d) - } - } for { - yyj1369++ - if yyhl1369 { - yyb1369 = yyj1369 > l + yyj1354++ + if yyhl1354 { + yyb1354 = yyj1354 > l } else { - yyb1369 = r.CheckBreak() + yyb1354 = r.CheckBreak() } - if yyb1369 { + if yyb1354 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1369-1, "") + z.DecStructFieldNotFound(yyj1354-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16399,35 +16172,35 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1376 := z.EncBinary() - _ = yym1376 + yym1361 := z.EncBinary() + _ = yym1361 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1377 := !z.EncBinary() - yy2arr1377 := z.EncBasicHandle().StructToArray - var yyq1377 [3]bool - _, _, _ = yysep1377, yyq1377, yy2arr1377 - const yyr1377 bool = false - yyq1377[1] = x.Selector != nil - yyq1377[2] = x.Template != nil - var yynn1377 int - if yyr1377 || yy2arr1377 { + yysep1362 := !z.EncBinary() + yy2arr1362 := z.EncBasicHandle().StructToArray + var yyq1362 [3]bool + _, _, _ = yysep1362, yyq1362, yy2arr1362 + const yyr1362 bool = false + yyq1362[1] = x.Selector != nil + yyq1362[2] = x.Template != nil + var yynn1362 int + if yyr1362 || yy2arr1362 { r.EncodeArrayStart(3) } else { - yynn1377 = 1 - for _, b := range yyq1377 { + yynn1362 = 1 + for _, b := range yyq1362 { if b { - yynn1377++ + yynn1362++ } } - r.EncodeMapStart(yynn1377) - yynn1377 = 0 + r.EncodeMapStart(yynn1362) + yynn1362 = 0 } - if yyr1377 || yy2arr1377 { + if yyr1362 || yy2arr1362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1379 := z.EncBinary() - _ = yym1379 + yym1364 := z.EncBinary() + _ = yym1364 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -16436,39 +16209,51 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1380 := z.EncBinary() - _ = yym1380 + yym1365 := z.EncBinary() + _ = yym1365 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1377 || yy2arr1377 { + if yyr1362 || yy2arr1362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1377[1] { + if yyq1362[1] { if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym1367 := z.EncBinary() + _ = yym1367 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } else { r.EncodeNil() } } else { - if yyq1377[1] { + if yyq1362[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Selector == nil { r.EncodeNil() } else { - x.Selector.CodecEncodeSelf(e) + yym1368 := z.EncBinary() + _ = yym1368 + if false { + } else if z.HasExtensions() && z.EncExt(x.Selector) { + } else { + z.EncFallback(x.Selector) + } } } } - if yyr1377 || yy2arr1377 { + if yyr1362 || yy2arr1362 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1377[2] { + if yyq1362[2] { if x.Template == nil { r.EncodeNil() } else { @@ -16478,7 +16263,7 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1377[2] { + if yyq1362[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -16489,7 +16274,7 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1377 || yy2arr1377 { + if yyr1362 || yy2arr1362 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16502,25 +16287,25 @@ func (x *ReplicaSetSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1383 := z.DecBinary() - _ = yym1383 + yym1370 := z.DecBinary() + _ = yym1370 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1384 := r.ContainerType() - if yyct1384 == codecSelferValueTypeMap1234 { - yyl1384 := r.ReadMapStart() - if yyl1384 == 0 { + yyct1371 := r.ContainerType() + if yyct1371 == codecSelferValueTypeMap1234 { + yyl1371 := r.ReadMapStart() + if yyl1371 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1384, d) + x.codecDecodeSelfFromMap(yyl1371, d) } - } else if yyct1384 == codecSelferValueTypeArray1234 { - yyl1384 := r.ReadArrayStart() - if yyl1384 == 0 { + } else if yyct1371 == codecSelferValueTypeArray1234 { + yyl1371 := r.ReadArrayStart() + if yyl1371 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1384, d) + x.codecDecodeSelfFromArray(yyl1371, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16532,12 +16317,12 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1385Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1385Slc - var yyhl1385 bool = l >= 0 - for yyj1385 := 0; ; yyj1385++ { - if yyhl1385 { - if yyj1385 >= l { + var yys1372Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1372Slc + var yyhl1372 bool = l >= 0 + for yyj1372 := 0; ; yyj1372++ { + if yyhl1372 { + if yyj1372 >= l { break } } else { @@ -16546,10 +16331,10 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1385Slc = r.DecodeBytes(yys1385Slc, true, true) - yys1385 := string(yys1385Slc) + yys1372Slc = r.DecodeBytes(yys1372Slc, true, true) + yys1372 := string(yys1372Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1385 { + switch yys1372 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -16563,9 +16348,15 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym1375 := z.DecBinary() + _ = yym1375 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } case "template": if r.TryDecodeAsNil() { @@ -16579,9 +16370,9 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Template.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1385) - } // end switch yys1385 - } // end for yyj1385 + z.DecStructFieldNotFound(-1, yys1372) + } // end switch yys1372 + } // end for yyj1372 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16589,16 +16380,16 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1389 int - var yyb1389 bool - var yyhl1389 bool = l >= 0 - yyj1389++ - if yyhl1389 { - yyb1389 = yyj1389 > l + var yyj1377 int + var yyb1377 bool + var yyhl1377 bool = l >= 0 + yyj1377++ + if yyhl1377 { + yyb1377 = yyj1377 > l } else { - yyb1389 = r.CheckBreak() + yyb1377 = r.CheckBreak() } - if yyb1389 { + if yyb1377 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16608,13 +16399,13 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Replicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1389++ - if yyhl1389 { - yyb1389 = yyj1389 > l + yyj1377++ + if yyhl1377 { + yyb1377 = yyj1377 > l } else { - yyb1389 = r.CheckBreak() + yyb1377 = r.CheckBreak() } - if yyb1389 { + if yyb1377 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16625,17 +16416,23 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } } else { if x.Selector == nil { - x.Selector = new(LabelSelector) + x.Selector = new(pkg1_unversioned.LabelSelector) + } + yym1380 := z.DecBinary() + _ = yym1380 + if false { + } else if z.HasExtensions() && z.DecExt(x.Selector) { + } else { + z.DecFallback(x.Selector, false) } - x.Selector.CodecDecodeSelf(d) } - yyj1389++ - if yyhl1389 { - yyb1389 = yyj1389 > l + yyj1377++ + if yyhl1377 { + yyb1377 = yyj1377 > l } else { - yyb1389 = r.CheckBreak() + yyb1377 = r.CheckBreak() } - if yyb1389 { + if yyb1377 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16651,17 +16448,17 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Template.CodecDecodeSelf(d) } for { - yyj1389++ - if yyhl1389 { - yyb1389 = yyj1389 > l + yyj1377++ + if yyhl1377 { + yyb1377 = yyj1377 > l } else { - yyb1389 = r.CheckBreak() + yyb1377 = r.CheckBreak() } - if yyb1389 { + if yyb1377 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1389-1, "") + z.DecStructFieldNotFound(yyj1377-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16673,34 +16470,34 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1393 := z.EncBinary() - _ = yym1393 + yym1382 := z.EncBinary() + _ = yym1382 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1394 := !z.EncBinary() - yy2arr1394 := z.EncBasicHandle().StructToArray - var yyq1394 [2]bool - _, _, _ = yysep1394, yyq1394, yy2arr1394 - const yyr1394 bool = false - yyq1394[1] = x.ObservedGeneration != 0 - var yynn1394 int - if yyr1394 || yy2arr1394 { + yysep1383 := !z.EncBinary() + yy2arr1383 := z.EncBasicHandle().StructToArray + var yyq1383 [2]bool + _, _, _ = yysep1383, yyq1383, yy2arr1383 + const yyr1383 bool = false + yyq1383[1] = x.ObservedGeneration != 0 + var yynn1383 int + if yyr1383 || yy2arr1383 { r.EncodeArrayStart(2) } else { - yynn1394 = 1 - for _, b := range yyq1394 { + yynn1383 = 1 + for _, b := range yyq1383 { if b { - yynn1394++ + yynn1383++ } } - r.EncodeMapStart(yynn1394) - yynn1394 = 0 + r.EncodeMapStart(yynn1383) + yynn1383 = 0 } - if yyr1394 || yy2arr1394 { + if yyr1383 || yy2arr1383 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1396 := z.EncBinary() - _ = yym1396 + yym1385 := z.EncBinary() + _ = yym1385 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -16709,18 +16506,18 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1397 := z.EncBinary() - _ = yym1397 + yym1386 := z.EncBinary() + _ = yym1386 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1394 || yy2arr1394 { + if yyr1383 || yy2arr1383 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1394[1] { - yym1399 := z.EncBinary() - _ = yym1399 + if yyq1383[1] { + yym1388 := z.EncBinary() + _ = yym1388 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) @@ -16729,19 +16526,19 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1394[1] { + if yyq1383[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("observedGeneration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1400 := z.EncBinary() - _ = yym1400 + yym1389 := z.EncBinary() + _ = yym1389 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) } } } - if yyr1394 || yy2arr1394 { + if yyr1383 || yy2arr1383 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16754,25 +16551,25 @@ func (x *ReplicaSetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1401 := z.DecBinary() - _ = yym1401 + yym1390 := z.DecBinary() + _ = yym1390 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1402 := r.ContainerType() - if yyct1402 == codecSelferValueTypeMap1234 { - yyl1402 := r.ReadMapStart() - if yyl1402 == 0 { + yyct1391 := r.ContainerType() + if yyct1391 == codecSelferValueTypeMap1234 { + yyl1391 := r.ReadMapStart() + if yyl1391 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1402, d) + x.codecDecodeSelfFromMap(yyl1391, d) } - } else if yyct1402 == codecSelferValueTypeArray1234 { - yyl1402 := r.ReadArrayStart() - if yyl1402 == 0 { + } else if yyct1391 == codecSelferValueTypeArray1234 { + yyl1391 := r.ReadArrayStart() + if yyl1391 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1402, d) + x.codecDecodeSelfFromArray(yyl1391, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16784,12 +16581,12 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1403Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1403Slc - var yyhl1403 bool = l >= 0 - for yyj1403 := 0; ; yyj1403++ { - if yyhl1403 { - if yyj1403 >= l { + var yys1392Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1392Slc + var yyhl1392 bool = l >= 0 + for yyj1392 := 0; ; yyj1392++ { + if yyhl1392 { + if yyj1392 >= l { break } } else { @@ -16798,10 +16595,10 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1403Slc = r.DecodeBytes(yys1403Slc, true, true) - yys1403 := string(yys1403Slc) + yys1392Slc = r.DecodeBytes(yys1392Slc, true, true) + yys1392 := string(yys1392Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1403 { + switch yys1392 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -16815,9 +16612,9 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ObservedGeneration = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys1403) - } // end switch yys1403 - } // end for yyj1403 + z.DecStructFieldNotFound(-1, yys1392) + } // end switch yys1392 + } // end for yyj1392 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16825,16 +16622,16 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1406 int - var yyb1406 bool - var yyhl1406 bool = l >= 0 - yyj1406++ - if yyhl1406 { - yyb1406 = yyj1406 > l + var yyj1395 int + var yyb1395 bool + var yyhl1395 bool = l >= 0 + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1406 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1406 { + if yyb1395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16844,13 +16641,13 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Replicas = int(r.DecodeInt(codecSelferBitsize1234)) } - yyj1406++ - if yyhl1406 { - yyb1406 = yyj1406 > l + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1406 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1406 { + if yyb1395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16861,17 +16658,2175 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ObservedGeneration = int64(r.DecodeInt(64)) } for { - yyj1406++ - if yyhl1406 { - yyb1406 = yyj1406 > l + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1406 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1406 { + if yyb1395 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1406-1, "") + z.DecStructFieldNotFound(yyj1395-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodSecurityPolicy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1398 := z.EncBinary() + _ = yym1398 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1399 := !z.EncBinary() + yy2arr1399 := z.EncBasicHandle().StructToArray + var yyq1399 [4]bool + _, _, _ = yysep1399, yyq1399, yy2arr1399 + const yyr1399 bool = false + yyq1399[0] = true + yyq1399[1] = true + yyq1399[2] = x.Kind != "" + yyq1399[3] = x.APIVersion != "" + var yynn1399 int + if yyr1399 || yy2arr1399 { + r.EncodeArrayStart(4) + } else { + yynn1399 = 0 + for _, b := range yyq1399 { + if b { + yynn1399++ + } + } + r.EncodeMapStart(yynn1399) + yynn1399 = 0 + } + if yyr1399 || yy2arr1399 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1399[0] { + yy1401 := &x.ObjectMeta + yy1401.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1399[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1402 := &x.ObjectMeta + yy1402.CodecEncodeSelf(e) + } + } + if yyr1399 || yy2arr1399 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1399[1] { + yy1404 := &x.Spec + yy1404.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1399[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1405 := &x.Spec + yy1405.CodecEncodeSelf(e) + } + } + if yyr1399 || yy2arr1399 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1399[2] { + yym1407 := z.EncBinary() + _ = yym1407 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1399[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1408 := z.EncBinary() + _ = yym1408 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1399 || yy2arr1399 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1399[3] { + yym1410 := z.EncBinary() + _ = yym1410 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1399[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1411 := z.EncBinary() + _ = yym1411 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1399 || yy2arr1399 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1412 := z.DecBinary() + _ = yym1412 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1413 := r.ContainerType() + if yyct1413 == codecSelferValueTypeMap1234 { + yyl1413 := r.ReadMapStart() + if yyl1413 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1413, d) + } + } else if yyct1413 == codecSelferValueTypeArray1234 { + yyl1413 := r.ReadArrayStart() + if yyl1413 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1413, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1414Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1414Slc + var yyhl1414 bool = l >= 0 + for yyj1414 := 0; ; yyj1414++ { + if yyhl1414 { + if yyj1414 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1414Slc = r.DecodeBytes(yys1414Slc, true, true) + yys1414 := string(yys1414Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1414 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1415 := &x.ObjectMeta + yyv1415.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PodSecurityPolicySpec{} + } else { + yyv1416 := &x.Spec + yyv1416.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, yys1414) + } // end switch yys1414 + } // end for yyj1414 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1419 int + var yyb1419 bool + var yyhl1419 bool = l >= 0 + yyj1419++ + if yyhl1419 { + yyb1419 = yyj1419 > l + } else { + yyb1419 = r.CheckBreak() + } + if yyb1419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv1420 := &x.ObjectMeta + yyv1420.CodecDecodeSelf(d) + } + yyj1419++ + if yyhl1419 { + yyb1419 = yyj1419 > l + } else { + yyb1419 = r.CheckBreak() + } + if yyb1419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PodSecurityPolicySpec{} + } else { + yyv1421 := &x.Spec + yyv1421.CodecDecodeSelf(d) + } + yyj1419++ + if yyhl1419 { + yyb1419 = yyj1419 > l + } else { + yyb1419 = r.CheckBreak() + } + if yyb1419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1419++ + if yyhl1419 { + yyb1419 = yyj1419 > l + } else { + yyb1419 = r.CheckBreak() + } + if yyb1419 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj1419++ + if yyhl1419 { + yyb1419 = yyj1419 > l + } else { + yyb1419 = r.CheckBreak() + } + if yyb1419 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1419-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodSecurityPolicySpec) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1424 := z.EncBinary() + _ = yym1424 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1425 := !z.EncBinary() + yy2arr1425 := z.EncBasicHandle().StructToArray + var yyq1425 [9]bool + _, _, _ = yysep1425, yyq1425, yy2arr1425 + const yyr1425 bool = false + yyq1425[0] = x.Privileged != false + yyq1425[1] = len(x.Capabilities) != 0 + yyq1425[2] = len(x.Volumes) != 0 + yyq1425[3] = x.HostNetwork != false + yyq1425[4] = len(x.HostPorts) != 0 + yyq1425[5] = x.HostPID != false + yyq1425[6] = x.HostIPC != false + yyq1425[7] = true + yyq1425[8] = true + var yynn1425 int + if yyr1425 || yy2arr1425 { + r.EncodeArrayStart(9) + } else { + yynn1425 = 0 + for _, b := range yyq1425 { + if b { + yynn1425++ + } + } + r.EncodeMapStart(yynn1425) + yynn1425 = 0 + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[0] { + yym1427 := z.EncBinary() + _ = yym1427 + if false { + } else { + r.EncodeBool(bool(x.Privileged)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1425[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("privileged")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1428 := z.EncBinary() + _ = yym1428 + if false { + } else { + r.EncodeBool(bool(x.Privileged)) + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[1] { + if x.Capabilities == nil { + r.EncodeNil() + } else { + yym1430 := z.EncBinary() + _ = yym1430 + if false { + } else { + h.encSliceapi_Capability(([]pkg2_api.Capability)(x.Capabilities), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1425[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("capabilities")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Capabilities == nil { + r.EncodeNil() + } else { + yym1431 := z.EncBinary() + _ = yym1431 + if false { + } else { + h.encSliceapi_Capability(([]pkg2_api.Capability)(x.Capabilities), e) + } + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[2] { + if x.Volumes == nil { + r.EncodeNil() + } else { + yym1433 := z.EncBinary() + _ = yym1433 + if false { + } else { + h.encSliceFSType(([]FSType)(x.Volumes), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1425[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("volumes")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Volumes == nil { + r.EncodeNil() + } else { + yym1434 := z.EncBinary() + _ = yym1434 + if false { + } else { + h.encSliceFSType(([]FSType)(x.Volumes), e) + } + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[3] { + yym1436 := z.EncBinary() + _ = yym1436 + if false { + } else { + r.EncodeBool(bool(x.HostNetwork)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1425[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostNetwork")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1437 := z.EncBinary() + _ = yym1437 + if false { + } else { + r.EncodeBool(bool(x.HostNetwork)) + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[4] { + if x.HostPorts == nil { + r.EncodeNil() + } else { + yym1439 := z.EncBinary() + _ = yym1439 + if false { + } else { + h.encSliceHostPortRange(([]HostPortRange)(x.HostPorts), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1425[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPorts")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.HostPorts == nil { + r.EncodeNil() + } else { + yym1440 := z.EncBinary() + _ = yym1440 + if false { + } else { + h.encSliceHostPortRange(([]HostPortRange)(x.HostPorts), e) + } + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[5] { + yym1442 := z.EncBinary() + _ = yym1442 + if false { + } else { + r.EncodeBool(bool(x.HostPID)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1425[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPID")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1443 := z.EncBinary() + _ = yym1443 + if false { + } else { + r.EncodeBool(bool(x.HostPID)) + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[6] { + yym1445 := z.EncBinary() + _ = yym1445 + if false { + } else { + r.EncodeBool(bool(x.HostIPC)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1425[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostIPC")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1446 := z.EncBinary() + _ = yym1446 + if false { + } else { + r.EncodeBool(bool(x.HostIPC)) + } + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[7] { + yy1448 := &x.SELinuxContext + yy1448.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1425[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("seLinuxContext")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1449 := &x.SELinuxContext + yy1449.CodecEncodeSelf(e) + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1425[8] { + yy1451 := &x.RunAsUser + yy1451.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1425[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1452 := &x.RunAsUser + yy1452.CodecEncodeSelf(e) + } + } + if yyr1425 || yy2arr1425 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicySpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1453 := z.DecBinary() + _ = yym1453 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1454 := r.ContainerType() + if yyct1454 == codecSelferValueTypeMap1234 { + yyl1454 := r.ReadMapStart() + if yyl1454 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1454, d) + } + } else if yyct1454 == codecSelferValueTypeArray1234 { + yyl1454 := r.ReadArrayStart() + if yyl1454 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1454, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicySpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1455Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1455Slc + var yyhl1455 bool = l >= 0 + for yyj1455 := 0; ; yyj1455++ { + if yyhl1455 { + if yyj1455 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1455Slc = r.DecodeBytes(yys1455Slc, true, true) + yys1455 := string(yys1455Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1455 { + case "privileged": + if r.TryDecodeAsNil() { + x.Privileged = false + } else { + x.Privileged = bool(r.DecodeBool()) + } + case "capabilities": + if r.TryDecodeAsNil() { + x.Capabilities = nil + } else { + yyv1457 := &x.Capabilities + yym1458 := z.DecBinary() + _ = yym1458 + if false { + } else { + h.decSliceapi_Capability((*[]pkg2_api.Capability)(yyv1457), d) + } + } + case "volumes": + if r.TryDecodeAsNil() { + x.Volumes = nil + } else { + yyv1459 := &x.Volumes + yym1460 := z.DecBinary() + _ = yym1460 + if false { + } else { + h.decSliceFSType((*[]FSType)(yyv1459), d) + } + } + case "hostNetwork": + if r.TryDecodeAsNil() { + x.HostNetwork = false + } else { + x.HostNetwork = bool(r.DecodeBool()) + } + case "hostPorts": + if r.TryDecodeAsNil() { + x.HostPorts = nil + } else { + yyv1462 := &x.HostPorts + yym1463 := z.DecBinary() + _ = yym1463 + if false { + } else { + h.decSliceHostPortRange((*[]HostPortRange)(yyv1462), d) + } + } + case "hostPID": + if r.TryDecodeAsNil() { + x.HostPID = false + } else { + x.HostPID = bool(r.DecodeBool()) + } + case "hostIPC": + if r.TryDecodeAsNil() { + x.HostIPC = false + } else { + x.HostIPC = bool(r.DecodeBool()) + } + case "seLinuxContext": + if r.TryDecodeAsNil() { + x.SELinuxContext = SELinuxContextStrategyOptions{} + } else { + yyv1466 := &x.SELinuxContext + yyv1466.CodecDecodeSelf(d) + } + case "runAsUser": + if r.TryDecodeAsNil() { + x.RunAsUser = RunAsUserStrategyOptions{} + } else { + yyv1467 := &x.RunAsUser + yyv1467.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1455) + } // end switch yys1455 + } // end for yyj1455 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicySpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1468 int + var yyb1468 bool + var yyhl1468 bool = l >= 0 + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Privileged = false + } else { + x.Privileged = bool(r.DecodeBool()) + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Capabilities = nil + } else { + yyv1470 := &x.Capabilities + yym1471 := z.DecBinary() + _ = yym1471 + if false { + } else { + h.decSliceapi_Capability((*[]pkg2_api.Capability)(yyv1470), d) + } + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Volumes = nil + } else { + yyv1472 := &x.Volumes + yym1473 := z.DecBinary() + _ = yym1473 + if false { + } else { + h.decSliceFSType((*[]FSType)(yyv1472), d) + } + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostNetwork = false + } else { + x.HostNetwork = bool(r.DecodeBool()) + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostPorts = nil + } else { + yyv1475 := &x.HostPorts + yym1476 := z.DecBinary() + _ = yym1476 + if false { + } else { + h.decSliceHostPortRange((*[]HostPortRange)(yyv1475), d) + } + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostPID = false + } else { + x.HostPID = bool(r.DecodeBool()) + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostIPC = false + } else { + x.HostIPC = bool(r.DecodeBool()) + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SELinuxContext = SELinuxContextStrategyOptions{} + } else { + yyv1479 := &x.SELinuxContext + yyv1479.CodecDecodeSelf(d) + } + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RunAsUser = RunAsUserStrategyOptions{} + } else { + yyv1480 := &x.RunAsUser + yyv1480.CodecDecodeSelf(d) + } + for { + yyj1468++ + if yyhl1468 { + yyb1468 = yyj1468 > l + } else { + yyb1468 = r.CheckBreak() + } + if yyb1468 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1468-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *HostPortRange) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1481 := z.EncBinary() + _ = yym1481 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1482 := !z.EncBinary() + yy2arr1482 := z.EncBasicHandle().StructToArray + var yyq1482 [2]bool + _, _, _ = yysep1482, yyq1482, yy2arr1482 + const yyr1482 bool = false + var yynn1482 int + if yyr1482 || yy2arr1482 { + r.EncodeArrayStart(2) + } else { + yynn1482 = 2 + for _, b := range yyq1482 { + if b { + yynn1482++ + } + } + r.EncodeMapStart(yynn1482) + yynn1482 = 0 + } + if yyr1482 || yy2arr1482 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1484 := z.EncBinary() + _ = yym1484 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("min")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1485 := z.EncBinary() + _ = yym1485 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } + if yyr1482 || yy2arr1482 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1487 := z.EncBinary() + _ = yym1487 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("max")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1488 := z.EncBinary() + _ = yym1488 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } + if yyr1482 || yy2arr1482 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HostPortRange) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1489 := z.DecBinary() + _ = yym1489 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1490 := r.ContainerType() + if yyct1490 == codecSelferValueTypeMap1234 { + yyl1490 := r.ReadMapStart() + if yyl1490 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1490, d) + } + } else if yyct1490 == codecSelferValueTypeArray1234 { + yyl1490 := r.ReadArrayStart() + if yyl1490 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1490, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HostPortRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1491Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1491Slc + var yyhl1491 bool = l >= 0 + for yyj1491 := 0; ; yyj1491++ { + if yyhl1491 { + if yyj1491 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1491Slc = r.DecodeBytes(yys1491Slc, true, true) + yys1491 := string(yys1491Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1491 { + case "min": + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int(r.DecodeInt(codecSelferBitsize1234)) + } + case "max": + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int(r.DecodeInt(codecSelferBitsize1234)) + } + default: + z.DecStructFieldNotFound(-1, yys1491) + } // end switch yys1491 + } // end for yyj1491 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HostPortRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1494 int + var yyb1494 bool + var yyhl1494 bool = l >= 0 + yyj1494++ + if yyhl1494 { + yyb1494 = yyj1494 > l + } else { + yyb1494 = r.CheckBreak() + } + if yyb1494 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj1494++ + if yyhl1494 { + yyb1494 = yyj1494 > l + } else { + yyb1494 = r.CheckBreak() + } + if yyb1494 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int(r.DecodeInt(codecSelferBitsize1234)) + } + for { + yyj1494++ + if yyhl1494 { + yyb1494 = yyj1494 > l + } else { + yyb1494 = r.CheckBreak() + } + if yyb1494 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1494-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x FSType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1497 := z.EncBinary() + _ = yym1497 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *FSType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1498 := z.DecBinary() + _ = yym1498 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *SELinuxContextStrategyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1499 := z.EncBinary() + _ = yym1499 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1500 := !z.EncBinary() + yy2arr1500 := z.EncBasicHandle().StructToArray + var yyq1500 [2]bool + _, _, _ = yysep1500, yyq1500, yy2arr1500 + const yyr1500 bool = false + yyq1500[1] = x.SELinuxOptions != nil + var yynn1500 int + if yyr1500 || yy2arr1500 { + r.EncodeArrayStart(2) + } else { + yynn1500 = 1 + for _, b := range yyq1500 { + if b { + yynn1500++ + } + } + r.EncodeMapStart(yynn1500) + yynn1500 = 0 + } + if yyr1500 || yy2arr1500 { + 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 yyr1500 || yy2arr1500 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1500[1] { + if x.SELinuxOptions == nil { + r.EncodeNil() + } else { + x.SELinuxOptions.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1500[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SELinuxOptions == nil { + r.EncodeNil() + } else { + x.SELinuxOptions.CodecEncodeSelf(e) + } + } + } + if yyr1500 || yy2arr1500 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *SELinuxContextStrategyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1503 := z.DecBinary() + _ = yym1503 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1504 := r.ContainerType() + if yyct1504 == codecSelferValueTypeMap1234 { + yyl1504 := r.ReadMapStart() + if yyl1504 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1504, d) + } + } else if yyct1504 == codecSelferValueTypeArray1234 { + yyl1504 := r.ReadArrayStart() + if yyl1504 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1504, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *SELinuxContextStrategyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1505Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1505Slc + var yyhl1505 bool = l >= 0 + for yyj1505 := 0; ; yyj1505++ { + if yyhl1505 { + if yyj1505 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1505Slc = r.DecodeBytes(yys1505Slc, true, true) + yys1505 := string(yys1505Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1505 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SELinuxContextStrategy(r.DecodeString()) + } + case "seLinuxOptions": + if r.TryDecodeAsNil() { + if x.SELinuxOptions != nil { + x.SELinuxOptions = nil + } + } else { + if x.SELinuxOptions == nil { + x.SELinuxOptions = new(pkg2_api.SELinuxOptions) + } + x.SELinuxOptions.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1505) + } // end switch yys1505 + } // end for yyj1505 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *SELinuxContextStrategyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1508 int + var yyb1508 bool + var yyhl1508 bool = l >= 0 + yyj1508++ + if yyhl1508 { + yyb1508 = yyj1508 > l + } else { + yyb1508 = r.CheckBreak() + } + if yyb1508 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SELinuxContextStrategy(r.DecodeString()) + } + yyj1508++ + if yyhl1508 { + yyb1508 = yyj1508 > l + } else { + yyb1508 = r.CheckBreak() + } + if yyb1508 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SELinuxOptions != nil { + x.SELinuxOptions = nil + } + } else { + if x.SELinuxOptions == nil { + x.SELinuxOptions = new(pkg2_api.SELinuxOptions) + } + x.SELinuxOptions.CodecDecodeSelf(d) + } + for { + yyj1508++ + if yyhl1508 { + yyb1508 = yyj1508 > l + } else { + yyb1508 = r.CheckBreak() + } + if yyb1508 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1508-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x SELinuxContextStrategy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1511 := z.EncBinary() + _ = yym1511 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *SELinuxContextStrategy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1512 := z.DecBinary() + _ = yym1512 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *RunAsUserStrategyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1513 := z.EncBinary() + _ = yym1513 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1514 := !z.EncBinary() + yy2arr1514 := z.EncBasicHandle().StructToArray + var yyq1514 [2]bool + _, _, _ = yysep1514, yyq1514, yy2arr1514 + const yyr1514 bool = false + yyq1514[1] = len(x.Ranges) != 0 + var yynn1514 int + if yyr1514 || yy2arr1514 { + r.EncodeArrayStart(2) + } else { + yynn1514 = 1 + for _, b := range yyq1514 { + if b { + yynn1514++ + } + } + r.EncodeMapStart(yynn1514) + yynn1514 = 0 + } + if yyr1514 || yy2arr1514 { + 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 yyr1514 || yy2arr1514 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1514[1] { + if x.Ranges == nil { + r.EncodeNil() + } else { + yym1517 := z.EncBinary() + _ = yym1517 + if false { + } else { + h.encSliceIDRange(([]IDRange)(x.Ranges), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1514[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("ranges")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Ranges == nil { + r.EncodeNil() + } else { + yym1518 := z.EncBinary() + _ = yym1518 + if false { + } else { + h.encSliceIDRange(([]IDRange)(x.Ranges), e) + } + } + } + } + if yyr1514 || yy2arr1514 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *RunAsUserStrategyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1519 := z.DecBinary() + _ = yym1519 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1520 := r.ContainerType() + if yyct1520 == codecSelferValueTypeMap1234 { + yyl1520 := r.ReadMapStart() + if yyl1520 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1520, d) + } + } else if yyct1520 == codecSelferValueTypeArray1234 { + yyl1520 := r.ReadArrayStart() + if yyl1520 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1520, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *RunAsUserStrategyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1521Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1521Slc + var yyhl1521 bool = l >= 0 + for yyj1521 := 0; ; yyj1521++ { + if yyhl1521 { + if yyj1521 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1521Slc = r.DecodeBytes(yys1521Slc, true, true) + yys1521 := string(yys1521Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1521 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RunAsUserStrategy(r.DecodeString()) + } + case "ranges": + if r.TryDecodeAsNil() { + x.Ranges = nil + } else { + yyv1523 := &x.Ranges + yym1524 := z.DecBinary() + _ = yym1524 + if false { + } else { + h.decSliceIDRange((*[]IDRange)(yyv1523), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1521) + } // end switch yys1521 + } // end for yyj1521 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *RunAsUserStrategyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1525 int + var yyb1525 bool + var yyhl1525 bool = l >= 0 + yyj1525++ + if yyhl1525 { + yyb1525 = yyj1525 > l + } else { + yyb1525 = r.CheckBreak() + } + if yyb1525 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RunAsUserStrategy(r.DecodeString()) + } + yyj1525++ + if yyhl1525 { + yyb1525 = yyj1525 > l + } else { + yyb1525 = r.CheckBreak() + } + if yyb1525 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Ranges = nil + } else { + yyv1527 := &x.Ranges + yym1528 := z.DecBinary() + _ = yym1528 + if false { + } else { + h.decSliceIDRange((*[]IDRange)(yyv1527), d) + } + } + for { + yyj1525++ + if yyhl1525 { + yyb1525 = yyj1525 > l + } else { + yyb1525 = r.CheckBreak() + } + if yyb1525 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1525-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *IDRange) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1529 := z.EncBinary() + _ = yym1529 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1530 := !z.EncBinary() + yy2arr1530 := z.EncBasicHandle().StructToArray + var yyq1530 [2]bool + _, _, _ = yysep1530, yyq1530, yy2arr1530 + const yyr1530 bool = false + var yynn1530 int + if yyr1530 || yy2arr1530 { + r.EncodeArrayStart(2) + } else { + yynn1530 = 2 + for _, b := range yyq1530 { + if b { + yynn1530++ + } + } + r.EncodeMapStart(yynn1530) + yynn1530 = 0 + } + if yyr1530 || yy2arr1530 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1532 := z.EncBinary() + _ = yym1532 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("min")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1533 := z.EncBinary() + _ = yym1533 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } + if yyr1530 || yy2arr1530 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1535 := z.EncBinary() + _ = yym1535 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("max")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1536 := z.EncBinary() + _ = yym1536 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } + if yyr1530 || yy2arr1530 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *IDRange) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1537 := z.DecBinary() + _ = yym1537 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1538 := r.ContainerType() + if yyct1538 == codecSelferValueTypeMap1234 { + yyl1538 := r.ReadMapStart() + if yyl1538 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1538, d) + } + } else if yyct1538 == codecSelferValueTypeArray1234 { + yyl1538 := r.ReadArrayStart() + if yyl1538 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1538, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *IDRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1539Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1539Slc + var yyhl1539 bool = l >= 0 + for yyj1539 := 0; ; yyj1539++ { + if yyhl1539 { + if yyj1539 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1539Slc = r.DecodeBytes(yys1539Slc, true, true) + yys1539 := string(yys1539Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1539 { + case "min": + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int64(r.DecodeInt(64)) + } + case "max": + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int64(r.DecodeInt(64)) + } + default: + z.DecStructFieldNotFound(-1, yys1539) + } // end switch yys1539 + } // end for yyj1539 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *IDRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1542 int + var yyb1542 bool + var yyhl1542 bool = l >= 0 + yyj1542++ + if yyhl1542 { + yyb1542 = yyj1542 > l + } else { + yyb1542 = r.CheckBreak() + } + if yyb1542 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int64(r.DecodeInt(64)) + } + yyj1542++ + if yyhl1542 { + yyb1542 = yyj1542 > l + } else { + yyb1542 = r.CheckBreak() + } + if yyb1542 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int64(r.DecodeInt(64)) + } + for { + yyj1542++ + if yyhl1542 { + yyb1542 = yyj1542 > l + } else { + yyb1542 = r.CheckBreak() + } + if yyb1542 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1542-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x RunAsUserStrategy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1545 := z.EncBinary() + _ = yym1545 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *RunAsUserStrategy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1546 := z.DecBinary() + _ = yym1546 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *PodSecurityPolicyList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1547 := z.EncBinary() + _ = yym1547 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1548 := !z.EncBinary() + yy2arr1548 := z.EncBasicHandle().StructToArray + var yyq1548 [4]bool + _, _, _ = yysep1548, yyq1548, yy2arr1548 + const yyr1548 bool = false + yyq1548[0] = true + yyq1548[2] = x.Kind != "" + yyq1548[3] = x.APIVersion != "" + var yynn1548 int + if yyr1548 || yy2arr1548 { + r.EncodeArrayStart(4) + } else { + yynn1548 = 1 + for _, b := range yyq1548 { + if b { + yynn1548++ + } + } + r.EncodeMapStart(yynn1548) + yynn1548 = 0 + } + if yyr1548 || yy2arr1548 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1548[0] { + yy1550 := &x.ListMeta + yym1551 := z.EncBinary() + _ = yym1551 + if false { + } else if z.HasExtensions() && z.EncExt(yy1550) { + } else { + z.EncFallback(yy1550) + } + } else { + r.EncodeNil() + } + } else { + if yyq1548[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1552 := &x.ListMeta + yym1553 := z.EncBinary() + _ = yym1553 + if false { + } else if z.HasExtensions() && z.EncExt(yy1552) { + } else { + z.EncFallback(yy1552) + } + } + } + if yyr1548 || yy2arr1548 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1555 := z.EncBinary() + _ = yym1555 + if false { + } else { + h.encSlicePodSecurityPolicy(([]PodSecurityPolicy)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1556 := z.EncBinary() + _ = yym1556 + if false { + } else { + h.encSlicePodSecurityPolicy(([]PodSecurityPolicy)(x.Items), e) + } + } + } + if yyr1548 || yy2arr1548 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1548[2] { + yym1558 := z.EncBinary() + _ = yym1558 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1548[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1559 := z.EncBinary() + _ = yym1559 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1548 || yy2arr1548 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1548[3] { + yym1561 := z.EncBinary() + _ = yym1561 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1548[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1562 := z.EncBinary() + _ = yym1562 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1548 || yy2arr1548 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicyList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1563 := z.DecBinary() + _ = yym1563 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1564 := r.ContainerType() + if yyct1564 == codecSelferValueTypeMap1234 { + yyl1564 := r.ReadMapStart() + if yyl1564 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1564, d) + } + } else if yyct1564 == codecSelferValueTypeArray1234 { + yyl1564 := r.ReadArrayStart() + if yyl1564 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1564, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicyList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1565Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1565Slc + var yyhl1565 bool = l >= 0 + for yyj1565 := 0; ; yyj1565++ { + if yyhl1565 { + if yyj1565 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1565Slc = r.DecodeBytes(yys1565Slc, true, true) + yys1565 := string(yys1565Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1565 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1566 := &x.ListMeta + yym1567 := z.DecBinary() + _ = yym1567 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1566) { + } else { + z.DecFallback(yyv1566, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1568 := &x.Items + yym1569 := z.DecBinary() + _ = yym1569 + if false { + } else { + h.decSlicePodSecurityPolicy((*[]PodSecurityPolicy)(yyv1568), 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, yys1565) + } // end switch yys1565 + } // end for yyj1565 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicyList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1572 int + var yyb1572 bool + var yyhl1572 bool = l >= 0 + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1573 := &x.ListMeta + yym1574 := z.DecBinary() + _ = yym1574 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1573) { + } else { + z.DecFallback(yyv1573, false) + } + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1575 := &x.Items + yym1576 := z.DecBinary() + _ = yym1576 + if false { + } else { + h.decSlicePodSecurityPolicy((*[]PodSecurityPolicy)(yyv1575), d) + } + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1572-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16881,10 +18836,10 @@ func (x codecSelfer1234) encSliceCustomMetricTarget(v []CustomMetricTarget, e *c z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1409 := range v { + for _, yyv1579 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1410 := &yyv1409 - yy1410.CodecEncodeSelf(e) + yy1580 := &yyv1579 + yy1580.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16894,83 +18849,83 @@ func (x codecSelfer1234) decSliceCustomMetricTarget(v *[]CustomMetricTarget, d * z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1411 := *v - yyh1411, yyl1411 := z.DecSliceHelperStart() - var yyc1411 bool - if yyl1411 == 0 { - if yyv1411 == nil { - yyv1411 = []CustomMetricTarget{} - yyc1411 = true - } else if len(yyv1411) != 0 { - yyv1411 = yyv1411[:0] - yyc1411 = true + yyv1581 := *v + yyh1581, yyl1581 := z.DecSliceHelperStart() + var yyc1581 bool + if yyl1581 == 0 { + if yyv1581 == nil { + yyv1581 = []CustomMetricTarget{} + yyc1581 = true + } else if len(yyv1581) != 0 { + yyv1581 = yyv1581[:0] + yyc1581 = true } - } else if yyl1411 > 0 { - var yyrr1411, yyrl1411 int - var yyrt1411 bool - if yyl1411 > cap(yyv1411) { + } else if yyl1581 > 0 { + var yyrr1581, yyrl1581 int + var yyrt1581 bool + if yyl1581 > cap(yyv1581) { - yyrg1411 := len(yyv1411) > 0 - yyv21411 := yyv1411 - yyrl1411, yyrt1411 = z.DecInferLen(yyl1411, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1411 { - if yyrl1411 <= cap(yyv1411) { - yyv1411 = yyv1411[:yyrl1411] + yyrg1581 := len(yyv1581) > 0 + yyv21581 := yyv1581 + yyrl1581, yyrt1581 = z.DecInferLen(yyl1581, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1581 { + if yyrl1581 <= cap(yyv1581) { + yyv1581 = yyv1581[:yyrl1581] } else { - yyv1411 = make([]CustomMetricTarget, yyrl1411) + yyv1581 = make([]CustomMetricTarget, yyrl1581) } } else { - yyv1411 = make([]CustomMetricTarget, yyrl1411) + yyv1581 = make([]CustomMetricTarget, yyrl1581) } - yyc1411 = true - yyrr1411 = len(yyv1411) - if yyrg1411 { - copy(yyv1411, yyv21411) + yyc1581 = true + yyrr1581 = len(yyv1581) + if yyrg1581 { + copy(yyv1581, yyv21581) } - } else if yyl1411 != len(yyv1411) { - yyv1411 = yyv1411[:yyl1411] - yyc1411 = true + } else if yyl1581 != len(yyv1581) { + yyv1581 = yyv1581[:yyl1581] + yyc1581 = true } - yyj1411 := 0 - for ; yyj1411 < yyrr1411; yyj1411++ { - yyh1411.ElemContainerState(yyj1411) + yyj1581 := 0 + for ; yyj1581 < yyrr1581; yyj1581++ { + yyh1581.ElemContainerState(yyj1581) if r.TryDecodeAsNil() { - yyv1411[yyj1411] = CustomMetricTarget{} + yyv1581[yyj1581] = CustomMetricTarget{} } else { - yyv1412 := &yyv1411[yyj1411] - yyv1412.CodecDecodeSelf(d) + yyv1582 := &yyv1581[yyj1581] + yyv1582.CodecDecodeSelf(d) } } - if yyrt1411 { - for ; yyj1411 < yyl1411; yyj1411++ { - yyv1411 = append(yyv1411, CustomMetricTarget{}) - yyh1411.ElemContainerState(yyj1411) + if yyrt1581 { + for ; yyj1581 < yyl1581; yyj1581++ { + yyv1581 = append(yyv1581, CustomMetricTarget{}) + yyh1581.ElemContainerState(yyj1581) if r.TryDecodeAsNil() { - yyv1411[yyj1411] = CustomMetricTarget{} + yyv1581[yyj1581] = CustomMetricTarget{} } else { - yyv1413 := &yyv1411[yyj1411] - yyv1413.CodecDecodeSelf(d) + yyv1583 := &yyv1581[yyj1581] + yyv1583.CodecDecodeSelf(d) } } } } else { - yyj1411 := 0 - for ; !r.CheckBreak(); yyj1411++ { + yyj1581 := 0 + for ; !r.CheckBreak(); yyj1581++ { - if yyj1411 >= len(yyv1411) { - yyv1411 = append(yyv1411, CustomMetricTarget{}) // var yyz1411 CustomMetricTarget - yyc1411 = true + if yyj1581 >= len(yyv1581) { + yyv1581 = append(yyv1581, CustomMetricTarget{}) // var yyz1581 CustomMetricTarget + yyc1581 = true } - yyh1411.ElemContainerState(yyj1411) - if yyj1411 < len(yyv1411) { + yyh1581.ElemContainerState(yyj1581) + if yyj1581 < len(yyv1581) { if r.TryDecodeAsNil() { - yyv1411[yyj1411] = CustomMetricTarget{} + yyv1581[yyj1581] = CustomMetricTarget{} } else { - yyv1414 := &yyv1411[yyj1411] - yyv1414.CodecDecodeSelf(d) + yyv1584 := &yyv1581[yyj1581] + yyv1584.CodecDecodeSelf(d) } } else { @@ -16978,17 +18933,17 @@ func (x codecSelfer1234) decSliceCustomMetricTarget(v *[]CustomMetricTarget, d * } } - if yyj1411 < len(yyv1411) { - yyv1411 = yyv1411[:yyj1411] - yyc1411 = true - } else if yyj1411 == 0 && yyv1411 == nil { - yyv1411 = []CustomMetricTarget{} - yyc1411 = true + if yyj1581 < len(yyv1581) { + yyv1581 = yyv1581[:yyj1581] + yyc1581 = true + } else if yyj1581 == 0 && yyv1581 == nil { + yyv1581 = []CustomMetricTarget{} + yyc1581 = true } } - yyh1411.End() - if yyc1411 { - *v = yyv1411 + yyh1581.End() + if yyc1581 { + *v = yyv1581 } } @@ -16997,10 +18952,10 @@ func (x codecSelfer1234) encSliceCustomMetricCurrentStatus(v []CustomMetricCurre z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1415 := range v { + for _, yyv1585 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1416 := &yyv1415 - yy1416.CodecEncodeSelf(e) + yy1586 := &yyv1585 + yy1586.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17010,83 +18965,83 @@ func (x codecSelfer1234) decSliceCustomMetricCurrentStatus(v *[]CustomMetricCurr z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1417 := *v - yyh1417, yyl1417 := z.DecSliceHelperStart() - var yyc1417 bool - if yyl1417 == 0 { - if yyv1417 == nil { - yyv1417 = []CustomMetricCurrentStatus{} - yyc1417 = true - } else if len(yyv1417) != 0 { - yyv1417 = yyv1417[:0] - yyc1417 = true + yyv1587 := *v + yyh1587, yyl1587 := z.DecSliceHelperStart() + var yyc1587 bool + if yyl1587 == 0 { + if yyv1587 == nil { + yyv1587 = []CustomMetricCurrentStatus{} + yyc1587 = true + } else if len(yyv1587) != 0 { + yyv1587 = yyv1587[:0] + yyc1587 = true } - } else if yyl1417 > 0 { - var yyrr1417, yyrl1417 int - var yyrt1417 bool - if yyl1417 > cap(yyv1417) { + } else if yyl1587 > 0 { + var yyrr1587, yyrl1587 int + var yyrt1587 bool + if yyl1587 > cap(yyv1587) { - yyrg1417 := len(yyv1417) > 0 - yyv21417 := yyv1417 - yyrl1417, yyrt1417 = z.DecInferLen(yyl1417, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1417 { - if yyrl1417 <= cap(yyv1417) { - yyv1417 = yyv1417[:yyrl1417] + yyrg1587 := len(yyv1587) > 0 + yyv21587 := yyv1587 + yyrl1587, yyrt1587 = z.DecInferLen(yyl1587, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1587 { + if yyrl1587 <= cap(yyv1587) { + yyv1587 = yyv1587[:yyrl1587] } else { - yyv1417 = make([]CustomMetricCurrentStatus, yyrl1417) + yyv1587 = make([]CustomMetricCurrentStatus, yyrl1587) } } else { - yyv1417 = make([]CustomMetricCurrentStatus, yyrl1417) + yyv1587 = make([]CustomMetricCurrentStatus, yyrl1587) } - yyc1417 = true - yyrr1417 = len(yyv1417) - if yyrg1417 { - copy(yyv1417, yyv21417) + yyc1587 = true + yyrr1587 = len(yyv1587) + if yyrg1587 { + copy(yyv1587, yyv21587) } - } else if yyl1417 != len(yyv1417) { - yyv1417 = yyv1417[:yyl1417] - yyc1417 = true + } else if yyl1587 != len(yyv1587) { + yyv1587 = yyv1587[:yyl1587] + yyc1587 = true } - yyj1417 := 0 - for ; yyj1417 < yyrr1417; yyj1417++ { - yyh1417.ElemContainerState(yyj1417) + yyj1587 := 0 + for ; yyj1587 < yyrr1587; yyj1587++ { + yyh1587.ElemContainerState(yyj1587) if r.TryDecodeAsNil() { - yyv1417[yyj1417] = CustomMetricCurrentStatus{} + yyv1587[yyj1587] = CustomMetricCurrentStatus{} } else { - yyv1418 := &yyv1417[yyj1417] - yyv1418.CodecDecodeSelf(d) + yyv1588 := &yyv1587[yyj1587] + yyv1588.CodecDecodeSelf(d) } } - if yyrt1417 { - for ; yyj1417 < yyl1417; yyj1417++ { - yyv1417 = append(yyv1417, CustomMetricCurrentStatus{}) - yyh1417.ElemContainerState(yyj1417) + if yyrt1587 { + for ; yyj1587 < yyl1587; yyj1587++ { + yyv1587 = append(yyv1587, CustomMetricCurrentStatus{}) + yyh1587.ElemContainerState(yyj1587) if r.TryDecodeAsNil() { - yyv1417[yyj1417] = CustomMetricCurrentStatus{} + yyv1587[yyj1587] = CustomMetricCurrentStatus{} } else { - yyv1419 := &yyv1417[yyj1417] - yyv1419.CodecDecodeSelf(d) + yyv1589 := &yyv1587[yyj1587] + yyv1589.CodecDecodeSelf(d) } } } } else { - yyj1417 := 0 - for ; !r.CheckBreak(); yyj1417++ { + yyj1587 := 0 + for ; !r.CheckBreak(); yyj1587++ { - if yyj1417 >= len(yyv1417) { - yyv1417 = append(yyv1417, CustomMetricCurrentStatus{}) // var yyz1417 CustomMetricCurrentStatus - yyc1417 = true + if yyj1587 >= len(yyv1587) { + yyv1587 = append(yyv1587, CustomMetricCurrentStatus{}) // var yyz1587 CustomMetricCurrentStatus + yyc1587 = true } - yyh1417.ElemContainerState(yyj1417) - if yyj1417 < len(yyv1417) { + yyh1587.ElemContainerState(yyj1587) + if yyj1587 < len(yyv1587) { if r.TryDecodeAsNil() { - yyv1417[yyj1417] = CustomMetricCurrentStatus{} + yyv1587[yyj1587] = CustomMetricCurrentStatus{} } else { - yyv1420 := &yyv1417[yyj1417] - yyv1420.CodecDecodeSelf(d) + yyv1590 := &yyv1587[yyj1587] + yyv1590.CodecDecodeSelf(d) } } else { @@ -17094,17 +19049,17 @@ func (x codecSelfer1234) decSliceCustomMetricCurrentStatus(v *[]CustomMetricCurr } } - if yyj1417 < len(yyv1417) { - yyv1417 = yyv1417[:yyj1417] - yyc1417 = true - } else if yyj1417 == 0 && yyv1417 == nil { - yyv1417 = []CustomMetricCurrentStatus{} - yyc1417 = true + if yyj1587 < len(yyv1587) { + yyv1587 = yyv1587[:yyj1587] + yyc1587 = true + } else if yyj1587 == 0 && yyv1587 == nil { + yyv1587 = []CustomMetricCurrentStatus{} + yyc1587 = true } } - yyh1417.End() - if yyc1417 { - *v = yyv1417 + yyh1587.End() + if yyc1587 { + *v = yyv1587 } } @@ -17113,10 +19068,10 @@ func (x codecSelfer1234) encSliceHorizontalPodAutoscaler(v []HorizontalPodAutosc z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1421 := range v { + for _, yyv1591 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1422 := &yyv1421 - yy1422.CodecEncodeSelf(e) + yy1592 := &yyv1591 + yy1592.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17126,83 +19081,83 @@ func (x codecSelfer1234) decSliceHorizontalPodAutoscaler(v *[]HorizontalPodAutos z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1423 := *v - yyh1423, yyl1423 := z.DecSliceHelperStart() - var yyc1423 bool - if yyl1423 == 0 { - if yyv1423 == nil { - yyv1423 = []HorizontalPodAutoscaler{} - yyc1423 = true - } else if len(yyv1423) != 0 { - yyv1423 = yyv1423[:0] - yyc1423 = true + yyv1593 := *v + yyh1593, yyl1593 := z.DecSliceHelperStart() + var yyc1593 bool + if yyl1593 == 0 { + if yyv1593 == nil { + yyv1593 = []HorizontalPodAutoscaler{} + yyc1593 = true + } else if len(yyv1593) != 0 { + yyv1593 = yyv1593[:0] + yyc1593 = true } - } else if yyl1423 > 0 { - var yyrr1423, yyrl1423 int - var yyrt1423 bool - if yyl1423 > cap(yyv1423) { + } else if yyl1593 > 0 { + var yyrr1593, yyrl1593 int + var yyrt1593 bool + if yyl1593 > cap(yyv1593) { - yyrg1423 := len(yyv1423) > 0 - yyv21423 := yyv1423 - yyrl1423, yyrt1423 = z.DecInferLen(yyl1423, z.DecBasicHandle().MaxInitLen, 320) - if yyrt1423 { - if yyrl1423 <= cap(yyv1423) { - yyv1423 = yyv1423[:yyrl1423] + yyrg1593 := len(yyv1593) > 0 + yyv21593 := yyv1593 + yyrl1593, yyrt1593 = z.DecInferLen(yyl1593, z.DecBasicHandle().MaxInitLen, 320) + if yyrt1593 { + if yyrl1593 <= cap(yyv1593) { + yyv1593 = yyv1593[:yyrl1593] } else { - yyv1423 = make([]HorizontalPodAutoscaler, yyrl1423) + yyv1593 = make([]HorizontalPodAutoscaler, yyrl1593) } } else { - yyv1423 = make([]HorizontalPodAutoscaler, yyrl1423) + yyv1593 = make([]HorizontalPodAutoscaler, yyrl1593) } - yyc1423 = true - yyrr1423 = len(yyv1423) - if yyrg1423 { - copy(yyv1423, yyv21423) + yyc1593 = true + yyrr1593 = len(yyv1593) + if yyrg1593 { + copy(yyv1593, yyv21593) } - } else if yyl1423 != len(yyv1423) { - yyv1423 = yyv1423[:yyl1423] - yyc1423 = true + } else if yyl1593 != len(yyv1593) { + yyv1593 = yyv1593[:yyl1593] + yyc1593 = true } - yyj1423 := 0 - for ; yyj1423 < yyrr1423; yyj1423++ { - yyh1423.ElemContainerState(yyj1423) + yyj1593 := 0 + for ; yyj1593 < yyrr1593; yyj1593++ { + yyh1593.ElemContainerState(yyj1593) if r.TryDecodeAsNil() { - yyv1423[yyj1423] = HorizontalPodAutoscaler{} + yyv1593[yyj1593] = HorizontalPodAutoscaler{} } else { - yyv1424 := &yyv1423[yyj1423] - yyv1424.CodecDecodeSelf(d) + yyv1594 := &yyv1593[yyj1593] + yyv1594.CodecDecodeSelf(d) } } - if yyrt1423 { - for ; yyj1423 < yyl1423; yyj1423++ { - yyv1423 = append(yyv1423, HorizontalPodAutoscaler{}) - yyh1423.ElemContainerState(yyj1423) + if yyrt1593 { + for ; yyj1593 < yyl1593; yyj1593++ { + yyv1593 = append(yyv1593, HorizontalPodAutoscaler{}) + yyh1593.ElemContainerState(yyj1593) if r.TryDecodeAsNil() { - yyv1423[yyj1423] = HorizontalPodAutoscaler{} + yyv1593[yyj1593] = HorizontalPodAutoscaler{} } else { - yyv1425 := &yyv1423[yyj1423] - yyv1425.CodecDecodeSelf(d) + yyv1595 := &yyv1593[yyj1593] + yyv1595.CodecDecodeSelf(d) } } } } else { - yyj1423 := 0 - for ; !r.CheckBreak(); yyj1423++ { + yyj1593 := 0 + for ; !r.CheckBreak(); yyj1593++ { - if yyj1423 >= len(yyv1423) { - yyv1423 = append(yyv1423, HorizontalPodAutoscaler{}) // var yyz1423 HorizontalPodAutoscaler - yyc1423 = true + if yyj1593 >= len(yyv1593) { + yyv1593 = append(yyv1593, HorizontalPodAutoscaler{}) // var yyz1593 HorizontalPodAutoscaler + yyc1593 = true } - yyh1423.ElemContainerState(yyj1423) - if yyj1423 < len(yyv1423) { + yyh1593.ElemContainerState(yyj1593) + if yyj1593 < len(yyv1593) { if r.TryDecodeAsNil() { - yyv1423[yyj1423] = HorizontalPodAutoscaler{} + yyv1593[yyj1593] = HorizontalPodAutoscaler{} } else { - yyv1426 := &yyv1423[yyj1423] - yyv1426.CodecDecodeSelf(d) + yyv1596 := &yyv1593[yyj1593] + yyv1596.CodecDecodeSelf(d) } } else { @@ -17210,17 +19165,17 @@ func (x codecSelfer1234) decSliceHorizontalPodAutoscaler(v *[]HorizontalPodAutos } } - if yyj1423 < len(yyv1423) { - yyv1423 = yyv1423[:yyj1423] - yyc1423 = true - } else if yyj1423 == 0 && yyv1423 == nil { - yyv1423 = []HorizontalPodAutoscaler{} - yyc1423 = true + if yyj1593 < len(yyv1593) { + yyv1593 = yyv1593[:yyj1593] + yyc1593 = true + } else if yyj1593 == 0 && yyv1593 == nil { + yyv1593 = []HorizontalPodAutoscaler{} + yyc1593 = true } } - yyh1423.End() - if yyc1423 { - *v = yyv1423 + yyh1593.End() + if yyc1593 { + *v = yyv1593 } } @@ -17229,10 +19184,10 @@ func (x codecSelfer1234) encSliceAPIVersion(v []APIVersion, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1427 := range v { + for _, yyv1597 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1428 := &yyv1427 - yy1428.CodecEncodeSelf(e) + yy1598 := &yyv1597 + yy1598.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17242,83 +19197,83 @@ func (x codecSelfer1234) decSliceAPIVersion(v *[]APIVersion, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1429 := *v - yyh1429, yyl1429 := z.DecSliceHelperStart() - var yyc1429 bool - if yyl1429 == 0 { - if yyv1429 == nil { - yyv1429 = []APIVersion{} - yyc1429 = true - } else if len(yyv1429) != 0 { - yyv1429 = yyv1429[:0] - yyc1429 = true + yyv1599 := *v + yyh1599, yyl1599 := z.DecSliceHelperStart() + var yyc1599 bool + if yyl1599 == 0 { + if yyv1599 == nil { + yyv1599 = []APIVersion{} + yyc1599 = true + } else if len(yyv1599) != 0 { + yyv1599 = yyv1599[:0] + yyc1599 = true } - } else if yyl1429 > 0 { - var yyrr1429, yyrl1429 int - var yyrt1429 bool - if yyl1429 > cap(yyv1429) { + } else if yyl1599 > 0 { + var yyrr1599, yyrl1599 int + var yyrt1599 bool + if yyl1599 > cap(yyv1599) { - yyrg1429 := len(yyv1429) > 0 - yyv21429 := yyv1429 - yyrl1429, yyrt1429 = z.DecInferLen(yyl1429, z.DecBasicHandle().MaxInitLen, 32) - if yyrt1429 { - if yyrl1429 <= cap(yyv1429) { - yyv1429 = yyv1429[:yyrl1429] + yyrg1599 := len(yyv1599) > 0 + yyv21599 := yyv1599 + yyrl1599, yyrt1599 = z.DecInferLen(yyl1599, z.DecBasicHandle().MaxInitLen, 32) + if yyrt1599 { + if yyrl1599 <= cap(yyv1599) { + yyv1599 = yyv1599[:yyrl1599] } else { - yyv1429 = make([]APIVersion, yyrl1429) + yyv1599 = make([]APIVersion, yyrl1599) } } else { - yyv1429 = make([]APIVersion, yyrl1429) + yyv1599 = make([]APIVersion, yyrl1599) } - yyc1429 = true - yyrr1429 = len(yyv1429) - if yyrg1429 { - copy(yyv1429, yyv21429) + yyc1599 = true + yyrr1599 = len(yyv1599) + if yyrg1599 { + copy(yyv1599, yyv21599) } - } else if yyl1429 != len(yyv1429) { - yyv1429 = yyv1429[:yyl1429] - yyc1429 = true + } else if yyl1599 != len(yyv1599) { + yyv1599 = yyv1599[:yyl1599] + yyc1599 = true } - yyj1429 := 0 - for ; yyj1429 < yyrr1429; yyj1429++ { - yyh1429.ElemContainerState(yyj1429) + yyj1599 := 0 + for ; yyj1599 < yyrr1599; yyj1599++ { + yyh1599.ElemContainerState(yyj1599) if r.TryDecodeAsNil() { - yyv1429[yyj1429] = APIVersion{} + yyv1599[yyj1599] = APIVersion{} } else { - yyv1430 := &yyv1429[yyj1429] - yyv1430.CodecDecodeSelf(d) + yyv1600 := &yyv1599[yyj1599] + yyv1600.CodecDecodeSelf(d) } } - if yyrt1429 { - for ; yyj1429 < yyl1429; yyj1429++ { - yyv1429 = append(yyv1429, APIVersion{}) - yyh1429.ElemContainerState(yyj1429) + if yyrt1599 { + for ; yyj1599 < yyl1599; yyj1599++ { + yyv1599 = append(yyv1599, APIVersion{}) + yyh1599.ElemContainerState(yyj1599) if r.TryDecodeAsNil() { - yyv1429[yyj1429] = APIVersion{} + yyv1599[yyj1599] = APIVersion{} } else { - yyv1431 := &yyv1429[yyj1429] - yyv1431.CodecDecodeSelf(d) + yyv1601 := &yyv1599[yyj1599] + yyv1601.CodecDecodeSelf(d) } } } } else { - yyj1429 := 0 - for ; !r.CheckBreak(); yyj1429++ { + yyj1599 := 0 + for ; !r.CheckBreak(); yyj1599++ { - if yyj1429 >= len(yyv1429) { - yyv1429 = append(yyv1429, APIVersion{}) // var yyz1429 APIVersion - yyc1429 = true + if yyj1599 >= len(yyv1599) { + yyv1599 = append(yyv1599, APIVersion{}) // var yyz1599 APIVersion + yyc1599 = true } - yyh1429.ElemContainerState(yyj1429) - if yyj1429 < len(yyv1429) { + yyh1599.ElemContainerState(yyj1599) + if yyj1599 < len(yyv1599) { if r.TryDecodeAsNil() { - yyv1429[yyj1429] = APIVersion{} + yyv1599[yyj1599] = APIVersion{} } else { - yyv1432 := &yyv1429[yyj1429] - yyv1432.CodecDecodeSelf(d) + yyv1602 := &yyv1599[yyj1599] + yyv1602.CodecDecodeSelf(d) } } else { @@ -17326,17 +19281,17 @@ func (x codecSelfer1234) decSliceAPIVersion(v *[]APIVersion, d *codec1978.Decode } } - if yyj1429 < len(yyv1429) { - yyv1429 = yyv1429[:yyj1429] - yyc1429 = true - } else if yyj1429 == 0 && yyv1429 == nil { - yyv1429 = []APIVersion{} - yyc1429 = true + if yyj1599 < len(yyv1599) { + yyv1599 = yyv1599[:yyj1599] + yyc1599 = true + } else if yyj1599 == 0 && yyv1599 == nil { + yyv1599 = []APIVersion{} + yyc1599 = true } } - yyh1429.End() - if yyc1429 { - *v = yyv1429 + yyh1599.End() + if yyc1599 { + *v = yyv1599 } } @@ -17345,10 +19300,10 @@ func (x codecSelfer1234) encSliceThirdPartyResource(v []ThirdPartyResource, e *c z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1433 := range v { + for _, yyv1603 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1434 := &yyv1433 - yy1434.CodecEncodeSelf(e) + yy1604 := &yyv1603 + yy1604.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17358,83 +19313,83 @@ func (x codecSelfer1234) decSliceThirdPartyResource(v *[]ThirdPartyResource, d * z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1435 := *v - yyh1435, yyl1435 := z.DecSliceHelperStart() - var yyc1435 bool - if yyl1435 == 0 { - if yyv1435 == nil { - yyv1435 = []ThirdPartyResource{} - yyc1435 = true - } else if len(yyv1435) != 0 { - yyv1435 = yyv1435[:0] - yyc1435 = true + yyv1605 := *v + yyh1605, yyl1605 := z.DecSliceHelperStart() + var yyc1605 bool + if yyl1605 == 0 { + if yyv1605 == nil { + yyv1605 = []ThirdPartyResource{} + yyc1605 = true + } else if len(yyv1605) != 0 { + yyv1605 = yyv1605[:0] + yyc1605 = true } - } else if yyl1435 > 0 { - var yyrr1435, yyrl1435 int - var yyrt1435 bool - if yyl1435 > cap(yyv1435) { + } else if yyl1605 > 0 { + var yyrr1605, yyrl1605 int + var yyrt1605 bool + if yyl1605 > cap(yyv1605) { - yyrg1435 := len(yyv1435) > 0 - yyv21435 := yyv1435 - yyrl1435, yyrt1435 = z.DecInferLen(yyl1435, z.DecBasicHandle().MaxInitLen, 232) - if yyrt1435 { - if yyrl1435 <= cap(yyv1435) { - yyv1435 = yyv1435[:yyrl1435] + yyrg1605 := len(yyv1605) > 0 + yyv21605 := yyv1605 + yyrl1605, yyrt1605 = z.DecInferLen(yyl1605, z.DecBasicHandle().MaxInitLen, 232) + if yyrt1605 { + if yyrl1605 <= cap(yyv1605) { + yyv1605 = yyv1605[:yyrl1605] } else { - yyv1435 = make([]ThirdPartyResource, yyrl1435) + yyv1605 = make([]ThirdPartyResource, yyrl1605) } } else { - yyv1435 = make([]ThirdPartyResource, yyrl1435) + yyv1605 = make([]ThirdPartyResource, yyrl1605) } - yyc1435 = true - yyrr1435 = len(yyv1435) - if yyrg1435 { - copy(yyv1435, yyv21435) + yyc1605 = true + yyrr1605 = len(yyv1605) + if yyrg1605 { + copy(yyv1605, yyv21605) } - } else if yyl1435 != len(yyv1435) { - yyv1435 = yyv1435[:yyl1435] - yyc1435 = true + } else if yyl1605 != len(yyv1605) { + yyv1605 = yyv1605[:yyl1605] + yyc1605 = true } - yyj1435 := 0 - for ; yyj1435 < yyrr1435; yyj1435++ { - yyh1435.ElemContainerState(yyj1435) + yyj1605 := 0 + for ; yyj1605 < yyrr1605; yyj1605++ { + yyh1605.ElemContainerState(yyj1605) if r.TryDecodeAsNil() { - yyv1435[yyj1435] = ThirdPartyResource{} + yyv1605[yyj1605] = ThirdPartyResource{} } else { - yyv1436 := &yyv1435[yyj1435] - yyv1436.CodecDecodeSelf(d) + yyv1606 := &yyv1605[yyj1605] + yyv1606.CodecDecodeSelf(d) } } - if yyrt1435 { - for ; yyj1435 < yyl1435; yyj1435++ { - yyv1435 = append(yyv1435, ThirdPartyResource{}) - yyh1435.ElemContainerState(yyj1435) + if yyrt1605 { + for ; yyj1605 < yyl1605; yyj1605++ { + yyv1605 = append(yyv1605, ThirdPartyResource{}) + yyh1605.ElemContainerState(yyj1605) if r.TryDecodeAsNil() { - yyv1435[yyj1435] = ThirdPartyResource{} + yyv1605[yyj1605] = ThirdPartyResource{} } else { - yyv1437 := &yyv1435[yyj1435] - yyv1437.CodecDecodeSelf(d) + yyv1607 := &yyv1605[yyj1605] + yyv1607.CodecDecodeSelf(d) } } } } else { - yyj1435 := 0 - for ; !r.CheckBreak(); yyj1435++ { + yyj1605 := 0 + for ; !r.CheckBreak(); yyj1605++ { - if yyj1435 >= len(yyv1435) { - yyv1435 = append(yyv1435, ThirdPartyResource{}) // var yyz1435 ThirdPartyResource - yyc1435 = true + if yyj1605 >= len(yyv1605) { + yyv1605 = append(yyv1605, ThirdPartyResource{}) // var yyz1605 ThirdPartyResource + yyc1605 = true } - yyh1435.ElemContainerState(yyj1435) - if yyj1435 < len(yyv1435) { + yyh1605.ElemContainerState(yyj1605) + if yyj1605 < len(yyv1605) { if r.TryDecodeAsNil() { - yyv1435[yyj1435] = ThirdPartyResource{} + yyv1605[yyj1605] = ThirdPartyResource{} } else { - yyv1438 := &yyv1435[yyj1435] - yyv1438.CodecDecodeSelf(d) + yyv1608 := &yyv1605[yyj1605] + yyv1608.CodecDecodeSelf(d) } } else { @@ -17442,17 +19397,17 @@ func (x codecSelfer1234) decSliceThirdPartyResource(v *[]ThirdPartyResource, d * } } - if yyj1435 < len(yyv1435) { - yyv1435 = yyv1435[:yyj1435] - yyc1435 = true - } else if yyj1435 == 0 && yyv1435 == nil { - yyv1435 = []ThirdPartyResource{} - yyc1435 = true + if yyj1605 < len(yyv1605) { + yyv1605 = yyv1605[:yyj1605] + yyc1605 = true + } else if yyj1605 == 0 && yyv1605 == nil { + yyv1605 = []ThirdPartyResource{} + yyc1605 = true } } - yyh1435.End() - if yyc1435 { - *v = yyv1435 + yyh1605.End() + if yyc1605 { + *v = yyv1605 } } @@ -17461,10 +19416,10 @@ func (x codecSelfer1234) encSliceDeployment(v []Deployment, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1439 := range v { + for _, yyv1609 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1440 := &yyv1439 - yy1440.CodecEncodeSelf(e) + yy1610 := &yyv1609 + yy1610.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17474,83 +19429,83 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1441 := *v - yyh1441, yyl1441 := z.DecSliceHelperStart() - var yyc1441 bool - if yyl1441 == 0 { - if yyv1441 == nil { - yyv1441 = []Deployment{} - yyc1441 = true - } else if len(yyv1441) != 0 { - yyv1441 = yyv1441[:0] - yyc1441 = true + yyv1611 := *v + yyh1611, yyl1611 := z.DecSliceHelperStart() + var yyc1611 bool + if yyl1611 == 0 { + if yyv1611 == nil { + yyv1611 = []Deployment{} + yyc1611 = true + } else if len(yyv1611) != 0 { + yyv1611 = yyv1611[:0] + yyc1611 = true } - } else if yyl1441 > 0 { - var yyrr1441, yyrl1441 int - var yyrt1441 bool - if yyl1441 > cap(yyv1441) { + } else if yyl1611 > 0 { + var yyrr1611, yyrl1611 int + var yyrt1611 bool + if yyl1611 > cap(yyv1611) { - yyrg1441 := len(yyv1441) > 0 - yyv21441 := yyv1441 - yyrl1441, yyrt1441 = z.DecInferLen(yyl1441, z.DecBasicHandle().MaxInitLen, 632) - if yyrt1441 { - if yyrl1441 <= cap(yyv1441) { - yyv1441 = yyv1441[:yyrl1441] + yyrg1611 := len(yyv1611) > 0 + yyv21611 := yyv1611 + yyrl1611, yyrt1611 = z.DecInferLen(yyl1611, z.DecBasicHandle().MaxInitLen, 624) + if yyrt1611 { + if yyrl1611 <= cap(yyv1611) { + yyv1611 = yyv1611[:yyrl1611] } else { - yyv1441 = make([]Deployment, yyrl1441) + yyv1611 = make([]Deployment, yyrl1611) } } else { - yyv1441 = make([]Deployment, yyrl1441) + yyv1611 = make([]Deployment, yyrl1611) } - yyc1441 = true - yyrr1441 = len(yyv1441) - if yyrg1441 { - copy(yyv1441, yyv21441) + yyc1611 = true + yyrr1611 = len(yyv1611) + if yyrg1611 { + copy(yyv1611, yyv21611) } - } else if yyl1441 != len(yyv1441) { - yyv1441 = yyv1441[:yyl1441] - yyc1441 = true + } else if yyl1611 != len(yyv1611) { + yyv1611 = yyv1611[:yyl1611] + yyc1611 = true } - yyj1441 := 0 - for ; yyj1441 < yyrr1441; yyj1441++ { - yyh1441.ElemContainerState(yyj1441) + yyj1611 := 0 + for ; yyj1611 < yyrr1611; yyj1611++ { + yyh1611.ElemContainerState(yyj1611) if r.TryDecodeAsNil() { - yyv1441[yyj1441] = Deployment{} + yyv1611[yyj1611] = Deployment{} } else { - yyv1442 := &yyv1441[yyj1441] - yyv1442.CodecDecodeSelf(d) + yyv1612 := &yyv1611[yyj1611] + yyv1612.CodecDecodeSelf(d) } } - if yyrt1441 { - for ; yyj1441 < yyl1441; yyj1441++ { - yyv1441 = append(yyv1441, Deployment{}) - yyh1441.ElemContainerState(yyj1441) + if yyrt1611 { + for ; yyj1611 < yyl1611; yyj1611++ { + yyv1611 = append(yyv1611, Deployment{}) + yyh1611.ElemContainerState(yyj1611) if r.TryDecodeAsNil() { - yyv1441[yyj1441] = Deployment{} + yyv1611[yyj1611] = Deployment{} } else { - yyv1443 := &yyv1441[yyj1441] - yyv1443.CodecDecodeSelf(d) + yyv1613 := &yyv1611[yyj1611] + yyv1613.CodecDecodeSelf(d) } } } } else { - yyj1441 := 0 - for ; !r.CheckBreak(); yyj1441++ { + yyj1611 := 0 + for ; !r.CheckBreak(); yyj1611++ { - if yyj1441 >= len(yyv1441) { - yyv1441 = append(yyv1441, Deployment{}) // var yyz1441 Deployment - yyc1441 = true + if yyj1611 >= len(yyv1611) { + yyv1611 = append(yyv1611, Deployment{}) // var yyz1611 Deployment + yyc1611 = true } - yyh1441.ElemContainerState(yyj1441) - if yyj1441 < len(yyv1441) { + yyh1611.ElemContainerState(yyj1611) + if yyj1611 < len(yyv1611) { if r.TryDecodeAsNil() { - yyv1441[yyj1441] = Deployment{} + yyv1611[yyj1611] = Deployment{} } else { - yyv1444 := &yyv1441[yyj1441] - yyv1444.CodecDecodeSelf(d) + yyv1614 := &yyv1611[yyj1611] + yyv1614.CodecDecodeSelf(d) } } else { @@ -17558,17 +19513,17 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode } } - if yyj1441 < len(yyv1441) { - yyv1441 = yyv1441[:yyj1441] - yyc1441 = true - } else if yyj1441 == 0 && yyv1441 == nil { - yyv1441 = []Deployment{} - yyc1441 = true + if yyj1611 < len(yyv1611) { + yyv1611 = yyv1611[:yyj1611] + yyc1611 = true + } else if yyj1611 == 0 && yyv1611 == nil { + yyv1611 = []Deployment{} + yyc1611 = true } } - yyh1441.End() - if yyc1441 { - *v = yyv1441 + yyh1611.End() + if yyc1611 { + *v = yyv1611 } } @@ -17577,10 +19532,10 @@ func (x codecSelfer1234) encSliceDaemonSet(v []DaemonSet, e *codec1978.Encoder) z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1445 := range v { + for _, yyv1615 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1446 := &yyv1445 - yy1446.CodecEncodeSelf(e) + yy1616 := &yyv1615 + yy1616.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17590,83 +19545,83 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder) z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1447 := *v - yyh1447, yyl1447 := z.DecSliceHelperStart() - var yyc1447 bool - if yyl1447 == 0 { - if yyv1447 == nil { - yyv1447 = []DaemonSet{} - yyc1447 = true - } else if len(yyv1447) != 0 { - yyv1447 = yyv1447[:0] - yyc1447 = true + yyv1617 := *v + yyh1617, yyl1617 := z.DecSliceHelperStart() + var yyc1617 bool + if yyl1617 == 0 { + if yyv1617 == nil { + yyv1617 = []DaemonSet{} + yyc1617 = true + } else if len(yyv1617) != 0 { + yyv1617 = yyv1617[:0] + yyc1617 = true } - } else if yyl1447 > 0 { - var yyrr1447, yyrl1447 int - var yyrt1447 bool - if yyl1447 > cap(yyv1447) { + } else if yyl1617 > 0 { + var yyrr1617, yyrl1617 int + var yyrt1617 bool + if yyl1617 > cap(yyv1617) { - yyrg1447 := len(yyv1447) > 0 - yyv21447 := yyv1447 - yyrl1447, yyrt1447 = z.DecInferLen(yyl1447, z.DecBasicHandle().MaxInitLen, 592) - if yyrt1447 { - if yyrl1447 <= cap(yyv1447) { - yyv1447 = yyv1447[:yyrl1447] + yyrg1617 := len(yyv1617) > 0 + yyv21617 := yyv1617 + yyrl1617, yyrt1617 = z.DecInferLen(yyl1617, z.DecBasicHandle().MaxInitLen, 592) + if yyrt1617 { + if yyrl1617 <= cap(yyv1617) { + yyv1617 = yyv1617[:yyrl1617] } else { - yyv1447 = make([]DaemonSet, yyrl1447) + yyv1617 = make([]DaemonSet, yyrl1617) } } else { - yyv1447 = make([]DaemonSet, yyrl1447) + yyv1617 = make([]DaemonSet, yyrl1617) } - yyc1447 = true - yyrr1447 = len(yyv1447) - if yyrg1447 { - copy(yyv1447, yyv21447) + yyc1617 = true + yyrr1617 = len(yyv1617) + if yyrg1617 { + copy(yyv1617, yyv21617) } - } else if yyl1447 != len(yyv1447) { - yyv1447 = yyv1447[:yyl1447] - yyc1447 = true + } else if yyl1617 != len(yyv1617) { + yyv1617 = yyv1617[:yyl1617] + yyc1617 = true } - yyj1447 := 0 - for ; yyj1447 < yyrr1447; yyj1447++ { - yyh1447.ElemContainerState(yyj1447) + yyj1617 := 0 + for ; yyj1617 < yyrr1617; yyj1617++ { + yyh1617.ElemContainerState(yyj1617) if r.TryDecodeAsNil() { - yyv1447[yyj1447] = DaemonSet{} + yyv1617[yyj1617] = DaemonSet{} } else { - yyv1448 := &yyv1447[yyj1447] - yyv1448.CodecDecodeSelf(d) + yyv1618 := &yyv1617[yyj1617] + yyv1618.CodecDecodeSelf(d) } } - if yyrt1447 { - for ; yyj1447 < yyl1447; yyj1447++ { - yyv1447 = append(yyv1447, DaemonSet{}) - yyh1447.ElemContainerState(yyj1447) + if yyrt1617 { + for ; yyj1617 < yyl1617; yyj1617++ { + yyv1617 = append(yyv1617, DaemonSet{}) + yyh1617.ElemContainerState(yyj1617) if r.TryDecodeAsNil() { - yyv1447[yyj1447] = DaemonSet{} + yyv1617[yyj1617] = DaemonSet{} } else { - yyv1449 := &yyv1447[yyj1447] - yyv1449.CodecDecodeSelf(d) + yyv1619 := &yyv1617[yyj1617] + yyv1619.CodecDecodeSelf(d) } } } } else { - yyj1447 := 0 - for ; !r.CheckBreak(); yyj1447++ { + yyj1617 := 0 + for ; !r.CheckBreak(); yyj1617++ { - if yyj1447 >= len(yyv1447) { - yyv1447 = append(yyv1447, DaemonSet{}) // var yyz1447 DaemonSet - yyc1447 = true + if yyj1617 >= len(yyv1617) { + yyv1617 = append(yyv1617, DaemonSet{}) // var yyz1617 DaemonSet + yyc1617 = true } - yyh1447.ElemContainerState(yyj1447) - if yyj1447 < len(yyv1447) { + yyh1617.ElemContainerState(yyj1617) + if yyj1617 < len(yyv1617) { if r.TryDecodeAsNil() { - yyv1447[yyj1447] = DaemonSet{} + yyv1617[yyj1617] = DaemonSet{} } else { - yyv1450 := &yyv1447[yyj1447] - yyv1450.CodecDecodeSelf(d) + yyv1620 := &yyv1617[yyj1617] + yyv1620.CodecDecodeSelf(d) } } else { @@ -17674,17 +19629,17 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder) } } - if yyj1447 < len(yyv1447) { - yyv1447 = yyv1447[:yyj1447] - yyc1447 = true - } else if yyj1447 == 0 && yyv1447 == nil { - yyv1447 = []DaemonSet{} - yyc1447 = true + if yyj1617 < len(yyv1617) { + yyv1617 = yyv1617[:yyj1617] + yyc1617 = true + } else if yyj1617 == 0 && yyv1617 == nil { + yyv1617 = []DaemonSet{} + yyc1617 = true } } - yyh1447.End() - if yyc1447 { - *v = yyv1447 + yyh1617.End() + if yyc1617 { + *v = yyv1617 } } @@ -17693,10 +19648,10 @@ func (x codecSelfer1234) encSliceThirdPartyResourceData(v []ThirdPartyResourceDa z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1451 := range v { + for _, yyv1621 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1452 := &yyv1451 - yy1452.CodecEncodeSelf(e) + yy1622 := &yyv1621 + yy1622.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17706,83 +19661,83 @@ func (x codecSelfer1234) decSliceThirdPartyResourceData(v *[]ThirdPartyResourceD z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1453 := *v - yyh1453, yyl1453 := z.DecSliceHelperStart() - var yyc1453 bool - if yyl1453 == 0 { - if yyv1453 == nil { - yyv1453 = []ThirdPartyResourceData{} - yyc1453 = true - } else if len(yyv1453) != 0 { - yyv1453 = yyv1453[:0] - yyc1453 = true + yyv1623 := *v + yyh1623, yyl1623 := z.DecSliceHelperStart() + var yyc1623 bool + if yyl1623 == 0 { + if yyv1623 == nil { + yyv1623 = []ThirdPartyResourceData{} + yyc1623 = true + } else if len(yyv1623) != 0 { + yyv1623 = yyv1623[:0] + yyc1623 = true } - } else if yyl1453 > 0 { - var yyrr1453, yyrl1453 int - var yyrt1453 bool - if yyl1453 > cap(yyv1453) { + } else if yyl1623 > 0 { + var yyrr1623, yyrl1623 int + var yyrt1623 bool + if yyl1623 > cap(yyv1623) { - yyrg1453 := len(yyv1453) > 0 - yyv21453 := yyv1453 - yyrl1453, yyrt1453 = z.DecInferLen(yyl1453, z.DecBasicHandle().MaxInitLen, 216) - if yyrt1453 { - if yyrl1453 <= cap(yyv1453) { - yyv1453 = yyv1453[:yyrl1453] + yyrg1623 := len(yyv1623) > 0 + yyv21623 := yyv1623 + yyrl1623, yyrt1623 = z.DecInferLen(yyl1623, z.DecBasicHandle().MaxInitLen, 216) + if yyrt1623 { + if yyrl1623 <= cap(yyv1623) { + yyv1623 = yyv1623[:yyrl1623] } else { - yyv1453 = make([]ThirdPartyResourceData, yyrl1453) + yyv1623 = make([]ThirdPartyResourceData, yyrl1623) } } else { - yyv1453 = make([]ThirdPartyResourceData, yyrl1453) + yyv1623 = make([]ThirdPartyResourceData, yyrl1623) } - yyc1453 = true - yyrr1453 = len(yyv1453) - if yyrg1453 { - copy(yyv1453, yyv21453) + yyc1623 = true + yyrr1623 = len(yyv1623) + if yyrg1623 { + copy(yyv1623, yyv21623) } - } else if yyl1453 != len(yyv1453) { - yyv1453 = yyv1453[:yyl1453] - yyc1453 = true + } else if yyl1623 != len(yyv1623) { + yyv1623 = yyv1623[:yyl1623] + yyc1623 = true } - yyj1453 := 0 - for ; yyj1453 < yyrr1453; yyj1453++ { - yyh1453.ElemContainerState(yyj1453) + yyj1623 := 0 + for ; yyj1623 < yyrr1623; yyj1623++ { + yyh1623.ElemContainerState(yyj1623) if r.TryDecodeAsNil() { - yyv1453[yyj1453] = ThirdPartyResourceData{} + yyv1623[yyj1623] = ThirdPartyResourceData{} } else { - yyv1454 := &yyv1453[yyj1453] - yyv1454.CodecDecodeSelf(d) + yyv1624 := &yyv1623[yyj1623] + yyv1624.CodecDecodeSelf(d) } } - if yyrt1453 { - for ; yyj1453 < yyl1453; yyj1453++ { - yyv1453 = append(yyv1453, ThirdPartyResourceData{}) - yyh1453.ElemContainerState(yyj1453) + if yyrt1623 { + for ; yyj1623 < yyl1623; yyj1623++ { + yyv1623 = append(yyv1623, ThirdPartyResourceData{}) + yyh1623.ElemContainerState(yyj1623) if r.TryDecodeAsNil() { - yyv1453[yyj1453] = ThirdPartyResourceData{} + yyv1623[yyj1623] = ThirdPartyResourceData{} } else { - yyv1455 := &yyv1453[yyj1453] - yyv1455.CodecDecodeSelf(d) + yyv1625 := &yyv1623[yyj1623] + yyv1625.CodecDecodeSelf(d) } } } } else { - yyj1453 := 0 - for ; !r.CheckBreak(); yyj1453++ { + yyj1623 := 0 + for ; !r.CheckBreak(); yyj1623++ { - if yyj1453 >= len(yyv1453) { - yyv1453 = append(yyv1453, ThirdPartyResourceData{}) // var yyz1453 ThirdPartyResourceData - yyc1453 = true + if yyj1623 >= len(yyv1623) { + yyv1623 = append(yyv1623, ThirdPartyResourceData{}) // var yyz1623 ThirdPartyResourceData + yyc1623 = true } - yyh1453.ElemContainerState(yyj1453) - if yyj1453 < len(yyv1453) { + yyh1623.ElemContainerState(yyj1623) + if yyj1623 < len(yyv1623) { if r.TryDecodeAsNil() { - yyv1453[yyj1453] = ThirdPartyResourceData{} + yyv1623[yyj1623] = ThirdPartyResourceData{} } else { - yyv1456 := &yyv1453[yyj1453] - yyv1456.CodecDecodeSelf(d) + yyv1626 := &yyv1623[yyj1623] + yyv1626.CodecDecodeSelf(d) } } else { @@ -17790,17 +19745,17 @@ func (x codecSelfer1234) decSliceThirdPartyResourceData(v *[]ThirdPartyResourceD } } - if yyj1453 < len(yyv1453) { - yyv1453 = yyv1453[:yyj1453] - yyc1453 = true - } else if yyj1453 == 0 && yyv1453 == nil { - yyv1453 = []ThirdPartyResourceData{} - yyc1453 = true + if yyj1623 < len(yyv1623) { + yyv1623 = yyv1623[:yyj1623] + yyc1623 = true + } else if yyj1623 == 0 && yyv1623 == nil { + yyv1623 = []ThirdPartyResourceData{} + yyc1623 = true } } - yyh1453.End() - if yyc1453 { - *v = yyv1453 + yyh1623.End() + if yyc1623 { + *v = yyv1623 } } @@ -17809,10 +19764,10 @@ func (x codecSelfer1234) encSliceJob(v []Job, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1457 := range v { + for _, yyv1627 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1458 := &yyv1457 - yy1458.CodecEncodeSelf(e) + yy1628 := &yyv1627 + yy1628.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17822,83 +19777,83 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1459 := *v - yyh1459, yyl1459 := z.DecSliceHelperStart() - var yyc1459 bool - if yyl1459 == 0 { - if yyv1459 == nil { - yyv1459 = []Job{} - yyc1459 = true - } else if len(yyv1459) != 0 { - yyv1459 = yyv1459[:0] - yyc1459 = true + yyv1629 := *v + yyh1629, yyl1629 := z.DecSliceHelperStart() + var yyc1629 bool + if yyl1629 == 0 { + if yyv1629 == nil { + yyv1629 = []Job{} + yyc1629 = true + } else if len(yyv1629) != 0 { + yyv1629 = yyv1629[:0] + yyc1629 = true } - } else if yyl1459 > 0 { - var yyrr1459, yyrl1459 int - var yyrt1459 bool - if yyl1459 > cap(yyv1459) { + } else if yyl1629 > 0 { + var yyrr1629, yyrl1629 int + var yyrt1629 bool + if yyl1629 > cap(yyv1629) { - yyrg1459 := len(yyv1459) > 0 - yyv21459 := yyv1459 - yyrl1459, yyrt1459 = z.DecInferLen(yyl1459, z.DecBasicHandle().MaxInitLen, 616) - if yyrt1459 { - if yyrl1459 <= cap(yyv1459) { - yyv1459 = yyv1459[:yyrl1459] + yyrg1629 := len(yyv1629) > 0 + yyv21629 := yyv1629 + yyrl1629, yyrt1629 = z.DecInferLen(yyl1629, z.DecBasicHandle().MaxInitLen, 616) + if yyrt1629 { + if yyrl1629 <= cap(yyv1629) { + yyv1629 = yyv1629[:yyrl1629] } else { - yyv1459 = make([]Job, yyrl1459) + yyv1629 = make([]Job, yyrl1629) } } else { - yyv1459 = make([]Job, yyrl1459) + yyv1629 = make([]Job, yyrl1629) } - yyc1459 = true - yyrr1459 = len(yyv1459) - if yyrg1459 { - copy(yyv1459, yyv21459) + yyc1629 = true + yyrr1629 = len(yyv1629) + if yyrg1629 { + copy(yyv1629, yyv21629) } - } else if yyl1459 != len(yyv1459) { - yyv1459 = yyv1459[:yyl1459] - yyc1459 = true + } else if yyl1629 != len(yyv1629) { + yyv1629 = yyv1629[:yyl1629] + yyc1629 = true } - yyj1459 := 0 - for ; yyj1459 < yyrr1459; yyj1459++ { - yyh1459.ElemContainerState(yyj1459) + yyj1629 := 0 + for ; yyj1629 < yyrr1629; yyj1629++ { + yyh1629.ElemContainerState(yyj1629) if r.TryDecodeAsNil() { - yyv1459[yyj1459] = Job{} + yyv1629[yyj1629] = Job{} } else { - yyv1460 := &yyv1459[yyj1459] - yyv1460.CodecDecodeSelf(d) + yyv1630 := &yyv1629[yyj1629] + yyv1630.CodecDecodeSelf(d) } } - if yyrt1459 { - for ; yyj1459 < yyl1459; yyj1459++ { - yyv1459 = append(yyv1459, Job{}) - yyh1459.ElemContainerState(yyj1459) + if yyrt1629 { + for ; yyj1629 < yyl1629; yyj1629++ { + yyv1629 = append(yyv1629, Job{}) + yyh1629.ElemContainerState(yyj1629) if r.TryDecodeAsNil() { - yyv1459[yyj1459] = Job{} + yyv1629[yyj1629] = Job{} } else { - yyv1461 := &yyv1459[yyj1459] - yyv1461.CodecDecodeSelf(d) + yyv1631 := &yyv1629[yyj1629] + yyv1631.CodecDecodeSelf(d) } } } } else { - yyj1459 := 0 - for ; !r.CheckBreak(); yyj1459++ { + yyj1629 := 0 + for ; !r.CheckBreak(); yyj1629++ { - if yyj1459 >= len(yyv1459) { - yyv1459 = append(yyv1459, Job{}) // var yyz1459 Job - yyc1459 = true + if yyj1629 >= len(yyv1629) { + yyv1629 = append(yyv1629, Job{}) // var yyz1629 Job + yyc1629 = true } - yyh1459.ElemContainerState(yyj1459) - if yyj1459 < len(yyv1459) { + yyh1629.ElemContainerState(yyj1629) + if yyj1629 < len(yyv1629) { if r.TryDecodeAsNil() { - yyv1459[yyj1459] = Job{} + yyv1629[yyj1629] = Job{} } else { - yyv1462 := &yyv1459[yyj1459] - yyv1462.CodecDecodeSelf(d) + yyv1632 := &yyv1629[yyj1629] + yyv1632.CodecDecodeSelf(d) } } else { @@ -17906,17 +19861,17 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { } } - if yyj1459 < len(yyv1459) { - yyv1459 = yyv1459[:yyj1459] - yyc1459 = true - } else if yyj1459 == 0 && yyv1459 == nil { - yyv1459 = []Job{} - yyc1459 = true + if yyj1629 < len(yyv1629) { + yyv1629 = yyv1629[:yyj1629] + yyc1629 = true + } else if yyj1629 == 0 && yyv1629 == nil { + yyv1629 = []Job{} + yyc1629 = true } } - yyh1459.End() - if yyc1459 { - *v = yyv1459 + yyh1629.End() + if yyc1629 { + *v = yyv1629 } } @@ -17925,10 +19880,10 @@ func (x codecSelfer1234) encSliceJobCondition(v []JobCondition, e *codec1978.Enc z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1463 := range v { + for _, yyv1633 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1464 := &yyv1463 - yy1464.CodecEncodeSelf(e) + yy1634 := &yyv1633 + yy1634.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17938,83 +19893,83 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1465 := *v - yyh1465, yyl1465 := z.DecSliceHelperStart() - var yyc1465 bool - if yyl1465 == 0 { - if yyv1465 == nil { - yyv1465 = []JobCondition{} - yyc1465 = true - } else if len(yyv1465) != 0 { - yyv1465 = yyv1465[:0] - yyc1465 = true + yyv1635 := *v + yyh1635, yyl1635 := z.DecSliceHelperStart() + var yyc1635 bool + if yyl1635 == 0 { + if yyv1635 == nil { + yyv1635 = []JobCondition{} + yyc1635 = true + } else if len(yyv1635) != 0 { + yyv1635 = yyv1635[:0] + yyc1635 = true } - } else if yyl1465 > 0 { - var yyrr1465, yyrl1465 int - var yyrt1465 bool - if yyl1465 > cap(yyv1465) { + } else if yyl1635 > 0 { + var yyrr1635, yyrl1635 int + var yyrt1635 bool + if yyl1635 > cap(yyv1635) { - yyrg1465 := len(yyv1465) > 0 - yyv21465 := yyv1465 - yyrl1465, yyrt1465 = z.DecInferLen(yyl1465, z.DecBasicHandle().MaxInitLen, 112) - if yyrt1465 { - if yyrl1465 <= cap(yyv1465) { - yyv1465 = yyv1465[:yyrl1465] + yyrg1635 := len(yyv1635) > 0 + yyv21635 := yyv1635 + yyrl1635, yyrt1635 = z.DecInferLen(yyl1635, z.DecBasicHandle().MaxInitLen, 112) + if yyrt1635 { + if yyrl1635 <= cap(yyv1635) { + yyv1635 = yyv1635[:yyrl1635] } else { - yyv1465 = make([]JobCondition, yyrl1465) + yyv1635 = make([]JobCondition, yyrl1635) } } else { - yyv1465 = make([]JobCondition, yyrl1465) + yyv1635 = make([]JobCondition, yyrl1635) } - yyc1465 = true - yyrr1465 = len(yyv1465) - if yyrg1465 { - copy(yyv1465, yyv21465) + yyc1635 = true + yyrr1635 = len(yyv1635) + if yyrg1635 { + copy(yyv1635, yyv21635) } - } else if yyl1465 != len(yyv1465) { - yyv1465 = yyv1465[:yyl1465] - yyc1465 = true + } else if yyl1635 != len(yyv1635) { + yyv1635 = yyv1635[:yyl1635] + yyc1635 = true } - yyj1465 := 0 - for ; yyj1465 < yyrr1465; yyj1465++ { - yyh1465.ElemContainerState(yyj1465) + yyj1635 := 0 + for ; yyj1635 < yyrr1635; yyj1635++ { + yyh1635.ElemContainerState(yyj1635) if r.TryDecodeAsNil() { - yyv1465[yyj1465] = JobCondition{} + yyv1635[yyj1635] = JobCondition{} } else { - yyv1466 := &yyv1465[yyj1465] - yyv1466.CodecDecodeSelf(d) + yyv1636 := &yyv1635[yyj1635] + yyv1636.CodecDecodeSelf(d) } } - if yyrt1465 { - for ; yyj1465 < yyl1465; yyj1465++ { - yyv1465 = append(yyv1465, JobCondition{}) - yyh1465.ElemContainerState(yyj1465) + if yyrt1635 { + for ; yyj1635 < yyl1635; yyj1635++ { + yyv1635 = append(yyv1635, JobCondition{}) + yyh1635.ElemContainerState(yyj1635) if r.TryDecodeAsNil() { - yyv1465[yyj1465] = JobCondition{} + yyv1635[yyj1635] = JobCondition{} } else { - yyv1467 := &yyv1465[yyj1465] - yyv1467.CodecDecodeSelf(d) + yyv1637 := &yyv1635[yyj1635] + yyv1637.CodecDecodeSelf(d) } } } } else { - yyj1465 := 0 - for ; !r.CheckBreak(); yyj1465++ { + yyj1635 := 0 + for ; !r.CheckBreak(); yyj1635++ { - if yyj1465 >= len(yyv1465) { - yyv1465 = append(yyv1465, JobCondition{}) // var yyz1465 JobCondition - yyc1465 = true + if yyj1635 >= len(yyv1635) { + yyv1635 = append(yyv1635, JobCondition{}) // var yyz1635 JobCondition + yyc1635 = true } - yyh1465.ElemContainerState(yyj1465) - if yyj1465 < len(yyv1465) { + yyh1635.ElemContainerState(yyj1635) + if yyj1635 < len(yyv1635) { if r.TryDecodeAsNil() { - yyv1465[yyj1465] = JobCondition{} + yyv1635[yyj1635] = JobCondition{} } else { - yyv1468 := &yyv1465[yyj1465] - yyv1468.CodecDecodeSelf(d) + yyv1638 := &yyv1635[yyj1635] + yyv1638.CodecDecodeSelf(d) } } else { @@ -18022,17 +19977,17 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De } } - if yyj1465 < len(yyv1465) { - yyv1465 = yyv1465[:yyj1465] - yyc1465 = true - } else if yyj1465 == 0 && yyv1465 == nil { - yyv1465 = []JobCondition{} - yyc1465 = true + if yyj1635 < len(yyv1635) { + yyv1635 = yyv1635[:yyj1635] + yyc1635 = true + } else if yyj1635 == 0 && yyv1635 == nil { + yyv1635 = []JobCondition{} + yyc1635 = true } } - yyh1465.End() - if yyc1465 { - *v = yyv1465 + yyh1635.End() + if yyc1635 { + *v = yyv1635 } } @@ -18041,10 +19996,10 @@ func (x codecSelfer1234) encSliceIngress(v []Ingress, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1469 := range v { + for _, yyv1639 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1470 := &yyv1469 - yy1470.CodecEncodeSelf(e) + yy1640 := &yyv1639 + yy1640.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18054,83 +20009,83 @@ func (x codecSelfer1234) decSliceIngress(v *[]Ingress, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1471 := *v - yyh1471, yyl1471 := z.DecSliceHelperStart() - var yyc1471 bool - if yyl1471 == 0 { - if yyv1471 == nil { - yyv1471 = []Ingress{} - yyc1471 = true - } else if len(yyv1471) != 0 { - yyv1471 = yyv1471[:0] - yyc1471 = true + yyv1641 := *v + yyh1641, yyl1641 := z.DecSliceHelperStart() + var yyc1641 bool + if yyl1641 == 0 { + if yyv1641 == nil { + yyv1641 = []Ingress{} + yyc1641 = true + } else if len(yyv1641) != 0 { + yyv1641 = yyv1641[:0] + yyc1641 = true } - } else if yyl1471 > 0 { - var yyrr1471, yyrl1471 int - var yyrt1471 bool - if yyl1471 > cap(yyv1471) { + } else if yyl1641 > 0 { + var yyrr1641, yyrl1641 int + var yyrt1641 bool + if yyl1641 > cap(yyv1641) { - yyrg1471 := len(yyv1471) > 0 - yyv21471 := yyv1471 - yyrl1471, yyrt1471 = z.DecInferLen(yyl1471, z.DecBasicHandle().MaxInitLen, 248) - if yyrt1471 { - if yyrl1471 <= cap(yyv1471) { - yyv1471 = yyv1471[:yyrl1471] + yyrg1641 := len(yyv1641) > 0 + yyv21641 := yyv1641 + yyrl1641, yyrt1641 = z.DecInferLen(yyl1641, z.DecBasicHandle().MaxInitLen, 272) + if yyrt1641 { + if yyrl1641 <= cap(yyv1641) { + yyv1641 = yyv1641[:yyrl1641] } else { - yyv1471 = make([]Ingress, yyrl1471) + yyv1641 = make([]Ingress, yyrl1641) } } else { - yyv1471 = make([]Ingress, yyrl1471) + yyv1641 = make([]Ingress, yyrl1641) } - yyc1471 = true - yyrr1471 = len(yyv1471) - if yyrg1471 { - copy(yyv1471, yyv21471) + yyc1641 = true + yyrr1641 = len(yyv1641) + if yyrg1641 { + copy(yyv1641, yyv21641) } - } else if yyl1471 != len(yyv1471) { - yyv1471 = yyv1471[:yyl1471] - yyc1471 = true + } else if yyl1641 != len(yyv1641) { + yyv1641 = yyv1641[:yyl1641] + yyc1641 = true } - yyj1471 := 0 - for ; yyj1471 < yyrr1471; yyj1471++ { - yyh1471.ElemContainerState(yyj1471) + yyj1641 := 0 + for ; yyj1641 < yyrr1641; yyj1641++ { + yyh1641.ElemContainerState(yyj1641) if r.TryDecodeAsNil() { - yyv1471[yyj1471] = Ingress{} + yyv1641[yyj1641] = Ingress{} } else { - yyv1472 := &yyv1471[yyj1471] - yyv1472.CodecDecodeSelf(d) + yyv1642 := &yyv1641[yyj1641] + yyv1642.CodecDecodeSelf(d) } } - if yyrt1471 { - for ; yyj1471 < yyl1471; yyj1471++ { - yyv1471 = append(yyv1471, Ingress{}) - yyh1471.ElemContainerState(yyj1471) + if yyrt1641 { + for ; yyj1641 < yyl1641; yyj1641++ { + yyv1641 = append(yyv1641, Ingress{}) + yyh1641.ElemContainerState(yyj1641) if r.TryDecodeAsNil() { - yyv1471[yyj1471] = Ingress{} + yyv1641[yyj1641] = Ingress{} } else { - yyv1473 := &yyv1471[yyj1471] - yyv1473.CodecDecodeSelf(d) + yyv1643 := &yyv1641[yyj1641] + yyv1643.CodecDecodeSelf(d) } } } } else { - yyj1471 := 0 - for ; !r.CheckBreak(); yyj1471++ { + yyj1641 := 0 + for ; !r.CheckBreak(); yyj1641++ { - if yyj1471 >= len(yyv1471) { - yyv1471 = append(yyv1471, Ingress{}) // var yyz1471 Ingress - yyc1471 = true + if yyj1641 >= len(yyv1641) { + yyv1641 = append(yyv1641, Ingress{}) // var yyz1641 Ingress + yyc1641 = true } - yyh1471.ElemContainerState(yyj1471) - if yyj1471 < len(yyv1471) { + yyh1641.ElemContainerState(yyj1641) + if yyj1641 < len(yyv1641) { if r.TryDecodeAsNil() { - yyv1471[yyj1471] = Ingress{} + yyv1641[yyj1641] = Ingress{} } else { - yyv1474 := &yyv1471[yyj1471] - yyv1474.CodecDecodeSelf(d) + yyv1644 := &yyv1641[yyj1641] + yyv1644.CodecDecodeSelf(d) } } else { @@ -18138,17 +20093,133 @@ func (x codecSelfer1234) decSliceIngress(v *[]Ingress, d *codec1978.Decoder) { } } - if yyj1471 < len(yyv1471) { - yyv1471 = yyv1471[:yyj1471] - yyc1471 = true - } else if yyj1471 == 0 && yyv1471 == nil { - yyv1471 = []Ingress{} - yyc1471 = true + if yyj1641 < len(yyv1641) { + yyv1641 = yyv1641[:yyj1641] + yyc1641 = true + } else if yyj1641 == 0 && yyv1641 == nil { + yyv1641 = []Ingress{} + yyc1641 = true } } - yyh1471.End() - if yyc1471 { - *v = yyv1471 + yyh1641.End() + if yyc1641 { + *v = yyv1641 + } +} + +func (x codecSelfer1234) encSliceIngressTLS(v []IngressTLS, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1645 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1646 := &yyv1645 + yy1646.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceIngressTLS(v *[]IngressTLS, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1647 := *v + yyh1647, yyl1647 := z.DecSliceHelperStart() + var yyc1647 bool + if yyl1647 == 0 { + if yyv1647 == nil { + yyv1647 = []IngressTLS{} + yyc1647 = true + } else if len(yyv1647) != 0 { + yyv1647 = yyv1647[:0] + yyc1647 = true + } + } else if yyl1647 > 0 { + var yyrr1647, yyrl1647 int + var yyrt1647 bool + if yyl1647 > cap(yyv1647) { + + yyrg1647 := len(yyv1647) > 0 + yyv21647 := yyv1647 + yyrl1647, yyrt1647 = z.DecInferLen(yyl1647, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1647 { + if yyrl1647 <= cap(yyv1647) { + yyv1647 = yyv1647[:yyrl1647] + } else { + yyv1647 = make([]IngressTLS, yyrl1647) + } + } else { + yyv1647 = make([]IngressTLS, yyrl1647) + } + yyc1647 = true + yyrr1647 = len(yyv1647) + if yyrg1647 { + copy(yyv1647, yyv21647) + } + } else if yyl1647 != len(yyv1647) { + yyv1647 = yyv1647[:yyl1647] + yyc1647 = true + } + yyj1647 := 0 + for ; yyj1647 < yyrr1647; yyj1647++ { + yyh1647.ElemContainerState(yyj1647) + if r.TryDecodeAsNil() { + yyv1647[yyj1647] = IngressTLS{} + } else { + yyv1648 := &yyv1647[yyj1647] + yyv1648.CodecDecodeSelf(d) + } + + } + if yyrt1647 { + for ; yyj1647 < yyl1647; yyj1647++ { + yyv1647 = append(yyv1647, IngressTLS{}) + yyh1647.ElemContainerState(yyj1647) + if r.TryDecodeAsNil() { + yyv1647[yyj1647] = IngressTLS{} + } else { + yyv1649 := &yyv1647[yyj1647] + yyv1649.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1647 := 0 + for ; !r.CheckBreak(); yyj1647++ { + + if yyj1647 >= len(yyv1647) { + yyv1647 = append(yyv1647, IngressTLS{}) // var yyz1647 IngressTLS + yyc1647 = true + } + yyh1647.ElemContainerState(yyj1647) + if yyj1647 < len(yyv1647) { + if r.TryDecodeAsNil() { + yyv1647[yyj1647] = IngressTLS{} + } else { + yyv1650 := &yyv1647[yyj1647] + yyv1650.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1647 < len(yyv1647) { + yyv1647 = yyv1647[:yyj1647] + yyc1647 = true + } else if yyj1647 == 0 && yyv1647 == nil { + yyv1647 = []IngressTLS{} + yyc1647 = true + } + } + yyh1647.End() + if yyc1647 { + *v = yyv1647 } } @@ -18157,10 +20228,10 @@ func (x codecSelfer1234) encSliceIngressRule(v []IngressRule, e *codec1978.Encod z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1475 := range v { + for _, yyv1651 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1476 := &yyv1475 - yy1476.CodecEncodeSelf(e) + yy1652 := &yyv1651 + yy1652.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18170,83 +20241,83 @@ func (x codecSelfer1234) decSliceIngressRule(v *[]IngressRule, d *codec1978.Deco z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1477 := *v - yyh1477, yyl1477 := z.DecSliceHelperStart() - var yyc1477 bool - if yyl1477 == 0 { - if yyv1477 == nil { - yyv1477 = []IngressRule{} - yyc1477 = true - } else if len(yyv1477) != 0 { - yyv1477 = yyv1477[:0] - yyc1477 = true + yyv1653 := *v + yyh1653, yyl1653 := z.DecSliceHelperStart() + var yyc1653 bool + if yyl1653 == 0 { + if yyv1653 == nil { + yyv1653 = []IngressRule{} + yyc1653 = true + } else if len(yyv1653) != 0 { + yyv1653 = yyv1653[:0] + yyc1653 = true } - } else if yyl1477 > 0 { - var yyrr1477, yyrl1477 int - var yyrt1477 bool - if yyl1477 > cap(yyv1477) { + } else if yyl1653 > 0 { + var yyrr1653, yyrl1653 int + var yyrt1653 bool + if yyl1653 > cap(yyv1653) { - yyrg1477 := len(yyv1477) > 0 - yyv21477 := yyv1477 - yyrl1477, yyrt1477 = z.DecInferLen(yyl1477, z.DecBasicHandle().MaxInitLen, 24) - if yyrt1477 { - if yyrl1477 <= cap(yyv1477) { - yyv1477 = yyv1477[:yyrl1477] + yyrg1653 := len(yyv1653) > 0 + yyv21653 := yyv1653 + yyrl1653, yyrt1653 = z.DecInferLen(yyl1653, z.DecBasicHandle().MaxInitLen, 24) + if yyrt1653 { + if yyrl1653 <= cap(yyv1653) { + yyv1653 = yyv1653[:yyrl1653] } else { - yyv1477 = make([]IngressRule, yyrl1477) + yyv1653 = make([]IngressRule, yyrl1653) } } else { - yyv1477 = make([]IngressRule, yyrl1477) + yyv1653 = make([]IngressRule, yyrl1653) } - yyc1477 = true - yyrr1477 = len(yyv1477) - if yyrg1477 { - copy(yyv1477, yyv21477) + yyc1653 = true + yyrr1653 = len(yyv1653) + if yyrg1653 { + copy(yyv1653, yyv21653) } - } else if yyl1477 != len(yyv1477) { - yyv1477 = yyv1477[:yyl1477] - yyc1477 = true + } else if yyl1653 != len(yyv1653) { + yyv1653 = yyv1653[:yyl1653] + yyc1653 = true } - yyj1477 := 0 - for ; yyj1477 < yyrr1477; yyj1477++ { - yyh1477.ElemContainerState(yyj1477) + yyj1653 := 0 + for ; yyj1653 < yyrr1653; yyj1653++ { + yyh1653.ElemContainerState(yyj1653) if r.TryDecodeAsNil() { - yyv1477[yyj1477] = IngressRule{} + yyv1653[yyj1653] = IngressRule{} } else { - yyv1478 := &yyv1477[yyj1477] - yyv1478.CodecDecodeSelf(d) + yyv1654 := &yyv1653[yyj1653] + yyv1654.CodecDecodeSelf(d) } } - if yyrt1477 { - for ; yyj1477 < yyl1477; yyj1477++ { - yyv1477 = append(yyv1477, IngressRule{}) - yyh1477.ElemContainerState(yyj1477) + if yyrt1653 { + for ; yyj1653 < yyl1653; yyj1653++ { + yyv1653 = append(yyv1653, IngressRule{}) + yyh1653.ElemContainerState(yyj1653) if r.TryDecodeAsNil() { - yyv1477[yyj1477] = IngressRule{} + yyv1653[yyj1653] = IngressRule{} } else { - yyv1479 := &yyv1477[yyj1477] - yyv1479.CodecDecodeSelf(d) + yyv1655 := &yyv1653[yyj1653] + yyv1655.CodecDecodeSelf(d) } } } } else { - yyj1477 := 0 - for ; !r.CheckBreak(); yyj1477++ { + yyj1653 := 0 + for ; !r.CheckBreak(); yyj1653++ { - if yyj1477 >= len(yyv1477) { - yyv1477 = append(yyv1477, IngressRule{}) // var yyz1477 IngressRule - yyc1477 = true + if yyj1653 >= len(yyv1653) { + yyv1653 = append(yyv1653, IngressRule{}) // var yyz1653 IngressRule + yyc1653 = true } - yyh1477.ElemContainerState(yyj1477) - if yyj1477 < len(yyv1477) { + yyh1653.ElemContainerState(yyj1653) + if yyj1653 < len(yyv1653) { if r.TryDecodeAsNil() { - yyv1477[yyj1477] = IngressRule{} + yyv1653[yyj1653] = IngressRule{} } else { - yyv1480 := &yyv1477[yyj1477] - yyv1480.CodecDecodeSelf(d) + yyv1656 := &yyv1653[yyj1653] + yyv1656.CodecDecodeSelf(d) } } else { @@ -18254,17 +20325,17 @@ func (x codecSelfer1234) decSliceIngressRule(v *[]IngressRule, d *codec1978.Deco } } - if yyj1477 < len(yyv1477) { - yyv1477 = yyv1477[:yyj1477] - yyc1477 = true - } else if yyj1477 == 0 && yyv1477 == nil { - yyv1477 = []IngressRule{} - yyc1477 = true + if yyj1653 < len(yyv1653) { + yyv1653 = yyv1653[:yyj1653] + yyc1653 = true + } else if yyj1653 == 0 && yyv1653 == nil { + yyv1653 = []IngressRule{} + yyc1653 = true } } - yyh1477.End() - if yyc1477 { - *v = yyv1477 + yyh1653.End() + if yyc1653 { + *v = yyv1653 } } @@ -18273,10 +20344,10 @@ func (x codecSelfer1234) encSliceHTTPIngressPath(v []HTTPIngressPath, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1481 := range v { + for _, yyv1657 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1482 := &yyv1481 - yy1482.CodecEncodeSelf(e) + yy1658 := &yyv1657 + yy1658.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18286,83 +20357,83 @@ func (x codecSelfer1234) decSliceHTTPIngressPath(v *[]HTTPIngressPath, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1483 := *v - yyh1483, yyl1483 := z.DecSliceHelperStart() - var yyc1483 bool - if yyl1483 == 0 { - if yyv1483 == nil { - yyv1483 = []HTTPIngressPath{} - yyc1483 = true - } else if len(yyv1483) != 0 { - yyv1483 = yyv1483[:0] - yyc1483 = true + yyv1659 := *v + yyh1659, yyl1659 := z.DecSliceHelperStart() + var yyc1659 bool + if yyl1659 == 0 { + if yyv1659 == nil { + yyv1659 = []HTTPIngressPath{} + yyc1659 = true + } else if len(yyv1659) != 0 { + yyv1659 = yyv1659[:0] + yyc1659 = true } - } else if yyl1483 > 0 { - var yyrr1483, yyrl1483 int - var yyrt1483 bool - if yyl1483 > cap(yyv1483) { + } else if yyl1659 > 0 { + var yyrr1659, yyrl1659 int + var yyrt1659 bool + if yyl1659 > cap(yyv1659) { - yyrg1483 := len(yyv1483) > 0 - yyv21483 := yyv1483 - yyrl1483, yyrt1483 = z.DecInferLen(yyl1483, z.DecBasicHandle().MaxInitLen, 64) - if yyrt1483 { - if yyrl1483 <= cap(yyv1483) { - yyv1483 = yyv1483[:yyrl1483] + yyrg1659 := len(yyv1659) > 0 + yyv21659 := yyv1659 + yyrl1659, yyrt1659 = z.DecInferLen(yyl1659, z.DecBasicHandle().MaxInitLen, 64) + if yyrt1659 { + if yyrl1659 <= cap(yyv1659) { + yyv1659 = yyv1659[:yyrl1659] } else { - yyv1483 = make([]HTTPIngressPath, yyrl1483) + yyv1659 = make([]HTTPIngressPath, yyrl1659) } } else { - yyv1483 = make([]HTTPIngressPath, yyrl1483) + yyv1659 = make([]HTTPIngressPath, yyrl1659) } - yyc1483 = true - yyrr1483 = len(yyv1483) - if yyrg1483 { - copy(yyv1483, yyv21483) + yyc1659 = true + yyrr1659 = len(yyv1659) + if yyrg1659 { + copy(yyv1659, yyv21659) } - } else if yyl1483 != len(yyv1483) { - yyv1483 = yyv1483[:yyl1483] - yyc1483 = true + } else if yyl1659 != len(yyv1659) { + yyv1659 = yyv1659[:yyl1659] + yyc1659 = true } - yyj1483 := 0 - for ; yyj1483 < yyrr1483; yyj1483++ { - yyh1483.ElemContainerState(yyj1483) + yyj1659 := 0 + for ; yyj1659 < yyrr1659; yyj1659++ { + yyh1659.ElemContainerState(yyj1659) if r.TryDecodeAsNil() { - yyv1483[yyj1483] = HTTPIngressPath{} + yyv1659[yyj1659] = HTTPIngressPath{} } else { - yyv1484 := &yyv1483[yyj1483] - yyv1484.CodecDecodeSelf(d) + yyv1660 := &yyv1659[yyj1659] + yyv1660.CodecDecodeSelf(d) } } - if yyrt1483 { - for ; yyj1483 < yyl1483; yyj1483++ { - yyv1483 = append(yyv1483, HTTPIngressPath{}) - yyh1483.ElemContainerState(yyj1483) + if yyrt1659 { + for ; yyj1659 < yyl1659; yyj1659++ { + yyv1659 = append(yyv1659, HTTPIngressPath{}) + yyh1659.ElemContainerState(yyj1659) if r.TryDecodeAsNil() { - yyv1483[yyj1483] = HTTPIngressPath{} + yyv1659[yyj1659] = HTTPIngressPath{} } else { - yyv1485 := &yyv1483[yyj1483] - yyv1485.CodecDecodeSelf(d) + yyv1661 := &yyv1659[yyj1659] + yyv1661.CodecDecodeSelf(d) } } } } else { - yyj1483 := 0 - for ; !r.CheckBreak(); yyj1483++ { + yyj1659 := 0 + for ; !r.CheckBreak(); yyj1659++ { - if yyj1483 >= len(yyv1483) { - yyv1483 = append(yyv1483, HTTPIngressPath{}) // var yyz1483 HTTPIngressPath - yyc1483 = true + if yyj1659 >= len(yyv1659) { + yyv1659 = append(yyv1659, HTTPIngressPath{}) // var yyz1659 HTTPIngressPath + yyc1659 = true } - yyh1483.ElemContainerState(yyj1483) - if yyj1483 < len(yyv1483) { + yyh1659.ElemContainerState(yyj1659) + if yyj1659 < len(yyv1659) { if r.TryDecodeAsNil() { - yyv1483[yyj1483] = HTTPIngressPath{} + yyv1659[yyj1659] = HTTPIngressPath{} } else { - yyv1486 := &yyv1483[yyj1483] - yyv1486.CodecDecodeSelf(d) + yyv1662 := &yyv1659[yyj1659] + yyv1662.CodecDecodeSelf(d) } } else { @@ -18370,17 +20441,17 @@ func (x codecSelfer1234) decSliceHTTPIngressPath(v *[]HTTPIngressPath, d *codec1 } } - if yyj1483 < len(yyv1483) { - yyv1483 = yyv1483[:yyj1483] - yyc1483 = true - } else if yyj1483 == 0 && yyv1483 == nil { - yyv1483 = []HTTPIngressPath{} - yyc1483 = true + if yyj1659 < len(yyv1659) { + yyv1659 = yyv1659[:yyj1659] + yyc1659 = true + } else if yyj1659 == 0 && yyv1659 == nil { + yyv1659 = []HTTPIngressPath{} + yyc1659 = true } } - yyh1483.End() - if yyc1483 { - *v = yyv1483 + yyh1659.End() + if yyc1659 { + *v = yyv1659 } } @@ -18389,10 +20460,10 @@ func (x codecSelfer1234) encSliceNodeUtilization(v []NodeUtilization, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1487 := range v { + for _, yyv1663 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1488 := &yyv1487 - yy1488.CodecEncodeSelf(e) + yy1664 := &yyv1663 + yy1664.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18402,83 +20473,83 @@ func (x codecSelfer1234) decSliceNodeUtilization(v *[]NodeUtilization, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1489 := *v - yyh1489, yyl1489 := z.DecSliceHelperStart() - var yyc1489 bool - if yyl1489 == 0 { - if yyv1489 == nil { - yyv1489 = []NodeUtilization{} - yyc1489 = true - } else if len(yyv1489) != 0 { - yyv1489 = yyv1489[:0] - yyc1489 = true + yyv1665 := *v + yyh1665, yyl1665 := z.DecSliceHelperStart() + var yyc1665 bool + if yyl1665 == 0 { + if yyv1665 == nil { + yyv1665 = []NodeUtilization{} + yyc1665 = true + } else if len(yyv1665) != 0 { + yyv1665 = yyv1665[:0] + yyc1665 = true } - } else if yyl1489 > 0 { - var yyrr1489, yyrl1489 int - var yyrt1489 bool - if yyl1489 > cap(yyv1489) { + } else if yyl1665 > 0 { + var yyrr1665, yyrl1665 int + var yyrt1665 bool + if yyl1665 > cap(yyv1665) { - yyrg1489 := len(yyv1489) > 0 - yyv21489 := yyv1489 - yyrl1489, yyrt1489 = z.DecInferLen(yyl1489, z.DecBasicHandle().MaxInitLen, 24) - if yyrt1489 { - if yyrl1489 <= cap(yyv1489) { - yyv1489 = yyv1489[:yyrl1489] + yyrg1665 := len(yyv1665) > 0 + yyv21665 := yyv1665 + yyrl1665, yyrt1665 = z.DecInferLen(yyl1665, z.DecBasicHandle().MaxInitLen, 24) + if yyrt1665 { + if yyrl1665 <= cap(yyv1665) { + yyv1665 = yyv1665[:yyrl1665] } else { - yyv1489 = make([]NodeUtilization, yyrl1489) + yyv1665 = make([]NodeUtilization, yyrl1665) } } else { - yyv1489 = make([]NodeUtilization, yyrl1489) + yyv1665 = make([]NodeUtilization, yyrl1665) } - yyc1489 = true - yyrr1489 = len(yyv1489) - if yyrg1489 { - copy(yyv1489, yyv21489) + yyc1665 = true + yyrr1665 = len(yyv1665) + if yyrg1665 { + copy(yyv1665, yyv21665) } - } else if yyl1489 != len(yyv1489) { - yyv1489 = yyv1489[:yyl1489] - yyc1489 = true + } else if yyl1665 != len(yyv1665) { + yyv1665 = yyv1665[:yyl1665] + yyc1665 = true } - yyj1489 := 0 - for ; yyj1489 < yyrr1489; yyj1489++ { - yyh1489.ElemContainerState(yyj1489) + yyj1665 := 0 + for ; yyj1665 < yyrr1665; yyj1665++ { + yyh1665.ElemContainerState(yyj1665) if r.TryDecodeAsNil() { - yyv1489[yyj1489] = NodeUtilization{} + yyv1665[yyj1665] = NodeUtilization{} } else { - yyv1490 := &yyv1489[yyj1489] - yyv1490.CodecDecodeSelf(d) + yyv1666 := &yyv1665[yyj1665] + yyv1666.CodecDecodeSelf(d) } } - if yyrt1489 { - for ; yyj1489 < yyl1489; yyj1489++ { - yyv1489 = append(yyv1489, NodeUtilization{}) - yyh1489.ElemContainerState(yyj1489) + if yyrt1665 { + for ; yyj1665 < yyl1665; yyj1665++ { + yyv1665 = append(yyv1665, NodeUtilization{}) + yyh1665.ElemContainerState(yyj1665) if r.TryDecodeAsNil() { - yyv1489[yyj1489] = NodeUtilization{} + yyv1665[yyj1665] = NodeUtilization{} } else { - yyv1491 := &yyv1489[yyj1489] - yyv1491.CodecDecodeSelf(d) + yyv1667 := &yyv1665[yyj1665] + yyv1667.CodecDecodeSelf(d) } } } } else { - yyj1489 := 0 - for ; !r.CheckBreak(); yyj1489++ { + yyj1665 := 0 + for ; !r.CheckBreak(); yyj1665++ { - if yyj1489 >= len(yyv1489) { - yyv1489 = append(yyv1489, NodeUtilization{}) // var yyz1489 NodeUtilization - yyc1489 = true + if yyj1665 >= len(yyv1665) { + yyv1665 = append(yyv1665, NodeUtilization{}) // var yyz1665 NodeUtilization + yyc1665 = true } - yyh1489.ElemContainerState(yyj1489) - if yyj1489 < len(yyv1489) { + yyh1665.ElemContainerState(yyj1665) + if yyj1665 < len(yyv1665) { if r.TryDecodeAsNil() { - yyv1489[yyj1489] = NodeUtilization{} + yyv1665[yyj1665] = NodeUtilization{} } else { - yyv1492 := &yyv1489[yyj1489] - yyv1492.CodecDecodeSelf(d) + yyv1668 := &yyv1665[yyj1665] + yyv1668.CodecDecodeSelf(d) } } else { @@ -18486,17 +20557,17 @@ func (x codecSelfer1234) decSliceNodeUtilization(v *[]NodeUtilization, d *codec1 } } - if yyj1489 < len(yyv1489) { - yyv1489 = yyv1489[:yyj1489] - yyc1489 = true - } else if yyj1489 == 0 && yyv1489 == nil { - yyv1489 = []NodeUtilization{} - yyc1489 = true + if yyj1665 < len(yyv1665) { + yyv1665 = yyv1665[:yyj1665] + yyc1665 = true + } else if yyj1665 == 0 && yyv1665 == nil { + yyv1665 = []NodeUtilization{} + yyc1665 = true } } - yyh1489.End() - if yyc1489 { - *v = yyv1489 + yyh1665.End() + if yyc1665 { + *v = yyv1665 } } @@ -18505,10 +20576,10 @@ func (x codecSelfer1234) encSliceClusterAutoscaler(v []ClusterAutoscaler, e *cod z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1493 := range v { + for _, yyv1669 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1494 := &yyv1493 - yy1494.CodecEncodeSelf(e) + yy1670 := &yyv1669 + yy1670.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18518,83 +20589,83 @@ func (x codecSelfer1234) decSliceClusterAutoscaler(v *[]ClusterAutoscaler, d *co z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1495 := *v - yyh1495, yyl1495 := z.DecSliceHelperStart() - var yyc1495 bool - if yyl1495 == 0 { - if yyv1495 == nil { - yyv1495 = []ClusterAutoscaler{} - yyc1495 = true - } else if len(yyv1495) != 0 { - yyv1495 = yyv1495[:0] - yyc1495 = true + yyv1671 := *v + yyh1671, yyl1671 := z.DecSliceHelperStart() + var yyc1671 bool + if yyl1671 == 0 { + if yyv1671 == nil { + yyv1671 = []ClusterAutoscaler{} + yyc1671 = true + } else if len(yyv1671) != 0 { + yyv1671 = yyv1671[:0] + yyc1671 = true } - } else if yyl1495 > 0 { - var yyrr1495, yyrl1495 int - var yyrt1495 bool - if yyl1495 > cap(yyv1495) { + } else if yyl1671 > 0 { + var yyrr1671, yyrl1671 int + var yyrt1671 bool + if yyl1671 > cap(yyv1671) { - yyrg1495 := len(yyv1495) > 0 - yyv21495 := yyv1495 - yyrl1495, yyrt1495 = z.DecInferLen(yyl1495, z.DecBasicHandle().MaxInitLen, 232) - if yyrt1495 { - if yyrl1495 <= cap(yyv1495) { - yyv1495 = yyv1495[:yyrl1495] + yyrg1671 := len(yyv1671) > 0 + yyv21671 := yyv1671 + yyrl1671, yyrt1671 = z.DecInferLen(yyl1671, z.DecBasicHandle().MaxInitLen, 232) + if yyrt1671 { + if yyrl1671 <= cap(yyv1671) { + yyv1671 = yyv1671[:yyrl1671] } else { - yyv1495 = make([]ClusterAutoscaler, yyrl1495) + yyv1671 = make([]ClusterAutoscaler, yyrl1671) } } else { - yyv1495 = make([]ClusterAutoscaler, yyrl1495) + yyv1671 = make([]ClusterAutoscaler, yyrl1671) } - yyc1495 = true - yyrr1495 = len(yyv1495) - if yyrg1495 { - copy(yyv1495, yyv21495) + yyc1671 = true + yyrr1671 = len(yyv1671) + if yyrg1671 { + copy(yyv1671, yyv21671) } - } else if yyl1495 != len(yyv1495) { - yyv1495 = yyv1495[:yyl1495] - yyc1495 = true + } else if yyl1671 != len(yyv1671) { + yyv1671 = yyv1671[:yyl1671] + yyc1671 = true } - yyj1495 := 0 - for ; yyj1495 < yyrr1495; yyj1495++ { - yyh1495.ElemContainerState(yyj1495) + yyj1671 := 0 + for ; yyj1671 < yyrr1671; yyj1671++ { + yyh1671.ElemContainerState(yyj1671) if r.TryDecodeAsNil() { - yyv1495[yyj1495] = ClusterAutoscaler{} + yyv1671[yyj1671] = ClusterAutoscaler{} } else { - yyv1496 := &yyv1495[yyj1495] - yyv1496.CodecDecodeSelf(d) + yyv1672 := &yyv1671[yyj1671] + yyv1672.CodecDecodeSelf(d) } } - if yyrt1495 { - for ; yyj1495 < yyl1495; yyj1495++ { - yyv1495 = append(yyv1495, ClusterAutoscaler{}) - yyh1495.ElemContainerState(yyj1495) + if yyrt1671 { + for ; yyj1671 < yyl1671; yyj1671++ { + yyv1671 = append(yyv1671, ClusterAutoscaler{}) + yyh1671.ElemContainerState(yyj1671) if r.TryDecodeAsNil() { - yyv1495[yyj1495] = ClusterAutoscaler{} + yyv1671[yyj1671] = ClusterAutoscaler{} } else { - yyv1497 := &yyv1495[yyj1495] - yyv1497.CodecDecodeSelf(d) + yyv1673 := &yyv1671[yyj1671] + yyv1673.CodecDecodeSelf(d) } } } } else { - yyj1495 := 0 - for ; !r.CheckBreak(); yyj1495++ { + yyj1671 := 0 + for ; !r.CheckBreak(); yyj1671++ { - if yyj1495 >= len(yyv1495) { - yyv1495 = append(yyv1495, ClusterAutoscaler{}) // var yyz1495 ClusterAutoscaler - yyc1495 = true + if yyj1671 >= len(yyv1671) { + yyv1671 = append(yyv1671, ClusterAutoscaler{}) // var yyz1671 ClusterAutoscaler + yyc1671 = true } - yyh1495.ElemContainerState(yyj1495) - if yyj1495 < len(yyv1495) { + yyh1671.ElemContainerState(yyj1671) + if yyj1671 < len(yyv1671) { if r.TryDecodeAsNil() { - yyv1495[yyj1495] = ClusterAutoscaler{} + yyv1671[yyj1671] = ClusterAutoscaler{} } else { - yyv1498 := &yyv1495[yyj1495] - yyv1498.CodecDecodeSelf(d) + yyv1674 := &yyv1671[yyj1671] + yyv1674.CodecDecodeSelf(d) } } else { @@ -18602,133 +20673,17 @@ func (x codecSelfer1234) decSliceClusterAutoscaler(v *[]ClusterAutoscaler, d *co } } - if yyj1495 < len(yyv1495) { - yyv1495 = yyv1495[:yyj1495] - yyc1495 = true - } else if yyj1495 == 0 && yyv1495 == nil { - yyv1495 = []ClusterAutoscaler{} - yyc1495 = true + if yyj1671 < len(yyv1671) { + yyv1671 = yyv1671[:yyj1671] + yyc1671 = true + } else if yyj1671 == 0 && yyv1671 == nil { + yyv1671 = []ClusterAutoscaler{} + yyc1671 = true } } - yyh1495.End() - if yyc1495 { - *v = yyv1495 - } -} - -func (x codecSelfer1234) encSliceLabelSelectorRequirement(v []LabelSelectorRequirement, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1499 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1500 := &yyv1499 - yy1500.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceLabelSelectorRequirement(v *[]LabelSelectorRequirement, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1501 := *v - yyh1501, yyl1501 := z.DecSliceHelperStart() - var yyc1501 bool - if yyl1501 == 0 { - if yyv1501 == nil { - yyv1501 = []LabelSelectorRequirement{} - yyc1501 = true - } else if len(yyv1501) != 0 { - yyv1501 = yyv1501[:0] - yyc1501 = true - } - } else if yyl1501 > 0 { - var yyrr1501, yyrl1501 int - var yyrt1501 bool - if yyl1501 > cap(yyv1501) { - - yyrg1501 := len(yyv1501) > 0 - yyv21501 := yyv1501 - yyrl1501, yyrt1501 = z.DecInferLen(yyl1501, z.DecBasicHandle().MaxInitLen, 56) - if yyrt1501 { - if yyrl1501 <= cap(yyv1501) { - yyv1501 = yyv1501[:yyrl1501] - } else { - yyv1501 = make([]LabelSelectorRequirement, yyrl1501) - } - } else { - yyv1501 = make([]LabelSelectorRequirement, yyrl1501) - } - yyc1501 = true - yyrr1501 = len(yyv1501) - if yyrg1501 { - copy(yyv1501, yyv21501) - } - } else if yyl1501 != len(yyv1501) { - yyv1501 = yyv1501[:yyl1501] - yyc1501 = true - } - yyj1501 := 0 - for ; yyj1501 < yyrr1501; yyj1501++ { - yyh1501.ElemContainerState(yyj1501) - if r.TryDecodeAsNil() { - yyv1501[yyj1501] = LabelSelectorRequirement{} - } else { - yyv1502 := &yyv1501[yyj1501] - yyv1502.CodecDecodeSelf(d) - } - - } - if yyrt1501 { - for ; yyj1501 < yyl1501; yyj1501++ { - yyv1501 = append(yyv1501, LabelSelectorRequirement{}) - yyh1501.ElemContainerState(yyj1501) - if r.TryDecodeAsNil() { - yyv1501[yyj1501] = LabelSelectorRequirement{} - } else { - yyv1503 := &yyv1501[yyj1501] - yyv1503.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1501 := 0 - for ; !r.CheckBreak(); yyj1501++ { - - if yyj1501 >= len(yyv1501) { - yyv1501 = append(yyv1501, LabelSelectorRequirement{}) // var yyz1501 LabelSelectorRequirement - yyc1501 = true - } - yyh1501.ElemContainerState(yyj1501) - if yyj1501 < len(yyv1501) { - if r.TryDecodeAsNil() { - yyv1501[yyj1501] = LabelSelectorRequirement{} - } else { - yyv1504 := &yyv1501[yyj1501] - yyv1504.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1501 < len(yyv1501) { - yyv1501 = yyv1501[:yyj1501] - yyc1501 = true - } else if yyj1501 == 0 && yyv1501 == nil { - yyv1501 = []LabelSelectorRequirement{} - yyc1501 = true - } - } - yyh1501.End() - if yyc1501 { - *v = yyv1501 + yyh1671.End() + if yyc1671 { + *v = yyv1671 } } @@ -18737,10 +20692,10 @@ func (x codecSelfer1234) encSliceReplicaSet(v []ReplicaSet, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1505 := range v { + for _, yyv1675 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1506 := &yyv1505 - yy1506.CodecEncodeSelf(e) + yy1676 := &yyv1675 + yy1676.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18750,83 +20705,83 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1507 := *v - yyh1507, yyl1507 := z.DecSliceHelperStart() - var yyc1507 bool - if yyl1507 == 0 { - if yyv1507 == nil { - yyv1507 = []ReplicaSet{} - yyc1507 = true - } else if len(yyv1507) != 0 { - yyv1507 = yyv1507[:0] - yyc1507 = true + yyv1677 := *v + yyh1677, yyl1677 := z.DecSliceHelperStart() + var yyc1677 bool + if yyl1677 == 0 { + if yyv1677 == nil { + yyv1677 = []ReplicaSet{} + yyc1677 = true + } else if len(yyv1677) != 0 { + yyv1677 = yyv1677[:0] + yyc1677 = true } - } else if yyl1507 > 0 { - var yyrr1507, yyrl1507 int - var yyrt1507 bool - if yyl1507 > cap(yyv1507) { + } else if yyl1677 > 0 { + var yyrr1677, yyrl1677 int + var yyrt1677 bool + if yyl1677 > cap(yyv1677) { - yyrg1507 := len(yyv1507) > 0 - yyv21507 := yyv1507 - yyrl1507, yyrt1507 = z.DecInferLen(yyl1507, z.DecBasicHandle().MaxInitLen, 232) - if yyrt1507 { - if yyrl1507 <= cap(yyv1507) { - yyv1507 = yyv1507[:yyrl1507] + yyrg1677 := len(yyv1677) > 0 + yyv21677 := yyv1677 + yyrl1677, yyrt1677 = z.DecInferLen(yyl1677, z.DecBasicHandle().MaxInitLen, 232) + if yyrt1677 { + if yyrl1677 <= cap(yyv1677) { + yyv1677 = yyv1677[:yyrl1677] } else { - yyv1507 = make([]ReplicaSet, yyrl1507) + yyv1677 = make([]ReplicaSet, yyrl1677) } } else { - yyv1507 = make([]ReplicaSet, yyrl1507) + yyv1677 = make([]ReplicaSet, yyrl1677) } - yyc1507 = true - yyrr1507 = len(yyv1507) - if yyrg1507 { - copy(yyv1507, yyv21507) + yyc1677 = true + yyrr1677 = len(yyv1677) + if yyrg1677 { + copy(yyv1677, yyv21677) } - } else if yyl1507 != len(yyv1507) { - yyv1507 = yyv1507[:yyl1507] - yyc1507 = true + } else if yyl1677 != len(yyv1677) { + yyv1677 = yyv1677[:yyl1677] + yyc1677 = true } - yyj1507 := 0 - for ; yyj1507 < yyrr1507; yyj1507++ { - yyh1507.ElemContainerState(yyj1507) + yyj1677 := 0 + for ; yyj1677 < yyrr1677; yyj1677++ { + yyh1677.ElemContainerState(yyj1677) if r.TryDecodeAsNil() { - yyv1507[yyj1507] = ReplicaSet{} + yyv1677[yyj1677] = ReplicaSet{} } else { - yyv1508 := &yyv1507[yyj1507] - yyv1508.CodecDecodeSelf(d) + yyv1678 := &yyv1677[yyj1677] + yyv1678.CodecDecodeSelf(d) } } - if yyrt1507 { - for ; yyj1507 < yyl1507; yyj1507++ { - yyv1507 = append(yyv1507, ReplicaSet{}) - yyh1507.ElemContainerState(yyj1507) + if yyrt1677 { + for ; yyj1677 < yyl1677; yyj1677++ { + yyv1677 = append(yyv1677, ReplicaSet{}) + yyh1677.ElemContainerState(yyj1677) if r.TryDecodeAsNil() { - yyv1507[yyj1507] = ReplicaSet{} + yyv1677[yyj1677] = ReplicaSet{} } else { - yyv1509 := &yyv1507[yyj1507] - yyv1509.CodecDecodeSelf(d) + yyv1679 := &yyv1677[yyj1677] + yyv1679.CodecDecodeSelf(d) } } } } else { - yyj1507 := 0 - for ; !r.CheckBreak(); yyj1507++ { + yyj1677 := 0 + for ; !r.CheckBreak(); yyj1677++ { - if yyj1507 >= len(yyv1507) { - yyv1507 = append(yyv1507, ReplicaSet{}) // var yyz1507 ReplicaSet - yyc1507 = true + if yyj1677 >= len(yyv1677) { + yyv1677 = append(yyv1677, ReplicaSet{}) // var yyz1677 ReplicaSet + yyc1677 = true } - yyh1507.ElemContainerState(yyj1507) - if yyj1507 < len(yyv1507) { + yyh1677.ElemContainerState(yyj1677) + if yyj1677 < len(yyv1677) { if r.TryDecodeAsNil() { - yyv1507[yyj1507] = ReplicaSet{} + yyv1677[yyj1677] = ReplicaSet{} } else { - yyv1510 := &yyv1507[yyj1507] - yyv1510.CodecDecodeSelf(d) + yyv1680 := &yyv1677[yyj1677] + yyv1680.CodecDecodeSelf(d) } } else { @@ -18834,16 +20789,584 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode } } - if yyj1507 < len(yyv1507) { - yyv1507 = yyv1507[:yyj1507] - yyc1507 = true - } else if yyj1507 == 0 && yyv1507 == nil { - yyv1507 = []ReplicaSet{} - yyc1507 = true + if yyj1677 < len(yyv1677) { + yyv1677 = yyv1677[:yyj1677] + yyc1677 = true + } else if yyj1677 == 0 && yyv1677 == nil { + yyv1677 = []ReplicaSet{} + yyc1677 = true } } - yyh1507.End() - if yyc1507 { - *v = yyv1507 + yyh1677.End() + if yyc1677 { + *v = yyv1677 + } +} + +func (x codecSelfer1234) encSliceapi_Capability(v []pkg2_api.Capability, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1681 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1682 := z.EncBinary() + _ = yym1682 + if false { + } else if z.HasExtensions() && z.EncExt(yyv1681) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(yyv1681)) + } + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceapi_Capability(v *[]pkg2_api.Capability, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1683 := *v + yyh1683, yyl1683 := z.DecSliceHelperStart() + var yyc1683 bool + if yyl1683 == 0 { + if yyv1683 == nil { + yyv1683 = []pkg2_api.Capability{} + yyc1683 = true + } else if len(yyv1683) != 0 { + yyv1683 = yyv1683[:0] + yyc1683 = true + } + } else if yyl1683 > 0 { + var yyrr1683, yyrl1683 int + var yyrt1683 bool + if yyl1683 > cap(yyv1683) { + + yyrl1683, yyrt1683 = z.DecInferLen(yyl1683, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1683 { + if yyrl1683 <= cap(yyv1683) { + yyv1683 = yyv1683[:yyrl1683] + } else { + yyv1683 = make([]pkg2_api.Capability, yyrl1683) + } + } else { + yyv1683 = make([]pkg2_api.Capability, yyrl1683) + } + yyc1683 = true + yyrr1683 = len(yyv1683) + } else if yyl1683 != len(yyv1683) { + yyv1683 = yyv1683[:yyl1683] + yyc1683 = true + } + yyj1683 := 0 + for ; yyj1683 < yyrr1683; yyj1683++ { + yyh1683.ElemContainerState(yyj1683) + if r.TryDecodeAsNil() { + yyv1683[yyj1683] = "" + } else { + yyv1683[yyj1683] = pkg2_api.Capability(r.DecodeString()) + } + + } + if yyrt1683 { + for ; yyj1683 < yyl1683; yyj1683++ { + yyv1683 = append(yyv1683, "") + yyh1683.ElemContainerState(yyj1683) + if r.TryDecodeAsNil() { + yyv1683[yyj1683] = "" + } else { + yyv1683[yyj1683] = pkg2_api.Capability(r.DecodeString()) + } + + } + } + + } else { + yyj1683 := 0 + for ; !r.CheckBreak(); yyj1683++ { + + if yyj1683 >= len(yyv1683) { + yyv1683 = append(yyv1683, "") // var yyz1683 pkg2_api.Capability + yyc1683 = true + } + yyh1683.ElemContainerState(yyj1683) + if yyj1683 < len(yyv1683) { + if r.TryDecodeAsNil() { + yyv1683[yyj1683] = "" + } else { + yyv1683[yyj1683] = pkg2_api.Capability(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj1683 < len(yyv1683) { + yyv1683 = yyv1683[:yyj1683] + yyc1683 = true + } else if yyj1683 == 0 && yyv1683 == nil { + yyv1683 = []pkg2_api.Capability{} + yyc1683 = true + } + } + yyh1683.End() + if yyc1683 { + *v = yyv1683 + } +} + +func (x codecSelfer1234) encSliceFSType(v []FSType, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1687 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yyv1687.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceFSType(v *[]FSType, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1688 := *v + yyh1688, yyl1688 := z.DecSliceHelperStart() + var yyc1688 bool + if yyl1688 == 0 { + if yyv1688 == nil { + yyv1688 = []FSType{} + yyc1688 = true + } else if len(yyv1688) != 0 { + yyv1688 = yyv1688[:0] + yyc1688 = true + } + } else if yyl1688 > 0 { + var yyrr1688, yyrl1688 int + var yyrt1688 bool + if yyl1688 > cap(yyv1688) { + + yyrl1688, yyrt1688 = z.DecInferLen(yyl1688, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1688 { + if yyrl1688 <= cap(yyv1688) { + yyv1688 = yyv1688[:yyrl1688] + } else { + yyv1688 = make([]FSType, yyrl1688) + } + } else { + yyv1688 = make([]FSType, yyrl1688) + } + yyc1688 = true + yyrr1688 = len(yyv1688) + } else if yyl1688 != len(yyv1688) { + yyv1688 = yyv1688[:yyl1688] + yyc1688 = true + } + yyj1688 := 0 + for ; yyj1688 < yyrr1688; yyj1688++ { + yyh1688.ElemContainerState(yyj1688) + if r.TryDecodeAsNil() { + yyv1688[yyj1688] = "" + } else { + yyv1688[yyj1688] = FSType(r.DecodeString()) + } + + } + if yyrt1688 { + for ; yyj1688 < yyl1688; yyj1688++ { + yyv1688 = append(yyv1688, "") + yyh1688.ElemContainerState(yyj1688) + if r.TryDecodeAsNil() { + yyv1688[yyj1688] = "" + } else { + yyv1688[yyj1688] = FSType(r.DecodeString()) + } + + } + } + + } else { + yyj1688 := 0 + for ; !r.CheckBreak(); yyj1688++ { + + if yyj1688 >= len(yyv1688) { + yyv1688 = append(yyv1688, "") // var yyz1688 FSType + yyc1688 = true + } + yyh1688.ElemContainerState(yyj1688) + if yyj1688 < len(yyv1688) { + if r.TryDecodeAsNil() { + yyv1688[yyj1688] = "" + } else { + yyv1688[yyj1688] = FSType(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj1688 < len(yyv1688) { + yyv1688 = yyv1688[:yyj1688] + yyc1688 = true + } else if yyj1688 == 0 && yyv1688 == nil { + yyv1688 = []FSType{} + yyc1688 = true + } + } + yyh1688.End() + if yyc1688 { + *v = yyv1688 + } +} + +func (x codecSelfer1234) encSliceHostPortRange(v []HostPortRange, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1692 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1693 := &yyv1692 + yy1693.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceHostPortRange(v *[]HostPortRange, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1694 := *v + yyh1694, yyl1694 := z.DecSliceHelperStart() + var yyc1694 bool + if yyl1694 == 0 { + if yyv1694 == nil { + yyv1694 = []HostPortRange{} + yyc1694 = true + } else if len(yyv1694) != 0 { + yyv1694 = yyv1694[:0] + yyc1694 = true + } + } else if yyl1694 > 0 { + var yyrr1694, yyrl1694 int + var yyrt1694 bool + if yyl1694 > cap(yyv1694) { + + yyrg1694 := len(yyv1694) > 0 + yyv21694 := yyv1694 + yyrl1694, yyrt1694 = z.DecInferLen(yyl1694, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1694 { + if yyrl1694 <= cap(yyv1694) { + yyv1694 = yyv1694[:yyrl1694] + } else { + yyv1694 = make([]HostPortRange, yyrl1694) + } + } else { + yyv1694 = make([]HostPortRange, yyrl1694) + } + yyc1694 = true + yyrr1694 = len(yyv1694) + if yyrg1694 { + copy(yyv1694, yyv21694) + } + } else if yyl1694 != len(yyv1694) { + yyv1694 = yyv1694[:yyl1694] + yyc1694 = true + } + yyj1694 := 0 + for ; yyj1694 < yyrr1694; yyj1694++ { + yyh1694.ElemContainerState(yyj1694) + if r.TryDecodeAsNil() { + yyv1694[yyj1694] = HostPortRange{} + } else { + yyv1695 := &yyv1694[yyj1694] + yyv1695.CodecDecodeSelf(d) + } + + } + if yyrt1694 { + for ; yyj1694 < yyl1694; yyj1694++ { + yyv1694 = append(yyv1694, HostPortRange{}) + yyh1694.ElemContainerState(yyj1694) + if r.TryDecodeAsNil() { + yyv1694[yyj1694] = HostPortRange{} + } else { + yyv1696 := &yyv1694[yyj1694] + yyv1696.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1694 := 0 + for ; !r.CheckBreak(); yyj1694++ { + + if yyj1694 >= len(yyv1694) { + yyv1694 = append(yyv1694, HostPortRange{}) // var yyz1694 HostPortRange + yyc1694 = true + } + yyh1694.ElemContainerState(yyj1694) + if yyj1694 < len(yyv1694) { + if r.TryDecodeAsNil() { + yyv1694[yyj1694] = HostPortRange{} + } else { + yyv1697 := &yyv1694[yyj1694] + yyv1697.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1694 < len(yyv1694) { + yyv1694 = yyv1694[:yyj1694] + yyc1694 = true + } else if yyj1694 == 0 && yyv1694 == nil { + yyv1694 = []HostPortRange{} + yyc1694 = true + } + } + yyh1694.End() + if yyc1694 { + *v = yyv1694 + } +} + +func (x codecSelfer1234) encSliceIDRange(v []IDRange, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1698 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1699 := &yyv1698 + yy1699.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceIDRange(v *[]IDRange, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1700 := *v + yyh1700, yyl1700 := z.DecSliceHelperStart() + var yyc1700 bool + if yyl1700 == 0 { + if yyv1700 == nil { + yyv1700 = []IDRange{} + yyc1700 = true + } else if len(yyv1700) != 0 { + yyv1700 = yyv1700[:0] + yyc1700 = true + } + } else if yyl1700 > 0 { + var yyrr1700, yyrl1700 int + var yyrt1700 bool + if yyl1700 > cap(yyv1700) { + + yyrg1700 := len(yyv1700) > 0 + yyv21700 := yyv1700 + yyrl1700, yyrt1700 = z.DecInferLen(yyl1700, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1700 { + if yyrl1700 <= cap(yyv1700) { + yyv1700 = yyv1700[:yyrl1700] + } else { + yyv1700 = make([]IDRange, yyrl1700) + } + } else { + yyv1700 = make([]IDRange, yyrl1700) + } + yyc1700 = true + yyrr1700 = len(yyv1700) + if yyrg1700 { + copy(yyv1700, yyv21700) + } + } else if yyl1700 != len(yyv1700) { + yyv1700 = yyv1700[:yyl1700] + yyc1700 = true + } + yyj1700 := 0 + for ; yyj1700 < yyrr1700; yyj1700++ { + yyh1700.ElemContainerState(yyj1700) + if r.TryDecodeAsNil() { + yyv1700[yyj1700] = IDRange{} + } else { + yyv1701 := &yyv1700[yyj1700] + yyv1701.CodecDecodeSelf(d) + } + + } + if yyrt1700 { + for ; yyj1700 < yyl1700; yyj1700++ { + yyv1700 = append(yyv1700, IDRange{}) + yyh1700.ElemContainerState(yyj1700) + if r.TryDecodeAsNil() { + yyv1700[yyj1700] = IDRange{} + } else { + yyv1702 := &yyv1700[yyj1700] + yyv1702.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1700 := 0 + for ; !r.CheckBreak(); yyj1700++ { + + if yyj1700 >= len(yyv1700) { + yyv1700 = append(yyv1700, IDRange{}) // var yyz1700 IDRange + yyc1700 = true + } + yyh1700.ElemContainerState(yyj1700) + if yyj1700 < len(yyv1700) { + if r.TryDecodeAsNil() { + yyv1700[yyj1700] = IDRange{} + } else { + yyv1703 := &yyv1700[yyj1700] + yyv1703.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1700 < len(yyv1700) { + yyv1700 = yyv1700[:yyj1700] + yyc1700 = true + } else if yyj1700 == 0 && yyv1700 == nil { + yyv1700 = []IDRange{} + yyc1700 = true + } + } + yyh1700.End() + if yyc1700 { + *v = yyv1700 + } +} + +func (x codecSelfer1234) encSlicePodSecurityPolicy(v []PodSecurityPolicy, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1704 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1705 := &yyv1704 + yy1705.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePodSecurityPolicy(v *[]PodSecurityPolicy, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1706 := *v + yyh1706, yyl1706 := z.DecSliceHelperStart() + var yyc1706 bool + if yyl1706 == 0 { + if yyv1706 == nil { + yyv1706 = []PodSecurityPolicy{} + yyc1706 = true + } else if len(yyv1706) != 0 { + yyv1706 = yyv1706[:0] + yyc1706 = true + } + } else if yyl1706 > 0 { + var yyrr1706, yyrl1706 int + var yyrt1706 bool + if yyl1706 > cap(yyv1706) { + + yyrg1706 := len(yyv1706) > 0 + yyv21706 := yyv1706 + yyrl1706, yyrt1706 = z.DecInferLen(yyl1706, z.DecBasicHandle().MaxInitLen, 352) + if yyrt1706 { + if yyrl1706 <= cap(yyv1706) { + yyv1706 = yyv1706[:yyrl1706] + } else { + yyv1706 = make([]PodSecurityPolicy, yyrl1706) + } + } else { + yyv1706 = make([]PodSecurityPolicy, yyrl1706) + } + yyc1706 = true + yyrr1706 = len(yyv1706) + if yyrg1706 { + copy(yyv1706, yyv21706) + } + } else if yyl1706 != len(yyv1706) { + yyv1706 = yyv1706[:yyl1706] + yyc1706 = true + } + yyj1706 := 0 + for ; yyj1706 < yyrr1706; yyj1706++ { + yyh1706.ElemContainerState(yyj1706) + if r.TryDecodeAsNil() { + yyv1706[yyj1706] = PodSecurityPolicy{} + } else { + yyv1707 := &yyv1706[yyj1706] + yyv1707.CodecDecodeSelf(d) + } + + } + if yyrt1706 { + for ; yyj1706 < yyl1706; yyj1706++ { + yyv1706 = append(yyv1706, PodSecurityPolicy{}) + yyh1706.ElemContainerState(yyj1706) + if r.TryDecodeAsNil() { + yyv1706[yyj1706] = PodSecurityPolicy{} + } else { + yyv1708 := &yyv1706[yyj1706] + yyv1708.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1706 := 0 + for ; !r.CheckBreak(); yyj1706++ { + + if yyj1706 >= len(yyv1706) { + yyv1706 = append(yyv1706, PodSecurityPolicy{}) // var yyz1706 PodSecurityPolicy + yyc1706 = true + } + yyh1706.ElemContainerState(yyj1706) + if yyj1706 < len(yyv1706) { + if r.TryDecodeAsNil() { + yyv1706[yyj1706] = PodSecurityPolicy{} + } else { + yyv1709 := &yyv1706[yyj1706] + yyv1709.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1706 < len(yyv1706) { + yyv1706 = yyv1706[:yyj1706] + yyc1706 = true + } else if yyj1706 == 0 && yyv1706 == nil { + yyv1706 = []PodSecurityPolicy{} + yyc1706 = true + } + } + yyh1706.End() + if yyc1706 { + *v = yyv1706 } } diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go index 142d8e52f69..f6c0c0cafad 100644 --- a/pkg/apis/extensions/types.go +++ b/pkg/apis/extensions/types.go @@ -233,9 +233,9 @@ type DeploymentSpec struct { // zero and not specified. Defaults to 1. Replicas int `json:"replicas,omitempty"` - // Label selector for pods. Existing ReplicationControllers whose pods are + // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. - Selector map[string]string `json:"selector,omitempty"` + Selector *unversioned.LabelSelector `json:"selector,omitempty"` // Template describes the pods that will be created. Template api.PodTemplateSpec `json:"template"` @@ -243,20 +243,15 @@ type DeploymentSpec struct { // The deployment strategy to use to replace existing pods with new ones. Strategy DeploymentStrategy `json:"strategy,omitempty"` - // The number of old ReplicationControllers to retain to allow rollback. + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing, for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + MinReadySeconds int `json:"minReadySeconds,omitempty"` + + // The number of old ReplicaSets to retain to allow rollback. // This is a pointer to distinguish between explicit zero and not specified. RevisionHistoryLimit *int `json:"revisionHistoryLimit,omitempty"` - // Key of the selector that is added to existing RCs (and label key that is - // added to its pods) to prevent the existing RCs to select new pods (and old - // pods being selected by new RC). - // Users can set this to an empty string to indicate that the system should - // not add any selector and label. If unspecified, system uses - // DefaultDeploymentUniqueLabelKey("deployment.kubernetes.io/podTemplateHash"). - // Value of this key is hash of DeploymentSpec.PodTemplateSpec. - // No label is added if this is set to empty string. - UniqueLabelKey string `json:"uniqueLabelKey,omitempty"` - // Indicates that the deployment is paused and will not be processed by the // deployment controller. Paused bool `json:"paused,omitempty"` @@ -283,9 +278,8 @@ type RollbackConfig struct { const ( // DefaultDeploymentUniqueLabelKey is the default key of the selector that is added // to existing RCs (and label key that is added to its pods) to prevent the existing RCs - // to select new pods (and old pods being select by new RC). See DeploymentSpec's UniqueLabelKey - // field for more information. - DefaultDeploymentUniqueLabelKey string = "deployment.kubernetes.io/podTemplateHash" + // to select new pods (and old pods being select by new RC). + DefaultDeploymentUniqueLabelKey string = "pod-template-hash" ) type DeploymentStrategy struct { @@ -335,11 +329,6 @@ type RollingUpdateDeployment struct { // new RC can be scaled up further, ensuring that total number of pods running // at any time during the update is atmost 130% of original pods. MaxSurge intstr.IntOrString `json:"maxSurge,omitempty"` - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - MinReadySeconds int `json:"minReadySeconds,omitempty"` } type DeploymentStatus struct { @@ -413,7 +402,7 @@ type DaemonSetSpec struct { // Must match in order to be controlled. // If empty, defaulted to labels on Pod template. // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors - Selector *LabelSelector `json:"selector,omitempty"` + Selector *unversioned.LabelSelector `json:"selector,omitempty"` // Template is the object that describes the pod that will be created. // The DaemonSet will create exactly one copy of this pod on every node @@ -545,7 +534,7 @@ type JobSpec struct { ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` // Selector is a label query over pods that should match the pod count. - Selector *LabelSelector `json:"selector,omitempty"` + Selector *unversioned.LabelSelector `json:"selector,omitempty"` // Template is the object that describes the pod that will be created when // executing a job. @@ -643,12 +632,35 @@ type IngressSpec struct { // is optional to allow the loadbalancer controller or defaulting logic to // specify a global default. Backend *IngressBackend `json:"backend,omitempty"` + + // TLS is the TLS configuration. Currently the Ingress only supports a single TLS + // port, 443, and assumes TLS termination. If multiple members of this + // list specify different hosts, they will be multiplexed on the same + // port according to the hostname specified through the SNI TLS extension. + TLS []IngressTLS `json:"tls,omitempty"` + // A list of host rules used to configure the Ingress. If unspecified, or // no rule matches, all traffic is sent to the default backend. Rules []IngressRule `json:"rules,omitempty"` // TODO: Add the ability to specify load-balancer IP through claims } +// IngressTLS describes the transport layer security associated with an Ingress. +type IngressTLS struct { + // Hosts are a list of hosts included in the TLS certificate. The values in + // this list must match the name/s used in the tlsSecret. Defaults to the + // wildcard host setting for the loadbalancer controller fulfilling this + // Ingress, if left unspecified. + Hosts []string `json:"hosts,omitempty"` + // SecretName is the name of the secret used to terminate SSL traffic on 443. + // Field is left optional to allow SSL routing based on SNI hostname alone. + // If the SNI host in a listener conflicts with the "Host" header field used + // by an IngressRule, the SNI host is used for termination and value of the + // Host header is used for routing. + SecretName string `json:"secretName,omitempty"` + // TODO: Consider specifying different modes of termination, protocols etc. +} + // IngressStatus describe the current state of the Ingress. type IngressStatus struct { // LoadBalancer contains the current status of the load-balancer. @@ -793,43 +805,6 @@ type ClusterAutoscalerList struct { Items []ClusterAutoscaler `json:"items"` } -// A label selector is a label query over a set of resources. The result of matchLabels and -// matchExpressions are ANDed. An empty label selector matches all objects. A null -// label selector matches no objects. -type LabelSelector struct { - // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - // map is equivalent to an element of matchExpressions, whose key field is "key", the - // operator is "In", and the values array contains only "value". The requirements are ANDed. - MatchLabels map[string]string `json:"matchLabels,omitempty"` - // matchExpressions is a list of label selector requirements. The requirements are ANDed. - MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty"` -} - -// A label selector requirement is a selector that contains values, a key, and an operator that -// relates the key and values. -type LabelSelectorRequirement struct { - // key is the label key that the selector applies to. - Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` - // operator represents a key's relationship to a set of values. - // Valid operators ard In, NotIn, Exists and DoesNotExist. - Operator LabelSelectorOperator `json:"operator"` - // values is an array of string values. If the operator is In or NotIn, - // the values array must be non-empty. If the operator is Exists or DoesNotExist, - // the values array must be empty. This array is replaced during a strategic - // merge patch. - Values []string `json:"values,omitempty"` -} - -// A label selector operator is the set of operators that can be used in a selector requirement. -type LabelSelectorOperator string - -const ( - LabelSelectorOpIn LabelSelectorOperator = "In" - LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" - LabelSelectorOpExists LabelSelectorOperator = "Exists" - LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" -) - // +genclient=true // ReplicaSet represents the configuration of a replica set. @@ -864,7 +839,7 @@ type ReplicaSetSpec struct { // Must match in order to be controlled. // If empty, defaulted to labels on pod template. // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors - Selector *LabelSelector `json:"selector,omitempty"` + Selector *unversioned.LabelSelector `json:"selector,omitempty"` // Template is the object that describes the pod that will be created if // insufficient replicas are detected. @@ -879,3 +854,123 @@ type ReplicaSetStatus struct { // ObservedGeneration is the most recent generation observed by the controller. ObservedGeneration int64 `json:"observedGeneration,omitempty"` } + +// PodSecurityPolicy governs the ability to make requests that affect the SecurityContext +// that will be applied to a pod and container. +type PodSecurityPolicy struct { + unversioned.TypeMeta `json:",inline"` + api.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the policy enforced. + Spec PodSecurityPolicySpec `json:"spec,omitempty"` +} + +// PodSecurityPolicySpec defines the policy enforced. +type PodSecurityPolicySpec struct { + // Privileged determines if a pod can request to be run as privileged. + Privileged bool `json:"privileged,omitempty"` + // Capabilities is a list of capabilities that can be added. + Capabilities []api.Capability `json:"capabilities,omitempty"` + // Volumes is a white list of allowed volume plugins. Empty indicates that all plugins + // may be used. + Volumes []FSType `json:"volumes,omitempty"` + // HostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + HostNetwork bool `json:"hostNetwork,omitempty"` + // HostPorts determines which host port ranges are allowed to be exposed. + HostPorts []HostPortRange `json:"hostPorts,omitempty"` + // HostPID determines if the policy allows the use of HostPID in the pod spec. + HostPID bool `json:"hostPID,omitempty"` + // HostIPC determines if the policy allows the use of HostIPC in the pod spec. + HostIPC bool `json:"hostIPC,omitempty"` + // SELinuxContext is the strategy that will dictate the allowable labels that may be set. + SELinuxContext SELinuxContextStrategyOptions `json:"seLinuxContext,omitempty"` + // RunAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + RunAsUser RunAsUserStrategyOptions `json:"runAsUser,omitempty"` +} + +// HostPortRange defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +type HostPortRange struct { + // Min is the start of the range, inclusive. + Min int `json:"min"` + // Max is the end of the range, inclusive. + Max int `json:"max"` +} + +// FSType gives strong typing to different file systems that are used by volumes. +type FSType string + +var ( + HostPath FSType = "hostPath" + EmptyDir FSType = "emptyDir" + GCEPersistentDisk FSType = "gcePersistentDisk" + AWSElasticBlockStore FSType = "awsElasticBlockStore" + GitRepo FSType = "gitRepo" + Secret FSType = "secret" + NFS FSType = "nfs" + ISCSI FSType = "iscsi" + Glusterfs FSType = "glusterfs" + PersistentVolumeClaim FSType = "persistentVolumeClaim" + RBD FSType = "rbd" + Cinder FSType = "cinder" + CephFS FSType = "cephFS" + DownwardAPI FSType = "downwardAPI" + FC FSType = "fc" +) + +// SELinuxContextStrategyOptions defines the strategy type and any options used to create the strategy. +type SELinuxContextStrategyOptions struct { + // Type is the strategy that will dictate the allowable labels that may be set. + Type SELinuxContextStrategy `json:"type"` + // seLinuxOptions required to run as; required for MustRunAs + // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context + SELinuxOptions *api.SELinuxOptions `json:"seLinuxOptions,omitempty"` +} + +// SELinuxContextStrategyType denotes strategy types for generating SELinux options for a +// SecurityContext. +type SELinuxContextStrategy string + +const ( + // container must have SELinux labels of X applied. + SELinuxStrategyMustRunAs SELinuxContextStrategy = "MustRunAs" + // container may make requests for any SELinux context labels. + SELinuxStrategyRunAsAny SELinuxContextStrategy = "RunAsAny" +) + +// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. +type RunAsUserStrategyOptions struct { + // Type is the strategy that will dictate the allowable RunAsUser values that may be set. + Type RunAsUserStrategy `json:"type"` + // Ranges are the allowed ranges of uids that may be used. + Ranges []IDRange `json:"ranges,omitempty"` +} + +// IDRange provides a min/max of an allowed range of IDs. +type IDRange struct { + // Min is the start of the range, inclusive. + Min int64 `json:"min"` + // Max is the end of the range, inclusive. + Max int64 `json:"max"` +} + +// RunAsUserStrategyType denotes strategy types for generating RunAsUser values for a +// SecurityContext. +type RunAsUserStrategy string + +const ( + // container must run as a particular uid. + RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs" + // container must run as a non-root uid + RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot" + // container may make requests for any uid. + RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny" +) + +// PodSecurityPolicyList is a list of PodSecurityPolicy objects. +type PodSecurityPolicyList struct { + unversioned.TypeMeta `json:",inline"` + unversioned.ListMeta `json:"metadata,omitempty"` + + Items []PodSecurityPolicy `json:"items"` +} diff --git a/pkg/apis/extensions/v1beta1/conversion.go b/pkg/apis/extensions/v1beta1/conversion.go index 330e34e911c..68eaba419e1 100644 --- a/pkg/apis/extensions/v1beta1/conversion.go +++ b/pkg/apis/extensions/v1beta1/conversion.go @@ -21,6 +21,7 @@ import ( "reflect" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" v1 "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/conversion" @@ -89,155 +90,11 @@ func addConversionFuncs(scheme *runtime.Scheme) { // for the generated functions to work properly. // This should be fixed: https://github.com/kubernetes/kubernetes/issues/12977 func Convert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *v1.PodSpec, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*api.PodSpec))(in) - } - if in.Volumes != nil { - out.Volumes = make([]v1.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.Containers != nil { - out.Containers = make([]v1.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 - } - out.RestartPolicy = v1.RestartPolicy(in.RestartPolicy) - if in.TerminationGracePeriodSeconds != nil { - out.TerminationGracePeriodSeconds = new(int64) - *out.TerminationGracePeriodSeconds = *in.TerminationGracePeriodSeconds - } else { - out.TerminationGracePeriodSeconds = nil - } - if in.ActiveDeadlineSeconds != nil { - out.ActiveDeadlineSeconds = new(int64) - *out.ActiveDeadlineSeconds = *in.ActiveDeadlineSeconds - } else { - out.ActiveDeadlineSeconds = nil - } - out.DNSPolicy = v1.DNSPolicy(in.DNSPolicy) - if in.NodeSelector != nil { - out.NodeSelector = make(map[string]string) - for key, val := range in.NodeSelector { - out.NodeSelector[key] = val - } - } else { - out.NodeSelector = nil - } - 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(v1.PodSecurityContext) - if err := Convert_api_PodSecurityContext_To_v1_PodSecurityContext(in.SecurityContext, out.SecurityContext, s); err != nil { - return err - } - - out.HostNetwork = in.SecurityContext.HostNetwork - out.HostPID = in.SecurityContext.HostPID - out.HostIPC = in.SecurityContext.HostIPC - } - if in.ImagePullSecrets != nil { - out.ImagePullSecrets = make([]v1.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 - } - return nil + return v1.Convert_api_PodSpec_To_v1_PodSpec(in, out, s) } func Convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*v1.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 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) - if in.TerminationGracePeriodSeconds != nil { - out.TerminationGracePeriodSeconds = new(int64) - *out.TerminationGracePeriodSeconds = *in.TerminationGracePeriodSeconds - } else { - out.TerminationGracePeriodSeconds = nil - } - if in.ActiveDeadlineSeconds != nil { - out.ActiveDeadlineSeconds = new(int64) - *out.ActiveDeadlineSeconds = *in.ActiveDeadlineSeconds - } else { - out.ActiveDeadlineSeconds = nil - } - out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) - if in.NodeSelector != nil { - out.NodeSelector = make(map[string]string) - for key, val := range in.NodeSelector { - out.NodeSelector[key] = val - } - } else { - out.NodeSelector = nil - } - // 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 - } - } - if out.SecurityContext == nil { - out.SecurityContext = new(api.PodSecurityContext) - } - 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 - } - return nil + return v1.Convert_v1_PodSpec_To_api_PodSpec(in, out, s) } func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error { @@ -247,14 +104,14 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions. out.Replicas = new(int32) *out.Replicas = int32(in.Replicas) if in.Selector != nil { - out.Selector = make(map[string]string) - for key, val := range in.Selector { - out.Selector[key] = val + out.Selector = new(LabelSelector) + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + return err } } else { out.Selector = nil } - if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if err := Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { @@ -264,8 +121,7 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions. out.RevisionHistoryLimit = new(int32) *out.RevisionHistoryLimit = int32(*in.RevisionHistoryLimit) } - out.UniqueLabelKey = new(string) - *out.UniqueLabelKey = in.UniqueLabelKey + out.MinReadySeconds = int32(in.MinReadySeconds) out.Paused = in.Paused if in.RollbackTo != nil { out.RollbackTo = new(RollbackConfig) @@ -283,15 +139,16 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS if in.Replicas != nil { out.Replicas = int(*in.Replicas) } + if in.Selector != nil { - out.Selector = make(map[string]string) - for key, val := range in.Selector { - out.Selector[key] = val + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { + return err } } else { out.Selector = nil } - if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if err := Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { @@ -301,9 +158,7 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS out.RevisionHistoryLimit = new(int) *out.RevisionHistoryLimit = int(*in.RevisionHistoryLimit) } - if in.UniqueLabelKey != nil { - out.UniqueLabelKey = *in.UniqueLabelKey - } + out.MinReadySeconds = int(in.MinReadySeconds) out.Paused = in.Paused if in.RollbackTo != nil { out.RollbackTo = new(extensions.RollbackConfig) @@ -362,7 +217,6 @@ func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployme if err := s.Convert(&in.MaxSurge, out.MaxSurge, 0); err != nil { return err } - out.MinReadySeconds = int32(in.MinReadySeconds) return nil } @@ -376,77 +230,6 @@ func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme if err := s.Convert(in.MaxSurge, &out.MaxSurge, 0); err != nil { return err } - out.MinReadySeconds = int(in.MinReadySeconds) - return nil -} - -func Convert_api_PodSecurityContext_To_v1_PodSecurityContext(in *api.PodSecurityContext, out *v1.PodSecurityContext, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*api.PodSecurityContext))(in) - } - - out.SupplementalGroups = in.SupplementalGroups - if in.SELinuxOptions != nil { - out.SELinuxOptions = new(v1.SELinuxOptions) - if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - out.RunAsUser = new(int64) - *out.RunAsUser = *in.RunAsUser - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - out.RunAsNonRoot = new(bool) - *out.RunAsNonRoot = *in.RunAsNonRoot - } else { - out.RunAsNonRoot = nil - } - if in.FSGroup != nil { - out.FSGroup = new(int64) - *out.FSGroup = *in.FSGroup - } else { - out.FSGroup = nil - } - return nil -} - -func Convert_v1_PodSecurityContext_To_api_PodSecurityContext(in *v1.PodSecurityContext, out *api.PodSecurityContext, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*v1.PodSecurityContext))(in) - } - - out.SupplementalGroups = in.SupplementalGroups - if in.SELinuxOptions != nil { - out.SELinuxOptions = new(api.SELinuxOptions) - if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - out.RunAsUser = new(int64) - *out.RunAsUser = *in.RunAsUser - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - out.RunAsNonRoot = new(bool) - *out.RunAsNonRoot = *in.RunAsNonRoot - } else { - out.RunAsNonRoot = nil - } - if in.FSGroup != nil { - out.FSGroup = new(int64) - *out.FSGroup = *in.FSGroup - } else { - out.FSGroup = nil - } return nil } @@ -454,16 +237,16 @@ func Convert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in *extensions.Da if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.DaemonSetSpec))(in) } - // unable to generate simple pointer conversion for extensions.LabelSelector -> v1beta1.LabelSelector + // unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector if in.Selector != nil { out.Selector = new(LabelSelector) - if err := Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { out.Selector = nil } - if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if err := Convert_extensions_DaemonSetUpdateStrategy_To_v1beta1_DaemonSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil { @@ -478,16 +261,16 @@ func Convert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSetSpec if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*DaemonSetSpec))(in) } - // unable to generate simple pointer conversion for v1beta1.LabelSelector -> extensions.LabelSelector + // unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector if in.Selector != nil { - out.Selector = new(extensions.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in.Selector, out.Selector, s); err != nil { + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { out.Selector = nil } - if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if err := Convert_v1beta1_DaemonSetUpdateStrategy_To_extensions_DaemonSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil { @@ -564,7 +347,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions. *out.Replicas = int32(in.Replicas) if in.Selector != nil { out.Selector = new(LabelSelector) - if err := Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -572,7 +355,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions. } if in.Template != nil { out.Template = new(v1.PodTemplateSpec) - if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in.Template, out.Template, s); err != nil { + if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in.Template, out.Template, s); err != nil { return err } } else { @@ -589,8 +372,8 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS out.Replicas = int(*in.Replicas) } if in.Selector != nil { - out.Selector = new(extensions.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in.Selector, out.Selector, s); err != nil { + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -598,7 +381,7 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS } if in.Template != nil { out.Template = new(api.PodTemplateSpec) - if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil { + if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil { return err } } else { diff --git a/pkg/apis/extensions/v1beta1/conversion_generated.go b/pkg/apis/extensions/v1beta1/conversion_generated.go index 29afdcf664d..7c18bcd5779 100644 --- a/pkg/apis/extensions/v1beta1/conversion_generated.go +++ b/pkg/apis/extensions/v1beta1/conversion_generated.go @@ -44,6 +44,20 @@ func Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolu return autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in, out, s) } +func autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *v1.AzureFileVolumeSource, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*api.AzureFileVolumeSource))(in) + } + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + +func Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *v1.AzureFileVolumeSource, s conversion.Scope) error { + return autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in, out, s) +} + func autoConvert_api_Capabilities_To_v1_Capabilities(in *api.Capabilities, out *v1.Capabilities, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*api.Capabilities))(in) @@ -502,6 +516,16 @@ func autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, ou } out.Host = in.Host out.Scheme = v1.URIScheme(in.Scheme) + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]v1.HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := Convert_api_HTTPHeader_To_v1_HTTPHeader(&in.HTTPHeaders[i], &out.HTTPHeaders[i], s); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } return nil } @@ -509,6 +533,19 @@ func Convert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, out *v return autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in, out, s) } +func autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *v1.HTTPHeader, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*api.HTTPHeader))(in) + } + out.Name = in.Name + out.Value = in.Value + return nil +} + +func Convert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *v1.HTTPHeader, s conversion.Scope) error { + return autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in, out, s) +} + func autoConvert_api_Handler_To_v1_Handler(in *api.Handler, out *v1.Handler, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*api.Handler))(in) @@ -1234,6 +1271,15 @@ func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out * } else { out.FC = nil } + // unable to generate simple pointer conversion for api.AzureFileVolumeSource -> v1.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(v1.AzureFileVolumeSource) + if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -1241,6 +1287,56 @@ func Convert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *v1.V return autoConvert_api_VolumeSource_To_v1_VolumeSource(in, out, s) } +func autoConvert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*unversioned.LabelSelector))(in) + } + if in.MatchLabels != nil { + out.MatchLabels = make(map[string]string) + for key, val := range in.MatchLabels { + out.MatchLabels[key] = val + } + } else { + out.MatchLabels = nil + } + if in.MatchExpressions != nil { + out.MatchExpressions = make([]LabelSelectorRequirement, len(in.MatchExpressions)) + for i := range in.MatchExpressions { + if err := Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(&in.MatchExpressions[i], &out.MatchExpressions[i], s); err != nil { + return err + } + } + } else { + out.MatchExpressions = nil + } + return nil +} + +func Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { + return autoConvert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in, out, s) +} + +func autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*unversioned.LabelSelectorRequirement))(in) + } + out.Key = in.Key + out.Operator = LabelSelectorOperator(in.Operator) + if in.Values != nil { + out.Values = make([]string, len(in.Values)) + for i := range in.Values { + out.Values[i] = in.Values[i] + } + } else { + out.Values = nil + } + return nil +} + +func Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { + return autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in, out, s) +} + func autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *v1.AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*v1.AWSElasticBlockStoreVolumeSource))(in) @@ -1256,6 +1352,20 @@ func Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolu return autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in, out, s) } +func autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *v1.AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*v1.AzureFileVolumeSource))(in) + } + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + +func Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *v1.AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { + return autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in, out, s) +} + func autoConvert_v1_Capabilities_To_api_Capabilities(in *v1.Capabilities, out *api.Capabilities, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*v1.Capabilities))(in) @@ -1714,6 +1824,16 @@ func autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in *v1.HTTPGetAction, out } out.Host = in.Host out.Scheme = api.URIScheme(in.Scheme) + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]api.HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := Convert_v1_HTTPHeader_To_api_HTTPHeader(&in.HTTPHeaders[i], &out.HTTPHeaders[i], s); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } return nil } @@ -1721,6 +1841,19 @@ func Convert_v1_HTTPGetAction_To_api_HTTPGetAction(in *v1.HTTPGetAction, out *ap return autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in, out, s) } +func autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in *v1.HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*v1.HTTPHeader))(in) + } + out.Name = in.Name + out.Value = in.Value + return nil +} + +func Convert_v1_HTTPHeader_To_api_HTTPHeader(in *v1.HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { + return autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in, out, s) +} + func autoConvert_v1_Handler_To_api_Handler(in *v1.Handler, out *api.Handler, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*v1.Handler))(in) @@ -2422,6 +2555,15 @@ func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *v1.VolumeSource, out *a } else { out.FC = nil } + // unable to generate simple pointer conversion for v1.AzureFileVolumeSource -> api.AzureFileVolumeSource + if in.AzureFile != nil { + out.AzureFile = new(api.AzureFileVolumeSource) + if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in.AzureFile, out.AzureFile, s); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -2578,10 +2720,10 @@ func autoConvert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in *extension if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.DaemonSetSpec))(in) } - // unable to generate simple pointer conversion for extensions.LabelSelector -> v1beta1.LabelSelector + // unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector if in.Selector != nil { out.Selector = new(LabelSelector) - if err := Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -2713,10 +2855,11 @@ func autoConvert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensi if err := s.Convert(&in.Replicas, &out.Replicas, 0); err != nil { return err } + // unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector if in.Selector != nil { - out.Selector = make(map[string]string) - for key, val := range in.Selector { - out.Selector[key] = val + out.Selector = new(LabelSelector) + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + return err } } else { out.Selector = nil @@ -2727,15 +2870,13 @@ func autoConvert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensi if err := Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { return err } + out.MinReadySeconds = int32(in.MinReadySeconds) if in.RevisionHistoryLimit != nil { out.RevisionHistoryLimit = new(int32) *out.RevisionHistoryLimit = int32(*in.RevisionHistoryLimit) } else { out.RevisionHistoryLimit = nil } - if err := api.Convert_string_To_string_ref(&in.UniqueLabelKey, &out.UniqueLabelKey, s); err != nil { - return err - } out.Paused = in.Paused // unable to generate simple pointer conversion for extensions.RollbackConfig -> v1beta1.RollbackConfig if in.RollbackTo != nil { @@ -2931,6 +3072,32 @@ func Convert_extensions_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAu return autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(in, out, s) } +func autoConvert_extensions_HostPortRange_To_v1beta1_HostPortRange(in *extensions.HostPortRange, out *HostPortRange, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.HostPortRange))(in) + } + out.Min = int32(in.Min) + out.Max = int32(in.Max) + return nil +} + +func Convert_extensions_HostPortRange_To_v1beta1_HostPortRange(in *extensions.HostPortRange, out *HostPortRange, s conversion.Scope) error { + return autoConvert_extensions_HostPortRange_To_v1beta1_HostPortRange(in, out, s) +} + +func autoConvert_extensions_IDRange_To_v1beta1_IDRange(in *extensions.IDRange, out *IDRange, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.IDRange))(in) + } + out.Min = in.Min + out.Max = in.Max + return nil +} + +func Convert_extensions_IDRange_To_v1beta1_IDRange(in *extensions.IDRange, out *IDRange, s conversion.Scope) error { + return autoConvert_extensions_IDRange_To_v1beta1_IDRange(in, out, s) +} + func autoConvert_extensions_Ingress_To_v1beta1_Ingress(in *extensions.Ingress, out *Ingress, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.Ingress))(in) @@ -3044,6 +3211,16 @@ func autoConvert_extensions_IngressSpec_To_v1beta1_IngressSpec(in *extensions.In } else { out.Backend = nil } + if in.TLS != nil { + out.TLS = make([]IngressTLS, len(in.TLS)) + for i := range in.TLS { + if err := Convert_extensions_IngressTLS_To_v1beta1_IngressTLS(&in.TLS[i], &out.TLS[i], s); err != nil { + return err + } + } + } else { + out.TLS = nil + } if in.Rules != nil { out.Rules = make([]IngressRule, len(in.Rules)) for i := range in.Rules { @@ -3075,6 +3252,26 @@ func Convert_extensions_IngressStatus_To_v1beta1_IngressStatus(in *extensions.In return autoConvert_extensions_IngressStatus_To_v1beta1_IngressStatus(in, out, s) } +func autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS(in *extensions.IngressTLS, out *IngressTLS, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.IngressTLS))(in) + } + if in.Hosts != nil { + out.Hosts = make([]string, len(in.Hosts)) + for i := range in.Hosts { + out.Hosts[i] = in.Hosts[i] + } + } else { + out.Hosts = nil + } + out.SecretName = in.SecretName + return nil +} + +func Convert_extensions_IngressTLS_To_v1beta1_IngressTLS(in *extensions.IngressTLS, out *IngressTLS, s conversion.Scope) error { + return autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS(in, out, s) +} + func autoConvert_extensions_Job_To_v1beta1_Job(in *extensions.Job, out *Job, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.Job))(in) @@ -3168,10 +3365,10 @@ func autoConvert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, o } else { out.ActiveDeadlineSeconds = nil } - // unable to generate simple pointer conversion for extensions.LabelSelector -> v1beta1.LabelSelector + // unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector if in.Selector != nil { out.Selector = new(LabelSelector) - if err := Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -3229,56 +3426,6 @@ func Convert_extensions_JobStatus_To_v1beta1_JobStatus(in *extensions.JobStatus, return autoConvert_extensions_JobStatus_To_v1beta1_JobStatus(in, out, s) } -func autoConvert_extensions_LabelSelector_To_v1beta1_LabelSelector(in *extensions.LabelSelector, out *LabelSelector, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*extensions.LabelSelector))(in) - } - if in.MatchLabels != nil { - out.MatchLabels = make(map[string]string) - for key, val := range in.MatchLabels { - out.MatchLabels[key] = val - } - } else { - out.MatchLabels = nil - } - if in.MatchExpressions != nil { - out.MatchExpressions = make([]LabelSelectorRequirement, len(in.MatchExpressions)) - for i := range in.MatchExpressions { - if err := Convert_extensions_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(&in.MatchExpressions[i], &out.MatchExpressions[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in *extensions.LabelSelector, out *LabelSelector, s conversion.Scope) error { - return autoConvert_extensions_LabelSelector_To_v1beta1_LabelSelector(in, out, s) -} - -func autoConvert_extensions_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *extensions.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { - defaulting.(func(*extensions.LabelSelectorRequirement))(in) - } - out.Key = in.Key - out.Operator = LabelSelectorOperator(in.Operator) - if in.Values != nil { - out.Values = make([]string, len(in.Values)) - for i := range in.Values { - out.Values[i] = in.Values[i] - } - } else { - out.Values = nil - } - return nil -} - -func Convert_extensions_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *extensions.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_extensions_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in, out, s) -} - func autoConvert_extensions_NodeUtilization_To_v1beta1_NodeUtilization(in *extensions.NodeUtilization, out *NodeUtilization, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.NodeUtilization))(in) @@ -3292,6 +3439,100 @@ func Convert_extensions_NodeUtilization_To_v1beta1_NodeUtilization(in *extension return autoConvert_extensions_NodeUtilization_To_v1beta1_NodeUtilization(in, out, s) } +func autoConvert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in *extensions.PodSecurityPolicy, out *PodSecurityPolicy, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.PodSecurityPolicy))(in) + } + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +func Convert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in *extensions.PodSecurityPolicy, out *PodSecurityPolicy, s conversion.Scope) error { + return autoConvert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in, out, s) +} + +func autoConvert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in *extensions.PodSecurityPolicyList, out *PodSecurityPolicyList, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.PodSecurityPolicyList))(in) + } + 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 { + out.Items = make([]PodSecurityPolicy, len(in.Items)) + for i := range in.Items { + if err := Convert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(&in.Items[i], &out.Items[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in *extensions.PodSecurityPolicyList, out *PodSecurityPolicyList, s conversion.Scope) error { + return autoConvert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in, out, s) +} + +func autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in *extensions.PodSecurityPolicySpec, out *PodSecurityPolicySpec, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.PodSecurityPolicySpec))(in) + } + out.Privileged = in.Privileged + if in.Capabilities != nil { + out.Capabilities = make([]v1.Capability, len(in.Capabilities)) + for i := range in.Capabilities { + out.Capabilities[i] = v1.Capability(in.Capabilities[i]) + } + } else { + out.Capabilities = nil + } + if in.Volumes != nil { + out.Volumes = make([]FSType, len(in.Volumes)) + for i := range in.Volumes { + out.Volumes[i] = FSType(in.Volumes[i]) + } + } else { + out.Volumes = nil + } + out.HostNetwork = in.HostNetwork + if in.HostPorts != nil { + out.HostPorts = make([]HostPortRange, len(in.HostPorts)) + for i := range in.HostPorts { + if err := Convert_extensions_HostPortRange_To_v1beta1_HostPortRange(&in.HostPorts[i], &out.HostPorts[i], s); err != nil { + return err + } + } + } else { + out.HostPorts = nil + } + out.HostPID = in.HostPID + out.HostIPC = in.HostIPC + if err := Convert_extensions_SELinuxContextStrategyOptions_To_v1beta1_SELinuxContextStrategyOptions(&in.SELinuxContext, &out.SELinuxContext, s); err != nil { + return err + } + if err := Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil { + return err + } + return nil +} + +func Convert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in *extensions.PodSecurityPolicySpec, out *PodSecurityPolicySpec, s conversion.Scope) error { + return autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in, out, s) +} + func autoConvert_extensions_ReplicaSet_To_v1beta1_ReplicaSet(in *extensions.ReplicaSet, out *ReplicaSet, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.ReplicaSet))(in) @@ -3349,10 +3590,10 @@ func autoConvert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensi if err := s.Convert(&in.Replicas, &out.Replicas, 0); err != nil { return err } - // unable to generate simple pointer conversion for extensions.LabelSelector -> v1beta1.LabelSelector + // unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector if in.Selector != nil { out.Selector = new(LabelSelector) - if err := Convert_extensions_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { + if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -3430,10 +3671,52 @@ func autoConvert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDepl if err := s.Convert(&in.MaxSurge, &out.MaxSurge, 0); err != nil { return err } - out.MinReadySeconds = int32(in.MinReadySeconds) return nil } +func autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *extensions.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.RunAsUserStrategyOptions))(in) + } + out.Type = RunAsUserStrategy(in.Type) + if in.Ranges != nil { + out.Ranges = make([]IDRange, len(in.Ranges)) + for i := range in.Ranges { + if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&in.Ranges[i], &out.Ranges[i], s); err != nil { + return err + } + } + } else { + out.Ranges = nil + } + return nil +} + +func Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *extensions.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error { + return autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in, out, s) +} + +func autoConvert_extensions_SELinuxContextStrategyOptions_To_v1beta1_SELinuxContextStrategyOptions(in *extensions.SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*extensions.SELinuxContextStrategyOptions))(in) + } + out.Type = SELinuxContextStrategy(in.Type) + // unable to generate simple pointer conversion for api.SELinuxOptions -> v1.SELinuxOptions + if in.SELinuxOptions != nil { + out.SELinuxOptions = new(v1.SELinuxOptions) + if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil { + return err + } + } else { + out.SELinuxOptions = nil + } + return nil +} + +func Convert_extensions_SELinuxContextStrategyOptions_To_v1beta1_SELinuxContextStrategyOptions(in *extensions.SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, s conversion.Scope) error { + return autoConvert_extensions_SELinuxContextStrategyOptions_To_v1beta1_SELinuxContextStrategyOptions(in, out, s) +} + func autoConvert_extensions_Scale_To_v1beta1_Scale(in *extensions.Scale, out *Scale, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*extensions.Scale))(in) @@ -3755,10 +4038,10 @@ func autoConvert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSet if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*DaemonSetSpec))(in) } - // unable to generate simple pointer conversion for v1beta1.LabelSelector -> extensions.LabelSelector + // unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector if in.Selector != nil { - out.Selector = new(extensions.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in.Selector, out.Selector, s); err != nil { + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -3888,10 +4171,11 @@ func autoConvert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *Deploym defaulting.(func(*DeploymentSpec))(in) } // in.Replicas has no peer in out + // unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector if in.Selector != nil { - out.Selector = make(map[string]string) - for key, val := range in.Selector { - out.Selector[key] = val + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { + return err } } else { out.Selector = nil @@ -3902,15 +4186,13 @@ func autoConvert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *Deploym if err := s.Convert(&in.Strategy, &out.Strategy, 0); err != nil { return err } + out.MinReadySeconds = int(in.MinReadySeconds) if in.RevisionHistoryLimit != nil { out.RevisionHistoryLimit = new(int) *out.RevisionHistoryLimit = int(*in.RevisionHistoryLimit) } else { out.RevisionHistoryLimit = nil } - if err := api.Convert_string_ref_To_string(&in.UniqueLabelKey, &out.UniqueLabelKey, s); err != nil { - return err - } out.Paused = in.Paused // unable to generate simple pointer conversion for v1beta1.RollbackConfig -> extensions.RollbackConfig if in.RollbackTo != nil { @@ -4089,6 +4371,32 @@ func Convert_v1beta1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAu return autoConvert_v1beta1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in, out, s) } +func autoConvert_v1beta1_HostPortRange_To_extensions_HostPortRange(in *HostPortRange, out *extensions.HostPortRange, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*HostPortRange))(in) + } + out.Min = int(in.Min) + out.Max = int(in.Max) + return nil +} + +func Convert_v1beta1_HostPortRange_To_extensions_HostPortRange(in *HostPortRange, out *extensions.HostPortRange, s conversion.Scope) error { + return autoConvert_v1beta1_HostPortRange_To_extensions_HostPortRange(in, out, s) +} + +func autoConvert_v1beta1_IDRange_To_extensions_IDRange(in *IDRange, out *extensions.IDRange, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*IDRange))(in) + } + out.Min = in.Min + out.Max = in.Max + return nil +} + +func Convert_v1beta1_IDRange_To_extensions_IDRange(in *IDRange, out *extensions.IDRange, s conversion.Scope) error { + return autoConvert_v1beta1_IDRange_To_extensions_IDRange(in, out, s) +} + func autoConvert_v1beta1_Ingress_To_extensions_Ingress(in *Ingress, out *extensions.Ingress, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*Ingress))(in) @@ -4202,6 +4510,16 @@ func autoConvert_v1beta1_IngressSpec_To_extensions_IngressSpec(in *IngressSpec, } else { out.Backend = nil } + if in.TLS != nil { + out.TLS = make([]extensions.IngressTLS, len(in.TLS)) + for i := range in.TLS { + if err := Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(&in.TLS[i], &out.TLS[i], s); err != nil { + return err + } + } + } else { + out.TLS = nil + } if in.Rules != nil { out.Rules = make([]extensions.IngressRule, len(in.Rules)) for i := range in.Rules { @@ -4233,6 +4551,26 @@ func Convert_v1beta1_IngressStatus_To_extensions_IngressStatus(in *IngressStatus return autoConvert_v1beta1_IngressStatus_To_extensions_IngressStatus(in, out, s) } +func autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *extensions.IngressTLS, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*IngressTLS))(in) + } + if in.Hosts != nil { + out.Hosts = make([]string, len(in.Hosts)) + for i := range in.Hosts { + out.Hosts[i] = in.Hosts[i] + } + } else { + out.Hosts = nil + } + out.SecretName = in.SecretName + return nil +} + +func Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *extensions.IngressTLS, s conversion.Scope) error { + return autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS(in, out, s) +} + func autoConvert_v1beta1_Job_To_extensions_Job(in *Job, out *extensions.Job, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*Job))(in) @@ -4326,10 +4664,10 @@ func autoConvert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensi } else { out.ActiveDeadlineSeconds = nil } - // unable to generate simple pointer conversion for v1beta1.LabelSelector -> extensions.LabelSelector + // unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector if in.Selector != nil { - out.Selector = new(extensions.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in.Selector, out.Selector, s); err != nil { + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -4387,7 +4725,7 @@ func Convert_v1beta1_JobStatus_To_extensions_JobStatus(in *JobStatus, out *exten return autoConvert_v1beta1_JobStatus_To_extensions_JobStatus(in, out, s) } -func autoConvert_v1beta1_LabelSelector_To_extensions_LabelSelector(in *LabelSelector, out *extensions.LabelSelector, s conversion.Scope) error { +func autoConvert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*LabelSelector))(in) } @@ -4400,9 +4738,9 @@ func autoConvert_v1beta1_LabelSelector_To_extensions_LabelSelector(in *LabelSele out.MatchLabels = nil } if in.MatchExpressions != nil { - out.MatchExpressions = make([]extensions.LabelSelectorRequirement, len(in.MatchExpressions)) + out.MatchExpressions = make([]unversioned.LabelSelectorRequirement, len(in.MatchExpressions)) for i := range in.MatchExpressions { - if err := Convert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorRequirement(&in.MatchExpressions[i], &out.MatchExpressions[i], s); err != nil { + if err := Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&in.MatchExpressions[i], &out.MatchExpressions[i], s); err != nil { return err } } @@ -4412,16 +4750,16 @@ func autoConvert_v1beta1_LabelSelector_To_extensions_LabelSelector(in *LabelSele return nil } -func Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in *LabelSelector, out *extensions.LabelSelector, s conversion.Scope) error { - return autoConvert_v1beta1_LabelSelector_To_extensions_LabelSelector(in, out, s) +func Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { + return autoConvert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in, out, s) } -func autoConvert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorRequirement(in *LabelSelectorRequirement, out *extensions.LabelSelectorRequirement, s conversion.Scope) error { +func autoConvert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*LabelSelectorRequirement))(in) } out.Key = in.Key - out.Operator = extensions.LabelSelectorOperator(in.Operator) + out.Operator = unversioned.LabelSelectorOperator(in.Operator) if in.Values != nil { out.Values = make([]string, len(in.Values)) for i := range in.Values { @@ -4433,8 +4771,8 @@ func autoConvert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorReq return nil } -func Convert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorRequirement(in *LabelSelectorRequirement, out *extensions.LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorRequirement(in, out, s) +func Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { + return autoConvert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s) } func autoConvert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error { @@ -4478,6 +4816,100 @@ func Convert_v1beta1_NodeUtilization_To_extensions_NodeUtilization(in *NodeUtili return autoConvert_v1beta1_NodeUtilization_To_extensions_NodeUtilization(in, out, s) } +func autoConvert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in *PodSecurityPolicy, out *extensions.PodSecurityPolicy, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*PodSecurityPolicy))(in) + } + if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { + return err + } + if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +func Convert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in *PodSecurityPolicy, out *extensions.PodSecurityPolicy, s conversion.Scope) error { + return autoConvert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in, out, s) +} + +func autoConvert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in *PodSecurityPolicyList, out *extensions.PodSecurityPolicyList, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*PodSecurityPolicyList))(in) + } + 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 { + out.Items = make([]extensions.PodSecurityPolicy, len(in.Items)) + for i := range in.Items { + if err := Convert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(&in.Items[i], &out.Items[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in *PodSecurityPolicyList, out *extensions.PodSecurityPolicyList, s conversion.Scope) error { + return autoConvert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in, out, s) +} + +func autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in *PodSecurityPolicySpec, out *extensions.PodSecurityPolicySpec, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*PodSecurityPolicySpec))(in) + } + out.Privileged = in.Privileged + if in.Capabilities != nil { + out.Capabilities = make([]api.Capability, len(in.Capabilities)) + for i := range in.Capabilities { + out.Capabilities[i] = api.Capability(in.Capabilities[i]) + } + } else { + out.Capabilities = nil + } + if in.Volumes != nil { + out.Volumes = make([]extensions.FSType, len(in.Volumes)) + for i := range in.Volumes { + out.Volumes[i] = extensions.FSType(in.Volumes[i]) + } + } else { + out.Volumes = nil + } + out.HostNetwork = in.HostNetwork + if in.HostPorts != nil { + out.HostPorts = make([]extensions.HostPortRange, len(in.HostPorts)) + for i := range in.HostPorts { + if err := Convert_v1beta1_HostPortRange_To_extensions_HostPortRange(&in.HostPorts[i], &out.HostPorts[i], s); err != nil { + return err + } + } + } else { + out.HostPorts = nil + } + out.HostPID = in.HostPID + out.HostIPC = in.HostIPC + if err := Convert_v1beta1_SELinuxContextStrategyOptions_To_extensions_SELinuxContextStrategyOptions(&in.SELinuxContext, &out.SELinuxContext, s); err != nil { + return err + } + if err := Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil { + return err + } + return nil +} + +func Convert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in *PodSecurityPolicySpec, out *extensions.PodSecurityPolicySpec, s conversion.Scope) error { + return autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in, out, s) +} + func autoConvert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(in *ReplicaSet, out *extensions.ReplicaSet, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*ReplicaSet))(in) @@ -4533,10 +4965,10 @@ func autoConvert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *Replica defaulting.(func(*ReplicaSetSpec))(in) } // in.Replicas has no peer in out - // unable to generate simple pointer conversion for v1beta1.LabelSelector -> extensions.LabelSelector + // unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector if in.Selector != nil { - out.Selector = new(extensions.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_extensions_LabelSelector(in.Selector, out.Selector, s); err != nil { + out.Selector = new(unversioned.LabelSelector) + if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil { return err } } else { @@ -4608,10 +5040,52 @@ func autoConvert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDepl } // in.MaxUnavailable has no peer in out // in.MaxSurge has no peer in out - out.MinReadySeconds = int(in.MinReadySeconds) return nil } +func autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *extensions.RunAsUserStrategyOptions, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*RunAsUserStrategyOptions))(in) + } + out.Type = extensions.RunAsUserStrategy(in.Type) + if in.Ranges != nil { + out.Ranges = make([]extensions.IDRange, len(in.Ranges)) + for i := range in.Ranges { + if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&in.Ranges[i], &out.Ranges[i], s); err != nil { + return err + } + } + } else { + out.Ranges = nil + } + return nil +} + +func Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *extensions.RunAsUserStrategyOptions, s conversion.Scope) error { + return autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in, out, s) +} + +func autoConvert_v1beta1_SELinuxContextStrategyOptions_To_extensions_SELinuxContextStrategyOptions(in *SELinuxContextStrategyOptions, out *extensions.SELinuxContextStrategyOptions, s conversion.Scope) error { + if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { + defaulting.(func(*SELinuxContextStrategyOptions))(in) + } + out.Type = extensions.SELinuxContextStrategy(in.Type) + // unable to generate simple pointer conversion for v1.SELinuxOptions -> api.SELinuxOptions + if in.SELinuxOptions != nil { + out.SELinuxOptions = new(api.SELinuxOptions) + if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil { + return err + } + } else { + out.SELinuxOptions = nil + } + return nil +} + +func Convert_v1beta1_SELinuxContextStrategyOptions_To_extensions_SELinuxContextStrategyOptions(in *SELinuxContextStrategyOptions, out *extensions.SELinuxContextStrategyOptions, s conversion.Scope) error { + return autoConvert_v1beta1_SELinuxContextStrategyOptions_To_extensions_SELinuxContextStrategyOptions(in, out, s) +} + func autoConvert_v1beta1_Scale_To_extensions_Scale(in *Scale, out *extensions.Scale, s conversion.Scope) error { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { defaulting.(func(*Scale))(in) @@ -4787,6 +5261,7 @@ func Convert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList func init() { err := api.Scheme.AddGeneratedConversionFuncs( autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource, + autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource, autoConvert_api_Capabilities_To_v1_Capabilities, autoConvert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource, autoConvert_api_CinderVolumeSource_To_v1_CinderVolumeSource, @@ -4806,6 +5281,7 @@ func init() { autoConvert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource, autoConvert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource, autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction, + autoConvert_api_HTTPHeader_To_v1_HTTPHeader, autoConvert_api_Handler_To_v1_Handler, autoConvert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource, autoConvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource, @@ -4853,21 +5329,25 @@ func init() { autoConvert_extensions_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec, autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus, autoConvert_extensions_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler, + autoConvert_extensions_HostPortRange_To_v1beta1_HostPortRange, + autoConvert_extensions_IDRange_To_v1beta1_IDRange, autoConvert_extensions_IngressBackend_To_v1beta1_IngressBackend, autoConvert_extensions_IngressList_To_v1beta1_IngressList, autoConvert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue, autoConvert_extensions_IngressRule_To_v1beta1_IngressRule, autoConvert_extensions_IngressSpec_To_v1beta1_IngressSpec, autoConvert_extensions_IngressStatus_To_v1beta1_IngressStatus, + autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS, autoConvert_extensions_Ingress_To_v1beta1_Ingress, autoConvert_extensions_JobCondition_To_v1beta1_JobCondition, autoConvert_extensions_JobList_To_v1beta1_JobList, autoConvert_extensions_JobSpec_To_v1beta1_JobSpec, autoConvert_extensions_JobStatus_To_v1beta1_JobStatus, autoConvert_extensions_Job_To_v1beta1_Job, - autoConvert_extensions_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement, - autoConvert_extensions_LabelSelector_To_v1beta1_LabelSelector, autoConvert_extensions_NodeUtilization_To_v1beta1_NodeUtilization, + autoConvert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList, + autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec, + autoConvert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy, autoConvert_extensions_ReplicaSetList_To_v1beta1_ReplicaSetList, autoConvert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec, autoConvert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus, @@ -4876,6 +5356,8 @@ func init() { autoConvert_extensions_RollbackConfig_To_v1beta1_RollbackConfig, autoConvert_extensions_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet, autoConvert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment, + autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions, + autoConvert_extensions_SELinuxContextStrategyOptions_To_v1beta1_SELinuxContextStrategyOptions, autoConvert_extensions_ScaleSpec_To_v1beta1_ScaleSpec, autoConvert_extensions_ScaleStatus_To_v1beta1_ScaleStatus, autoConvert_extensions_Scale_To_v1beta1_Scale, @@ -4884,7 +5366,10 @@ func init() { autoConvert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData, autoConvert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList, autoConvert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource, + autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement, + autoConvert_unversioned_LabelSelector_To_v1beta1_LabelSelector, autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource, + autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource, autoConvert_v1_Capabilities_To_api_Capabilities, autoConvert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource, autoConvert_v1_CinderVolumeSource_To_api_CinderVolumeSource, @@ -4904,6 +5389,7 @@ func init() { autoConvert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource, autoConvert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource, autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction, + autoConvert_v1_HTTPHeader_To_api_HTTPHeader, autoConvert_v1_Handler_To_api_Handler, autoConvert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource, autoConvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource, @@ -4949,22 +5435,28 @@ func init() { autoConvert_v1beta1_HorizontalPodAutoscalerSpec_To_extensions_HorizontalPodAutoscalerSpec, autoConvert_v1beta1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus, autoConvert_v1beta1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler, + autoConvert_v1beta1_HostPortRange_To_extensions_HostPortRange, + autoConvert_v1beta1_IDRange_To_extensions_IDRange, autoConvert_v1beta1_IngressBackend_To_extensions_IngressBackend, autoConvert_v1beta1_IngressList_To_extensions_IngressList, autoConvert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue, autoConvert_v1beta1_IngressRule_To_extensions_IngressRule, autoConvert_v1beta1_IngressSpec_To_extensions_IngressSpec, autoConvert_v1beta1_IngressStatus_To_extensions_IngressStatus, + autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS, autoConvert_v1beta1_Ingress_To_extensions_Ingress, autoConvert_v1beta1_JobCondition_To_extensions_JobCondition, autoConvert_v1beta1_JobList_To_extensions_JobList, autoConvert_v1beta1_JobSpec_To_extensions_JobSpec, autoConvert_v1beta1_JobStatus_To_extensions_JobStatus, autoConvert_v1beta1_Job_To_extensions_Job, - autoConvert_v1beta1_LabelSelectorRequirement_To_extensions_LabelSelectorRequirement, - autoConvert_v1beta1_LabelSelector_To_extensions_LabelSelector, + autoConvert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement, + autoConvert_v1beta1_LabelSelector_To_unversioned_LabelSelector, autoConvert_v1beta1_ListOptions_To_api_ListOptions, autoConvert_v1beta1_NodeUtilization_To_extensions_NodeUtilization, + autoConvert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList, + autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec, + autoConvert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy, autoConvert_v1beta1_ReplicaSetList_To_extensions_ReplicaSetList, autoConvert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec, autoConvert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus, @@ -4973,6 +5465,8 @@ func init() { autoConvert_v1beta1_RollbackConfig_To_extensions_RollbackConfig, autoConvert_v1beta1_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet, autoConvert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment, + autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions, + autoConvert_v1beta1_SELinuxContextStrategyOptions_To_extensions_SELinuxContextStrategyOptions, autoConvert_v1beta1_ScaleSpec_To_extensions_ScaleSpec, autoConvert_v1beta1_ScaleStatus_To_extensions_ScaleStatus, autoConvert_v1beta1_Scale_To_extensions_Scale, diff --git a/pkg/apis/extensions/v1beta1/deep_copy_generated.go b/pkg/apis/extensions/v1beta1/deep_copy_generated.go index 695908cd109..2fdee8abdef 100644 --- a/pkg/apis/extensions/v1beta1/deep_copy_generated.go +++ b/pkg/apis/extensions/v1beta1/deep_copy_generated.go @@ -73,6 +73,13 @@ func deepCopy_v1_AWSElasticBlockStoreVolumeSource(in v1.AWSElasticBlockStoreVolu return nil } +func deepCopy_v1_AzureFileVolumeSource(in v1.AzureFileVolumeSource, out *v1.AzureFileVolumeSource, c *conversion.Cloner) error { + out.SecretName = in.SecretName + out.ShareName = in.ShareName + out.ReadOnly = in.ReadOnly + return nil +} + func deepCopy_v1_Capabilities(in v1.Capabilities, out *v1.Capabilities, c *conversion.Cloner) error { if in.Add != nil { out.Add = make([]v1.Capability, len(in.Add)) @@ -392,6 +399,22 @@ func deepCopy_v1_HTTPGetAction(in v1.HTTPGetAction, out *v1.HTTPGetAction, c *co } out.Host = in.Host out.Scheme = in.Scheme + if in.HTTPHeaders != nil { + out.HTTPHeaders = make([]v1.HTTPHeader, len(in.HTTPHeaders)) + for i := range in.HTTPHeaders { + if err := deepCopy_v1_HTTPHeader(in.HTTPHeaders[i], &out.HTTPHeaders[i], c); err != nil { + return err + } + } + } else { + out.HTTPHeaders = nil + } + return nil +} + +func deepCopy_v1_HTTPHeader(in v1.HTTPHeader, out *v1.HTTPHeader, c *conversion.Cloner) error { + out.Name = in.Name + out.Value = in.Value return nil } @@ -948,6 +971,14 @@ func deepCopy_v1_VolumeSource(in v1.VolumeSource, out *v1.VolumeSource, c *conve } else { out.FC = nil } + if in.AzureFile != nil { + out.AzureFile = new(v1.AzureFileVolumeSource) + if err := deepCopy_v1_AzureFileVolumeSource(*in.AzureFile, out.AzureFile, c); err != nil { + return err + } + } else { + out.AzureFile = nil + } return nil } @@ -1154,9 +1185,9 @@ func deepCopy_v1beta1_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c * out.Replicas = nil } if in.Selector != nil { - out.Selector = make(map[string]string) - for key, val := range in.Selector { - out.Selector[key] = val + out.Selector = new(LabelSelector) + if err := deepCopy_v1beta1_LabelSelector(*in.Selector, out.Selector, c); err != nil { + return err } } else { out.Selector = nil @@ -1167,18 +1198,13 @@ func deepCopy_v1beta1_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c * if err := deepCopy_v1beta1_DeploymentStrategy(in.Strategy, &out.Strategy, c); err != nil { return err } + out.MinReadySeconds = in.MinReadySeconds if in.RevisionHistoryLimit != nil { out.RevisionHistoryLimit = new(int32) *out.RevisionHistoryLimit = *in.RevisionHistoryLimit } else { out.RevisionHistoryLimit = nil } - if in.UniqueLabelKey != nil { - out.UniqueLabelKey = new(string) - *out.UniqueLabelKey = *in.UniqueLabelKey - } else { - out.UniqueLabelKey = nil - } out.Paused = in.Paused if in.RollbackTo != nil { out.RollbackTo = new(RollbackConfig) @@ -1318,6 +1344,18 @@ func deepCopy_v1beta1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerSt return nil } +func deepCopy_v1beta1_HostPortRange(in HostPortRange, out *HostPortRange, c *conversion.Cloner) error { + out.Min = in.Min + out.Max = in.Max + return nil +} + +func deepCopy_v1beta1_IDRange(in IDRange, out *IDRange, c *conversion.Cloner) error { + out.Min = in.Min + out.Max = in.Max + return nil +} + func deepCopy_v1beta1_Ingress(in Ingress, out *Ingress, c *conversion.Cloner) error { if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err @@ -1391,6 +1429,16 @@ func deepCopy_v1beta1_IngressSpec(in IngressSpec, out *IngressSpec, c *conversio } else { out.Backend = nil } + if in.TLS != nil { + out.TLS = make([]IngressTLS, len(in.TLS)) + for i := range in.TLS { + if err := deepCopy_v1beta1_IngressTLS(in.TLS[i], &out.TLS[i], c); err != nil { + return err + } + } + } else { + out.TLS = nil + } if in.Rules != nil { out.Rules = make([]IngressRule, len(in.Rules)) for i := range in.Rules { @@ -1411,6 +1459,19 @@ func deepCopy_v1beta1_IngressStatus(in IngressStatus, out *IngressStatus, c *con return nil } +func deepCopy_v1beta1_IngressTLS(in IngressTLS, out *IngressTLS, c *conversion.Cloner) error { + if in.Hosts != nil { + out.Hosts = make([]string, len(in.Hosts)) + for i := range in.Hosts { + out.Hosts[i] = in.Hosts[i] + } + } else { + out.Hosts = nil + } + out.SecretName = in.SecretName + return nil +} + func deepCopy_v1beta1_Job(in Job, out *Job, c *conversion.Cloner) error { if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err @@ -1586,6 +1647,79 @@ func deepCopy_v1beta1_NodeUtilization(in NodeUtilization, out *NodeUtilization, return nil } +func deepCopy_v1beta1_PodSecurityPolicy(in PodSecurityPolicy, out *PodSecurityPolicy, c *conversion.Cloner) error { + if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { + return err + } + if err := deepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := deepCopy_v1beta1_PodSecurityPolicySpec(in.Spec, &out.Spec, c); err != nil { + return err + } + return nil +} + +func deepCopy_v1beta1_PodSecurityPolicyList(in PodSecurityPolicyList, out *PodSecurityPolicyList, 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 + } + if in.Items != nil { + out.Items = make([]PodSecurityPolicy, len(in.Items)) + for i := range in.Items { + if err := deepCopy_v1beta1_PodSecurityPolicy(in.Items[i], &out.Items[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func deepCopy_v1beta1_PodSecurityPolicySpec(in PodSecurityPolicySpec, out *PodSecurityPolicySpec, c *conversion.Cloner) error { + out.Privileged = in.Privileged + if in.Capabilities != nil { + out.Capabilities = make([]v1.Capability, len(in.Capabilities)) + for i := range in.Capabilities { + out.Capabilities[i] = in.Capabilities[i] + } + } else { + out.Capabilities = nil + } + if in.Volumes != nil { + out.Volumes = make([]FSType, len(in.Volumes)) + for i := range in.Volumes { + out.Volumes[i] = in.Volumes[i] + } + } else { + out.Volumes = nil + } + out.HostNetwork = in.HostNetwork + if in.HostPorts != nil { + out.HostPorts = make([]HostPortRange, len(in.HostPorts)) + for i := range in.HostPorts { + if err := deepCopy_v1beta1_HostPortRange(in.HostPorts[i], &out.HostPorts[i], c); err != nil { + return err + } + } + } else { + out.HostPorts = nil + } + out.HostPID = in.HostPID + out.HostIPC = in.HostIPC + if err := deepCopy_v1beta1_SELinuxContextStrategyOptions(in.SELinuxContext, &out.SELinuxContext, c); err != nil { + return err + } + if err := deepCopy_v1beta1_RunAsUserStrategyOptions(in.RunAsUser, &out.RunAsUser, c); err != nil { + return err + } + return nil +} + func deepCopy_v1beta1_ReplicaSet(in ReplicaSet, out *ReplicaSet, c *conversion.Cloner) error { if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil { return err @@ -1696,7 +1830,34 @@ func deepCopy_v1beta1_RollingUpdateDeployment(in RollingUpdateDeployment, out *R } else { out.MaxSurge = nil } - out.MinReadySeconds = in.MinReadySeconds + return nil +} + +func deepCopy_v1beta1_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, c *conversion.Cloner) error { + out.Type = in.Type + if in.Ranges != nil { + out.Ranges = make([]IDRange, len(in.Ranges)) + for i := range in.Ranges { + if err := deepCopy_v1beta1_IDRange(in.Ranges[i], &out.Ranges[i], c); err != nil { + return err + } + } + } else { + out.Ranges = nil + } + return nil +} + +func deepCopy_v1beta1_SELinuxContextStrategyOptions(in SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, c *conversion.Cloner) error { + out.Type = in.Type + if in.SELinuxOptions != nil { + out.SELinuxOptions = new(v1.SELinuxOptions) + if err := deepCopy_v1_SELinuxOptions(*in.SELinuxOptions, out.SELinuxOptions, c); err != nil { + return err + } + } else { + out.SELinuxOptions = nil + } return nil } @@ -1835,6 +1996,7 @@ func init() { deepCopy_unversioned_Time, deepCopy_unversioned_TypeMeta, deepCopy_v1_AWSElasticBlockStoreVolumeSource, + deepCopy_v1_AzureFileVolumeSource, deepCopy_v1_Capabilities, deepCopy_v1_CephFSVolumeSource, deepCopy_v1_CinderVolumeSource, @@ -1854,6 +2016,7 @@ func init() { deepCopy_v1_GitRepoVolumeSource, deepCopy_v1_GlusterfsVolumeSource, deepCopy_v1_HTTPGetAction, + deepCopy_v1_HTTPHeader, deepCopy_v1_Handler, deepCopy_v1_HostPathVolumeSource, deepCopy_v1_ISCSIVolumeSource, @@ -1901,6 +2064,8 @@ func init() { deepCopy_v1beta1_HorizontalPodAutoscalerList, deepCopy_v1beta1_HorizontalPodAutoscalerSpec, deepCopy_v1beta1_HorizontalPodAutoscalerStatus, + deepCopy_v1beta1_HostPortRange, + deepCopy_v1beta1_IDRange, deepCopy_v1beta1_Ingress, deepCopy_v1beta1_IngressBackend, deepCopy_v1beta1_IngressList, @@ -1908,6 +2073,7 @@ func init() { deepCopy_v1beta1_IngressRuleValue, deepCopy_v1beta1_IngressSpec, deepCopy_v1beta1_IngressStatus, + deepCopy_v1beta1_IngressTLS, deepCopy_v1beta1_Job, deepCopy_v1beta1_JobCondition, deepCopy_v1beta1_JobList, @@ -1917,6 +2083,9 @@ func init() { deepCopy_v1beta1_LabelSelectorRequirement, deepCopy_v1beta1_ListOptions, deepCopy_v1beta1_NodeUtilization, + deepCopy_v1beta1_PodSecurityPolicy, + deepCopy_v1beta1_PodSecurityPolicyList, + deepCopy_v1beta1_PodSecurityPolicySpec, deepCopy_v1beta1_ReplicaSet, deepCopy_v1beta1_ReplicaSetList, deepCopy_v1beta1_ReplicaSetSpec, @@ -1925,6 +2094,8 @@ func init() { deepCopy_v1beta1_RollbackConfig, deepCopy_v1beta1_RollingUpdateDaemonSet, deepCopy_v1beta1_RollingUpdateDeployment, + deepCopy_v1beta1_RunAsUserStrategyOptions, + deepCopy_v1beta1_SELinuxContextStrategyOptions, deepCopy_v1beta1_Scale, deepCopy_v1beta1_ScaleSpec, deepCopy_v1beta1_ScaleStatus, diff --git a/pkg/apis/extensions/v1beta1/defaults.go b/pkg/apis/extensions/v1beta1/defaults.go index 356849d9944..4d3b0e2ee9d 100644 --- a/pkg/apis/extensions/v1beta1/defaults.go +++ b/pkg/apis/extensions/v1beta1/defaults.go @@ -67,8 +67,8 @@ func addDefaultingFuncs(scheme *runtime.Scheme) { labels := obj.Spec.Template.Labels if labels != nil { - if len(obj.Spec.Selector) == 0 { - obj.Spec.Selector = labels + if obj.Spec.Selector == nil { + obj.Spec.Selector = &LabelSelector{MatchLabels: labels} } if len(obj.Labels) == 0 { obj.Labels = labels @@ -100,10 +100,6 @@ func addDefaultingFuncs(scheme *runtime.Scheme) { strategy.RollingUpdate.MaxSurge = &maxSurge } } - if obj.Spec.UniqueLabelKey == nil { - obj.Spec.UniqueLabelKey = new(string) - *obj.Spec.UniqueLabelKey = DefaultDeploymentUniqueLabelKey - } }, func(obj *Job) { labels := obj.Spec.Template.Labels diff --git a/pkg/apis/extensions/v1beta1/defaults_test.go b/pkg/apis/extensions/v1beta1/defaults_test.go index 5bd43d040ce..cd41460631d 100644 --- a/pkg/apis/extensions/v1beta1/defaults_test.go +++ b/pkg/apis/extensions/v1beta1/defaults_test.go @@ -198,7 +198,6 @@ func TestSetDefaultDaemonSet(t *testing.T) { func TestSetDefaultDeployment(t *testing.T) { defaultIntOrString := intstr.FromInt(1) differentIntOrString := intstr.FromInt(5) - deploymentLabelKey := DefaultDeploymentUniqueLabelKey period := int64(v1.DefaultTerminationGracePeriodSeconds) defaultTemplate := v1.PodTemplateSpec{ Spec: v1.PodSpec{ @@ -224,8 +223,7 @@ func TestSetDefaultDeployment(t *testing.T) { MaxUnavailable: &defaultIntOrString, }, }, - Template: defaultTemplate, - UniqueLabelKey: newString(deploymentLabelKey), + Template: defaultTemplate, }, }, }, @@ -250,8 +248,7 @@ func TestSetDefaultDeployment(t *testing.T) { MaxUnavailable: &defaultIntOrString, }, }, - Template: defaultTemplate, - UniqueLabelKey: newString(deploymentLabelKey), + Template: defaultTemplate, }, }, }, @@ -270,8 +267,7 @@ func TestSetDefaultDeployment(t *testing.T) { Strategy: DeploymentStrategy{ Type: RecreateDeploymentStrategyType, }, - Template: defaultTemplate, - UniqueLabelKey: newString(deploymentLabelKey), + Template: defaultTemplate, }, }, }, @@ -282,7 +278,6 @@ func TestSetDefaultDeployment(t *testing.T) { Strategy: DeploymentStrategy{ Type: RecreateDeploymentStrategyType, }, - UniqueLabelKey: newString("customDeploymentKey"), }, }, expected: &Deployment{ @@ -291,8 +286,7 @@ func TestSetDefaultDeployment(t *testing.T) { Strategy: DeploymentStrategy{ Type: RecreateDeploymentStrategyType, }, - Template: defaultTemplate, - UniqueLabelKey: newString("customDeploymentKey"), + Template: defaultTemplate, }, }, }, diff --git a/pkg/apis/extensions/v1beta1/register.go b/pkg/apis/extensions/v1beta1/register.go index f40c83c003e..d2750a63943 100644 --- a/pkg/apis/extensions/v1beta1/register.go +++ b/pkg/apis/extensions/v1beta1/register.go @@ -60,6 +60,8 @@ func addKnownTypes(scheme *runtime.Scheme) { &v1.DeleteOptions{}, &ReplicaSet{}, &ReplicaSetList{}, + &PodSecurityPolicy{}, + &PodSecurityPolicyList{}, ) } @@ -85,3 +87,5 @@ func (obj *IngressList) GetObjectKind() unversioned.ObjectKind { func (obj *ListOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } func (obj *ReplicaSet) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } func (obj *ReplicaSetList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *PodSecurityPolicy) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } +func (obj *PodSecurityPolicyList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/extensions/v1beta1/types.generated.go b/pkg/apis/extensions/v1beta1/types.generated.go index 4417dd0c90c..118d202fcea 100644 --- a/pkg/apis/extensions/v1beta1/types.generated.go +++ b/pkg/apis/extensions/v1beta1/types.generated.go @@ -493,11 +493,11 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { var yyq31 [5]bool _, _, _ = yysep31, yyq31, yy2arr31 const yyr31 bool = false - yyq31[0] = x.Kind != "" - yyq31[1] = x.APIVersion != "" + yyq31[0] = true + yyq31[1] = true yyq31[2] = true - yyq31[3] = true - yyq31[4] = true + yyq31[3] = x.Kind != "" + yyq31[4] = x.APIVersion != "" var yynn31 int if yyr31 || yy2arr31 { r.EncodeArrayStart(5) @@ -514,57 +514,41 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[0] { - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy33 := &x.ObjectMeta + yy33.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq31[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy34 := &x.ObjectMeta + yy34.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[1] { - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy36 := &x.Spec + yy36.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq31[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy37 := &x.Spec + yy37.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[2] { - yy39 := &x.ObjectMeta + yy39 := &x.Status yy39.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -572,44 +556,60 @@ func (x *Scale) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq31[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy40 := &x.ObjectMeta + yy40 := &x.Status yy40.CodecEncodeSelf(e) } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[3] { - yy42 := &x.Spec - yy42.CodecEncodeSelf(e) + yym42 := z.EncBinary() + _ = yym42 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq31[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy43 := &x.Spec - yy43.CodecEncodeSelf(e) + yym43 := z.EncBinary() + _ = yym43 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr31 || yy2arr31 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq31[4] { - yy45 := &x.Status - yy45.CodecEncodeSelf(e) + yym45 := z.EncBinary() + _ = yym45 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq31[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy46 := &x.Status - yy46.CodecEncodeSelf(e) + yym46 := z.EncBinary() + _ = yym46 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr31 || yy2arr31 { @@ -673,6 +673,27 @@ func (x *Scale) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys49 := string(yys49Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys49 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv50 := &x.ObjectMeta + yyv50.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ScaleSpec{} + } else { + yyv51 := &x.Spec + yyv51.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ScaleStatus{} + } else { + yyv52 := &x.Status + yyv52.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -685,27 +706,6 @@ func (x *Scale) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv52 := &x.ObjectMeta - yyv52.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ScaleSpec{} - } else { - yyv53 := &x.Spec - yyv53.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ScaleStatus{} - } else { - yyv54 := &x.Status - yyv54.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys49) } // end switch yys49 @@ -731,6 +731,57 @@ func (x *Scale) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv56 := &x.ObjectMeta + yyv56.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ScaleSpec{} + } else { + yyv57 := &x.Spec + yyv57.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ScaleStatus{} + } else { + yyv58 := &x.Status + yyv58.CodecDecodeSelf(d) + } + yyj55++ + if yyhl55 { + yyb55 = yyj55 > l + } else { + yyb55 = r.CheckBreak() + } + if yyb55 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -752,57 +803,6 @@ func (x *Scale) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv58 := &x.ObjectMeta - yyv58.CodecDecodeSelf(d) - } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ScaleSpec{} - } else { - yyv59 := &x.Spec - yyv59.CodecDecodeSelf(d) - } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l - } else { - yyb55 = r.CheckBreak() - } - if yyb55 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ScaleStatus{} - } else { - yyv60 := &x.Status - yyv60.CodecDecodeSelf(d) - } for { yyj55++ if yyhl55 { @@ -3136,11 +3136,11 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { var yyq250 [5]bool _, _, _ = yysep250, yyq250, yy2arr250 const yyr250 bool = false - yyq250[0] = x.Kind != "" - yyq250[1] = x.APIVersion != "" + yyq250[0] = true + yyq250[1] = true yyq250[2] = true - yyq250[3] = true - yyq250[4] = true + yyq250[3] = x.Kind != "" + yyq250[4] = x.APIVersion != "" var yynn250 int if yyr250 || yy2arr250 { r.EncodeArrayStart(5) @@ -3157,57 +3157,41 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[0] { - yym252 := z.EncBinary() - _ = yym252 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy252 := &x.ObjectMeta + yy252.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq250[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym253 := z.EncBinary() - _ = yym253 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy253 := &x.ObjectMeta + yy253.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[1] { - yym255 := z.EncBinary() - _ = yym255 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy255 := &x.Spec + yy255.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq250[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym256 := z.EncBinary() - _ = yym256 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy256 := &x.Spec + yy256.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[2] { - yy258 := &x.ObjectMeta + yy258 := &x.Status yy258.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -3215,44 +3199,60 @@ func (x *HorizontalPodAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq250[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy259 := &x.ObjectMeta + yy259 := &x.Status yy259.CodecEncodeSelf(e) } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[3] { - yy261 := &x.Spec - yy261.CodecEncodeSelf(e) + yym261 := z.EncBinary() + _ = yym261 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq250[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy262 := &x.Spec - yy262.CodecEncodeSelf(e) + yym262 := z.EncBinary() + _ = yym262 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr250 || yy2arr250 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq250[4] { - yy264 := &x.Status - yy264.CodecEncodeSelf(e) + yym264 := z.EncBinary() + _ = yym264 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq250[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy265 := &x.Status - yy265.CodecEncodeSelf(e) + yym265 := z.EncBinary() + _ = yym265 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr250 || yy2arr250 { @@ -3316,6 +3316,27 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Dec yys268 := string(yys268Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys268 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv269 := &x.ObjectMeta + yyv269.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = HorizontalPodAutoscalerSpec{} + } else { + yyv270 := &x.Spec + yyv270.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = HorizontalPodAutoscalerStatus{} + } else { + yyv271 := &x.Status + yyv271.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -3328,27 +3349,6 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv271 := &x.ObjectMeta - yyv271.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = HorizontalPodAutoscalerSpec{} - } else { - yyv272 := &x.Spec - yyv272.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = HorizontalPodAutoscalerStatus{} - } else { - yyv273 := &x.Status - yyv273.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys268) } // end switch yys268 @@ -3374,6 +3374,57 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.D return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv275 := &x.ObjectMeta + yyv275.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = HorizontalPodAutoscalerSpec{} + } else { + yyv276 := &x.Spec + yyv276.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = HorizontalPodAutoscalerStatus{} + } else { + yyv277 := &x.Status + yyv277.CodecDecodeSelf(d) + } + yyj274++ + if yyhl274 { + yyb274 = yyj274 > l + } else { + yyb274 = r.CheckBreak() + } + if yyb274 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -3395,57 +3446,6 @@ func (x *HorizontalPodAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv277 := &x.ObjectMeta - yyv277.CodecDecodeSelf(d) - } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = HorizontalPodAutoscalerSpec{} - } else { - yyv278 := &x.Spec - yyv278.CodecDecodeSelf(d) - } - yyj274++ - if yyhl274 { - yyb274 = yyj274 > l - } else { - yyb274 = r.CheckBreak() - } - if yyb274 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = HorizontalPodAutoscalerStatus{} - } else { - yyv279 := &x.Status - yyv279.CodecDecodeSelf(d) - } for { yyj274++ if yyhl274 { @@ -3479,9 +3479,9 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq281 [4]bool _, _, _ = yysep281, yyq281, yy2arr281 const yyr281 bool = false - yyq281[0] = x.Kind != "" - yyq281[1] = x.APIVersion != "" - yyq281[2] = true + yyq281[0] = true + yyq281[2] = x.Kind != "" + yyq281[3] = x.APIVersion != "" var yynn281 int if yyr281 || yy2arr281 { r.EncodeArrayStart(4) @@ -3498,79 +3498,29 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr281 || yy2arr281 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq281[0] { - yym283 := z.EncBinary() - _ = yym283 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq281[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy283 := &x.ListMeta yym284 := z.EncBinary() _ = yym284 if false { + } else if z.HasExtensions() && z.EncExt(yy283) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr281 || yy2arr281 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq281[1] { - yym286 := z.EncBinary() - _ = yym286 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq281[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym287 := z.EncBinary() - _ = yym287 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr281 || yy2arr281 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq281[2] { - yy289 := &x.ListMeta - yym290 := z.EncBinary() - _ = yym290 - if false { - } else if z.HasExtensions() && z.EncExt(yy289) { - } else { - z.EncFallback(yy289) + z.EncFallback(yy283) } } else { r.EncodeNil() } } else { - if yyq281[2] { + if yyq281[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy291 := &x.ListMeta - yym292 := z.EncBinary() - _ = yym292 + yy285 := &x.ListMeta + yym286 := z.EncBinary() + _ = yym286 if false { - } else if z.HasExtensions() && z.EncExt(yy291) { + } else if z.HasExtensions() && z.EncExt(yy285) { } else { - z.EncFallback(yy291) + z.EncFallback(yy285) } } } @@ -3579,8 +3529,8 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym294 := z.EncBinary() - _ = yym294 + yym288 := z.EncBinary() + _ = yym288 if false { } else { h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) @@ -3593,11 +3543,61 @@ func (x *HorizontalPodAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym289 := z.EncBinary() + _ = yym289 + if false { + } else { + h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) + } + } + } + if yyr281 || yy2arr281 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq281[2] { + yym291 := z.EncBinary() + _ = yym291 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq281[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym292 := z.EncBinary() + _ = yym292 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr281 || yy2arr281 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq281[3] { + yym294 := z.EncBinary() + _ = yym294 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq281[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym295 := z.EncBinary() _ = yym295 if false { } else { - h.encSliceHorizontalPodAutoscaler(([]HorizontalPodAutoscaler)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -3662,6 +3662,31 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978 yys298 := string(yys298Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys298 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv299 := &x.ListMeta + yym300 := z.DecBinary() + _ = yym300 + if false { + } else if z.HasExtensions() && z.DecExt(yyv299) { + } else { + z.DecFallback(yyv299, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv301 := &x.Items + yym302 := z.DecBinary() + _ = yym302 + if false { + } else { + h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv301), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -3674,31 +3699,6 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978 } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv301 := &x.ListMeta - yym302 := z.DecBinary() - _ = yym302 - if false { - } else if z.HasExtensions() && z.DecExt(yyv301) { - } else { - z.DecFallback(yyv301, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv303 := &x.Items - yym304 := z.DecBinary() - _ = yym304 - if false { - } else { - h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv303), d) - } - } default: z.DecStructFieldNotFound(-1, yys298) } // end switch yys298 @@ -3724,6 +3724,51 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromArray(l int, d *codec19 return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv306 := &x.ListMeta + yym307 := z.DecBinary() + _ = yym307 + if false { + } else if z.HasExtensions() && z.DecExt(yyv306) { + } else { + z.DecFallback(yyv306, false) + } + } + yyj305++ + if yyhl305 { + yyb305 = yyj305 > l + } else { + yyb305 = r.CheckBreak() + } + if yyb305 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv308 := &x.Items + yym309 := z.DecBinary() + _ = yym309 + if false { + } else { + h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv308), d) + } + } + yyj305++ + if yyhl305 { + yyb305 = yyj305 > l + } else { + yyb305 = r.CheckBreak() + } + if yyb305 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -3745,51 +3790,6 @@ func (x *HorizontalPodAutoscalerList) codecDecodeSelfFromArray(l int, d *codec19 } else { x.APIVersion = string(r.DecodeString()) } - yyj305++ - if yyhl305 { - yyb305 = yyj305 > l - } else { - yyb305 = r.CheckBreak() - } - if yyb305 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv308 := &x.ListMeta - yym309 := z.DecBinary() - _ = yym309 - if false { - } else if z.HasExtensions() && z.DecExt(yyv308) { - } else { - z.DecFallback(yyv308, false) - } - } - yyj305++ - if yyhl305 { - yyb305 = yyj305 > l - } else { - yyb305 = r.CheckBreak() - } - if yyb305 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv310 := &x.Items - yym311 := z.DecBinary() - _ = yym311 - if false { - } else { - h.decSliceHorizontalPodAutoscaler((*[]HorizontalPodAutoscaler)(yyv310), d) - } - } for { yyj305++ if yyhl305 { @@ -3823,11 +3823,11 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { var yyq313 [5]bool _, _, _ = yysep313, yyq313, yy2arr313 const yyr313 bool = false - yyq313[0] = x.Kind != "" - yyq313[1] = x.APIVersion != "" - yyq313[2] = true - yyq313[3] = x.Description != "" - yyq313[4] = len(x.Versions) != 0 + yyq313[0] = true + yyq313[1] = x.Description != "" + yyq313[2] = len(x.Versions) != 0 + yyq313[3] = x.Kind != "" + yyq313[4] = x.APIVersion != "" var yynn313 int if yyr313 || yy2arr313 { r.EncodeArrayStart(5) @@ -3844,26 +3844,18 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[0] { - yym315 := z.EncBinary() - _ = yym315 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy315 := &x.ObjectMeta + yy315.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq313[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym316 := z.EncBinary() - _ = yym316 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy316 := &x.ObjectMeta + yy316.CodecEncodeSelf(e) } } if yyr313 || yy2arr313 { @@ -3873,7 +3865,7 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym318 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Description)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -3881,31 +3873,47 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq313[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("description")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym319 := z.EncBinary() _ = yym319 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Description)) } } } if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[2] { - yy321 := &x.ObjectMeta - yy321.CodecEncodeSelf(e) + if x.Versions == nil { + r.EncodeNil() + } else { + yym321 := z.EncBinary() + _ = yym321 + if false { + } else { + h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) + } + } } else { r.EncodeNil() } } else { if yyq313[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("versions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy322 := &x.ObjectMeta - yy322.CodecEncodeSelf(e) + if x.Versions == nil { + r.EncodeNil() + } else { + yym322 := z.EncBinary() + _ = yym322 + if false { + } else { + h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) + } + } } } if yyr313 || yy2arr313 { @@ -3915,7 +3923,7 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym324 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Description)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -3923,46 +3931,38 @@ func (x *ThirdPartyResource) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq313[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("description")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym325 := z.EncBinary() _ = yym325 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Description)) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } if yyr313 || yy2arr313 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq313[4] { - if x.Versions == nil { - r.EncodeNil() + yym327 := z.EncBinary() + _ = yym327 + if false { } else { - yym327 := z.EncBinary() - _ = yym327 - if false { - } else { - h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) - } + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq313[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("versions")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Versions == nil { - r.EncodeNil() + yym328 := z.EncBinary() + _ = yym328 + if false { } else { - yym328 := z.EncBinary() - _ = yym328 - if false { - } else { - h.encSliceAPIVersion(([]APIVersion)(x.Versions), e) - } + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -4027,24 +4027,12 @@ func (x *ThirdPartyResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) yys331 := string(yys331Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys331 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_v1.ObjectMeta{} } else { - yyv334 := &x.ObjectMeta - yyv334.CodecDecodeSelf(d) + yyv332 := &x.ObjectMeta + yyv332.CodecDecodeSelf(d) } case "description": if r.TryDecodeAsNil() { @@ -4056,14 +4044,26 @@ func (x *ThirdPartyResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Versions = nil } else { - yyv336 := &x.Versions - yym337 := z.DecBinary() - _ = yym337 + yyv334 := &x.Versions + yym335 := z.DecBinary() + _ = yym335 if false { } else { - h.decSliceAPIVersion((*[]APIVersion)(yyv336), d) + h.decSliceAPIVersion((*[]APIVersion)(yyv334), 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, yys331) } // end switch yys331 @@ -4089,43 +4089,11 @@ func (x *ThirdPartyResource) codecDecodeSelfFromArray(l int, d *codec1978.Decode return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj338++ - if yyhl338 { - yyb338 = yyj338 > l - } else { - yyb338 = r.CheckBreak() - } - if yyb338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj338++ - if yyhl338 { - yyb338 = yyj338 > l - } else { - yyb338 = r.CheckBreak() - } - if yyb338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_v1.ObjectMeta{} } else { - yyv341 := &x.ObjectMeta - yyv341.CodecDecodeSelf(d) + yyv339 := &x.ObjectMeta + yyv339.CodecDecodeSelf(d) } yyj338++ if yyhl338 { @@ -4157,14 +4125,46 @@ func (x *ThirdPartyResource) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.Versions = nil } else { - yyv343 := &x.Versions - yym344 := z.DecBinary() - _ = yym344 + yyv341 := &x.Versions + yym342 := z.DecBinary() + _ = yym342 if false { } else { - h.decSliceAPIVersion((*[]APIVersion)(yyv343), d) + h.decSliceAPIVersion((*[]APIVersion)(yyv341), d) } } + yyj338++ + if yyhl338 { + yyb338 = yyj338 > l + } else { + yyb338 = r.CheckBreak() + } + if yyb338 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj338++ + if yyhl338 { + yyb338 = yyj338 > l + } else { + yyb338 = r.CheckBreak() + } + if yyb338 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { yyj338++ if yyhl338 { @@ -4198,9 +4198,9 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq346 [4]bool _, _, _ = yysep346, yyq346, yy2arr346 const yyr346 bool = false - yyq346[0] = x.Kind != "" - yyq346[1] = x.APIVersion != "" - yyq346[2] = true + yyq346[0] = true + yyq346[2] = x.Kind != "" + yyq346[3] = x.APIVersion != "" var yynn346 int if yyr346 || yy2arr346 { r.EncodeArrayStart(4) @@ -4217,79 +4217,29 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if yyr346 || yy2arr346 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq346[0] { - yym348 := z.EncBinary() - _ = yym348 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq346[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy348 := &x.ListMeta yym349 := z.EncBinary() _ = yym349 if false { + } else if z.HasExtensions() && z.EncExt(yy348) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr346 || yy2arr346 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq346[1] { - yym351 := z.EncBinary() - _ = yym351 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq346[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym352 := z.EncBinary() - _ = yym352 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr346 || yy2arr346 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq346[2] { - yy354 := &x.ListMeta - yym355 := z.EncBinary() - _ = yym355 - if false { - } else if z.HasExtensions() && z.EncExt(yy354) { - } else { - z.EncFallback(yy354) + z.EncFallback(yy348) } } else { r.EncodeNil() } } else { - if yyq346[2] { + if yyq346[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy356 := &x.ListMeta - yym357 := z.EncBinary() - _ = yym357 + yy350 := &x.ListMeta + yym351 := z.EncBinary() + _ = yym351 if false { - } else if z.HasExtensions() && z.EncExt(yy356) { + } else if z.HasExtensions() && z.EncExt(yy350) { } else { - z.EncFallback(yy356) + z.EncFallback(yy350) } } } @@ -4298,8 +4248,8 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym359 := z.EncBinary() - _ = yym359 + yym353 := z.EncBinary() + _ = yym353 if false { } else { h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) @@ -4312,11 +4262,61 @@ func (x *ThirdPartyResourceList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { + yym354 := z.EncBinary() + _ = yym354 + if false { + } else { + h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) + } + } + } + if yyr346 || yy2arr346 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq346[2] { + yym356 := z.EncBinary() + _ = yym356 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq346[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym357 := z.EncBinary() + _ = yym357 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr346 || yy2arr346 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq346[3] { + yym359 := z.EncBinary() + _ = yym359 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq346[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym360 := z.EncBinary() _ = yym360 if false { } else { - h.encSliceThirdPartyResource(([]ThirdPartyResource)(x.Items), e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -4381,6 +4381,31 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromMap(l int, d *codec1978.Deco yys363 := string(yys363Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys363 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv364 := &x.ListMeta + yym365 := z.DecBinary() + _ = yym365 + if false { + } else if z.HasExtensions() && z.DecExt(yyv364) { + } else { + z.DecFallback(yyv364, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv366 := &x.Items + yym367 := z.DecBinary() + _ = yym367 + if false { + } else { + h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv366), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4393,31 +4418,6 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv366 := &x.ListMeta - yym367 := z.DecBinary() - _ = yym367 - if false { - } else if z.HasExtensions() && z.DecExt(yyv366) { - } else { - z.DecFallback(yyv366, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv368 := &x.Items - yym369 := z.DecBinary() - _ = yym369 - if false { - } else { - h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv368), d) - } - } default: z.DecStructFieldNotFound(-1, yys363) } // end switch yys363 @@ -4443,6 +4443,51 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromArray(l int, d *codec1978.De return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv371 := &x.ListMeta + yym372 := z.DecBinary() + _ = yym372 + if false { + } else if z.HasExtensions() && z.DecExt(yyv371) { + } else { + z.DecFallback(yyv371, false) + } + } + yyj370++ + if yyhl370 { + yyb370 = yyj370 > l + } else { + yyb370 = r.CheckBreak() + } + if yyb370 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv373 := &x.Items + yym374 := z.DecBinary() + _ = yym374 + if false { + } else { + h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv373), d) + } + } + yyj370++ + if yyhl370 { + yyb370 = yyj370 > l + } else { + yyb370 = r.CheckBreak() + } + if yyb370 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -4464,51 +4509,6 @@ func (x *ThirdPartyResourceList) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - yyj370++ - if yyhl370 { - yyb370 = yyj370 > l - } else { - yyb370 = r.CheckBreak() - } - if yyb370 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv373 := &x.ListMeta - yym374 := z.DecBinary() - _ = yym374 - if false { - } else if z.HasExtensions() && z.DecExt(yyv373) { - } else { - z.DecFallback(yyv373, false) - } - } - yyj370++ - if yyhl370 { - yyb370 = yyj370 > l - } else { - yyb370 = r.CheckBreak() - } - if yyb370 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv375 := &x.Items - yym376 := z.DecBinary() - _ = yym376 - if false { - } else { - h.decSliceThirdPartyResource((*[]ThirdPartyResource)(yyv375), d) - } - } for { yyj370++ if yyhl370 { @@ -4759,10 +4759,10 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { var yyq394 [4]bool _, _, _ = yysep394, yyq394, yy2arr394 const yyr394 bool = false - yyq394[0] = x.Kind != "" - yyq394[1] = x.APIVersion != "" - yyq394[2] = true - yyq394[3] = len(x.Data) != 0 + yyq394[0] = true + yyq394[1] = len(x.Data) != 0 + yyq394[2] = x.Kind != "" + yyq394[3] = x.APIVersion != "" var yynn394 int if yyr394 || yy2arr394 { r.EncodeArrayStart(4) @@ -4779,78 +4779,28 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq394[0] { - yym396 := z.EncBinary() - _ = yym396 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq394[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym397 := z.EncBinary() - _ = yym397 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr394 || yy2arr394 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[1] { - yym399 := z.EncBinary() - _ = yym399 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq394[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym400 := z.EncBinary() - _ = yym400 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr394 || yy2arr394 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[2] { - yy402 := &x.ObjectMeta - yy402.CodecEncodeSelf(e) + yy396 := &x.ObjectMeta + yy396.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq394[2] { + if yyq394[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy403 := &x.ObjectMeta - yy403.CodecEncodeSelf(e) + yy397 := &x.ObjectMeta + yy397.CodecEncodeSelf(e) } } if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq394[3] { + if yyq394[1] { if x.Data == nil { r.EncodeNil() } else { - yym405 := z.EncBinary() - _ = yym405 + yym399 := z.EncBinary() + _ = yym399 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -4860,15 +4810,15 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq394[3] { + if yyq394[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("data")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Data == nil { r.EncodeNil() } else { - yym406 := z.EncBinary() - _ = yym406 + yym400 := z.EncBinary() + _ = yym400 if false { } else { r.EncodeStringBytes(codecSelferC_RAW1234, []byte(x.Data)) @@ -4876,6 +4826,56 @@ func (x *ThirdPartyResourceData) CodecEncodeSelf(e *codec1978.Encoder) { } } } + if yyr394 || yy2arr394 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq394[2] { + yym402 := z.EncBinary() + _ = yym402 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq394[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym403 := z.EncBinary() + _ = yym403 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr394 || yy2arr394 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq394[3] { + yym405 := z.EncBinary() + _ = yym405 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq394[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym406 := z.EncBinary() + _ = yym406 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr394 || yy2arr394 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -4937,6 +4937,25 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromMap(l int, d *codec1978.Deco yys409 := string(yys409Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys409 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv410 := &x.ObjectMeta + yyv410.CodecDecodeSelf(d) + } + case "data": + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv411 := &x.Data + yym412 := z.DecBinary() + _ = yym412 + if false { + } else { + *yyv411 = r.DecodeBytes(*(*[]byte)(yyv411), false, false) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -4949,25 +4968,6 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromMap(l int, d *codec1978.Deco } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv412 := &x.ObjectMeta - yyv412.CodecDecodeSelf(d) - } - case "data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv413 := &x.Data - yym414 := z.DecBinary() - _ = yym414 - if false { - } else { - *yyv413 = r.DecodeBytes(*(*[]byte)(yyv413), false, false) - } - } default: z.DecStructFieldNotFound(-1, yys409) } // end switch yys409 @@ -4993,6 +4993,45 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromArray(l int, d *codec1978.De return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv416 := &x.ObjectMeta + yyv416.CodecDecodeSelf(d) + } + yyj415++ + if yyhl415 { + yyb415 = yyj415 > l + } else { + yyb415 = r.CheckBreak() + } + if yyb415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Data = nil + } else { + yyv417 := &x.Data + yym418 := z.DecBinary() + _ = yym418 + if false { + } else { + *yyv417 = r.DecodeBytes(*(*[]byte)(yyv417), false, false) + } + } + yyj415++ + if yyhl415 { + yyb415 = yyj415 > l + } else { + yyb415 = r.CheckBreak() + } + if yyb415 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -5014,45 +5053,6 @@ func (x *ThirdPartyResourceData) codecDecodeSelfFromArray(l int, d *codec1978.De } else { x.APIVersion = string(r.DecodeString()) } - yyj415++ - if yyhl415 { - yyb415 = yyj415 > l - } else { - yyb415 = r.CheckBreak() - } - if yyb415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv418 := &x.ObjectMeta - yyv418.CodecDecodeSelf(d) - } - yyj415++ - if yyhl415 { - yyb415 = yyj415 > l - } else { - yyb415 = r.CheckBreak() - } - if yyb415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv419 := &x.Data - yym420 := z.DecBinary() - _ = yym420 - if false { - } else { - *yyv419 = r.DecodeBytes(*(*[]byte)(yyv419), false, false) - } - } for { yyj415++ if yyhl415 { @@ -5086,11 +5086,11 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { var yyq422 [5]bool _, _, _ = yysep422, yyq422, yy2arr422 const yyr422 bool = false - yyq422[0] = x.Kind != "" - yyq422[1] = x.APIVersion != "" + yyq422[0] = true + yyq422[1] = true yyq422[2] = true - yyq422[3] = true - yyq422[4] = true + yyq422[3] = x.Kind != "" + yyq422[4] = x.APIVersion != "" var yynn422 int if yyr422 || yy2arr422 { r.EncodeArrayStart(5) @@ -5107,57 +5107,41 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[0] { - yym424 := z.EncBinary() - _ = yym424 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy424 := &x.ObjectMeta + yy424.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq422[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym425 := z.EncBinary() - _ = yym425 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } + yy425 := &x.ObjectMeta + yy425.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[1] { - yym427 := z.EncBinary() - _ = yym427 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy427 := &x.Spec + yy427.CodecEncodeSelf(e) } else { - r.EncodeString(codecSelferC_UTF81234, "") + r.EncodeNil() } } else { if yyq422[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym428 := z.EncBinary() - _ = yym428 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } + yy428 := &x.Spec + yy428.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[2] { - yy430 := &x.ObjectMeta + yy430 := &x.Status yy430.CodecEncodeSelf(e) } else { r.EncodeNil() @@ -5165,44 +5149,60 @@ func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq422[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) + r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy431 := &x.ObjectMeta + yy431 := &x.Status yy431.CodecEncodeSelf(e) } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[3] { - yy433 := &x.Spec - yy433.CodecEncodeSelf(e) + yym433 := z.EncBinary() + _ = yym433 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq422[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) + r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy434 := &x.Spec - yy434.CodecEncodeSelf(e) + yym434 := z.EncBinary() + _ = yym434 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } } } if yyr422 || yy2arr422 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq422[4] { - yy436 := &x.Status - yy436.CodecEncodeSelf(e) + yym436 := z.EncBinary() + _ = yym436 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF81234, "") } } else { if yyq422[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy437 := &x.Status - yy437.CodecEncodeSelf(e) + yym437 := z.EncBinary() + _ = yym437 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } } } if yyr422 || yy2arr422 { @@ -5266,6 +5266,27 @@ func (x *Deployment) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys440 := string(yys440Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys440 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv441 := &x.ObjectMeta + yyv441.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = DeploymentSpec{} + } else { + yyv442 := &x.Spec + yyv442.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = DeploymentStatus{} + } else { + yyv443 := &x.Status + yyv443.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -5278,27 +5299,6 @@ func (x *Deployment) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv443 := &x.ObjectMeta - yyv443.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = DeploymentSpec{} - } else { - yyv444 := &x.Spec - yyv444.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = DeploymentStatus{} - } else { - yyv445 := &x.Status - yyv445.CodecDecodeSelf(d) - } default: z.DecStructFieldNotFound(-1, yys440) } // end switch yys440 @@ -5324,6 +5324,57 @@ func (x *Deployment) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv447 := &x.ObjectMeta + yyv447.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = DeploymentSpec{} + } else { + yyv448 := &x.Spec + yyv448.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = DeploymentStatus{} + } else { + yyv449 := &x.Status + yyv449.CodecDecodeSelf(d) + } + yyj446++ + if yyhl446 { + yyb446 = yyj446 > l + } else { + yyb446 = r.CheckBreak() + } + if yyb446 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -5345,57 +5396,6 @@ func (x *Deployment) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv449 := &x.ObjectMeta - yyv449.CodecDecodeSelf(d) - } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = DeploymentSpec{} - } else { - yyv450 := &x.Spec - yyv450.CodecDecodeSelf(d) - } - yyj446++ - if yyhl446 { - yyb446 = yyj446 > l - } else { - yyb446 = r.CheckBreak() - } - if yyb446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = DeploymentStatus{} - } else { - yyv451 := &x.Status - yyv451.CodecDecodeSelf(d) - } for { yyj446++ if yyhl446 { @@ -5430,10 +5430,10 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { _, _, _ = yysep453, yyq453, yy2arr453 const yyr453 bool = false yyq453[0] = x.Replicas != nil - yyq453[1] = len(x.Selector) != 0 + yyq453[1] = x.Selector != nil yyq453[3] = true - yyq453[4] = x.RevisionHistoryLimit != nil - yyq453[5] = x.UniqueLabelKey != nil + yyq453[4] = x.MinReadySeconds != 0 + yyq453[5] = x.RevisionHistoryLimit != nil yyq453[6] = x.Paused != false yyq453[7] = x.RollbackTo != nil var yynn453 int @@ -5490,12 +5490,7 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Selector == nil { r.EncodeNil() } else { - yym460 := z.EncBinary() - _ = yym460 - if false { - } else { - z.F.EncMapStringStringV(x.Selector, false, e) - } + x.Selector.CodecEncodeSelf(e) } } else { r.EncodeNil() @@ -5508,31 +5503,26 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.Selector == nil { r.EncodeNil() } else { - yym461 := z.EncBinary() - _ = yym461 - if false { - } else { - z.F.EncMapStringStringV(x.Selector, false, e) - } + x.Selector.CodecEncodeSelf(e) } } } if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy463 := &x.Template - yy463.CodecEncodeSelf(e) + yy461 := &x.Template + yy461.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy464 := &x.Template - yy464.CodecEncodeSelf(e) + yy462 := &x.Template + yy462.CodecEncodeSelf(e) } if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq453[3] { - yy466 := &x.Strategy - yy466.CodecEncodeSelf(e) + yy464 := &x.Strategy + yy464.CodecEncodeSelf(e) } else { r.EncodeNil() } @@ -5541,76 +5531,66 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("strategy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy467 := &x.Strategy - yy467.CodecEncodeSelf(e) + yy465 := &x.Strategy + yy465.CodecEncodeSelf(e) } } if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq453[4] { + yym467 := z.EncBinary() + _ = yym467 + if false { + } else { + r.EncodeInt(int64(x.MinReadySeconds)) + } + } else { + r.EncodeInt(0) + } + } else { + if yyq453[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym468 := z.EncBinary() + _ = yym468 + if false { + } else { + r.EncodeInt(int64(x.MinReadySeconds)) + } + } + } + if yyr453 || yy2arr453 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq453[5] { if x.RevisionHistoryLimit == nil { r.EncodeNil() } else { - yy469 := *x.RevisionHistoryLimit - yym470 := z.EncBinary() - _ = yym470 + yy470 := *x.RevisionHistoryLimit + yym471 := z.EncBinary() + _ = yym471 if false { } else { - r.EncodeInt(int64(yy469)) + r.EncodeInt(int64(yy470)) } } } else { r.EncodeNil() } } else { - if yyq453[4] { + if yyq453[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("revisionHistoryLimit")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.RevisionHistoryLimit == nil { r.EncodeNil() } else { - yy471 := *x.RevisionHistoryLimit - yym472 := z.EncBinary() - _ = yym472 + yy472 := *x.RevisionHistoryLimit + yym473 := z.EncBinary() + _ = yym473 if false { } else { - r.EncodeInt(int64(yy471)) - } - } - } - } - if yyr453 || yy2arr453 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq453[5] { - if x.UniqueLabelKey == nil { - r.EncodeNil() - } else { - yy474 := *x.UniqueLabelKey - yym475 := z.EncBinary() - _ = yym475 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(yy474)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq453[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("uniqueLabelKey")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.UniqueLabelKey == nil { - r.EncodeNil() - } else { - yy476 := *x.UniqueLabelKey - yym477 := z.EncBinary() - _ = yym477 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(yy476)) + r.EncodeInt(int64(yy472)) } } } @@ -5618,8 +5598,8 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { if yyr453 || yy2arr453 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq453[6] { - yym479 := z.EncBinary() - _ = yym479 + yym475 := z.EncBinary() + _ = yym475 if false { } else { r.EncodeBool(bool(x.Paused)) @@ -5632,8 +5612,8 @@ func (x *DeploymentSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("paused")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym480 := z.EncBinary() - _ = yym480 + yym476 := z.EncBinary() + _ = yym476 if false { } else { r.EncodeBool(bool(x.Paused)) @@ -5676,25 +5656,25 @@ func (x *DeploymentSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym482 := z.DecBinary() - _ = yym482 + yym478 := z.DecBinary() + _ = yym478 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct483 := r.ContainerType() - if yyct483 == codecSelferValueTypeMap1234 { - yyl483 := r.ReadMapStart() - if yyl483 == 0 { + yyct479 := r.ContainerType() + if yyct479 == codecSelferValueTypeMap1234 { + yyl479 := r.ReadMapStart() + if yyl479 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl483, d) + x.codecDecodeSelfFromMap(yyl479, d) } - } else if yyct483 == codecSelferValueTypeArray1234 { - yyl483 := r.ReadArrayStart() - if yyl483 == 0 { + } else if yyct479 == codecSelferValueTypeArray1234 { + yyl479 := r.ReadArrayStart() + if yyl479 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl483, d) + x.codecDecodeSelfFromArray(yyl479, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -5706,12 +5686,12 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys484Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys484Slc - var yyhl484 bool = l >= 0 - for yyj484 := 0; ; yyj484++ { - if yyhl484 { - if yyj484 >= l { + var yys480Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys480Slc + var yyhl480 bool = l >= 0 + for yyj480 := 0; ; yyj480++ { + if yyhl480 { + if yyj480 >= l { break } } else { @@ -5720,10 +5700,10 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys484Slc = r.DecodeBytes(yys484Slc, true, true) - yys484 := string(yys484Slc) + yys480Slc = r.DecodeBytes(yys480Slc, true, true) + yys480 := string(yys480Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys484 { + switch yys480 { case "replicas": if r.TryDecodeAsNil() { if x.Replicas != nil { @@ -5733,8 +5713,8 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Replicas == nil { x.Replicas = new(int32) } - yym486 := z.DecBinary() - _ = yym486 + yym482 := z.DecBinary() + _ = yym482 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) @@ -5742,29 +5722,34 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } case "selector": if r.TryDecodeAsNil() { - x.Selector = nil - } else { - yyv487 := &x.Selector - yym488 := z.DecBinary() - _ = yym488 - if false { - } else { - z.F.DecMapStringStringX(yyv487, false, d) + if x.Selector != nil { + x.Selector = nil } + } else { + if x.Selector == nil { + x.Selector = new(LabelSelector) + } + x.Selector.CodecDecodeSelf(d) } case "template": if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv489 := &x.Template - yyv489.CodecDecodeSelf(d) + yyv484 := &x.Template + yyv484.CodecDecodeSelf(d) } case "strategy": if r.TryDecodeAsNil() { x.Strategy = DeploymentStrategy{} } else { - yyv490 := &x.Strategy - yyv490.CodecDecodeSelf(d) + yyv485 := &x.Strategy + yyv485.CodecDecodeSelf(d) + } + case "minReadySeconds": + if r.TryDecodeAsNil() { + x.MinReadySeconds = 0 + } else { + x.MinReadySeconds = int32(r.DecodeInt(32)) } case "revisionHistoryLimit": if r.TryDecodeAsNil() { @@ -5775,29 +5760,13 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.RevisionHistoryLimit == nil { x.RevisionHistoryLimit = new(int32) } - yym492 := z.DecBinary() - _ = yym492 + yym488 := z.DecBinary() + _ = yym488 if false { } else { *((*int32)(x.RevisionHistoryLimit)) = int32(r.DecodeInt(32)) } } - case "uniqueLabelKey": - if r.TryDecodeAsNil() { - if x.UniqueLabelKey != nil { - x.UniqueLabelKey = nil - } - } else { - if x.UniqueLabelKey == nil { - x.UniqueLabelKey = new(string) - } - yym494 := z.DecBinary() - _ = yym494 - if false { - } else { - *((*string)(x.UniqueLabelKey)) = r.DecodeString() - } - } case "paused": if r.TryDecodeAsNil() { x.Paused = false @@ -5816,9 +5785,9 @@ func (x *DeploymentSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.RollbackTo.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys484) - } // end switch yys484 - } // end for yyj484 + z.DecStructFieldNotFound(-1, yys480) + } // end switch yys480 + } // end for yyj480 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -5826,16 +5795,16 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj497 int - var yyb497 bool - var yyhl497 bool = l >= 0 - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + var yyj491 int + var yyb491 bool + var yyhl491 bool = l >= 0 + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5848,42 +5817,41 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Replicas == nil { x.Replicas = new(int32) } - yym499 := z.DecBinary() - _ = yym499 + yym493 := z.DecBinary() + _ = yym493 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) } } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Selector = nil - } else { - yyv500 := &x.Selector - yym501 := z.DecBinary() - _ = yym501 - if false { - } else { - z.F.DecMapStringStringX(yyv500, false, d) + if x.Selector != nil { + x.Selector = nil } - } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l } else { - yyb497 = r.CheckBreak() + if x.Selector == nil { + x.Selector = new(LabelSelector) + } + x.Selector.CodecDecodeSelf(d) } - if yyb497 { + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l + } else { + yyb491 = r.CheckBreak() + } + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5891,16 +5859,16 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv502 := &x.Template - yyv502.CodecDecodeSelf(d) + yyv495 := &x.Template + yyv495.CodecDecodeSelf(d) } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5908,16 +5876,32 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Strategy = DeploymentStrategy{} } else { - yyv503 := &x.Strategy - yyv503.CodecDecodeSelf(d) + yyv496 := &x.Strategy + yyv496.CodecDecodeSelf(d) } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.MinReadySeconds = 0 + } else { + x.MinReadySeconds = int32(r.DecodeInt(32)) + } + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l + } else { + yyb491 = r.CheckBreak() + } + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5930,46 +5914,20 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.RevisionHistoryLimit == nil { x.RevisionHistoryLimit = new(int32) } - yym505 := z.DecBinary() - _ = yym505 + yym499 := z.DecBinary() + _ = yym499 if false { } else { *((*int32)(x.RevisionHistoryLimit)) = int32(r.DecodeInt(32)) } } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.UniqueLabelKey != nil { - x.UniqueLabelKey = nil - } - } else { - if x.UniqueLabelKey == nil { - x.UniqueLabelKey = new(string) - } - yym507 := z.DecBinary() - _ = yym507 - if false { - } else { - *((*string)(x.UniqueLabelKey)) = r.DecodeString() - } - } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l - } else { - yyb497 = r.CheckBreak() - } - if yyb497 { + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -5979,13 +5937,13 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Paused = bool(r.DecodeBool()) } - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6001,17 +5959,17 @@ func (x *DeploymentSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.RollbackTo.CodecDecodeSelf(d) } for { - yyj497++ - if yyhl497 { - yyb497 = yyj497 > l + yyj491++ + if yyhl491 { + yyb491 = yyj491 > l } else { - yyb497 = r.CheckBreak() + yyb491 = r.CheckBreak() } - if yyb497 { + if yyb491 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj497-1, "") + z.DecStructFieldNotFound(yyj491-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6023,86 +5981,36 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym510 := z.EncBinary() - _ = yym510 + yym502 := z.EncBinary() + _ = yym502 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep511 := !z.EncBinary() - yy2arr511 := z.EncBasicHandle().StructToArray - var yyq511 [5]bool - _, _, _ = yysep511, yyq511, yy2arr511 - const yyr511 bool = false - yyq511[0] = x.Kind != "" - yyq511[1] = x.APIVersion != "" - yyq511[3] = len(x.UpdatedAnnotations) != 0 - var yynn511 int - if yyr511 || yy2arr511 { + yysep503 := !z.EncBinary() + yy2arr503 := z.EncBasicHandle().StructToArray + var yyq503 [5]bool + _, _, _ = yysep503, yyq503, yy2arr503 + const yyr503 bool = false + yyq503[1] = len(x.UpdatedAnnotations) != 0 + yyq503[3] = x.Kind != "" + yyq503[4] = x.APIVersion != "" + var yynn503 int + if yyr503 || yy2arr503 { r.EncodeArrayStart(5) } else { - yynn511 = 2 - for _, b := range yyq511 { + yynn503 = 2 + for _, b := range yyq503 { if b { - yynn511++ + yynn503++ } } - r.EncodeMapStart(yynn511) - yynn511 = 0 + r.EncodeMapStart(yynn503) + yynn503 = 0 } - if yyr511 || yy2arr511 { + if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq511[0] { - yym513 := z.EncBinary() - _ = yym513 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq511[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym514 := z.EncBinary() - _ = yym514 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr511 || yy2arr511 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq511[1] { - yym516 := z.EncBinary() - _ = yym516 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq511[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym517 := z.EncBinary() - _ = yym517 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr511 || yy2arr511 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym519 := z.EncBinary() - _ = yym519 + yym505 := z.EncBinary() + _ = yym505 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) @@ -6111,21 +6019,21 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("name")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym520 := z.EncBinary() - _ = yym520 + yym506 := z.EncBinary() + _ = yym506 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Name)) } } - if yyr511 || yy2arr511 { + if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq511[3] { + if yyq503[1] { if x.UpdatedAnnotations == nil { r.EncodeNil() } else { - yym522 := z.EncBinary() - _ = yym522 + yym508 := z.EncBinary() + _ = yym508 if false { } else { z.F.EncMapStringStringV(x.UpdatedAnnotations, false, e) @@ -6135,15 +6043,15 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq511[3] { + if yyq503[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("updatedAnnotations")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.UpdatedAnnotations == nil { r.EncodeNil() } else { - yym523 := z.EncBinary() - _ = yym523 + yym509 := z.EncBinary() + _ = yym509 if false { } else { z.F.EncMapStringStringV(x.UpdatedAnnotations, false, e) @@ -6151,18 +6059,68 @@ func (x *DeploymentRollback) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr511 || yy2arr511 { + if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy525 := &x.RollbackTo - yy525.CodecEncodeSelf(e) + yy511 := &x.RollbackTo + yy511.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rollbackTo")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy526 := &x.RollbackTo - yy526.CodecEncodeSelf(e) + yy512 := &x.RollbackTo + yy512.CodecEncodeSelf(e) } - if yyr511 || yy2arr511 { + if yyr503 || yy2arr503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq503[3] { + yym514 := z.EncBinary() + _ = yym514 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq503[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym515 := z.EncBinary() + _ = yym515 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr503 || yy2arr503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq503[4] { + yym517 := z.EncBinary() + _ = yym517 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq503[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym518 := z.EncBinary() + _ = yym518 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr503 || yy2arr503 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6175,25 +6133,25 @@ func (x *DeploymentRollback) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym527 := z.DecBinary() - _ = yym527 + yym519 := z.DecBinary() + _ = yym519 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct528 := r.ContainerType() - if yyct528 == codecSelferValueTypeMap1234 { - yyl528 := r.ReadMapStart() - if yyl528 == 0 { + yyct520 := r.ContainerType() + if yyct520 == codecSelferValueTypeMap1234 { + yyl520 := r.ReadMapStart() + if yyl520 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl528, d) + x.codecDecodeSelfFromMap(yyl520, d) } - } else if yyct528 == codecSelferValueTypeArray1234 { - yyl528 := r.ReadArrayStart() - if yyl528 == 0 { + } else if yyct520 == codecSelferValueTypeArray1234 { + yyl520 := r.ReadArrayStart() + if yyl520 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl528, d) + x.codecDecodeSelfFromArray(yyl520, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6205,12 +6163,12 @@ func (x *DeploymentRollback) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys529Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys529Slc - var yyhl529 bool = l >= 0 - for yyj529 := 0; ; yyj529++ { - if yyhl529 { - if yyj529 >= l { + var yys521Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys521Slc + var yyhl521 bool = l >= 0 + for yyj521 := 0; ; yyj521++ { + if yyhl521 { + if yyj521 >= l { break } } else { @@ -6219,10 +6177,35 @@ func (x *DeploymentRollback) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys529Slc = r.DecodeBytes(yys529Slc, true, true) - yys529 := string(yys529Slc) + yys521Slc = r.DecodeBytes(yys521Slc, true, true) + yys521 := string(yys521Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys529 { + switch yys521 { + case "name": + if r.TryDecodeAsNil() { + x.Name = "" + } else { + x.Name = string(r.DecodeString()) + } + case "updatedAnnotations": + if r.TryDecodeAsNil() { + x.UpdatedAnnotations = nil + } else { + yyv523 := &x.UpdatedAnnotations + yym524 := z.DecBinary() + _ = yym524 + if false { + } else { + z.F.DecMapStringStringX(yyv523, false, d) + } + } + case "rollbackTo": + if r.TryDecodeAsNil() { + x.RollbackTo = RollbackConfig{} + } else { + yyv525 := &x.RollbackTo + yyv525.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -6235,35 +6218,10 @@ func (x *DeploymentRollback) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - case "updatedAnnotations": - if r.TryDecodeAsNil() { - x.UpdatedAnnotations = nil - } else { - yyv533 := &x.UpdatedAnnotations - yym534 := z.DecBinary() - _ = yym534 - if false { - } else { - z.F.DecMapStringStringX(yyv533, false, d) - } - } - case "rollbackTo": - if r.TryDecodeAsNil() { - x.RollbackTo = RollbackConfig{} - } else { - yyv535 := &x.RollbackTo - yyv535.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys529) - } // end switch yys529 - } // end for yyj529 + z.DecStructFieldNotFound(-1, yys521) + } // end switch yys521 + } // end for yyj521 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6271,48 +6229,16 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj536 int - var yyb536 bool - var yyhl536 bool = l >= 0 - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l + var yyj528 int + var yyb528 bool + var yyhl528 bool = l >= 0 + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l } else { - yyb536 = r.CheckBreak() + yyb528 = r.CheckBreak() } - if yyb536 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l - } else { - yyb536 = r.CheckBreak() - } - if yyb536 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l - } else { - yyb536 = r.CheckBreak() - } - if yyb536 { + if yyb528 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6322,13 +6248,13 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Name = string(r.DecodeString()) } - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l } else { - yyb536 = r.CheckBreak() + yyb528 = r.CheckBreak() } - if yyb536 { + if yyb528 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6336,21 +6262,21 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.UpdatedAnnotations = nil } else { - yyv540 := &x.UpdatedAnnotations - yym541 := z.DecBinary() - _ = yym541 + yyv530 := &x.UpdatedAnnotations + yym531 := z.DecBinary() + _ = yym531 if false { } else { - z.F.DecMapStringStringX(yyv540, false, d) + z.F.DecMapStringStringX(yyv530, false, d) } } - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l } else { - yyb536 = r.CheckBreak() + yyb528 = r.CheckBreak() } - if yyb536 { + if yyb528 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6358,21 +6284,53 @@ func (x *DeploymentRollback) codecDecodeSelfFromArray(l int, d *codec1978.Decode if r.TryDecodeAsNil() { x.RollbackTo = RollbackConfig{} } else { - yyv542 := &x.RollbackTo - yyv542.CodecDecodeSelf(d) + yyv532 := &x.RollbackTo + yyv532.CodecDecodeSelf(d) + } + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l + } else { + yyb528 = r.CheckBreak() + } + if yyb528 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l + } else { + yyb528 = r.CheckBreak() + } + if yyb528 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) } for { - yyj536++ - if yyhl536 { - yyb536 = yyj536 > l + yyj528++ + if yyhl528 { + yyb528 = yyj528 > l } else { - yyb536 = r.CheckBreak() + yyb528 = r.CheckBreak() } - if yyb536 { + if yyb528 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj536-1, "") + z.DecStructFieldNotFound(yyj528-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6384,35 +6342,35 @@ func (x *RollbackConfig) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym543 := z.EncBinary() - _ = yym543 + yym535 := z.EncBinary() + _ = yym535 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep544 := !z.EncBinary() - yy2arr544 := z.EncBasicHandle().StructToArray - var yyq544 [1]bool - _, _, _ = yysep544, yyq544, yy2arr544 - const yyr544 bool = false - yyq544[0] = x.Revision != 0 - var yynn544 int - if yyr544 || yy2arr544 { + yysep536 := !z.EncBinary() + yy2arr536 := z.EncBasicHandle().StructToArray + var yyq536 [1]bool + _, _, _ = yysep536, yyq536, yy2arr536 + const yyr536 bool = false + yyq536[0] = x.Revision != 0 + var yynn536 int + if yyr536 || yy2arr536 { r.EncodeArrayStart(1) } else { - yynn544 = 0 - for _, b := range yyq544 { + yynn536 = 0 + for _, b := range yyq536 { if b { - yynn544++ + yynn536++ } } - r.EncodeMapStart(yynn544) - yynn544 = 0 + r.EncodeMapStart(yynn536) + yynn536 = 0 } - if yyr544 || yy2arr544 { + if yyr536 || yy2arr536 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq544[0] { - yym546 := z.EncBinary() - _ = yym546 + if yyq536[0] { + yym538 := z.EncBinary() + _ = yym538 if false { } else { r.EncodeInt(int64(x.Revision)) @@ -6421,19 +6379,19 @@ func (x *RollbackConfig) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq544[0] { + if yyq536[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("revision")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym547 := z.EncBinary() - _ = yym547 + yym539 := z.EncBinary() + _ = yym539 if false { } else { r.EncodeInt(int64(x.Revision)) } } } - if yyr544 || yy2arr544 { + if yyr536 || yy2arr536 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6446,25 +6404,25 @@ func (x *RollbackConfig) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym548 := z.DecBinary() - _ = yym548 + yym540 := z.DecBinary() + _ = yym540 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct549 := r.ContainerType() - if yyct549 == codecSelferValueTypeMap1234 { - yyl549 := r.ReadMapStart() - if yyl549 == 0 { + yyct541 := r.ContainerType() + if yyct541 == codecSelferValueTypeMap1234 { + yyl541 := r.ReadMapStart() + if yyl541 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl549, d) + x.codecDecodeSelfFromMap(yyl541, d) } - } else if yyct549 == codecSelferValueTypeArray1234 { - yyl549 := r.ReadArrayStart() - if yyl549 == 0 { + } else if yyct541 == codecSelferValueTypeArray1234 { + yyl541 := r.ReadArrayStart() + if yyl541 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl549, d) + x.codecDecodeSelfFromArray(yyl541, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6476,12 +6434,12 @@ func (x *RollbackConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys550Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys550Slc - var yyhl550 bool = l >= 0 - for yyj550 := 0; ; yyj550++ { - if yyhl550 { - if yyj550 >= l { + var yys542Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys542Slc + var yyhl542 bool = l >= 0 + for yyj542 := 0; ; yyj542++ { + if yyhl542 { + if yyj542 >= l { break } } else { @@ -6490,10 +6448,10 @@ func (x *RollbackConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys550Slc = r.DecodeBytes(yys550Slc, true, true) - yys550 := string(yys550Slc) + yys542Slc = r.DecodeBytes(yys542Slc, true, true) + yys542 := string(yys542Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys550 { + switch yys542 { case "revision": if r.TryDecodeAsNil() { x.Revision = 0 @@ -6501,9 +6459,9 @@ func (x *RollbackConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Revision = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys550) - } // end switch yys550 - } // end for yyj550 + z.DecStructFieldNotFound(-1, yys542) + } // end switch yys542 + } // end for yyj542 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6511,16 +6469,16 @@ func (x *RollbackConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj552 int - var yyb552 bool - var yyhl552 bool = l >= 0 - yyj552++ - if yyhl552 { - yyb552 = yyj552 > l + var yyj544 int + var yyb544 bool + var yyhl544 bool = l >= 0 + yyj544++ + if yyhl544 { + yyb544 = yyj544 > l } else { - yyb552 = r.CheckBreak() + yyb544 = r.CheckBreak() } - if yyb552 { + if yyb544 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6531,17 +6489,17 @@ func (x *RollbackConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Revision = int64(r.DecodeInt(64)) } for { - yyj552++ - if yyhl552 { - yyb552 = yyj552 > l + yyj544++ + if yyhl544 { + yyb544 = yyj544 > l } else { - yyb552 = r.CheckBreak() + yyb544 = r.CheckBreak() } - if yyb552 { + if yyb544 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj552-1, "") + z.DecStructFieldNotFound(yyj544-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6553,49 +6511,49 @@ func (x *DeploymentStrategy) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym554 := z.EncBinary() - _ = yym554 + yym546 := z.EncBinary() + _ = yym546 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep555 := !z.EncBinary() - yy2arr555 := z.EncBasicHandle().StructToArray - var yyq555 [2]bool - _, _, _ = yysep555, yyq555, yy2arr555 - const yyr555 bool = false - yyq555[0] = x.Type != "" - yyq555[1] = x.RollingUpdate != nil - var yynn555 int - if yyr555 || yy2arr555 { + yysep547 := !z.EncBinary() + yy2arr547 := z.EncBasicHandle().StructToArray + var yyq547 [2]bool + _, _, _ = yysep547, yyq547, yy2arr547 + const yyr547 bool = false + yyq547[0] = x.Type != "" + yyq547[1] = x.RollingUpdate != nil + var yynn547 int + if yyr547 || yy2arr547 { r.EncodeArrayStart(2) } else { - yynn555 = 0 - for _, b := range yyq555 { + yynn547 = 0 + for _, b := range yyq547 { if b { - yynn555++ + yynn547++ } } - r.EncodeMapStart(yynn555) - yynn555 = 0 + r.EncodeMapStart(yynn547) + yynn547 = 0 } - if yyr555 || yy2arr555 { + if yyr547 || yy2arr547 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq555[0] { + if yyq547[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq555[0] { + if yyq547[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr555 || yy2arr555 { + if yyr547 || yy2arr547 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq555[1] { + if yyq547[1] { if x.RollingUpdate == nil { r.EncodeNil() } else { @@ -6605,7 +6563,7 @@ func (x *DeploymentStrategy) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq555[1] { + if yyq547[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rollingUpdate")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -6616,7 +6574,7 @@ func (x *DeploymentStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr555 || yy2arr555 { + if yyr547 || yy2arr547 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6629,25 +6587,25 @@ func (x *DeploymentStrategy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym558 := z.DecBinary() - _ = yym558 + yym550 := z.DecBinary() + _ = yym550 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct559 := r.ContainerType() - if yyct559 == codecSelferValueTypeMap1234 { - yyl559 := r.ReadMapStart() - if yyl559 == 0 { + yyct551 := r.ContainerType() + if yyct551 == codecSelferValueTypeMap1234 { + yyl551 := r.ReadMapStart() + if yyl551 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl559, d) + x.codecDecodeSelfFromMap(yyl551, d) } - } else if yyct559 == codecSelferValueTypeArray1234 { - yyl559 := r.ReadArrayStart() - if yyl559 == 0 { + } else if yyct551 == codecSelferValueTypeArray1234 { + yyl551 := r.ReadArrayStart() + if yyl551 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl559, d) + x.codecDecodeSelfFromArray(yyl551, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6659,12 +6617,12 @@ func (x *DeploymentStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys560Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys560Slc - var yyhl560 bool = l >= 0 - for yyj560 := 0; ; yyj560++ { - if yyhl560 { - if yyj560 >= l { + var yys552Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys552Slc + var yyhl552 bool = l >= 0 + for yyj552 := 0; ; yyj552++ { + if yyhl552 { + if yyj552 >= l { break } } else { @@ -6673,10 +6631,10 @@ func (x *DeploymentStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys560Slc = r.DecodeBytes(yys560Slc, true, true) - yys560 := string(yys560Slc) + yys552Slc = r.DecodeBytes(yys552Slc, true, true) + yys552 := string(yys552Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys560 { + switch yys552 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -6695,9 +6653,9 @@ func (x *DeploymentStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) x.RollingUpdate.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys560) - } // end switch yys560 - } // end for yyj560 + z.DecStructFieldNotFound(-1, yys552) + } // end switch yys552 + } // end for yyj552 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -6705,16 +6663,16 @@ func (x *DeploymentStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decode var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj563 int - var yyb563 bool - var yyhl563 bool = l >= 0 - yyj563++ - if yyhl563 { - yyb563 = yyj563 > l + var yyj555 int + var yyb555 bool + var yyhl555 bool = l >= 0 + yyj555++ + if yyhl555 { + yyb555 = yyj555 > l } else { - yyb563 = r.CheckBreak() + yyb555 = r.CheckBreak() } - if yyb563 { + if yyb555 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6724,13 +6682,13 @@ func (x *DeploymentStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decode } else { x.Type = DeploymentStrategyType(r.DecodeString()) } - yyj563++ - if yyhl563 { - yyb563 = yyj563 > l + yyj555++ + if yyhl555 { + yyb555 = yyj555 > l } else { - yyb563 = r.CheckBreak() + yyb555 = r.CheckBreak() } - if yyb563 { + if yyb555 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -6746,17 +6704,17 @@ func (x *DeploymentStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decode x.RollingUpdate.CodecDecodeSelf(d) } for { - yyj563++ - if yyhl563 { - yyb563 = yyj563 > l + yyj555++ + if yyhl555 { + yyb555 = yyj555 > l } else { - yyb563 = r.CheckBreak() + yyb555 = r.CheckBreak() } - if yyb563 { + if yyb555 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj563-1, "") + z.DecStructFieldNotFound(yyj555-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -6765,8 +6723,8 @@ func (x DeploymentStrategyType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym566 := z.EncBinary() - _ = yym566 + yym558 := z.EncBinary() + _ = yym558 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -6778,8 +6736,8 @@ func (x *DeploymentStrategyType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym567 := z.DecBinary() - _ = yym567 + yym559 := z.DecBinary() + _ = yym559 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -6794,43 +6752,42 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym568 := z.EncBinary() - _ = yym568 + yym560 := z.EncBinary() + _ = yym560 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep569 := !z.EncBinary() - yy2arr569 := z.EncBasicHandle().StructToArray - var yyq569 [3]bool - _, _, _ = yysep569, yyq569, yy2arr569 - const yyr569 bool = false - yyq569[0] = x.MaxUnavailable != nil - yyq569[1] = x.MaxSurge != nil - yyq569[2] = x.MinReadySeconds != 0 - var yynn569 int - if yyr569 || yy2arr569 { - r.EncodeArrayStart(3) + yysep561 := !z.EncBinary() + yy2arr561 := z.EncBasicHandle().StructToArray + var yyq561 [2]bool + _, _, _ = yysep561, yyq561, yy2arr561 + const yyr561 bool = false + yyq561[0] = x.MaxUnavailable != nil + yyq561[1] = x.MaxSurge != nil + var yynn561 int + if yyr561 || yy2arr561 { + r.EncodeArrayStart(2) } else { - yynn569 = 0 - for _, b := range yyq569 { + yynn561 = 0 + for _, b := range yyq561 { if b { - yynn569++ + yynn561++ } } - r.EncodeMapStart(yynn569) - yynn569 = 0 + r.EncodeMapStart(yynn561) + yynn561 = 0 } - if yyr569 || yy2arr569 { + if yyr561 || yy2arr561 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq569[0] { + if yyq561[0] { if x.MaxUnavailable == nil { r.EncodeNil() } else { - yym571 := z.EncBinary() - _ = yym571 + yym563 := z.EncBinary() + _ = yym563 if false { } else if z.HasExtensions() && z.EncExt(x.MaxUnavailable) { - } else if !yym571 && z.IsJSONHandle() { + } else if !yym563 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxUnavailable) } else { z.EncFallback(x.MaxUnavailable) @@ -6840,18 +6797,18 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq569[0] { + if yyq561[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxUnavailable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.MaxUnavailable == nil { r.EncodeNil() } else { - yym572 := z.EncBinary() - _ = yym572 + yym564 := z.EncBinary() + _ = yym564 if false { } else if z.HasExtensions() && z.EncExt(x.MaxUnavailable) { - } else if !yym572 && z.IsJSONHandle() { + } else if !yym564 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxUnavailable) } else { z.EncFallback(x.MaxUnavailable) @@ -6859,17 +6816,17 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr569 || yy2arr569 { + if yyr561 || yy2arr561 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq569[1] { + if yyq561[1] { if x.MaxSurge == nil { r.EncodeNil() } else { - yym574 := z.EncBinary() - _ = yym574 + yym566 := z.EncBinary() + _ = yym566 if false { } else if z.HasExtensions() && z.EncExt(x.MaxSurge) { - } else if !yym574 && z.IsJSONHandle() { + } else if !yym566 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxSurge) } else { z.EncFallback(x.MaxSurge) @@ -6879,18 +6836,18 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq569[1] { + if yyq561[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxSurge")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.MaxSurge == nil { r.EncodeNil() } else { - yym575 := z.EncBinary() - _ = yym575 + yym567 := z.EncBinary() + _ = yym567 if false { } else if z.HasExtensions() && z.EncExt(x.MaxSurge) { - } else if !yym575 && z.IsJSONHandle() { + } else if !yym567 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxSurge) } else { z.EncFallback(x.MaxSurge) @@ -6898,32 +6855,7 @@ func (x *RollingUpdateDeployment) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr569 || yy2arr569 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq569[2] { - yym577 := z.EncBinary() - _ = yym577 - if false { - } else { - r.EncodeInt(int64(x.MinReadySeconds)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq569[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym578 := z.EncBinary() - _ = yym578 - if false { - } else { - r.EncodeInt(int64(x.MinReadySeconds)) - } - } - } - if yyr569 || yy2arr569 { + if yyr561 || yy2arr561 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -6936,25 +6868,25 @@ func (x *RollingUpdateDeployment) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym579 := z.DecBinary() - _ = yym579 + yym568 := z.DecBinary() + _ = yym568 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct580 := r.ContainerType() - if yyct580 == codecSelferValueTypeMap1234 { - yyl580 := r.ReadMapStart() - if yyl580 == 0 { + yyct569 := r.ContainerType() + if yyct569 == codecSelferValueTypeMap1234 { + yyl569 := r.ReadMapStart() + if yyl569 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl580, d) + x.codecDecodeSelfFromMap(yyl569, d) } - } else if yyct580 == codecSelferValueTypeArray1234 { - yyl580 := r.ReadArrayStart() - if yyl580 == 0 { + } else if yyct569 == codecSelferValueTypeArray1234 { + yyl569 := r.ReadArrayStart() + if yyl569 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl580, d) + x.codecDecodeSelfFromArray(yyl569, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -6966,12 +6898,12 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys581Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys581Slc - var yyhl581 bool = l >= 0 - for yyj581 := 0; ; yyj581++ { - if yyhl581 { - if yyj581 >= l { + var yys570Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys570Slc + var yyhl570 bool = l >= 0 + for yyj570 := 0; ; yyj570++ { + if yyhl570 { + if yyj570 >= l { break } } else { @@ -6980,10 +6912,10 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys581Slc = r.DecodeBytes(yys581Slc, true, true) - yys581 := string(yys581Slc) + yys570Slc = r.DecodeBytes(yys570Slc, true, true) + yys570 := string(yys570Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys581 { + switch yys570 { case "maxUnavailable": if r.TryDecodeAsNil() { if x.MaxUnavailable != nil { @@ -6993,11 +6925,11 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec if x.MaxUnavailable == nil { x.MaxUnavailable = new(pkg6_intstr.IntOrString) } - yym583 := z.DecBinary() - _ = yym583 + yym572 := z.DecBinary() + _ = yym572 if false { } else if z.HasExtensions() && z.DecExt(x.MaxUnavailable) { - } else if !yym583 && z.IsJSONHandle() { + } else if !yym572 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxUnavailable) } else { z.DecFallback(x.MaxUnavailable, false) @@ -7012,26 +6944,20 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromMap(l int, d *codec1978.Dec if x.MaxSurge == nil { x.MaxSurge = new(pkg6_intstr.IntOrString) } - yym585 := z.DecBinary() - _ = yym585 + yym574 := z.DecBinary() + _ = yym574 if false { } else if z.HasExtensions() && z.DecExt(x.MaxSurge) { - } else if !yym585 && z.IsJSONHandle() { + } else if !yym574 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxSurge) } else { z.DecFallback(x.MaxSurge, false) } } - case "minReadySeconds": - if r.TryDecodeAsNil() { - x.MinReadySeconds = 0 - } else { - x.MinReadySeconds = int32(r.DecodeInt(32)) - } default: - z.DecStructFieldNotFound(-1, yys581) - } // end switch yys581 - } // end for yyj581 + z.DecStructFieldNotFound(-1, yys570) + } // end switch yys570 + } // end for yyj570 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7039,16 +6965,16 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj587 int - var yyb587 bool - var yyhl587 bool = l >= 0 - yyj587++ - if yyhl587 { - yyb587 = yyj587 > l + var yyj575 int + var yyb575 bool + var yyhl575 bool = l >= 0 + yyj575++ + if yyhl575 { + yyb575 = yyj575 > l } else { - yyb587 = r.CheckBreak() + yyb575 = r.CheckBreak() } - if yyb587 { + if yyb575 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7061,23 +6987,23 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D if x.MaxUnavailable == nil { x.MaxUnavailable = new(pkg6_intstr.IntOrString) } - yym589 := z.DecBinary() - _ = yym589 + yym577 := z.DecBinary() + _ = yym577 if false { } else if z.HasExtensions() && z.DecExt(x.MaxUnavailable) { - } else if !yym589 && z.IsJSONHandle() { + } else if !yym577 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxUnavailable) } else { z.DecFallback(x.MaxUnavailable, false) } } - yyj587++ - if yyhl587 { - yyb587 = yyj587 > l + yyj575++ + if yyhl575 { + yyb575 = yyj575 > l } else { - yyb587 = r.CheckBreak() + yyb575 = r.CheckBreak() } - if yyb587 { + if yyb575 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7090,44 +7016,28 @@ func (x *RollingUpdateDeployment) codecDecodeSelfFromArray(l int, d *codec1978.D if x.MaxSurge == nil { x.MaxSurge = new(pkg6_intstr.IntOrString) } - yym591 := z.DecBinary() - _ = yym591 + yym579 := z.DecBinary() + _ = yym579 if false { } else if z.HasExtensions() && z.DecExt(x.MaxSurge) { - } else if !yym591 && z.IsJSONHandle() { + } else if !yym579 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxSurge) } else { z.DecFallback(x.MaxSurge, false) } } - yyj587++ - if yyhl587 { - yyb587 = yyj587 > l - } else { - yyb587 = r.CheckBreak() - } - if yyb587 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MinReadySeconds = 0 - } else { - x.MinReadySeconds = int32(r.DecodeInt(32)) - } for { - yyj587++ - if yyhl587 { - yyb587 = yyj587 > l + yyj575++ + if yyhl575 { + yyb575 = yyj575 > l } else { - yyb587 = r.CheckBreak() + yyb575 = r.CheckBreak() } - if yyb587 { + if yyb575 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj587-1, "") + z.DecStructFieldNotFound(yyj575-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7139,38 +7049,38 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym593 := z.EncBinary() - _ = yym593 + yym580 := z.EncBinary() + _ = yym580 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep594 := !z.EncBinary() - yy2arr594 := z.EncBasicHandle().StructToArray - var yyq594 [4]bool - _, _, _ = yysep594, yyq594, yy2arr594 - const yyr594 bool = false - yyq594[0] = x.Replicas != 0 - yyq594[1] = x.UpdatedReplicas != 0 - yyq594[2] = x.AvailableReplicas != 0 - yyq594[3] = x.UnavailableReplicas != 0 - var yynn594 int - if yyr594 || yy2arr594 { + yysep581 := !z.EncBinary() + yy2arr581 := z.EncBasicHandle().StructToArray + var yyq581 [4]bool + _, _, _ = yysep581, yyq581, yy2arr581 + const yyr581 bool = false + yyq581[0] = x.Replicas != 0 + yyq581[1] = x.UpdatedReplicas != 0 + yyq581[2] = x.AvailableReplicas != 0 + yyq581[3] = x.UnavailableReplicas != 0 + var yynn581 int + if yyr581 || yy2arr581 { r.EncodeArrayStart(4) } else { - yynn594 = 0 - for _, b := range yyq594 { + yynn581 = 0 + for _, b := range yyq581 { if b { - yynn594++ + yynn581++ } } - r.EncodeMapStart(yynn594) - yynn594 = 0 + r.EncodeMapStart(yynn581) + yynn581 = 0 } - if yyr594 || yy2arr594 { + if yyr581 || yy2arr581 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq594[0] { - yym596 := z.EncBinary() - _ = yym596 + if yyq581[0] { + yym583 := z.EncBinary() + _ = yym583 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -7179,23 +7089,23 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq594[0] { + if yyq581[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym597 := z.EncBinary() - _ = yym597 + yym584 := z.EncBinary() + _ = yym584 if false { } else { r.EncodeInt(int64(x.Replicas)) } } } - if yyr594 || yy2arr594 { + if yyr581 || yy2arr581 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq594[1] { - yym599 := z.EncBinary() - _ = yym599 + if yyq581[1] { + yym586 := z.EncBinary() + _ = yym586 if false { } else { r.EncodeInt(int64(x.UpdatedReplicas)) @@ -7204,23 +7114,23 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq594[1] { + if yyq581[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("updatedReplicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym600 := z.EncBinary() - _ = yym600 + yym587 := z.EncBinary() + _ = yym587 if false { } else { r.EncodeInt(int64(x.UpdatedReplicas)) } } } - if yyr594 || yy2arr594 { + if yyr581 || yy2arr581 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq594[2] { - yym602 := z.EncBinary() - _ = yym602 + if yyq581[2] { + yym589 := z.EncBinary() + _ = yym589 if false { } else { r.EncodeInt(int64(x.AvailableReplicas)) @@ -7229,23 +7139,23 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq594[2] { + if yyq581[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("availableReplicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym603 := z.EncBinary() - _ = yym603 + yym590 := z.EncBinary() + _ = yym590 if false { } else { r.EncodeInt(int64(x.AvailableReplicas)) } } } - if yyr594 || yy2arr594 { + if yyr581 || yy2arr581 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq594[3] { - yym605 := z.EncBinary() - _ = yym605 + if yyq581[3] { + yym592 := z.EncBinary() + _ = yym592 if false { } else { r.EncodeInt(int64(x.UnavailableReplicas)) @@ -7254,19 +7164,19 @@ func (x *DeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq594[3] { + if yyq581[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("unavailableReplicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym606 := z.EncBinary() - _ = yym606 + yym593 := z.EncBinary() + _ = yym593 if false { } else { r.EncodeInt(int64(x.UnavailableReplicas)) } } } - if yyr594 || yy2arr594 { + if yyr581 || yy2arr581 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7279,25 +7189,25 @@ func (x *DeploymentStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym607 := z.DecBinary() - _ = yym607 + yym594 := z.DecBinary() + _ = yym594 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct608 := r.ContainerType() - if yyct608 == codecSelferValueTypeMap1234 { - yyl608 := r.ReadMapStart() - if yyl608 == 0 { + yyct595 := r.ContainerType() + if yyct595 == codecSelferValueTypeMap1234 { + yyl595 := r.ReadMapStart() + if yyl595 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl608, d) + x.codecDecodeSelfFromMap(yyl595, d) } - } else if yyct608 == codecSelferValueTypeArray1234 { - yyl608 := r.ReadArrayStart() - if yyl608 == 0 { + } else if yyct595 == codecSelferValueTypeArray1234 { + yyl595 := r.ReadArrayStart() + if yyl595 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl608, d) + x.codecDecodeSelfFromArray(yyl595, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7309,12 +7219,12 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys609Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys609Slc - var yyhl609 bool = l >= 0 - for yyj609 := 0; ; yyj609++ { - if yyhl609 { - if yyj609 >= l { + var yys596Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys596Slc + var yyhl596 bool = l >= 0 + for yyj596 := 0; ; yyj596++ { + if yyhl596 { + if yyj596 >= l { break } } else { @@ -7323,10 +7233,10 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys609Slc = r.DecodeBytes(yys609Slc, true, true) - yys609 := string(yys609Slc) + yys596Slc = r.DecodeBytes(yys596Slc, true, true) + yys596 := string(yys596Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys609 { + switch yys596 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -7352,9 +7262,9 @@ func (x *DeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.UnavailableReplicas = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys609) - } // end switch yys609 - } // end for yyj609 + z.DecStructFieldNotFound(-1, yys596) + } // end switch yys596 + } // end for yyj596 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7362,16 +7272,16 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj614 int - var yyb614 bool - var yyhl614 bool = l >= 0 - yyj614++ - if yyhl614 { - yyb614 = yyj614 > l + var yyj601 int + var yyb601 bool + var yyhl601 bool = l >= 0 + yyj601++ + if yyhl601 { + yyb601 = yyj601 > l } else { - yyb614 = r.CheckBreak() + yyb601 = r.CheckBreak() } - if yyb614 { + if yyb601 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7381,13 +7291,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Replicas = int32(r.DecodeInt(32)) } - yyj614++ - if yyhl614 { - yyb614 = yyj614 > l + yyj601++ + if yyhl601 { + yyb601 = yyj601 > l } else { - yyb614 = r.CheckBreak() + yyb601 = r.CheckBreak() } - if yyb614 { + if yyb601 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7397,13 +7307,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.UpdatedReplicas = int32(r.DecodeInt(32)) } - yyj614++ - if yyhl614 { - yyb614 = yyj614 > l + yyj601++ + if yyhl601 { + yyb601 = yyj601 > l } else { - yyb614 = r.CheckBreak() + yyb601 = r.CheckBreak() } - if yyb614 { + if yyb601 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7413,13 +7323,13 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.AvailableReplicas = int32(r.DecodeInt(32)) } - yyj614++ - if yyhl614 { - yyb614 = yyj614 > l + yyj601++ + if yyhl601 { + yyb601 = yyj601 > l } else { - yyb614 = r.CheckBreak() + yyb601 = r.CheckBreak() } - if yyb614 { + if yyb601 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7430,17 +7340,17 @@ func (x *DeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.UnavailableReplicas = int32(r.DecodeInt(32)) } for { - yyj614++ - if yyhl614 { - yyb614 = yyj614 > l + yyj601++ + if yyhl601 { + yyb601 = yyj601 > l } else { - yyb614 = r.CheckBreak() + yyb601 = r.CheckBreak() } - if yyb614 { + if yyb601 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj614-1, "") + z.DecStructFieldNotFound(yyj601-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7452,118 +7362,68 @@ func (x *DeploymentList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym619 := z.EncBinary() - _ = yym619 + yym606 := z.EncBinary() + _ = yym606 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep620 := !z.EncBinary() - yy2arr620 := z.EncBasicHandle().StructToArray - var yyq620 [4]bool - _, _, _ = yysep620, yyq620, yy2arr620 - const yyr620 bool = false - yyq620[0] = x.Kind != "" - yyq620[1] = x.APIVersion != "" - yyq620[2] = true - var yynn620 int - if yyr620 || yy2arr620 { + yysep607 := !z.EncBinary() + yy2arr607 := z.EncBasicHandle().StructToArray + var yyq607 [4]bool + _, _, _ = yysep607, yyq607, yy2arr607 + const yyr607 bool = false + yyq607[0] = true + yyq607[2] = x.Kind != "" + yyq607[3] = x.APIVersion != "" + var yynn607 int + if yyr607 || yy2arr607 { r.EncodeArrayStart(4) } else { - yynn620 = 1 - for _, b := range yyq620 { + yynn607 = 1 + for _, b := range yyq607 { if b { - yynn620++ + yynn607++ } } - r.EncodeMapStart(yynn620) - yynn620 = 0 + r.EncodeMapStart(yynn607) + yynn607 = 0 } - if yyr620 || yy2arr620 { + if yyr607 || yy2arr607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[0] { - yym622 := z.EncBinary() - _ = yym622 + if yyq607[0] { + yy609 := &x.ListMeta + yym610 := z.EncBinary() + _ = yym610 if false { + } else if z.HasExtensions() && z.EncExt(yy609) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq620[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym623 := z.EncBinary() - _ = yym623 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr620 || yy2arr620 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[1] { - yym625 := z.EncBinary() - _ = yym625 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq620[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym626 := z.EncBinary() - _ = yym626 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr620 || yy2arr620 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq620[2] { - yy628 := &x.ListMeta - yym629 := z.EncBinary() - _ = yym629 - if false { - } else if z.HasExtensions() && z.EncExt(yy628) { - } else { - z.EncFallback(yy628) + z.EncFallback(yy609) } } else { r.EncodeNil() } } else { - if yyq620[2] { + if yyq607[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy630 := &x.ListMeta - yym631 := z.EncBinary() - _ = yym631 + yy611 := &x.ListMeta + yym612 := z.EncBinary() + _ = yym612 if false { - } else if z.HasExtensions() && z.EncExt(yy630) { + } else if z.HasExtensions() && z.EncExt(yy611) { } else { - z.EncFallback(yy630) + z.EncFallback(yy611) } } } - if yyr620 || yy2arr620 { + if yyr607 || yy2arr607 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym633 := z.EncBinary() - _ = yym633 + yym614 := z.EncBinary() + _ = yym614 if false { } else { h.encSliceDeployment(([]Deployment)(x.Items), e) @@ -7576,15 +7436,65 @@ func (x *DeploymentList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym634 := z.EncBinary() - _ = yym634 + yym615 := z.EncBinary() + _ = yym615 if false { } else { h.encSliceDeployment(([]Deployment)(x.Items), e) } } } - if yyr620 || yy2arr620 { + if yyr607 || yy2arr607 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq607[2] { + yym617 := z.EncBinary() + _ = yym617 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq607[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym618 := z.EncBinary() + _ = yym618 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr607 || yy2arr607 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq607[3] { + yym620 := z.EncBinary() + _ = yym620 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq607[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym621 := z.EncBinary() + _ = yym621 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr607 || yy2arr607 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7597,25 +7507,25 @@ func (x *DeploymentList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym635 := z.DecBinary() - _ = yym635 + yym622 := z.DecBinary() + _ = yym622 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct636 := r.ContainerType() - if yyct636 == codecSelferValueTypeMap1234 { - yyl636 := r.ReadMapStart() - if yyl636 == 0 { + yyct623 := r.ContainerType() + if yyct623 == codecSelferValueTypeMap1234 { + yyl623 := r.ReadMapStart() + if yyl623 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl636, d) + x.codecDecodeSelfFromMap(yyl623, d) } - } else if yyct636 == codecSelferValueTypeArray1234 { - yyl636 := r.ReadArrayStart() - if yyl636 == 0 { + } else if yyct623 == codecSelferValueTypeArray1234 { + yyl623 := r.ReadArrayStart() + if yyl623 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl636, d) + x.codecDecodeSelfFromArray(yyl623, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7627,12 +7537,12 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys637Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys637Slc - var yyhl637 bool = l >= 0 - for yyj637 := 0; ; yyj637++ { - if yyhl637 { - if yyj637 >= l { + var yys624Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys624Slc + var yyhl624 bool = l >= 0 + for yyj624 := 0; ; yyj624++ { + if yyhl624 { + if yyj624 >= l { break } } else { @@ -7641,10 +7551,35 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys637Slc = r.DecodeBytes(yys637Slc, true, true) - yys637 := string(yys637Slc) + yys624Slc = r.DecodeBytes(yys624Slc, true, true) + yys624 := string(yys624Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys637 { + switch yys624 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv625 := &x.ListMeta + yym626 := z.DecBinary() + _ = yym626 + if false { + } else if z.HasExtensions() && z.DecExt(yyv625) { + } else { + z.DecFallback(yyv625, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv627 := &x.Items + yym628 := z.DecBinary() + _ = yym628 + if false { + } else { + h.decSliceDeployment((*[]Deployment)(yyv627), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -7657,35 +7592,10 @@ func (x *DeploymentList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv640 := &x.ListMeta - yym641 := z.DecBinary() - _ = yym641 - if false { - } else if z.HasExtensions() && z.DecExt(yyv640) { - } else { - z.DecFallback(yyv640, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv642 := &x.Items - yym643 := z.DecBinary() - _ = yym643 - if false { - } else { - h.decSliceDeployment((*[]Deployment)(yyv642), d) - } - } default: - z.DecStructFieldNotFound(-1, yys637) - } // end switch yys637 - } // end for yyj637 + z.DecStructFieldNotFound(-1, yys624) + } // end switch yys624 + } // end for yyj624 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7693,16 +7603,61 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj644 int - var yyb644 bool - var yyhl644 bool = l >= 0 - yyj644++ - if yyhl644 { - yyb644 = yyj644 > l + var yyj631 int + var yyb631 bool + var yyhl631 bool = l >= 0 + yyj631++ + if yyhl631 { + yyb631 = yyj631 > l } else { - yyb644 = r.CheckBreak() + yyb631 = r.CheckBreak() } - if yyb644 { + if yyb631 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv632 := &x.ListMeta + yym633 := z.DecBinary() + _ = yym633 + if false { + } else if z.HasExtensions() && z.DecExt(yyv632) { + } else { + z.DecFallback(yyv632, false) + } + } + yyj631++ + if yyhl631 { + yyb631 = yyj631 > l + } else { + yyb631 = r.CheckBreak() + } + if yyb631 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv634 := &x.Items + yym635 := z.DecBinary() + _ = yym635 + if false { + } else { + h.decSliceDeployment((*[]Deployment)(yyv634), d) + } + } + yyj631++ + if yyhl631 { + yyb631 = yyj631 > l + } else { + yyb631 = r.CheckBreak() + } + if yyb631 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7712,13 +7667,13 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj644++ - if yyhl644 { - yyb644 = yyj644 > l + yyj631++ + if yyhl631 { + yyb631 = yyj631 > l } else { - yyb644 = r.CheckBreak() + yyb631 = r.CheckBreak() } - if yyb644 { + if yyb631 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7728,63 +7683,18 @@ func (x *DeploymentList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj644++ - if yyhl644 { - yyb644 = yyj644 > l - } else { - yyb644 = r.CheckBreak() - } - if yyb644 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv647 := &x.ListMeta - yym648 := z.DecBinary() - _ = yym648 - if false { - } else if z.HasExtensions() && z.DecExt(yyv647) { - } else { - z.DecFallback(yyv647, false) - } - } - yyj644++ - if yyhl644 { - yyb644 = yyj644 > l - } else { - yyb644 = r.CheckBreak() - } - if yyb644 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv649 := &x.Items - yym650 := z.DecBinary() - _ = yym650 - if false { - } else { - h.decSliceDeployment((*[]Deployment)(yyv649), d) - } - } for { - yyj644++ - if yyhl644 { - yyb644 = yyj644 > l + yyj631++ + if yyhl631 { + yyb631 = yyj631 > l } else { - yyb644 = r.CheckBreak() + yyb631 = r.CheckBreak() } - if yyb644 { + if yyb631 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj644-1, "") + z.DecStructFieldNotFound(yyj631-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -7796,49 +7706,49 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym651 := z.EncBinary() - _ = yym651 + yym638 := z.EncBinary() + _ = yym638 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep652 := !z.EncBinary() - yy2arr652 := z.EncBasicHandle().StructToArray - var yyq652 [2]bool - _, _, _ = yysep652, yyq652, yy2arr652 - const yyr652 bool = false - yyq652[0] = x.Type != "" - yyq652[1] = x.RollingUpdate != nil - var yynn652 int - if yyr652 || yy2arr652 { + yysep639 := !z.EncBinary() + yy2arr639 := z.EncBasicHandle().StructToArray + var yyq639 [2]bool + _, _, _ = yysep639, yyq639, yy2arr639 + const yyr639 bool = false + yyq639[0] = x.Type != "" + yyq639[1] = x.RollingUpdate != nil + var yynn639 int + if yyr639 || yy2arr639 { r.EncodeArrayStart(2) } else { - yynn652 = 0 - for _, b := range yyq652 { + yynn639 = 0 + for _, b := range yyq639 { if b { - yynn652++ + yynn639++ } } - r.EncodeMapStart(yynn652) - yynn652 = 0 + r.EncodeMapStart(yynn639) + yynn639 = 0 } - if yyr652 || yy2arr652 { + if yyr639 || yy2arr639 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq652[0] { + if yyq639[0] { x.Type.CodecEncodeSelf(e) } else { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq652[0] { + if yyq639[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("type")) z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } } - if yyr652 || yy2arr652 { + if yyr639 || yy2arr639 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq652[1] { + if yyq639[1] { if x.RollingUpdate == nil { r.EncodeNil() } else { @@ -7848,7 +7758,7 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq652[1] { + if yyq639[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rollingUpdate")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -7859,7 +7769,7 @@ func (x *DaemonSetUpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr652 || yy2arr652 { + if yyr639 || yy2arr639 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -7872,25 +7782,25 @@ func (x *DaemonSetUpdateStrategy) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym655 := z.DecBinary() - _ = yym655 + yym642 := z.DecBinary() + _ = yym642 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct656 := r.ContainerType() - if yyct656 == codecSelferValueTypeMap1234 { - yyl656 := r.ReadMapStart() - if yyl656 == 0 { + yyct643 := r.ContainerType() + if yyct643 == codecSelferValueTypeMap1234 { + yyl643 := r.ReadMapStart() + if yyl643 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl656, d) + x.codecDecodeSelfFromMap(yyl643, d) } - } else if yyct656 == codecSelferValueTypeArray1234 { - yyl656 := r.ReadArrayStart() - if yyl656 == 0 { + } else if yyct643 == codecSelferValueTypeArray1234 { + yyl643 := r.ReadArrayStart() + if yyl643 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl656, d) + x.codecDecodeSelfFromArray(yyl643, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -7902,12 +7812,12 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys657Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys657Slc - var yyhl657 bool = l >= 0 - for yyj657 := 0; ; yyj657++ { - if yyhl657 { - if yyj657 >= l { + var yys644Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys644Slc + var yyhl644 bool = l >= 0 + for yyj644 := 0; ; yyj644++ { + if yyhl644 { + if yyj644 >= l { break } } else { @@ -7916,10 +7826,10 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys657Slc = r.DecodeBytes(yys657Slc, true, true) - yys657 := string(yys657Slc) + yys644Slc = r.DecodeBytes(yys644Slc, true, true) + yys644 := string(yys644Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys657 { + switch yys644 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -7938,9 +7848,9 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Dec x.RollingUpdate.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys657) - } // end switch yys657 - } // end for yyj657 + z.DecStructFieldNotFound(-1, yys644) + } // end switch yys644 + } // end for yyj644 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -7948,16 +7858,16 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj660 int - var yyb660 bool - var yyhl660 bool = l >= 0 - yyj660++ - if yyhl660 { - yyb660 = yyj660 > l + var yyj647 int + var yyb647 bool + var yyhl647 bool = l >= 0 + yyj647++ + if yyhl647 { + yyb647 = yyj647 > l } else { - yyb660 = r.CheckBreak() + yyb647 = r.CheckBreak() } - if yyb660 { + if yyb647 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7967,13 +7877,13 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.Type = DaemonSetUpdateStrategyType(r.DecodeString()) } - yyj660++ - if yyhl660 { - yyb660 = yyj660 > l + yyj647++ + if yyhl647 { + yyb647 = yyj647 > l } else { - yyb660 = r.CheckBreak() + yyb647 = r.CheckBreak() } - if yyb660 { + if yyb647 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -7989,17 +7899,17 @@ func (x *DaemonSetUpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.D x.RollingUpdate.CodecDecodeSelf(d) } for { - yyj660++ - if yyhl660 { - yyb660 = yyj660 > l + yyj647++ + if yyhl647 { + yyb647 = yyj647 > l } else { - yyb660 = r.CheckBreak() + yyb647 = r.CheckBreak() } - if yyb660 { + if yyb647 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj660-1, "") + z.DecStructFieldNotFound(yyj647-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8008,8 +7918,8 @@ func (x DaemonSetUpdateStrategyType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym663 := z.EncBinary() - _ = yym663 + yym650 := z.EncBinary() + _ = yym650 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -8021,8 +7931,8 @@ func (x *DaemonSetUpdateStrategyType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym664 := z.DecBinary() - _ = yym664 + yym651 := z.DecBinary() + _ = yym651 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -8037,42 +7947,42 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym665 := z.EncBinary() - _ = yym665 + yym652 := z.EncBinary() + _ = yym652 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep666 := !z.EncBinary() - yy2arr666 := z.EncBasicHandle().StructToArray - var yyq666 [2]bool - _, _, _ = yysep666, yyq666, yy2arr666 - const yyr666 bool = false - yyq666[0] = x.MaxUnavailable != nil - yyq666[1] = x.MinReadySeconds != 0 - var yynn666 int - if yyr666 || yy2arr666 { + yysep653 := !z.EncBinary() + yy2arr653 := z.EncBasicHandle().StructToArray + var yyq653 [2]bool + _, _, _ = yysep653, yyq653, yy2arr653 + const yyr653 bool = false + yyq653[0] = x.MaxUnavailable != nil + yyq653[1] = x.MinReadySeconds != 0 + var yynn653 int + if yyr653 || yy2arr653 { r.EncodeArrayStart(2) } else { - yynn666 = 0 - for _, b := range yyq666 { + yynn653 = 0 + for _, b := range yyq653 { if b { - yynn666++ + yynn653++ } } - r.EncodeMapStart(yynn666) - yynn666 = 0 + r.EncodeMapStart(yynn653) + yynn653 = 0 } - if yyr666 || yy2arr666 { + if yyr653 || yy2arr653 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq666[0] { + if yyq653[0] { if x.MaxUnavailable == nil { r.EncodeNil() } else { - yym668 := z.EncBinary() - _ = yym668 + yym655 := z.EncBinary() + _ = yym655 if false { } else if z.HasExtensions() && z.EncExt(x.MaxUnavailable) { - } else if !yym668 && z.IsJSONHandle() { + } else if !yym655 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxUnavailable) } else { z.EncFallback(x.MaxUnavailable) @@ -8082,18 +7992,18 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq666[0] { + if yyq653[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxUnavailable")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.MaxUnavailable == nil { r.EncodeNil() } else { - yym669 := z.EncBinary() - _ = yym669 + yym656 := z.EncBinary() + _ = yym656 if false { } else if z.HasExtensions() && z.EncExt(x.MaxUnavailable) { - } else if !yym669 && z.IsJSONHandle() { + } else if !yym656 && z.IsJSONHandle() { z.EncJSONMarshal(x.MaxUnavailable) } else { z.EncFallback(x.MaxUnavailable) @@ -8101,11 +8011,11 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr666 || yy2arr666 { + if yyr653 || yy2arr653 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq666[1] { - yym671 := z.EncBinary() - _ = yym671 + if yyq653[1] { + yym658 := z.EncBinary() + _ = yym658 if false { } else { r.EncodeInt(int64(x.MinReadySeconds)) @@ -8114,19 +8024,19 @@ func (x *RollingUpdateDaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq666[1] { + if yyq653[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minReadySeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym672 := z.EncBinary() - _ = yym672 + yym659 := z.EncBinary() + _ = yym659 if false { } else { r.EncodeInt(int64(x.MinReadySeconds)) } } } - if yyr666 || yy2arr666 { + if yyr653 || yy2arr653 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8139,25 +8049,25 @@ func (x *RollingUpdateDaemonSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym673 := z.DecBinary() - _ = yym673 + yym660 := z.DecBinary() + _ = yym660 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct674 := r.ContainerType() - if yyct674 == codecSelferValueTypeMap1234 { - yyl674 := r.ReadMapStart() - if yyl674 == 0 { + yyct661 := r.ContainerType() + if yyct661 == codecSelferValueTypeMap1234 { + yyl661 := r.ReadMapStart() + if yyl661 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl674, d) + x.codecDecodeSelfFromMap(yyl661, d) } - } else if yyct674 == codecSelferValueTypeArray1234 { - yyl674 := r.ReadArrayStart() - if yyl674 == 0 { + } else if yyct661 == codecSelferValueTypeArray1234 { + yyl661 := r.ReadArrayStart() + if yyl661 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl674, d) + x.codecDecodeSelfFromArray(yyl661, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8169,12 +8079,12 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys675Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys675Slc - var yyhl675 bool = l >= 0 - for yyj675 := 0; ; yyj675++ { - if yyhl675 { - if yyj675 >= l { + var yys662Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys662Slc + var yyhl662 bool = l >= 0 + for yyj662 := 0; ; yyj662++ { + if yyhl662 { + if yyj662 >= l { break } } else { @@ -8183,10 +8093,10 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys675Slc = r.DecodeBytes(yys675Slc, true, true) - yys675 := string(yys675Slc) + yys662Slc = r.DecodeBytes(yys662Slc, true, true) + yys662 := string(yys662Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys675 { + switch yys662 { case "maxUnavailable": if r.TryDecodeAsNil() { if x.MaxUnavailable != nil { @@ -8196,11 +8106,11 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco if x.MaxUnavailable == nil { x.MaxUnavailable = new(pkg6_intstr.IntOrString) } - yym677 := z.DecBinary() - _ = yym677 + yym664 := z.DecBinary() + _ = yym664 if false { } else if z.HasExtensions() && z.DecExt(x.MaxUnavailable) { - } else if !yym677 && z.IsJSONHandle() { + } else if !yym664 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxUnavailable) } else { z.DecFallback(x.MaxUnavailable, false) @@ -8213,9 +8123,9 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Deco x.MinReadySeconds = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys675) - } // end switch yys675 - } // end for yyj675 + z.DecStructFieldNotFound(-1, yys662) + } // end switch yys662 + } // end for yyj662 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8223,16 +8133,16 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj679 int - var yyb679 bool - var yyhl679 bool = l >= 0 - yyj679++ - if yyhl679 { - yyb679 = yyj679 > l + var yyj666 int + var yyb666 bool + var yyhl666 bool = l >= 0 + yyj666++ + if yyhl666 { + yyb666 = yyj666 > l } else { - yyb679 = r.CheckBreak() + yyb666 = r.CheckBreak() } - if yyb679 { + if yyb666 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8245,23 +8155,23 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De if x.MaxUnavailable == nil { x.MaxUnavailable = new(pkg6_intstr.IntOrString) } - yym681 := z.DecBinary() - _ = yym681 + yym668 := z.DecBinary() + _ = yym668 if false { } else if z.HasExtensions() && z.DecExt(x.MaxUnavailable) { - } else if !yym681 && z.IsJSONHandle() { + } else if !yym668 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.MaxUnavailable) } else { z.DecFallback(x.MaxUnavailable, false) } } - yyj679++ - if yyhl679 { - yyb679 = yyj679 > l + yyj666++ + if yyhl666 { + yyb666 = yyj666 > l } else { - yyb679 = r.CheckBreak() + yyb666 = r.CheckBreak() } - if yyb679 { + if yyb666 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8272,17 +8182,17 @@ func (x *RollingUpdateDaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.De x.MinReadySeconds = int32(r.DecodeInt(32)) } for { - yyj679++ - if yyhl679 { - yyb679 = yyj679 > l + yyj666++ + if yyhl666 { + yyb666 = yyj666 > l } else { - yyb679 = r.CheckBreak() + yyb666 = r.CheckBreak() } - if yyb679 { + if yyb666 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj679-1, "") + z.DecStructFieldNotFound(yyj666-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8294,35 +8204,35 @@ func (x *DaemonSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym683 := z.EncBinary() - _ = yym683 + yym670 := z.EncBinary() + _ = yym670 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep684 := !z.EncBinary() - yy2arr684 := z.EncBasicHandle().StructToArray - var yyq684 [4]bool - _, _, _ = yysep684, yyq684, yy2arr684 - const yyr684 bool = false - yyq684[0] = x.Selector != nil - yyq684[2] = true - yyq684[3] = x.UniqueLabelKey != nil - var yynn684 int - if yyr684 || yy2arr684 { + yysep671 := !z.EncBinary() + yy2arr671 := z.EncBasicHandle().StructToArray + var yyq671 [4]bool + _, _, _ = yysep671, yyq671, yy2arr671 + const yyr671 bool = false + yyq671[0] = x.Selector != nil + yyq671[2] = true + yyq671[3] = x.UniqueLabelKey != nil + var yynn671 int + if yyr671 || yy2arr671 { r.EncodeArrayStart(4) } else { - yynn684 = 1 - for _, b := range yyq684 { + yynn671 = 1 + for _, b := range yyq671 { if b { - yynn684++ + yynn671++ } } - r.EncodeMapStart(yynn684) - yynn684 = 0 + r.EncodeMapStart(yynn671) + yynn671 = 0 } - if yyr684 || yy2arr684 { + if yyr671 || yy2arr671 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq684[0] { + if yyq671[0] { if x.Selector == nil { r.EncodeNil() } else { @@ -8332,7 +8242,7 @@ func (x *DaemonSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq684[0] { + if yyq671[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -8343,70 +8253,70 @@ func (x *DaemonSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr684 || yy2arr684 { + if yyr671 || yy2arr671 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy687 := &x.Template - yy687.CodecEncodeSelf(e) + yy674 := &x.Template + yy674.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy688 := &x.Template - yy688.CodecEncodeSelf(e) + yy675 := &x.Template + yy675.CodecEncodeSelf(e) } - if yyr684 || yy2arr684 { + if yyr671 || yy2arr671 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq684[2] { - yy690 := &x.UpdateStrategy - yy690.CodecEncodeSelf(e) + if yyq671[2] { + yy677 := &x.UpdateStrategy + yy677.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq684[2] { + if yyq671[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("updateStrategy")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy691 := &x.UpdateStrategy - yy691.CodecEncodeSelf(e) + yy678 := &x.UpdateStrategy + yy678.CodecEncodeSelf(e) } } - if yyr684 || yy2arr684 { + if yyr671 || yy2arr671 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq684[3] { + if yyq671[3] { if x.UniqueLabelKey == nil { r.EncodeNil() } else { - yy693 := *x.UniqueLabelKey - yym694 := z.EncBinary() - _ = yym694 + yy680 := *x.UniqueLabelKey + yym681 := z.EncBinary() + _ = yym681 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(yy693)) + r.EncodeString(codecSelferC_UTF81234, string(yy680)) } } } else { r.EncodeNil() } } else { - if yyq684[3] { + if yyq671[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("uniqueLabelKey")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.UniqueLabelKey == nil { r.EncodeNil() } else { - yy695 := *x.UniqueLabelKey - yym696 := z.EncBinary() - _ = yym696 + yy682 := *x.UniqueLabelKey + yym683 := z.EncBinary() + _ = yym683 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(yy695)) + r.EncodeString(codecSelferC_UTF81234, string(yy682)) } } } } - if yyr684 || yy2arr684 { + if yyr671 || yy2arr671 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8419,25 +8329,25 @@ func (x *DaemonSetSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym697 := z.DecBinary() - _ = yym697 + yym684 := z.DecBinary() + _ = yym684 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct698 := r.ContainerType() - if yyct698 == codecSelferValueTypeMap1234 { - yyl698 := r.ReadMapStart() - if yyl698 == 0 { + yyct685 := r.ContainerType() + if yyct685 == codecSelferValueTypeMap1234 { + yyl685 := r.ReadMapStart() + if yyl685 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl698, d) + x.codecDecodeSelfFromMap(yyl685, d) } - } else if yyct698 == codecSelferValueTypeArray1234 { - yyl698 := r.ReadArrayStart() - if yyl698 == 0 { + } else if yyct685 == codecSelferValueTypeArray1234 { + yyl685 := r.ReadArrayStart() + if yyl685 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl698, d) + x.codecDecodeSelfFromArray(yyl685, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8449,12 +8359,12 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys699Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys699Slc - var yyhl699 bool = l >= 0 - for yyj699 := 0; ; yyj699++ { - if yyhl699 { - if yyj699 >= l { + var yys686Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys686Slc + var yyhl686 bool = l >= 0 + for yyj686 := 0; ; yyj686++ { + if yyhl686 { + if yyj686 >= l { break } } else { @@ -8463,10 +8373,10 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys699Slc = r.DecodeBytes(yys699Slc, true, true) - yys699 := string(yys699Slc) + yys686Slc = r.DecodeBytes(yys686Slc, true, true) + yys686 := string(yys686Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys699 { + switch yys686 { case "selector": if r.TryDecodeAsNil() { if x.Selector != nil { @@ -8482,15 +8392,15 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv701 := &x.Template - yyv701.CodecDecodeSelf(d) + yyv688 := &x.Template + yyv688.CodecDecodeSelf(d) } case "updateStrategy": if r.TryDecodeAsNil() { x.UpdateStrategy = DaemonSetUpdateStrategy{} } else { - yyv702 := &x.UpdateStrategy - yyv702.CodecDecodeSelf(d) + yyv689 := &x.UpdateStrategy + yyv689.CodecDecodeSelf(d) } case "uniqueLabelKey": if r.TryDecodeAsNil() { @@ -8501,17 +8411,17 @@ func (x *DaemonSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.UniqueLabelKey == nil { x.UniqueLabelKey = new(string) } - yym704 := z.DecBinary() - _ = yym704 + yym691 := z.DecBinary() + _ = yym691 if false { } else { *((*string)(x.UniqueLabelKey)) = r.DecodeString() } } default: - z.DecStructFieldNotFound(-1, yys699) - } // end switch yys699 - } // end for yyj699 + z.DecStructFieldNotFound(-1, yys686) + } // end switch yys686 + } // end for yyj686 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8519,16 +8429,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj705 int - var yyb705 bool - var yyhl705 bool = l >= 0 - yyj705++ - if yyhl705 { - yyb705 = yyj705 > l + var yyj692 int + var yyb692 bool + var yyhl692 bool = l >= 0 + yyj692++ + if yyhl692 { + yyb692 = yyj692 > l } else { - yyb705 = r.CheckBreak() + yyb692 = r.CheckBreak() } - if yyb705 { + if yyb692 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8543,13 +8453,13 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Selector.CodecDecodeSelf(d) } - yyj705++ - if yyhl705 { - yyb705 = yyj705 > l + yyj692++ + if yyhl692 { + yyb692 = yyj692 > l } else { - yyb705 = r.CheckBreak() + yyb692 = r.CheckBreak() } - if yyb705 { + if yyb692 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8557,16 +8467,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv707 := &x.Template - yyv707.CodecDecodeSelf(d) + yyv694 := &x.Template + yyv694.CodecDecodeSelf(d) } - yyj705++ - if yyhl705 { - yyb705 = yyj705 > l + yyj692++ + if yyhl692 { + yyb692 = yyj692 > l } else { - yyb705 = r.CheckBreak() + yyb692 = r.CheckBreak() } - if yyb705 { + if yyb692 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8574,16 +8484,16 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.UpdateStrategy = DaemonSetUpdateStrategy{} } else { - yyv708 := &x.UpdateStrategy - yyv708.CodecDecodeSelf(d) + yyv695 := &x.UpdateStrategy + yyv695.CodecDecodeSelf(d) } - yyj705++ - if yyhl705 { - yyb705 = yyj705 > l + yyj692++ + if yyhl692 { + yyb692 = yyj692 > l } else { - yyb705 = r.CheckBreak() + yyb692 = r.CheckBreak() } - if yyb705 { + if yyb692 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8596,25 +8506,25 @@ func (x *DaemonSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.UniqueLabelKey == nil { x.UniqueLabelKey = new(string) } - yym710 := z.DecBinary() - _ = yym710 + yym697 := z.DecBinary() + _ = yym697 if false { } else { *((*string)(x.UniqueLabelKey)) = r.DecodeString() } } for { - yyj705++ - if yyhl705 { - yyb705 = yyj705 > l + yyj692++ + if yyhl692 { + yyb692 = yyj692 > l } else { - yyb705 = r.CheckBreak() + yyb692 = r.CheckBreak() } - if yyb705 { + if yyb692 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj705-1, "") + z.DecStructFieldNotFound(yyj692-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8626,33 +8536,33 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym711 := z.EncBinary() - _ = yym711 + yym698 := z.EncBinary() + _ = yym698 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep712 := !z.EncBinary() - yy2arr712 := z.EncBasicHandle().StructToArray - var yyq712 [3]bool - _, _, _ = yysep712, yyq712, yy2arr712 - const yyr712 bool = false - var yynn712 int - if yyr712 || yy2arr712 { + yysep699 := !z.EncBinary() + yy2arr699 := z.EncBasicHandle().StructToArray + var yyq699 [3]bool + _, _, _ = yysep699, yyq699, yy2arr699 + const yyr699 bool = false + var yynn699 int + if yyr699 || yy2arr699 { r.EncodeArrayStart(3) } else { - yynn712 = 3 - for _, b := range yyq712 { + yynn699 = 3 + for _, b := range yyq699 { if b { - yynn712++ + yynn699++ } } - r.EncodeMapStart(yynn712) - yynn712 = 0 + r.EncodeMapStart(yynn699) + yynn699 = 0 } - if yyr712 || yy2arr712 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym714 := z.EncBinary() - _ = yym714 + yym701 := z.EncBinary() + _ = yym701 if false { } else { r.EncodeInt(int64(x.CurrentNumberScheduled)) @@ -8661,17 +8571,17 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("currentNumberScheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym715 := z.EncBinary() - _ = yym715 + yym702 := z.EncBinary() + _ = yym702 if false { } else { r.EncodeInt(int64(x.CurrentNumberScheduled)) } } - if yyr712 || yy2arr712 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym717 := z.EncBinary() - _ = yym717 + yym704 := z.EncBinary() + _ = yym704 if false { } else { r.EncodeInt(int64(x.NumberMisscheduled)) @@ -8680,17 +8590,17 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("numberMisscheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym718 := z.EncBinary() - _ = yym718 + yym705 := z.EncBinary() + _ = yym705 if false { } else { r.EncodeInt(int64(x.NumberMisscheduled)) } } - if yyr712 || yy2arr712 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym720 := z.EncBinary() - _ = yym720 + yym707 := z.EncBinary() + _ = yym707 if false { } else { r.EncodeInt(int64(x.DesiredNumberScheduled)) @@ -8699,14 +8609,14 @@ func (x *DaemonSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("desiredNumberScheduled")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym721 := z.EncBinary() - _ = yym721 + yym708 := z.EncBinary() + _ = yym708 if false { } else { r.EncodeInt(int64(x.DesiredNumberScheduled)) } } - if yyr712 || yy2arr712 { + if yyr699 || yy2arr699 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -8719,25 +8629,25 @@ func (x *DaemonSetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym722 := z.DecBinary() - _ = yym722 + yym709 := z.DecBinary() + _ = yym709 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct723 := r.ContainerType() - if yyct723 == codecSelferValueTypeMap1234 { - yyl723 := r.ReadMapStart() - if yyl723 == 0 { + yyct710 := r.ContainerType() + if yyct710 == codecSelferValueTypeMap1234 { + yyl710 := r.ReadMapStart() + if yyl710 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl723, d) + x.codecDecodeSelfFromMap(yyl710, d) } - } else if yyct723 == codecSelferValueTypeArray1234 { - yyl723 := r.ReadArrayStart() - if yyl723 == 0 { + } else if yyct710 == codecSelferValueTypeArray1234 { + yyl710 := r.ReadArrayStart() + if yyl710 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl723, d) + x.codecDecodeSelfFromArray(yyl710, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -8749,12 +8659,12 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys724Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys724Slc - var yyhl724 bool = l >= 0 - for yyj724 := 0; ; yyj724++ { - if yyhl724 { - if yyj724 >= l { + var yys711Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys711Slc + var yyhl711 bool = l >= 0 + for yyj711 := 0; ; yyj711++ { + if yyhl711 { + if yyj711 >= l { break } } else { @@ -8763,10 +8673,10 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys724Slc = r.DecodeBytes(yys724Slc, true, true) - yys724 := string(yys724Slc) + yys711Slc = r.DecodeBytes(yys711Slc, true, true) + yys711 := string(yys711Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys724 { + switch yys711 { case "currentNumberScheduled": if r.TryDecodeAsNil() { x.CurrentNumberScheduled = 0 @@ -8786,9 +8696,9 @@ func (x *DaemonSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.DesiredNumberScheduled = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys724) - } // end switch yys724 - } // end for yyj724 + z.DecStructFieldNotFound(-1, yys711) + } // end switch yys711 + } // end for yyj711 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -8796,16 +8706,16 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj728 int - var yyb728 bool - var yyhl728 bool = l >= 0 - yyj728++ - if yyhl728 { - yyb728 = yyj728 > l + var yyj715 int + var yyb715 bool + var yyhl715 bool = l >= 0 + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb728 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb728 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8815,13 +8725,13 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.CurrentNumberScheduled = int32(r.DecodeInt(32)) } - yyj728++ - if yyhl728 { - yyb728 = yyj728 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb728 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb728 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8831,13 +8741,13 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.NumberMisscheduled = int32(r.DecodeInt(32)) } - yyj728++ - if yyhl728 { - yyb728 = yyj728 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb728 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb728 { + if yyb715 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -8848,17 +8758,17 @@ func (x *DaemonSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.DesiredNumberScheduled = int32(r.DecodeInt(32)) } for { - yyj728++ - if yyhl728 { - yyb728 = yyj728 > l + yyj715++ + if yyhl715 { + yyb715 = yyj715 > l } else { - yyb728 = r.CheckBreak() + yyb715 = r.CheckBreak() } - if yyb728 { + if yyb715 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj728-1, "") + z.DecStructFieldNotFound(yyj715-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -8870,136 +8780,136 @@ func (x *DaemonSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym732 := z.EncBinary() - _ = yym732 + yym719 := z.EncBinary() + _ = yym719 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep733 := !z.EncBinary() - yy2arr733 := z.EncBasicHandle().StructToArray - var yyq733 [5]bool - _, _, _ = yysep733, yyq733, yy2arr733 - const yyr733 bool = false - yyq733[0] = x.Kind != "" - yyq733[1] = x.APIVersion != "" - yyq733[2] = true - yyq733[3] = true - yyq733[4] = true - var yynn733 int - if yyr733 || yy2arr733 { + yysep720 := !z.EncBinary() + yy2arr720 := z.EncBasicHandle().StructToArray + var yyq720 [5]bool + _, _, _ = yysep720, yyq720, yy2arr720 + const yyr720 bool = false + yyq720[0] = true + yyq720[1] = true + yyq720[2] = true + yyq720[3] = x.Kind != "" + yyq720[4] = x.APIVersion != "" + var yynn720 int + if yyr720 || yy2arr720 { r.EncodeArrayStart(5) } else { - yynn733 = 0 - for _, b := range yyq733 { + yynn720 = 0 + for _, b := range yyq720 { if b { - yynn733++ + yynn720++ } } - r.EncodeMapStart(yynn733) - yynn733 = 0 + r.EncodeMapStart(yynn720) + yynn720 = 0 } - if yyr733 || yy2arr733 { + if yyr720 || yy2arr720 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq733[0] { + if yyq720[0] { + yy722 := &x.ObjectMeta + yy722.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq720[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy723 := &x.ObjectMeta + yy723.CodecEncodeSelf(e) + } + } + if yyr720 || yy2arr720 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq720[1] { + yy725 := &x.Spec + yy725.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq720[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy726 := &x.Spec + yy726.CodecEncodeSelf(e) + } + } + if yyr720 || yy2arr720 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq720[2] { + yy728 := &x.Status + yy728.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq720[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy729 := &x.Status + yy729.CodecEncodeSelf(e) + } + } + if yyr720 || yy2arr720 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq720[3] { + yym731 := z.EncBinary() + _ = yym731 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq720[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym732 := z.EncBinary() + _ = yym732 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr720 || yy2arr720 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq720[4] { + yym734 := z.EncBinary() + _ = yym734 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq720[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym735 := z.EncBinary() _ = yym735 if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq733[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym736 := z.EncBinary() - _ = yym736 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr733 || yy2arr733 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq733[1] { - yym738 := z.EncBinary() - _ = yym738 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq733[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym739 := z.EncBinary() - _ = yym739 - if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr733 || yy2arr733 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq733[2] { - yy741 := &x.ObjectMeta - yy741.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq733[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy742 := &x.ObjectMeta - yy742.CodecEncodeSelf(e) - } - } - if yyr733 || yy2arr733 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq733[3] { - yy744 := &x.Spec - yy744.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq733[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy745 := &x.Spec - yy745.CodecEncodeSelf(e) - } - } - if yyr733 || yy2arr733 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq733[4] { - yy747 := &x.Status - yy747.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq733[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy748 := &x.Status - yy748.CodecEncodeSelf(e) - } - } - if yyr733 || yy2arr733 { + if yyr720 || yy2arr720 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9012,25 +8922,25 @@ func (x *DaemonSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym749 := z.DecBinary() - _ = yym749 + yym736 := z.DecBinary() + _ = yym736 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct750 := r.ContainerType() - if yyct750 == codecSelferValueTypeMap1234 { - yyl750 := r.ReadMapStart() - if yyl750 == 0 { + yyct737 := r.ContainerType() + if yyct737 == codecSelferValueTypeMap1234 { + yyl737 := r.ReadMapStart() + if yyl737 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl750, d) + x.codecDecodeSelfFromMap(yyl737, d) } - } else if yyct750 == codecSelferValueTypeArray1234 { - yyl750 := r.ReadArrayStart() - if yyl750 == 0 { + } else if yyct737 == codecSelferValueTypeArray1234 { + yyl737 := r.ReadArrayStart() + if yyl737 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl750, d) + x.codecDecodeSelfFromArray(yyl737, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9042,12 +8952,12 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys751Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys751Slc - var yyhl751 bool = l >= 0 - for yyj751 := 0; ; yyj751++ { - if yyhl751 { - if yyj751 >= l { + var yys738Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys738Slc + var yyhl738 bool = l >= 0 + for yyj738 := 0; ; yyj738++ { + if yyhl738 { + if yyj738 >= l { break } } else { @@ -9056,10 +8966,31 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys751Slc = r.DecodeBytes(yys751Slc, true, true) - yys751 := string(yys751Slc) + yys738Slc = r.DecodeBytes(yys738Slc, true, true) + yys738 := string(yys738Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys751 { + switch yys738 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv739 := &x.ObjectMeta + yyv739.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = DaemonSetSpec{} + } else { + yyv740 := &x.Spec + yyv740.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = DaemonSetStatus{} + } else { + yyv741 := &x.Status + yyv741.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9072,31 +9003,10 @@ func (x *DaemonSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv754 := &x.ObjectMeta - yyv754.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = DaemonSetSpec{} - } else { - yyv755 := &x.Spec - yyv755.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = DaemonSetStatus{} - } else { - yyv756 := &x.Status - yyv756.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys751) - } // end switch yys751 - } // end for yyj751 + z.DecStructFieldNotFound(-1, yys738) + } // end switch yys738 + } // end for yyj738 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9104,16 +9014,67 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj757 int - var yyb757 bool - var yyhl757 bool = l >= 0 - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l + var yyj744 int + var yyb744 bool + var yyhl744 bool = l >= 0 + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l } else { - yyb757 = r.CheckBreak() + yyb744 = r.CheckBreak() } - if yyb757 { + if yyb744 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv745 := &x.ObjectMeta + yyv745.CodecDecodeSelf(d) + } + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l + } else { + yyb744 = r.CheckBreak() + } + if yyb744 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = DaemonSetSpec{} + } else { + yyv746 := &x.Spec + yyv746.CodecDecodeSelf(d) + } + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l + } else { + yyb744 = r.CheckBreak() + } + if yyb744 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = DaemonSetStatus{} + } else { + yyv747 := &x.Status + yyv747.CodecDecodeSelf(d) + } + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l + } else { + yyb744 = r.CheckBreak() + } + if yyb744 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9123,13 +9084,13 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l } else { - yyb757 = r.CheckBreak() + yyb744 = r.CheckBreak() } - if yyb757 { + if yyb744 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9139,69 +9100,18 @@ func (x *DaemonSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l - } else { - yyb757 = r.CheckBreak() - } - if yyb757 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv760 := &x.ObjectMeta - yyv760.CodecDecodeSelf(d) - } - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l - } else { - yyb757 = r.CheckBreak() - } - if yyb757 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = DaemonSetSpec{} - } else { - yyv761 := &x.Spec - yyv761.CodecDecodeSelf(d) - } - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l - } else { - yyb757 = r.CheckBreak() - } - if yyb757 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = DaemonSetStatus{} - } else { - yyv762 := &x.Status - yyv762.CodecDecodeSelf(d) - } for { - yyj757++ - if yyhl757 { - yyb757 = yyj757 > l + yyj744++ + if yyhl744 { + yyb744 = yyj744 > l } else { - yyb757 = r.CheckBreak() + yyb744 = r.CheckBreak() } - if yyb757 { + if yyb744 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj757-1, "") + z.DecStructFieldNotFound(yyj744-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9213,118 +9123,68 @@ func (x *DaemonSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym763 := z.EncBinary() - _ = yym763 + yym750 := z.EncBinary() + _ = yym750 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep764 := !z.EncBinary() - yy2arr764 := z.EncBasicHandle().StructToArray - var yyq764 [4]bool - _, _, _ = yysep764, yyq764, yy2arr764 - const yyr764 bool = false - yyq764[0] = x.Kind != "" - yyq764[1] = x.APIVersion != "" - yyq764[2] = true - var yynn764 int - if yyr764 || yy2arr764 { + yysep751 := !z.EncBinary() + yy2arr751 := z.EncBasicHandle().StructToArray + var yyq751 [4]bool + _, _, _ = yysep751, yyq751, yy2arr751 + const yyr751 bool = false + yyq751[0] = true + yyq751[2] = x.Kind != "" + yyq751[3] = x.APIVersion != "" + var yynn751 int + if yyr751 || yy2arr751 { r.EncodeArrayStart(4) } else { - yynn764 = 1 - for _, b := range yyq764 { + yynn751 = 1 + for _, b := range yyq751 { if b { - yynn764++ + yynn751++ } } - r.EncodeMapStart(yynn764) - yynn764 = 0 + r.EncodeMapStart(yynn751) + yynn751 = 0 } - if yyr764 || yy2arr764 { + if yyr751 || yy2arr751 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq764[0] { - yym766 := z.EncBinary() - _ = yym766 + if yyq751[0] { + yy753 := &x.ListMeta + yym754 := z.EncBinary() + _ = yym754 if false { + } else if z.HasExtensions() && z.EncExt(yy753) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq764[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym767 := z.EncBinary() - _ = yym767 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr764 || yy2arr764 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq764[1] { - yym769 := z.EncBinary() - _ = yym769 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq764[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym770 := z.EncBinary() - _ = yym770 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr764 || yy2arr764 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq764[2] { - yy772 := &x.ListMeta - yym773 := z.EncBinary() - _ = yym773 - if false { - } else if z.HasExtensions() && z.EncExt(yy772) { - } else { - z.EncFallback(yy772) + z.EncFallback(yy753) } } else { r.EncodeNil() } } else { - if yyq764[2] { + if yyq751[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy774 := &x.ListMeta - yym775 := z.EncBinary() - _ = yym775 + yy755 := &x.ListMeta + yym756 := z.EncBinary() + _ = yym756 if false { - } else if z.HasExtensions() && z.EncExt(yy774) { + } else if z.HasExtensions() && z.EncExt(yy755) { } else { - z.EncFallback(yy774) + z.EncFallback(yy755) } } } - if yyr764 || yy2arr764 { + if yyr751 || yy2arr751 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym777 := z.EncBinary() - _ = yym777 + yym758 := z.EncBinary() + _ = yym758 if false { } else { h.encSliceDaemonSet(([]DaemonSet)(x.Items), e) @@ -9337,15 +9197,65 @@ func (x *DaemonSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym778 := z.EncBinary() - _ = yym778 + yym759 := z.EncBinary() + _ = yym759 if false { } else { h.encSliceDaemonSet(([]DaemonSet)(x.Items), e) } } } - if yyr764 || yy2arr764 { + if yyr751 || yy2arr751 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq751[2] { + yym761 := z.EncBinary() + _ = yym761 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq751[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym762 := z.EncBinary() + _ = yym762 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr751 || yy2arr751 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq751[3] { + yym764 := z.EncBinary() + _ = yym764 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq751[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym765 := z.EncBinary() + _ = yym765 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr751 || yy2arr751 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9358,25 +9268,25 @@ func (x *DaemonSetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym779 := z.DecBinary() - _ = yym779 + yym766 := z.DecBinary() + _ = yym766 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct780 := r.ContainerType() - if yyct780 == codecSelferValueTypeMap1234 { - yyl780 := r.ReadMapStart() - if yyl780 == 0 { + yyct767 := r.ContainerType() + if yyct767 == codecSelferValueTypeMap1234 { + yyl767 := r.ReadMapStart() + if yyl767 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl780, d) + x.codecDecodeSelfFromMap(yyl767, d) } - } else if yyct780 == codecSelferValueTypeArray1234 { - yyl780 := r.ReadArrayStart() - if yyl780 == 0 { + } else if yyct767 == codecSelferValueTypeArray1234 { + yyl767 := r.ReadArrayStart() + if yyl767 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl780, d) + x.codecDecodeSelfFromArray(yyl767, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9388,12 +9298,12 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys781Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys781Slc - var yyhl781 bool = l >= 0 - for yyj781 := 0; ; yyj781++ { - if yyhl781 { - if yyj781 >= l { + var yys768Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys768Slc + var yyhl768 bool = l >= 0 + for yyj768 := 0; ; yyj768++ { + if yyhl768 { + if yyj768 >= l { break } } else { @@ -9402,10 +9312,35 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys781Slc = r.DecodeBytes(yys781Slc, true, true) - yys781 := string(yys781Slc) + yys768Slc = r.DecodeBytes(yys768Slc, true, true) + yys768 := string(yys768Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys781 { + switch yys768 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv769 := &x.ListMeta + yym770 := z.DecBinary() + _ = yym770 + if false { + } else if z.HasExtensions() && z.DecExt(yyv769) { + } else { + z.DecFallback(yyv769, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv771 := &x.Items + yym772 := z.DecBinary() + _ = yym772 + if false { + } else { + h.decSliceDaemonSet((*[]DaemonSet)(yyv771), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9418,35 +9353,10 @@ func (x *DaemonSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv784 := &x.ListMeta - yym785 := z.DecBinary() - _ = yym785 - if false { - } else if z.HasExtensions() && z.DecExt(yyv784) { - } else { - z.DecFallback(yyv784, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv786 := &x.Items - yym787 := z.DecBinary() - _ = yym787 - if false { - } else { - h.decSliceDaemonSet((*[]DaemonSet)(yyv786), d) - } - } default: - z.DecStructFieldNotFound(-1, yys781) - } // end switch yys781 - } // end for yyj781 + z.DecStructFieldNotFound(-1, yys768) + } // end switch yys768 + } // end for yyj768 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9454,16 +9364,61 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj788 int - var yyb788 bool - var yyhl788 bool = l >= 0 - yyj788++ - if yyhl788 { - yyb788 = yyj788 > l + var yyj775 int + var yyb775 bool + var yyhl775 bool = l >= 0 + yyj775++ + if yyhl775 { + yyb775 = yyj775 > l } else { - yyb788 = r.CheckBreak() + yyb775 = r.CheckBreak() } - if yyb788 { + if yyb775 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv776 := &x.ListMeta + yym777 := z.DecBinary() + _ = yym777 + if false { + } else if z.HasExtensions() && z.DecExt(yyv776) { + } else { + z.DecFallback(yyv776, false) + } + } + yyj775++ + if yyhl775 { + yyb775 = yyj775 > l + } else { + yyb775 = r.CheckBreak() + } + if yyb775 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv778 := &x.Items + yym779 := z.DecBinary() + _ = yym779 + if false { + } else { + h.decSliceDaemonSet((*[]DaemonSet)(yyv778), d) + } + } + yyj775++ + if yyhl775 { + yyb775 = yyj775 > l + } else { + yyb775 = r.CheckBreak() + } + if yyb775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9473,13 +9428,13 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj788++ - if yyhl788 { - yyb788 = yyj788 > l + yyj775++ + if yyhl775 { + yyb775 = yyj775 > l } else { - yyb788 = r.CheckBreak() + yyb775 = r.CheckBreak() } - if yyb788 { + if yyb775 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9489,63 +9444,18 @@ func (x *DaemonSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj788++ - if yyhl788 { - yyb788 = yyj788 > l - } else { - yyb788 = r.CheckBreak() - } - if yyb788 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv791 := &x.ListMeta - yym792 := z.DecBinary() - _ = yym792 - if false { - } else if z.HasExtensions() && z.DecExt(yyv791) { - } else { - z.DecFallback(yyv791, false) - } - } - yyj788++ - if yyhl788 { - yyb788 = yyj788 > l - } else { - yyb788 = r.CheckBreak() - } - if yyb788 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv793 := &x.Items - yym794 := z.DecBinary() - _ = yym794 - if false { - } else { - h.decSliceDaemonSet((*[]DaemonSet)(yyv793), d) - } - } for { - yyj788++ - if yyhl788 { - yyb788 = yyj788 > l + yyj775++ + if yyhl775 { + yyb775 = yyj775 > l } else { - yyb788 = r.CheckBreak() + yyb775 = r.CheckBreak() } - if yyb788 { + if yyb775 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj788-1, "") + z.DecStructFieldNotFound(yyj775-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9557,118 +9467,68 @@ func (x *ThirdPartyResourceDataList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym795 := z.EncBinary() - _ = yym795 + yym782 := z.EncBinary() + _ = yym782 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep796 := !z.EncBinary() - yy2arr796 := z.EncBasicHandle().StructToArray - var yyq796 [4]bool - _, _, _ = yysep796, yyq796, yy2arr796 - const yyr796 bool = false - yyq796[0] = x.Kind != "" - yyq796[1] = x.APIVersion != "" - yyq796[2] = true - var yynn796 int - if yyr796 || yy2arr796 { + yysep783 := !z.EncBinary() + yy2arr783 := z.EncBasicHandle().StructToArray + var yyq783 [4]bool + _, _, _ = yysep783, yyq783, yy2arr783 + const yyr783 bool = false + yyq783[0] = true + yyq783[2] = x.Kind != "" + yyq783[3] = x.APIVersion != "" + var yynn783 int + if yyr783 || yy2arr783 { r.EncodeArrayStart(4) } else { - yynn796 = 1 - for _, b := range yyq796 { + yynn783 = 1 + for _, b := range yyq783 { if b { - yynn796++ + yynn783++ } } - r.EncodeMapStart(yynn796) - yynn796 = 0 + r.EncodeMapStart(yynn783) + yynn783 = 0 } - if yyr796 || yy2arr796 { + if yyr783 || yy2arr783 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq796[0] { - yym798 := z.EncBinary() - _ = yym798 + if yyq783[0] { + yy785 := &x.ListMeta + yym786 := z.EncBinary() + _ = yym786 if false { + } else if z.HasExtensions() && z.EncExt(yy785) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq796[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym799 := z.EncBinary() - _ = yym799 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr796 || yy2arr796 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq796[1] { - yym801 := z.EncBinary() - _ = yym801 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq796[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym802 := z.EncBinary() - _ = yym802 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr796 || yy2arr796 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq796[2] { - yy804 := &x.ListMeta - yym805 := z.EncBinary() - _ = yym805 - if false { - } else if z.HasExtensions() && z.EncExt(yy804) { - } else { - z.EncFallback(yy804) + z.EncFallback(yy785) } } else { r.EncodeNil() } } else { - if yyq796[2] { + if yyq783[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy806 := &x.ListMeta - yym807 := z.EncBinary() - _ = yym807 + yy787 := &x.ListMeta + yym788 := z.EncBinary() + _ = yym788 if false { - } else if z.HasExtensions() && z.EncExt(yy806) { + } else if z.HasExtensions() && z.EncExt(yy787) { } else { - z.EncFallback(yy806) + z.EncFallback(yy787) } } } - if yyr796 || yy2arr796 { + if yyr783 || yy2arr783 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym809 := z.EncBinary() - _ = yym809 + yym790 := z.EncBinary() + _ = yym790 if false { } else { h.encSliceThirdPartyResourceData(([]ThirdPartyResourceData)(x.Items), e) @@ -9681,15 +9541,65 @@ func (x *ThirdPartyResourceDataList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym810 := z.EncBinary() - _ = yym810 + yym791 := z.EncBinary() + _ = yym791 if false { } else { h.encSliceThirdPartyResourceData(([]ThirdPartyResourceData)(x.Items), e) } } } - if yyr796 || yy2arr796 { + if yyr783 || yy2arr783 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq783[2] { + yym793 := z.EncBinary() + _ = yym793 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq783[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym794 := z.EncBinary() + _ = yym794 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr783 || yy2arr783 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq783[3] { + yym796 := z.EncBinary() + _ = yym796 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq783[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym797 := z.EncBinary() + _ = yym797 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr783 || yy2arr783 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -9702,25 +9612,25 @@ func (x *ThirdPartyResourceDataList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym811 := z.DecBinary() - _ = yym811 + yym798 := z.DecBinary() + _ = yym798 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct812 := r.ContainerType() - if yyct812 == codecSelferValueTypeMap1234 { - yyl812 := r.ReadMapStart() - if yyl812 == 0 { + yyct799 := r.ContainerType() + if yyct799 == codecSelferValueTypeMap1234 { + yyl799 := r.ReadMapStart() + if yyl799 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl812, d) + x.codecDecodeSelfFromMap(yyl799, d) } - } else if yyct812 == codecSelferValueTypeArray1234 { - yyl812 := r.ReadArrayStart() - if yyl812 == 0 { + } else if yyct799 == codecSelferValueTypeArray1234 { + yyl799 := r.ReadArrayStart() + if yyl799 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl812, d) + x.codecDecodeSelfFromArray(yyl799, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -9732,12 +9642,12 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys813Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys813Slc - var yyhl813 bool = l >= 0 - for yyj813 := 0; ; yyj813++ { - if yyhl813 { - if yyj813 >= l { + var yys800Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys800Slc + var yyhl800 bool = l >= 0 + for yyj800 := 0; ; yyj800++ { + if yyhl800 { + if yyj800 >= l { break } } else { @@ -9746,10 +9656,35 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys813Slc = r.DecodeBytes(yys813Slc, true, true) - yys813 := string(yys813Slc) + yys800Slc = r.DecodeBytes(yys800Slc, true, true) + yys800 := string(yys800Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys813 { + switch yys800 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv801 := &x.ListMeta + yym802 := z.DecBinary() + _ = yym802 + if false { + } else if z.HasExtensions() && z.DecExt(yyv801) { + } else { + z.DecFallback(yyv801, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv803 := &x.Items + yym804 := z.DecBinary() + _ = yym804 + if false { + } else { + h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv803), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -9762,35 +9697,10 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromMap(l int, d *codec1978. } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv816 := &x.ListMeta - yym817 := z.DecBinary() - _ = yym817 - if false { - } else if z.HasExtensions() && z.DecExt(yyv816) { - } else { - z.DecFallback(yyv816, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv818 := &x.Items - yym819 := z.DecBinary() - _ = yym819 - if false { - } else { - h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv818), d) - } - } default: - z.DecStructFieldNotFound(-1, yys813) - } // end switch yys813 - } // end for yyj813 + z.DecStructFieldNotFound(-1, yys800) + } // end switch yys800 + } // end for yyj800 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -9798,16 +9708,61 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj820 int - var yyb820 bool - var yyhl820 bool = l >= 0 - yyj820++ - if yyhl820 { - yyb820 = yyj820 > l + var yyj807 int + var yyb807 bool + var yyhl807 bool = l >= 0 + yyj807++ + if yyhl807 { + yyb807 = yyj807 > l } else { - yyb820 = r.CheckBreak() + yyb807 = r.CheckBreak() } - if yyb820 { + if yyb807 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv808 := &x.ListMeta + yym809 := z.DecBinary() + _ = yym809 + if false { + } else if z.HasExtensions() && z.DecExt(yyv808) { + } else { + z.DecFallback(yyv808, false) + } + } + yyj807++ + if yyhl807 { + yyb807 = yyj807 > l + } else { + yyb807 = r.CheckBreak() + } + if yyb807 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv810 := &x.Items + yym811 := z.DecBinary() + _ = yym811 + if false { + } else { + h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv810), d) + } + } + yyj807++ + if yyhl807 { + yyb807 = yyj807 > l + } else { + yyb807 = r.CheckBreak() + } + if yyb807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9817,13 +9772,13 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 } else { x.Kind = string(r.DecodeString()) } - yyj820++ - if yyhl820 { - yyb820 = yyj820 > l + yyj807++ + if yyhl807 { + yyb807 = yyj807 > l } else { - yyb820 = r.CheckBreak() + yyb807 = r.CheckBreak() } - if yyb820 { + if yyb807 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -9833,63 +9788,18 @@ func (x *ThirdPartyResourceDataList) codecDecodeSelfFromArray(l int, d *codec197 } else { x.APIVersion = string(r.DecodeString()) } - yyj820++ - if yyhl820 { - yyb820 = yyj820 > l - } else { - yyb820 = r.CheckBreak() - } - if yyb820 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv823 := &x.ListMeta - yym824 := z.DecBinary() - _ = yym824 - if false { - } else if z.HasExtensions() && z.DecExt(yyv823) { - } else { - z.DecFallback(yyv823, false) - } - } - yyj820++ - if yyhl820 { - yyb820 = yyj820 > l - } else { - yyb820 = r.CheckBreak() - } - if yyb820 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv825 := &x.Items - yym826 := z.DecBinary() - _ = yym826 - if false { - } else { - h.decSliceThirdPartyResourceData((*[]ThirdPartyResourceData)(yyv825), d) - } - } for { - yyj820++ - if yyhl820 { - yyb820 = yyj820 > l + yyj807++ + if yyhl807 { + yyb807 = yyj807 > l } else { - yyb820 = r.CheckBreak() + yyb807 = r.CheckBreak() } - if yyb820 { + if yyb807 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj820-1, "") + z.DecStructFieldNotFound(yyj807-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -9901,136 +9811,136 @@ func (x *Job) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym827 := z.EncBinary() - _ = yym827 + yym814 := z.EncBinary() + _ = yym814 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep828 := !z.EncBinary() - yy2arr828 := z.EncBasicHandle().StructToArray - var yyq828 [5]bool - _, _, _ = yysep828, yyq828, yy2arr828 - const yyr828 bool = false - yyq828[0] = x.Kind != "" - yyq828[1] = x.APIVersion != "" - yyq828[2] = true - yyq828[3] = true - yyq828[4] = true - var yynn828 int - if yyr828 || yy2arr828 { + yysep815 := !z.EncBinary() + yy2arr815 := z.EncBasicHandle().StructToArray + var yyq815 [5]bool + _, _, _ = yysep815, yyq815, yy2arr815 + const yyr815 bool = false + yyq815[0] = true + yyq815[1] = true + yyq815[2] = true + yyq815[3] = x.Kind != "" + yyq815[4] = x.APIVersion != "" + var yynn815 int + if yyr815 || yy2arr815 { r.EncodeArrayStart(5) } else { - yynn828 = 0 - for _, b := range yyq828 { + yynn815 = 0 + for _, b := range yyq815 { if b { - yynn828++ + yynn815++ } } - r.EncodeMapStart(yynn828) - yynn828 = 0 + r.EncodeMapStart(yynn815) + yynn815 = 0 } - if yyr828 || yy2arr828 { + if yyr815 || yy2arr815 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[0] { + if yyq815[0] { + yy817 := &x.ObjectMeta + yy817.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq815[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy818 := &x.ObjectMeta + yy818.CodecEncodeSelf(e) + } + } + if yyr815 || yy2arr815 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq815[1] { + yy820 := &x.Spec + yy820.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq815[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy821 := &x.Spec + yy821.CodecEncodeSelf(e) + } + } + if yyr815 || yy2arr815 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq815[2] { + yy823 := &x.Status + yy823.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq815[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy824 := &x.Status + yy824.CodecEncodeSelf(e) + } + } + if yyr815 || yy2arr815 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq815[3] { + yym826 := z.EncBinary() + _ = yym826 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq815[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym827 := z.EncBinary() + _ = yym827 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr815 || yy2arr815 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq815[4] { + yym829 := z.EncBinary() + _ = yym829 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq815[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym830 := z.EncBinary() _ = yym830 if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq828[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym831 := z.EncBinary() - _ = yym831 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr828 || yy2arr828 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[1] { - yym833 := z.EncBinary() - _ = yym833 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq828[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym834 := z.EncBinary() - _ = yym834 - if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr828 || yy2arr828 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[2] { - yy836 := &x.ObjectMeta - yy836.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq828[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy837 := &x.ObjectMeta - yy837.CodecEncodeSelf(e) - } - } - if yyr828 || yy2arr828 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[3] { - yy839 := &x.Spec - yy839.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq828[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy840 := &x.Spec - yy840.CodecEncodeSelf(e) - } - } - if yyr828 || yy2arr828 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq828[4] { - yy842 := &x.Status - yy842.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq828[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy843 := &x.Status - yy843.CodecEncodeSelf(e) - } - } - if yyr828 || yy2arr828 { + if yyr815 || yy2arr815 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10043,25 +9953,25 @@ func (x *Job) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym844 := z.DecBinary() - _ = yym844 + yym831 := z.DecBinary() + _ = yym831 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct845 := r.ContainerType() - if yyct845 == codecSelferValueTypeMap1234 { - yyl845 := r.ReadMapStart() - if yyl845 == 0 { + yyct832 := r.ContainerType() + if yyct832 == codecSelferValueTypeMap1234 { + yyl832 := r.ReadMapStart() + if yyl832 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl845, d) + x.codecDecodeSelfFromMap(yyl832, d) } - } else if yyct845 == codecSelferValueTypeArray1234 { - yyl845 := r.ReadArrayStart() - if yyl845 == 0 { + } else if yyct832 == codecSelferValueTypeArray1234 { + yyl832 := r.ReadArrayStart() + if yyl832 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl845, d) + x.codecDecodeSelfFromArray(yyl832, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10073,12 +9983,12 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys846Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys846Slc - var yyhl846 bool = l >= 0 - for yyj846 := 0; ; yyj846++ { - if yyhl846 { - if yyj846 >= l { + var yys833Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys833Slc + var yyhl833 bool = l >= 0 + for yyj833 := 0; ; yyj833++ { + if yyhl833 { + if yyj833 >= l { break } } else { @@ -10087,10 +9997,31 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys846Slc = r.DecodeBytes(yys846Slc, true, true) - yys846 := string(yys846Slc) + yys833Slc = r.DecodeBytes(yys833Slc, true, true) + yys833 := string(yys833Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys846 { + switch yys833 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv834 := &x.ObjectMeta + yyv834.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = JobSpec{} + } else { + yyv835 := &x.Spec + yyv835.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = JobStatus{} + } else { + yyv836 := &x.Status + yyv836.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -10103,31 +10034,10 @@ func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv849 := &x.ObjectMeta - yyv849.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = JobSpec{} - } else { - yyv850 := &x.Spec - yyv850.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = JobStatus{} - } else { - yyv851 := &x.Status - yyv851.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys846) - } // end switch yys846 - } // end for yyj846 + z.DecStructFieldNotFound(-1, yys833) + } // end switch yys833 + } // end for yyj833 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10135,16 +10045,67 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj852 int - var yyb852 bool - var yyhl852 bool = l >= 0 - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l + var yyj839 int + var yyb839 bool + var yyhl839 bool = l >= 0 + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l } else { - yyb852 = r.CheckBreak() + yyb839 = r.CheckBreak() } - if yyb852 { + if yyb839 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv840 := &x.ObjectMeta + yyv840.CodecDecodeSelf(d) + } + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l + } else { + yyb839 = r.CheckBreak() + } + if yyb839 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = JobSpec{} + } else { + yyv841 := &x.Spec + yyv841.CodecDecodeSelf(d) + } + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l + } else { + yyb839 = r.CheckBreak() + } + if yyb839 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = JobStatus{} + } else { + yyv842 := &x.Status + yyv842.CodecDecodeSelf(d) + } + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l + } else { + yyb839 = r.CheckBreak() + } + if yyb839 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10154,13 +10115,13 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l } else { - yyb852 = r.CheckBreak() + yyb839 = r.CheckBreak() } - if yyb852 { + if yyb839 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10170,69 +10131,18 @@ func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l - } else { - yyb852 = r.CheckBreak() - } - if yyb852 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv855 := &x.ObjectMeta - yyv855.CodecDecodeSelf(d) - } - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l - } else { - yyb852 = r.CheckBreak() - } - if yyb852 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = JobSpec{} - } else { - yyv856 := &x.Spec - yyv856.CodecDecodeSelf(d) - } - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l - } else { - yyb852 = r.CheckBreak() - } - if yyb852 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = JobStatus{} - } else { - yyv857 := &x.Status - yyv857.CodecDecodeSelf(d) - } for { - yyj852++ - if yyhl852 { - yyb852 = yyj852 > l + yyj839++ + if yyhl839 { + yyb839 = yyj839 > l } else { - yyb852 = r.CheckBreak() + yyb839 = r.CheckBreak() } - if yyb852 { + if yyb839 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj852-1, "") + z.DecStructFieldNotFound(yyj839-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10244,118 +10154,68 @@ func (x *JobList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym858 := z.EncBinary() - _ = yym858 + yym845 := z.EncBinary() + _ = yym845 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep859 := !z.EncBinary() - yy2arr859 := z.EncBasicHandle().StructToArray - var yyq859 [4]bool - _, _, _ = yysep859, yyq859, yy2arr859 - const yyr859 bool = false - yyq859[0] = x.Kind != "" - yyq859[1] = x.APIVersion != "" - yyq859[2] = true - var yynn859 int - if yyr859 || yy2arr859 { + yysep846 := !z.EncBinary() + yy2arr846 := z.EncBasicHandle().StructToArray + var yyq846 [4]bool + _, _, _ = yysep846, yyq846, yy2arr846 + const yyr846 bool = false + yyq846[0] = true + yyq846[2] = x.Kind != "" + yyq846[3] = x.APIVersion != "" + var yynn846 int + if yyr846 || yy2arr846 { r.EncodeArrayStart(4) } else { - yynn859 = 1 - for _, b := range yyq859 { + yynn846 = 1 + for _, b := range yyq846 { if b { - yynn859++ + yynn846++ } } - r.EncodeMapStart(yynn859) - yynn859 = 0 + r.EncodeMapStart(yynn846) + yynn846 = 0 } - if yyr859 || yy2arr859 { + if yyr846 || yy2arr846 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq859[0] { - yym861 := z.EncBinary() - _ = yym861 + if yyq846[0] { + yy848 := &x.ListMeta + yym849 := z.EncBinary() + _ = yym849 if false { + } else if z.HasExtensions() && z.EncExt(yy848) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq859[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym862 := z.EncBinary() - _ = yym862 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr859 || yy2arr859 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq859[1] { - yym864 := z.EncBinary() - _ = yym864 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq859[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym865 := z.EncBinary() - _ = yym865 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr859 || yy2arr859 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq859[2] { - yy867 := &x.ListMeta - yym868 := z.EncBinary() - _ = yym868 - if false { - } else if z.HasExtensions() && z.EncExt(yy867) { - } else { - z.EncFallback(yy867) + z.EncFallback(yy848) } } else { r.EncodeNil() } } else { - if yyq859[2] { + if yyq846[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy869 := &x.ListMeta - yym870 := z.EncBinary() - _ = yym870 + yy850 := &x.ListMeta + yym851 := z.EncBinary() + _ = yym851 if false { - } else if z.HasExtensions() && z.EncExt(yy869) { + } else if z.HasExtensions() && z.EncExt(yy850) { } else { - z.EncFallback(yy869) + z.EncFallback(yy850) } } } - if yyr859 || yy2arr859 { + if yyr846 || yy2arr846 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym872 := z.EncBinary() - _ = yym872 + yym853 := z.EncBinary() + _ = yym853 if false { } else { h.encSliceJob(([]Job)(x.Items), e) @@ -10368,15 +10228,65 @@ func (x *JobList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym873 := z.EncBinary() - _ = yym873 + yym854 := z.EncBinary() + _ = yym854 if false { } else { h.encSliceJob(([]Job)(x.Items), e) } } } - if yyr859 || yy2arr859 { + if yyr846 || yy2arr846 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq846[2] { + yym856 := z.EncBinary() + _ = yym856 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq846[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym857 := z.EncBinary() + _ = yym857 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr846 || yy2arr846 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq846[3] { + yym859 := z.EncBinary() + _ = yym859 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq846[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym860 := z.EncBinary() + _ = yym860 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr846 || yy2arr846 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10389,25 +10299,25 @@ func (x *JobList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym874 := z.DecBinary() - _ = yym874 + yym861 := z.DecBinary() + _ = yym861 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct875 := r.ContainerType() - if yyct875 == codecSelferValueTypeMap1234 { - yyl875 := r.ReadMapStart() - if yyl875 == 0 { + yyct862 := r.ContainerType() + if yyct862 == codecSelferValueTypeMap1234 { + yyl862 := r.ReadMapStart() + if yyl862 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl875, d) + x.codecDecodeSelfFromMap(yyl862, d) } - } else if yyct875 == codecSelferValueTypeArray1234 { - yyl875 := r.ReadArrayStart() - if yyl875 == 0 { + } else if yyct862 == codecSelferValueTypeArray1234 { + yyl862 := r.ReadArrayStart() + if yyl862 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl875, d) + x.codecDecodeSelfFromArray(yyl862, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10419,12 +10329,12 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys876Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys876Slc - var yyhl876 bool = l >= 0 - for yyj876 := 0; ; yyj876++ { - if yyhl876 { - if yyj876 >= l { + var yys863Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys863Slc + var yyhl863 bool = l >= 0 + for yyj863 := 0; ; yyj863++ { + if yyhl863 { + if yyj863 >= l { break } } else { @@ -10433,10 +10343,35 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys876Slc = r.DecodeBytes(yys876Slc, true, true) - yys876 := string(yys876Slc) + yys863Slc = r.DecodeBytes(yys863Slc, true, true) + yys863 := string(yys863Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys876 { + switch yys863 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv864 := &x.ListMeta + yym865 := z.DecBinary() + _ = yym865 + if false { + } else if z.HasExtensions() && z.DecExt(yyv864) { + } else { + z.DecFallback(yyv864, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv866 := &x.Items + yym867 := z.DecBinary() + _ = yym867 + if false { + } else { + h.decSliceJob((*[]Job)(yyv866), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -10449,35 +10384,10 @@ func (x *JobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv879 := &x.ListMeta - yym880 := z.DecBinary() - _ = yym880 - if false { - } else if z.HasExtensions() && z.DecExt(yyv879) { - } else { - z.DecFallback(yyv879, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv881 := &x.Items - yym882 := z.DecBinary() - _ = yym882 - if false { - } else { - h.decSliceJob((*[]Job)(yyv881), d) - } - } default: - z.DecStructFieldNotFound(-1, yys876) - } // end switch yys876 - } // end for yyj876 + z.DecStructFieldNotFound(-1, yys863) + } // end switch yys863 + } // end for yyj863 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10485,16 +10395,61 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj883 int - var yyb883 bool - var yyhl883 bool = l >= 0 - yyj883++ - if yyhl883 { - yyb883 = yyj883 > l + var yyj870 int + var yyb870 bool + var yyhl870 bool = l >= 0 + yyj870++ + if yyhl870 { + yyb870 = yyj870 > l } else { - yyb883 = r.CheckBreak() + yyb870 = r.CheckBreak() } - if yyb883 { + if yyb870 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv871 := &x.ListMeta + yym872 := z.DecBinary() + _ = yym872 + if false { + } else if z.HasExtensions() && z.DecExt(yyv871) { + } else { + z.DecFallback(yyv871, false) + } + } + yyj870++ + if yyhl870 { + yyb870 = yyj870 > l + } else { + yyb870 = r.CheckBreak() + } + if yyb870 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv873 := &x.Items + yym874 := z.DecBinary() + _ = yym874 + if false { + } else { + h.decSliceJob((*[]Job)(yyv873), d) + } + } + yyj870++ + if yyhl870 { + yyb870 = yyj870 > l + } else { + yyb870 = r.CheckBreak() + } + if yyb870 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10504,13 +10459,13 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj883++ - if yyhl883 { - yyb883 = yyj883 > l + yyj870++ + if yyhl870 { + yyb870 = yyj870 > l } else { - yyb883 = r.CheckBreak() + yyb870 = r.CheckBreak() } - if yyb883 { + if yyb870 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10520,63 +10475,18 @@ func (x *JobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj883++ - if yyhl883 { - yyb883 = yyj883 > l - } else { - yyb883 = r.CheckBreak() - } - if yyb883 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv886 := &x.ListMeta - yym887 := z.DecBinary() - _ = yym887 - if false { - } else if z.HasExtensions() && z.DecExt(yyv886) { - } else { - z.DecFallback(yyv886, false) - } - } - yyj883++ - if yyhl883 { - yyb883 = yyj883 > l - } else { - yyb883 = r.CheckBreak() - } - if yyb883 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv888 := &x.Items - yym889 := z.DecBinary() - _ = yym889 - if false { - } else { - h.decSliceJob((*[]Job)(yyv888), d) - } - } for { - yyj883++ - if yyhl883 { - yyb883 = yyj883 > l + yyj870++ + if yyhl870 { + yyb870 = yyj870 > l } else { - yyb883 = r.CheckBreak() + yyb870 = r.CheckBreak() } - if yyb883 { + if yyb870 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj883-1, "") + z.DecStructFieldNotFound(yyj870-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -10588,141 +10498,141 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym890 := z.EncBinary() - _ = yym890 + yym877 := z.EncBinary() + _ = yym877 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep891 := !z.EncBinary() - yy2arr891 := z.EncBasicHandle().StructToArray - var yyq891 [5]bool - _, _, _ = yysep891, yyq891, yy2arr891 - const yyr891 bool = false - yyq891[0] = x.Parallelism != nil - yyq891[1] = x.Completions != nil - yyq891[2] = x.ActiveDeadlineSeconds != nil - yyq891[3] = x.Selector != nil - var yynn891 int - if yyr891 || yy2arr891 { + yysep878 := !z.EncBinary() + yy2arr878 := z.EncBasicHandle().StructToArray + var yyq878 [5]bool + _, _, _ = yysep878, yyq878, yy2arr878 + const yyr878 bool = false + yyq878[0] = x.Parallelism != nil + yyq878[1] = x.Completions != nil + yyq878[2] = x.ActiveDeadlineSeconds != nil + yyq878[3] = x.Selector != nil + var yynn878 int + if yyr878 || yy2arr878 { r.EncodeArrayStart(5) } else { - yynn891 = 1 - for _, b := range yyq891 { + yynn878 = 1 + for _, b := range yyq878 { if b { - yynn891++ + yynn878++ } } - r.EncodeMapStart(yynn891) - yynn891 = 0 + r.EncodeMapStart(yynn878) + yynn878 = 0 } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq891[0] { + if yyq878[0] { if x.Parallelism == nil { r.EncodeNil() } else { - yy893 := *x.Parallelism - yym894 := z.EncBinary() - _ = yym894 + yy880 := *x.Parallelism + yym881 := z.EncBinary() + _ = yym881 if false { } else { - r.EncodeInt(int64(yy893)) + r.EncodeInt(int64(yy880)) } } } else { r.EncodeNil() } } else { - if yyq891[0] { + if yyq878[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("parallelism")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Parallelism == nil { r.EncodeNil() } else { - yy895 := *x.Parallelism - yym896 := z.EncBinary() - _ = yym896 + yy882 := *x.Parallelism + yym883 := z.EncBinary() + _ = yym883 if false { } else { - r.EncodeInt(int64(yy895)) + r.EncodeInt(int64(yy882)) } } } } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq891[1] { + if yyq878[1] { if x.Completions == nil { r.EncodeNil() } else { - yy898 := *x.Completions - yym899 := z.EncBinary() - _ = yym899 + yy885 := *x.Completions + yym886 := z.EncBinary() + _ = yym886 if false { } else { - r.EncodeInt(int64(yy898)) + r.EncodeInt(int64(yy885)) } } } else { r.EncodeNil() } } else { - if yyq891[1] { + if yyq878[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("completions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Completions == nil { r.EncodeNil() } else { - yy900 := *x.Completions - yym901 := z.EncBinary() - _ = yym901 + yy887 := *x.Completions + yym888 := z.EncBinary() + _ = yym888 if false { } else { - r.EncodeInt(int64(yy900)) + r.EncodeInt(int64(yy887)) } } } } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq891[2] { + if yyq878[2] { if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy903 := *x.ActiveDeadlineSeconds - yym904 := z.EncBinary() - _ = yym904 + yy890 := *x.ActiveDeadlineSeconds + yym891 := z.EncBinary() + _ = yym891 if false { } else { - r.EncodeInt(int64(yy903)) + r.EncodeInt(int64(yy890)) } } } else { r.EncodeNil() } } else { - if yyq891[2] { + if yyq878[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("activeDeadlineSeconds")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.ActiveDeadlineSeconds == nil { r.EncodeNil() } else { - yy905 := *x.ActiveDeadlineSeconds - yym906 := z.EncBinary() - _ = yym906 + yy892 := *x.ActiveDeadlineSeconds + yym893 := z.EncBinary() + _ = yym893 if false { } else { - r.EncodeInt(int64(yy905)) + r.EncodeInt(int64(yy892)) } } } } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq891[3] { + if yyq878[3] { if x.Selector == nil { r.EncodeNil() } else { @@ -10732,7 +10642,7 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq891[3] { + if yyq878[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -10743,18 +10653,18 @@ func (x *JobSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy909 := &x.Template - yy909.CodecEncodeSelf(e) + yy896 := &x.Template + yy896.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy910 := &x.Template - yy910.CodecEncodeSelf(e) + yy897 := &x.Template + yy897.CodecEncodeSelf(e) } - if yyr891 || yy2arr891 { + if yyr878 || yy2arr878 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -10767,25 +10677,25 @@ func (x *JobSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym911 := z.DecBinary() - _ = yym911 + yym898 := z.DecBinary() + _ = yym898 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct912 := r.ContainerType() - if yyct912 == codecSelferValueTypeMap1234 { - yyl912 := r.ReadMapStart() - if yyl912 == 0 { + yyct899 := r.ContainerType() + if yyct899 == codecSelferValueTypeMap1234 { + yyl899 := r.ReadMapStart() + if yyl899 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl912, d) + x.codecDecodeSelfFromMap(yyl899, d) } - } else if yyct912 == codecSelferValueTypeArray1234 { - yyl912 := r.ReadArrayStart() - if yyl912 == 0 { + } else if yyct899 == codecSelferValueTypeArray1234 { + yyl899 := r.ReadArrayStart() + if yyl899 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl912, d) + x.codecDecodeSelfFromArray(yyl899, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -10797,12 +10707,12 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys913Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys913Slc - var yyhl913 bool = l >= 0 - for yyj913 := 0; ; yyj913++ { - if yyhl913 { - if yyj913 >= l { + var yys900Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys900Slc + var yyhl900 bool = l >= 0 + for yyj900 := 0; ; yyj900++ { + if yyhl900 { + if yyj900 >= l { break } } else { @@ -10811,10 +10721,10 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys913Slc = r.DecodeBytes(yys913Slc, true, true) - yys913 := string(yys913Slc) + yys900Slc = r.DecodeBytes(yys900Slc, true, true) + yys900 := string(yys900Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys913 { + switch yys900 { case "parallelism": if r.TryDecodeAsNil() { if x.Parallelism != nil { @@ -10824,8 +10734,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Parallelism == nil { x.Parallelism = new(int32) } - yym915 := z.DecBinary() - _ = yym915 + yym902 := z.DecBinary() + _ = yym902 if false { } else { *((*int32)(x.Parallelism)) = int32(r.DecodeInt(32)) @@ -10840,8 +10750,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Completions == nil { x.Completions = new(int32) } - yym917 := z.DecBinary() - _ = yym917 + yym904 := z.DecBinary() + _ = yym904 if false { } else { *((*int32)(x.Completions)) = int32(r.DecodeInt(32)) @@ -10856,8 +10766,8 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym919 := z.DecBinary() - _ = yym919 + yym906 := z.DecBinary() + _ = yym906 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) @@ -10878,13 +10788,13 @@ func (x *JobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv921 := &x.Template - yyv921.CodecDecodeSelf(d) + yyv908 := &x.Template + yyv908.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys913) - } // end switch yys913 - } // end for yyj913 + z.DecStructFieldNotFound(-1, yys900) + } // end switch yys900 + } // end for yyj900 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -10892,16 +10802,16 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj922 int - var yyb922 bool - var yyhl922 bool = l >= 0 - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + var yyj909 int + var yyb909 bool + var yyhl909 bool = l >= 0 + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10914,20 +10824,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Parallelism == nil { x.Parallelism = new(int32) } - yym924 := z.DecBinary() - _ = yym924 + yym911 := z.DecBinary() + _ = yym911 if false { } else { *((*int32)(x.Parallelism)) = int32(r.DecodeInt(32)) } } - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10940,20 +10850,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Completions == nil { x.Completions = new(int32) } - yym926 := z.DecBinary() - _ = yym926 + yym913 := z.DecBinary() + _ = yym913 if false { } else { *((*int32)(x.Completions)) = int32(r.DecodeInt(32)) } } - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10966,20 +10876,20 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.ActiveDeadlineSeconds == nil { x.ActiveDeadlineSeconds = new(int64) } - yym928 := z.DecBinary() - _ = yym928 + yym915 := z.DecBinary() + _ = yym915 if false { } else { *((*int64)(x.ActiveDeadlineSeconds)) = int64(r.DecodeInt(64)) } } - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -10994,13 +10904,13 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Selector.CodecDecodeSelf(d) } - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11008,21 +10918,21 @@ func (x *JobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Template = pkg2_v1.PodTemplateSpec{} } else { - yyv930 := &x.Template - yyv930.CodecDecodeSelf(d) + yyv917 := &x.Template + yyv917.CodecDecodeSelf(d) } for { - yyj922++ - if yyhl922 { - yyb922 = yyj922 > l + yyj909++ + if yyhl909 { + yyb909 = yyj909 > l } else { - yyb922 = r.CheckBreak() + yyb909 = r.CheckBreak() } - if yyb922 { + if yyb909 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj922-1, "") + z.DecStructFieldNotFound(yyj909-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11034,43 +10944,43 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym931 := z.EncBinary() - _ = yym931 + yym918 := z.EncBinary() + _ = yym918 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep932 := !z.EncBinary() - yy2arr932 := z.EncBasicHandle().StructToArray - var yyq932 [6]bool - _, _, _ = yysep932, yyq932, yy2arr932 - const yyr932 bool = false - yyq932[0] = len(x.Conditions) != 0 - yyq932[1] = x.StartTime != nil - yyq932[2] = x.CompletionTime != nil - yyq932[3] = x.Active != 0 - yyq932[4] = x.Succeeded != 0 - yyq932[5] = x.Failed != 0 - var yynn932 int - if yyr932 || yy2arr932 { + yysep919 := !z.EncBinary() + yy2arr919 := z.EncBasicHandle().StructToArray + var yyq919 [6]bool + _, _, _ = yysep919, yyq919, yy2arr919 + const yyr919 bool = false + yyq919[0] = len(x.Conditions) != 0 + yyq919[1] = x.StartTime != nil + yyq919[2] = x.CompletionTime != nil + yyq919[3] = x.Active != 0 + yyq919[4] = x.Succeeded != 0 + yyq919[5] = x.Failed != 0 + var yynn919 int + if yyr919 || yy2arr919 { r.EncodeArrayStart(6) } else { - yynn932 = 0 - for _, b := range yyq932 { + yynn919 = 0 + for _, b := range yyq919 { if b { - yynn932++ + yynn919++ } } - r.EncodeMapStart(yynn932) - yynn932 = 0 + r.EncodeMapStart(yynn919) + yynn919 = 0 } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[0] { + if yyq919[0] { if x.Conditions == nil { r.EncodeNil() } else { - yym934 := z.EncBinary() - _ = yym934 + yym921 := z.EncBinary() + _ = yym921 if false { } else { h.encSliceJobCondition(([]JobCondition)(x.Conditions), e) @@ -11080,15 +10990,15 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq932[0] { + if yyq919[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("conditions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Conditions == nil { r.EncodeNil() } else { - yym935 := z.EncBinary() - _ = yym935 + yym922 := z.EncBinary() + _ = yym922 if false { } else { h.encSliceJobCondition(([]JobCondition)(x.Conditions), e) @@ -11096,19 +11006,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[1] { + if yyq919[1] { if x.StartTime == nil { r.EncodeNil() } else { - yym937 := z.EncBinary() - _ = yym937 + yym924 := z.EncBinary() + _ = yym924 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym937 { + } else if yym924 { z.EncBinaryMarshal(x.StartTime) - } else if !yym937 && z.IsJSONHandle() { + } else if !yym924 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -11118,20 +11028,20 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq932[1] { + if yyq919[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("startTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.StartTime == nil { r.EncodeNil() } else { - yym938 := z.EncBinary() - _ = yym938 + yym925 := z.EncBinary() + _ = yym925 if false { } else if z.HasExtensions() && z.EncExt(x.StartTime) { - } else if yym938 { + } else if yym925 { z.EncBinaryMarshal(x.StartTime) - } else if !yym938 && z.IsJSONHandle() { + } else if !yym925 && z.IsJSONHandle() { z.EncJSONMarshal(x.StartTime) } else { z.EncFallback(x.StartTime) @@ -11139,19 +11049,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[2] { + if yyq919[2] { if x.CompletionTime == nil { r.EncodeNil() } else { - yym940 := z.EncBinary() - _ = yym940 + yym927 := z.EncBinary() + _ = yym927 if false { } else if z.HasExtensions() && z.EncExt(x.CompletionTime) { - } else if yym940 { + } else if yym927 { z.EncBinaryMarshal(x.CompletionTime) - } else if !yym940 && z.IsJSONHandle() { + } else if !yym927 && z.IsJSONHandle() { z.EncJSONMarshal(x.CompletionTime) } else { z.EncFallback(x.CompletionTime) @@ -11161,20 +11071,20 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq932[2] { + if yyq919[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("completionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.CompletionTime == nil { r.EncodeNil() } else { - yym941 := z.EncBinary() - _ = yym941 + yym928 := z.EncBinary() + _ = yym928 if false { } else if z.HasExtensions() && z.EncExt(x.CompletionTime) { - } else if yym941 { + } else if yym928 { z.EncBinaryMarshal(x.CompletionTime) - } else if !yym941 && z.IsJSONHandle() { + } else if !yym928 && z.IsJSONHandle() { z.EncJSONMarshal(x.CompletionTime) } else { z.EncFallback(x.CompletionTime) @@ -11182,11 +11092,11 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[3] { - yym943 := z.EncBinary() - _ = yym943 + if yyq919[3] { + yym930 := z.EncBinary() + _ = yym930 if false { } else { r.EncodeInt(int64(x.Active)) @@ -11195,23 +11105,23 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq932[3] { + if yyq919[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("active")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym944 := z.EncBinary() - _ = yym944 + yym931 := z.EncBinary() + _ = yym931 if false { } else { r.EncodeInt(int64(x.Active)) } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[4] { - yym946 := z.EncBinary() - _ = yym946 + if yyq919[4] { + yym933 := z.EncBinary() + _ = yym933 if false { } else { r.EncodeInt(int64(x.Succeeded)) @@ -11220,23 +11130,23 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq932[4] { + if yyq919[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("succeeded")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym947 := z.EncBinary() - _ = yym947 + yym934 := z.EncBinary() + _ = yym934 if false { } else { r.EncodeInt(int64(x.Succeeded)) } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq932[5] { - yym949 := z.EncBinary() - _ = yym949 + if yyq919[5] { + yym936 := z.EncBinary() + _ = yym936 if false { } else { r.EncodeInt(int64(x.Failed)) @@ -11245,19 +11155,19 @@ func (x *JobStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq932[5] { + if yyq919[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("failed")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym950 := z.EncBinary() - _ = yym950 + yym937 := z.EncBinary() + _ = yym937 if false { } else { r.EncodeInt(int64(x.Failed)) } } } - if yyr932 || yy2arr932 { + if yyr919 || yy2arr919 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11270,25 +11180,25 @@ func (x *JobStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym951 := z.DecBinary() - _ = yym951 + yym938 := z.DecBinary() + _ = yym938 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct952 := r.ContainerType() - if yyct952 == codecSelferValueTypeMap1234 { - yyl952 := r.ReadMapStart() - if yyl952 == 0 { + yyct939 := r.ContainerType() + if yyct939 == codecSelferValueTypeMap1234 { + yyl939 := r.ReadMapStart() + if yyl939 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl952, d) + x.codecDecodeSelfFromMap(yyl939, d) } - } else if yyct952 == codecSelferValueTypeArray1234 { - yyl952 := r.ReadArrayStart() - if yyl952 == 0 { + } else if yyct939 == codecSelferValueTypeArray1234 { + yyl939 := r.ReadArrayStart() + if yyl939 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl952, d) + x.codecDecodeSelfFromArray(yyl939, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11300,12 +11210,12 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys953Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys953Slc - var yyhl953 bool = l >= 0 - for yyj953 := 0; ; yyj953++ { - if yyhl953 { - if yyj953 >= l { + var yys940Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys940Slc + var yyhl940 bool = l >= 0 + for yyj940 := 0; ; yyj940++ { + if yyhl940 { + if yyj940 >= l { break } } else { @@ -11314,20 +11224,20 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys953Slc = r.DecodeBytes(yys953Slc, true, true) - yys953 := string(yys953Slc) + yys940Slc = r.DecodeBytes(yys940Slc, true, true) + yys940 := string(yys940Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys953 { + switch yys940 { case "conditions": if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv954 := &x.Conditions - yym955 := z.DecBinary() - _ = yym955 + yyv941 := &x.Conditions + yym942 := z.DecBinary() + _ = yym942 if false { } else { - h.decSliceJobCondition((*[]JobCondition)(yyv954), d) + h.decSliceJobCondition((*[]JobCondition)(yyv941), d) } } case "startTime": @@ -11339,13 +11249,13 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg1_unversioned.Time) } - yym957 := z.DecBinary() - _ = yym957 + yym944 := z.DecBinary() + _ = yym944 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym957 { + } else if yym944 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym957 && z.IsJSONHandle() { + } else if !yym944 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) @@ -11360,13 +11270,13 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.CompletionTime == nil { x.CompletionTime = new(pkg1_unversioned.Time) } - yym959 := z.DecBinary() - _ = yym959 + yym946 := z.DecBinary() + _ = yym946 if false { } else if z.HasExtensions() && z.DecExt(x.CompletionTime) { - } else if yym959 { + } else if yym946 { z.DecBinaryUnmarshal(x.CompletionTime) - } else if !yym959 && z.IsJSONHandle() { + } else if !yym946 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.CompletionTime) } else { z.DecFallback(x.CompletionTime, false) @@ -11391,9 +11301,9 @@ func (x *JobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Failed = int32(r.DecodeInt(32)) } default: - z.DecStructFieldNotFound(-1, yys953) - } // end switch yys953 - } // end for yyj953 + z.DecStructFieldNotFound(-1, yys940) + } // end switch yys940 + } // end for yyj940 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11401,16 +11311,16 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj963 int - var yyb963 bool - var yyhl963 bool = l >= 0 - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + var yyj950 int + var yyb950 bool + var yyhl950 bool = l >= 0 + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11418,21 +11328,21 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Conditions = nil } else { - yyv964 := &x.Conditions - yym965 := z.DecBinary() - _ = yym965 + yyv951 := &x.Conditions + yym952 := z.DecBinary() + _ = yym952 if false { } else { - h.decSliceJobCondition((*[]JobCondition)(yyv964), d) + h.decSliceJobCondition((*[]JobCondition)(yyv951), d) } } - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11445,25 +11355,25 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.StartTime == nil { x.StartTime = new(pkg1_unversioned.Time) } - yym967 := z.DecBinary() - _ = yym967 + yym954 := z.DecBinary() + _ = yym954 if false { } else if z.HasExtensions() && z.DecExt(x.StartTime) { - } else if yym967 { + } else if yym954 { z.DecBinaryUnmarshal(x.StartTime) - } else if !yym967 && z.IsJSONHandle() { + } else if !yym954 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.StartTime) } else { z.DecFallback(x.StartTime, false) } } - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11476,25 +11386,25 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.CompletionTime == nil { x.CompletionTime = new(pkg1_unversioned.Time) } - yym969 := z.DecBinary() - _ = yym969 + yym956 := z.DecBinary() + _ = yym956 if false { } else if z.HasExtensions() && z.DecExt(x.CompletionTime) { - } else if yym969 { + } else if yym956 { z.DecBinaryUnmarshal(x.CompletionTime) - } else if !yym969 && z.IsJSONHandle() { + } else if !yym956 && z.IsJSONHandle() { z.DecJSONUnmarshal(x.CompletionTime) } else { z.DecFallback(x.CompletionTime, false) } } - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11504,13 +11414,13 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Active = int32(r.DecodeInt(32)) } - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11520,13 +11430,13 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Succeeded = int32(r.DecodeInt(32)) } - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11537,17 +11447,17 @@ func (x *JobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Failed = int32(r.DecodeInt(32)) } for { - yyj963++ - if yyhl963 { - yyb963 = yyj963 > l + yyj950++ + if yyhl950 { + yyb950 = yyj950 > l } else { - yyb963 = r.CheckBreak() + yyb950 = r.CheckBreak() } - if yyb963 { + if yyb950 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj963-1, "") + z.DecStructFieldNotFound(yyj950-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -11556,8 +11466,8 @@ func (x JobConditionType) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym973 := z.EncBinary() - _ = yym973 + yym960 := z.EncBinary() + _ = yym960 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -11569,8 +11479,8 @@ func (x *JobConditionType) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym974 := z.DecBinary() - _ = yym974 + yym961 := z.DecBinary() + _ = yym961 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -11585,34 +11495,34 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym975 := z.EncBinary() - _ = yym975 + yym962 := z.EncBinary() + _ = yym962 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep976 := !z.EncBinary() - yy2arr976 := z.EncBasicHandle().StructToArray - var yyq976 [6]bool - _, _, _ = yysep976, yyq976, yy2arr976 - const yyr976 bool = false - yyq976[2] = true - yyq976[3] = true - yyq976[4] = x.Reason != "" - yyq976[5] = x.Message != "" - var yynn976 int - if yyr976 || yy2arr976 { + yysep963 := !z.EncBinary() + yy2arr963 := z.EncBasicHandle().StructToArray + var yyq963 [6]bool + _, _, _ = yysep963, yyq963, yy2arr963 + const yyr963 bool = false + yyq963[2] = true + yyq963[3] = true + yyq963[4] = x.Reason != "" + yyq963[5] = x.Message != "" + var yynn963 int + if yyr963 || yy2arr963 { r.EncodeArrayStart(6) } else { - yynn976 = 2 - for _, b := range yyq976 { + yynn963 = 2 + for _, b := range yyq963 { if b { - yynn976++ + yynn963++ } } - r.EncodeMapStart(yynn976) - yynn976 = 0 + r.EncodeMapStart(yynn963) + yynn963 = 0 } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Type.CodecEncodeSelf(e) } else { @@ -11621,10 +11531,10 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Type.CodecEncodeSelf(e) } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym979 := z.EncBinary() - _ = yym979 + yym966 := z.EncBinary() + _ = yym966 if false { } else if z.HasExtensions() && z.EncExt(x.Status) { } else { @@ -11634,93 +11544,93 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym980 := z.EncBinary() - _ = yym980 + yym967 := z.EncBinary() + _ = yym967 if false { } else if z.HasExtensions() && z.EncExt(x.Status) { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Status)) } } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq976[2] { - yy982 := &x.LastProbeTime - yym983 := z.EncBinary() - _ = yym983 + if yyq963[2] { + yy969 := &x.LastProbeTime + yym970 := z.EncBinary() + _ = yym970 if false { - } else if z.HasExtensions() && z.EncExt(yy982) { - } else if yym983 { - z.EncBinaryMarshal(yy982) - } else if !yym983 && z.IsJSONHandle() { - z.EncJSONMarshal(yy982) + } else if z.HasExtensions() && z.EncExt(yy969) { + } else if yym970 { + z.EncBinaryMarshal(yy969) + } else if !yym970 && z.IsJSONHandle() { + z.EncJSONMarshal(yy969) } else { - z.EncFallback(yy982) + z.EncFallback(yy969) } } else { r.EncodeNil() } } else { - if yyq976[2] { + if yyq963[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy984 := &x.LastProbeTime - yym985 := z.EncBinary() - _ = yym985 + yy971 := &x.LastProbeTime + yym972 := z.EncBinary() + _ = yym972 if false { - } else if z.HasExtensions() && z.EncExt(yy984) { - } else if yym985 { - z.EncBinaryMarshal(yy984) - } else if !yym985 && z.IsJSONHandle() { - z.EncJSONMarshal(yy984) + } else if z.HasExtensions() && z.EncExt(yy971) { + } else if yym972 { + z.EncBinaryMarshal(yy971) + } else if !yym972 && z.IsJSONHandle() { + z.EncJSONMarshal(yy971) } else { - z.EncFallback(yy984) + z.EncFallback(yy971) } } } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq976[3] { - yy987 := &x.LastTransitionTime - yym988 := z.EncBinary() - _ = yym988 + if yyq963[3] { + yy974 := &x.LastTransitionTime + yym975 := z.EncBinary() + _ = yym975 if false { - } else if z.HasExtensions() && z.EncExt(yy987) { - } else if yym988 { - z.EncBinaryMarshal(yy987) - } else if !yym988 && z.IsJSONHandle() { - z.EncJSONMarshal(yy987) + } else if z.HasExtensions() && z.EncExt(yy974) { + } else if yym975 { + z.EncBinaryMarshal(yy974) + } else if !yym975 && z.IsJSONHandle() { + z.EncJSONMarshal(yy974) } else { - z.EncFallback(yy987) + z.EncFallback(yy974) } } else { r.EncodeNil() } } else { - if yyq976[3] { + if yyq963[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy989 := &x.LastTransitionTime - yym990 := z.EncBinary() - _ = yym990 + yy976 := &x.LastTransitionTime + yym977 := z.EncBinary() + _ = yym977 if false { - } else if z.HasExtensions() && z.EncExt(yy989) { - } else if yym990 { - z.EncBinaryMarshal(yy989) - } else if !yym990 && z.IsJSONHandle() { - z.EncJSONMarshal(yy989) + } else if z.HasExtensions() && z.EncExt(yy976) { + } else if yym977 { + z.EncBinaryMarshal(yy976) + } else if !yym977 && z.IsJSONHandle() { + z.EncJSONMarshal(yy976) } else { - z.EncFallback(yy989) + z.EncFallback(yy976) } } } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq976[4] { - yym992 := z.EncBinary() - _ = yym992 + if yyq963[4] { + yym979 := z.EncBinary() + _ = yym979 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) @@ -11729,23 +11639,23 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq976[4] { + if yyq963[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("reason")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym993 := z.EncBinary() - _ = yym993 + yym980 := z.EncBinary() + _ = yym980 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) } } } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq976[5] { - yym995 := z.EncBinary() - _ = yym995 + if yyq963[5] { + yym982 := z.EncBinary() + _ = yym982 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) @@ -11754,19 +11664,19 @@ func (x *JobCondition) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq976[5] { + if yyq963[5] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("message")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym996 := z.EncBinary() - _ = yym996 + yym983 := z.EncBinary() + _ = yym983 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Message)) } } } - if yyr976 || yy2arr976 { + if yyr963 || yy2arr963 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -11779,25 +11689,25 @@ func (x *JobCondition) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym997 := z.DecBinary() - _ = yym997 + yym984 := z.DecBinary() + _ = yym984 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct998 := r.ContainerType() - if yyct998 == codecSelferValueTypeMap1234 { - yyl998 := r.ReadMapStart() - if yyl998 == 0 { + yyct985 := r.ContainerType() + if yyct985 == codecSelferValueTypeMap1234 { + yyl985 := r.ReadMapStart() + if yyl985 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl998, d) + x.codecDecodeSelfFromMap(yyl985, d) } - } else if yyct998 == codecSelferValueTypeArray1234 { - yyl998 := r.ReadArrayStart() - if yyl998 == 0 { + } else if yyct985 == codecSelferValueTypeArray1234 { + yyl985 := r.ReadArrayStart() + if yyl985 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl998, d) + x.codecDecodeSelfFromArray(yyl985, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -11809,12 +11719,12 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys999Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys999Slc - var yyhl999 bool = l >= 0 - for yyj999 := 0; ; yyj999++ { - if yyhl999 { - if yyj999 >= l { + var yys986Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys986Slc + var yyhl986 bool = l >= 0 + for yyj986 := 0; ; yyj986++ { + if yyhl986 { + if yyj986 >= l { break } } else { @@ -11823,10 +11733,10 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys999Slc = r.DecodeBytes(yys999Slc, true, true) - yys999 := string(yys999Slc) + yys986Slc = r.DecodeBytes(yys986Slc, true, true) + yys986 := string(yys986Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys999 { + switch yys986 { case "type": if r.TryDecodeAsNil() { x.Type = "" @@ -11843,34 +11753,34 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg1_unversioned.Time{} } else { - yyv1002 := &x.LastProbeTime - yym1003 := z.DecBinary() - _ = yym1003 + yyv989 := &x.LastProbeTime + yym990 := z.DecBinary() + _ = yym990 if false { - } else if z.HasExtensions() && z.DecExt(yyv1002) { - } else if yym1003 { - z.DecBinaryUnmarshal(yyv1002) - } else if !yym1003 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1002) + } else if z.HasExtensions() && z.DecExt(yyv989) { + } else if yym990 { + z.DecBinaryUnmarshal(yyv989) + } else if !yym990 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv989) } else { - z.DecFallback(yyv1002, false) + z.DecFallback(yyv989, false) } } case "lastTransitionTime": if r.TryDecodeAsNil() { x.LastTransitionTime = pkg1_unversioned.Time{} } else { - yyv1004 := &x.LastTransitionTime - yym1005 := z.DecBinary() - _ = yym1005 + yyv991 := &x.LastTransitionTime + yym992 := z.DecBinary() + _ = yym992 if false { - } else if z.HasExtensions() && z.DecExt(yyv1004) { - } else if yym1005 { - z.DecBinaryUnmarshal(yyv1004) - } else if !yym1005 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1004) + } else if z.HasExtensions() && z.DecExt(yyv991) { + } else if yym992 { + z.DecBinaryUnmarshal(yyv991) + } else if !yym992 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv991) } else { - z.DecFallback(yyv1004, false) + z.DecFallback(yyv991, false) } } case "reason": @@ -11886,9 +11796,9 @@ func (x *JobCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } default: - z.DecStructFieldNotFound(-1, yys999) - } // end switch yys999 - } // end for yyj999 + z.DecStructFieldNotFound(-1, yys986) + } // end switch yys986 + } // end for yyj986 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -11896,16 +11806,16 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1008 int - var yyb1008 bool - var yyhl1008 bool = l >= 0 - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + var yyj995 int + var yyb995 bool + var yyhl995 bool = l >= 0 + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11915,13 +11825,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Type = JobConditionType(r.DecodeString()) } - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11931,13 +11841,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Status = pkg2_v1.ConditionStatus(r.DecodeString()) } - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11945,26 +11855,26 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastProbeTime = pkg1_unversioned.Time{} } else { - yyv1011 := &x.LastProbeTime - yym1012 := z.DecBinary() - _ = yym1012 + yyv998 := &x.LastProbeTime + yym999 := z.DecBinary() + _ = yym999 if false { - } else if z.HasExtensions() && z.DecExt(yyv1011) { - } else if yym1012 { - z.DecBinaryUnmarshal(yyv1011) - } else if !yym1012 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1011) + } else if z.HasExtensions() && z.DecExt(yyv998) { + } else if yym999 { + z.DecBinaryUnmarshal(yyv998) + } else if !yym999 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv998) } else { - z.DecFallback(yyv1011, false) + z.DecFallback(yyv998, false) } } - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -11972,26 +11882,26 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.LastTransitionTime = pkg1_unversioned.Time{} } else { - yyv1013 := &x.LastTransitionTime - yym1014 := z.DecBinary() - _ = yym1014 + yyv1000 := &x.LastTransitionTime + yym1001 := z.DecBinary() + _ = yym1001 if false { - } else if z.HasExtensions() && z.DecExt(yyv1013) { - } else if yym1014 { - z.DecBinaryUnmarshal(yyv1013) - } else if !yym1014 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1013) + } else if z.HasExtensions() && z.DecExt(yyv1000) { + } else if yym1001 { + z.DecBinaryUnmarshal(yyv1000) + } else if !yym1001 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1000) } else { - z.DecFallback(yyv1013, false) + z.DecFallback(yyv1000, false) } } - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12001,13 +11911,13 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Reason = string(r.DecodeString()) } - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12018,17 +11928,17 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Message = string(r.DecodeString()) } for { - yyj1008++ - if yyhl1008 { - yyb1008 = yyj1008 > l + yyj995++ + if yyhl995 { + yyb995 = yyj995 > l } else { - yyb1008 = r.CheckBreak() + yyb995 = r.CheckBreak() } - if yyb1008 { + if yyb995 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1008-1, "") + z.DecStructFieldNotFound(yyj995-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12040,136 +11950,136 @@ func (x *Ingress) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1017 := z.EncBinary() - _ = yym1017 + yym1004 := z.EncBinary() + _ = yym1004 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1018 := !z.EncBinary() - yy2arr1018 := z.EncBasicHandle().StructToArray - var yyq1018 [5]bool - _, _, _ = yysep1018, yyq1018, yy2arr1018 - const yyr1018 bool = false - yyq1018[0] = x.Kind != "" - yyq1018[1] = x.APIVersion != "" - yyq1018[2] = true - yyq1018[3] = true - yyq1018[4] = true - var yynn1018 int - if yyr1018 || yy2arr1018 { + yysep1005 := !z.EncBinary() + yy2arr1005 := z.EncBasicHandle().StructToArray + var yyq1005 [5]bool + _, _, _ = yysep1005, yyq1005, yy2arr1005 + const yyr1005 bool = false + yyq1005[0] = true + yyq1005[1] = true + yyq1005[2] = true + yyq1005[3] = x.Kind != "" + yyq1005[4] = x.APIVersion != "" + var yynn1005 int + if yyr1005 || yy2arr1005 { r.EncodeArrayStart(5) } else { - yynn1018 = 0 - for _, b := range yyq1018 { + yynn1005 = 0 + for _, b := range yyq1005 { if b { - yynn1018++ + yynn1005++ } } - r.EncodeMapStart(yynn1018) - yynn1018 = 0 + r.EncodeMapStart(yynn1005) + yynn1005 = 0 } - if yyr1018 || yy2arr1018 { + if yyr1005 || yy2arr1005 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1018[0] { + if yyq1005[0] { + yy1007 := &x.ObjectMeta + yy1007.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1005[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1008 := &x.ObjectMeta + yy1008.CodecEncodeSelf(e) + } + } + if yyr1005 || yy2arr1005 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1005[1] { + yy1010 := &x.Spec + yy1010.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1005[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1011 := &x.Spec + yy1011.CodecEncodeSelf(e) + } + } + if yyr1005 || yy2arr1005 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1005[2] { + yy1013 := &x.Status + yy1013.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1005[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1014 := &x.Status + yy1014.CodecEncodeSelf(e) + } + } + if yyr1005 || yy2arr1005 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1005[3] { + yym1016 := z.EncBinary() + _ = yym1016 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1005[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1017 := z.EncBinary() + _ = yym1017 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1005 || yy2arr1005 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1005[4] { + yym1019 := z.EncBinary() + _ = yym1019 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1005[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym1020 := z.EncBinary() _ = yym1020 if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1018[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1021 := z.EncBinary() - _ = yym1021 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1018 || yy2arr1018 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1018[1] { - yym1023 := z.EncBinary() - _ = yym1023 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1018[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1024 := z.EncBinary() - _ = yym1024 - if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr1018 || yy2arr1018 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1018[2] { - yy1026 := &x.ObjectMeta - yy1026.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1018[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1027 := &x.ObjectMeta - yy1027.CodecEncodeSelf(e) - } - } - if yyr1018 || yy2arr1018 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1018[3] { - yy1029 := &x.Spec - yy1029.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1018[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1030 := &x.Spec - yy1030.CodecEncodeSelf(e) - } - } - if yyr1018 || yy2arr1018 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1018[4] { - yy1032 := &x.Status - yy1032.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1018[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1033 := &x.Status - yy1033.CodecEncodeSelf(e) - } - } - if yyr1018 || yy2arr1018 { + if yyr1005 || yy2arr1005 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12182,25 +12092,25 @@ func (x *Ingress) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1034 := z.DecBinary() - _ = yym1034 + yym1021 := z.DecBinary() + _ = yym1021 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1035 := r.ContainerType() - if yyct1035 == codecSelferValueTypeMap1234 { - yyl1035 := r.ReadMapStart() - if yyl1035 == 0 { + yyct1022 := r.ContainerType() + if yyct1022 == codecSelferValueTypeMap1234 { + yyl1022 := r.ReadMapStart() + if yyl1022 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1035, d) + x.codecDecodeSelfFromMap(yyl1022, d) } - } else if yyct1035 == codecSelferValueTypeArray1234 { - yyl1035 := r.ReadArrayStart() - if yyl1035 == 0 { + } else if yyct1022 == codecSelferValueTypeArray1234 { + yyl1022 := r.ReadArrayStart() + if yyl1022 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1035, d) + x.codecDecodeSelfFromArray(yyl1022, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12212,12 +12122,12 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1036Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1036Slc - var yyhl1036 bool = l >= 0 - for yyj1036 := 0; ; yyj1036++ { - if yyhl1036 { - if yyj1036 >= l { + var yys1023Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1023Slc + var yyhl1023 bool = l >= 0 + for yyj1023 := 0; ; yyj1023++ { + if yyhl1023 { + if yyj1023 >= l { break } } else { @@ -12226,10 +12136,31 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1036Slc = r.DecodeBytes(yys1036Slc, true, true) - yys1036 := string(yys1036Slc) + yys1023Slc = r.DecodeBytes(yys1023Slc, true, true) + yys1023 := string(yys1023Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1036 { + switch yys1023 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1024 := &x.ObjectMeta + yyv1024.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = IngressSpec{} + } else { + yyv1025 := &x.Spec + yyv1025.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = IngressStatus{} + } else { + yyv1026 := &x.Status + yyv1026.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -12242,31 +12173,10 @@ func (x *Ingress) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1039 := &x.ObjectMeta - yyv1039.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = IngressSpec{} - } else { - yyv1040 := &x.Spec - yyv1040.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = IngressStatus{} - } else { - yyv1041 := &x.Status - yyv1041.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1036) - } // end switch yys1036 - } // end for yyj1036 + z.DecStructFieldNotFound(-1, yys1023) + } // end switch yys1023 + } // end for yyj1023 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12274,16 +12184,67 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1042 int - var yyb1042 bool - var yyhl1042 bool = l >= 0 - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l + var yyj1029 int + var yyb1029 bool + var yyhl1029 bool = l >= 0 + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l } else { - yyb1042 = r.CheckBreak() + yyb1029 = r.CheckBreak() } - if yyb1042 { + if yyb1029 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1030 := &x.ObjectMeta + yyv1030.CodecDecodeSelf(d) + } + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l + } else { + yyb1029 = r.CheckBreak() + } + if yyb1029 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = IngressSpec{} + } else { + yyv1031 := &x.Spec + yyv1031.CodecDecodeSelf(d) + } + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l + } else { + yyb1029 = r.CheckBreak() + } + if yyb1029 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = IngressStatus{} + } else { + yyv1032 := &x.Status + yyv1032.CodecDecodeSelf(d) + } + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l + } else { + yyb1029 = r.CheckBreak() + } + if yyb1029 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12293,13 +12254,13 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l } else { - yyb1042 = r.CheckBreak() + yyb1029 = r.CheckBreak() } - if yyb1042 { + if yyb1029 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12309,69 +12270,18 @@ func (x *Ingress) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l - } else { - yyb1042 = r.CheckBreak() - } - if yyb1042 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1045 := &x.ObjectMeta - yyv1045.CodecDecodeSelf(d) - } - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l - } else { - yyb1042 = r.CheckBreak() - } - if yyb1042 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = IngressSpec{} - } else { - yyv1046 := &x.Spec - yyv1046.CodecDecodeSelf(d) - } - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l - } else { - yyb1042 = r.CheckBreak() - } - if yyb1042 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = IngressStatus{} - } else { - yyv1047 := &x.Status - yyv1047.CodecDecodeSelf(d) - } for { - yyj1042++ - if yyhl1042 { - yyb1042 = yyj1042 > l + yyj1029++ + if yyhl1029 { + yyb1029 = yyj1029 > l } else { - yyb1042 = r.CheckBreak() + yyb1029 = r.CheckBreak() } - if yyb1042 { + if yyb1029 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1042-1, "") + z.DecStructFieldNotFound(yyj1029-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12383,118 +12293,68 @@ func (x *IngressList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1048 := z.EncBinary() - _ = yym1048 + yym1035 := z.EncBinary() + _ = yym1035 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1049 := !z.EncBinary() - yy2arr1049 := z.EncBasicHandle().StructToArray - var yyq1049 [4]bool - _, _, _ = yysep1049, yyq1049, yy2arr1049 - const yyr1049 bool = false - yyq1049[0] = x.Kind != "" - yyq1049[1] = x.APIVersion != "" - yyq1049[2] = true - var yynn1049 int - if yyr1049 || yy2arr1049 { + yysep1036 := !z.EncBinary() + yy2arr1036 := z.EncBasicHandle().StructToArray + var yyq1036 [4]bool + _, _, _ = yysep1036, yyq1036, yy2arr1036 + const yyr1036 bool = false + yyq1036[0] = true + yyq1036[2] = x.Kind != "" + yyq1036[3] = x.APIVersion != "" + var yynn1036 int + if yyr1036 || yy2arr1036 { r.EncodeArrayStart(4) } else { - yynn1049 = 1 - for _, b := range yyq1049 { + yynn1036 = 1 + for _, b := range yyq1036 { if b { - yynn1049++ + yynn1036++ } } - r.EncodeMapStart(yynn1049) - yynn1049 = 0 + r.EncodeMapStart(yynn1036) + yynn1036 = 0 } - if yyr1049 || yy2arr1049 { + if yyr1036 || yy2arr1036 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1049[0] { - yym1051 := z.EncBinary() - _ = yym1051 + if yyq1036[0] { + yy1038 := &x.ListMeta + yym1039 := z.EncBinary() + _ = yym1039 if false { + } else if z.HasExtensions() && z.EncExt(yy1038) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1049[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1052 := z.EncBinary() - _ = yym1052 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1049 || yy2arr1049 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1049[1] { - yym1054 := z.EncBinary() - _ = yym1054 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1049[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1055 := z.EncBinary() - _ = yym1055 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1049 || yy2arr1049 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1049[2] { - yy1057 := &x.ListMeta - yym1058 := z.EncBinary() - _ = yym1058 - if false { - } else if z.HasExtensions() && z.EncExt(yy1057) { - } else { - z.EncFallback(yy1057) + z.EncFallback(yy1038) } } else { r.EncodeNil() } } else { - if yyq1049[2] { + if yyq1036[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1059 := &x.ListMeta - yym1060 := z.EncBinary() - _ = yym1060 + yy1040 := &x.ListMeta + yym1041 := z.EncBinary() + _ = yym1041 if false { - } else if z.HasExtensions() && z.EncExt(yy1059) { + } else if z.HasExtensions() && z.EncExt(yy1040) { } else { - z.EncFallback(yy1059) + z.EncFallback(yy1040) } } } - if yyr1049 || yy2arr1049 { + if yyr1036 || yy2arr1036 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1062 := z.EncBinary() - _ = yym1062 + yym1043 := z.EncBinary() + _ = yym1043 if false { } else { h.encSliceIngress(([]Ingress)(x.Items), e) @@ -12507,15 +12367,65 @@ func (x *IngressList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1063 := z.EncBinary() - _ = yym1063 + yym1044 := z.EncBinary() + _ = yym1044 if false { } else { h.encSliceIngress(([]Ingress)(x.Items), e) } } } - if yyr1049 || yy2arr1049 { + if yyr1036 || yy2arr1036 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1036[2] { + yym1046 := z.EncBinary() + _ = yym1046 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1036[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1047 := z.EncBinary() + _ = yym1047 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1036 || yy2arr1036 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1036[3] { + yym1049 := z.EncBinary() + _ = yym1049 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1036[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1050 := z.EncBinary() + _ = yym1050 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1036 || yy2arr1036 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12528,25 +12438,25 @@ func (x *IngressList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1064 := z.DecBinary() - _ = yym1064 + yym1051 := z.DecBinary() + _ = yym1051 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1065 := r.ContainerType() - if yyct1065 == codecSelferValueTypeMap1234 { - yyl1065 := r.ReadMapStart() - if yyl1065 == 0 { + yyct1052 := r.ContainerType() + if yyct1052 == codecSelferValueTypeMap1234 { + yyl1052 := r.ReadMapStart() + if yyl1052 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1065, d) + x.codecDecodeSelfFromMap(yyl1052, d) } - } else if yyct1065 == codecSelferValueTypeArray1234 { - yyl1065 := r.ReadArrayStart() - if yyl1065 == 0 { + } else if yyct1052 == codecSelferValueTypeArray1234 { + yyl1052 := r.ReadArrayStart() + if yyl1052 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1065, d) + x.codecDecodeSelfFromArray(yyl1052, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12558,12 +12468,12 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1066Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1066Slc - var yyhl1066 bool = l >= 0 - for yyj1066 := 0; ; yyj1066++ { - if yyhl1066 { - if yyj1066 >= l { + var yys1053Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1053Slc + var yyhl1053 bool = l >= 0 + for yyj1053 := 0; ; yyj1053++ { + if yyhl1053 { + if yyj1053 >= l { break } } else { @@ -12572,10 +12482,35 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1066Slc = r.DecodeBytes(yys1066Slc, true, true) - yys1066 := string(yys1066Slc) + yys1053Slc = r.DecodeBytes(yys1053Slc, true, true) + yys1053 := string(yys1053Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1066 { + switch yys1053 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1054 := &x.ListMeta + yym1055 := z.DecBinary() + _ = yym1055 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1054) { + } else { + z.DecFallback(yyv1054, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1056 := &x.Items + yym1057 := z.DecBinary() + _ = yym1057 + if false { + } else { + h.decSliceIngress((*[]Ingress)(yyv1056), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -12588,35 +12523,10 @@ func (x *IngressList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1069 := &x.ListMeta - yym1070 := z.DecBinary() - _ = yym1070 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1069) { - } else { - z.DecFallback(yyv1069, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1071 := &x.Items - yym1072 := z.DecBinary() - _ = yym1072 - if false { - } else { - h.decSliceIngress((*[]Ingress)(yyv1071), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1066) - } // end switch yys1066 - } // end for yyj1066 + z.DecStructFieldNotFound(-1, yys1053) + } // end switch yys1053 + } // end for yyj1053 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12624,16 +12534,61 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1073 int - var yyb1073 bool - var yyhl1073 bool = l >= 0 - yyj1073++ - if yyhl1073 { - yyb1073 = yyj1073 > l + var yyj1060 int + var yyb1060 bool + var yyhl1060 bool = l >= 0 + yyj1060++ + if yyhl1060 { + yyb1060 = yyj1060 > l } else { - yyb1073 = r.CheckBreak() + yyb1060 = r.CheckBreak() } - if yyb1073 { + if yyb1060 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1061 := &x.ListMeta + yym1062 := z.DecBinary() + _ = yym1062 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1061) { + } else { + z.DecFallback(yyv1061, false) + } + } + yyj1060++ + if yyhl1060 { + yyb1060 = yyj1060 > l + } else { + yyb1060 = r.CheckBreak() + } + if yyb1060 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1063 := &x.Items + yym1064 := z.DecBinary() + _ = yym1064 + if false { + } else { + h.decSliceIngress((*[]Ingress)(yyv1063), d) + } + } + yyj1060++ + if yyhl1060 { + yyb1060 = yyj1060 > l + } else { + yyb1060 = r.CheckBreak() + } + if yyb1060 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12643,13 +12598,13 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1073++ - if yyhl1073 { - yyb1073 = yyj1073 > l + yyj1060++ + if yyhl1060 { + yyb1060 = yyj1060 > l } else { - yyb1073 = r.CheckBreak() + yyb1060 = r.CheckBreak() } - if yyb1073 { + if yyb1060 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12659,63 +12614,18 @@ func (x *IngressList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1073++ - if yyhl1073 { - yyb1073 = yyj1073 > l - } else { - yyb1073 = r.CheckBreak() - } - if yyb1073 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1076 := &x.ListMeta - yym1077 := z.DecBinary() - _ = yym1077 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1076) { - } else { - z.DecFallback(yyv1076, false) - } - } - yyj1073++ - if yyhl1073 { - yyb1073 = yyj1073 > l - } else { - yyb1073 = r.CheckBreak() - } - if yyb1073 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1078 := &x.Items - yym1079 := z.DecBinary() - _ = yym1079 - if false { - } else { - h.decSliceIngress((*[]Ingress)(yyv1078), d) - } - } for { - yyj1073++ - if yyhl1073 { - yyb1073 = yyj1073 > l + yyj1060++ + if yyhl1060 { + yyb1060 = yyj1060 > l } else { - yyb1073 = r.CheckBreak() + yyb1060 = r.CheckBreak() } - if yyb1073 { + if yyb1060 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1073-1, "") + z.DecStructFieldNotFound(yyj1060-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12727,34 +12637,35 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1080 := z.EncBinary() - _ = yym1080 + yym1067 := z.EncBinary() + _ = yym1067 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1081 := !z.EncBinary() - yy2arr1081 := z.EncBasicHandle().StructToArray - var yyq1081 [2]bool - _, _, _ = yysep1081, yyq1081, yy2arr1081 - const yyr1081 bool = false - yyq1081[0] = x.Backend != nil - yyq1081[1] = len(x.Rules) != 0 - var yynn1081 int - if yyr1081 || yy2arr1081 { - r.EncodeArrayStart(2) + yysep1068 := !z.EncBinary() + yy2arr1068 := z.EncBasicHandle().StructToArray + var yyq1068 [3]bool + _, _, _ = yysep1068, yyq1068, yy2arr1068 + const yyr1068 bool = false + yyq1068[0] = x.Backend != nil + yyq1068[1] = len(x.TLS) != 0 + yyq1068[2] = len(x.Rules) != 0 + var yynn1068 int + if yyr1068 || yy2arr1068 { + r.EncodeArrayStart(3) } else { - yynn1081 = 0 - for _, b := range yyq1081 { + yynn1068 = 0 + for _, b := range yyq1068 { if b { - yynn1081++ + yynn1068++ } } - r.EncodeMapStart(yynn1081) - yynn1081 = 0 + r.EncodeMapStart(yynn1068) + yynn1068 = 0 } - if yyr1081 || yy2arr1081 { + if yyr1068 || yy2arr1068 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1081[0] { + if yyq1068[0] { if x.Backend == nil { r.EncodeNil() } else { @@ -12764,7 +12675,7 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1081[0] { + if yyq1068[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("backend")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -12775,14 +12686,47 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1081 || yy2arr1081 { + if yyr1068 || yy2arr1068 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1081[1] { + if yyq1068[1] { + if x.TLS == nil { + r.EncodeNil() + } else { + yym1071 := z.EncBinary() + _ = yym1071 + if false { + } else { + h.encSliceIngressTLS(([]IngressTLS)(x.TLS), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1068[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("tls")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TLS == nil { + r.EncodeNil() + } else { + yym1072 := z.EncBinary() + _ = yym1072 + if false { + } else { + h.encSliceIngressTLS(([]IngressTLS)(x.TLS), e) + } + } + } + } + if yyr1068 || yy2arr1068 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1068[2] { if x.Rules == nil { r.EncodeNil() } else { - yym1084 := z.EncBinary() - _ = yym1084 + yym1074 := z.EncBinary() + _ = yym1074 if false { } else { h.encSliceIngressRule(([]IngressRule)(x.Rules), e) @@ -12792,15 +12736,15 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1081[1] { + if yyq1068[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("rules")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Rules == nil { r.EncodeNil() } else { - yym1085 := z.EncBinary() - _ = yym1085 + yym1075 := z.EncBinary() + _ = yym1075 if false { } else { h.encSliceIngressRule(([]IngressRule)(x.Rules), e) @@ -12808,7 +12752,7 @@ func (x *IngressSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1081 || yy2arr1081 { + if yyr1068 || yy2arr1068 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -12821,25 +12765,25 @@ func (x *IngressSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1086 := z.DecBinary() - _ = yym1086 + yym1076 := z.DecBinary() + _ = yym1076 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1087 := r.ContainerType() - if yyct1087 == codecSelferValueTypeMap1234 { - yyl1087 := r.ReadMapStart() - if yyl1087 == 0 { + yyct1077 := r.ContainerType() + if yyct1077 == codecSelferValueTypeMap1234 { + yyl1077 := r.ReadMapStart() + if yyl1077 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1087, d) + x.codecDecodeSelfFromMap(yyl1077, d) } - } else if yyct1087 == codecSelferValueTypeArray1234 { - yyl1087 := r.ReadArrayStart() - if yyl1087 == 0 { + } else if yyct1077 == codecSelferValueTypeArray1234 { + yyl1077 := r.ReadArrayStart() + if yyl1077 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1087, d) + x.codecDecodeSelfFromArray(yyl1077, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -12851,12 +12795,12 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1088Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1088Slc - var yyhl1088 bool = l >= 0 - for yyj1088 := 0; ; yyj1088++ { - if yyhl1088 { - if yyj1088 >= l { + var yys1078Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1078Slc + var yyhl1078 bool = l >= 0 + for yyj1078 := 0; ; yyj1078++ { + if yyhl1078 { + if yyj1078 >= l { break } } else { @@ -12865,10 +12809,10 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1088Slc = r.DecodeBytes(yys1088Slc, true, true) - yys1088 := string(yys1088Slc) + yys1078Slc = r.DecodeBytes(yys1078Slc, true, true) + yys1078 := string(yys1078Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1088 { + switch yys1078 { case "backend": if r.TryDecodeAsNil() { if x.Backend != nil { @@ -12880,22 +12824,34 @@ func (x *IngressSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } x.Backend.CodecDecodeSelf(d) } + case "tls": + if r.TryDecodeAsNil() { + x.TLS = nil + } else { + yyv1080 := &x.TLS + yym1081 := z.DecBinary() + _ = yym1081 + if false { + } else { + h.decSliceIngressTLS((*[]IngressTLS)(yyv1080), d) + } + } case "rules": if r.TryDecodeAsNil() { x.Rules = nil } else { - yyv1090 := &x.Rules - yym1091 := z.DecBinary() - _ = yym1091 + yyv1082 := &x.Rules + yym1083 := z.DecBinary() + _ = yym1083 if false { } else { - h.decSliceIngressRule((*[]IngressRule)(yyv1090), d) + h.decSliceIngressRule((*[]IngressRule)(yyv1082), d) } } default: - z.DecStructFieldNotFound(-1, yys1088) - } // end switch yys1088 - } // end for yyj1088 + z.DecStructFieldNotFound(-1, yys1078) + } // end switch yys1078 + } // end for yyj1078 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -12903,16 +12859,16 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1092 int - var yyb1092 bool - var yyhl1092 bool = l >= 0 - yyj1092++ - if yyhl1092 { - yyb1092 = yyj1092 > l + var yyj1084 int + var yyb1084 bool + var yyhl1084 bool = l >= 0 + yyj1084++ + if yyhl1084 { + yyb1084 = yyj1084 > l } else { - yyb1092 = r.CheckBreak() + yyb1084 = r.CheckBreak() } - if yyb1092 { + if yyb1084 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12927,13 +12883,35 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Backend.CodecDecodeSelf(d) } - yyj1092++ - if yyhl1092 { - yyb1092 = yyj1092 > l + yyj1084++ + if yyhl1084 { + yyb1084 = yyj1084 > l } else { - yyb1092 = r.CheckBreak() + yyb1084 = r.CheckBreak() } - if yyb1092 { + if yyb1084 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.TLS = nil + } else { + yyv1086 := &x.TLS + yym1087 := z.DecBinary() + _ = yym1087 + if false { + } else { + h.decSliceIngressTLS((*[]IngressTLS)(yyv1086), d) + } + } + yyj1084++ + if yyhl1084 { + yyb1084 = yyj1084 > l + } else { + yyb1084 = r.CheckBreak() + } + if yyb1084 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -12941,26 +12919,263 @@ func (x *IngressSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Rules = nil } else { - yyv1094 := &x.Rules - yym1095 := z.DecBinary() - _ = yym1095 + yyv1088 := &x.Rules + yym1089 := z.DecBinary() + _ = yym1089 if false { } else { - h.decSliceIngressRule((*[]IngressRule)(yyv1094), d) + h.decSliceIngressRule((*[]IngressRule)(yyv1088), d) } } for { - yyj1092++ - if yyhl1092 { - yyb1092 = yyj1092 > l + yyj1084++ + if yyhl1084 { + yyb1084 = yyj1084 > l } else { - yyb1092 = r.CheckBreak() + yyb1084 = r.CheckBreak() } - if yyb1092 { + if yyb1084 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1092-1, "") + z.DecStructFieldNotFound(yyj1084-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *IngressTLS) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1090 := z.EncBinary() + _ = yym1090 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1091 := !z.EncBinary() + yy2arr1091 := z.EncBasicHandle().StructToArray + var yyq1091 [2]bool + _, _, _ = yysep1091, yyq1091, yy2arr1091 + const yyr1091 bool = false + yyq1091[0] = len(x.Hosts) != 0 + yyq1091[1] = x.SecretName != "" + var yynn1091 int + if yyr1091 || yy2arr1091 { + r.EncodeArrayStart(2) + } else { + yynn1091 = 0 + for _, b := range yyq1091 { + if b { + yynn1091++ + } + } + r.EncodeMapStart(yynn1091) + yynn1091 = 0 + } + if yyr1091 || yy2arr1091 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1091[0] { + if x.Hosts == nil { + r.EncodeNil() + } else { + yym1093 := z.EncBinary() + _ = yym1093 + if false { + } else { + z.F.EncSliceStringV(x.Hosts, false, e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1091[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hosts")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Hosts == nil { + r.EncodeNil() + } else { + yym1094 := z.EncBinary() + _ = yym1094 + if false { + } else { + z.F.EncSliceStringV(x.Hosts, false, e) + } + } + } + } + if yyr1091 || yy2arr1091 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1091[1] { + yym1096 := z.EncBinary() + _ = yym1096 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1091[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("secretName")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1097 := z.EncBinary() + _ = yym1097 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.SecretName)) + } + } + } + if yyr1091 || yy2arr1091 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *IngressTLS) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1098 := z.DecBinary() + _ = yym1098 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1099 := r.ContainerType() + if yyct1099 == codecSelferValueTypeMap1234 { + yyl1099 := r.ReadMapStart() + if yyl1099 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1099, d) + } + } else if yyct1099 == codecSelferValueTypeArray1234 { + yyl1099 := r.ReadArrayStart() + if yyl1099 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1099, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *IngressTLS) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1100Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1100Slc + var yyhl1100 bool = l >= 0 + for yyj1100 := 0; ; yyj1100++ { + if yyhl1100 { + if yyj1100 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1100Slc = r.DecodeBytes(yys1100Slc, true, true) + yys1100 := string(yys1100Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1100 { + case "hosts": + if r.TryDecodeAsNil() { + x.Hosts = nil + } else { + yyv1101 := &x.Hosts + yym1102 := z.DecBinary() + _ = yym1102 + if false { + } else { + z.F.DecSliceStringX(yyv1101, false, d) + } + } + case "secretName": + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + default: + z.DecStructFieldNotFound(-1, yys1100) + } // end switch yys1100 + } // end for yyj1100 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *IngressTLS) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1104 int + var yyb1104 bool + var yyhl1104 bool = l >= 0 + yyj1104++ + if yyhl1104 { + yyb1104 = yyj1104 > l + } else { + yyb1104 = r.CheckBreak() + } + if yyb1104 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Hosts = nil + } else { + yyv1105 := &x.Hosts + yym1106 := z.DecBinary() + _ = yym1106 + if false { + } else { + z.F.DecSliceStringX(yyv1105, false, d) + } + } + yyj1104++ + if yyhl1104 { + yyb1104 = yyj1104 > l + } else { + yyb1104 = r.CheckBreak() + } + if yyb1104 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SecretName = "" + } else { + x.SecretName = string(r.DecodeString()) + } + for { + yyj1104++ + if yyhl1104 { + yyb1104 = yyj1104 > l + } else { + yyb1104 = r.CheckBreak() + } + if yyb1104 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1104-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -12972,48 +13187,48 @@ func (x *IngressStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1096 := z.EncBinary() - _ = yym1096 + yym1108 := z.EncBinary() + _ = yym1108 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1097 := !z.EncBinary() - yy2arr1097 := z.EncBasicHandle().StructToArray - var yyq1097 [1]bool - _, _, _ = yysep1097, yyq1097, yy2arr1097 - const yyr1097 bool = false - yyq1097[0] = true - var yynn1097 int - if yyr1097 || yy2arr1097 { + yysep1109 := !z.EncBinary() + yy2arr1109 := z.EncBasicHandle().StructToArray + var yyq1109 [1]bool + _, _, _ = yysep1109, yyq1109, yy2arr1109 + const yyr1109 bool = false + yyq1109[0] = true + var yynn1109 int + if yyr1109 || yy2arr1109 { r.EncodeArrayStart(1) } else { - yynn1097 = 0 - for _, b := range yyq1097 { + yynn1109 = 0 + for _, b := range yyq1109 { if b { - yynn1097++ + yynn1109++ } } - r.EncodeMapStart(yynn1097) - yynn1097 = 0 + r.EncodeMapStart(yynn1109) + yynn1109 = 0 } - if yyr1097 || yy2arr1097 { + if yyr1109 || yy2arr1109 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1097[0] { - yy1099 := &x.LoadBalancer - yy1099.CodecEncodeSelf(e) + if yyq1109[0] { + yy1111 := &x.LoadBalancer + yy1111.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1097[0] { + if yyq1109[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("loadBalancer")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1100 := &x.LoadBalancer - yy1100.CodecEncodeSelf(e) + yy1112 := &x.LoadBalancer + yy1112.CodecEncodeSelf(e) } } - if yyr1097 || yy2arr1097 { + if yyr1109 || yy2arr1109 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13023,215 +13238,6 @@ func (x *IngressStatus) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *IngressStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1101 := z.DecBinary() - _ = yym1101 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1102 := r.ContainerType() - if yyct1102 == codecSelferValueTypeMap1234 { - yyl1102 := r.ReadMapStart() - if yyl1102 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1102, d) - } - } else if yyct1102 == codecSelferValueTypeArray1234 { - yyl1102 := r.ReadArrayStart() - if yyl1102 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1102, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *IngressStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1103Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1103Slc - var yyhl1103 bool = l >= 0 - for yyj1103 := 0; ; yyj1103++ { - if yyhl1103 { - if yyj1103 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1103Slc = r.DecodeBytes(yys1103Slc, true, true) - yys1103 := string(yys1103Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1103 { - case "loadBalancer": - if r.TryDecodeAsNil() { - x.LoadBalancer = pkg2_v1.LoadBalancerStatus{} - } else { - yyv1104 := &x.LoadBalancer - yyv1104.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys1103) - } // end switch yys1103 - } // end for yyj1103 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *IngressStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1105 int - var yyb1105 bool - var yyhl1105 bool = l >= 0 - yyj1105++ - if yyhl1105 { - yyb1105 = yyj1105 > l - } else { - yyb1105 = r.CheckBreak() - } - if yyb1105 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LoadBalancer = pkg2_v1.LoadBalancerStatus{} - } else { - yyv1106 := &x.LoadBalancer - yyv1106.CodecDecodeSelf(d) - } - for { - yyj1105++ - if yyhl1105 { - yyb1105 = yyj1105 > l - } else { - yyb1105 = r.CheckBreak() - } - if yyb1105 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1105-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1107 := z.EncBinary() - _ = yym1107 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1108 := !z.EncBinary() - yy2arr1108 := z.EncBasicHandle().StructToArray - var yyq1108 [2]bool - _, _, _ = yysep1108, yyq1108, yy2arr1108 - const yyr1108 bool = false - yyq1108[0] = x.Host != "" - yyq1108[1] = x.IngressRuleValue.HTTP != nil && x.HTTP != nil - var yynn1108 int - if yyr1108 || yy2arr1108 { - r.EncodeArrayStart(2) - } else { - yynn1108 = 0 - for _, b := range yyq1108 { - if b { - yynn1108++ - } - } - r.EncodeMapStart(yynn1108) - yynn1108 = 0 - } - if yyr1108 || yy2arr1108 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1108[0] { - yym1110 := z.EncBinary() - _ = yym1110 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Host)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1108[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("host")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1111 := z.EncBinary() - _ = yym1111 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Host)) - } - } - } - var yyn1112 bool - if x.IngressRuleValue.HTTP == nil { - yyn1112 = true - goto LABEL1112 - } - LABEL1112: - if yyr1108 || yy2arr1108 { - if yyn1112 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1108[1] { - if x.HTTP == nil { - r.EncodeNil() - } else { - x.HTTP.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } - } else { - if yyq1108[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("http")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn1112 { - r.EncodeNil() - } else { - if x.HTTP == nil { - r.EncodeNil() - } else { - x.HTTP.CodecEncodeSelf(e) - } - } - } - } - if yyr1108 || yy2arr1108 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *IngressRule) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -13261,7 +13267,7 @@ func (x *IngressRule) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *IngressStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -13283,6 +13289,215 @@ func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys1115 := string(yys1115Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys1115 { + case "loadBalancer": + if r.TryDecodeAsNil() { + x.LoadBalancer = pkg2_v1.LoadBalancerStatus{} + } else { + yyv1116 := &x.LoadBalancer + yyv1116.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1115) + } // end switch yys1115 + } // end for yyj1115 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *IngressStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1117 int + var yyb1117 bool + var yyhl1117 bool = l >= 0 + yyj1117++ + if yyhl1117 { + yyb1117 = yyj1117 > l + } else { + yyb1117 = r.CheckBreak() + } + if yyb1117 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.LoadBalancer = pkg2_v1.LoadBalancerStatus{} + } else { + yyv1118 := &x.LoadBalancer + yyv1118.CodecDecodeSelf(d) + } + for { + yyj1117++ + if yyhl1117 { + yyb1117 = yyj1117 > l + } else { + yyb1117 = r.CheckBreak() + } + if yyb1117 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1117-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *IngressRule) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1119 := z.EncBinary() + _ = yym1119 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1120 := !z.EncBinary() + yy2arr1120 := z.EncBasicHandle().StructToArray + var yyq1120 [2]bool + _, _, _ = yysep1120, yyq1120, yy2arr1120 + const yyr1120 bool = false + yyq1120[0] = x.Host != "" + yyq1120[1] = x.IngressRuleValue.HTTP != nil && x.HTTP != nil + var yynn1120 int + if yyr1120 || yy2arr1120 { + r.EncodeArrayStart(2) + } else { + yynn1120 = 0 + for _, b := range yyq1120 { + if b { + yynn1120++ + } + } + r.EncodeMapStart(yynn1120) + yynn1120 = 0 + } + if yyr1120 || yy2arr1120 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1120[0] { + yym1122 := z.EncBinary() + _ = yym1122 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Host)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1120[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("host")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1123 := z.EncBinary() + _ = yym1123 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Host)) + } + } + } + var yyn1124 bool + if x.IngressRuleValue.HTTP == nil { + yyn1124 = true + goto LABEL1124 + } + LABEL1124: + if yyr1120 || yy2arr1120 { + if yyn1124 { + r.EncodeNil() + } else { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1120[1] { + if x.HTTP == nil { + r.EncodeNil() + } else { + x.HTTP.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } + } else { + if yyq1120[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("http")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if yyn1124 { + r.EncodeNil() + } else { + if x.HTTP == nil { + r.EncodeNil() + } else { + x.HTTP.CodecEncodeSelf(e) + } + } + } + } + if yyr1120 || yy2arr1120 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *IngressRule) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1125 := z.DecBinary() + _ = yym1125 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1126 := r.ContainerType() + if yyct1126 == codecSelferValueTypeMap1234 { + yyl1126 := r.ReadMapStart() + if yyl1126 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1126, d) + } + } else if yyct1126 == codecSelferValueTypeArray1234 { + yyl1126 := r.ReadArrayStart() + if yyl1126 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1126, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1127Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1127Slc + var yyhl1127 bool = l >= 0 + for yyj1127 := 0; ; yyj1127++ { + if yyhl1127 { + if yyj1127 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1127Slc = r.DecodeBytes(yys1127Slc, true, true) + yys1127 := string(yys1127Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1127 { case "host": if r.TryDecodeAsNil() { x.Host = "" @@ -13304,9 +13519,9 @@ func (x *IngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1115) - } // end switch yys1115 - } // end for yyj1115 + z.DecStructFieldNotFound(-1, yys1127) + } // end switch yys1127 + } // end for yyj1127 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13314,16 +13529,16 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1118 int - var yyb1118 bool - var yyhl1118 bool = l >= 0 - yyj1118++ - if yyhl1118 { - yyb1118 = yyj1118 > l + var yyj1130 int + var yyb1130 bool + var yyhl1130 bool = l >= 0 + yyj1130++ + if yyhl1130 { + yyb1130 = yyj1130 > l } else { - yyb1118 = r.CheckBreak() + yyb1130 = r.CheckBreak() } - if yyb1118 { + if yyb1130 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13336,13 +13551,13 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.IngressRuleValue.HTTP == nil { x.IngressRuleValue.HTTP = new(HTTPIngressRuleValue) } - yyj1118++ - if yyhl1118 { - yyb1118 = yyj1118 > l + yyj1130++ + if yyhl1130 { + yyb1130 = yyj1130 > l } else { - yyb1118 = r.CheckBreak() + yyb1130 = r.CheckBreak() } - if yyb1118 { + if yyb1130 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13358,17 +13573,17 @@ func (x *IngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } for { - yyj1118++ - if yyhl1118 { - yyb1118 = yyj1118 > l + yyj1130++ + if yyhl1130 { + yyb1130 = yyj1130 > l } else { - yyb1118 = r.CheckBreak() + yyb1130 = r.CheckBreak() } - if yyb1118 { + if yyb1130 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1118-1, "") + z.DecStructFieldNotFound(yyj1130-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13380,33 +13595,33 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1121 := z.EncBinary() - _ = yym1121 + yym1133 := z.EncBinary() + _ = yym1133 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1122 := !z.EncBinary() - yy2arr1122 := z.EncBasicHandle().StructToArray - var yyq1122 [1]bool - _, _, _ = yysep1122, yyq1122, yy2arr1122 - const yyr1122 bool = false - yyq1122[0] = x.HTTP != nil - var yynn1122 int - if yyr1122 || yy2arr1122 { + yysep1134 := !z.EncBinary() + yy2arr1134 := z.EncBasicHandle().StructToArray + var yyq1134 [1]bool + _, _, _ = yysep1134, yyq1134, yy2arr1134 + const yyr1134 bool = false + yyq1134[0] = x.HTTP != nil + var yynn1134 int + if yyr1134 || yy2arr1134 { r.EncodeArrayStart(1) } else { - yynn1122 = 0 - for _, b := range yyq1122 { + yynn1134 = 0 + for _, b := range yyq1134 { if b { - yynn1122++ + yynn1134++ } } - r.EncodeMapStart(yynn1122) - yynn1122 = 0 + r.EncodeMapStart(yynn1134) + yynn1134 = 0 } - if yyr1122 || yy2arr1122 { + if yyr1134 || yy2arr1134 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1122[0] { + if yyq1134[0] { if x.HTTP == nil { r.EncodeNil() } else { @@ -13416,7 +13631,7 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1122[0] { + if yyq1134[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("http")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -13427,7 +13642,7 @@ func (x *IngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1122 || yy2arr1122 { + if yyr1134 || yy2arr1134 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13440,25 +13655,25 @@ func (x *IngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1124 := z.DecBinary() - _ = yym1124 + yym1136 := z.DecBinary() + _ = yym1136 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1125 := r.ContainerType() - if yyct1125 == codecSelferValueTypeMap1234 { - yyl1125 := r.ReadMapStart() - if yyl1125 == 0 { + yyct1137 := r.ContainerType() + if yyct1137 == codecSelferValueTypeMap1234 { + yyl1137 := r.ReadMapStart() + if yyl1137 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1125, d) + x.codecDecodeSelfFromMap(yyl1137, d) } - } else if yyct1125 == codecSelferValueTypeArray1234 { - yyl1125 := r.ReadArrayStart() - if yyl1125 == 0 { + } else if yyct1137 == codecSelferValueTypeArray1234 { + yyl1137 := r.ReadArrayStart() + if yyl1137 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1125, d) + x.codecDecodeSelfFromArray(yyl1137, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13470,12 +13685,12 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1126Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1126Slc - var yyhl1126 bool = l >= 0 - for yyj1126 := 0; ; yyj1126++ { - if yyhl1126 { - if yyj1126 >= l { + var yys1138Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1138Slc + var yyhl1138 bool = l >= 0 + for yyj1138 := 0; ; yyj1138++ { + if yyhl1138 { + if yyj1138 >= l { break } } else { @@ -13484,10 +13699,10 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1126Slc = r.DecodeBytes(yys1126Slc, true, true) - yys1126 := string(yys1126Slc) + yys1138Slc = r.DecodeBytes(yys1138Slc, true, true) + yys1138 := string(yys1138Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1126 { + switch yys1138 { case "http": if r.TryDecodeAsNil() { if x.HTTP != nil { @@ -13500,194 +13715,13 @@ func (x *IngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.HTTP.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1126) - } // end switch yys1126 - } // end for yyj1126 + z.DecStructFieldNotFound(-1, yys1138) + } // end switch yys1138 + } // end for yyj1138 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } func (x *IngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1128 int - var yyb1128 bool - var yyhl1128 bool = l >= 0 - yyj1128++ - if yyhl1128 { - yyb1128 = yyj1128 > l - } else { - yyb1128 = r.CheckBreak() - } - if yyb1128 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.HTTP != nil { - x.HTTP = nil - } - } else { - if x.HTTP == nil { - x.HTTP = new(HTTPIngressRuleValue) - } - x.HTTP.CodecDecodeSelf(d) - } - for { - yyj1128++ - if yyhl1128 { - yyb1128 = yyj1128 > l - } else { - yyb1128 = r.CheckBreak() - } - if yyb1128 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1128-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *HTTPIngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1130 := z.EncBinary() - _ = yym1130 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1131 := !z.EncBinary() - yy2arr1131 := z.EncBasicHandle().StructToArray - var yyq1131 [1]bool - _, _, _ = yysep1131, yyq1131, yy2arr1131 - const yyr1131 bool = false - var yynn1131 int - if yyr1131 || yy2arr1131 { - r.EncodeArrayStart(1) - } else { - yynn1131 = 1 - for _, b := range yyq1131 { - if b { - yynn1131++ - } - } - r.EncodeMapStart(yynn1131) - yynn1131 = 0 - } - if yyr1131 || yy2arr1131 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Paths == nil { - r.EncodeNil() - } else { - yym1133 := z.EncBinary() - _ = yym1133 - if false { - } else { - h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("paths")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Paths == nil { - r.EncodeNil() - } else { - yym1134 := z.EncBinary() - _ = yym1134 - if false { - } else { - h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) - } - } - } - if yyr1131 || yy2arr1131 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *HTTPIngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1135 := z.DecBinary() - _ = yym1135 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1136 := r.ContainerType() - if yyct1136 == codecSelferValueTypeMap1234 { - yyl1136 := r.ReadMapStart() - if yyl1136 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1136, d) - } - } else if yyct1136 == codecSelferValueTypeArray1234 { - yyl1136 := r.ReadArrayStart() - if yyl1136 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1136, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *HTTPIngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1137Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1137Slc - var yyhl1137 bool = l >= 0 - for yyj1137 := 0; ; yyj1137++ { - if yyhl1137 { - if yyj1137 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1137Slc = r.DecodeBytes(yys1137Slc, true, true) - yys1137 := string(yys1137Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1137 { - case "paths": - if r.TryDecodeAsNil() { - x.Paths = nil - } else { - yyv1138 := &x.Paths - yym1139 := z.DecBinary() - _ = yym1139 - if false { - } else { - h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1138), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys1137) - } // end switch yys1137 - } // end for yyj1137 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -13706,15 +13740,14 @@ func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Deco } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Paths = nil - } else { - yyv1141 := &x.Paths - yym1142 := z.DecBinary() - _ = yym1142 - if false { - } else { - h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1141), d) + if x.HTTP != nil { + x.HTTP = nil } + } else { + if x.HTTP == nil { + x.HTTP = new(HTTPIngressRuleValue) + } + x.HTTP.CodecDecodeSelf(d) } for { yyj1140++ @@ -13732,6 +13765,188 @@ func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Deco z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } +func (x *HTTPIngressRuleValue) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1142 := z.EncBinary() + _ = yym1142 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1143 := !z.EncBinary() + yy2arr1143 := z.EncBasicHandle().StructToArray + var yyq1143 [1]bool + _, _, _ = yysep1143, yyq1143, yy2arr1143 + const yyr1143 bool = false + var yynn1143 int + if yyr1143 || yy2arr1143 { + r.EncodeArrayStart(1) + } else { + yynn1143 = 1 + for _, b := range yyq1143 { + if b { + yynn1143++ + } + } + r.EncodeMapStart(yynn1143) + yynn1143 = 0 + } + if yyr1143 || yy2arr1143 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Paths == nil { + r.EncodeNil() + } else { + yym1145 := z.EncBinary() + _ = yym1145 + if false { + } else { + h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("paths")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Paths == nil { + r.EncodeNil() + } else { + yym1146 := z.EncBinary() + _ = yym1146 + if false { + } else { + h.encSliceHTTPIngressPath(([]HTTPIngressPath)(x.Paths), e) + } + } + } + if yyr1143 || yy2arr1143 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HTTPIngressRuleValue) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1147 := z.DecBinary() + _ = yym1147 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1148 := r.ContainerType() + if yyct1148 == codecSelferValueTypeMap1234 { + yyl1148 := r.ReadMapStart() + if yyl1148 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1148, d) + } + } else if yyct1148 == codecSelferValueTypeArray1234 { + yyl1148 := r.ReadArrayStart() + if yyl1148 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1148, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HTTPIngressRuleValue) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1149Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1149Slc + var yyhl1149 bool = l >= 0 + for yyj1149 := 0; ; yyj1149++ { + if yyhl1149 { + if yyj1149 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1149Slc = r.DecodeBytes(yys1149Slc, true, true) + yys1149 := string(yys1149Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1149 { + case "paths": + if r.TryDecodeAsNil() { + x.Paths = nil + } else { + yyv1150 := &x.Paths + yym1151 := z.DecBinary() + _ = yym1151 + if false { + } else { + h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1150), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1149) + } // end switch yys1149 + } // end for yyj1149 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HTTPIngressRuleValue) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1152 int + var yyb1152 bool + var yyhl1152 bool = l >= 0 + yyj1152++ + if yyhl1152 { + yyb1152 = yyj1152 > l + } else { + yyb1152 = r.CheckBreak() + } + if yyb1152 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Paths = nil + } else { + yyv1153 := &x.Paths + yym1154 := z.DecBinary() + _ = yym1154 + if false { + } else { + h.decSliceHTTPIngressPath((*[]HTTPIngressPath)(yyv1153), d) + } + } + for { + yyj1152++ + if yyhl1152 { + yyb1152 = yyj1152 > l + } else { + yyb1152 = r.CheckBreak() + } + if yyb1152 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1152-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + func (x *HTTPIngressPath) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) @@ -13739,35 +13954,35 @@ func (x *HTTPIngressPath) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1143 := z.EncBinary() - _ = yym1143 + yym1155 := z.EncBinary() + _ = yym1155 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1144 := !z.EncBinary() - yy2arr1144 := z.EncBasicHandle().StructToArray - var yyq1144 [2]bool - _, _, _ = yysep1144, yyq1144, yy2arr1144 - const yyr1144 bool = false - yyq1144[0] = x.Path != "" - var yynn1144 int - if yyr1144 || yy2arr1144 { + yysep1156 := !z.EncBinary() + yy2arr1156 := z.EncBasicHandle().StructToArray + var yyq1156 [2]bool + _, _, _ = yysep1156, yyq1156, yy2arr1156 + const yyr1156 bool = false + yyq1156[0] = x.Path != "" + var yynn1156 int + if yyr1156 || yy2arr1156 { r.EncodeArrayStart(2) } else { - yynn1144 = 1 - for _, b := range yyq1144 { + yynn1156 = 1 + for _, b := range yyq1156 { if b { - yynn1144++ + yynn1156++ } } - r.EncodeMapStart(yynn1144) - yynn1144 = 0 + r.EncodeMapStart(yynn1156) + yynn1156 = 0 } - if yyr1144 || yy2arr1144 { + if yyr1156 || yy2arr1156 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1144[0] { - yym1146 := z.EncBinary() - _ = yym1146 + if yyq1156[0] { + yym1158 := z.EncBinary() + _ = yym1158 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -13776,30 +13991,30 @@ func (x *HTTPIngressPath) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq1144[0] { + if yyq1156[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("path")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1147 := z.EncBinary() - _ = yym1147 + yym1159 := z.EncBinary() + _ = yym1159 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } } - if yyr1144 || yy2arr1144 { + if yyr1156 || yy2arr1156 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1149 := &x.Backend - yy1149.CodecEncodeSelf(e) + yy1161 := &x.Backend + yy1161.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("backend")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1150 := &x.Backend - yy1150.CodecEncodeSelf(e) + yy1162 := &x.Backend + yy1162.CodecEncodeSelf(e) } - if yyr1144 || yy2arr1144 { + if yyr1156 || yy2arr1156 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -13812,25 +14027,25 @@ func (x *HTTPIngressPath) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1151 := z.DecBinary() - _ = yym1151 + yym1163 := z.DecBinary() + _ = yym1163 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1152 := r.ContainerType() - if yyct1152 == codecSelferValueTypeMap1234 { - yyl1152 := r.ReadMapStart() - if yyl1152 == 0 { + yyct1164 := r.ContainerType() + if yyct1164 == codecSelferValueTypeMap1234 { + yyl1164 := r.ReadMapStart() + if yyl1164 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1152, d) + x.codecDecodeSelfFromMap(yyl1164, d) } - } else if yyct1152 == codecSelferValueTypeArray1234 { - yyl1152 := r.ReadArrayStart() - if yyl1152 == 0 { + } else if yyct1164 == codecSelferValueTypeArray1234 { + yyl1164 := r.ReadArrayStart() + if yyl1164 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1152, d) + x.codecDecodeSelfFromArray(yyl1164, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -13842,12 +14057,12 @@ func (x *HTTPIngressPath) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1153Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1153Slc - var yyhl1153 bool = l >= 0 - for yyj1153 := 0; ; yyj1153++ { - if yyhl1153 { - if yyj1153 >= l { + var yys1165Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1165Slc + var yyhl1165 bool = l >= 0 + for yyj1165 := 0; ; yyj1165++ { + if yyhl1165 { + if yyj1165 >= l { break } } else { @@ -13856,10 +14071,10 @@ func (x *HTTPIngressPath) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1153Slc = r.DecodeBytes(yys1153Slc, true, true) - yys1153 := string(yys1153Slc) + yys1165Slc = r.DecodeBytes(yys1165Slc, true, true) + yys1165 := string(yys1165Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1153 { + switch yys1165 { case "path": if r.TryDecodeAsNil() { x.Path = "" @@ -13870,13 +14085,13 @@ func (x *HTTPIngressPath) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Backend = IngressBackend{} } else { - yyv1155 := &x.Backend - yyv1155.CodecDecodeSelf(d) + yyv1167 := &x.Backend + yyv1167.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1153) - } // end switch yys1153 - } // end for yyj1153 + z.DecStructFieldNotFound(-1, yys1165) + } // end switch yys1165 + } // end for yyj1165 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -13884,16 +14099,16 @@ func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1156 int - var yyb1156 bool - var yyhl1156 bool = l >= 0 - yyj1156++ - if yyhl1156 { - yyb1156 = yyj1156 > l + var yyj1168 int + var yyb1168 bool + var yyhl1168 bool = l >= 0 + yyj1168++ + if yyhl1168 { + yyb1168 = yyj1168 > l } else { - yyb1156 = r.CheckBreak() + yyb1168 = r.CheckBreak() } - if yyb1156 { + if yyb1168 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13903,13 +14118,13 @@ func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } - yyj1156++ - if yyhl1156 { - yyb1156 = yyj1156 > l + yyj1168++ + if yyhl1168 { + yyb1168 = yyj1168 > l } else { - yyb1156 = r.CheckBreak() + yyb1168 = r.CheckBreak() } - if yyb1156 { + if yyb1168 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -13917,21 +14132,21 @@ func (x *HTTPIngressPath) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if r.TryDecodeAsNil() { x.Backend = IngressBackend{} } else { - yyv1158 := &x.Backend - yyv1158.CodecDecodeSelf(d) + yyv1170 := &x.Backend + yyv1170.CodecDecodeSelf(d) } for { - yyj1156++ - if yyhl1156 { - yyb1156 = yyj1156 > l + yyj1168++ + if yyhl1168 { + yyb1168 = yyj1168 > l } else { - yyb1156 = r.CheckBreak() + yyb1168 = r.CheckBreak() } - if yyb1156 { + if yyb1168 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1156-1, "") + z.DecStructFieldNotFound(yyj1168-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -13943,33 +14158,33 @@ func (x *IngressBackend) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1159 := z.EncBinary() - _ = yym1159 + yym1171 := z.EncBinary() + _ = yym1171 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1160 := !z.EncBinary() - yy2arr1160 := z.EncBasicHandle().StructToArray - var yyq1160 [2]bool - _, _, _ = yysep1160, yyq1160, yy2arr1160 - const yyr1160 bool = false - var yynn1160 int - if yyr1160 || yy2arr1160 { + yysep1172 := !z.EncBinary() + yy2arr1172 := z.EncBasicHandle().StructToArray + var yyq1172 [2]bool + _, _, _ = yysep1172, yyq1172, yy2arr1172 + const yyr1172 bool = false + var yynn1172 int + if yyr1172 || yy2arr1172 { r.EncodeArrayStart(2) } else { - yynn1160 = 2 - for _, b := range yyq1160 { + yynn1172 = 2 + for _, b := range yyq1172 { if b { - yynn1160++ + yynn1172++ } } - r.EncodeMapStart(yynn1160) - yynn1160 = 0 + r.EncodeMapStart(yynn1172) + yynn1172 = 0 } - if yyr1160 || yy2arr1160 { + if yyr1172 || yy2arr1172 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1162 := z.EncBinary() - _ = yym1162 + yym1174 := z.EncBinary() + _ = yym1174 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceName)) @@ -13978,41 +14193,41 @@ func (x *IngressBackend) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("serviceName")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1163 := z.EncBinary() - _ = yym1163 + yym1175 := z.EncBinary() + _ = yym1175 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.ServiceName)) } } - if yyr1160 || yy2arr1160 { + if yyr1172 || yy2arr1172 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1165 := &x.ServicePort - yym1166 := z.EncBinary() - _ = yym1166 + yy1177 := &x.ServicePort + yym1178 := z.EncBinary() + _ = yym1178 if false { - } else if z.HasExtensions() && z.EncExt(yy1165) { - } else if !yym1166 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1165) + } else if z.HasExtensions() && z.EncExt(yy1177) { + } else if !yym1178 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1177) } else { - z.EncFallback(yy1165) + z.EncFallback(yy1177) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("servicePort")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1167 := &x.ServicePort - yym1168 := z.EncBinary() - _ = yym1168 + yy1179 := &x.ServicePort + yym1180 := z.EncBinary() + _ = yym1180 if false { - } else if z.HasExtensions() && z.EncExt(yy1167) { - } else if !yym1168 && z.IsJSONHandle() { - z.EncJSONMarshal(yy1167) + } else if z.HasExtensions() && z.EncExt(yy1179) { + } else if !yym1180 && z.IsJSONHandle() { + z.EncJSONMarshal(yy1179) } else { - z.EncFallback(yy1167) + z.EncFallback(yy1179) } } - if yyr1160 || yy2arr1160 { + if yyr1172 || yy2arr1172 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14025,25 +14240,25 @@ func (x *IngressBackend) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1169 := z.DecBinary() - _ = yym1169 + yym1181 := z.DecBinary() + _ = yym1181 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1170 := r.ContainerType() - if yyct1170 == codecSelferValueTypeMap1234 { - yyl1170 := r.ReadMapStart() - if yyl1170 == 0 { + yyct1182 := r.ContainerType() + if yyct1182 == codecSelferValueTypeMap1234 { + yyl1182 := r.ReadMapStart() + if yyl1182 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1170, d) + x.codecDecodeSelfFromMap(yyl1182, d) } - } else if yyct1170 == codecSelferValueTypeArray1234 { - yyl1170 := r.ReadArrayStart() - if yyl1170 == 0 { + } else if yyct1182 == codecSelferValueTypeArray1234 { + yyl1182 := r.ReadArrayStart() + if yyl1182 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1170, d) + x.codecDecodeSelfFromArray(yyl1182, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14055,12 +14270,12 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1171Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1171Slc - var yyhl1171 bool = l >= 0 - for yyj1171 := 0; ; yyj1171++ { - if yyhl1171 { - if yyj1171 >= l { + var yys1183Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1183Slc + var yyhl1183 bool = l >= 0 + for yyj1183 := 0; ; yyj1183++ { + if yyhl1183 { + if yyj1183 >= l { break } } else { @@ -14069,10 +14284,10 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1171Slc = r.DecodeBytes(yys1171Slc, true, true) - yys1171 := string(yys1171Slc) + yys1183Slc = r.DecodeBytes(yys1183Slc, true, true) + yys1183 := string(yys1183Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1171 { + switch yys1183 { case "serviceName": if r.TryDecodeAsNil() { x.ServiceName = "" @@ -14083,21 +14298,21 @@ func (x *IngressBackend) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ServicePort = pkg6_intstr.IntOrString{} } else { - yyv1173 := &x.ServicePort - yym1174 := z.DecBinary() - _ = yym1174 + yyv1185 := &x.ServicePort + yym1186 := z.DecBinary() + _ = yym1186 if false { - } else if z.HasExtensions() && z.DecExt(yyv1173) { - } else if !yym1174 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1173) + } else if z.HasExtensions() && z.DecExt(yyv1185) { + } else if !yym1186 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1185) } else { - z.DecFallback(yyv1173, false) + z.DecFallback(yyv1185, false) } } default: - z.DecStructFieldNotFound(-1, yys1171) - } // end switch yys1171 - } // end for yyj1171 + z.DecStructFieldNotFound(-1, yys1183) + } // end switch yys1183 + } // end for yyj1183 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14105,16 +14320,16 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1175 int - var yyb1175 bool - var yyhl1175 bool = l >= 0 - yyj1175++ - if yyhl1175 { - yyb1175 = yyj1175 > l + var yyj1187 int + var yyb1187 bool + var yyhl1187 bool = l >= 0 + yyj1187++ + if yyhl1187 { + yyb1187 = yyj1187 > l } else { - yyb1175 = r.CheckBreak() + yyb1187 = r.CheckBreak() } - if yyb1175 { + if yyb1187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14124,13 +14339,13 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ServiceName = string(r.DecodeString()) } - yyj1175++ - if yyhl1175 { - yyb1175 = yyj1175 > l + yyj1187++ + if yyhl1187 { + yyb1187 = yyj1187 > l } else { - yyb1175 = r.CheckBreak() + yyb1187 = r.CheckBreak() } - if yyb1175 { + if yyb1187 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14138,29 +14353,29 @@ func (x *IngressBackend) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ServicePort = pkg6_intstr.IntOrString{} } else { - yyv1177 := &x.ServicePort - yym1178 := z.DecBinary() - _ = yym1178 + yyv1189 := &x.ServicePort + yym1190 := z.DecBinary() + _ = yym1190 if false { - } else if z.HasExtensions() && z.DecExt(yyv1177) { - } else if !yym1178 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv1177) + } else if z.HasExtensions() && z.DecExt(yyv1189) { + } else if !yym1190 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv1189) } else { - z.DecFallback(yyv1177, false) + z.DecFallback(yyv1189, false) } } for { - yyj1175++ - if yyhl1175 { - yyb1175 = yyj1175 > l + yyj1187++ + if yyhl1187 { + yyb1187 = yyj1187 > l } else { - yyb1175 = r.CheckBreak() + yyb1187 = r.CheckBreak() } - if yyb1175 { + if yyb1187 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1175-1, "") + z.DecStructFieldNotFound(yyj1187-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14169,8 +14384,8 @@ func (x NodeResource) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1179 := z.EncBinary() - _ = yym1179 + yym1191 := z.EncBinary() + _ = yym1191 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -14182,8 +14397,8 @@ func (x *NodeResource) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1180 := z.DecBinary() - _ = yym1180 + yym1192 := z.DecBinary() + _ = yym1192 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -14198,30 +14413,30 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1181 := z.EncBinary() - _ = yym1181 + yym1193 := z.EncBinary() + _ = yym1193 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1182 := !z.EncBinary() - yy2arr1182 := z.EncBasicHandle().StructToArray - var yyq1182 [2]bool - _, _, _ = yysep1182, yyq1182, yy2arr1182 - const yyr1182 bool = false - var yynn1182 int - if yyr1182 || yy2arr1182 { + yysep1194 := !z.EncBinary() + yy2arr1194 := z.EncBasicHandle().StructToArray + var yyq1194 [2]bool + _, _, _ = yysep1194, yyq1194, yy2arr1194 + const yyr1194 bool = false + var yynn1194 int + if yyr1194 || yy2arr1194 { r.EncodeArrayStart(2) } else { - yynn1182 = 2 - for _, b := range yyq1182 { + yynn1194 = 2 + for _, b := range yyq1194 { if b { - yynn1182++ + yynn1194++ } } - r.EncodeMapStart(yynn1182) - yynn1182 = 0 + r.EncodeMapStart(yynn1194) + yynn1194 = 0 } - if yyr1182 || yy2arr1182 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Resource.CodecEncodeSelf(e) } else { @@ -14230,10 +14445,10 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Resource.CodecEncodeSelf(e) } - if yyr1182 || yy2arr1182 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1185 := z.EncBinary() - _ = yym1185 + yym1197 := z.EncBinary() + _ = yym1197 if false { } else { r.EncodeFloat64(float64(x.Value)) @@ -14242,14 +14457,14 @@ func (x *NodeUtilization) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("value")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1186 := z.EncBinary() - _ = yym1186 + yym1198 := z.EncBinary() + _ = yym1198 if false { } else { r.EncodeFloat64(float64(x.Value)) } } - if yyr1182 || yy2arr1182 { + if yyr1194 || yy2arr1194 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14262,25 +14477,25 @@ func (x *NodeUtilization) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1187 := z.DecBinary() - _ = yym1187 + yym1199 := z.DecBinary() + _ = yym1199 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1188 := r.ContainerType() - if yyct1188 == codecSelferValueTypeMap1234 { - yyl1188 := r.ReadMapStart() - if yyl1188 == 0 { + yyct1200 := r.ContainerType() + if yyct1200 == codecSelferValueTypeMap1234 { + yyl1200 := r.ReadMapStart() + if yyl1200 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1188, d) + x.codecDecodeSelfFromMap(yyl1200, d) } - } else if yyct1188 == codecSelferValueTypeArray1234 { - yyl1188 := r.ReadArrayStart() - if yyl1188 == 0 { + } else if yyct1200 == codecSelferValueTypeArray1234 { + yyl1200 := r.ReadArrayStart() + if yyl1200 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1188, d) + x.codecDecodeSelfFromArray(yyl1200, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14292,12 +14507,12 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1189Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1189Slc - var yyhl1189 bool = l >= 0 - for yyj1189 := 0; ; yyj1189++ { - if yyhl1189 { - if yyj1189 >= l { + var yys1201Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1201Slc + var yyhl1201 bool = l >= 0 + for yyj1201 := 0; ; yyj1201++ { + if yyhl1201 { + if yyj1201 >= l { break } } else { @@ -14306,10 +14521,10 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1189Slc = r.DecodeBytes(yys1189Slc, true, true) - yys1189 := string(yys1189Slc) + yys1201Slc = r.DecodeBytes(yys1201Slc, true, true) + yys1201 := string(yys1201Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1189 { + switch yys1201 { case "resource": if r.TryDecodeAsNil() { x.Resource = "" @@ -14323,9 +14538,9 @@ func (x *NodeUtilization) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Value = float64(r.DecodeFloat(false)) } default: - z.DecStructFieldNotFound(-1, yys1189) - } // end switch yys1189 - } // end for yyj1189 + z.DecStructFieldNotFound(-1, yys1201) + } // end switch yys1201 + } // end for yyj1201 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14333,16 +14548,16 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1192 int - var yyb1192 bool - var yyhl1192 bool = l >= 0 - yyj1192++ - if yyhl1192 { - yyb1192 = yyj1192 > l + var yyj1204 int + var yyb1204 bool + var yyhl1204 bool = l >= 0 + yyj1204++ + if yyhl1204 { + yyb1204 = yyj1204 > l } else { - yyb1192 = r.CheckBreak() + yyb1204 = r.CheckBreak() } - if yyb1192 { + if yyb1204 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14352,13 +14567,13 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Resource = NodeResource(r.DecodeString()) } - yyj1192++ - if yyhl1192 { - yyb1192 = yyj1192 > l + yyj1204++ + if yyhl1204 { + yyb1204 = yyj1204 > l } else { - yyb1192 = r.CheckBreak() + yyb1204 = r.CheckBreak() } - if yyb1192 { + if yyb1204 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14369,17 +14584,17 @@ func (x *NodeUtilization) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.Value = float64(r.DecodeFloat(false)) } for { - yyj1192++ - if yyhl1192 { - yyb1192 = yyj1192 > l + yyj1204++ + if yyhl1204 { + yyb1204 = yyj1204 > l } else { - yyb1192 = r.CheckBreak() + yyb1204 = r.CheckBreak() } - if yyb1192 { + if yyb1204 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1192-1, "") + z.DecStructFieldNotFound(yyj1204-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14391,33 +14606,33 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1195 := z.EncBinary() - _ = yym1195 + yym1207 := z.EncBinary() + _ = yym1207 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1196 := !z.EncBinary() - yy2arr1196 := z.EncBasicHandle().StructToArray - var yyq1196 [3]bool - _, _, _ = yysep1196, yyq1196, yy2arr1196 - const yyr1196 bool = false - var yynn1196 int - if yyr1196 || yy2arr1196 { + yysep1208 := !z.EncBinary() + yy2arr1208 := z.EncBasicHandle().StructToArray + var yyq1208 [3]bool + _, _, _ = yysep1208, yyq1208, yy2arr1208 + const yyr1208 bool = false + var yynn1208 int + if yyr1208 || yy2arr1208 { r.EncodeArrayStart(3) } else { - yynn1196 = 3 - for _, b := range yyq1196 { + yynn1208 = 3 + for _, b := range yyq1208 { if b { - yynn1196++ + yynn1208++ } } - r.EncodeMapStart(yynn1196) - yynn1196 = 0 + r.EncodeMapStart(yynn1208) + yynn1208 = 0 } - if yyr1196 || yy2arr1196 { + if yyr1208 || yy2arr1208 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1198 := z.EncBinary() - _ = yym1198 + yym1210 := z.EncBinary() + _ = yym1210 if false { } else { r.EncodeInt(int64(x.MinNodes)) @@ -14426,17 +14641,17 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("minNodes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1199 := z.EncBinary() - _ = yym1199 + yym1211 := z.EncBinary() + _ = yym1211 if false { } else { r.EncodeInt(int64(x.MinNodes)) } } - if yyr1196 || yy2arr1196 { + if yyr1208 || yy2arr1208 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1201 := z.EncBinary() - _ = yym1201 + yym1213 := z.EncBinary() + _ = yym1213 if false { } else { r.EncodeInt(int64(x.MaxNodes)) @@ -14445,20 +14660,20 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("maxNodes")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1202 := z.EncBinary() - _ = yym1202 + yym1214 := z.EncBinary() + _ = yym1214 if false { } else { r.EncodeInt(int64(x.MaxNodes)) } } - if yyr1196 || yy2arr1196 { + if yyr1208 || yy2arr1208 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.TargetUtilization == nil { r.EncodeNil() } else { - yym1204 := z.EncBinary() - _ = yym1204 + yym1216 := z.EncBinary() + _ = yym1216 if false { } else { h.encSliceNodeUtilization(([]NodeUtilization)(x.TargetUtilization), e) @@ -14471,15 +14686,15 @@ func (x *ClusterAutoscalerSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x.TargetUtilization == nil { r.EncodeNil() } else { - yym1205 := z.EncBinary() - _ = yym1205 + yym1217 := z.EncBinary() + _ = yym1217 if false { } else { h.encSliceNodeUtilization(([]NodeUtilization)(x.TargetUtilization), e) } } } - if yyr1196 || yy2arr1196 { + if yyr1208 || yy2arr1208 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14492,25 +14707,25 @@ func (x *ClusterAutoscalerSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1206 := z.DecBinary() - _ = yym1206 + yym1218 := z.DecBinary() + _ = yym1218 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1207 := r.ContainerType() - if yyct1207 == codecSelferValueTypeMap1234 { - yyl1207 := r.ReadMapStart() - if yyl1207 == 0 { + yyct1219 := r.ContainerType() + if yyct1219 == codecSelferValueTypeMap1234 { + yyl1219 := r.ReadMapStart() + if yyl1219 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1207, d) + x.codecDecodeSelfFromMap(yyl1219, d) } - } else if yyct1207 == codecSelferValueTypeArray1234 { - yyl1207 := r.ReadArrayStart() - if yyl1207 == 0 { + } else if yyct1219 == codecSelferValueTypeArray1234 { + yyl1219 := r.ReadArrayStart() + if yyl1219 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1207, d) + x.codecDecodeSelfFromArray(yyl1219, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14522,12 +14737,12 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1208Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1208Slc - var yyhl1208 bool = l >= 0 - for yyj1208 := 0; ; yyj1208++ { - if yyhl1208 { - if yyj1208 >= l { + var yys1220Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1220Slc + var yyhl1220 bool = l >= 0 + for yyj1220 := 0; ; yyj1220++ { + if yyhl1220 { + if yyj1220 >= l { break } } else { @@ -14536,10 +14751,10 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1208Slc = r.DecodeBytes(yys1208Slc, true, true) - yys1208 := string(yys1208Slc) + yys1220Slc = r.DecodeBytes(yys1220Slc, true, true) + yys1220 := string(yys1220Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1208 { + switch yys1220 { case "minNodes": if r.TryDecodeAsNil() { x.MinNodes = 0 @@ -14556,18 +14771,18 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.TargetUtilization = nil } else { - yyv1211 := &x.TargetUtilization - yym1212 := z.DecBinary() - _ = yym1212 + yyv1223 := &x.TargetUtilization + yym1224 := z.DecBinary() + _ = yym1224 if false { } else { - h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1211), d) + h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1223), d) } } default: - z.DecStructFieldNotFound(-1, yys1208) - } // end switch yys1208 - } // end for yyj1208 + z.DecStructFieldNotFound(-1, yys1220) + } // end switch yys1220 + } // end for yyj1220 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14575,16 +14790,16 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1213 int - var yyb1213 bool - var yyhl1213 bool = l >= 0 - yyj1213++ - if yyhl1213 { - yyb1213 = yyj1213 > l + var yyj1225 int + var yyb1225 bool + var yyhl1225 bool = l >= 0 + yyj1225++ + if yyhl1225 { + yyb1225 = yyj1225 > l } else { - yyb1213 = r.CheckBreak() + yyb1225 = r.CheckBreak() } - if yyb1213 { + if yyb1225 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14594,13 +14809,13 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.MinNodes = int32(r.DecodeInt(32)) } - yyj1213++ - if yyhl1213 { - yyb1213 = yyj1213 > l + yyj1225++ + if yyhl1225 { + yyb1225 = yyj1225 > l } else { - yyb1213 = r.CheckBreak() + yyb1225 = r.CheckBreak() } - if yyb1213 { + if yyb1225 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14610,13 +14825,13 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.MaxNodes = int32(r.DecodeInt(32)) } - yyj1213++ - if yyhl1213 { - yyb1213 = yyj1213 > l + yyj1225++ + if yyhl1225 { + yyb1225 = yyj1225 > l } else { - yyb1213 = r.CheckBreak() + yyb1225 = r.CheckBreak() } - if yyb1213 { + if yyb1225 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14624,26 +14839,26 @@ func (x *ClusterAutoscalerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.TargetUtilization = nil } else { - yyv1216 := &x.TargetUtilization - yym1217 := z.DecBinary() - _ = yym1217 + yyv1228 := &x.TargetUtilization + yym1229 := z.DecBinary() + _ = yym1229 if false { } else { - h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1216), d) + h.decSliceNodeUtilization((*[]NodeUtilization)(yyv1228), d) } } for { - yyj1213++ - if yyhl1213 { - yyb1213 = yyj1213 > l + yyj1225++ + if yyhl1225 { + yyb1225 = yyj1225 > l } else { - yyb1213 = r.CheckBreak() + yyb1225 = r.CheckBreak() } - if yyb1213 { + if yyb1225 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1213-1, "") + z.DecStructFieldNotFound(yyj1225-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14655,118 +14870,118 @@ func (x *ClusterAutoscaler) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1218 := z.EncBinary() - _ = yym1218 + yym1230 := z.EncBinary() + _ = yym1230 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1219 := !z.EncBinary() - yy2arr1219 := z.EncBasicHandle().StructToArray - var yyq1219 [4]bool - _, _, _ = yysep1219, yyq1219, yy2arr1219 - const yyr1219 bool = false - yyq1219[0] = x.Kind != "" - yyq1219[1] = x.APIVersion != "" - yyq1219[2] = true - yyq1219[3] = true - var yynn1219 int - if yyr1219 || yy2arr1219 { + yysep1231 := !z.EncBinary() + yy2arr1231 := z.EncBasicHandle().StructToArray + var yyq1231 [4]bool + _, _, _ = yysep1231, yyq1231, yy2arr1231 + const yyr1231 bool = false + yyq1231[0] = true + yyq1231[1] = true + yyq1231[2] = x.Kind != "" + yyq1231[3] = x.APIVersion != "" + var yynn1231 int + if yyr1231 || yy2arr1231 { r.EncodeArrayStart(4) } else { - yynn1219 = 0 - for _, b := range yyq1219 { + yynn1231 = 0 + for _, b := range yyq1231 { if b { - yynn1219++ + yynn1231++ } } - r.EncodeMapStart(yynn1219) - yynn1219 = 0 + r.EncodeMapStart(yynn1231) + yynn1231 = 0 } - if yyr1219 || yy2arr1219 { + if yyr1231 || yy2arr1231 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1219[0] { - yym1221 := z.EncBinary() - _ = yym1221 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1219[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1222 := z.EncBinary() - _ = yym1222 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1219 || yy2arr1219 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1219[1] { - yym1224 := z.EncBinary() - _ = yym1224 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1219[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1225 := z.EncBinary() - _ = yym1225 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1219 || yy2arr1219 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1219[2] { - yy1227 := &x.ObjectMeta - yy1227.CodecEncodeSelf(e) + if yyq1231[0] { + yy1233 := &x.ObjectMeta + yy1233.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1219[2] { + if yyq1231[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1228 := &x.ObjectMeta - yy1228.CodecEncodeSelf(e) + yy1234 := &x.ObjectMeta + yy1234.CodecEncodeSelf(e) } } - if yyr1219 || yy2arr1219 { + if yyr1231 || yy2arr1231 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1219[3] { - yy1230 := &x.Spec - yy1230.CodecEncodeSelf(e) + if yyq1231[1] { + yy1236 := &x.Spec + yy1236.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1219[3] { + if yyq1231[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1231 := &x.Spec - yy1231.CodecEncodeSelf(e) + yy1237 := &x.Spec + yy1237.CodecEncodeSelf(e) } } - if yyr1219 || yy2arr1219 { + if yyr1231 || yy2arr1231 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1231[2] { + yym1239 := z.EncBinary() + _ = yym1239 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1231[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1240 := z.EncBinary() + _ = yym1240 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1231 || yy2arr1231 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1231[3] { + yym1242 := z.EncBinary() + _ = yym1242 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1231[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1243 := z.EncBinary() + _ = yym1243 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1231 || yy2arr1231 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -14779,25 +14994,25 @@ func (x *ClusterAutoscaler) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1232 := z.DecBinary() - _ = yym1232 + yym1244 := z.DecBinary() + _ = yym1244 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1233 := r.ContainerType() - if yyct1233 == codecSelferValueTypeMap1234 { - yyl1233 := r.ReadMapStart() - if yyl1233 == 0 { + yyct1245 := r.ContainerType() + if yyct1245 == codecSelferValueTypeMap1234 { + yyl1245 := r.ReadMapStart() + if yyl1245 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1233, d) + x.codecDecodeSelfFromMap(yyl1245, d) } - } else if yyct1233 == codecSelferValueTypeArray1234 { - yyl1233 := r.ReadArrayStart() - if yyl1233 == 0 { + } else if yyct1245 == codecSelferValueTypeArray1234 { + yyl1245 := r.ReadArrayStart() + if yyl1245 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1233, d) + x.codecDecodeSelfFromArray(yyl1245, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -14809,12 +15024,12 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1234Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1234Slc - var yyhl1234 bool = l >= 0 - for yyj1234 := 0; ; yyj1234++ { - if yyhl1234 { - if yyj1234 >= l { + var yys1246Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1246Slc + var yyhl1246 bool = l >= 0 + for yyj1246 := 0; ; yyj1246++ { + if yyhl1246 { + if yyj1246 >= l { break } } else { @@ -14823,10 +15038,24 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1234Slc = r.DecodeBytes(yys1234Slc, true, true) - yys1234 := string(yys1234Slc) + yys1246Slc = r.DecodeBytes(yys1246Slc, true, true) + yys1246 := string(yys1246Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1234 { + switch yys1246 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1247 := &x.ObjectMeta + yyv1247.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ClusterAutoscalerSpec{} + } else { + yyv1248 := &x.Spec + yyv1248.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -14839,24 +15068,10 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1237 := &x.ObjectMeta - yyv1237.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ClusterAutoscalerSpec{} - } else { - yyv1238 := &x.Spec - yyv1238.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1234) - } // end switch yys1234 - } // end for yyj1234 + z.DecStructFieldNotFound(-1, yys1246) + } // end switch yys1246 + } // end for yyj1246 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -14864,16 +15079,50 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1239 int - var yyb1239 bool - var yyhl1239 bool = l >= 0 - yyj1239++ - if yyhl1239 { - yyb1239 = yyj1239 > l + var yyj1251 int + var yyb1251 bool + var yyhl1251 bool = l >= 0 + yyj1251++ + if yyhl1251 { + yyb1251 = yyj1251 > l } else { - yyb1239 = r.CheckBreak() + yyb1251 = r.CheckBreak() } - if yyb1239 { + if yyb1251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1252 := &x.ObjectMeta + yyv1252.CodecDecodeSelf(d) + } + yyj1251++ + if yyhl1251 { + yyb1251 = yyj1251 > l + } else { + yyb1251 = r.CheckBreak() + } + if yyb1251 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ClusterAutoscalerSpec{} + } else { + yyv1253 := &x.Spec + yyv1253.CodecDecodeSelf(d) + } + yyj1251++ + if yyhl1251 { + yyb1251 = yyj1251 > l + } else { + yyb1251 = r.CheckBreak() + } + if yyb1251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14883,13 +15132,13 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.Kind = string(r.DecodeString()) } - yyj1239++ - if yyhl1239 { - yyb1239 = yyj1239 > l + yyj1251++ + if yyhl1251 { + yyb1251 = yyj1251 > l } else { - yyb1239 = r.CheckBreak() + yyb1251 = r.CheckBreak() } - if yyb1239 { + if yyb1251 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -14899,52 +15148,18 @@ func (x *ClusterAutoscaler) codecDecodeSelfFromArray(l int, d *codec1978.Decoder } else { x.APIVersion = string(r.DecodeString()) } - yyj1239++ - if yyhl1239 { - yyb1239 = yyj1239 > l - } else { - yyb1239 = r.CheckBreak() - } - if yyb1239 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1242 := &x.ObjectMeta - yyv1242.CodecDecodeSelf(d) - } - yyj1239++ - if yyhl1239 { - yyb1239 = yyj1239 > l - } else { - yyb1239 = r.CheckBreak() - } - if yyb1239 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ClusterAutoscalerSpec{} - } else { - yyv1243 := &x.Spec - yyv1243.CodecDecodeSelf(d) - } for { - yyj1239++ - if yyhl1239 { - yyb1239 = yyj1239 > l + yyj1251++ + if yyhl1251 { + yyb1251 = yyj1251 > l } else { - yyb1239 = r.CheckBreak() + yyb1251 = r.CheckBreak() } - if yyb1239 { + if yyb1251 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1239-1, "") + z.DecStructFieldNotFound(yyj1251-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -14956,118 +15171,68 @@ func (x *ClusterAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1244 := z.EncBinary() - _ = yym1244 + yym1256 := z.EncBinary() + _ = yym1256 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1245 := !z.EncBinary() - yy2arr1245 := z.EncBasicHandle().StructToArray - var yyq1245 [4]bool - _, _, _ = yysep1245, yyq1245, yy2arr1245 - const yyr1245 bool = false - yyq1245[0] = x.Kind != "" - yyq1245[1] = x.APIVersion != "" - yyq1245[2] = true - var yynn1245 int - if yyr1245 || yy2arr1245 { + yysep1257 := !z.EncBinary() + yy2arr1257 := z.EncBasicHandle().StructToArray + var yyq1257 [4]bool + _, _, _ = yysep1257, yyq1257, yy2arr1257 + const yyr1257 bool = false + yyq1257[0] = true + yyq1257[2] = x.Kind != "" + yyq1257[3] = x.APIVersion != "" + var yynn1257 int + if yyr1257 || yy2arr1257 { r.EncodeArrayStart(4) } else { - yynn1245 = 1 - for _, b := range yyq1245 { + yynn1257 = 1 + for _, b := range yyq1257 { if b { - yynn1245++ + yynn1257++ } } - r.EncodeMapStart(yynn1245) - yynn1245 = 0 + r.EncodeMapStart(yynn1257) + yynn1257 = 0 } - if yyr1245 || yy2arr1245 { + if yyr1257 || yy2arr1257 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1245[0] { - yym1247 := z.EncBinary() - _ = yym1247 + if yyq1257[0] { + yy1259 := &x.ListMeta + yym1260 := z.EncBinary() + _ = yym1260 if false { + } else if z.HasExtensions() && z.EncExt(yy1259) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1245[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1248 := z.EncBinary() - _ = yym1248 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1245 || yy2arr1245 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1245[1] { - yym1250 := z.EncBinary() - _ = yym1250 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1245[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1251 := z.EncBinary() - _ = yym1251 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1245 || yy2arr1245 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1245[2] { - yy1253 := &x.ListMeta - yym1254 := z.EncBinary() - _ = yym1254 - if false { - } else if z.HasExtensions() && z.EncExt(yy1253) { - } else { - z.EncFallback(yy1253) + z.EncFallback(yy1259) } } else { r.EncodeNil() } } else { - if yyq1245[2] { + if yyq1257[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1255 := &x.ListMeta - yym1256 := z.EncBinary() - _ = yym1256 + yy1261 := &x.ListMeta + yym1262 := z.EncBinary() + _ = yym1262 if false { - } else if z.HasExtensions() && z.EncExt(yy1255) { + } else if z.HasExtensions() && z.EncExt(yy1261) { } else { - z.EncFallback(yy1255) + z.EncFallback(yy1261) } } } - if yyr1245 || yy2arr1245 { + if yyr1257 || yy2arr1257 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1258 := z.EncBinary() - _ = yym1258 + yym1264 := z.EncBinary() + _ = yym1264 if false { } else { h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) @@ -15080,15 +15245,65 @@ func (x *ClusterAutoscalerList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1259 := z.EncBinary() - _ = yym1259 + yym1265 := z.EncBinary() + _ = yym1265 if false { } else { h.encSliceClusterAutoscaler(([]ClusterAutoscaler)(x.Items), e) } } } - if yyr1245 || yy2arr1245 { + if yyr1257 || yy2arr1257 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1257[2] { + yym1267 := z.EncBinary() + _ = yym1267 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1257[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1268 := z.EncBinary() + _ = yym1268 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1257 || yy2arr1257 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1257[3] { + yym1270 := z.EncBinary() + _ = yym1270 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1257[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1271 := z.EncBinary() + _ = yym1271 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1257 || yy2arr1257 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15101,25 +15316,25 @@ func (x *ClusterAutoscalerList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1260 := z.DecBinary() - _ = yym1260 + yym1272 := z.DecBinary() + _ = yym1272 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1261 := r.ContainerType() - if yyct1261 == codecSelferValueTypeMap1234 { - yyl1261 := r.ReadMapStart() - if yyl1261 == 0 { + yyct1273 := r.ContainerType() + if yyct1273 == codecSelferValueTypeMap1234 { + yyl1273 := r.ReadMapStart() + if yyl1273 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1261, d) + x.codecDecodeSelfFromMap(yyl1273, d) } - } else if yyct1261 == codecSelferValueTypeArray1234 { - yyl1261 := r.ReadArrayStart() - if yyl1261 == 0 { + } else if yyct1273 == codecSelferValueTypeArray1234 { + yyl1273 := r.ReadArrayStart() + if yyl1273 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1261, d) + x.codecDecodeSelfFromArray(yyl1273, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15131,12 +15346,12 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1262Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1262Slc - var yyhl1262 bool = l >= 0 - for yyj1262 := 0; ; yyj1262++ { - if yyhl1262 { - if yyj1262 >= l { + var yys1274Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1274Slc + var yyhl1274 bool = l >= 0 + for yyj1274 := 0; ; yyj1274++ { + if yyhl1274 { + if yyj1274 >= l { break } } else { @@ -15145,10 +15360,35 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1262Slc = r.DecodeBytes(yys1262Slc, true, true) - yys1262 := string(yys1262Slc) + yys1274Slc = r.DecodeBytes(yys1274Slc, true, true) + yys1274 := string(yys1274Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1262 { + switch yys1274 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1275 := &x.ListMeta + yym1276 := z.DecBinary() + _ = yym1276 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1275) { + } else { + z.DecFallback(yyv1275, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1277 := &x.Items + yym1278 := z.DecBinary() + _ = yym1278 + if false { + } else { + h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1277), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -15161,35 +15401,10 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromMap(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1265 := &x.ListMeta - yym1266 := z.DecBinary() - _ = yym1266 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1265) { - } else { - z.DecFallback(yyv1265, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1267 := &x.Items - yym1268 := z.DecBinary() - _ = yym1268 - if false { - } else { - h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1267), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1262) - } // end switch yys1262 - } // end for yyj1262 + z.DecStructFieldNotFound(-1, yys1274) + } // end switch yys1274 + } // end for yyj1274 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15197,16 +15412,61 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1269 int - var yyb1269 bool - var yyhl1269 bool = l >= 0 - yyj1269++ - if yyhl1269 { - yyb1269 = yyj1269 > l + var yyj1281 int + var yyb1281 bool + var yyhl1281 bool = l >= 0 + yyj1281++ + if yyhl1281 { + yyb1281 = yyj1281 > l } else { - yyb1269 = r.CheckBreak() + yyb1281 = r.CheckBreak() } - if yyb1269 { + if yyb1281 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1282 := &x.ListMeta + yym1283 := z.DecBinary() + _ = yym1283 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1282) { + } else { + z.DecFallback(yyv1282, false) + } + } + yyj1281++ + if yyhl1281 { + yyb1281 = yyj1281 > l + } else { + yyb1281 = r.CheckBreak() + } + if yyb1281 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1284 := &x.Items + yym1285 := z.DecBinary() + _ = yym1285 + if false { + } else { + h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1284), d) + } + } + yyj1281++ + if yyhl1281 { + yyb1281 = yyj1281 > l + } else { + yyb1281 = r.CheckBreak() + } + if yyb1281 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15216,13 +15476,13 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.Kind = string(r.DecodeString()) } - yyj1269++ - if yyhl1269 { - yyb1269 = yyj1269 > l + yyj1281++ + if yyhl1281 { + yyb1281 = yyj1281 > l } else { - yyb1269 = r.CheckBreak() + yyb1281 = r.CheckBreak() } - if yyb1269 { + if yyb1281 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15232,63 +15492,18 @@ func (x *ClusterAutoscalerList) codecDecodeSelfFromArray(l int, d *codec1978.Dec } else { x.APIVersion = string(r.DecodeString()) } - yyj1269++ - if yyhl1269 { - yyb1269 = yyj1269 > l - } else { - yyb1269 = r.CheckBreak() - } - if yyb1269 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1272 := &x.ListMeta - yym1273 := z.DecBinary() - _ = yym1273 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1272) { - } else { - z.DecFallback(yyv1272, false) - } - } - yyj1269++ - if yyhl1269 { - yyb1269 = yyj1269 > l - } else { - yyb1269 = r.CheckBreak() - } - if yyb1269 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1274 := &x.Items - yym1275 := z.DecBinary() - _ = yym1275 - if false { - } else { - h.decSliceClusterAutoscaler((*[]ClusterAutoscaler)(yyv1274), d) - } - } for { - yyj1269++ - if yyhl1269 { - yyb1269 = yyj1269 > l + yyj1281++ + if yyhl1281 { + yyb1281 = yyj1281 > l } else { - yyb1269 = r.CheckBreak() + yyb1281 = r.CheckBreak() } - if yyb1269 { + if yyb1281 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1269-1, "") + z.DecStructFieldNotFound(yyj1281-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -15300,85 +15515,35 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1276 := z.EncBinary() - _ = yym1276 + yym1288 := z.EncBinary() + _ = yym1288 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1277 := !z.EncBinary() - yy2arr1277 := z.EncBasicHandle().StructToArray - var yyq1277 [4]bool - _, _, _ = yysep1277, yyq1277, yy2arr1277 - const yyr1277 bool = false - yyq1277[0] = x.Kind != "" - yyq1277[1] = x.APIVersion != "" - var yynn1277 int - if yyr1277 || yy2arr1277 { + yysep1289 := !z.EncBinary() + yy2arr1289 := z.EncBasicHandle().StructToArray + var yyq1289 [4]bool + _, _, _ = yysep1289, yyq1289, yy2arr1289 + const yyr1289 bool = false + yyq1289[2] = x.Kind != "" + yyq1289[3] = x.APIVersion != "" + var yynn1289 int + if yyr1289 || yy2arr1289 { r.EncodeArrayStart(4) } else { - yynn1277 = 2 - for _, b := range yyq1277 { + yynn1289 = 2 + for _, b := range yyq1289 { if b { - yynn1277++ + yynn1289++ } } - r.EncodeMapStart(yynn1277) - yynn1277 = 0 + r.EncodeMapStart(yynn1289) + yynn1289 = 0 } - if yyr1277 || yy2arr1277 { + if yyr1289 || yy2arr1289 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1277[0] { - yym1279 := z.EncBinary() - _ = yym1279 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1277[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1280 := z.EncBinary() - _ = yym1280 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1277 || yy2arr1277 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1277[1] { - yym1282 := z.EncBinary() - _ = yym1282 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1277[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1283 := z.EncBinary() - _ = yym1283 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1277 || yy2arr1277 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1285 := z.EncBinary() - _ = yym1285 + yym1291 := z.EncBinary() + _ = yym1291 if false { } else { r.EncodeBool(bool(x.Export)) @@ -15387,17 +15552,17 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("export")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1286 := z.EncBinary() - _ = yym1286 + yym1292 := z.EncBinary() + _ = yym1292 if false { } else { r.EncodeBool(bool(x.Export)) } } - if yyr1277 || yy2arr1277 { + if yyr1289 || yy2arr1289 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1288 := z.EncBinary() - _ = yym1288 + yym1294 := z.EncBinary() + _ = yym1294 if false { } else { r.EncodeBool(bool(x.Exact)) @@ -15406,14 +15571,64 @@ func (x *ExportOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("exact")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1289 := z.EncBinary() - _ = yym1289 + yym1295 := z.EncBinary() + _ = yym1295 if false { } else { r.EncodeBool(bool(x.Exact)) } } - if yyr1277 || yy2arr1277 { + if yyr1289 || yy2arr1289 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1289[2] { + yym1297 := z.EncBinary() + _ = yym1297 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1289[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1298 := z.EncBinary() + _ = yym1298 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1289 || yy2arr1289 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1289[3] { + yym1300 := z.EncBinary() + _ = yym1300 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1289[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1301 := z.EncBinary() + _ = yym1301 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1289 || yy2arr1289 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -15426,25 +15641,25 @@ func (x *ExportOptions) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1290 := z.DecBinary() - _ = yym1290 + yym1302 := z.DecBinary() + _ = yym1302 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1291 := r.ContainerType() - if yyct1291 == codecSelferValueTypeMap1234 { - yyl1291 := r.ReadMapStart() - if yyl1291 == 0 { + yyct1303 := r.ContainerType() + if yyct1303 == codecSelferValueTypeMap1234 { + yyl1303 := r.ReadMapStart() + if yyl1303 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1291, d) + x.codecDecodeSelfFromMap(yyl1303, d) } - } else if yyct1291 == codecSelferValueTypeArray1234 { - yyl1291 := r.ReadArrayStart() - if yyl1291 == 0 { + } else if yyct1303 == codecSelferValueTypeArray1234 { + yyl1303 := r.ReadArrayStart() + if yyl1303 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1291, d) + x.codecDecodeSelfFromArray(yyl1303, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -15456,12 +15671,12 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1292Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1292Slc - var yyhl1292 bool = l >= 0 - for yyj1292 := 0; ; yyj1292++ { - if yyhl1292 { - if yyj1292 >= l { + var yys1304Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1304Slc + var yyhl1304 bool = l >= 0 + for yyj1304 := 0; ; yyj1304++ { + if yyhl1304 { + if yyj1304 >= l { break } } else { @@ -15470,22 +15685,10 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1292Slc = r.DecodeBytes(yys1292Slc, true, true) - yys1292 := string(yys1292Slc) + yys1304Slc = r.DecodeBytes(yys1304Slc, true, true) + yys1304 := string(yys1304Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1292 { - 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()) - } + switch yys1304 { case "export": if r.TryDecodeAsNil() { x.Export = false @@ -15498,383 +15701,6 @@ func (x *ExportOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Exact = bool(r.DecodeBool()) } - default: - z.DecStructFieldNotFound(-1, yys1292) - } // end switch yys1292 - } // end for yyj1292 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj1297 int - var yyb1297 bool - var yyhl1297 bool = l >= 0 - yyj1297++ - if yyhl1297 { - yyb1297 = yyj1297 > l - } else { - yyb1297 = r.CheckBreak() - } - if yyb1297 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj1297++ - if yyhl1297 { - yyb1297 = yyj1297 > l - } else { - yyb1297 = r.CheckBreak() - } - if yyb1297 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj1297++ - if yyhl1297 { - yyb1297 = yyj1297 > l - } else { - yyb1297 = r.CheckBreak() - } - if yyb1297 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Export = false - } else { - x.Export = bool(r.DecodeBool()) - } - yyj1297++ - if yyhl1297 { - yyb1297 = yyj1297 > l - } else { - yyb1297 = r.CheckBreak() - } - if yyb1297 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Exact = false - } else { - x.Exact = bool(r.DecodeBool()) - } - for { - yyj1297++ - if yyhl1297 { - yyb1297 = yyj1297 > l - } else { - yyb1297 = r.CheckBreak() - } - if yyb1297 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1297-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1302 := z.EncBinary() - _ = yym1302 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep1303 := !z.EncBinary() - yy2arr1303 := z.EncBasicHandle().StructToArray - var yyq1303 [7]bool - _, _, _ = yysep1303, yyq1303, yy2arr1303 - const yyr1303 bool = false - yyq1303[0] = x.Kind != "" - yyq1303[1] = x.APIVersion != "" - yyq1303[2] = x.LabelSelector != "" - yyq1303[3] = x.FieldSelector != "" - yyq1303[4] = x.Watch != false - yyq1303[5] = x.ResourceVersion != "" - yyq1303[6] = x.TimeoutSeconds != nil - var yynn1303 int - if yyr1303 || yy2arr1303 { - r.EncodeArrayStart(7) - } else { - yynn1303 = 0 - for _, b := range yyq1303 { - if b { - yynn1303++ - } - } - r.EncodeMapStart(yynn1303) - yynn1303 = 0 - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[0] { - yym1305 := z.EncBinary() - _ = yym1305 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1303[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1306 := z.EncBinary() - _ = yym1306 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[1] { - yym1308 := z.EncBinary() - _ = yym1308 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1303[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1309 := z.EncBinary() - _ = yym1309 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[2] { - yym1311 := z.EncBinary() - _ = yym1311 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1303[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("labelSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1312 := z.EncBinary() - _ = yym1312 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[3] { - yym1314 := z.EncBinary() - _ = yym1314 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1303[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("fieldSelector")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1315 := z.EncBinary() - _ = yym1315 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[4] { - yym1317 := z.EncBinary() - _ = yym1317 - if false { - } else { - r.EncodeBool(bool(x.Watch)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq1303[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("watch")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1318 := z.EncBinary() - _ = yym1318 - if false { - } else { - r.EncodeBool(bool(x.Watch)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[5] { - yym1320 := z.EncBinary() - _ = yym1320 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1303[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1321 := z.EncBinary() - _ = yym1321 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1303[6] { - if x.TimeoutSeconds == nil { - r.EncodeNil() - } else { - yy1323 := *x.TimeoutSeconds - yym1324 := z.EncBinary() - _ = yym1324 - if false { - } else { - r.EncodeInt(int64(yy1323)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq1303[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.TimeoutSeconds == nil { - r.EncodeNil() - } else { - yy1325 := *x.TimeoutSeconds - yym1326 := z.EncBinary() - _ = yym1326 - if false { - } else { - r.EncodeInt(int64(yy1325)) - } - } - } - } - if yyr1303 || yy2arr1303 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1327 := z.DecBinary() - _ = yym1327 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct1328 := r.ContainerType() - if yyct1328 == codecSelferValueTypeMap1234 { - yyl1328 := r.ReadMapStart() - if yyl1328 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl1328, d) - } - } else if yyct1328 == codecSelferValueTypeArray1234 { - yyl1328 := r.ReadArrayStart() - if yyl1328 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl1328, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys1329Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1329Slc - var yyhl1329 bool = l >= 0 - for yyj1329 := 0; ; yyj1329++ { - if yyhl1329 { - if yyj1329 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1329Slc = r.DecodeBytes(yys1329Slc, true, true) - yys1329 := string(yys1329Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1329 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -15887,6 +15713,383 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } + default: + z.DecStructFieldNotFound(-1, yys1304) + } // end switch yys1304 + } // end for yyj1304 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *ExportOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1309 int + var yyb1309 bool + var yyhl1309 bool = l >= 0 + yyj1309++ + if yyhl1309 { + yyb1309 = yyj1309 > l + } else { + yyb1309 = r.CheckBreak() + } + if yyb1309 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Export = false + } else { + x.Export = bool(r.DecodeBool()) + } + yyj1309++ + if yyhl1309 { + yyb1309 = yyj1309 > l + } else { + yyb1309 = r.CheckBreak() + } + if yyb1309 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Exact = false + } else { + x.Exact = bool(r.DecodeBool()) + } + yyj1309++ + if yyhl1309 { + yyb1309 = yyj1309 > l + } else { + yyb1309 = r.CheckBreak() + } + if yyb1309 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1309++ + if yyhl1309 { + yyb1309 = yyj1309 > l + } else { + yyb1309 = r.CheckBreak() + } + if yyb1309 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj1309++ + if yyhl1309 { + yyb1309 = yyj1309 > l + } else { + yyb1309 = r.CheckBreak() + } + if yyb1309 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1309-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *ListOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1314 := z.EncBinary() + _ = yym1314 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1315 := !z.EncBinary() + yy2arr1315 := z.EncBasicHandle().StructToArray + var yyq1315 [7]bool + _, _, _ = yysep1315, yyq1315, yy2arr1315 + const yyr1315 bool = false + yyq1315[0] = x.LabelSelector != "" + yyq1315[1] = x.FieldSelector != "" + yyq1315[2] = x.Watch != false + yyq1315[3] = x.ResourceVersion != "" + yyq1315[4] = x.TimeoutSeconds != nil + yyq1315[5] = x.Kind != "" + yyq1315[6] = x.APIVersion != "" + var yynn1315 int + if yyr1315 || yy2arr1315 { + r.EncodeArrayStart(7) + } else { + yynn1315 = 0 + for _, b := range yyq1315 { + if b { + yynn1315++ + } + } + r.EncodeMapStart(yynn1315) + yynn1315 = 0 + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[0] { + yym1317 := z.EncBinary() + _ = yym1317 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1315[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("labelSelector")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1318 := z.EncBinary() + _ = yym1318 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.LabelSelector)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[1] { + yym1320 := z.EncBinary() + _ = yym1320 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1315[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("fieldSelector")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1321 := z.EncBinary() + _ = yym1321 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.FieldSelector)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[2] { + yym1323 := z.EncBinary() + _ = yym1323 + if false { + } else { + r.EncodeBool(bool(x.Watch)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1315[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("watch")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1324 := z.EncBinary() + _ = yym1324 + if false { + } else { + r.EncodeBool(bool(x.Watch)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[3] { + yym1326 := z.EncBinary() + _ = yym1326 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1315[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1327 := z.EncBinary() + _ = yym1327 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[4] { + if x.TimeoutSeconds == nil { + r.EncodeNil() + } else { + yy1329 := *x.TimeoutSeconds + yym1330 := z.EncBinary() + _ = yym1330 + if false { + } else { + r.EncodeInt(int64(yy1329)) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1315[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("timeoutSeconds")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.TimeoutSeconds == nil { + r.EncodeNil() + } else { + yy1331 := *x.TimeoutSeconds + yym1332 := z.EncBinary() + _ = yym1332 + if false { + } else { + r.EncodeInt(int64(yy1331)) + } + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[5] { + yym1334 := z.EncBinary() + _ = yym1334 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1315[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1335 := z.EncBinary() + _ = yym1335 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1315[6] { + yym1337 := z.EncBinary() + _ = yym1337 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1315[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1338 := z.EncBinary() + _ = yym1338 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1315 || yy2arr1315 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *ListOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1339 := z.DecBinary() + _ = yym1339 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1340 := r.ContainerType() + if yyct1340 == codecSelferValueTypeMap1234 { + yyl1340 := r.ReadMapStart() + if yyl1340 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1340, d) + } + } else if yyct1340 == codecSelferValueTypeArray1234 { + yyl1340 := r.ReadArrayStart() + if yyl1340 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1340, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1341Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1341Slc + var yyhl1341 bool = l >= 0 + for yyj1341 := 0; ; yyj1341++ { + if yyhl1341 { + if yyj1341 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1341Slc = r.DecodeBytes(yys1341Slc, true, true) + yys1341 := string(yys1341Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1341 { case "labelSelector": if r.TryDecodeAsNil() { x.LabelSelector = "" @@ -15920,17 +16123,29 @@ func (x *ListOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.TimeoutSeconds == nil { x.TimeoutSeconds = new(int64) } - yym1337 := z.DecBinary() - _ = yym1337 + yym1347 := z.DecBinary() + _ = yym1347 if false { } else { *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) } } + 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, yys1329) - } // end switch yys1329 - } // end for yyj1329 + z.DecStructFieldNotFound(-1, yys1341) + } // end switch yys1341 + } // end for yyj1341 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -15938,48 +16153,16 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1338 int - var yyb1338 bool - var yyhl1338 bool = l >= 0 - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + var yyj1350 int + var yyb1350 bool + var yyhl1350 bool = l >= 0 + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l - } else { - yyb1338 = r.CheckBreak() - } - if yyb1338 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l - } else { - yyb1338 = r.CheckBreak() - } - if yyb1338 { + if yyb1350 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -15989,13 +16172,13 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.LabelSelector = string(r.DecodeString()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { + if yyb1350 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16005,13 +16188,13 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.FieldSelector = string(r.DecodeString()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { + if yyb1350 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16021,13 +16204,13 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Watch = bool(r.DecodeBool()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { + if yyb1350 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16037,13 +16220,13 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.ResourceVersion = string(r.DecodeString()) } - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { + if yyb1350 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16056,25 +16239,57 @@ func (x *ListOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.TimeoutSeconds == nil { x.TimeoutSeconds = new(int64) } - yym1346 := z.DecBinary() - _ = yym1346 + yym1356 := z.DecBinary() + _ = yym1356 if false { } else { *((*int64)(x.TimeoutSeconds)) = int64(r.DecodeInt(64)) } } + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l + } else { + yyb1350 = r.CheckBreak() + } + if yyb1350 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l + } else { + yyb1350 = r.CheckBreak() + } + if yyb1350 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { - yyj1338++ - if yyhl1338 { - yyb1338 = yyj1338 > l + yyj1350++ + if yyhl1350 { + yyb1350 = yyj1350 > l } else { - yyb1338 = r.CheckBreak() + yyb1350 = r.CheckBreak() } - if yyb1338 { + if yyb1350 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1338-1, "") + z.DecStructFieldNotFound(yyj1350-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16086,39 +16301,39 @@ func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1347 := z.EncBinary() - _ = yym1347 + yym1359 := z.EncBinary() + _ = yym1359 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1348 := !z.EncBinary() - yy2arr1348 := z.EncBasicHandle().StructToArray - var yyq1348 [2]bool - _, _, _ = yysep1348, yyq1348, yy2arr1348 - const yyr1348 bool = false - yyq1348[0] = len(x.MatchLabels) != 0 - yyq1348[1] = len(x.MatchExpressions) != 0 - var yynn1348 int - if yyr1348 || yy2arr1348 { + yysep1360 := !z.EncBinary() + yy2arr1360 := z.EncBasicHandle().StructToArray + var yyq1360 [2]bool + _, _, _ = yysep1360, yyq1360, yy2arr1360 + const yyr1360 bool = false + yyq1360[0] = len(x.MatchLabels) != 0 + yyq1360[1] = len(x.MatchExpressions) != 0 + var yynn1360 int + if yyr1360 || yy2arr1360 { r.EncodeArrayStart(2) } else { - yynn1348 = 0 - for _, b := range yyq1348 { + yynn1360 = 0 + for _, b := range yyq1360 { if b { - yynn1348++ + yynn1360++ } } - r.EncodeMapStart(yynn1348) - yynn1348 = 0 + r.EncodeMapStart(yynn1360) + yynn1360 = 0 } - if yyr1348 || yy2arr1348 { + if yyr1360 || yy2arr1360 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1348[0] { + if yyq1360[0] { if x.MatchLabels == nil { r.EncodeNil() } else { - yym1350 := z.EncBinary() - _ = yym1350 + yym1362 := z.EncBinary() + _ = yym1362 if false { } else { z.F.EncMapStringStringV(x.MatchLabels, false, e) @@ -16128,15 +16343,15 @@ func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1348[0] { + if yyq1360[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("matchLabels")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.MatchLabels == nil { r.EncodeNil() } else { - yym1351 := z.EncBinary() - _ = yym1351 + yym1363 := z.EncBinary() + _ = yym1363 if false { } else { z.F.EncMapStringStringV(x.MatchLabels, false, e) @@ -16144,14 +16359,14 @@ func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1348 || yy2arr1348 { + if yyr1360 || yy2arr1360 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1348[1] { + if yyq1360[1] { if x.MatchExpressions == nil { r.EncodeNil() } else { - yym1353 := z.EncBinary() - _ = yym1353 + yym1365 := z.EncBinary() + _ = yym1365 if false { } else { h.encSliceLabelSelectorRequirement(([]LabelSelectorRequirement)(x.MatchExpressions), e) @@ -16161,15 +16376,15 @@ func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1348[1] { + if yyq1360[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("matchExpressions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.MatchExpressions == nil { r.EncodeNil() } else { - yym1354 := z.EncBinary() - _ = yym1354 + yym1366 := z.EncBinary() + _ = yym1366 if false { } else { h.encSliceLabelSelectorRequirement(([]LabelSelectorRequirement)(x.MatchExpressions), e) @@ -16177,7 +16392,7 @@ func (x *LabelSelector) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1348 || yy2arr1348 { + if yyr1360 || yy2arr1360 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16190,25 +16405,25 @@ func (x *LabelSelector) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1355 := z.DecBinary() - _ = yym1355 + yym1367 := z.DecBinary() + _ = yym1367 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1356 := r.ContainerType() - if yyct1356 == codecSelferValueTypeMap1234 { - yyl1356 := r.ReadMapStart() - if yyl1356 == 0 { + yyct1368 := r.ContainerType() + if yyct1368 == codecSelferValueTypeMap1234 { + yyl1368 := r.ReadMapStart() + if yyl1368 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1356, d) + x.codecDecodeSelfFromMap(yyl1368, d) } - } else if yyct1356 == codecSelferValueTypeArray1234 { - yyl1356 := r.ReadArrayStart() - if yyl1356 == 0 { + } else if yyct1368 == codecSelferValueTypeArray1234 { + yyl1368 := r.ReadArrayStart() + if yyl1368 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1356, d) + x.codecDecodeSelfFromArray(yyl1368, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16220,12 +16435,12 @@ func (x *LabelSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1357Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1357Slc - var yyhl1357 bool = l >= 0 - for yyj1357 := 0; ; yyj1357++ { - if yyhl1357 { - if yyj1357 >= l { + var yys1369Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1369Slc + var yyhl1369 bool = l >= 0 + for yyj1369 := 0; ; yyj1369++ { + if yyhl1369 { + if yyj1369 >= l { break } } else { @@ -16234,38 +16449,38 @@ func (x *LabelSelector) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1357Slc = r.DecodeBytes(yys1357Slc, true, true) - yys1357 := string(yys1357Slc) + yys1369Slc = r.DecodeBytes(yys1369Slc, true, true) + yys1369 := string(yys1369Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1357 { + switch yys1369 { case "matchLabels": if r.TryDecodeAsNil() { x.MatchLabels = nil } else { - yyv1358 := &x.MatchLabels - yym1359 := z.DecBinary() - _ = yym1359 + yyv1370 := &x.MatchLabels + yym1371 := z.DecBinary() + _ = yym1371 if false { } else { - z.F.DecMapStringStringX(yyv1358, false, d) + z.F.DecMapStringStringX(yyv1370, false, d) } } case "matchExpressions": if r.TryDecodeAsNil() { x.MatchExpressions = nil } else { - yyv1360 := &x.MatchExpressions - yym1361 := z.DecBinary() - _ = yym1361 + yyv1372 := &x.MatchExpressions + yym1373 := z.DecBinary() + _ = yym1373 if false { } else { - h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1360), d) + h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1372), d) } } default: - z.DecStructFieldNotFound(-1, yys1357) - } // end switch yys1357 - } // end for yyj1357 + z.DecStructFieldNotFound(-1, yys1369) + } // end switch yys1369 + } // end for yyj1369 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16273,16 +16488,16 @@ func (x *LabelSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1362 int - var yyb1362 bool - var yyhl1362 bool = l >= 0 - yyj1362++ - if yyhl1362 { - yyb1362 = yyj1362 > l + var yyj1374 int + var yyb1374 bool + var yyhl1374 bool = l >= 0 + yyj1374++ + if yyhl1374 { + yyb1374 = yyj1374 > l } else { - yyb1362 = r.CheckBreak() + yyb1374 = r.CheckBreak() } - if yyb1362 { + if yyb1374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16290,21 +16505,21 @@ func (x *LabelSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.MatchLabels = nil } else { - yyv1363 := &x.MatchLabels - yym1364 := z.DecBinary() - _ = yym1364 + yyv1375 := &x.MatchLabels + yym1376 := z.DecBinary() + _ = yym1376 if false { } else { - z.F.DecMapStringStringX(yyv1363, false, d) + z.F.DecMapStringStringX(yyv1375, false, d) } } - yyj1362++ - if yyhl1362 { - yyb1362 = yyj1362 > l + yyj1374++ + if yyhl1374 { + yyb1374 = yyj1374 > l } else { - yyb1362 = r.CheckBreak() + yyb1374 = r.CheckBreak() } - if yyb1362 { + if yyb1374 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16312,26 +16527,26 @@ func (x *LabelSelector) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.MatchExpressions = nil } else { - yyv1365 := &x.MatchExpressions - yym1366 := z.DecBinary() - _ = yym1366 + yyv1377 := &x.MatchExpressions + yym1378 := z.DecBinary() + _ = yym1378 if false { } else { - h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1365), d) + h.decSliceLabelSelectorRequirement((*[]LabelSelectorRequirement)(yyv1377), d) } } for { - yyj1362++ - if yyhl1362 { - yyb1362 = yyj1362 > l + yyj1374++ + if yyhl1374 { + yyb1374 = yyj1374 > l } else { - yyb1362 = r.CheckBreak() + yyb1374 = r.CheckBreak() } - if yyb1362 { + if yyb1374 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1362-1, "") + z.DecStructFieldNotFound(yyj1374-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16343,34 +16558,34 @@ func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1367 := z.EncBinary() - _ = yym1367 + yym1379 := z.EncBinary() + _ = yym1379 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1368 := !z.EncBinary() - yy2arr1368 := z.EncBasicHandle().StructToArray - var yyq1368 [3]bool - _, _, _ = yysep1368, yyq1368, yy2arr1368 - const yyr1368 bool = false - yyq1368[2] = len(x.Values) != 0 - var yynn1368 int - if yyr1368 || yy2arr1368 { + yysep1380 := !z.EncBinary() + yy2arr1380 := z.EncBasicHandle().StructToArray + var yyq1380 [3]bool + _, _, _ = yysep1380, yyq1380, yy2arr1380 + const yyr1380 bool = false + yyq1380[2] = len(x.Values) != 0 + var yynn1380 int + if yyr1380 || yy2arr1380 { r.EncodeArrayStart(3) } else { - yynn1368 = 2 - for _, b := range yyq1368 { + yynn1380 = 2 + for _, b := range yyq1380 { if b { - yynn1368++ + yynn1380++ } } - r.EncodeMapStart(yynn1368) - yynn1368 = 0 + r.EncodeMapStart(yynn1380) + yynn1380 = 0 } - if yyr1368 || yy2arr1368 { + if yyr1380 || yy2arr1380 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1370 := z.EncBinary() - _ = yym1370 + yym1382 := z.EncBinary() + _ = yym1382 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) @@ -16379,14 +16594,14 @@ func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("key")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1371 := z.EncBinary() - _ = yym1371 + yym1383 := z.EncBinary() + _ = yym1383 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) } } - if yyr1368 || yy2arr1368 { + if yyr1380 || yy2arr1380 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) x.Operator.CodecEncodeSelf(e) } else { @@ -16395,14 +16610,14 @@ func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapValue1234) x.Operator.CodecEncodeSelf(e) } - if yyr1368 || yy2arr1368 { + if yyr1380 || yy2arr1380 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1368[2] { + if yyq1380[2] { if x.Values == nil { r.EncodeNil() } else { - yym1374 := z.EncBinary() - _ = yym1374 + yym1386 := z.EncBinary() + _ = yym1386 if false { } else { z.F.EncSliceStringV(x.Values, false, e) @@ -16412,15 +16627,15 @@ func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1368[2] { + if yyq1380[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("values")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Values == nil { r.EncodeNil() } else { - yym1375 := z.EncBinary() - _ = yym1375 + yym1387 := z.EncBinary() + _ = yym1387 if false { } else { z.F.EncSliceStringV(x.Values, false, e) @@ -16428,7 +16643,7 @@ func (x *LabelSelectorRequirement) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1368 || yy2arr1368 { + if yyr1380 || yy2arr1380 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16441,25 +16656,25 @@ func (x *LabelSelectorRequirement) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1376 := z.DecBinary() - _ = yym1376 + yym1388 := z.DecBinary() + _ = yym1388 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1377 := r.ContainerType() - if yyct1377 == codecSelferValueTypeMap1234 { - yyl1377 := r.ReadMapStart() - if yyl1377 == 0 { + yyct1389 := r.ContainerType() + if yyct1389 == codecSelferValueTypeMap1234 { + yyl1389 := r.ReadMapStart() + if yyl1389 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1377, d) + x.codecDecodeSelfFromMap(yyl1389, d) } - } else if yyct1377 == codecSelferValueTypeArray1234 { - yyl1377 := r.ReadArrayStart() - if yyl1377 == 0 { + } else if yyct1389 == codecSelferValueTypeArray1234 { + yyl1389 := r.ReadArrayStart() + if yyl1389 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1377, d) + x.codecDecodeSelfFromArray(yyl1389, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16471,12 +16686,12 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.De var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1378Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1378Slc - var yyhl1378 bool = l >= 0 - for yyj1378 := 0; ; yyj1378++ { - if yyhl1378 { - if yyj1378 >= l { + var yys1390Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1390Slc + var yyhl1390 bool = l >= 0 + for yyj1390 := 0; ; yyj1390++ { + if yyhl1390 { + if yyj1390 >= l { break } } else { @@ -16485,10 +16700,10 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.De } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1378Slc = r.DecodeBytes(yys1378Slc, true, true) - yys1378 := string(yys1378Slc) + yys1390Slc = r.DecodeBytes(yys1390Slc, true, true) + yys1390 := string(yys1390Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1378 { + switch yys1390 { case "key": if r.TryDecodeAsNil() { x.Key = "" @@ -16505,18 +16720,18 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromMap(l int, d *codec1978.De if r.TryDecodeAsNil() { x.Values = nil } else { - yyv1381 := &x.Values - yym1382 := z.DecBinary() - _ = yym1382 + yyv1393 := &x.Values + yym1394 := z.DecBinary() + _ = yym1394 if false { } else { - z.F.DecSliceStringX(yyv1381, false, d) + z.F.DecSliceStringX(yyv1393, false, d) } } default: - z.DecStructFieldNotFound(-1, yys1378) - } // end switch yys1378 - } // end for yyj1378 + z.DecStructFieldNotFound(-1, yys1390) + } // end switch yys1390 + } // end for yyj1390 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16524,16 +16739,16 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978. var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1383 int - var yyb1383 bool - var yyhl1383 bool = l >= 0 - yyj1383++ - if yyhl1383 { - yyb1383 = yyj1383 > l + var yyj1395 int + var yyb1395 bool + var yyhl1395 bool = l >= 0 + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1383 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1383 { + if yyb1395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16543,13 +16758,13 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Key = string(r.DecodeString()) } - yyj1383++ - if yyhl1383 { - yyb1383 = yyj1383 > l + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1383 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1383 { + if yyb1395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16559,13 +16774,13 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978. } else { x.Operator = LabelSelectorOperator(r.DecodeString()) } - yyj1383++ - if yyhl1383 { - yyb1383 = yyj1383 > l + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1383 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1383 { + if yyb1395 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16573,26 +16788,26 @@ func (x *LabelSelectorRequirement) codecDecodeSelfFromArray(l int, d *codec1978. if r.TryDecodeAsNil() { x.Values = nil } else { - yyv1386 := &x.Values - yym1387 := z.DecBinary() - _ = yym1387 + yyv1398 := &x.Values + yym1399 := z.DecBinary() + _ = yym1399 if false { } else { - z.F.DecSliceStringX(yyv1386, false, d) + z.F.DecSliceStringX(yyv1398, false, d) } } for { - yyj1383++ - if yyhl1383 { - yyb1383 = yyj1383 > l + yyj1395++ + if yyhl1395 { + yyb1395 = yyj1395 > l } else { - yyb1383 = r.CheckBreak() + yyb1395 = r.CheckBreak() } - if yyb1383 { + if yyb1395 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1383-1, "") + z.DecStructFieldNotFound(yyj1395-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16601,8 +16816,8 @@ func (x LabelSelectorOperator) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - yym1388 := z.EncBinary() - _ = yym1388 + yym1400 := z.EncBinary() + _ = yym1400 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { @@ -16614,8 +16829,8 @@ func (x *LabelSelectorOperator) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1389 := z.DecBinary() - _ = yym1389 + yym1401 := z.DecBinary() + _ = yym1401 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { @@ -16630,136 +16845,136 @@ func (x *ReplicaSet) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1390 := z.EncBinary() - _ = yym1390 + yym1402 := z.EncBinary() + _ = yym1402 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1391 := !z.EncBinary() - yy2arr1391 := z.EncBasicHandle().StructToArray - var yyq1391 [5]bool - _, _, _ = yysep1391, yyq1391, yy2arr1391 - const yyr1391 bool = false - yyq1391[0] = x.Kind != "" - yyq1391[1] = x.APIVersion != "" - yyq1391[2] = true - yyq1391[3] = true - yyq1391[4] = true - var yynn1391 int - if yyr1391 || yy2arr1391 { + yysep1403 := !z.EncBinary() + yy2arr1403 := z.EncBasicHandle().StructToArray + var yyq1403 [5]bool + _, _, _ = yysep1403, yyq1403, yy2arr1403 + const yyr1403 bool = false + yyq1403[0] = true + yyq1403[1] = true + yyq1403[2] = true + yyq1403[3] = x.Kind != "" + yyq1403[4] = x.APIVersion != "" + var yynn1403 int + if yyr1403 || yy2arr1403 { r.EncodeArrayStart(5) } else { - yynn1391 = 0 - for _, b := range yyq1391 { + yynn1403 = 0 + for _, b := range yyq1403 { if b { - yynn1391++ + yynn1403++ } } - r.EncodeMapStart(yynn1391) - yynn1391 = 0 + r.EncodeMapStart(yynn1403) + yynn1403 = 0 } - if yyr1391 || yy2arr1391 { + if yyr1403 || yy2arr1403 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1391[0] { - yym1393 := z.EncBinary() - _ = yym1393 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1391[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1394 := z.EncBinary() - _ = yym1394 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1391 || yy2arr1391 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1391[1] { - yym1396 := z.EncBinary() - _ = yym1396 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1391[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1397 := z.EncBinary() - _ = yym1397 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1391 || yy2arr1391 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1391[2] { - yy1399 := &x.ObjectMeta - yy1399.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1391[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1400 := &x.ObjectMeta - yy1400.CodecEncodeSelf(e) - } - } - if yyr1391 || yy2arr1391 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1391[3] { - yy1402 := &x.Spec - yy1402.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq1391[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1403 := &x.Spec - yy1403.CodecEncodeSelf(e) - } - } - if yyr1391 || yy2arr1391 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1391[4] { - yy1405 := &x.Status + if yyq1403[0] { + yy1405 := &x.ObjectMeta yy1405.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq1391[4] { + if yyq1403[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1406 := &x.Status + yy1406 := &x.ObjectMeta yy1406.CodecEncodeSelf(e) } } - if yyr1391 || yy2arr1391 { + if yyr1403 || yy2arr1403 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1403[1] { + yy1408 := &x.Spec + yy1408.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1403[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1409 := &x.Spec + yy1409.CodecEncodeSelf(e) + } + } + if yyr1403 || yy2arr1403 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1403[2] { + yy1411 := &x.Status + yy1411.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1403[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("status")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1412 := &x.Status + yy1412.CodecEncodeSelf(e) + } + } + if yyr1403 || yy2arr1403 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1403[3] { + yym1414 := z.EncBinary() + _ = yym1414 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1403[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1415 := z.EncBinary() + _ = yym1415 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1403 || yy2arr1403 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1403[4] { + yym1417 := z.EncBinary() + _ = yym1417 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1403[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1418 := z.EncBinary() + _ = yym1418 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1403 || yy2arr1403 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -16772,25 +16987,25 @@ func (x *ReplicaSet) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1407 := z.DecBinary() - _ = yym1407 + yym1419 := z.DecBinary() + _ = yym1419 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1408 := r.ContainerType() - if yyct1408 == codecSelferValueTypeMap1234 { - yyl1408 := r.ReadMapStart() - if yyl1408 == 0 { + yyct1420 := r.ContainerType() + if yyct1420 == codecSelferValueTypeMap1234 { + yyl1420 := r.ReadMapStart() + if yyl1420 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1408, d) + x.codecDecodeSelfFromMap(yyl1420, d) } - } else if yyct1408 == codecSelferValueTypeArray1234 { - yyl1408 := r.ReadArrayStart() - if yyl1408 == 0 { + } else if yyct1420 == codecSelferValueTypeArray1234 { + yyl1420 := r.ReadArrayStart() + if yyl1420 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1408, d) + x.codecDecodeSelfFromArray(yyl1420, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -16802,12 +17017,12 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1409Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1409Slc - var yyhl1409 bool = l >= 0 - for yyj1409 := 0; ; yyj1409++ { - if yyhl1409 { - if yyj1409 >= l { + var yys1421Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1421Slc + var yyhl1421 bool = l >= 0 + for yyj1421 := 0; ; yyj1421++ { + if yyhl1421 { + if yyj1421 >= l { break } } else { @@ -16816,10 +17031,31 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1409Slc = r.DecodeBytes(yys1409Slc, true, true) - yys1409 := string(yys1409Slc) + yys1421Slc = r.DecodeBytes(yys1421Slc, true, true) + yys1421 := string(yys1421Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1409 { + switch yys1421 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1422 := &x.ObjectMeta + yyv1422.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = ReplicaSetSpec{} + } else { + yyv1423 := &x.Spec + yyv1423.CodecDecodeSelf(d) + } + case "status": + if r.TryDecodeAsNil() { + x.Status = ReplicaSetStatus{} + } else { + yyv1424 := &x.Status + yyv1424.CodecDecodeSelf(d) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -16832,31 +17068,10 @@ func (x *ReplicaSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1412 := &x.ObjectMeta - yyv1412.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ReplicaSetSpec{} - } else { - yyv1413 := &x.Spec - yyv1413.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ReplicaSetStatus{} - } else { - yyv1414 := &x.Status - yyv1414.CodecDecodeSelf(d) - } default: - z.DecStructFieldNotFound(-1, yys1409) - } // end switch yys1409 - } // end for yyj1409 + z.DecStructFieldNotFound(-1, yys1421) + } // end switch yys1421 + } // end for yyj1421 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -16864,16 +17079,67 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1415 int - var yyb1415 bool - var yyhl1415 bool = l >= 0 - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l + var yyj1427 int + var yyb1427 bool + var yyhl1427 bool = l >= 0 + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l } else { - yyb1415 = r.CheckBreak() + yyb1427 = r.CheckBreak() } - if yyb1415 { + if yyb1427 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1428 := &x.ObjectMeta + yyv1428.CodecDecodeSelf(d) + } + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l + } else { + yyb1427 = r.CheckBreak() + } + if yyb1427 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = ReplicaSetSpec{} + } else { + yyv1429 := &x.Spec + yyv1429.CodecDecodeSelf(d) + } + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l + } else { + yyb1427 = r.CheckBreak() + } + if yyb1427 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Status = ReplicaSetStatus{} + } else { + yyv1430 := &x.Status + yyv1430.CodecDecodeSelf(d) + } + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l + } else { + yyb1427 = r.CheckBreak() + } + if yyb1427 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16883,13 +17149,13 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l } else { - yyb1415 = r.CheckBreak() + yyb1427 = r.CheckBreak() } - if yyb1415 { + if yyb1427 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -16899,69 +17165,18 @@ func (x *ReplicaSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l - } else { - yyb1415 = r.CheckBreak() - } - if yyb1415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv1418 := &x.ObjectMeta - yyv1418.CodecDecodeSelf(d) - } - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l - } else { - yyb1415 = r.CheckBreak() - } - if yyb1415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ReplicaSetSpec{} - } else { - yyv1419 := &x.Spec - yyv1419.CodecDecodeSelf(d) - } - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l - } else { - yyb1415 = r.CheckBreak() - } - if yyb1415 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ReplicaSetStatus{} - } else { - yyv1420 := &x.Status - yyv1420.CodecDecodeSelf(d) - } for { - yyj1415++ - if yyhl1415 { - yyb1415 = yyj1415 > l + yyj1427++ + if yyhl1427 { + yyb1427 = yyj1427 > l } else { - yyb1415 = r.CheckBreak() + yyb1427 = r.CheckBreak() } - if yyb1415 { + if yyb1427 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1415-1, "") + z.DecStructFieldNotFound(yyj1427-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -16973,118 +17188,68 @@ func (x *ReplicaSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1421 := z.EncBinary() - _ = yym1421 + yym1433 := z.EncBinary() + _ = yym1433 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1422 := !z.EncBinary() - yy2arr1422 := z.EncBasicHandle().StructToArray - var yyq1422 [4]bool - _, _, _ = yysep1422, yyq1422, yy2arr1422 - const yyr1422 bool = false - yyq1422[0] = x.Kind != "" - yyq1422[1] = x.APIVersion != "" - yyq1422[2] = true - var yynn1422 int - if yyr1422 || yy2arr1422 { + yysep1434 := !z.EncBinary() + yy2arr1434 := z.EncBasicHandle().StructToArray + var yyq1434 [4]bool + _, _, _ = yysep1434, yyq1434, yy2arr1434 + const yyr1434 bool = false + yyq1434[0] = true + yyq1434[2] = x.Kind != "" + yyq1434[3] = x.APIVersion != "" + var yynn1434 int + if yyr1434 || yy2arr1434 { r.EncodeArrayStart(4) } else { - yynn1422 = 1 - for _, b := range yyq1422 { + yynn1434 = 1 + for _, b := range yyq1434 { if b { - yynn1422++ + yynn1434++ } } - r.EncodeMapStart(yynn1422) - yynn1422 = 0 + r.EncodeMapStart(yynn1434) + yynn1434 = 0 } - if yyr1422 || yy2arr1422 { + if yyr1434 || yy2arr1434 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1422[0] { - yym1424 := z.EncBinary() - _ = yym1424 + if yyq1434[0] { + yy1436 := &x.ListMeta + yym1437 := z.EncBinary() + _ = yym1437 if false { + } else if z.HasExtensions() && z.EncExt(yy1436) { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1422[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1425 := z.EncBinary() - _ = yym1425 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr1422 || yy2arr1422 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1422[1] { - yym1427 := z.EncBinary() - _ = yym1427 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq1422[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1428 := z.EncBinary() - _ = yym1428 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr1422 || yy2arr1422 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1422[2] { - yy1430 := &x.ListMeta - yym1431 := z.EncBinary() - _ = yym1431 - if false { - } else if z.HasExtensions() && z.EncExt(yy1430) { - } else { - z.EncFallback(yy1430) + z.EncFallback(yy1436) } } else { r.EncodeNil() } } else { - if yyq1422[2] { + if yyq1434[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy1432 := &x.ListMeta - yym1433 := z.EncBinary() - _ = yym1433 + yy1438 := &x.ListMeta + yym1439 := z.EncBinary() + _ = yym1439 if false { - } else if z.HasExtensions() && z.EncExt(yy1432) { + } else if z.HasExtensions() && z.EncExt(yy1438) { } else { - z.EncFallback(yy1432) + z.EncFallback(yy1438) } } } - if yyr1422 || yy2arr1422 { + if yyr1434 || yy2arr1434 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym1435 := z.EncBinary() - _ = yym1435 + yym1441 := z.EncBinary() + _ = yym1441 if false { } else { h.encSliceReplicaSet(([]ReplicaSet)(x.Items), e) @@ -17097,15 +17262,65 @@ func (x *ReplicaSetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym1436 := z.EncBinary() - _ = yym1436 + yym1442 := z.EncBinary() + _ = yym1442 if false { } else { h.encSliceReplicaSet(([]ReplicaSet)(x.Items), e) } } } - if yyr1422 || yy2arr1422 { + if yyr1434 || yy2arr1434 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1434[2] { + yym1444 := z.EncBinary() + _ = yym1444 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1434[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1445 := z.EncBinary() + _ = yym1445 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1434 || yy2arr1434 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1434[3] { + yym1447 := z.EncBinary() + _ = yym1447 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1434[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1448 := z.EncBinary() + _ = yym1448 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1434 || yy2arr1434 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17118,25 +17333,25 @@ func (x *ReplicaSetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1437 := z.DecBinary() - _ = yym1437 + yym1449 := z.DecBinary() + _ = yym1449 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1438 := r.ContainerType() - if yyct1438 == codecSelferValueTypeMap1234 { - yyl1438 := r.ReadMapStart() - if yyl1438 == 0 { + yyct1450 := r.ContainerType() + if yyct1450 == codecSelferValueTypeMap1234 { + yyl1450 := r.ReadMapStart() + if yyl1450 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1438, d) + x.codecDecodeSelfFromMap(yyl1450, d) } - } else if yyct1438 == codecSelferValueTypeArray1234 { - yyl1438 := r.ReadArrayStart() - if yyl1438 == 0 { + } else if yyct1450 == codecSelferValueTypeArray1234 { + yyl1450 := r.ReadArrayStart() + if yyl1450 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1438, d) + x.codecDecodeSelfFromArray(yyl1450, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17148,12 +17363,12 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1439Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1439Slc - var yyhl1439 bool = l >= 0 - for yyj1439 := 0; ; yyj1439++ { - if yyhl1439 { - if yyj1439 >= l { + var yys1451Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1451Slc + var yyhl1451 bool = l >= 0 + for yyj1451 := 0; ; yyj1451++ { + if yyhl1451 { + if yyj1451 >= l { break } } else { @@ -17162,10 +17377,35 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1439Slc = r.DecodeBytes(yys1439Slc, true, true) - yys1439 := string(yys1439Slc) + yys1451Slc = r.DecodeBytes(yys1451Slc, true, true) + yys1451 := string(yys1451Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1439 { + switch yys1451 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1452 := &x.ListMeta + yym1453 := z.DecBinary() + _ = yym1453 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1452) { + } else { + z.DecFallback(yyv1452, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1454 := &x.Items + yym1455 := z.DecBinary() + _ = yym1455 + if false { + } else { + h.decSliceReplicaSet((*[]ReplicaSet)(yyv1454), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -17178,35 +17418,10 @@ func (x *ReplicaSetList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1442 := &x.ListMeta - yym1443 := z.DecBinary() - _ = yym1443 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1442) { - } else { - z.DecFallback(yyv1442, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1444 := &x.Items - yym1445 := z.DecBinary() - _ = yym1445 - if false { - } else { - h.decSliceReplicaSet((*[]ReplicaSet)(yyv1444), d) - } - } default: - z.DecStructFieldNotFound(-1, yys1439) - } // end switch yys1439 - } // end for yyj1439 + z.DecStructFieldNotFound(-1, yys1451) + } // end switch yys1451 + } // end for yyj1451 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17214,16 +17429,61 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1446 int - var yyb1446 bool - var yyhl1446 bool = l >= 0 - yyj1446++ - if yyhl1446 { - yyb1446 = yyj1446 > l + var yyj1458 int + var yyb1458 bool + var yyhl1458 bool = l >= 0 + yyj1458++ + if yyhl1458 { + yyb1458 = yyj1458 > l } else { - yyb1446 = r.CheckBreak() + yyb1458 = r.CheckBreak() } - if yyb1446 { + if yyb1458 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1459 := &x.ListMeta + yym1460 := z.DecBinary() + _ = yym1460 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1459) { + } else { + z.DecFallback(yyv1459, false) + } + } + yyj1458++ + if yyhl1458 { + yyb1458 = yyj1458 > l + } else { + yyb1458 = r.CheckBreak() + } + if yyb1458 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1461 := &x.Items + yym1462 := z.DecBinary() + _ = yym1462 + if false { + } else { + h.decSliceReplicaSet((*[]ReplicaSet)(yyv1461), d) + } + } + yyj1458++ + if yyhl1458 { + yyb1458 = yyj1458 > l + } else { + yyb1458 = r.CheckBreak() + } + if yyb1458 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17233,13 +17493,13 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj1446++ - if yyhl1446 { - yyb1446 = yyj1446 > l + yyj1458++ + if yyhl1458 { + yyb1458 = yyj1458 > l } else { - yyb1446 = r.CheckBreak() + yyb1458 = r.CheckBreak() } - if yyb1446 { + if yyb1458 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17249,63 +17509,18 @@ func (x *ReplicaSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj1446++ - if yyhl1446 { - yyb1446 = yyj1446 > l - } else { - yyb1446 = r.CheckBreak() - } - if yyb1446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv1449 := &x.ListMeta - yym1450 := z.DecBinary() - _ = yym1450 - if false { - } else if z.HasExtensions() && z.DecExt(yyv1449) { - } else { - z.DecFallback(yyv1449, false) - } - } - yyj1446++ - if yyhl1446 { - yyb1446 = yyj1446 > l - } else { - yyb1446 = r.CheckBreak() - } - if yyb1446 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv1451 := &x.Items - yym1452 := z.DecBinary() - _ = yym1452 - if false { - } else { - h.decSliceReplicaSet((*[]ReplicaSet)(yyv1451), d) - } - } for { - yyj1446++ - if yyhl1446 { - yyb1446 = yyj1446 > l + yyj1458++ + if yyhl1458 { + yyb1458 = yyj1458 > l } else { - yyb1446 = r.CheckBreak() + yyb1458 = r.CheckBreak() } - if yyb1446 { + if yyb1458 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1446-1, "") + z.DecStructFieldNotFound(yyj1458-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17317,70 +17532,70 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1453 := z.EncBinary() - _ = yym1453 + yym1465 := z.EncBinary() + _ = yym1465 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1454 := !z.EncBinary() - yy2arr1454 := z.EncBasicHandle().StructToArray - var yyq1454 [3]bool - _, _, _ = yysep1454, yyq1454, yy2arr1454 - const yyr1454 bool = false - yyq1454[0] = x.Replicas != nil - yyq1454[1] = x.Selector != nil - yyq1454[2] = x.Template != nil - var yynn1454 int - if yyr1454 || yy2arr1454 { + yysep1466 := !z.EncBinary() + yy2arr1466 := z.EncBasicHandle().StructToArray + var yyq1466 [3]bool + _, _, _ = yysep1466, yyq1466, yy2arr1466 + const yyr1466 bool = false + yyq1466[0] = x.Replicas != nil + yyq1466[1] = x.Selector != nil + yyq1466[2] = x.Template != nil + var yynn1466 int + if yyr1466 || yy2arr1466 { r.EncodeArrayStart(3) } else { - yynn1454 = 0 - for _, b := range yyq1454 { + yynn1466 = 0 + for _, b := range yyq1466 { if b { - yynn1454++ + yynn1466++ } } - r.EncodeMapStart(yynn1454) - yynn1454 = 0 + r.EncodeMapStart(yynn1466) + yynn1466 = 0 } - if yyr1454 || yy2arr1454 { + if yyr1466 || yy2arr1466 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1454[0] { + if yyq1466[0] { if x.Replicas == nil { r.EncodeNil() } else { - yy1456 := *x.Replicas - yym1457 := z.EncBinary() - _ = yym1457 + yy1468 := *x.Replicas + yym1469 := z.EncBinary() + _ = yym1469 if false { } else { - r.EncodeInt(int64(yy1456)) + r.EncodeInt(int64(yy1468)) } } } else { r.EncodeNil() } } else { - if yyq1454[0] { + if yyq1466[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Replicas == nil { r.EncodeNil() } else { - yy1458 := *x.Replicas - yym1459 := z.EncBinary() - _ = yym1459 + yy1470 := *x.Replicas + yym1471 := z.EncBinary() + _ = yym1471 if false { } else { - r.EncodeInt(int64(yy1458)) + r.EncodeInt(int64(yy1470)) } } } } - if yyr1454 || yy2arr1454 { + if yyr1466 || yy2arr1466 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1454[1] { + if yyq1466[1] { if x.Selector == nil { r.EncodeNil() } else { @@ -17390,7 +17605,7 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1454[1] { + if yyq1466[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("selector")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17401,9 +17616,9 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1454 || yy2arr1454 { + if yyr1466 || yy2arr1466 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1454[2] { + if yyq1466[2] { if x.Template == nil { r.EncodeNil() } else { @@ -17413,7 +17628,7 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq1454[2] { + if yyq1466[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("template")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -17424,7 +17639,7 @@ func (x *ReplicaSetSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr1454 || yy2arr1454 { + if yyr1466 || yy2arr1466 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17437,25 +17652,25 @@ func (x *ReplicaSetSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1462 := z.DecBinary() - _ = yym1462 + yym1474 := z.DecBinary() + _ = yym1474 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1463 := r.ContainerType() - if yyct1463 == codecSelferValueTypeMap1234 { - yyl1463 := r.ReadMapStart() - if yyl1463 == 0 { + yyct1475 := r.ContainerType() + if yyct1475 == codecSelferValueTypeMap1234 { + yyl1475 := r.ReadMapStart() + if yyl1475 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1463, d) + x.codecDecodeSelfFromMap(yyl1475, d) } - } else if yyct1463 == codecSelferValueTypeArray1234 { - yyl1463 := r.ReadArrayStart() - if yyl1463 == 0 { + } else if yyct1475 == codecSelferValueTypeArray1234 { + yyl1475 := r.ReadArrayStart() + if yyl1475 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1463, d) + x.codecDecodeSelfFromArray(yyl1475, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17467,12 +17682,12 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1464Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1464Slc - var yyhl1464 bool = l >= 0 - for yyj1464 := 0; ; yyj1464++ { - if yyhl1464 { - if yyj1464 >= l { + var yys1476Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1476Slc + var yyhl1476 bool = l >= 0 + for yyj1476 := 0; ; yyj1476++ { + if yyhl1476 { + if yyj1476 >= l { break } } else { @@ -17481,10 +17696,10 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1464Slc = r.DecodeBytes(yys1464Slc, true, true) - yys1464 := string(yys1464Slc) + yys1476Slc = r.DecodeBytes(yys1476Slc, true, true) + yys1476 := string(yys1476Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1464 { + switch yys1476 { case "replicas": if r.TryDecodeAsNil() { if x.Replicas != nil { @@ -17494,8 +17709,8 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Replicas == nil { x.Replicas = new(int32) } - yym1466 := z.DecBinary() - _ = yym1466 + yym1478 := z.DecBinary() + _ = yym1478 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) @@ -17524,9 +17739,9 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.Template.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys1464) - } // end switch yys1464 - } // end for yyj1464 + z.DecStructFieldNotFound(-1, yys1476) + } // end switch yys1476 + } // end for yyj1476 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17534,16 +17749,16 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1469 int - var yyb1469 bool - var yyhl1469 bool = l >= 0 - yyj1469++ - if yyhl1469 { - yyb1469 = yyj1469 > l + var yyj1481 int + var yyb1481 bool + var yyhl1481 bool = l >= 0 + yyj1481++ + if yyhl1481 { + yyb1481 = yyj1481 > l } else { - yyb1469 = r.CheckBreak() + yyb1481 = r.CheckBreak() } - if yyb1469 { + if yyb1481 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17556,20 +17771,20 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Replicas == nil { x.Replicas = new(int32) } - yym1471 := z.DecBinary() - _ = yym1471 + yym1483 := z.DecBinary() + _ = yym1483 if false { } else { *((*int32)(x.Replicas)) = int32(r.DecodeInt(32)) } } - yyj1469++ - if yyhl1469 { - yyb1469 = yyj1469 > l + yyj1481++ + if yyhl1481 { + yyb1481 = yyj1481 > l } else { - yyb1469 = r.CheckBreak() + yyb1481 = r.CheckBreak() } - if yyb1469 { + if yyb1481 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17584,13 +17799,13 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Selector.CodecDecodeSelf(d) } - yyj1469++ - if yyhl1469 { - yyb1469 = yyj1469 > l + yyj1481++ + if yyhl1481 { + yyb1481 = yyj1481 > l } else { - yyb1469 = r.CheckBreak() + yyb1481 = r.CheckBreak() } - if yyb1469 { + if yyb1481 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17606,17 +17821,17 @@ func (x *ReplicaSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.Template.CodecDecodeSelf(d) } for { - yyj1469++ - if yyhl1469 { - yyb1469 = yyj1469 > l + yyj1481++ + if yyhl1481 { + yyb1481 = yyj1481 > l } else { - yyb1469 = r.CheckBreak() + yyb1481 = r.CheckBreak() } - if yyb1469 { + if yyb1481 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1469-1, "") + z.DecStructFieldNotFound(yyj1481-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17628,34 +17843,34 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym1474 := z.EncBinary() - _ = yym1474 + yym1486 := z.EncBinary() + _ = yym1486 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep1475 := !z.EncBinary() - yy2arr1475 := z.EncBasicHandle().StructToArray - var yyq1475 [2]bool - _, _, _ = yysep1475, yyq1475, yy2arr1475 - const yyr1475 bool = false - yyq1475[1] = x.ObservedGeneration != 0 - var yynn1475 int - if yyr1475 || yy2arr1475 { + yysep1487 := !z.EncBinary() + yy2arr1487 := z.EncBasicHandle().StructToArray + var yyq1487 [2]bool + _, _, _ = yysep1487, yyq1487, yy2arr1487 + const yyr1487 bool = false + yyq1487[1] = x.ObservedGeneration != 0 + var yynn1487 int + if yyr1487 || yy2arr1487 { r.EncodeArrayStart(2) } else { - yynn1475 = 1 - for _, b := range yyq1475 { + yynn1487 = 1 + for _, b := range yyq1487 { if b { - yynn1475++ + yynn1487++ } } - r.EncodeMapStart(yynn1475) - yynn1475 = 0 + r.EncodeMapStart(yynn1487) + yynn1487 = 0 } - if yyr1475 || yy2arr1475 { + if yyr1487 || yy2arr1487 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym1477 := z.EncBinary() - _ = yym1477 + yym1489 := z.EncBinary() + _ = yym1489 if false { } else { r.EncodeInt(int64(x.Replicas)) @@ -17664,18 +17879,18 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("replicas")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1478 := z.EncBinary() - _ = yym1478 + yym1490 := z.EncBinary() + _ = yym1490 if false { } else { r.EncodeInt(int64(x.Replicas)) } } - if yyr1475 || yy2arr1475 { + if yyr1487 || yy2arr1487 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq1475[1] { - yym1480 := z.EncBinary() - _ = yym1480 + if yyq1487[1] { + yym1492 := z.EncBinary() + _ = yym1492 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) @@ -17684,19 +17899,19 @@ func (x *ReplicaSetStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(0) } } else { - if yyq1475[1] { + if yyq1487[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("observedGeneration")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym1481 := z.EncBinary() - _ = yym1481 + yym1493 := z.EncBinary() + _ = yym1493 if false { } else { r.EncodeInt(int64(x.ObservedGeneration)) } } } - if yyr1475 || yy2arr1475 { + if yyr1487 || yy2arr1487 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -17709,25 +17924,25 @@ func (x *ReplicaSetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym1482 := z.DecBinary() - _ = yym1482 + yym1494 := z.DecBinary() + _ = yym1494 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct1483 := r.ContainerType() - if yyct1483 == codecSelferValueTypeMap1234 { - yyl1483 := r.ReadMapStart() - if yyl1483 == 0 { + yyct1495 := r.ContainerType() + if yyct1495 == codecSelferValueTypeMap1234 { + yyl1495 := r.ReadMapStart() + if yyl1495 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl1483, d) + x.codecDecodeSelfFromMap(yyl1495, d) } - } else if yyct1483 == codecSelferValueTypeArray1234 { - yyl1483 := r.ReadArrayStart() - if yyl1483 == 0 { + } else if yyct1495 == codecSelferValueTypeArray1234 { + yyl1495 := r.ReadArrayStart() + if yyl1495 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl1483, d) + x.codecDecodeSelfFromArray(yyl1495, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -17739,12 +17954,12 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys1484Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys1484Slc - var yyhl1484 bool = l >= 0 - for yyj1484 := 0; ; yyj1484++ { - if yyhl1484 { - if yyj1484 >= l { + var yys1496Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1496Slc + var yyhl1496 bool = l >= 0 + for yyj1496 := 0; ; yyj1496++ { + if yyhl1496 { + if yyj1496 >= l { break } } else { @@ -17753,10 +17968,10 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys1484Slc = r.DecodeBytes(yys1484Slc, true, true) - yys1484 := string(yys1484Slc) + yys1496Slc = r.DecodeBytes(yys1496Slc, true, true) + yys1496 := string(yys1496Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys1484 { + switch yys1496 { case "replicas": if r.TryDecodeAsNil() { x.Replicas = 0 @@ -17770,9 +17985,9 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.ObservedGeneration = int64(r.DecodeInt(64)) } default: - z.DecStructFieldNotFound(-1, yys1484) - } // end switch yys1484 - } // end for yyj1484 + z.DecStructFieldNotFound(-1, yys1496) + } // end switch yys1496 + } // end for yyj1496 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -17780,16 +17995,16 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj1487 int - var yyb1487 bool - var yyhl1487 bool = l >= 0 - yyj1487++ - if yyhl1487 { - yyb1487 = yyj1487 > l + var yyj1499 int + var yyb1499 bool + var yyhl1499 bool = l >= 0 + yyj1499++ + if yyhl1499 { + yyb1499 = yyj1499 > l } else { - yyb1487 = r.CheckBreak() + yyb1499 = r.CheckBreak() } - if yyb1487 { + if yyb1499 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17799,13 +18014,13 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Replicas = int32(r.DecodeInt(32)) } - yyj1487++ - if yyhl1487 { - yyb1487 = yyj1487 > l + yyj1499++ + if yyhl1499 { + yyb1499 = yyj1499 > l } else { - yyb1487 = r.CheckBreak() + yyb1499 = r.CheckBreak() } - if yyb1487 { + if yyb1499 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -17816,17 +18031,2175 @@ func (x *ReplicaSetStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) x.ObservedGeneration = int64(r.DecodeInt(64)) } for { - yyj1487++ - if yyhl1487 { - yyb1487 = yyj1487 > l + yyj1499++ + if yyhl1499 { + yyb1499 = yyj1499 > l } else { - yyb1487 = r.CheckBreak() + yyb1499 = r.CheckBreak() } - if yyb1487 { + if yyb1499 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj1487-1, "") + z.DecStructFieldNotFound(yyj1499-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodSecurityPolicy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1502 := z.EncBinary() + _ = yym1502 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1503 := !z.EncBinary() + yy2arr1503 := z.EncBasicHandle().StructToArray + var yyq1503 [4]bool + _, _, _ = yysep1503, yyq1503, yy2arr1503 + const yyr1503 bool = false + yyq1503[0] = true + yyq1503[1] = true + yyq1503[2] = x.Kind != "" + yyq1503[3] = x.APIVersion != "" + var yynn1503 int + if yyr1503 || yy2arr1503 { + r.EncodeArrayStart(4) + } else { + yynn1503 = 0 + for _, b := range yyq1503 { + if b { + yynn1503++ + } + } + r.EncodeMapStart(yynn1503) + yynn1503 = 0 + } + if yyr1503 || yy2arr1503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1503[0] { + yy1505 := &x.ObjectMeta + yy1505.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1503[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1506 := &x.ObjectMeta + yy1506.CodecEncodeSelf(e) + } + } + if yyr1503 || yy2arr1503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1503[1] { + yy1508 := &x.Spec + yy1508.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1503[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("spec")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1509 := &x.Spec + yy1509.CodecEncodeSelf(e) + } + } + if yyr1503 || yy2arr1503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1503[2] { + yym1511 := z.EncBinary() + _ = yym1511 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1503[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1512 := z.EncBinary() + _ = yym1512 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1503 || yy2arr1503 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1503[3] { + yym1514 := z.EncBinary() + _ = yym1514 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1503[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1515 := z.EncBinary() + _ = yym1515 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1503 || yy2arr1503 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1516 := z.DecBinary() + _ = yym1516 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1517 := r.ContainerType() + if yyct1517 == codecSelferValueTypeMap1234 { + yyl1517 := r.ReadMapStart() + if yyl1517 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1517, d) + } + } else if yyct1517 == codecSelferValueTypeArray1234 { + yyl1517 := r.ReadArrayStart() + if yyl1517 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1517, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1518Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1518Slc + var yyhl1518 bool = l >= 0 + for yyj1518 := 0; ; yyj1518++ { + if yyhl1518 { + if yyj1518 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1518Slc = r.DecodeBytes(yys1518Slc, true, true) + yys1518 := string(yys1518Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1518 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1519 := &x.ObjectMeta + yyv1519.CodecDecodeSelf(d) + } + case "spec": + if r.TryDecodeAsNil() { + x.Spec = PodSecurityPolicySpec{} + } else { + yyv1520 := &x.Spec + yyv1520.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, yys1518) + } // end switch yys1518 + } // end for yyj1518 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1523 int + var yyb1523 bool + var yyhl1523 bool = l >= 0 + yyj1523++ + if yyhl1523 { + yyb1523 = yyj1523 > l + } else { + yyb1523 = r.CheckBreak() + } + if yyb1523 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_v1.ObjectMeta{} + } else { + yyv1524 := &x.ObjectMeta + yyv1524.CodecDecodeSelf(d) + } + yyj1523++ + if yyhl1523 { + yyb1523 = yyj1523 > l + } else { + yyb1523 = r.CheckBreak() + } + if yyb1523 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Spec = PodSecurityPolicySpec{} + } else { + yyv1525 := &x.Spec + yyv1525.CodecDecodeSelf(d) + } + yyj1523++ + if yyhl1523 { + yyb1523 = yyj1523 > l + } else { + yyb1523 = r.CheckBreak() + } + if yyb1523 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1523++ + if yyhl1523 { + yyb1523 = yyj1523 > l + } else { + yyb1523 = r.CheckBreak() + } + if yyb1523 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj1523++ + if yyhl1523 { + yyb1523 = yyj1523 > l + } else { + yyb1523 = r.CheckBreak() + } + if yyb1523 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1523-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *PodSecurityPolicySpec) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1528 := z.EncBinary() + _ = yym1528 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1529 := !z.EncBinary() + yy2arr1529 := z.EncBasicHandle().StructToArray + var yyq1529 [9]bool + _, _, _ = yysep1529, yyq1529, yy2arr1529 + const yyr1529 bool = false + yyq1529[0] = x.Privileged != false + yyq1529[1] = len(x.Capabilities) != 0 + yyq1529[2] = len(x.Volumes) != 0 + yyq1529[3] = x.HostNetwork != false + yyq1529[4] = len(x.HostPorts) != 0 + yyq1529[5] = x.HostPID != false + yyq1529[6] = x.HostIPC != false + yyq1529[7] = true + yyq1529[8] = true + var yynn1529 int + if yyr1529 || yy2arr1529 { + r.EncodeArrayStart(9) + } else { + yynn1529 = 0 + for _, b := range yyq1529 { + if b { + yynn1529++ + } + } + r.EncodeMapStart(yynn1529) + yynn1529 = 0 + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[0] { + yym1531 := z.EncBinary() + _ = yym1531 + if false { + } else { + r.EncodeBool(bool(x.Privileged)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1529[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("privileged")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1532 := z.EncBinary() + _ = yym1532 + if false { + } else { + r.EncodeBool(bool(x.Privileged)) + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[1] { + if x.Capabilities == nil { + r.EncodeNil() + } else { + yym1534 := z.EncBinary() + _ = yym1534 + if false { + } else { + h.encSlicev1_Capability(([]pkg2_v1.Capability)(x.Capabilities), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1529[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("capabilities")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Capabilities == nil { + r.EncodeNil() + } else { + yym1535 := z.EncBinary() + _ = yym1535 + if false { + } else { + h.encSlicev1_Capability(([]pkg2_v1.Capability)(x.Capabilities), e) + } + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[2] { + if x.Volumes == nil { + r.EncodeNil() + } else { + yym1537 := z.EncBinary() + _ = yym1537 + if false { + } else { + h.encSliceFSType(([]FSType)(x.Volumes), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1529[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("volumes")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Volumes == nil { + r.EncodeNil() + } else { + yym1538 := z.EncBinary() + _ = yym1538 + if false { + } else { + h.encSliceFSType(([]FSType)(x.Volumes), e) + } + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[3] { + yym1540 := z.EncBinary() + _ = yym1540 + if false { + } else { + r.EncodeBool(bool(x.HostNetwork)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1529[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostNetwork")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1541 := z.EncBinary() + _ = yym1541 + if false { + } else { + r.EncodeBool(bool(x.HostNetwork)) + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[4] { + if x.HostPorts == nil { + r.EncodeNil() + } else { + yym1543 := z.EncBinary() + _ = yym1543 + if false { + } else { + h.encSliceHostPortRange(([]HostPortRange)(x.HostPorts), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1529[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPorts")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.HostPorts == nil { + r.EncodeNil() + } else { + yym1544 := z.EncBinary() + _ = yym1544 + if false { + } else { + h.encSliceHostPortRange(([]HostPortRange)(x.HostPorts), e) + } + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[5] { + yym1546 := z.EncBinary() + _ = yym1546 + if false { + } else { + r.EncodeBool(bool(x.HostPID)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1529[5] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostPID")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1547 := z.EncBinary() + _ = yym1547 + if false { + } else { + r.EncodeBool(bool(x.HostPID)) + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[6] { + yym1549 := z.EncBinary() + _ = yym1549 + if false { + } else { + r.EncodeBool(bool(x.HostIPC)) + } + } else { + r.EncodeBool(false) + } + } else { + if yyq1529[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("hostIPC")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1550 := z.EncBinary() + _ = yym1550 + if false { + } else { + r.EncodeBool(bool(x.HostIPC)) + } + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[7] { + yy1552 := &x.SELinuxContext + yy1552.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1529[7] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("seLinuxContext")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1553 := &x.SELinuxContext + yy1553.CodecEncodeSelf(e) + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1529[8] { + yy1555 := &x.RunAsUser + yy1555.CodecEncodeSelf(e) + } else { + r.EncodeNil() + } + } else { + if yyq1529[8] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("runAsUser")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1556 := &x.RunAsUser + yy1556.CodecEncodeSelf(e) + } + } + if yyr1529 || yy2arr1529 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicySpec) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1557 := z.DecBinary() + _ = yym1557 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1558 := r.ContainerType() + if yyct1558 == codecSelferValueTypeMap1234 { + yyl1558 := r.ReadMapStart() + if yyl1558 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1558, d) + } + } else if yyct1558 == codecSelferValueTypeArray1234 { + yyl1558 := r.ReadArrayStart() + if yyl1558 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1558, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicySpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1559Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1559Slc + var yyhl1559 bool = l >= 0 + for yyj1559 := 0; ; yyj1559++ { + if yyhl1559 { + if yyj1559 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1559Slc = r.DecodeBytes(yys1559Slc, true, true) + yys1559 := string(yys1559Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1559 { + case "privileged": + if r.TryDecodeAsNil() { + x.Privileged = false + } else { + x.Privileged = bool(r.DecodeBool()) + } + case "capabilities": + if r.TryDecodeAsNil() { + x.Capabilities = nil + } else { + yyv1561 := &x.Capabilities + yym1562 := z.DecBinary() + _ = yym1562 + if false { + } else { + h.decSlicev1_Capability((*[]pkg2_v1.Capability)(yyv1561), d) + } + } + case "volumes": + if r.TryDecodeAsNil() { + x.Volumes = nil + } else { + yyv1563 := &x.Volumes + yym1564 := z.DecBinary() + _ = yym1564 + if false { + } else { + h.decSliceFSType((*[]FSType)(yyv1563), d) + } + } + case "hostNetwork": + if r.TryDecodeAsNil() { + x.HostNetwork = false + } else { + x.HostNetwork = bool(r.DecodeBool()) + } + case "hostPorts": + if r.TryDecodeAsNil() { + x.HostPorts = nil + } else { + yyv1566 := &x.HostPorts + yym1567 := z.DecBinary() + _ = yym1567 + if false { + } else { + h.decSliceHostPortRange((*[]HostPortRange)(yyv1566), d) + } + } + case "hostPID": + if r.TryDecodeAsNil() { + x.HostPID = false + } else { + x.HostPID = bool(r.DecodeBool()) + } + case "hostIPC": + if r.TryDecodeAsNil() { + x.HostIPC = false + } else { + x.HostIPC = bool(r.DecodeBool()) + } + case "seLinuxContext": + if r.TryDecodeAsNil() { + x.SELinuxContext = SELinuxContextStrategyOptions{} + } else { + yyv1570 := &x.SELinuxContext + yyv1570.CodecDecodeSelf(d) + } + case "runAsUser": + if r.TryDecodeAsNil() { + x.RunAsUser = RunAsUserStrategyOptions{} + } else { + yyv1571 := &x.RunAsUser + yyv1571.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1559) + } // end switch yys1559 + } // end for yyj1559 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicySpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1572 int + var yyb1572 bool + var yyhl1572 bool = l >= 0 + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Privileged = false + } else { + x.Privileged = bool(r.DecodeBool()) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Capabilities = nil + } else { + yyv1574 := &x.Capabilities + yym1575 := z.DecBinary() + _ = yym1575 + if false { + } else { + h.decSlicev1_Capability((*[]pkg2_v1.Capability)(yyv1574), d) + } + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Volumes = nil + } else { + yyv1576 := &x.Volumes + yym1577 := z.DecBinary() + _ = yym1577 + if false { + } else { + h.decSliceFSType((*[]FSType)(yyv1576), d) + } + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostNetwork = false + } else { + x.HostNetwork = bool(r.DecodeBool()) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostPorts = nil + } else { + yyv1579 := &x.HostPorts + yym1580 := z.DecBinary() + _ = yym1580 + if false { + } else { + h.decSliceHostPortRange((*[]HostPortRange)(yyv1579), d) + } + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostPID = false + } else { + x.HostPID = bool(r.DecodeBool()) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.HostIPC = false + } else { + x.HostIPC = bool(r.DecodeBool()) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.SELinuxContext = SELinuxContextStrategyOptions{} + } else { + yyv1583 := &x.SELinuxContext + yyv1583.CodecDecodeSelf(d) + } + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.RunAsUser = RunAsUserStrategyOptions{} + } else { + yyv1584 := &x.RunAsUser + yyv1584.CodecDecodeSelf(d) + } + for { + yyj1572++ + if yyhl1572 { + yyb1572 = yyj1572 > l + } else { + yyb1572 = r.CheckBreak() + } + if yyb1572 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1572-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x FSType) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1585 := z.EncBinary() + _ = yym1585 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *FSType) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1586 := z.DecBinary() + _ = yym1586 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *HostPortRange) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1587 := z.EncBinary() + _ = yym1587 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1588 := !z.EncBinary() + yy2arr1588 := z.EncBasicHandle().StructToArray + var yyq1588 [2]bool + _, _, _ = yysep1588, yyq1588, yy2arr1588 + const yyr1588 bool = false + var yynn1588 int + if yyr1588 || yy2arr1588 { + r.EncodeArrayStart(2) + } else { + yynn1588 = 2 + for _, b := range yyq1588 { + if b { + yynn1588++ + } + } + r.EncodeMapStart(yynn1588) + yynn1588 = 0 + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1590 := z.EncBinary() + _ = yym1590 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("min")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1591 := z.EncBinary() + _ = yym1591 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1593 := z.EncBinary() + _ = yym1593 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("max")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1594 := z.EncBinary() + _ = yym1594 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } + if yyr1588 || yy2arr1588 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *HostPortRange) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1595 := z.DecBinary() + _ = yym1595 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1596 := r.ContainerType() + if yyct1596 == codecSelferValueTypeMap1234 { + yyl1596 := r.ReadMapStart() + if yyl1596 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1596, d) + } + } else if yyct1596 == codecSelferValueTypeArray1234 { + yyl1596 := r.ReadArrayStart() + if yyl1596 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1596, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *HostPortRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1597Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1597Slc + var yyhl1597 bool = l >= 0 + for yyj1597 := 0; ; yyj1597++ { + if yyhl1597 { + if yyj1597 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1597Slc = r.DecodeBytes(yys1597Slc, true, true) + yys1597 := string(yys1597Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1597 { + case "min": + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int32(r.DecodeInt(32)) + } + case "max": + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int32(r.DecodeInt(32)) + } + default: + z.DecStructFieldNotFound(-1, yys1597) + } // end switch yys1597 + } // end for yyj1597 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *HostPortRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1600 int + var yyb1600 bool + var yyhl1600 bool = l >= 0 + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int32(r.DecodeInt(32)) + } + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int32(r.DecodeInt(32)) + } + for { + yyj1600++ + if yyhl1600 { + yyb1600 = yyj1600 > l + } else { + yyb1600 = r.CheckBreak() + } + if yyb1600 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1600-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *SELinuxContextStrategyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1603 := z.EncBinary() + _ = yym1603 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1604 := !z.EncBinary() + yy2arr1604 := z.EncBasicHandle().StructToArray + var yyq1604 [2]bool + _, _, _ = yysep1604, yyq1604, yy2arr1604 + const yyr1604 bool = false + yyq1604[1] = x.SELinuxOptions != nil + var yynn1604 int + if yyr1604 || yy2arr1604 { + r.EncodeArrayStart(2) + } else { + yynn1604 = 1 + for _, b := range yyq1604 { + if b { + yynn1604++ + } + } + r.EncodeMapStart(yynn1604) + yynn1604 = 0 + } + if yyr1604 || yy2arr1604 { + 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 yyr1604 || yy2arr1604 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1604[1] { + if x.SELinuxOptions == nil { + r.EncodeNil() + } else { + x.SELinuxOptions.CodecEncodeSelf(e) + } + } else { + r.EncodeNil() + } + } else { + if yyq1604[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("seLinuxOptions")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.SELinuxOptions == nil { + r.EncodeNil() + } else { + x.SELinuxOptions.CodecEncodeSelf(e) + } + } + } + if yyr1604 || yy2arr1604 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *SELinuxContextStrategyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1607 := z.DecBinary() + _ = yym1607 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1608 := r.ContainerType() + if yyct1608 == codecSelferValueTypeMap1234 { + yyl1608 := r.ReadMapStart() + if yyl1608 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1608, d) + } + } else if yyct1608 == codecSelferValueTypeArray1234 { + yyl1608 := r.ReadArrayStart() + if yyl1608 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1608, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *SELinuxContextStrategyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1609Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1609Slc + var yyhl1609 bool = l >= 0 + for yyj1609 := 0; ; yyj1609++ { + if yyhl1609 { + if yyj1609 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1609Slc = r.DecodeBytes(yys1609Slc, true, true) + yys1609 := string(yys1609Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1609 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SELinuxContextStrategy(r.DecodeString()) + } + case "seLinuxOptions": + if r.TryDecodeAsNil() { + if x.SELinuxOptions != nil { + x.SELinuxOptions = nil + } + } else { + if x.SELinuxOptions == nil { + x.SELinuxOptions = new(pkg2_v1.SELinuxOptions) + } + x.SELinuxOptions.CodecDecodeSelf(d) + } + default: + z.DecStructFieldNotFound(-1, yys1609) + } // end switch yys1609 + } // end for yyj1609 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *SELinuxContextStrategyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1612 int + var yyb1612 bool + var yyhl1612 bool = l >= 0 + yyj1612++ + if yyhl1612 { + yyb1612 = yyj1612 > l + } else { + yyb1612 = r.CheckBreak() + } + if yyb1612 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = SELinuxContextStrategy(r.DecodeString()) + } + yyj1612++ + if yyhl1612 { + yyb1612 = yyj1612 > l + } else { + yyb1612 = r.CheckBreak() + } + if yyb1612 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + if x.SELinuxOptions != nil { + x.SELinuxOptions = nil + } + } else { + if x.SELinuxOptions == nil { + x.SELinuxOptions = new(pkg2_v1.SELinuxOptions) + } + x.SELinuxOptions.CodecDecodeSelf(d) + } + for { + yyj1612++ + if yyhl1612 { + yyb1612 = yyj1612 > l + } else { + yyb1612 = r.CheckBreak() + } + if yyb1612 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1612-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x SELinuxContextStrategy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1615 := z.EncBinary() + _ = yym1615 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *SELinuxContextStrategy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1616 := z.DecBinary() + _ = yym1616 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *RunAsUserStrategyOptions) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1617 := z.EncBinary() + _ = yym1617 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1618 := !z.EncBinary() + yy2arr1618 := z.EncBasicHandle().StructToArray + var yyq1618 [2]bool + _, _, _ = yysep1618, yyq1618, yy2arr1618 + const yyr1618 bool = false + yyq1618[1] = len(x.Ranges) != 0 + var yynn1618 int + if yyr1618 || yy2arr1618 { + r.EncodeArrayStart(2) + } else { + yynn1618 = 1 + for _, b := range yyq1618 { + if b { + yynn1618++ + } + } + r.EncodeMapStart(yynn1618) + yynn1618 = 0 + } + if yyr1618 || yy2arr1618 { + 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 yyr1618 || yy2arr1618 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1618[1] { + if x.Ranges == nil { + r.EncodeNil() + } else { + yym1621 := z.EncBinary() + _ = yym1621 + if false { + } else { + h.encSliceIDRange(([]IDRange)(x.Ranges), e) + } + } + } else { + r.EncodeNil() + } + } else { + if yyq1618[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("ranges")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Ranges == nil { + r.EncodeNil() + } else { + yym1622 := z.EncBinary() + _ = yym1622 + if false { + } else { + h.encSliceIDRange(([]IDRange)(x.Ranges), e) + } + } + } + } + if yyr1618 || yy2arr1618 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *RunAsUserStrategyOptions) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1623 := z.DecBinary() + _ = yym1623 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1624 := r.ContainerType() + if yyct1624 == codecSelferValueTypeMap1234 { + yyl1624 := r.ReadMapStart() + if yyl1624 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1624, d) + } + } else if yyct1624 == codecSelferValueTypeArray1234 { + yyl1624 := r.ReadArrayStart() + if yyl1624 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1624, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *RunAsUserStrategyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1625Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1625Slc + var yyhl1625 bool = l >= 0 + for yyj1625 := 0; ; yyj1625++ { + if yyhl1625 { + if yyj1625 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1625Slc = r.DecodeBytes(yys1625Slc, true, true) + yys1625 := string(yys1625Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1625 { + case "type": + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RunAsUserStrategy(r.DecodeString()) + } + case "ranges": + if r.TryDecodeAsNil() { + x.Ranges = nil + } else { + yyv1627 := &x.Ranges + yym1628 := z.DecBinary() + _ = yym1628 + if false { + } else { + h.decSliceIDRange((*[]IDRange)(yyv1627), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys1625) + } // end switch yys1625 + } // end for yyj1625 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *RunAsUserStrategyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1629 int + var yyb1629 bool + var yyhl1629 bool = l >= 0 + yyj1629++ + if yyhl1629 { + yyb1629 = yyj1629 > l + } else { + yyb1629 = r.CheckBreak() + } + if yyb1629 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Type = "" + } else { + x.Type = RunAsUserStrategy(r.DecodeString()) + } + yyj1629++ + if yyhl1629 { + yyb1629 = yyj1629 > l + } else { + yyb1629 = r.CheckBreak() + } + if yyb1629 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Ranges = nil + } else { + yyv1631 := &x.Ranges + yym1632 := z.DecBinary() + _ = yym1632 + if false { + } else { + h.decSliceIDRange((*[]IDRange)(yyv1631), d) + } + } + for { + yyj1629++ + if yyhl1629 { + yyb1629 = yyj1629 > l + } else { + yyb1629 = r.CheckBreak() + } + if yyb1629 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1629-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x *IDRange) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1633 := z.EncBinary() + _ = yym1633 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1634 := !z.EncBinary() + yy2arr1634 := z.EncBasicHandle().StructToArray + var yyq1634 [2]bool + _, _, _ = yysep1634, yyq1634, yy2arr1634 + const yyr1634 bool = false + var yynn1634 int + if yyr1634 || yy2arr1634 { + r.EncodeArrayStart(2) + } else { + yynn1634 = 2 + for _, b := range yyq1634 { + if b { + yynn1634++ + } + } + r.EncodeMapStart(yynn1634) + yynn1634 = 0 + } + if yyr1634 || yy2arr1634 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1636 := z.EncBinary() + _ = yym1636 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("min")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1637 := z.EncBinary() + _ = yym1637 + if false { + } else { + r.EncodeInt(int64(x.Min)) + } + } + if yyr1634 || yy2arr1634 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1639 := z.EncBinary() + _ = yym1639 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("max")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1640 := z.EncBinary() + _ = yym1640 + if false { + } else { + r.EncodeInt(int64(x.Max)) + } + } + if yyr1634 || yy2arr1634 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *IDRange) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1641 := z.DecBinary() + _ = yym1641 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1642 := r.ContainerType() + if yyct1642 == codecSelferValueTypeMap1234 { + yyl1642 := r.ReadMapStart() + if yyl1642 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1642, d) + } + } else if yyct1642 == codecSelferValueTypeArray1234 { + yyl1642 := r.ReadArrayStart() + if yyl1642 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1642, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *IDRange) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1643Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1643Slc + var yyhl1643 bool = l >= 0 + for yyj1643 := 0; ; yyj1643++ { + if yyhl1643 { + if yyj1643 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1643Slc = r.DecodeBytes(yys1643Slc, true, true) + yys1643 := string(yys1643Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1643 { + case "min": + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int64(r.DecodeInt(64)) + } + case "max": + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int64(r.DecodeInt(64)) + } + default: + z.DecStructFieldNotFound(-1, yys1643) + } // end switch yys1643 + } // end for yyj1643 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *IDRange) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1646 int + var yyb1646 bool + var yyhl1646 bool = l >= 0 + yyj1646++ + if yyhl1646 { + yyb1646 = yyj1646 > l + } else { + yyb1646 = r.CheckBreak() + } + if yyb1646 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Min = 0 + } else { + x.Min = int64(r.DecodeInt(64)) + } + yyj1646++ + if yyhl1646 { + yyb1646 = yyj1646 > l + } else { + yyb1646 = r.CheckBreak() + } + if yyb1646 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Max = 0 + } else { + x.Max = int64(r.DecodeInt(64)) + } + for { + yyj1646++ + if yyhl1646 { + yyb1646 = yyj1646 > l + } else { + yyb1646 = r.CheckBreak() + } + if yyb1646 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1646-1, "") + } + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x RunAsUserStrategy) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + yym1649 := z.EncBinary() + _ = yym1649 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x)) + } +} + +func (x *RunAsUserStrategy) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1650 := z.DecBinary() + _ = yym1650 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*string)(x)) = r.DecodeString() + } +} + +func (x *PodSecurityPolicyList) CodecEncodeSelf(e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1651 := z.EncBinary() + _ = yym1651 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + yysep1652 := !z.EncBinary() + yy2arr1652 := z.EncBasicHandle().StructToArray + var yyq1652 [4]bool + _, _, _ = yysep1652, yyq1652, yy2arr1652 + const yyr1652 bool = false + yyq1652[0] = true + yyq1652[2] = x.Kind != "" + yyq1652[3] = x.APIVersion != "" + var yynn1652 int + if yyr1652 || yy2arr1652 { + r.EncodeArrayStart(4) + } else { + yynn1652 = 1 + for _, b := range yyq1652 { + if b { + yynn1652++ + } + } + r.EncodeMapStart(yynn1652) + yynn1652 = 0 + } + if yyr1652 || yy2arr1652 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1652[0] { + yy1654 := &x.ListMeta + yym1655 := z.EncBinary() + _ = yym1655 + if false { + } else if z.HasExtensions() && z.EncExt(yy1654) { + } else { + z.EncFallback(yy1654) + } + } else { + r.EncodeNil() + } + } else { + if yyq1652[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy1656 := &x.ListMeta + yym1657 := z.EncBinary() + _ = yym1657 + if false { + } else if z.HasExtensions() && z.EncExt(yy1656) { + } else { + z.EncFallback(yy1656) + } + } + } + if yyr1652 || yy2arr1652 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1659 := z.EncBinary() + _ = yym1659 + if false { + } else { + h.encSlicePodSecurityPolicy(([]PodSecurityPolicy)(x.Items), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("items")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.Items == nil { + r.EncodeNil() + } else { + yym1660 := z.EncBinary() + _ = yym1660 + if false { + } else { + h.encSlicePodSecurityPolicy(([]PodSecurityPolicy)(x.Items), e) + } + } + } + if yyr1652 || yy2arr1652 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1652[2] { + yym1662 := z.EncBinary() + _ = yym1662 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1652[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1663 := z.EncBinary() + _ = yym1663 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr1652 || yy2arr1652 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq1652[3] { + yym1665 := z.EncBinary() + _ = yym1665 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq1652[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym1666 := z.EncBinary() + _ = yym1666 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr1652 || yy2arr1652 { + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + z.EncSendContainerState(codecSelfer_containerMapEnd1234) + } + } + } +} + +func (x *PodSecurityPolicyList) CodecDecodeSelf(d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + yym1667 := z.DecBinary() + _ = yym1667 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + yyct1668 := r.ContainerType() + if yyct1668 == codecSelferValueTypeMap1234 { + yyl1668 := r.ReadMapStart() + if yyl1668 == 0 { + z.DecSendContainerState(codecSelfer_containerMapEnd1234) + } else { + x.codecDecodeSelfFromMap(yyl1668, d) + } + } else if yyct1668 == codecSelferValueTypeArray1234 { + yyl1668 := r.ReadArrayStart() + if yyl1668 == 0 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + } else { + x.codecDecodeSelfFromArray(yyl1668, d) + } + } else { + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) + } + } +} + +func (x *PodSecurityPolicyList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yys1669Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys1669Slc + var yyhl1669 bool = l >= 0 + for yyj1669 := 0; ; yyj1669++ { + if yyhl1669 { + if yyj1669 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + z.DecSendContainerState(codecSelfer_containerMapKey1234) + yys1669Slc = r.DecodeBytes(yys1669Slc, true, true) + yys1669 := string(yys1669Slc) + z.DecSendContainerState(codecSelfer_containerMapValue1234) + switch yys1669 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1670 := &x.ListMeta + yym1671 := z.DecBinary() + _ = yym1671 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1670) { + } else { + z.DecFallback(yyv1670, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1672 := &x.Items + yym1673 := z.DecBinary() + _ = yym1673 + if false { + } else { + h.decSlicePodSecurityPolicy((*[]PodSecurityPolicy)(yyv1672), 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, yys1669) + } // end switch yys1669 + } // end for yyj1669 + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x *PodSecurityPolicyList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1676 int + var yyb1676 bool + var yyhl1676 bool = l >= 0 + yyj1676++ + if yyhl1676 { + yyb1676 = yyj1676 > l + } else { + yyb1676 = r.CheckBreak() + } + if yyb1676 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv1677 := &x.ListMeta + yym1678 := z.DecBinary() + _ = yym1678 + if false { + } else if z.HasExtensions() && z.DecExt(yyv1677) { + } else { + z.DecFallback(yyv1677, false) + } + } + yyj1676++ + if yyhl1676 { + yyb1676 = yyj1676 > l + } else { + yyb1676 = r.CheckBreak() + } + if yyb1676 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv1679 := &x.Items + yym1680 := z.DecBinary() + _ = yym1680 + if false { + } else { + h.decSlicePodSecurityPolicy((*[]PodSecurityPolicy)(yyv1679), d) + } + } + yyj1676++ + if yyhl1676 { + yyb1676 = yyj1676 > l + } else { + yyb1676 = r.CheckBreak() + } + if yyb1676 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj1676++ + if yyhl1676 { + yyb1676 = yyj1676 > l + } else { + yyb1676 = r.CheckBreak() + } + if yyb1676 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } + for { + yyj1676++ + if yyhl1676 { + yyb1676 = yyj1676 > l + } else { + yyb1676 = r.CheckBreak() + } + if yyb1676 { + break + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + z.DecStructFieldNotFound(yyj1676-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17836,10 +20209,10 @@ func (x codecSelfer1234) encSliceCustomMetricTarget(v []CustomMetricTarget, e *c z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1490 := range v { + for _, yyv1683 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1491 := &yyv1490 - yy1491.CodecEncodeSelf(e) + yy1684 := &yyv1683 + yy1684.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17849,83 +20222,83 @@ func (x codecSelfer1234) decSliceCustomMetricTarget(v *[]CustomMetricTarget, d * z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1492 := *v - yyh1492, yyl1492 := z.DecSliceHelperStart() - var yyc1492 bool - if yyl1492 == 0 { - if yyv1492 == nil { - yyv1492 = []CustomMetricTarget{} - yyc1492 = true - } else if len(yyv1492) != 0 { - yyv1492 = yyv1492[:0] - yyc1492 = true + yyv1685 := *v + yyh1685, yyl1685 := z.DecSliceHelperStart() + var yyc1685 bool + if yyl1685 == 0 { + if yyv1685 == nil { + yyv1685 = []CustomMetricTarget{} + yyc1685 = true + } else if len(yyv1685) != 0 { + yyv1685 = yyv1685[:0] + yyc1685 = true } - } else if yyl1492 > 0 { - var yyrr1492, yyrl1492 int - var yyrt1492 bool - if yyl1492 > cap(yyv1492) { + } else if yyl1685 > 0 { + var yyrr1685, yyrl1685 int + var yyrt1685 bool + if yyl1685 > cap(yyv1685) { - yyrg1492 := len(yyv1492) > 0 - yyv21492 := yyv1492 - yyrl1492, yyrt1492 = z.DecInferLen(yyl1492, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1492 { - if yyrl1492 <= cap(yyv1492) { - yyv1492 = yyv1492[:yyrl1492] + yyrg1685 := len(yyv1685) > 0 + yyv21685 := yyv1685 + yyrl1685, yyrt1685 = z.DecInferLen(yyl1685, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1685 { + if yyrl1685 <= cap(yyv1685) { + yyv1685 = yyv1685[:yyrl1685] } else { - yyv1492 = make([]CustomMetricTarget, yyrl1492) + yyv1685 = make([]CustomMetricTarget, yyrl1685) } } else { - yyv1492 = make([]CustomMetricTarget, yyrl1492) + yyv1685 = make([]CustomMetricTarget, yyrl1685) } - yyc1492 = true - yyrr1492 = len(yyv1492) - if yyrg1492 { - copy(yyv1492, yyv21492) + yyc1685 = true + yyrr1685 = len(yyv1685) + if yyrg1685 { + copy(yyv1685, yyv21685) } - } else if yyl1492 != len(yyv1492) { - yyv1492 = yyv1492[:yyl1492] - yyc1492 = true + } else if yyl1685 != len(yyv1685) { + yyv1685 = yyv1685[:yyl1685] + yyc1685 = true } - yyj1492 := 0 - for ; yyj1492 < yyrr1492; yyj1492++ { - yyh1492.ElemContainerState(yyj1492) + yyj1685 := 0 + for ; yyj1685 < yyrr1685; yyj1685++ { + yyh1685.ElemContainerState(yyj1685) if r.TryDecodeAsNil() { - yyv1492[yyj1492] = CustomMetricTarget{} + yyv1685[yyj1685] = CustomMetricTarget{} } else { - yyv1493 := &yyv1492[yyj1492] - yyv1493.CodecDecodeSelf(d) + yyv1686 := &yyv1685[yyj1685] + yyv1686.CodecDecodeSelf(d) } } - if yyrt1492 { - for ; yyj1492 < yyl1492; yyj1492++ { - yyv1492 = append(yyv1492, CustomMetricTarget{}) - yyh1492.ElemContainerState(yyj1492) + if yyrt1685 { + for ; yyj1685 < yyl1685; yyj1685++ { + yyv1685 = append(yyv1685, CustomMetricTarget{}) + yyh1685.ElemContainerState(yyj1685) if r.TryDecodeAsNil() { - yyv1492[yyj1492] = CustomMetricTarget{} + yyv1685[yyj1685] = CustomMetricTarget{} } else { - yyv1494 := &yyv1492[yyj1492] - yyv1494.CodecDecodeSelf(d) + yyv1687 := &yyv1685[yyj1685] + yyv1687.CodecDecodeSelf(d) } } } } else { - yyj1492 := 0 - for ; !r.CheckBreak(); yyj1492++ { + yyj1685 := 0 + for ; !r.CheckBreak(); yyj1685++ { - if yyj1492 >= len(yyv1492) { - yyv1492 = append(yyv1492, CustomMetricTarget{}) // var yyz1492 CustomMetricTarget - yyc1492 = true + if yyj1685 >= len(yyv1685) { + yyv1685 = append(yyv1685, CustomMetricTarget{}) // var yyz1685 CustomMetricTarget + yyc1685 = true } - yyh1492.ElemContainerState(yyj1492) - if yyj1492 < len(yyv1492) { + yyh1685.ElemContainerState(yyj1685) + if yyj1685 < len(yyv1685) { if r.TryDecodeAsNil() { - yyv1492[yyj1492] = CustomMetricTarget{} + yyv1685[yyj1685] = CustomMetricTarget{} } else { - yyv1495 := &yyv1492[yyj1492] - yyv1495.CodecDecodeSelf(d) + yyv1688 := &yyv1685[yyj1685] + yyv1688.CodecDecodeSelf(d) } } else { @@ -17933,17 +20306,17 @@ func (x codecSelfer1234) decSliceCustomMetricTarget(v *[]CustomMetricTarget, d * } } - if yyj1492 < len(yyv1492) { - yyv1492 = yyv1492[:yyj1492] - yyc1492 = true - } else if yyj1492 == 0 && yyv1492 == nil { - yyv1492 = []CustomMetricTarget{} - yyc1492 = true + if yyj1685 < len(yyv1685) { + yyv1685 = yyv1685[:yyj1685] + yyc1685 = true + } else if yyj1685 == 0 && yyv1685 == nil { + yyv1685 = []CustomMetricTarget{} + yyc1685 = true } } - yyh1492.End() - if yyc1492 { - *v = yyv1492 + yyh1685.End() + if yyc1685 { + *v = yyv1685 } } @@ -17952,10 +20325,10 @@ func (x codecSelfer1234) encSliceCustomMetricCurrentStatus(v []CustomMetricCurre z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1496 := range v { + for _, yyv1689 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1497 := &yyv1496 - yy1497.CodecEncodeSelf(e) + yy1690 := &yyv1689 + yy1690.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -17965,83 +20338,83 @@ func (x codecSelfer1234) decSliceCustomMetricCurrentStatus(v *[]CustomMetricCurr z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1498 := *v - yyh1498, yyl1498 := z.DecSliceHelperStart() - var yyc1498 bool - if yyl1498 == 0 { - if yyv1498 == nil { - yyv1498 = []CustomMetricCurrentStatus{} - yyc1498 = true - } else if len(yyv1498) != 0 { - yyv1498 = yyv1498[:0] - yyc1498 = true + yyv1691 := *v + yyh1691, yyl1691 := z.DecSliceHelperStart() + var yyc1691 bool + if yyl1691 == 0 { + if yyv1691 == nil { + yyv1691 = []CustomMetricCurrentStatus{} + yyc1691 = true + } else if len(yyv1691) != 0 { + yyv1691 = yyv1691[:0] + yyc1691 = true } - } else if yyl1498 > 0 { - var yyrr1498, yyrl1498 int - var yyrt1498 bool - if yyl1498 > cap(yyv1498) { + } else if yyl1691 > 0 { + var yyrr1691, yyrl1691 int + var yyrt1691 bool + if yyl1691 > cap(yyv1691) { - yyrg1498 := len(yyv1498) > 0 - yyv21498 := yyv1498 - yyrl1498, yyrt1498 = z.DecInferLen(yyl1498, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1498 { - if yyrl1498 <= cap(yyv1498) { - yyv1498 = yyv1498[:yyrl1498] + yyrg1691 := len(yyv1691) > 0 + yyv21691 := yyv1691 + yyrl1691, yyrt1691 = z.DecInferLen(yyl1691, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1691 { + if yyrl1691 <= cap(yyv1691) { + yyv1691 = yyv1691[:yyrl1691] } else { - yyv1498 = make([]CustomMetricCurrentStatus, yyrl1498) + yyv1691 = make([]CustomMetricCurrentStatus, yyrl1691) } } else { - yyv1498 = make([]CustomMetricCurrentStatus, yyrl1498) + yyv1691 = make([]CustomMetricCurrentStatus, yyrl1691) } - yyc1498 = true - yyrr1498 = len(yyv1498) - if yyrg1498 { - copy(yyv1498, yyv21498) + yyc1691 = true + yyrr1691 = len(yyv1691) + if yyrg1691 { + copy(yyv1691, yyv21691) } - } else if yyl1498 != len(yyv1498) { - yyv1498 = yyv1498[:yyl1498] - yyc1498 = true + } else if yyl1691 != len(yyv1691) { + yyv1691 = yyv1691[:yyl1691] + yyc1691 = true } - yyj1498 := 0 - for ; yyj1498 < yyrr1498; yyj1498++ { - yyh1498.ElemContainerState(yyj1498) + yyj1691 := 0 + for ; yyj1691 < yyrr1691; yyj1691++ { + yyh1691.ElemContainerState(yyj1691) if r.TryDecodeAsNil() { - yyv1498[yyj1498] = CustomMetricCurrentStatus{} + yyv1691[yyj1691] = CustomMetricCurrentStatus{} } else { - yyv1499 := &yyv1498[yyj1498] - yyv1499.CodecDecodeSelf(d) + yyv1692 := &yyv1691[yyj1691] + yyv1692.CodecDecodeSelf(d) } } - if yyrt1498 { - for ; yyj1498 < yyl1498; yyj1498++ { - yyv1498 = append(yyv1498, CustomMetricCurrentStatus{}) - yyh1498.ElemContainerState(yyj1498) + if yyrt1691 { + for ; yyj1691 < yyl1691; yyj1691++ { + yyv1691 = append(yyv1691, CustomMetricCurrentStatus{}) + yyh1691.ElemContainerState(yyj1691) if r.TryDecodeAsNil() { - yyv1498[yyj1498] = CustomMetricCurrentStatus{} + yyv1691[yyj1691] = CustomMetricCurrentStatus{} } else { - yyv1500 := &yyv1498[yyj1498] - yyv1500.CodecDecodeSelf(d) + yyv1693 := &yyv1691[yyj1691] + yyv1693.CodecDecodeSelf(d) } } } } else { - yyj1498 := 0 - for ; !r.CheckBreak(); yyj1498++ { + yyj1691 := 0 + for ; !r.CheckBreak(); yyj1691++ { - if yyj1498 >= len(yyv1498) { - yyv1498 = append(yyv1498, CustomMetricCurrentStatus{}) // var yyz1498 CustomMetricCurrentStatus - yyc1498 = true + if yyj1691 >= len(yyv1691) { + yyv1691 = append(yyv1691, CustomMetricCurrentStatus{}) // var yyz1691 CustomMetricCurrentStatus + yyc1691 = true } - yyh1498.ElemContainerState(yyj1498) - if yyj1498 < len(yyv1498) { + yyh1691.ElemContainerState(yyj1691) + if yyj1691 < len(yyv1691) { if r.TryDecodeAsNil() { - yyv1498[yyj1498] = CustomMetricCurrentStatus{} + yyv1691[yyj1691] = CustomMetricCurrentStatus{} } else { - yyv1501 := &yyv1498[yyj1498] - yyv1501.CodecDecodeSelf(d) + yyv1694 := &yyv1691[yyj1691] + yyv1694.CodecDecodeSelf(d) } } else { @@ -18049,17 +20422,17 @@ func (x codecSelfer1234) decSliceCustomMetricCurrentStatus(v *[]CustomMetricCurr } } - if yyj1498 < len(yyv1498) { - yyv1498 = yyv1498[:yyj1498] - yyc1498 = true - } else if yyj1498 == 0 && yyv1498 == nil { - yyv1498 = []CustomMetricCurrentStatus{} - yyc1498 = true + if yyj1691 < len(yyv1691) { + yyv1691 = yyv1691[:yyj1691] + yyc1691 = true + } else if yyj1691 == 0 && yyv1691 == nil { + yyv1691 = []CustomMetricCurrentStatus{} + yyc1691 = true } } - yyh1498.End() - if yyc1498 { - *v = yyv1498 + yyh1691.End() + if yyc1691 { + *v = yyv1691 } } @@ -18068,10 +20441,10 @@ func (x codecSelfer1234) encSliceHorizontalPodAutoscaler(v []HorizontalPodAutosc z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1502 := range v { + for _, yyv1695 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1503 := &yyv1502 - yy1503.CodecEncodeSelf(e) + yy1696 := &yyv1695 + yy1696.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18081,83 +20454,83 @@ func (x codecSelfer1234) decSliceHorizontalPodAutoscaler(v *[]HorizontalPodAutos z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1504 := *v - yyh1504, yyl1504 := z.DecSliceHelperStart() - var yyc1504 bool - if yyl1504 == 0 { - if yyv1504 == nil { - yyv1504 = []HorizontalPodAutoscaler{} - yyc1504 = true - } else if len(yyv1504) != 0 { - yyv1504 = yyv1504[:0] - yyc1504 = true + yyv1697 := *v + yyh1697, yyl1697 := z.DecSliceHelperStart() + var yyc1697 bool + if yyl1697 == 0 { + if yyv1697 == nil { + yyv1697 = []HorizontalPodAutoscaler{} + yyc1697 = true + } else if len(yyv1697) != 0 { + yyv1697 = yyv1697[:0] + yyc1697 = true } - } else if yyl1504 > 0 { - var yyrr1504, yyrl1504 int - var yyrt1504 bool - if yyl1504 > cap(yyv1504) { + } else if yyl1697 > 0 { + var yyrr1697, yyrl1697 int + var yyrt1697 bool + if yyl1697 > cap(yyv1697) { - yyrg1504 := len(yyv1504) > 0 - yyv21504 := yyv1504 - yyrl1504, yyrt1504 = z.DecInferLen(yyl1504, z.DecBasicHandle().MaxInitLen, 312) - if yyrt1504 { - if yyrl1504 <= cap(yyv1504) { - yyv1504 = yyv1504[:yyrl1504] + yyrg1697 := len(yyv1697) > 0 + yyv21697 := yyv1697 + yyrl1697, yyrt1697 = z.DecInferLen(yyl1697, z.DecBasicHandle().MaxInitLen, 312) + if yyrt1697 { + if yyrl1697 <= cap(yyv1697) { + yyv1697 = yyv1697[:yyrl1697] } else { - yyv1504 = make([]HorizontalPodAutoscaler, yyrl1504) + yyv1697 = make([]HorizontalPodAutoscaler, yyrl1697) } } else { - yyv1504 = make([]HorizontalPodAutoscaler, yyrl1504) + yyv1697 = make([]HorizontalPodAutoscaler, yyrl1697) } - yyc1504 = true - yyrr1504 = len(yyv1504) - if yyrg1504 { - copy(yyv1504, yyv21504) + yyc1697 = true + yyrr1697 = len(yyv1697) + if yyrg1697 { + copy(yyv1697, yyv21697) } - } else if yyl1504 != len(yyv1504) { - yyv1504 = yyv1504[:yyl1504] - yyc1504 = true + } else if yyl1697 != len(yyv1697) { + yyv1697 = yyv1697[:yyl1697] + yyc1697 = true } - yyj1504 := 0 - for ; yyj1504 < yyrr1504; yyj1504++ { - yyh1504.ElemContainerState(yyj1504) + yyj1697 := 0 + for ; yyj1697 < yyrr1697; yyj1697++ { + yyh1697.ElemContainerState(yyj1697) if r.TryDecodeAsNil() { - yyv1504[yyj1504] = HorizontalPodAutoscaler{} + yyv1697[yyj1697] = HorizontalPodAutoscaler{} } else { - yyv1505 := &yyv1504[yyj1504] - yyv1505.CodecDecodeSelf(d) + yyv1698 := &yyv1697[yyj1697] + yyv1698.CodecDecodeSelf(d) } } - if yyrt1504 { - for ; yyj1504 < yyl1504; yyj1504++ { - yyv1504 = append(yyv1504, HorizontalPodAutoscaler{}) - yyh1504.ElemContainerState(yyj1504) + if yyrt1697 { + for ; yyj1697 < yyl1697; yyj1697++ { + yyv1697 = append(yyv1697, HorizontalPodAutoscaler{}) + yyh1697.ElemContainerState(yyj1697) if r.TryDecodeAsNil() { - yyv1504[yyj1504] = HorizontalPodAutoscaler{} + yyv1697[yyj1697] = HorizontalPodAutoscaler{} } else { - yyv1506 := &yyv1504[yyj1504] - yyv1506.CodecDecodeSelf(d) + yyv1699 := &yyv1697[yyj1697] + yyv1699.CodecDecodeSelf(d) } } } } else { - yyj1504 := 0 - for ; !r.CheckBreak(); yyj1504++ { + yyj1697 := 0 + for ; !r.CheckBreak(); yyj1697++ { - if yyj1504 >= len(yyv1504) { - yyv1504 = append(yyv1504, HorizontalPodAutoscaler{}) // var yyz1504 HorizontalPodAutoscaler - yyc1504 = true + if yyj1697 >= len(yyv1697) { + yyv1697 = append(yyv1697, HorizontalPodAutoscaler{}) // var yyz1697 HorizontalPodAutoscaler + yyc1697 = true } - yyh1504.ElemContainerState(yyj1504) - if yyj1504 < len(yyv1504) { + yyh1697.ElemContainerState(yyj1697) + if yyj1697 < len(yyv1697) { if r.TryDecodeAsNil() { - yyv1504[yyj1504] = HorizontalPodAutoscaler{} + yyv1697[yyj1697] = HorizontalPodAutoscaler{} } else { - yyv1507 := &yyv1504[yyj1504] - yyv1507.CodecDecodeSelf(d) + yyv1700 := &yyv1697[yyj1697] + yyv1700.CodecDecodeSelf(d) } } else { @@ -18165,17 +20538,17 @@ func (x codecSelfer1234) decSliceHorizontalPodAutoscaler(v *[]HorizontalPodAutos } } - if yyj1504 < len(yyv1504) { - yyv1504 = yyv1504[:yyj1504] - yyc1504 = true - } else if yyj1504 == 0 && yyv1504 == nil { - yyv1504 = []HorizontalPodAutoscaler{} - yyc1504 = true + if yyj1697 < len(yyv1697) { + yyv1697 = yyv1697[:yyj1697] + yyc1697 = true + } else if yyj1697 == 0 && yyv1697 == nil { + yyv1697 = []HorizontalPodAutoscaler{} + yyc1697 = true } } - yyh1504.End() - if yyc1504 { - *v = yyv1504 + yyh1697.End() + if yyc1697 { + *v = yyv1697 } } @@ -18184,10 +20557,10 @@ func (x codecSelfer1234) encSliceAPIVersion(v []APIVersion, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1508 := range v { + for _, yyv1701 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1509 := &yyv1508 - yy1509.CodecEncodeSelf(e) + yy1702 := &yyv1701 + yy1702.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18197,83 +20570,83 @@ func (x codecSelfer1234) decSliceAPIVersion(v *[]APIVersion, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1510 := *v - yyh1510, yyl1510 := z.DecSliceHelperStart() - var yyc1510 bool - if yyl1510 == 0 { - if yyv1510 == nil { - yyv1510 = []APIVersion{} - yyc1510 = true - } else if len(yyv1510) != 0 { - yyv1510 = yyv1510[:0] - yyc1510 = true + yyv1703 := *v + yyh1703, yyl1703 := z.DecSliceHelperStart() + var yyc1703 bool + if yyl1703 == 0 { + if yyv1703 == nil { + yyv1703 = []APIVersion{} + yyc1703 = true + } else if len(yyv1703) != 0 { + yyv1703 = yyv1703[:0] + yyc1703 = true } - } else if yyl1510 > 0 { - var yyrr1510, yyrl1510 int - var yyrt1510 bool - if yyl1510 > cap(yyv1510) { + } else if yyl1703 > 0 { + var yyrr1703, yyrl1703 int + var yyrt1703 bool + if yyl1703 > cap(yyv1703) { - yyrg1510 := len(yyv1510) > 0 - yyv21510 := yyv1510 - yyrl1510, yyrt1510 = z.DecInferLen(yyl1510, z.DecBasicHandle().MaxInitLen, 32) - if yyrt1510 { - if yyrl1510 <= cap(yyv1510) { - yyv1510 = yyv1510[:yyrl1510] + yyrg1703 := len(yyv1703) > 0 + yyv21703 := yyv1703 + yyrl1703, yyrt1703 = z.DecInferLen(yyl1703, z.DecBasicHandle().MaxInitLen, 32) + if yyrt1703 { + if yyrl1703 <= cap(yyv1703) { + yyv1703 = yyv1703[:yyrl1703] } else { - yyv1510 = make([]APIVersion, yyrl1510) + yyv1703 = make([]APIVersion, yyrl1703) } } else { - yyv1510 = make([]APIVersion, yyrl1510) + yyv1703 = make([]APIVersion, yyrl1703) } - yyc1510 = true - yyrr1510 = len(yyv1510) - if yyrg1510 { - copy(yyv1510, yyv21510) + yyc1703 = true + yyrr1703 = len(yyv1703) + if yyrg1703 { + copy(yyv1703, yyv21703) } - } else if yyl1510 != len(yyv1510) { - yyv1510 = yyv1510[:yyl1510] - yyc1510 = true + } else if yyl1703 != len(yyv1703) { + yyv1703 = yyv1703[:yyl1703] + yyc1703 = true } - yyj1510 := 0 - for ; yyj1510 < yyrr1510; yyj1510++ { - yyh1510.ElemContainerState(yyj1510) + yyj1703 := 0 + for ; yyj1703 < yyrr1703; yyj1703++ { + yyh1703.ElemContainerState(yyj1703) if r.TryDecodeAsNil() { - yyv1510[yyj1510] = APIVersion{} + yyv1703[yyj1703] = APIVersion{} } else { - yyv1511 := &yyv1510[yyj1510] - yyv1511.CodecDecodeSelf(d) + yyv1704 := &yyv1703[yyj1703] + yyv1704.CodecDecodeSelf(d) } } - if yyrt1510 { - for ; yyj1510 < yyl1510; yyj1510++ { - yyv1510 = append(yyv1510, APIVersion{}) - yyh1510.ElemContainerState(yyj1510) + if yyrt1703 { + for ; yyj1703 < yyl1703; yyj1703++ { + yyv1703 = append(yyv1703, APIVersion{}) + yyh1703.ElemContainerState(yyj1703) if r.TryDecodeAsNil() { - yyv1510[yyj1510] = APIVersion{} + yyv1703[yyj1703] = APIVersion{} } else { - yyv1512 := &yyv1510[yyj1510] - yyv1512.CodecDecodeSelf(d) + yyv1705 := &yyv1703[yyj1703] + yyv1705.CodecDecodeSelf(d) } } } } else { - yyj1510 := 0 - for ; !r.CheckBreak(); yyj1510++ { + yyj1703 := 0 + for ; !r.CheckBreak(); yyj1703++ { - if yyj1510 >= len(yyv1510) { - yyv1510 = append(yyv1510, APIVersion{}) // var yyz1510 APIVersion - yyc1510 = true + if yyj1703 >= len(yyv1703) { + yyv1703 = append(yyv1703, APIVersion{}) // var yyz1703 APIVersion + yyc1703 = true } - yyh1510.ElemContainerState(yyj1510) - if yyj1510 < len(yyv1510) { + yyh1703.ElemContainerState(yyj1703) + if yyj1703 < len(yyv1703) { if r.TryDecodeAsNil() { - yyv1510[yyj1510] = APIVersion{} + yyv1703[yyj1703] = APIVersion{} } else { - yyv1513 := &yyv1510[yyj1510] - yyv1513.CodecDecodeSelf(d) + yyv1706 := &yyv1703[yyj1703] + yyv1706.CodecDecodeSelf(d) } } else { @@ -18281,17 +20654,17 @@ func (x codecSelfer1234) decSliceAPIVersion(v *[]APIVersion, d *codec1978.Decode } } - if yyj1510 < len(yyv1510) { - yyv1510 = yyv1510[:yyj1510] - yyc1510 = true - } else if yyj1510 == 0 && yyv1510 == nil { - yyv1510 = []APIVersion{} - yyc1510 = true + if yyj1703 < len(yyv1703) { + yyv1703 = yyv1703[:yyj1703] + yyc1703 = true + } else if yyj1703 == 0 && yyv1703 == nil { + yyv1703 = []APIVersion{} + yyc1703 = true } } - yyh1510.End() - if yyc1510 { - *v = yyv1510 + yyh1703.End() + if yyc1703 { + *v = yyv1703 } } @@ -18300,10 +20673,10 @@ func (x codecSelfer1234) encSliceThirdPartyResource(v []ThirdPartyResource, e *c z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1514 := range v { + for _, yyv1707 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1515 := &yyv1514 - yy1515.CodecEncodeSelf(e) + yy1708 := &yyv1707 + yy1708.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18313,83 +20686,83 @@ func (x codecSelfer1234) decSliceThirdPartyResource(v *[]ThirdPartyResource, d * z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1516 := *v - yyh1516, yyl1516 := z.DecSliceHelperStart() - var yyc1516 bool - if yyl1516 == 0 { - if yyv1516 == nil { - yyv1516 = []ThirdPartyResource{} - yyc1516 = true - } else if len(yyv1516) != 0 { - yyv1516 = yyv1516[:0] - yyc1516 = true + yyv1709 := *v + yyh1709, yyl1709 := z.DecSliceHelperStart() + var yyc1709 bool + if yyl1709 == 0 { + if yyv1709 == nil { + yyv1709 = []ThirdPartyResource{} + yyc1709 = true + } else if len(yyv1709) != 0 { + yyv1709 = yyv1709[:0] + yyc1709 = true } - } else if yyl1516 > 0 { - var yyrr1516, yyrl1516 int - var yyrt1516 bool - if yyl1516 > cap(yyv1516) { + } else if yyl1709 > 0 { + var yyrr1709, yyrl1709 int + var yyrt1709 bool + if yyl1709 > cap(yyv1709) { - yyrg1516 := len(yyv1516) > 0 - yyv21516 := yyv1516 - yyrl1516, yyrt1516 = z.DecInferLen(yyl1516, z.DecBasicHandle().MaxInitLen, 232) - if yyrt1516 { - if yyrl1516 <= cap(yyv1516) { - yyv1516 = yyv1516[:yyrl1516] + yyrg1709 := len(yyv1709) > 0 + yyv21709 := yyv1709 + yyrl1709, yyrt1709 = z.DecInferLen(yyl1709, z.DecBasicHandle().MaxInitLen, 232) + if yyrt1709 { + if yyrl1709 <= cap(yyv1709) { + yyv1709 = yyv1709[:yyrl1709] } else { - yyv1516 = make([]ThirdPartyResource, yyrl1516) + yyv1709 = make([]ThirdPartyResource, yyrl1709) } } else { - yyv1516 = make([]ThirdPartyResource, yyrl1516) + yyv1709 = make([]ThirdPartyResource, yyrl1709) } - yyc1516 = true - yyrr1516 = len(yyv1516) - if yyrg1516 { - copy(yyv1516, yyv21516) + yyc1709 = true + yyrr1709 = len(yyv1709) + if yyrg1709 { + copy(yyv1709, yyv21709) } - } else if yyl1516 != len(yyv1516) { - yyv1516 = yyv1516[:yyl1516] - yyc1516 = true + } else if yyl1709 != len(yyv1709) { + yyv1709 = yyv1709[:yyl1709] + yyc1709 = true } - yyj1516 := 0 - for ; yyj1516 < yyrr1516; yyj1516++ { - yyh1516.ElemContainerState(yyj1516) + yyj1709 := 0 + for ; yyj1709 < yyrr1709; yyj1709++ { + yyh1709.ElemContainerState(yyj1709) if r.TryDecodeAsNil() { - yyv1516[yyj1516] = ThirdPartyResource{} + yyv1709[yyj1709] = ThirdPartyResource{} } else { - yyv1517 := &yyv1516[yyj1516] - yyv1517.CodecDecodeSelf(d) + yyv1710 := &yyv1709[yyj1709] + yyv1710.CodecDecodeSelf(d) } } - if yyrt1516 { - for ; yyj1516 < yyl1516; yyj1516++ { - yyv1516 = append(yyv1516, ThirdPartyResource{}) - yyh1516.ElemContainerState(yyj1516) + if yyrt1709 { + for ; yyj1709 < yyl1709; yyj1709++ { + yyv1709 = append(yyv1709, ThirdPartyResource{}) + yyh1709.ElemContainerState(yyj1709) if r.TryDecodeAsNil() { - yyv1516[yyj1516] = ThirdPartyResource{} + yyv1709[yyj1709] = ThirdPartyResource{} } else { - yyv1518 := &yyv1516[yyj1516] - yyv1518.CodecDecodeSelf(d) + yyv1711 := &yyv1709[yyj1709] + yyv1711.CodecDecodeSelf(d) } } } } else { - yyj1516 := 0 - for ; !r.CheckBreak(); yyj1516++ { + yyj1709 := 0 + for ; !r.CheckBreak(); yyj1709++ { - if yyj1516 >= len(yyv1516) { - yyv1516 = append(yyv1516, ThirdPartyResource{}) // var yyz1516 ThirdPartyResource - yyc1516 = true + if yyj1709 >= len(yyv1709) { + yyv1709 = append(yyv1709, ThirdPartyResource{}) // var yyz1709 ThirdPartyResource + yyc1709 = true } - yyh1516.ElemContainerState(yyj1516) - if yyj1516 < len(yyv1516) { + yyh1709.ElemContainerState(yyj1709) + if yyj1709 < len(yyv1709) { if r.TryDecodeAsNil() { - yyv1516[yyj1516] = ThirdPartyResource{} + yyv1709[yyj1709] = ThirdPartyResource{} } else { - yyv1519 := &yyv1516[yyj1516] - yyv1519.CodecDecodeSelf(d) + yyv1712 := &yyv1709[yyj1709] + yyv1712.CodecDecodeSelf(d) } } else { @@ -18397,17 +20770,17 @@ func (x codecSelfer1234) decSliceThirdPartyResource(v *[]ThirdPartyResource, d * } } - if yyj1516 < len(yyv1516) { - yyv1516 = yyv1516[:yyj1516] - yyc1516 = true - } else if yyj1516 == 0 && yyv1516 == nil { - yyv1516 = []ThirdPartyResource{} - yyc1516 = true + if yyj1709 < len(yyv1709) { + yyv1709 = yyv1709[:yyj1709] + yyc1709 = true + } else if yyj1709 == 0 && yyv1709 == nil { + yyv1709 = []ThirdPartyResource{} + yyc1709 = true } } - yyh1516.End() - if yyc1516 { - *v = yyv1516 + yyh1709.End() + if yyc1709 { + *v = yyv1709 } } @@ -18416,10 +20789,10 @@ func (x codecSelfer1234) encSliceDeployment(v []Deployment, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1520 := range v { + for _, yyv1713 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1521 := &yyv1520 - yy1521.CodecEncodeSelf(e) + yy1714 := &yyv1713 + yy1714.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18429,83 +20802,83 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1522 := *v - yyh1522, yyl1522 := z.DecSliceHelperStart() - var yyc1522 bool - if yyl1522 == 0 { - if yyv1522 == nil { - yyv1522 = []Deployment{} - yyc1522 = true - } else if len(yyv1522) != 0 { - yyv1522 = yyv1522[:0] - yyc1522 = true + yyv1715 := *v + yyh1715, yyl1715 := z.DecSliceHelperStart() + var yyc1715 bool + if yyl1715 == 0 { + if yyv1715 == nil { + yyv1715 = []Deployment{} + yyc1715 = true + } else if len(yyv1715) != 0 { + yyv1715 = yyv1715[:0] + yyc1715 = true } - } else if yyl1522 > 0 { - var yyrr1522, yyrl1522 int - var yyrt1522 bool - if yyl1522 > cap(yyv1522) { + } else if yyl1715 > 0 { + var yyrr1715, yyrl1715 int + var yyrt1715 bool + if yyl1715 > cap(yyv1715) { - yyrg1522 := len(yyv1522) > 0 - yyv21522 := yyv1522 - yyrl1522, yyrt1522 = z.DecInferLen(yyl1522, z.DecBasicHandle().MaxInitLen, 632) - if yyrt1522 { - if yyrl1522 <= cap(yyv1522) { - yyv1522 = yyv1522[:yyrl1522] + yyrg1715 := len(yyv1715) > 0 + yyv21715 := yyv1715 + yyrl1715, yyrt1715 = z.DecInferLen(yyl1715, z.DecBasicHandle().MaxInitLen, 632) + if yyrt1715 { + if yyrl1715 <= cap(yyv1715) { + yyv1715 = yyv1715[:yyrl1715] } else { - yyv1522 = make([]Deployment, yyrl1522) + yyv1715 = make([]Deployment, yyrl1715) } } else { - yyv1522 = make([]Deployment, yyrl1522) + yyv1715 = make([]Deployment, yyrl1715) } - yyc1522 = true - yyrr1522 = len(yyv1522) - if yyrg1522 { - copy(yyv1522, yyv21522) + yyc1715 = true + yyrr1715 = len(yyv1715) + if yyrg1715 { + copy(yyv1715, yyv21715) } - } else if yyl1522 != len(yyv1522) { - yyv1522 = yyv1522[:yyl1522] - yyc1522 = true + } else if yyl1715 != len(yyv1715) { + yyv1715 = yyv1715[:yyl1715] + yyc1715 = true } - yyj1522 := 0 - for ; yyj1522 < yyrr1522; yyj1522++ { - yyh1522.ElemContainerState(yyj1522) + yyj1715 := 0 + for ; yyj1715 < yyrr1715; yyj1715++ { + yyh1715.ElemContainerState(yyj1715) if r.TryDecodeAsNil() { - yyv1522[yyj1522] = Deployment{} + yyv1715[yyj1715] = Deployment{} } else { - yyv1523 := &yyv1522[yyj1522] - yyv1523.CodecDecodeSelf(d) + yyv1716 := &yyv1715[yyj1715] + yyv1716.CodecDecodeSelf(d) } } - if yyrt1522 { - for ; yyj1522 < yyl1522; yyj1522++ { - yyv1522 = append(yyv1522, Deployment{}) - yyh1522.ElemContainerState(yyj1522) + if yyrt1715 { + for ; yyj1715 < yyl1715; yyj1715++ { + yyv1715 = append(yyv1715, Deployment{}) + yyh1715.ElemContainerState(yyj1715) if r.TryDecodeAsNil() { - yyv1522[yyj1522] = Deployment{} + yyv1715[yyj1715] = Deployment{} } else { - yyv1524 := &yyv1522[yyj1522] - yyv1524.CodecDecodeSelf(d) + yyv1717 := &yyv1715[yyj1715] + yyv1717.CodecDecodeSelf(d) } } } } else { - yyj1522 := 0 - for ; !r.CheckBreak(); yyj1522++ { + yyj1715 := 0 + for ; !r.CheckBreak(); yyj1715++ { - if yyj1522 >= len(yyv1522) { - yyv1522 = append(yyv1522, Deployment{}) // var yyz1522 Deployment - yyc1522 = true + if yyj1715 >= len(yyv1715) { + yyv1715 = append(yyv1715, Deployment{}) // var yyz1715 Deployment + yyc1715 = true } - yyh1522.ElemContainerState(yyj1522) - if yyj1522 < len(yyv1522) { + yyh1715.ElemContainerState(yyj1715) + if yyj1715 < len(yyv1715) { if r.TryDecodeAsNil() { - yyv1522[yyj1522] = Deployment{} + yyv1715[yyj1715] = Deployment{} } else { - yyv1525 := &yyv1522[yyj1522] - yyv1525.CodecDecodeSelf(d) + yyv1718 := &yyv1715[yyj1715] + yyv1718.CodecDecodeSelf(d) } } else { @@ -18513,17 +20886,17 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode } } - if yyj1522 < len(yyv1522) { - yyv1522 = yyv1522[:yyj1522] - yyc1522 = true - } else if yyj1522 == 0 && yyv1522 == nil { - yyv1522 = []Deployment{} - yyc1522 = true + if yyj1715 < len(yyv1715) { + yyv1715 = yyv1715[:yyj1715] + yyc1715 = true + } else if yyj1715 == 0 && yyv1715 == nil { + yyv1715 = []Deployment{} + yyc1715 = true } } - yyh1522.End() - if yyc1522 { - *v = yyv1522 + yyh1715.End() + if yyc1715 { + *v = yyv1715 } } @@ -18532,10 +20905,10 @@ func (x codecSelfer1234) encSliceDaemonSet(v []DaemonSet, e *codec1978.Encoder) z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1526 := range v { + for _, yyv1719 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1527 := &yyv1526 - yy1527.CodecEncodeSelf(e) + yy1720 := &yyv1719 + yy1720.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18545,83 +20918,83 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder) z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1528 := *v - yyh1528, yyl1528 := z.DecSliceHelperStart() - var yyc1528 bool - if yyl1528 == 0 { - if yyv1528 == nil { - yyv1528 = []DaemonSet{} - yyc1528 = true - } else if len(yyv1528) != 0 { - yyv1528 = yyv1528[:0] - yyc1528 = true + yyv1721 := *v + yyh1721, yyl1721 := z.DecSliceHelperStart() + var yyc1721 bool + if yyl1721 == 0 { + if yyv1721 == nil { + yyv1721 = []DaemonSet{} + yyc1721 = true + } else if len(yyv1721) != 0 { + yyv1721 = yyv1721[:0] + yyc1721 = true } - } else if yyl1528 > 0 { - var yyrr1528, yyrl1528 int - var yyrt1528 bool - if yyl1528 > cap(yyv1528) { + } else if yyl1721 > 0 { + var yyrr1721, yyrl1721 int + var yyrt1721 bool + if yyl1721 > cap(yyv1721) { - yyrg1528 := len(yyv1528) > 0 - yyv21528 := yyv1528 - yyrl1528, yyrt1528 = z.DecInferLen(yyl1528, z.DecBasicHandle().MaxInitLen, 600) - if yyrt1528 { - if yyrl1528 <= cap(yyv1528) { - yyv1528 = yyv1528[:yyrl1528] + yyrg1721 := len(yyv1721) > 0 + yyv21721 := yyv1721 + yyrl1721, yyrt1721 = z.DecInferLen(yyl1721, z.DecBasicHandle().MaxInitLen, 600) + if yyrt1721 { + if yyrl1721 <= cap(yyv1721) { + yyv1721 = yyv1721[:yyrl1721] } else { - yyv1528 = make([]DaemonSet, yyrl1528) + yyv1721 = make([]DaemonSet, yyrl1721) } } else { - yyv1528 = make([]DaemonSet, yyrl1528) + yyv1721 = make([]DaemonSet, yyrl1721) } - yyc1528 = true - yyrr1528 = len(yyv1528) - if yyrg1528 { - copy(yyv1528, yyv21528) + yyc1721 = true + yyrr1721 = len(yyv1721) + if yyrg1721 { + copy(yyv1721, yyv21721) } - } else if yyl1528 != len(yyv1528) { - yyv1528 = yyv1528[:yyl1528] - yyc1528 = true + } else if yyl1721 != len(yyv1721) { + yyv1721 = yyv1721[:yyl1721] + yyc1721 = true } - yyj1528 := 0 - for ; yyj1528 < yyrr1528; yyj1528++ { - yyh1528.ElemContainerState(yyj1528) + yyj1721 := 0 + for ; yyj1721 < yyrr1721; yyj1721++ { + yyh1721.ElemContainerState(yyj1721) if r.TryDecodeAsNil() { - yyv1528[yyj1528] = DaemonSet{} + yyv1721[yyj1721] = DaemonSet{} } else { - yyv1529 := &yyv1528[yyj1528] - yyv1529.CodecDecodeSelf(d) + yyv1722 := &yyv1721[yyj1721] + yyv1722.CodecDecodeSelf(d) } } - if yyrt1528 { - for ; yyj1528 < yyl1528; yyj1528++ { - yyv1528 = append(yyv1528, DaemonSet{}) - yyh1528.ElemContainerState(yyj1528) + if yyrt1721 { + for ; yyj1721 < yyl1721; yyj1721++ { + yyv1721 = append(yyv1721, DaemonSet{}) + yyh1721.ElemContainerState(yyj1721) if r.TryDecodeAsNil() { - yyv1528[yyj1528] = DaemonSet{} + yyv1721[yyj1721] = DaemonSet{} } else { - yyv1530 := &yyv1528[yyj1528] - yyv1530.CodecDecodeSelf(d) + yyv1723 := &yyv1721[yyj1721] + yyv1723.CodecDecodeSelf(d) } } } } else { - yyj1528 := 0 - for ; !r.CheckBreak(); yyj1528++ { + yyj1721 := 0 + for ; !r.CheckBreak(); yyj1721++ { - if yyj1528 >= len(yyv1528) { - yyv1528 = append(yyv1528, DaemonSet{}) // var yyz1528 DaemonSet - yyc1528 = true + if yyj1721 >= len(yyv1721) { + yyv1721 = append(yyv1721, DaemonSet{}) // var yyz1721 DaemonSet + yyc1721 = true } - yyh1528.ElemContainerState(yyj1528) - if yyj1528 < len(yyv1528) { + yyh1721.ElemContainerState(yyj1721) + if yyj1721 < len(yyv1721) { if r.TryDecodeAsNil() { - yyv1528[yyj1528] = DaemonSet{} + yyv1721[yyj1721] = DaemonSet{} } else { - yyv1531 := &yyv1528[yyj1528] - yyv1531.CodecDecodeSelf(d) + yyv1724 := &yyv1721[yyj1721] + yyv1724.CodecDecodeSelf(d) } } else { @@ -18629,17 +21002,17 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder) } } - if yyj1528 < len(yyv1528) { - yyv1528 = yyv1528[:yyj1528] - yyc1528 = true - } else if yyj1528 == 0 && yyv1528 == nil { - yyv1528 = []DaemonSet{} - yyc1528 = true + if yyj1721 < len(yyv1721) { + yyv1721 = yyv1721[:yyj1721] + yyc1721 = true + } else if yyj1721 == 0 && yyv1721 == nil { + yyv1721 = []DaemonSet{} + yyc1721 = true } } - yyh1528.End() - if yyc1528 { - *v = yyv1528 + yyh1721.End() + if yyc1721 { + *v = yyv1721 } } @@ -18648,10 +21021,10 @@ func (x codecSelfer1234) encSliceThirdPartyResourceData(v []ThirdPartyResourceDa z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1532 := range v { + for _, yyv1725 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1533 := &yyv1532 - yy1533.CodecEncodeSelf(e) + yy1726 := &yyv1725 + yy1726.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18661,83 +21034,83 @@ func (x codecSelfer1234) decSliceThirdPartyResourceData(v *[]ThirdPartyResourceD z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1534 := *v - yyh1534, yyl1534 := z.DecSliceHelperStart() - var yyc1534 bool - if yyl1534 == 0 { - if yyv1534 == nil { - yyv1534 = []ThirdPartyResourceData{} - yyc1534 = true - } else if len(yyv1534) != 0 { - yyv1534 = yyv1534[:0] - yyc1534 = true + yyv1727 := *v + yyh1727, yyl1727 := z.DecSliceHelperStart() + var yyc1727 bool + if yyl1727 == 0 { + if yyv1727 == nil { + yyv1727 = []ThirdPartyResourceData{} + yyc1727 = true + } else if len(yyv1727) != 0 { + yyv1727 = yyv1727[:0] + yyc1727 = true } - } else if yyl1534 > 0 { - var yyrr1534, yyrl1534 int - var yyrt1534 bool - if yyl1534 > cap(yyv1534) { + } else if yyl1727 > 0 { + var yyrr1727, yyrl1727 int + var yyrt1727 bool + if yyl1727 > cap(yyv1727) { - yyrg1534 := len(yyv1534) > 0 - yyv21534 := yyv1534 - yyrl1534, yyrt1534 = z.DecInferLen(yyl1534, z.DecBasicHandle().MaxInitLen, 216) - if yyrt1534 { - if yyrl1534 <= cap(yyv1534) { - yyv1534 = yyv1534[:yyrl1534] + yyrg1727 := len(yyv1727) > 0 + yyv21727 := yyv1727 + yyrl1727, yyrt1727 = z.DecInferLen(yyl1727, z.DecBasicHandle().MaxInitLen, 216) + if yyrt1727 { + if yyrl1727 <= cap(yyv1727) { + yyv1727 = yyv1727[:yyrl1727] } else { - yyv1534 = make([]ThirdPartyResourceData, yyrl1534) + yyv1727 = make([]ThirdPartyResourceData, yyrl1727) } } else { - yyv1534 = make([]ThirdPartyResourceData, yyrl1534) + yyv1727 = make([]ThirdPartyResourceData, yyrl1727) } - yyc1534 = true - yyrr1534 = len(yyv1534) - if yyrg1534 { - copy(yyv1534, yyv21534) + yyc1727 = true + yyrr1727 = len(yyv1727) + if yyrg1727 { + copy(yyv1727, yyv21727) } - } else if yyl1534 != len(yyv1534) { - yyv1534 = yyv1534[:yyl1534] - yyc1534 = true + } else if yyl1727 != len(yyv1727) { + yyv1727 = yyv1727[:yyl1727] + yyc1727 = true } - yyj1534 := 0 - for ; yyj1534 < yyrr1534; yyj1534++ { - yyh1534.ElemContainerState(yyj1534) + yyj1727 := 0 + for ; yyj1727 < yyrr1727; yyj1727++ { + yyh1727.ElemContainerState(yyj1727) if r.TryDecodeAsNil() { - yyv1534[yyj1534] = ThirdPartyResourceData{} + yyv1727[yyj1727] = ThirdPartyResourceData{} } else { - yyv1535 := &yyv1534[yyj1534] - yyv1535.CodecDecodeSelf(d) + yyv1728 := &yyv1727[yyj1727] + yyv1728.CodecDecodeSelf(d) } } - if yyrt1534 { - for ; yyj1534 < yyl1534; yyj1534++ { - yyv1534 = append(yyv1534, ThirdPartyResourceData{}) - yyh1534.ElemContainerState(yyj1534) + if yyrt1727 { + for ; yyj1727 < yyl1727; yyj1727++ { + yyv1727 = append(yyv1727, ThirdPartyResourceData{}) + yyh1727.ElemContainerState(yyj1727) if r.TryDecodeAsNil() { - yyv1534[yyj1534] = ThirdPartyResourceData{} + yyv1727[yyj1727] = ThirdPartyResourceData{} } else { - yyv1536 := &yyv1534[yyj1534] - yyv1536.CodecDecodeSelf(d) + yyv1729 := &yyv1727[yyj1727] + yyv1729.CodecDecodeSelf(d) } } } } else { - yyj1534 := 0 - for ; !r.CheckBreak(); yyj1534++ { + yyj1727 := 0 + for ; !r.CheckBreak(); yyj1727++ { - if yyj1534 >= len(yyv1534) { - yyv1534 = append(yyv1534, ThirdPartyResourceData{}) // var yyz1534 ThirdPartyResourceData - yyc1534 = true + if yyj1727 >= len(yyv1727) { + yyv1727 = append(yyv1727, ThirdPartyResourceData{}) // var yyz1727 ThirdPartyResourceData + yyc1727 = true } - yyh1534.ElemContainerState(yyj1534) - if yyj1534 < len(yyv1534) { + yyh1727.ElemContainerState(yyj1727) + if yyj1727 < len(yyv1727) { if r.TryDecodeAsNil() { - yyv1534[yyj1534] = ThirdPartyResourceData{} + yyv1727[yyj1727] = ThirdPartyResourceData{} } else { - yyv1537 := &yyv1534[yyj1534] - yyv1537.CodecDecodeSelf(d) + yyv1730 := &yyv1727[yyj1727] + yyv1730.CodecDecodeSelf(d) } } else { @@ -18745,17 +21118,17 @@ func (x codecSelfer1234) decSliceThirdPartyResourceData(v *[]ThirdPartyResourceD } } - if yyj1534 < len(yyv1534) { - yyv1534 = yyv1534[:yyj1534] - yyc1534 = true - } else if yyj1534 == 0 && yyv1534 == nil { - yyv1534 = []ThirdPartyResourceData{} - yyc1534 = true + if yyj1727 < len(yyv1727) { + yyv1727 = yyv1727[:yyj1727] + yyc1727 = true + } else if yyj1727 == 0 && yyv1727 == nil { + yyv1727 = []ThirdPartyResourceData{} + yyc1727 = true } } - yyh1534.End() - if yyc1534 { - *v = yyv1534 + yyh1727.End() + if yyc1727 { + *v = yyv1727 } } @@ -18764,10 +21137,10 @@ func (x codecSelfer1234) encSliceJob(v []Job, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1538 := range v { + for _, yyv1731 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1539 := &yyv1538 - yy1539.CodecEncodeSelf(e) + yy1732 := &yyv1731 + yy1732.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18777,83 +21150,83 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1540 := *v - yyh1540, yyl1540 := z.DecSliceHelperStart() - var yyc1540 bool - if yyl1540 == 0 { - if yyv1540 == nil { - yyv1540 = []Job{} - yyc1540 = true - } else if len(yyv1540) != 0 { - yyv1540 = yyv1540[:0] - yyc1540 = true + yyv1733 := *v + yyh1733, yyl1733 := z.DecSliceHelperStart() + var yyc1733 bool + if yyl1733 == 0 { + if yyv1733 == nil { + yyv1733 = []Job{} + yyc1733 = true + } else if len(yyv1733) != 0 { + yyv1733 = yyv1733[:0] + yyc1733 = true } - } else if yyl1540 > 0 { - var yyrr1540, yyrl1540 int - var yyrt1540 bool - if yyl1540 > cap(yyv1540) { + } else if yyl1733 > 0 { + var yyrr1733, yyrl1733 int + var yyrt1733 bool + if yyl1733 > cap(yyv1733) { - yyrg1540 := len(yyv1540) > 0 - yyv21540 := yyv1540 - yyrl1540, yyrt1540 = z.DecInferLen(yyl1540, z.DecBasicHandle().MaxInitLen, 632) - if yyrt1540 { - if yyrl1540 <= cap(yyv1540) { - yyv1540 = yyv1540[:yyrl1540] + yyrg1733 := len(yyv1733) > 0 + yyv21733 := yyv1733 + yyrl1733, yyrt1733 = z.DecInferLen(yyl1733, z.DecBasicHandle().MaxInitLen, 632) + if yyrt1733 { + if yyrl1733 <= cap(yyv1733) { + yyv1733 = yyv1733[:yyrl1733] } else { - yyv1540 = make([]Job, yyrl1540) + yyv1733 = make([]Job, yyrl1733) } } else { - yyv1540 = make([]Job, yyrl1540) + yyv1733 = make([]Job, yyrl1733) } - yyc1540 = true - yyrr1540 = len(yyv1540) - if yyrg1540 { - copy(yyv1540, yyv21540) + yyc1733 = true + yyrr1733 = len(yyv1733) + if yyrg1733 { + copy(yyv1733, yyv21733) } - } else if yyl1540 != len(yyv1540) { - yyv1540 = yyv1540[:yyl1540] - yyc1540 = true + } else if yyl1733 != len(yyv1733) { + yyv1733 = yyv1733[:yyl1733] + yyc1733 = true } - yyj1540 := 0 - for ; yyj1540 < yyrr1540; yyj1540++ { - yyh1540.ElemContainerState(yyj1540) + yyj1733 := 0 + for ; yyj1733 < yyrr1733; yyj1733++ { + yyh1733.ElemContainerState(yyj1733) if r.TryDecodeAsNil() { - yyv1540[yyj1540] = Job{} + yyv1733[yyj1733] = Job{} } else { - yyv1541 := &yyv1540[yyj1540] - yyv1541.CodecDecodeSelf(d) + yyv1734 := &yyv1733[yyj1733] + yyv1734.CodecDecodeSelf(d) } } - if yyrt1540 { - for ; yyj1540 < yyl1540; yyj1540++ { - yyv1540 = append(yyv1540, Job{}) - yyh1540.ElemContainerState(yyj1540) + if yyrt1733 { + for ; yyj1733 < yyl1733; yyj1733++ { + yyv1733 = append(yyv1733, Job{}) + yyh1733.ElemContainerState(yyj1733) if r.TryDecodeAsNil() { - yyv1540[yyj1540] = Job{} + yyv1733[yyj1733] = Job{} } else { - yyv1542 := &yyv1540[yyj1540] - yyv1542.CodecDecodeSelf(d) + yyv1735 := &yyv1733[yyj1733] + yyv1735.CodecDecodeSelf(d) } } } } else { - yyj1540 := 0 - for ; !r.CheckBreak(); yyj1540++ { + yyj1733 := 0 + for ; !r.CheckBreak(); yyj1733++ { - if yyj1540 >= len(yyv1540) { - yyv1540 = append(yyv1540, Job{}) // var yyz1540 Job - yyc1540 = true + if yyj1733 >= len(yyv1733) { + yyv1733 = append(yyv1733, Job{}) // var yyz1733 Job + yyc1733 = true } - yyh1540.ElemContainerState(yyj1540) - if yyj1540 < len(yyv1540) { + yyh1733.ElemContainerState(yyj1733) + if yyj1733 < len(yyv1733) { if r.TryDecodeAsNil() { - yyv1540[yyj1540] = Job{} + yyv1733[yyj1733] = Job{} } else { - yyv1543 := &yyv1540[yyj1540] - yyv1543.CodecDecodeSelf(d) + yyv1736 := &yyv1733[yyj1733] + yyv1736.CodecDecodeSelf(d) } } else { @@ -18861,17 +21234,17 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { } } - if yyj1540 < len(yyv1540) { - yyv1540 = yyv1540[:yyj1540] - yyc1540 = true - } else if yyj1540 == 0 && yyv1540 == nil { - yyv1540 = []Job{} - yyc1540 = true + if yyj1733 < len(yyv1733) { + yyv1733 = yyv1733[:yyj1733] + yyc1733 = true + } else if yyj1733 == 0 && yyv1733 == nil { + yyv1733 = []Job{} + yyc1733 = true } } - yyh1540.End() - if yyc1540 { - *v = yyv1540 + yyh1733.End() + if yyc1733 { + *v = yyv1733 } } @@ -18880,10 +21253,10 @@ func (x codecSelfer1234) encSliceJobCondition(v []JobCondition, e *codec1978.Enc z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1544 := range v { + for _, yyv1737 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1545 := &yyv1544 - yy1545.CodecEncodeSelf(e) + yy1738 := &yyv1737 + yy1738.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -18893,83 +21266,83 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1546 := *v - yyh1546, yyl1546 := z.DecSliceHelperStart() - var yyc1546 bool - if yyl1546 == 0 { - if yyv1546 == nil { - yyv1546 = []JobCondition{} - yyc1546 = true - } else if len(yyv1546) != 0 { - yyv1546 = yyv1546[:0] - yyc1546 = true + yyv1739 := *v + yyh1739, yyl1739 := z.DecSliceHelperStart() + var yyc1739 bool + if yyl1739 == 0 { + if yyv1739 == nil { + yyv1739 = []JobCondition{} + yyc1739 = true + } else if len(yyv1739) != 0 { + yyv1739 = yyv1739[:0] + yyc1739 = true } - } else if yyl1546 > 0 { - var yyrr1546, yyrl1546 int - var yyrt1546 bool - if yyl1546 > cap(yyv1546) { + } else if yyl1739 > 0 { + var yyrr1739, yyrl1739 int + var yyrt1739 bool + if yyl1739 > cap(yyv1739) { - yyrg1546 := len(yyv1546) > 0 - yyv21546 := yyv1546 - yyrl1546, yyrt1546 = z.DecInferLen(yyl1546, z.DecBasicHandle().MaxInitLen, 112) - if yyrt1546 { - if yyrl1546 <= cap(yyv1546) { - yyv1546 = yyv1546[:yyrl1546] + yyrg1739 := len(yyv1739) > 0 + yyv21739 := yyv1739 + yyrl1739, yyrt1739 = z.DecInferLen(yyl1739, z.DecBasicHandle().MaxInitLen, 112) + if yyrt1739 { + if yyrl1739 <= cap(yyv1739) { + yyv1739 = yyv1739[:yyrl1739] } else { - yyv1546 = make([]JobCondition, yyrl1546) + yyv1739 = make([]JobCondition, yyrl1739) } } else { - yyv1546 = make([]JobCondition, yyrl1546) + yyv1739 = make([]JobCondition, yyrl1739) } - yyc1546 = true - yyrr1546 = len(yyv1546) - if yyrg1546 { - copy(yyv1546, yyv21546) + yyc1739 = true + yyrr1739 = len(yyv1739) + if yyrg1739 { + copy(yyv1739, yyv21739) } - } else if yyl1546 != len(yyv1546) { - yyv1546 = yyv1546[:yyl1546] - yyc1546 = true + } else if yyl1739 != len(yyv1739) { + yyv1739 = yyv1739[:yyl1739] + yyc1739 = true } - yyj1546 := 0 - for ; yyj1546 < yyrr1546; yyj1546++ { - yyh1546.ElemContainerState(yyj1546) + yyj1739 := 0 + for ; yyj1739 < yyrr1739; yyj1739++ { + yyh1739.ElemContainerState(yyj1739) if r.TryDecodeAsNil() { - yyv1546[yyj1546] = JobCondition{} + yyv1739[yyj1739] = JobCondition{} } else { - yyv1547 := &yyv1546[yyj1546] - yyv1547.CodecDecodeSelf(d) + yyv1740 := &yyv1739[yyj1739] + yyv1740.CodecDecodeSelf(d) } } - if yyrt1546 { - for ; yyj1546 < yyl1546; yyj1546++ { - yyv1546 = append(yyv1546, JobCondition{}) - yyh1546.ElemContainerState(yyj1546) + if yyrt1739 { + for ; yyj1739 < yyl1739; yyj1739++ { + yyv1739 = append(yyv1739, JobCondition{}) + yyh1739.ElemContainerState(yyj1739) if r.TryDecodeAsNil() { - yyv1546[yyj1546] = JobCondition{} + yyv1739[yyj1739] = JobCondition{} } else { - yyv1548 := &yyv1546[yyj1546] - yyv1548.CodecDecodeSelf(d) + yyv1741 := &yyv1739[yyj1739] + yyv1741.CodecDecodeSelf(d) } } } } else { - yyj1546 := 0 - for ; !r.CheckBreak(); yyj1546++ { + yyj1739 := 0 + for ; !r.CheckBreak(); yyj1739++ { - if yyj1546 >= len(yyv1546) { - yyv1546 = append(yyv1546, JobCondition{}) // var yyz1546 JobCondition - yyc1546 = true + if yyj1739 >= len(yyv1739) { + yyv1739 = append(yyv1739, JobCondition{}) // var yyz1739 JobCondition + yyc1739 = true } - yyh1546.ElemContainerState(yyj1546) - if yyj1546 < len(yyv1546) { + yyh1739.ElemContainerState(yyj1739) + if yyj1739 < len(yyv1739) { if r.TryDecodeAsNil() { - yyv1546[yyj1546] = JobCondition{} + yyv1739[yyj1739] = JobCondition{} } else { - yyv1549 := &yyv1546[yyj1546] - yyv1549.CodecDecodeSelf(d) + yyv1742 := &yyv1739[yyj1739] + yyv1742.CodecDecodeSelf(d) } } else { @@ -18977,17 +21350,17 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De } } - if yyj1546 < len(yyv1546) { - yyv1546 = yyv1546[:yyj1546] - yyc1546 = true - } else if yyj1546 == 0 && yyv1546 == nil { - yyv1546 = []JobCondition{} - yyc1546 = true + if yyj1739 < len(yyv1739) { + yyv1739 = yyv1739[:yyj1739] + yyc1739 = true + } else if yyj1739 == 0 && yyv1739 == nil { + yyv1739 = []JobCondition{} + yyc1739 = true } } - yyh1546.End() - if yyc1546 { - *v = yyv1546 + yyh1739.End() + if yyc1739 { + *v = yyv1739 } } @@ -18996,10 +21369,10 @@ func (x codecSelfer1234) encSliceIngress(v []Ingress, e *codec1978.Encoder) { z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1550 := range v { + for _, yyv1743 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1551 := &yyv1550 - yy1551.CodecEncodeSelf(e) + yy1744 := &yyv1743 + yy1744.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19009,83 +21382,83 @@ func (x codecSelfer1234) decSliceIngress(v *[]Ingress, d *codec1978.Decoder) { z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1552 := *v - yyh1552, yyl1552 := z.DecSliceHelperStart() - var yyc1552 bool - if yyl1552 == 0 { - if yyv1552 == nil { - yyv1552 = []Ingress{} - yyc1552 = true - } else if len(yyv1552) != 0 { - yyv1552 = yyv1552[:0] - yyc1552 = true + yyv1745 := *v + yyh1745, yyl1745 := z.DecSliceHelperStart() + var yyc1745 bool + if yyl1745 == 0 { + if yyv1745 == nil { + yyv1745 = []Ingress{} + yyc1745 = true + } else if len(yyv1745) != 0 { + yyv1745 = yyv1745[:0] + yyc1745 = true } - } else if yyl1552 > 0 { - var yyrr1552, yyrl1552 int - var yyrt1552 bool - if yyl1552 > cap(yyv1552) { + } else if yyl1745 > 0 { + var yyrr1745, yyrl1745 int + var yyrt1745 bool + if yyl1745 > cap(yyv1745) { - yyrg1552 := len(yyv1552) > 0 - yyv21552 := yyv1552 - yyrl1552, yyrt1552 = z.DecInferLen(yyl1552, z.DecBasicHandle().MaxInitLen, 248) - if yyrt1552 { - if yyrl1552 <= cap(yyv1552) { - yyv1552 = yyv1552[:yyrl1552] + yyrg1745 := len(yyv1745) > 0 + yyv21745 := yyv1745 + yyrl1745, yyrt1745 = z.DecInferLen(yyl1745, z.DecBasicHandle().MaxInitLen, 272) + if yyrt1745 { + if yyrl1745 <= cap(yyv1745) { + yyv1745 = yyv1745[:yyrl1745] } else { - yyv1552 = make([]Ingress, yyrl1552) + yyv1745 = make([]Ingress, yyrl1745) } } else { - yyv1552 = make([]Ingress, yyrl1552) + yyv1745 = make([]Ingress, yyrl1745) } - yyc1552 = true - yyrr1552 = len(yyv1552) - if yyrg1552 { - copy(yyv1552, yyv21552) + yyc1745 = true + yyrr1745 = len(yyv1745) + if yyrg1745 { + copy(yyv1745, yyv21745) } - } else if yyl1552 != len(yyv1552) { - yyv1552 = yyv1552[:yyl1552] - yyc1552 = true + } else if yyl1745 != len(yyv1745) { + yyv1745 = yyv1745[:yyl1745] + yyc1745 = true } - yyj1552 := 0 - for ; yyj1552 < yyrr1552; yyj1552++ { - yyh1552.ElemContainerState(yyj1552) + yyj1745 := 0 + for ; yyj1745 < yyrr1745; yyj1745++ { + yyh1745.ElemContainerState(yyj1745) if r.TryDecodeAsNil() { - yyv1552[yyj1552] = Ingress{} + yyv1745[yyj1745] = Ingress{} } else { - yyv1553 := &yyv1552[yyj1552] - yyv1553.CodecDecodeSelf(d) + yyv1746 := &yyv1745[yyj1745] + yyv1746.CodecDecodeSelf(d) } } - if yyrt1552 { - for ; yyj1552 < yyl1552; yyj1552++ { - yyv1552 = append(yyv1552, Ingress{}) - yyh1552.ElemContainerState(yyj1552) + if yyrt1745 { + for ; yyj1745 < yyl1745; yyj1745++ { + yyv1745 = append(yyv1745, Ingress{}) + yyh1745.ElemContainerState(yyj1745) if r.TryDecodeAsNil() { - yyv1552[yyj1552] = Ingress{} + yyv1745[yyj1745] = Ingress{} } else { - yyv1554 := &yyv1552[yyj1552] - yyv1554.CodecDecodeSelf(d) + yyv1747 := &yyv1745[yyj1745] + yyv1747.CodecDecodeSelf(d) } } } } else { - yyj1552 := 0 - for ; !r.CheckBreak(); yyj1552++ { + yyj1745 := 0 + for ; !r.CheckBreak(); yyj1745++ { - if yyj1552 >= len(yyv1552) { - yyv1552 = append(yyv1552, Ingress{}) // var yyz1552 Ingress - yyc1552 = true + if yyj1745 >= len(yyv1745) { + yyv1745 = append(yyv1745, Ingress{}) // var yyz1745 Ingress + yyc1745 = true } - yyh1552.ElemContainerState(yyj1552) - if yyj1552 < len(yyv1552) { + yyh1745.ElemContainerState(yyj1745) + if yyj1745 < len(yyv1745) { if r.TryDecodeAsNil() { - yyv1552[yyj1552] = Ingress{} + yyv1745[yyj1745] = Ingress{} } else { - yyv1555 := &yyv1552[yyj1552] - yyv1555.CodecDecodeSelf(d) + yyv1748 := &yyv1745[yyj1745] + yyv1748.CodecDecodeSelf(d) } } else { @@ -19093,17 +21466,133 @@ func (x codecSelfer1234) decSliceIngress(v *[]Ingress, d *codec1978.Decoder) { } } - if yyj1552 < len(yyv1552) { - yyv1552 = yyv1552[:yyj1552] - yyc1552 = true - } else if yyj1552 == 0 && yyv1552 == nil { - yyv1552 = []Ingress{} - yyc1552 = true + if yyj1745 < len(yyv1745) { + yyv1745 = yyv1745[:yyj1745] + yyc1745 = true + } else if yyj1745 == 0 && yyv1745 == nil { + yyv1745 = []Ingress{} + yyc1745 = true } } - yyh1552.End() - if yyc1552 { - *v = yyv1552 + yyh1745.End() + if yyc1745 { + *v = yyv1745 + } +} + +func (x codecSelfer1234) encSliceIngressTLS(v []IngressTLS, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1749 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1750 := &yyv1749 + yy1750.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceIngressTLS(v *[]IngressTLS, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1751 := *v + yyh1751, yyl1751 := z.DecSliceHelperStart() + var yyc1751 bool + if yyl1751 == 0 { + if yyv1751 == nil { + yyv1751 = []IngressTLS{} + yyc1751 = true + } else if len(yyv1751) != 0 { + yyv1751 = yyv1751[:0] + yyc1751 = true + } + } else if yyl1751 > 0 { + var yyrr1751, yyrl1751 int + var yyrt1751 bool + if yyl1751 > cap(yyv1751) { + + yyrg1751 := len(yyv1751) > 0 + yyv21751 := yyv1751 + yyrl1751, yyrt1751 = z.DecInferLen(yyl1751, z.DecBasicHandle().MaxInitLen, 40) + if yyrt1751 { + if yyrl1751 <= cap(yyv1751) { + yyv1751 = yyv1751[:yyrl1751] + } else { + yyv1751 = make([]IngressTLS, yyrl1751) + } + } else { + yyv1751 = make([]IngressTLS, yyrl1751) + } + yyc1751 = true + yyrr1751 = len(yyv1751) + if yyrg1751 { + copy(yyv1751, yyv21751) + } + } else if yyl1751 != len(yyv1751) { + yyv1751 = yyv1751[:yyl1751] + yyc1751 = true + } + yyj1751 := 0 + for ; yyj1751 < yyrr1751; yyj1751++ { + yyh1751.ElemContainerState(yyj1751) + if r.TryDecodeAsNil() { + yyv1751[yyj1751] = IngressTLS{} + } else { + yyv1752 := &yyv1751[yyj1751] + yyv1752.CodecDecodeSelf(d) + } + + } + if yyrt1751 { + for ; yyj1751 < yyl1751; yyj1751++ { + yyv1751 = append(yyv1751, IngressTLS{}) + yyh1751.ElemContainerState(yyj1751) + if r.TryDecodeAsNil() { + yyv1751[yyj1751] = IngressTLS{} + } else { + yyv1753 := &yyv1751[yyj1751] + yyv1753.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1751 := 0 + for ; !r.CheckBreak(); yyj1751++ { + + if yyj1751 >= len(yyv1751) { + yyv1751 = append(yyv1751, IngressTLS{}) // var yyz1751 IngressTLS + yyc1751 = true + } + yyh1751.ElemContainerState(yyj1751) + if yyj1751 < len(yyv1751) { + if r.TryDecodeAsNil() { + yyv1751[yyj1751] = IngressTLS{} + } else { + yyv1754 := &yyv1751[yyj1751] + yyv1754.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1751 < len(yyv1751) { + yyv1751 = yyv1751[:yyj1751] + yyc1751 = true + } else if yyj1751 == 0 && yyv1751 == nil { + yyv1751 = []IngressTLS{} + yyc1751 = true + } + } + yyh1751.End() + if yyc1751 { + *v = yyv1751 } } @@ -19112,10 +21601,10 @@ func (x codecSelfer1234) encSliceIngressRule(v []IngressRule, e *codec1978.Encod z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1556 := range v { + for _, yyv1755 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1557 := &yyv1556 - yy1557.CodecEncodeSelf(e) + yy1756 := &yyv1755 + yy1756.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19125,83 +21614,83 @@ func (x codecSelfer1234) decSliceIngressRule(v *[]IngressRule, d *codec1978.Deco z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1558 := *v - yyh1558, yyl1558 := z.DecSliceHelperStart() - var yyc1558 bool - if yyl1558 == 0 { - if yyv1558 == nil { - yyv1558 = []IngressRule{} - yyc1558 = true - } else if len(yyv1558) != 0 { - yyv1558 = yyv1558[:0] - yyc1558 = true + yyv1757 := *v + yyh1757, yyl1757 := z.DecSliceHelperStart() + var yyc1757 bool + if yyl1757 == 0 { + if yyv1757 == nil { + yyv1757 = []IngressRule{} + yyc1757 = true + } else if len(yyv1757) != 0 { + yyv1757 = yyv1757[:0] + yyc1757 = true } - } else if yyl1558 > 0 { - var yyrr1558, yyrl1558 int - var yyrt1558 bool - if yyl1558 > cap(yyv1558) { + } else if yyl1757 > 0 { + var yyrr1757, yyrl1757 int + var yyrt1757 bool + if yyl1757 > cap(yyv1757) { - yyrg1558 := len(yyv1558) > 0 - yyv21558 := yyv1558 - yyrl1558, yyrt1558 = z.DecInferLen(yyl1558, z.DecBasicHandle().MaxInitLen, 24) - if yyrt1558 { - if yyrl1558 <= cap(yyv1558) { - yyv1558 = yyv1558[:yyrl1558] + yyrg1757 := len(yyv1757) > 0 + yyv21757 := yyv1757 + yyrl1757, yyrt1757 = z.DecInferLen(yyl1757, z.DecBasicHandle().MaxInitLen, 24) + if yyrt1757 { + if yyrl1757 <= cap(yyv1757) { + yyv1757 = yyv1757[:yyrl1757] } else { - yyv1558 = make([]IngressRule, yyrl1558) + yyv1757 = make([]IngressRule, yyrl1757) } } else { - yyv1558 = make([]IngressRule, yyrl1558) + yyv1757 = make([]IngressRule, yyrl1757) } - yyc1558 = true - yyrr1558 = len(yyv1558) - if yyrg1558 { - copy(yyv1558, yyv21558) + yyc1757 = true + yyrr1757 = len(yyv1757) + if yyrg1757 { + copy(yyv1757, yyv21757) } - } else if yyl1558 != len(yyv1558) { - yyv1558 = yyv1558[:yyl1558] - yyc1558 = true + } else if yyl1757 != len(yyv1757) { + yyv1757 = yyv1757[:yyl1757] + yyc1757 = true } - yyj1558 := 0 - for ; yyj1558 < yyrr1558; yyj1558++ { - yyh1558.ElemContainerState(yyj1558) + yyj1757 := 0 + for ; yyj1757 < yyrr1757; yyj1757++ { + yyh1757.ElemContainerState(yyj1757) if r.TryDecodeAsNil() { - yyv1558[yyj1558] = IngressRule{} + yyv1757[yyj1757] = IngressRule{} } else { - yyv1559 := &yyv1558[yyj1558] - yyv1559.CodecDecodeSelf(d) + yyv1758 := &yyv1757[yyj1757] + yyv1758.CodecDecodeSelf(d) } } - if yyrt1558 { - for ; yyj1558 < yyl1558; yyj1558++ { - yyv1558 = append(yyv1558, IngressRule{}) - yyh1558.ElemContainerState(yyj1558) + if yyrt1757 { + for ; yyj1757 < yyl1757; yyj1757++ { + yyv1757 = append(yyv1757, IngressRule{}) + yyh1757.ElemContainerState(yyj1757) if r.TryDecodeAsNil() { - yyv1558[yyj1558] = IngressRule{} + yyv1757[yyj1757] = IngressRule{} } else { - yyv1560 := &yyv1558[yyj1558] - yyv1560.CodecDecodeSelf(d) + yyv1759 := &yyv1757[yyj1757] + yyv1759.CodecDecodeSelf(d) } } } } else { - yyj1558 := 0 - for ; !r.CheckBreak(); yyj1558++ { + yyj1757 := 0 + for ; !r.CheckBreak(); yyj1757++ { - if yyj1558 >= len(yyv1558) { - yyv1558 = append(yyv1558, IngressRule{}) // var yyz1558 IngressRule - yyc1558 = true + if yyj1757 >= len(yyv1757) { + yyv1757 = append(yyv1757, IngressRule{}) // var yyz1757 IngressRule + yyc1757 = true } - yyh1558.ElemContainerState(yyj1558) - if yyj1558 < len(yyv1558) { + yyh1757.ElemContainerState(yyj1757) + if yyj1757 < len(yyv1757) { if r.TryDecodeAsNil() { - yyv1558[yyj1558] = IngressRule{} + yyv1757[yyj1757] = IngressRule{} } else { - yyv1561 := &yyv1558[yyj1558] - yyv1561.CodecDecodeSelf(d) + yyv1760 := &yyv1757[yyj1757] + yyv1760.CodecDecodeSelf(d) } } else { @@ -19209,17 +21698,17 @@ func (x codecSelfer1234) decSliceIngressRule(v *[]IngressRule, d *codec1978.Deco } } - if yyj1558 < len(yyv1558) { - yyv1558 = yyv1558[:yyj1558] - yyc1558 = true - } else if yyj1558 == 0 && yyv1558 == nil { - yyv1558 = []IngressRule{} - yyc1558 = true + if yyj1757 < len(yyv1757) { + yyv1757 = yyv1757[:yyj1757] + yyc1757 = true + } else if yyj1757 == 0 && yyv1757 == nil { + yyv1757 = []IngressRule{} + yyc1757 = true } } - yyh1558.End() - if yyc1558 { - *v = yyv1558 + yyh1757.End() + if yyc1757 { + *v = yyv1757 } } @@ -19228,10 +21717,10 @@ func (x codecSelfer1234) encSliceHTTPIngressPath(v []HTTPIngressPath, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1562 := range v { + for _, yyv1761 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1563 := &yyv1562 - yy1563.CodecEncodeSelf(e) + yy1762 := &yyv1761 + yy1762.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19241,83 +21730,83 @@ func (x codecSelfer1234) decSliceHTTPIngressPath(v *[]HTTPIngressPath, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1564 := *v - yyh1564, yyl1564 := z.DecSliceHelperStart() - var yyc1564 bool - if yyl1564 == 0 { - if yyv1564 == nil { - yyv1564 = []HTTPIngressPath{} - yyc1564 = true - } else if len(yyv1564) != 0 { - yyv1564 = yyv1564[:0] - yyc1564 = true + yyv1763 := *v + yyh1763, yyl1763 := z.DecSliceHelperStart() + var yyc1763 bool + if yyl1763 == 0 { + if yyv1763 == nil { + yyv1763 = []HTTPIngressPath{} + yyc1763 = true + } else if len(yyv1763) != 0 { + yyv1763 = yyv1763[:0] + yyc1763 = true } - } else if yyl1564 > 0 { - var yyrr1564, yyrl1564 int - var yyrt1564 bool - if yyl1564 > cap(yyv1564) { + } else if yyl1763 > 0 { + var yyrr1763, yyrl1763 int + var yyrt1763 bool + if yyl1763 > cap(yyv1763) { - yyrg1564 := len(yyv1564) > 0 - yyv21564 := yyv1564 - yyrl1564, yyrt1564 = z.DecInferLen(yyl1564, z.DecBasicHandle().MaxInitLen, 64) - if yyrt1564 { - if yyrl1564 <= cap(yyv1564) { - yyv1564 = yyv1564[:yyrl1564] + yyrg1763 := len(yyv1763) > 0 + yyv21763 := yyv1763 + yyrl1763, yyrt1763 = z.DecInferLen(yyl1763, z.DecBasicHandle().MaxInitLen, 64) + if yyrt1763 { + if yyrl1763 <= cap(yyv1763) { + yyv1763 = yyv1763[:yyrl1763] } else { - yyv1564 = make([]HTTPIngressPath, yyrl1564) + yyv1763 = make([]HTTPIngressPath, yyrl1763) } } else { - yyv1564 = make([]HTTPIngressPath, yyrl1564) + yyv1763 = make([]HTTPIngressPath, yyrl1763) } - yyc1564 = true - yyrr1564 = len(yyv1564) - if yyrg1564 { - copy(yyv1564, yyv21564) + yyc1763 = true + yyrr1763 = len(yyv1763) + if yyrg1763 { + copy(yyv1763, yyv21763) } - } else if yyl1564 != len(yyv1564) { - yyv1564 = yyv1564[:yyl1564] - yyc1564 = true + } else if yyl1763 != len(yyv1763) { + yyv1763 = yyv1763[:yyl1763] + yyc1763 = true } - yyj1564 := 0 - for ; yyj1564 < yyrr1564; yyj1564++ { - yyh1564.ElemContainerState(yyj1564) + yyj1763 := 0 + for ; yyj1763 < yyrr1763; yyj1763++ { + yyh1763.ElemContainerState(yyj1763) if r.TryDecodeAsNil() { - yyv1564[yyj1564] = HTTPIngressPath{} + yyv1763[yyj1763] = HTTPIngressPath{} } else { - yyv1565 := &yyv1564[yyj1564] - yyv1565.CodecDecodeSelf(d) + yyv1764 := &yyv1763[yyj1763] + yyv1764.CodecDecodeSelf(d) } } - if yyrt1564 { - for ; yyj1564 < yyl1564; yyj1564++ { - yyv1564 = append(yyv1564, HTTPIngressPath{}) - yyh1564.ElemContainerState(yyj1564) + if yyrt1763 { + for ; yyj1763 < yyl1763; yyj1763++ { + yyv1763 = append(yyv1763, HTTPIngressPath{}) + yyh1763.ElemContainerState(yyj1763) if r.TryDecodeAsNil() { - yyv1564[yyj1564] = HTTPIngressPath{} + yyv1763[yyj1763] = HTTPIngressPath{} } else { - yyv1566 := &yyv1564[yyj1564] - yyv1566.CodecDecodeSelf(d) + yyv1765 := &yyv1763[yyj1763] + yyv1765.CodecDecodeSelf(d) } } } } else { - yyj1564 := 0 - for ; !r.CheckBreak(); yyj1564++ { + yyj1763 := 0 + for ; !r.CheckBreak(); yyj1763++ { - if yyj1564 >= len(yyv1564) { - yyv1564 = append(yyv1564, HTTPIngressPath{}) // var yyz1564 HTTPIngressPath - yyc1564 = true + if yyj1763 >= len(yyv1763) { + yyv1763 = append(yyv1763, HTTPIngressPath{}) // var yyz1763 HTTPIngressPath + yyc1763 = true } - yyh1564.ElemContainerState(yyj1564) - if yyj1564 < len(yyv1564) { + yyh1763.ElemContainerState(yyj1763) + if yyj1763 < len(yyv1763) { if r.TryDecodeAsNil() { - yyv1564[yyj1564] = HTTPIngressPath{} + yyv1763[yyj1763] = HTTPIngressPath{} } else { - yyv1567 := &yyv1564[yyj1564] - yyv1567.CodecDecodeSelf(d) + yyv1766 := &yyv1763[yyj1763] + yyv1766.CodecDecodeSelf(d) } } else { @@ -19325,17 +21814,17 @@ func (x codecSelfer1234) decSliceHTTPIngressPath(v *[]HTTPIngressPath, d *codec1 } } - if yyj1564 < len(yyv1564) { - yyv1564 = yyv1564[:yyj1564] - yyc1564 = true - } else if yyj1564 == 0 && yyv1564 == nil { - yyv1564 = []HTTPIngressPath{} - yyc1564 = true + if yyj1763 < len(yyv1763) { + yyv1763 = yyv1763[:yyj1763] + yyc1763 = true + } else if yyj1763 == 0 && yyv1763 == nil { + yyv1763 = []HTTPIngressPath{} + yyc1763 = true } } - yyh1564.End() - if yyc1564 { - *v = yyv1564 + yyh1763.End() + if yyc1763 { + *v = yyv1763 } } @@ -19344,10 +21833,10 @@ func (x codecSelfer1234) encSliceNodeUtilization(v []NodeUtilization, e *codec19 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1568 := range v { + for _, yyv1767 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1569 := &yyv1568 - yy1569.CodecEncodeSelf(e) + yy1768 := &yyv1767 + yy1768.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19357,83 +21846,83 @@ func (x codecSelfer1234) decSliceNodeUtilization(v *[]NodeUtilization, d *codec1 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1570 := *v - yyh1570, yyl1570 := z.DecSliceHelperStart() - var yyc1570 bool - if yyl1570 == 0 { - if yyv1570 == nil { - yyv1570 = []NodeUtilization{} - yyc1570 = true - } else if len(yyv1570) != 0 { - yyv1570 = yyv1570[:0] - yyc1570 = true + yyv1769 := *v + yyh1769, yyl1769 := z.DecSliceHelperStart() + var yyc1769 bool + if yyl1769 == 0 { + if yyv1769 == nil { + yyv1769 = []NodeUtilization{} + yyc1769 = true + } else if len(yyv1769) != 0 { + yyv1769 = yyv1769[:0] + yyc1769 = true } - } else if yyl1570 > 0 { - var yyrr1570, yyrl1570 int - var yyrt1570 bool - if yyl1570 > cap(yyv1570) { + } else if yyl1769 > 0 { + var yyrr1769, yyrl1769 int + var yyrt1769 bool + if yyl1769 > cap(yyv1769) { - yyrg1570 := len(yyv1570) > 0 - yyv21570 := yyv1570 - yyrl1570, yyrt1570 = z.DecInferLen(yyl1570, z.DecBasicHandle().MaxInitLen, 24) - if yyrt1570 { - if yyrl1570 <= cap(yyv1570) { - yyv1570 = yyv1570[:yyrl1570] + yyrg1769 := len(yyv1769) > 0 + yyv21769 := yyv1769 + yyrl1769, yyrt1769 = z.DecInferLen(yyl1769, z.DecBasicHandle().MaxInitLen, 24) + if yyrt1769 { + if yyrl1769 <= cap(yyv1769) { + yyv1769 = yyv1769[:yyrl1769] } else { - yyv1570 = make([]NodeUtilization, yyrl1570) + yyv1769 = make([]NodeUtilization, yyrl1769) } } else { - yyv1570 = make([]NodeUtilization, yyrl1570) + yyv1769 = make([]NodeUtilization, yyrl1769) } - yyc1570 = true - yyrr1570 = len(yyv1570) - if yyrg1570 { - copy(yyv1570, yyv21570) + yyc1769 = true + yyrr1769 = len(yyv1769) + if yyrg1769 { + copy(yyv1769, yyv21769) } - } else if yyl1570 != len(yyv1570) { - yyv1570 = yyv1570[:yyl1570] - yyc1570 = true + } else if yyl1769 != len(yyv1769) { + yyv1769 = yyv1769[:yyl1769] + yyc1769 = true } - yyj1570 := 0 - for ; yyj1570 < yyrr1570; yyj1570++ { - yyh1570.ElemContainerState(yyj1570) + yyj1769 := 0 + for ; yyj1769 < yyrr1769; yyj1769++ { + yyh1769.ElemContainerState(yyj1769) if r.TryDecodeAsNil() { - yyv1570[yyj1570] = NodeUtilization{} + yyv1769[yyj1769] = NodeUtilization{} } else { - yyv1571 := &yyv1570[yyj1570] - yyv1571.CodecDecodeSelf(d) + yyv1770 := &yyv1769[yyj1769] + yyv1770.CodecDecodeSelf(d) } } - if yyrt1570 { - for ; yyj1570 < yyl1570; yyj1570++ { - yyv1570 = append(yyv1570, NodeUtilization{}) - yyh1570.ElemContainerState(yyj1570) + if yyrt1769 { + for ; yyj1769 < yyl1769; yyj1769++ { + yyv1769 = append(yyv1769, NodeUtilization{}) + yyh1769.ElemContainerState(yyj1769) if r.TryDecodeAsNil() { - yyv1570[yyj1570] = NodeUtilization{} + yyv1769[yyj1769] = NodeUtilization{} } else { - yyv1572 := &yyv1570[yyj1570] - yyv1572.CodecDecodeSelf(d) + yyv1771 := &yyv1769[yyj1769] + yyv1771.CodecDecodeSelf(d) } } } } else { - yyj1570 := 0 - for ; !r.CheckBreak(); yyj1570++ { + yyj1769 := 0 + for ; !r.CheckBreak(); yyj1769++ { - if yyj1570 >= len(yyv1570) { - yyv1570 = append(yyv1570, NodeUtilization{}) // var yyz1570 NodeUtilization - yyc1570 = true + if yyj1769 >= len(yyv1769) { + yyv1769 = append(yyv1769, NodeUtilization{}) // var yyz1769 NodeUtilization + yyc1769 = true } - yyh1570.ElemContainerState(yyj1570) - if yyj1570 < len(yyv1570) { + yyh1769.ElemContainerState(yyj1769) + if yyj1769 < len(yyv1769) { if r.TryDecodeAsNil() { - yyv1570[yyj1570] = NodeUtilization{} + yyv1769[yyj1769] = NodeUtilization{} } else { - yyv1573 := &yyv1570[yyj1570] - yyv1573.CodecDecodeSelf(d) + yyv1772 := &yyv1769[yyj1769] + yyv1772.CodecDecodeSelf(d) } } else { @@ -19441,17 +21930,17 @@ func (x codecSelfer1234) decSliceNodeUtilization(v *[]NodeUtilization, d *codec1 } } - if yyj1570 < len(yyv1570) { - yyv1570 = yyv1570[:yyj1570] - yyc1570 = true - } else if yyj1570 == 0 && yyv1570 == nil { - yyv1570 = []NodeUtilization{} - yyc1570 = true + if yyj1769 < len(yyv1769) { + yyv1769 = yyv1769[:yyj1769] + yyc1769 = true + } else if yyj1769 == 0 && yyv1769 == nil { + yyv1769 = []NodeUtilization{} + yyc1769 = true } } - yyh1570.End() - if yyc1570 { - *v = yyv1570 + yyh1769.End() + if yyc1769 { + *v = yyv1769 } } @@ -19460,10 +21949,10 @@ func (x codecSelfer1234) encSliceClusterAutoscaler(v []ClusterAutoscaler, e *cod z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1574 := range v { + for _, yyv1773 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1575 := &yyv1574 - yy1575.CodecEncodeSelf(e) + yy1774 := &yyv1773 + yy1774.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19473,83 +21962,83 @@ func (x codecSelfer1234) decSliceClusterAutoscaler(v *[]ClusterAutoscaler, d *co z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1576 := *v - yyh1576, yyl1576 := z.DecSliceHelperStart() - var yyc1576 bool - if yyl1576 == 0 { - if yyv1576 == nil { - yyv1576 = []ClusterAutoscaler{} - yyc1576 = true - } else if len(yyv1576) != 0 { - yyv1576 = yyv1576[:0] - yyc1576 = true + yyv1775 := *v + yyh1775, yyl1775 := z.DecSliceHelperStart() + var yyc1775 bool + if yyl1775 == 0 { + if yyv1775 == nil { + yyv1775 = []ClusterAutoscaler{} + yyc1775 = true + } else if len(yyv1775) != 0 { + yyv1775 = yyv1775[:0] + yyc1775 = true } - } else if yyl1576 > 0 { - var yyrr1576, yyrl1576 int - var yyrt1576 bool - if yyl1576 > cap(yyv1576) { + } else if yyl1775 > 0 { + var yyrr1775, yyrl1775 int + var yyrt1775 bool + if yyl1775 > cap(yyv1775) { - yyrg1576 := len(yyv1576) > 0 - yyv21576 := yyv1576 - yyrl1576, yyrt1576 = z.DecInferLen(yyl1576, z.DecBasicHandle().MaxInitLen, 224) - if yyrt1576 { - if yyrl1576 <= cap(yyv1576) { - yyv1576 = yyv1576[:yyrl1576] + yyrg1775 := len(yyv1775) > 0 + yyv21775 := yyv1775 + yyrl1775, yyrt1775 = z.DecInferLen(yyl1775, z.DecBasicHandle().MaxInitLen, 224) + if yyrt1775 { + if yyrl1775 <= cap(yyv1775) { + yyv1775 = yyv1775[:yyrl1775] } else { - yyv1576 = make([]ClusterAutoscaler, yyrl1576) + yyv1775 = make([]ClusterAutoscaler, yyrl1775) } } else { - yyv1576 = make([]ClusterAutoscaler, yyrl1576) + yyv1775 = make([]ClusterAutoscaler, yyrl1775) } - yyc1576 = true - yyrr1576 = len(yyv1576) - if yyrg1576 { - copy(yyv1576, yyv21576) + yyc1775 = true + yyrr1775 = len(yyv1775) + if yyrg1775 { + copy(yyv1775, yyv21775) } - } else if yyl1576 != len(yyv1576) { - yyv1576 = yyv1576[:yyl1576] - yyc1576 = true + } else if yyl1775 != len(yyv1775) { + yyv1775 = yyv1775[:yyl1775] + yyc1775 = true } - yyj1576 := 0 - for ; yyj1576 < yyrr1576; yyj1576++ { - yyh1576.ElemContainerState(yyj1576) + yyj1775 := 0 + for ; yyj1775 < yyrr1775; yyj1775++ { + yyh1775.ElemContainerState(yyj1775) if r.TryDecodeAsNil() { - yyv1576[yyj1576] = ClusterAutoscaler{} + yyv1775[yyj1775] = ClusterAutoscaler{} } else { - yyv1577 := &yyv1576[yyj1576] - yyv1577.CodecDecodeSelf(d) + yyv1776 := &yyv1775[yyj1775] + yyv1776.CodecDecodeSelf(d) } } - if yyrt1576 { - for ; yyj1576 < yyl1576; yyj1576++ { - yyv1576 = append(yyv1576, ClusterAutoscaler{}) - yyh1576.ElemContainerState(yyj1576) + if yyrt1775 { + for ; yyj1775 < yyl1775; yyj1775++ { + yyv1775 = append(yyv1775, ClusterAutoscaler{}) + yyh1775.ElemContainerState(yyj1775) if r.TryDecodeAsNil() { - yyv1576[yyj1576] = ClusterAutoscaler{} + yyv1775[yyj1775] = ClusterAutoscaler{} } else { - yyv1578 := &yyv1576[yyj1576] - yyv1578.CodecDecodeSelf(d) + yyv1777 := &yyv1775[yyj1775] + yyv1777.CodecDecodeSelf(d) } } } } else { - yyj1576 := 0 - for ; !r.CheckBreak(); yyj1576++ { + yyj1775 := 0 + for ; !r.CheckBreak(); yyj1775++ { - if yyj1576 >= len(yyv1576) { - yyv1576 = append(yyv1576, ClusterAutoscaler{}) // var yyz1576 ClusterAutoscaler - yyc1576 = true + if yyj1775 >= len(yyv1775) { + yyv1775 = append(yyv1775, ClusterAutoscaler{}) // var yyz1775 ClusterAutoscaler + yyc1775 = true } - yyh1576.ElemContainerState(yyj1576) - if yyj1576 < len(yyv1576) { + yyh1775.ElemContainerState(yyj1775) + if yyj1775 < len(yyv1775) { if r.TryDecodeAsNil() { - yyv1576[yyj1576] = ClusterAutoscaler{} + yyv1775[yyj1775] = ClusterAutoscaler{} } else { - yyv1579 := &yyv1576[yyj1576] - yyv1579.CodecDecodeSelf(d) + yyv1778 := &yyv1775[yyj1775] + yyv1778.CodecDecodeSelf(d) } } else { @@ -19557,17 +22046,17 @@ func (x codecSelfer1234) decSliceClusterAutoscaler(v *[]ClusterAutoscaler, d *co } } - if yyj1576 < len(yyv1576) { - yyv1576 = yyv1576[:yyj1576] - yyc1576 = true - } else if yyj1576 == 0 && yyv1576 == nil { - yyv1576 = []ClusterAutoscaler{} - yyc1576 = true + if yyj1775 < len(yyv1775) { + yyv1775 = yyv1775[:yyj1775] + yyc1775 = true + } else if yyj1775 == 0 && yyv1775 == nil { + yyv1775 = []ClusterAutoscaler{} + yyc1775 = true } } - yyh1576.End() - if yyc1576 { - *v = yyv1576 + yyh1775.End() + if yyc1775 { + *v = yyv1775 } } @@ -19576,10 +22065,10 @@ func (x codecSelfer1234) encSliceLabelSelectorRequirement(v []LabelSelectorRequi z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1580 := range v { + for _, yyv1779 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1581 := &yyv1580 - yy1581.CodecEncodeSelf(e) + yy1780 := &yyv1779 + yy1780.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19589,83 +22078,83 @@ func (x codecSelfer1234) decSliceLabelSelectorRequirement(v *[]LabelSelectorRequ z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1582 := *v - yyh1582, yyl1582 := z.DecSliceHelperStart() - var yyc1582 bool - if yyl1582 == 0 { - if yyv1582 == nil { - yyv1582 = []LabelSelectorRequirement{} - yyc1582 = true - } else if len(yyv1582) != 0 { - yyv1582 = yyv1582[:0] - yyc1582 = true + yyv1781 := *v + yyh1781, yyl1781 := z.DecSliceHelperStart() + var yyc1781 bool + if yyl1781 == 0 { + if yyv1781 == nil { + yyv1781 = []LabelSelectorRequirement{} + yyc1781 = true + } else if len(yyv1781) != 0 { + yyv1781 = yyv1781[:0] + yyc1781 = true } - } else if yyl1582 > 0 { - var yyrr1582, yyrl1582 int - var yyrt1582 bool - if yyl1582 > cap(yyv1582) { + } else if yyl1781 > 0 { + var yyrr1781, yyrl1781 int + var yyrt1781 bool + if yyl1781 > cap(yyv1781) { - yyrg1582 := len(yyv1582) > 0 - yyv21582 := yyv1582 - yyrl1582, yyrt1582 = z.DecInferLen(yyl1582, z.DecBasicHandle().MaxInitLen, 56) - if yyrt1582 { - if yyrl1582 <= cap(yyv1582) { - yyv1582 = yyv1582[:yyrl1582] + yyrg1781 := len(yyv1781) > 0 + yyv21781 := yyv1781 + yyrl1781, yyrt1781 = z.DecInferLen(yyl1781, z.DecBasicHandle().MaxInitLen, 56) + if yyrt1781 { + if yyrl1781 <= cap(yyv1781) { + yyv1781 = yyv1781[:yyrl1781] } else { - yyv1582 = make([]LabelSelectorRequirement, yyrl1582) + yyv1781 = make([]LabelSelectorRequirement, yyrl1781) } } else { - yyv1582 = make([]LabelSelectorRequirement, yyrl1582) + yyv1781 = make([]LabelSelectorRequirement, yyrl1781) } - yyc1582 = true - yyrr1582 = len(yyv1582) - if yyrg1582 { - copy(yyv1582, yyv21582) + yyc1781 = true + yyrr1781 = len(yyv1781) + if yyrg1781 { + copy(yyv1781, yyv21781) } - } else if yyl1582 != len(yyv1582) { - yyv1582 = yyv1582[:yyl1582] - yyc1582 = true + } else if yyl1781 != len(yyv1781) { + yyv1781 = yyv1781[:yyl1781] + yyc1781 = true } - yyj1582 := 0 - for ; yyj1582 < yyrr1582; yyj1582++ { - yyh1582.ElemContainerState(yyj1582) + yyj1781 := 0 + for ; yyj1781 < yyrr1781; yyj1781++ { + yyh1781.ElemContainerState(yyj1781) if r.TryDecodeAsNil() { - yyv1582[yyj1582] = LabelSelectorRequirement{} + yyv1781[yyj1781] = LabelSelectorRequirement{} } else { - yyv1583 := &yyv1582[yyj1582] - yyv1583.CodecDecodeSelf(d) + yyv1782 := &yyv1781[yyj1781] + yyv1782.CodecDecodeSelf(d) } } - if yyrt1582 { - for ; yyj1582 < yyl1582; yyj1582++ { - yyv1582 = append(yyv1582, LabelSelectorRequirement{}) - yyh1582.ElemContainerState(yyj1582) + if yyrt1781 { + for ; yyj1781 < yyl1781; yyj1781++ { + yyv1781 = append(yyv1781, LabelSelectorRequirement{}) + yyh1781.ElemContainerState(yyj1781) if r.TryDecodeAsNil() { - yyv1582[yyj1582] = LabelSelectorRequirement{} + yyv1781[yyj1781] = LabelSelectorRequirement{} } else { - yyv1584 := &yyv1582[yyj1582] - yyv1584.CodecDecodeSelf(d) + yyv1783 := &yyv1781[yyj1781] + yyv1783.CodecDecodeSelf(d) } } } } else { - yyj1582 := 0 - for ; !r.CheckBreak(); yyj1582++ { + yyj1781 := 0 + for ; !r.CheckBreak(); yyj1781++ { - if yyj1582 >= len(yyv1582) { - yyv1582 = append(yyv1582, LabelSelectorRequirement{}) // var yyz1582 LabelSelectorRequirement - yyc1582 = true + if yyj1781 >= len(yyv1781) { + yyv1781 = append(yyv1781, LabelSelectorRequirement{}) // var yyz1781 LabelSelectorRequirement + yyc1781 = true } - yyh1582.ElemContainerState(yyj1582) - if yyj1582 < len(yyv1582) { + yyh1781.ElemContainerState(yyj1781) + if yyj1781 < len(yyv1781) { if r.TryDecodeAsNil() { - yyv1582[yyj1582] = LabelSelectorRequirement{} + yyv1781[yyj1781] = LabelSelectorRequirement{} } else { - yyv1585 := &yyv1582[yyj1582] - yyv1585.CodecDecodeSelf(d) + yyv1784 := &yyv1781[yyj1781] + yyv1784.CodecDecodeSelf(d) } } else { @@ -19673,17 +22162,17 @@ func (x codecSelfer1234) decSliceLabelSelectorRequirement(v *[]LabelSelectorRequ } } - if yyj1582 < len(yyv1582) { - yyv1582 = yyv1582[:yyj1582] - yyc1582 = true - } else if yyj1582 == 0 && yyv1582 == nil { - yyv1582 = []LabelSelectorRequirement{} - yyc1582 = true + if yyj1781 < len(yyv1781) { + yyv1781 = yyv1781[:yyj1781] + yyc1781 = true + } else if yyj1781 == 0 && yyv1781 == nil { + yyv1781 = []LabelSelectorRequirement{} + yyc1781 = true } } - yyh1582.End() - if yyc1582 { - *v = yyv1582 + yyh1781.End() + if yyc1781 { + *v = yyv1781 } } @@ -19692,10 +22181,10 @@ func (x codecSelfer1234) encSliceReplicaSet(v []ReplicaSet, e *codec1978.Encoder z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv1586 := range v { + for _, yyv1785 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy1587 := &yyv1586 - yy1587.CodecEncodeSelf(e) + yy1786 := &yyv1785 + yy1786.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -19705,83 +22194,83 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv1588 := *v - yyh1588, yyl1588 := z.DecSliceHelperStart() - var yyc1588 bool - if yyl1588 == 0 { - if yyv1588 == nil { - yyv1588 = []ReplicaSet{} - yyc1588 = true - } else if len(yyv1588) != 0 { - yyv1588 = yyv1588[:0] - yyc1588 = true + yyv1787 := *v + yyh1787, yyl1787 := z.DecSliceHelperStart() + var yyc1787 bool + if yyl1787 == 0 { + if yyv1787 == nil { + yyv1787 = []ReplicaSet{} + yyc1787 = true + } else if len(yyv1787) != 0 { + yyv1787 = yyv1787[:0] + yyc1787 = true } - } else if yyl1588 > 0 { - var yyrr1588, yyrl1588 int - var yyrt1588 bool - if yyl1588 > cap(yyv1588) { + } else if yyl1787 > 0 { + var yyrr1787, yyrl1787 int + var yyrt1787 bool + if yyl1787 > cap(yyv1787) { - yyrg1588 := len(yyv1588) > 0 - yyv21588 := yyv1588 - yyrl1588, yyrt1588 = z.DecInferLen(yyl1588, z.DecBasicHandle().MaxInitLen, 232) - if yyrt1588 { - if yyrl1588 <= cap(yyv1588) { - yyv1588 = yyv1588[:yyrl1588] + yyrg1787 := len(yyv1787) > 0 + yyv21787 := yyv1787 + yyrl1787, yyrt1787 = z.DecInferLen(yyl1787, z.DecBasicHandle().MaxInitLen, 232) + if yyrt1787 { + if yyrl1787 <= cap(yyv1787) { + yyv1787 = yyv1787[:yyrl1787] } else { - yyv1588 = make([]ReplicaSet, yyrl1588) + yyv1787 = make([]ReplicaSet, yyrl1787) } } else { - yyv1588 = make([]ReplicaSet, yyrl1588) + yyv1787 = make([]ReplicaSet, yyrl1787) } - yyc1588 = true - yyrr1588 = len(yyv1588) - if yyrg1588 { - copy(yyv1588, yyv21588) + yyc1787 = true + yyrr1787 = len(yyv1787) + if yyrg1787 { + copy(yyv1787, yyv21787) } - } else if yyl1588 != len(yyv1588) { - yyv1588 = yyv1588[:yyl1588] - yyc1588 = true + } else if yyl1787 != len(yyv1787) { + yyv1787 = yyv1787[:yyl1787] + yyc1787 = true } - yyj1588 := 0 - for ; yyj1588 < yyrr1588; yyj1588++ { - yyh1588.ElemContainerState(yyj1588) + yyj1787 := 0 + for ; yyj1787 < yyrr1787; yyj1787++ { + yyh1787.ElemContainerState(yyj1787) if r.TryDecodeAsNil() { - yyv1588[yyj1588] = ReplicaSet{} + yyv1787[yyj1787] = ReplicaSet{} } else { - yyv1589 := &yyv1588[yyj1588] - yyv1589.CodecDecodeSelf(d) + yyv1788 := &yyv1787[yyj1787] + yyv1788.CodecDecodeSelf(d) } } - if yyrt1588 { - for ; yyj1588 < yyl1588; yyj1588++ { - yyv1588 = append(yyv1588, ReplicaSet{}) - yyh1588.ElemContainerState(yyj1588) + if yyrt1787 { + for ; yyj1787 < yyl1787; yyj1787++ { + yyv1787 = append(yyv1787, ReplicaSet{}) + yyh1787.ElemContainerState(yyj1787) if r.TryDecodeAsNil() { - yyv1588[yyj1588] = ReplicaSet{} + yyv1787[yyj1787] = ReplicaSet{} } else { - yyv1590 := &yyv1588[yyj1588] - yyv1590.CodecDecodeSelf(d) + yyv1789 := &yyv1787[yyj1787] + yyv1789.CodecDecodeSelf(d) } } } } else { - yyj1588 := 0 - for ; !r.CheckBreak(); yyj1588++ { + yyj1787 := 0 + for ; !r.CheckBreak(); yyj1787++ { - if yyj1588 >= len(yyv1588) { - yyv1588 = append(yyv1588, ReplicaSet{}) // var yyz1588 ReplicaSet - yyc1588 = true + if yyj1787 >= len(yyv1787) { + yyv1787 = append(yyv1787, ReplicaSet{}) // var yyz1787 ReplicaSet + yyc1787 = true } - yyh1588.ElemContainerState(yyj1588) - if yyj1588 < len(yyv1588) { + yyh1787.ElemContainerState(yyj1787) + if yyj1787 < len(yyv1787) { if r.TryDecodeAsNil() { - yyv1588[yyj1588] = ReplicaSet{} + yyv1787[yyj1787] = ReplicaSet{} } else { - yyv1591 := &yyv1588[yyj1588] - yyv1591.CodecDecodeSelf(d) + yyv1790 := &yyv1787[yyj1787] + yyv1790.CodecDecodeSelf(d) } } else { @@ -19789,16 +22278,584 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode } } - if yyj1588 < len(yyv1588) { - yyv1588 = yyv1588[:yyj1588] - yyc1588 = true - } else if yyj1588 == 0 && yyv1588 == nil { - yyv1588 = []ReplicaSet{} - yyc1588 = true + if yyj1787 < len(yyv1787) { + yyv1787 = yyv1787[:yyj1787] + yyc1787 = true + } else if yyj1787 == 0 && yyv1787 == nil { + yyv1787 = []ReplicaSet{} + yyc1787 = true } } - yyh1588.End() - if yyc1588 { - *v = yyv1588 + yyh1787.End() + if yyc1787 { + *v = yyv1787 + } +} + +func (x codecSelfer1234) encSlicev1_Capability(v []pkg2_v1.Capability, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1791 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yym1792 := z.EncBinary() + _ = yym1792 + if false { + } else if z.HasExtensions() && z.EncExt(yyv1791) { + } else { + r.EncodeString(codecSelferC_UTF81234, string(yyv1791)) + } + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicev1_Capability(v *[]pkg2_v1.Capability, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1793 := *v + yyh1793, yyl1793 := z.DecSliceHelperStart() + var yyc1793 bool + if yyl1793 == 0 { + if yyv1793 == nil { + yyv1793 = []pkg2_v1.Capability{} + yyc1793 = true + } else if len(yyv1793) != 0 { + yyv1793 = yyv1793[:0] + yyc1793 = true + } + } else if yyl1793 > 0 { + var yyrr1793, yyrl1793 int + var yyrt1793 bool + if yyl1793 > cap(yyv1793) { + + yyrl1793, yyrt1793 = z.DecInferLen(yyl1793, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1793 { + if yyrl1793 <= cap(yyv1793) { + yyv1793 = yyv1793[:yyrl1793] + } else { + yyv1793 = make([]pkg2_v1.Capability, yyrl1793) + } + } else { + yyv1793 = make([]pkg2_v1.Capability, yyrl1793) + } + yyc1793 = true + yyrr1793 = len(yyv1793) + } else if yyl1793 != len(yyv1793) { + yyv1793 = yyv1793[:yyl1793] + yyc1793 = true + } + yyj1793 := 0 + for ; yyj1793 < yyrr1793; yyj1793++ { + yyh1793.ElemContainerState(yyj1793) + if r.TryDecodeAsNil() { + yyv1793[yyj1793] = "" + } else { + yyv1793[yyj1793] = pkg2_v1.Capability(r.DecodeString()) + } + + } + if yyrt1793 { + for ; yyj1793 < yyl1793; yyj1793++ { + yyv1793 = append(yyv1793, "") + yyh1793.ElemContainerState(yyj1793) + if r.TryDecodeAsNil() { + yyv1793[yyj1793] = "" + } else { + yyv1793[yyj1793] = pkg2_v1.Capability(r.DecodeString()) + } + + } + } + + } else { + yyj1793 := 0 + for ; !r.CheckBreak(); yyj1793++ { + + if yyj1793 >= len(yyv1793) { + yyv1793 = append(yyv1793, "") // var yyz1793 pkg2_v1.Capability + yyc1793 = true + } + yyh1793.ElemContainerState(yyj1793) + if yyj1793 < len(yyv1793) { + if r.TryDecodeAsNil() { + yyv1793[yyj1793] = "" + } else { + yyv1793[yyj1793] = pkg2_v1.Capability(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj1793 < len(yyv1793) { + yyv1793 = yyv1793[:yyj1793] + yyc1793 = true + } else if yyj1793 == 0 && yyv1793 == nil { + yyv1793 = []pkg2_v1.Capability{} + yyc1793 = true + } + } + yyh1793.End() + if yyc1793 { + *v = yyv1793 + } +} + +func (x codecSelfer1234) encSliceFSType(v []FSType, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1797 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yyv1797.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceFSType(v *[]FSType, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1798 := *v + yyh1798, yyl1798 := z.DecSliceHelperStart() + var yyc1798 bool + if yyl1798 == 0 { + if yyv1798 == nil { + yyv1798 = []FSType{} + yyc1798 = true + } else if len(yyv1798) != 0 { + yyv1798 = yyv1798[:0] + yyc1798 = true + } + } else if yyl1798 > 0 { + var yyrr1798, yyrl1798 int + var yyrt1798 bool + if yyl1798 > cap(yyv1798) { + + yyrl1798, yyrt1798 = z.DecInferLen(yyl1798, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1798 { + if yyrl1798 <= cap(yyv1798) { + yyv1798 = yyv1798[:yyrl1798] + } else { + yyv1798 = make([]FSType, yyrl1798) + } + } else { + yyv1798 = make([]FSType, yyrl1798) + } + yyc1798 = true + yyrr1798 = len(yyv1798) + } else if yyl1798 != len(yyv1798) { + yyv1798 = yyv1798[:yyl1798] + yyc1798 = true + } + yyj1798 := 0 + for ; yyj1798 < yyrr1798; yyj1798++ { + yyh1798.ElemContainerState(yyj1798) + if r.TryDecodeAsNil() { + yyv1798[yyj1798] = "" + } else { + yyv1798[yyj1798] = FSType(r.DecodeString()) + } + + } + if yyrt1798 { + for ; yyj1798 < yyl1798; yyj1798++ { + yyv1798 = append(yyv1798, "") + yyh1798.ElemContainerState(yyj1798) + if r.TryDecodeAsNil() { + yyv1798[yyj1798] = "" + } else { + yyv1798[yyj1798] = FSType(r.DecodeString()) + } + + } + } + + } else { + yyj1798 := 0 + for ; !r.CheckBreak(); yyj1798++ { + + if yyj1798 >= len(yyv1798) { + yyv1798 = append(yyv1798, "") // var yyz1798 FSType + yyc1798 = true + } + yyh1798.ElemContainerState(yyj1798) + if yyj1798 < len(yyv1798) { + if r.TryDecodeAsNil() { + yyv1798[yyj1798] = "" + } else { + yyv1798[yyj1798] = FSType(r.DecodeString()) + } + + } else { + z.DecSwallow() + } + + } + if yyj1798 < len(yyv1798) { + yyv1798 = yyv1798[:yyj1798] + yyc1798 = true + } else if yyj1798 == 0 && yyv1798 == nil { + yyv1798 = []FSType{} + yyc1798 = true + } + } + yyh1798.End() + if yyc1798 { + *v = yyv1798 + } +} + +func (x codecSelfer1234) encSliceHostPortRange(v []HostPortRange, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1802 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1803 := &yyv1802 + yy1803.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceHostPortRange(v *[]HostPortRange, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1804 := *v + yyh1804, yyl1804 := z.DecSliceHelperStart() + var yyc1804 bool + if yyl1804 == 0 { + if yyv1804 == nil { + yyv1804 = []HostPortRange{} + yyc1804 = true + } else if len(yyv1804) != 0 { + yyv1804 = yyv1804[:0] + yyc1804 = true + } + } else if yyl1804 > 0 { + var yyrr1804, yyrl1804 int + var yyrt1804 bool + if yyl1804 > cap(yyv1804) { + + yyrg1804 := len(yyv1804) > 0 + yyv21804 := yyv1804 + yyrl1804, yyrt1804 = z.DecInferLen(yyl1804, z.DecBasicHandle().MaxInitLen, 8) + if yyrt1804 { + if yyrl1804 <= cap(yyv1804) { + yyv1804 = yyv1804[:yyrl1804] + } else { + yyv1804 = make([]HostPortRange, yyrl1804) + } + } else { + yyv1804 = make([]HostPortRange, yyrl1804) + } + yyc1804 = true + yyrr1804 = len(yyv1804) + if yyrg1804 { + copy(yyv1804, yyv21804) + } + } else if yyl1804 != len(yyv1804) { + yyv1804 = yyv1804[:yyl1804] + yyc1804 = true + } + yyj1804 := 0 + for ; yyj1804 < yyrr1804; yyj1804++ { + yyh1804.ElemContainerState(yyj1804) + if r.TryDecodeAsNil() { + yyv1804[yyj1804] = HostPortRange{} + } else { + yyv1805 := &yyv1804[yyj1804] + yyv1805.CodecDecodeSelf(d) + } + + } + if yyrt1804 { + for ; yyj1804 < yyl1804; yyj1804++ { + yyv1804 = append(yyv1804, HostPortRange{}) + yyh1804.ElemContainerState(yyj1804) + if r.TryDecodeAsNil() { + yyv1804[yyj1804] = HostPortRange{} + } else { + yyv1806 := &yyv1804[yyj1804] + yyv1806.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1804 := 0 + for ; !r.CheckBreak(); yyj1804++ { + + if yyj1804 >= len(yyv1804) { + yyv1804 = append(yyv1804, HostPortRange{}) // var yyz1804 HostPortRange + yyc1804 = true + } + yyh1804.ElemContainerState(yyj1804) + if yyj1804 < len(yyv1804) { + if r.TryDecodeAsNil() { + yyv1804[yyj1804] = HostPortRange{} + } else { + yyv1807 := &yyv1804[yyj1804] + yyv1807.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1804 < len(yyv1804) { + yyv1804 = yyv1804[:yyj1804] + yyc1804 = true + } else if yyj1804 == 0 && yyv1804 == nil { + yyv1804 = []HostPortRange{} + yyc1804 = true + } + } + yyh1804.End() + if yyc1804 { + *v = yyv1804 + } +} + +func (x codecSelfer1234) encSliceIDRange(v []IDRange, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1808 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1809 := &yyv1808 + yy1809.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSliceIDRange(v *[]IDRange, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1810 := *v + yyh1810, yyl1810 := z.DecSliceHelperStart() + var yyc1810 bool + if yyl1810 == 0 { + if yyv1810 == nil { + yyv1810 = []IDRange{} + yyc1810 = true + } else if len(yyv1810) != 0 { + yyv1810 = yyv1810[:0] + yyc1810 = true + } + } else if yyl1810 > 0 { + var yyrr1810, yyrl1810 int + var yyrt1810 bool + if yyl1810 > cap(yyv1810) { + + yyrg1810 := len(yyv1810) > 0 + yyv21810 := yyv1810 + yyrl1810, yyrt1810 = z.DecInferLen(yyl1810, z.DecBasicHandle().MaxInitLen, 16) + if yyrt1810 { + if yyrl1810 <= cap(yyv1810) { + yyv1810 = yyv1810[:yyrl1810] + } else { + yyv1810 = make([]IDRange, yyrl1810) + } + } else { + yyv1810 = make([]IDRange, yyrl1810) + } + yyc1810 = true + yyrr1810 = len(yyv1810) + if yyrg1810 { + copy(yyv1810, yyv21810) + } + } else if yyl1810 != len(yyv1810) { + yyv1810 = yyv1810[:yyl1810] + yyc1810 = true + } + yyj1810 := 0 + for ; yyj1810 < yyrr1810; yyj1810++ { + yyh1810.ElemContainerState(yyj1810) + if r.TryDecodeAsNil() { + yyv1810[yyj1810] = IDRange{} + } else { + yyv1811 := &yyv1810[yyj1810] + yyv1811.CodecDecodeSelf(d) + } + + } + if yyrt1810 { + for ; yyj1810 < yyl1810; yyj1810++ { + yyv1810 = append(yyv1810, IDRange{}) + yyh1810.ElemContainerState(yyj1810) + if r.TryDecodeAsNil() { + yyv1810[yyj1810] = IDRange{} + } else { + yyv1812 := &yyv1810[yyj1810] + yyv1812.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1810 := 0 + for ; !r.CheckBreak(); yyj1810++ { + + if yyj1810 >= len(yyv1810) { + yyv1810 = append(yyv1810, IDRange{}) // var yyz1810 IDRange + yyc1810 = true + } + yyh1810.ElemContainerState(yyj1810) + if yyj1810 < len(yyv1810) { + if r.TryDecodeAsNil() { + yyv1810[yyj1810] = IDRange{} + } else { + yyv1813 := &yyv1810[yyj1810] + yyv1813.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1810 < len(yyv1810) { + yyv1810 = yyv1810[:yyj1810] + yyc1810 = true + } else if yyj1810 == 0 && yyv1810 == nil { + yyv1810 = []IDRange{} + yyc1810 = true + } + } + yyh1810.End() + if yyc1810 { + *v = yyv1810 + } +} + +func (x codecSelfer1234) encSlicePodSecurityPolicy(v []PodSecurityPolicy, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeArrayStart(len(v)) + for _, yyv1814 := range v { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + yy1815 := &yyv1814 + yy1815.CodecEncodeSelf(e) + } + z.EncSendContainerState(codecSelfer_containerArrayEnd1234) +} + +func (x codecSelfer1234) decSlicePodSecurityPolicy(v *[]PodSecurityPolicy, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1816 := *v + yyh1816, yyl1816 := z.DecSliceHelperStart() + var yyc1816 bool + if yyl1816 == 0 { + if yyv1816 == nil { + yyv1816 = []PodSecurityPolicy{} + yyc1816 = true + } else if len(yyv1816) != 0 { + yyv1816 = yyv1816[:0] + yyc1816 = true + } + } else if yyl1816 > 0 { + var yyrr1816, yyrl1816 int + var yyrt1816 bool + if yyl1816 > cap(yyv1816) { + + yyrg1816 := len(yyv1816) > 0 + yyv21816 := yyv1816 + yyrl1816, yyrt1816 = z.DecInferLen(yyl1816, z.DecBasicHandle().MaxInitLen, 352) + if yyrt1816 { + if yyrl1816 <= cap(yyv1816) { + yyv1816 = yyv1816[:yyrl1816] + } else { + yyv1816 = make([]PodSecurityPolicy, yyrl1816) + } + } else { + yyv1816 = make([]PodSecurityPolicy, yyrl1816) + } + yyc1816 = true + yyrr1816 = len(yyv1816) + if yyrg1816 { + copy(yyv1816, yyv21816) + } + } else if yyl1816 != len(yyv1816) { + yyv1816 = yyv1816[:yyl1816] + yyc1816 = true + } + yyj1816 := 0 + for ; yyj1816 < yyrr1816; yyj1816++ { + yyh1816.ElemContainerState(yyj1816) + if r.TryDecodeAsNil() { + yyv1816[yyj1816] = PodSecurityPolicy{} + } else { + yyv1817 := &yyv1816[yyj1816] + yyv1817.CodecDecodeSelf(d) + } + + } + if yyrt1816 { + for ; yyj1816 < yyl1816; yyj1816++ { + yyv1816 = append(yyv1816, PodSecurityPolicy{}) + yyh1816.ElemContainerState(yyj1816) + if r.TryDecodeAsNil() { + yyv1816[yyj1816] = PodSecurityPolicy{} + } else { + yyv1818 := &yyv1816[yyj1816] + yyv1818.CodecDecodeSelf(d) + } + + } + } + + } else { + yyj1816 := 0 + for ; !r.CheckBreak(); yyj1816++ { + + if yyj1816 >= len(yyv1816) { + yyv1816 = append(yyv1816, PodSecurityPolicy{}) // var yyz1816 PodSecurityPolicy + yyc1816 = true + } + yyh1816.ElemContainerState(yyj1816) + if yyj1816 < len(yyv1816) { + if r.TryDecodeAsNil() { + yyv1816[yyj1816] = PodSecurityPolicy{} + } else { + yyv1819 := &yyv1816[yyj1816] + yyv1819.CodecDecodeSelf(d) + } + + } else { + z.DecSwallow() + } + + } + if yyj1816 < len(yyv1816) { + yyv1816 = yyv1816[:yyj1816] + yyc1816 = true + } else if yyj1816 == 0 && yyv1816 == nil { + yyv1816 = []PodSecurityPolicy{} + yyc1816 = true + } + } + yyh1816.End() + if yyc1816 { + *v = yyv1816 } } diff --git a/pkg/apis/extensions/v1beta1/types.go b/pkg/apis/extensions/v1beta1/types.go index 0e1eec913e0..e47de475e7b 100644 --- a/pkg/apis/extensions/v1beta1/types.go +++ b/pkg/apis/extensions/v1beta1/types.go @@ -199,7 +199,7 @@ type ThirdPartyResourceData struct { Data []byte `json:"data,omitempty"` } -// Deployment enables declarative updates for Pods and ReplicationControllers. +// Deployment enables declarative updates for Pods and ReplicaSets. type Deployment struct { unversioned.TypeMeta `json:",inline"` // Standard object metadata. @@ -218,9 +218,9 @@ type DeploymentSpec struct { // zero and not specified. Defaults to 1. Replicas *int32 `json:"replicas,omitempty"` - // Label selector for pods. Existing ReplicationControllers whose pods are + // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. - Selector map[string]string `json:"selector,omitempty"` + Selector *LabelSelector `json:"selector,omitempty"` // Template describes the pods that will be created. Template v1.PodTemplateSpec `json:"template"` @@ -228,20 +228,15 @@ type DeploymentSpec struct { // The deployment strategy to use to replace existing pods with new ones. Strategy DeploymentStrategy `json:"strategy,omitempty"` - // The number of old ReplicationControllers to retain to allow rollback. + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing, for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + MinReadySeconds int32 `json:"minReadySeconds,omitempty"` + + // The number of old ReplicaSets to retain to allow rollback. // This is a pointer to distinguish between explicit zero and not specified. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - // Key of the selector that is added to existing RCs (and label key that is - // added to its pods) to prevent the existing RCs to select new pods (and old - // pods being selected by new RC). - // Users can set this to an empty string to indicate that the system should - // not add any selector and label. If unspecified, system uses - // DefaultDeploymentUniqueLabelKey("deployment.kubernetes.io/podTemplateHash"). - // Value of this key is hash of DeploymentSpec.PodTemplateSpec. - // No label is added if this is set to empty string. - UniqueLabelKey *string `json:"uniqueLabelKey,omitempty"` - // Indicates that the deployment is paused and will not be processed by the // deployment controller. Paused bool `json:"paused,omitempty"` @@ -268,9 +263,8 @@ type RollbackConfig struct { const ( // DefaultDeploymentUniqueLabelKey is the default key of the selector that is added // to existing RCs (and label key that is added to its pods) to prevent the existing RCs - // to select new pods (and old pods being select by new RC). See DeploymentSpec's UniqueLabelKey - // field for more information. - DefaultDeploymentUniqueLabelKey string = "deployment.kubernetes.io/podTemplateHash" + // to select new pods (and old pods being select by new RC). + DefaultDeploymentUniqueLabelKey string = "pod-template-hash" ) // DeploymentStrategy describes how to replace existing pods with new ones. @@ -322,11 +316,6 @@ type RollingUpdateDeployment struct { // new RC can be scaled up further, ensuring that total number of pods running // at any time during the update is atmost 130% of desired pods. MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - MinReadySeconds int32 `json:"minReadySeconds,omitempty"` } // DeploymentStatus is the most recently observed status of the Deployment. @@ -639,12 +628,35 @@ type IngressSpec struct { // is optional to allow the loadbalancer controller or defaulting logic to // specify a global default. Backend *IngressBackend `json:"backend,omitempty"` + + // TLS configuration. Currently the Ingress only supports a single TLS + // port, 443, and assumes TLS termination. If multiple members of this + // list specify different hosts, they will be multiplexed on the same + // port according to the hostname specified through the SNI TLS extension. + TLS []IngressTLS `json:"tls,omitempty"` + // A list of host rules used to configure the Ingress. If unspecified, or // no rule matches, all traffic is sent to the default backend. Rules []IngressRule `json:"rules,omitempty"` // TODO: Add the ability to specify load-balancer IP through claims } +// IngressTLS describes the transport layer security associated with an Ingress. +type IngressTLS struct { + // Hosts are a list of hosts included in the TLS certificate. The values in + // this list must match the name/s used in the tlsSecret. Defaults to the + // wildcard host setting for the loadbalancer controller fulfilling this + // Ingress, if left unspecified. + Hosts []string `json:"hosts,omitempty"` + // SecretName is the name of the secret used to terminate SSL traffic on 443. + // Field is left optional to allow SSL routing based on SNI hostname alone. + // If the SNI host in a listener conflicts with the "Host" header field used + // by an IngressRule, the SNI host is used for termination and value of the + // Host header is used for routing. + SecretName string `json:"secretName,omitempty"` + // TODO: Consider specifying different modes of termination, protocols etc. +} + // IngressStatus describe the current state of the Ingress. type IngressStatus struct { // LoadBalancer contains the current status of the load-balancer. @@ -917,3 +929,128 @@ type ReplicaSetStatus struct { // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. ObservedGeneration int64 `json:"observedGeneration,omitempty"` } + +// Pod Security Policy governs the ability to make requests that affect the Security Context +// that will be applied to a pod and container. +type PodSecurityPolicy struct { + unversioned.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + v1.ObjectMeta `json:"metadata,omitempty"` + + // spec defines the policy enforced. + Spec PodSecurityPolicySpec `json:"spec,omitempty"` +} + +// Pod Security Policy Spec defines the policy enforced. +type PodSecurityPolicySpec struct { + // privileged determines if a pod can request to be run as privileged. + Privileged bool `json:"privileged,omitempty"` + // capabilities is a list of capabilities that can be added. + Capabilities []v1.Capability `json:"capabilities,omitempty"` + // volumes is a white list of allowed volume plugins. Empty indicates that all plugins + // may be used. + Volumes []FSType `json:"volumes,omitempty"` + // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + HostNetwork bool `json:"hostNetwork,omitempty"` + // hostPorts determines which host port ranges are allowed to be exposed. + HostPorts []HostPortRange `json:"hostPorts,omitempty"` + // hostPID determines if the policy allows the use of HostPID in the pod spec. + HostPID bool `json:"hostPID,omitempty"` + // hostIPC determines if the policy allows the use of HostIPC in the pod spec. + HostIPC bool `json:"hostIPC,omitempty"` + // seLinuxContext is the strategy that will dictate the allowable labels that may be set. + SELinuxContext SELinuxContextStrategyOptions `json:"seLinuxContext,omitempty"` + // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + RunAsUser RunAsUserStrategyOptions `json:"runAsUser,omitempty"` +} + +// FS Type gives strong typing to different file systems that are used by volumes. +type FSType string + +var ( + HostPath FSType = "hostPath" + EmptyDir FSType = "emptyDir" + GCEPersistentDisk FSType = "gcePersistentDisk" + AWSElasticBlockStore FSType = "awsElasticBlockStore" + GitRepo FSType = "gitRepo" + Secret FSType = "secret" + NFS FSType = "nfs" + ISCSI FSType = "iscsi" + Glusterfs FSType = "glusterfs" + PersistentVolumeClaim FSType = "persistentVolumeClaim" + RBD FSType = "rbd" + Cinder FSType = "cinder" + CephFS FSType = "cephFS" + DownwardAPI FSType = "downwardAPI" + FC FSType = "fc" +) + +// Host Port Range defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +type HostPortRange struct { + // min is the start of the range, inclusive. + Min int32 `json:"min"` + // max is the end of the range, inclusive. + Max int32 `json:"max"` +} + +// SELinux Context Strategy Options defines the strategy type and any options used to create the strategy. +type SELinuxContextStrategyOptions struct { + // type is the strategy that will dictate the allowable labels that may be set. + Type SELinuxContextStrategy `json:"type"` + // seLinuxOptions required to run as; required for MustRunAs + // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context + SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty"` +} + +// SELinux Context Strategy Type denotes strategy types for generating SELinux options for a +// Security Context. +type SELinuxContextStrategy string + +const ( + // container must have SELinux labels of X applied. + SELinuxStrategyMustRunAs SELinuxContextStrategy = "MustRunAs" + // container may make requests for any SELinux context labels. + SELinuxStrategyRunAsAny SELinuxContextStrategy = "RunAsAny" +) + +// Run A sUser Strategy Options defines the strategy type and any options used to create the strategy. +type RunAsUserStrategyOptions struct { + // type is the strategy that will dictate the allowable RunAsUser values that may be set. + Type RunAsUserStrategy `json:"type"` + // Ranges are the allowed ranges of uids that may be used. + Ranges []IDRange `json:"ranges,omitempty"` +} + +// ID Range provides a min/max of an allowed range of IDs. +type IDRange struct { + // Min is the start of the range, inclusive. + Min int64 `json:"min"` + // Max is the end of the range, inclusive. + Max int64 `json:"max"` +} + +// Run As User Strategy Type denotes strategy types for generating RunAsUser values for a +// Security Context. +type RunAsUserStrategy string + +const ( + // container must run as a particular uid. + RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs" + // container must run as a non-root uid + RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot" + // container may make requests for any uid. + RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny" +) + +// Pod Security Policy List is a list of PodSecurityPolicy objects. +type PodSecurityPolicyList struct { + unversioned.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: http://docs.k8s.io/api-conventions.md#metadata + unversioned.ListMeta `json:"metadata,omitempty"` + + // Items is a list of schema objects. + Items []PodSecurityPolicy `json:"items"` +} diff --git a/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go b/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go index 4687f64101c..7ae091b6013 100644 --- a/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go +++ b/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go @@ -147,7 +147,7 @@ func (DaemonSetUpdateStrategy) SwaggerDoc() map[string]string { } var map_Deployment = map[string]string{ - "": "Deployment enables declarative updates for Pods and ReplicationControllers.", + "": "Deployment enables declarative updates for Pods and ReplicaSets.", "metadata": "Standard object metadata.", "spec": "Specification of the desired behavior of the Deployment.", "status": "Most recently observed status of the Deployment.", @@ -181,11 +181,11 @@ func (DeploymentRollback) SwaggerDoc() map[string]string { var map_DeploymentSpec = map[string]string{ "": "DeploymentSpec is the specification of the desired behavior of the Deployment.", "replicas": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.", - "selector": "Label selector for pods. Existing ReplicationControllers whose pods are selected by this will be the ones affected by this deployment.", + "selector": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.", "template": "Template describes the pods that will be created.", "strategy": "The deployment strategy to use to replace existing pods with new ones.", - "revisionHistoryLimit": "The number of old ReplicationControllers to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified.", - "uniqueLabelKey": "Key of the selector that is added to existing RCs (and label key that is added to its pods) to prevent the existing RCs to select new pods (and old pods being selected by new RC). Users can set this to an empty string to indicate that the system should not add any selector and label. If unspecified, system uses DefaultDeploymentUniqueLabelKey(\"deployment.kubernetes.io/podTemplateHash\"). Value of this key is hash of DeploymentSpec.PodTemplateSpec. No label is added if this is set to empty string.", + "minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", + "revisionHistoryLimit": "The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified.", "paused": "Indicates that the deployment is paused and will not be processed by the deployment controller.", "rollbackTo": "The config this deployment is rolling back to. Will be cleared after rollback is done.", } @@ -291,6 +291,26 @@ func (HorizontalPodAutoscalerStatus) SwaggerDoc() map[string]string { return map_HorizontalPodAutoscalerStatus } +var map_HostPortRange = map[string]string{ + "": "Host Port Range defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.", + "min": "min is the start of the range, inclusive.", + "max": "max is the end of the range, inclusive.", +} + +func (HostPortRange) SwaggerDoc() map[string]string { + return map_HostPortRange +} + +var map_IDRange = map[string]string{ + "": "ID Range provides a min/max of an allowed range of IDs.", + "min": "Min is the start of the range, inclusive.", + "max": "Max is the end of the range, inclusive.", +} + +func (IDRange) SwaggerDoc() map[string]string { + return map_IDRange +} + var map_Ingress = map[string]string{ "": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", @@ -342,6 +362,7 @@ func (IngressRuleValue) SwaggerDoc() map[string]string { var map_IngressSpec = map[string]string{ "": "IngressSpec describes the Ingress the user wishes to exist.", "backend": "A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default.", + "tls": "TLS configuration. Currently the Ingress only supports a single TLS port, 443, and assumes TLS termination. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension.", "rules": "A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.", } @@ -358,6 +379,16 @@ func (IngressStatus) SwaggerDoc() map[string]string { return map_IngressStatus } +var map_IngressTLS = map[string]string{ + "": "IngressTLS describes the transport layer security associated with an Ingress.", + "hosts": "Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.", + "secretName": "SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing.", +} + +func (IngressTLS) SwaggerDoc() map[string]string { + return map_IngressTLS +} + var map_Job = map[string]string{ "": "Job represents the configuration of a single job.", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", @@ -463,6 +494,43 @@ func (NodeUtilization) SwaggerDoc() map[string]string { return map_NodeUtilization } +var map_PodSecurityPolicy = map[string]string{ + "": "Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.", + "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "spec": "spec defines the policy enforced.", +} + +func (PodSecurityPolicy) SwaggerDoc() map[string]string { + return map_PodSecurityPolicy +} + +var map_PodSecurityPolicyList = map[string]string{ + "": "Pod Security Policy List is a list of PodSecurityPolicy objects.", + "metadata": "Standard list metadata. More info: http://docs.k8s.io/api-conventions.md#metadata", + "items": "Items is a list of schema objects.", +} + +func (PodSecurityPolicyList) SwaggerDoc() map[string]string { + return map_PodSecurityPolicyList +} + +var map_PodSecurityPolicySpec = map[string]string{ + "": "Pod Security Policy Spec defines the policy enforced.", + "privileged": "privileged determines if a pod can request to be run as privileged.", + "capabilities": "capabilities is a list of capabilities that can be added.", + "volumes": "volumes is a white list of allowed volume plugins. Empty indicates that all plugins may be used.", + "hostNetwork": "hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.", + "hostPorts": "hostPorts determines which host port ranges are allowed to be exposed.", + "hostPID": "hostPID determines if the policy allows the use of HostPID in the pod spec.", + "hostIPC": "hostIPC determines if the policy allows the use of HostIPC in the pod spec.", + "seLinuxContext": "seLinuxContext is the strategy that will dictate the allowable labels that may be set.", + "runAsUser": "runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.", +} + +func (PodSecurityPolicySpec) SwaggerDoc() map[string]string { + return map_PodSecurityPolicySpec +} + var map_ReplicaSet = map[string]string{ "": "ReplicaSet represents the configuration of a ReplicaSet.", "metadata": "If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", @@ -532,16 +600,35 @@ func (RollingUpdateDaemonSet) SwaggerDoc() map[string]string { } var map_RollingUpdateDeployment = map[string]string{ - "": "Spec to control the desired behavior of rolling update.", - "maxUnavailable": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.", - "maxSurge": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.", - "minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", + "": "Spec to control the desired behavior of rolling update.", + "maxUnavailable": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.", + "maxSurge": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.", } func (RollingUpdateDeployment) SwaggerDoc() map[string]string { return map_RollingUpdateDeployment } +var map_RunAsUserStrategyOptions = map[string]string{ + "": "Run A sUser Strategy Options defines the strategy type and any options used to create the strategy.", + "type": "type is the strategy that will dictate the allowable RunAsUser values that may be set.", + "ranges": "Ranges are the allowed ranges of uids that may be used.", +} + +func (RunAsUserStrategyOptions) SwaggerDoc() map[string]string { + return map_RunAsUserStrategyOptions +} + +var map_SELinuxContextStrategyOptions = map[string]string{ + "": "SELinux Context Strategy Options defines the strategy type and any options used to create the strategy.", + "type": "type is the strategy that will dictate the allowable labels that may be set.", + "seLinuxOptions": "seLinuxOptions required to run as; required for MustRunAs More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context", +} + +func (SELinuxContextStrategyOptions) SwaggerDoc() map[string]string { + return map_SELinuxContextStrategyOptions +} + var map_Scale = map[string]string{ "": "represents a scaling request for a resource.", "metadata": "Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.", diff --git a/pkg/apis/extensions/validation/validation.go b/pkg/apis/extensions/validation/validation.go index 5ef47b9012b..2a72bdeeed7 100644 --- a/pkg/apis/extensions/validation/validation.go +++ b/pkg/apis/extensions/validation/validation.go @@ -17,14 +17,18 @@ limitations under the License. package validation import ( + "encoding/json" "net" "regexp" "strconv" "strings" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + unversionedvalidation "k8s.io/kubernetes/pkg/api/unversioned/validation" apivalidation "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/controller/podautoscaler" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/sets" @@ -83,9 +87,34 @@ func ValidateSubresourceReference(ref extensions.SubresourceReference, fldPath * return allErrs } +func validateHorizontalPodAutoscalerAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if annotationValue, found := annotations[podautoscaler.HpaCustomMetricsTargetAnnotationName]; found { + // Try to parse the annotation + var targetList extensions.CustomMetricTargetList + if err := json.Unmarshal([]byte(annotationValue), &targetList); err != nil { + allErrs = append(allErrs, field.Invalid(fldPath.Child("annotations"), annotations, "failed to parse custom metrics target annotation")) + } else { + if len(targetList.Items) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("annotations", "items"), "custom metrics target must not be empty")) + } + for _, target := range targetList.Items { + if target.Name == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("annotations", "items", "name"), "missing custom metric target name")) + } + if target.TargetValue.MilliValue() <= 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("annotations", "items", "value"), target.TargetValue, "custom metric target value must be greater than 0")) + } + } + } + } + return allErrs +} + func ValidateHorizontalPodAutoscaler(autoscaler *extensions.HorizontalPodAutoscaler) field.ErrorList { allErrs := apivalidation.ValidateObjectMeta(&autoscaler.ObjectMeta, true, ValidateHorizontalPodAutoscalerName, field.NewPath("metadata")) allErrs = append(allErrs, validateHorizontalPodAutoscalerSpec(autoscaler.Spec, field.NewPath("spec"))...) + allErrs = append(allErrs, validateHorizontalPodAutoscalerAnnotations(autoscaler.Annotations, field.NewPath("metadata"))...) return allErrs } @@ -210,9 +239,9 @@ func ValidateDaemonSetUpdateStrategy(strategy *extensions.DaemonSetUpdateStrateg func ValidateDaemonSetSpec(spec *extensions.DaemonSetSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - allErrs = append(allErrs, ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) + allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) - selector, err := extensions.LabelSelectorAsSelector(spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(spec.Selector) if err == nil && !selector.Matches(labels.Set(spec.Template.Labels)) { allErrs = append(allErrs, field.Invalid(fldPath.Child("template", "metadata", "labels"), spec.Template.Labels, "`selector` does not match template `labels`")) } @@ -290,7 +319,6 @@ func ValidateRollingUpdateDeployment(rollingUpdate *extensions.RollingUpdateDepl } // Validate that MaxUnavailable is not more than 100%. allErrs = append(allErrs, IsNotMoreThan100Percent(rollingUpdate.MaxUnavailable, fldPath.Child("maxUnavailable"))...) - allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(rollingUpdate.MinReadySeconds), fldPath.Child("minReadySeconds"))...) return allErrs } @@ -318,18 +346,30 @@ func ValidateRollback(rollback *extensions.RollbackConfig, fldPath *field.Path) // Validates given deployment spec. func ValidateDeploymentSpec(spec *extensions.DeploymentSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - allErrs = append(allErrs, apivalidation.ValidateNonEmptySelector(spec.Selector, fldPath.Child("selector"))...) allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(spec.Replicas), fldPath.Child("replicas"))...) - allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpecForRC(&spec.Template, spec.Selector, spec.Replicas, fldPath.Child("template"))...) + + if spec.Selector == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("selector"), "")) + } else { + allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) + if len(spec.Selector.MatchLabels)+len(spec.Selector.MatchExpressions) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "empty selector is not valid for deployment.")) + } + } + + selector, err := unversioned.LabelSelectorAsSelector(spec.Selector) + if err != nil { + allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "failed to convert LabelSelector to Selector.")) + } else { + allErrs = append(allErrs, ValidatePodTemplateSpecForReplicaSet(&spec.Template, selector, spec.Replicas, fldPath.Child("template"))...) + } + allErrs = append(allErrs, ValidateDeploymentStrategy(&spec.Strategy, fldPath.Child("strategy"))...) + allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(spec.MinReadySeconds), fldPath.Child("minReadySeconds"))...) if spec.RevisionHistoryLimit != nil { // zero is a valid RevisionHistoryLimit allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(*spec.RevisionHistoryLimit), fldPath.Child("revisionHistoryLimit"))...) } - // empty string is a valid UniqueLabelKey - if len(spec.UniqueLabelKey) > 0 { - allErrs = append(allErrs, apivalidation.ValidateLabelName(spec.UniqueLabelKey, fldPath.Child("uniqueLabel"))...) - } if spec.RollbackTo != nil { allErrs = append(allErrs, ValidateRollback(spec.RollbackTo, fldPath.Child("rollback"))...) } @@ -391,10 +431,10 @@ func ValidateJobSpec(spec *extensions.JobSpec, fldPath *field.Path) field.ErrorL if spec.Selector == nil { allErrs = append(allErrs, field.Required(fldPath.Child("selector"), "")) } else { - allErrs = append(allErrs, ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) + allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) } - if selector, err := extensions.LabelSelectorAsSelector(spec.Selector); err == nil { + if selector, err := unversioned.LabelSelectorAsSelector(spec.Selector); err == nil { labels := labels.Set(spec.Template.Labels) if !selector.Matches(labels) { allErrs = append(allErrs, field.Invalid(fldPath.Child("template", "metadata", "labels"), spec.Template.Labels, "`selector` does not match template `labels`")) @@ -457,6 +497,20 @@ func ValidateIngressName(name string, prefix bool) (bool, string) { return apivalidation.NameIsDNSSubdomain(name, prefix) } +func validateIngressTLS(spec *extensions.IngressSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + // Currently the Ingress only supports HTTP(S), so a secretName is required. + // This will not be the case if we support SSL routing at L4 via SNI. + for i, t := range spec.TLS { + if t.SecretName == "" { + allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("secretName"), spec.TLS[i].SecretName)) + } + } + // TODO: Perform a more thorough validation of spec.TLS.Hosts that takes + // the wildcard spec from RFC 6125 into account. + return allErrs +} + // ValidateIngressSpec tests if required fields in the IngressSpec are set. func ValidateIngressSpec(spec *extensions.IngressSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -469,6 +523,9 @@ func ValidateIngressSpec(spec *extensions.IngressSpec, fldPath *field.Path) fiel if len(spec.Rules) > 0 { allErrs = append(allErrs, validateIngressRules(spec.Rules, fldPath.Child("rules"))...) } + if len(spec.TLS) > 0 { + allErrs = append(allErrs, validateIngressTLS(spec, fldPath.Child("tls"))...) + } return allErrs } @@ -604,36 +661,6 @@ func ValidateClusterAutoscaler(autoscaler *extensions.ClusterAutoscaler) field.E return allErrs } -func ValidateLabelSelector(ps *extensions.LabelSelector, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if ps == nil { - return allErrs - } - allErrs = append(allErrs, apivalidation.ValidateLabels(ps.MatchLabels, fldPath.Child("matchLabels"))...) - for i, expr := range ps.MatchExpressions { - allErrs = append(allErrs, ValidateLabelSelectorRequirement(expr, fldPath.Child("matchExpressions").Index(i))...) - } - return allErrs -} - -func ValidateLabelSelectorRequirement(sr extensions.LabelSelectorRequirement, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - switch sr.Operator { - case extensions.LabelSelectorOpIn, extensions.LabelSelectorOpNotIn: - if len(sr.Values) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'")) - } - case extensions.LabelSelectorOpExists, extensions.LabelSelectorOpDoesNotExist: - if len(sr.Values) > 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'")) - } - default: - allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator")) - } - allErrs = append(allErrs, apivalidation.ValidateLabelName(sr.Key, fldPath.Child("key"))...) - return allErrs -} - func ValidateScale(scale *extensions.Scale) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&scale.ObjectMeta, true, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))...) @@ -686,13 +713,13 @@ func ValidateReplicaSetSpec(spec *extensions.ReplicaSetSpec, fldPath *field.Path if spec.Selector == nil { allErrs = append(allErrs, field.Required(fldPath.Child("selector"), "")) } else { - allErrs = append(allErrs, ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) + allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) if len(spec.Selector.MatchLabels)+len(spec.Selector.MatchExpressions) == 0 { allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "empty selector is not valid for deployment.")) } } - selector, err := extensions.LabelSelectorAsSelector(spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(spec.Selector) if err != nil { allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "failed to convert LabelSelector to Selector.")) } else { @@ -725,3 +752,116 @@ func ValidatePodTemplateSpecForReplicaSet(template *api.PodTemplateSpec, selecto } return allErrs } + +// ValidatePodSecurityPolicyName can be used to check whether the given +// pod security policy name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +func ValidatePodSecurityPolicyName(name string, prefix bool) (bool, string) { + return apivalidation.NameIsDNSSubdomain(name, prefix) +} + +func ValidatePodSecurityPolicy(psp *extensions.PodSecurityPolicy) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&psp.ObjectMeta, false, ValidatePodSecurityPolicyName, field.NewPath("metadata"))...) + allErrs = append(allErrs, ValidatePodSecurityPolicySpec(&psp.Spec, field.NewPath("spec"))...) + return allErrs +} + +func ValidatePodSecurityPolicySpec(spec *extensions.PodSecurityPolicySpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + allErrs = append(allErrs, validatePSPRunAsUser(fldPath.Child("runAsUser"), &spec.RunAsUser)...) + allErrs = append(allErrs, validatePSPSELinuxContext(fldPath.Child("seLinuxContext"), &spec.SELinuxContext)...) + allErrs = append(allErrs, validatePodSecurityPolicyVolumes(fldPath, spec.Volumes)...) + + return allErrs +} + +// validatePSPSELinuxContext validates the SELinuxContext fields of PodSecurityPolicy. +func validatePSPSELinuxContext(fldPath *field.Path, seLinuxContext *extensions.SELinuxContextStrategyOptions) field.ErrorList { + allErrs := field.ErrorList{} + + // ensure the selinux strategy has a valid type + supportedSELinuxContextTypes := sets.NewString(string(extensions.SELinuxStrategyMustRunAs), + string(extensions.SELinuxStrategyRunAsAny)) + if !supportedSELinuxContextTypes.Has(string(seLinuxContext.Type)) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("type"), seLinuxContext.Type, supportedSELinuxContextTypes.List())) + } + + return allErrs +} + +// validatePSPRunAsUser validates the RunAsUser fields of PodSecurityPolicy. +func validatePSPRunAsUser(fldPath *field.Path, runAsUser *extensions.RunAsUserStrategyOptions) field.ErrorList { + allErrs := field.ErrorList{} + + // ensure the user strategy has a valid type + supportedRunAsUserTypes := sets.NewString(string(extensions.RunAsUserStrategyMustRunAs), + string(extensions.RunAsUserStrategyMustRunAsNonRoot), + string(extensions.RunAsUserStrategyRunAsAny)) + if !supportedRunAsUserTypes.Has(string(runAsUser.Type)) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("type"), runAsUser.Type, supportedRunAsUserTypes.List())) + } + + // validate range settings + for idx, rng := range runAsUser.Ranges { + allErrs = append(allErrs, validateIDRanges(fldPath.Child("ranges").Index(idx), rng)...) + } + + return allErrs +} + +// validatePodSecurityPolicyVolumes validates the volume fields of PodSecurityPolicy. +func validatePodSecurityPolicyVolumes(fldPath *field.Path, volumes []extensions.FSType) field.ErrorList { + allErrs := field.ErrorList{} + allowed := sets.NewString(string(extensions.HostPath), + string(extensions.EmptyDir), + string(extensions.GCEPersistentDisk), + string(extensions.AWSElasticBlockStore), + string(extensions.GitRepo), + string(extensions.Secret), + string(extensions.NFS), + string(extensions.ISCSI), + string(extensions.Glusterfs), + string(extensions.PersistentVolumeClaim), + string(extensions.RBD), + string(extensions.Cinder), + string(extensions.CephFS), + string(extensions.DownwardAPI), + string(extensions.FC)) + for _, v := range volumes { + if !allowed.Has(string(v)) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("volumes"), v, allowed.List())) + } + } + + return allErrs +} + +// validateIDRanges ensures the range is valid. +func validateIDRanges(fldPath *field.Path, rng extensions.IDRange) field.ErrorList { + allErrs := field.ErrorList{} + + // if 0 <= Min <= Max then we do not need to validate max. It is always greater than or + // equal to 0 and Min. + if rng.Min < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("min"), rng.Min, "min cannot be negative")) + } + if rng.Max < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("max"), rng.Max, "max cannot be negative")) + } + if rng.Min > rng.Max { + allErrs = append(allErrs, field.Invalid(fldPath.Child("min"), rng.Min, "min cannot be greater than max")) + } + + return allErrs +} + +// ValidatePodSecurityPolicyUpdate validates a PSP for updates. +func ValidatePodSecurityPolicyUpdate(old *extensions.PodSecurityPolicy, new *extensions.PodSecurityPolicy) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&old.ObjectMeta, &new.ObjectMeta, field.NewPath("metadata"))...) + allErrs = append(allErrs, ValidatePodSecurityPolicySpec(&new.Spec, field.NewPath("spec"))...) + return allErrs +} diff --git a/pkg/apis/extensions/validation/validation_test.go b/pkg/apis/extensions/validation/validation_test.go index fec366b05b8..fbe751ab063 100644 --- a/pkg/apis/extensions/validation/validation_test.go +++ b/pkg/apis/extensions/validation/validation_test.go @@ -22,7 +22,9 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/controller/podautoscaler" "k8s.io/kubernetes/pkg/util/intstr" ) @@ -59,6 +61,24 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) { MaxReplicas: 5, }, }, + { + ObjectMeta: api.ObjectMeta{ + Name: "myautoscaler", + Namespace: api.NamespaceDefault, + Annotations: map[string]string{ + podautoscaler.HpaCustomMetricsTargetAnnotationName: "{\"items\":[{\"name\":\"qps\",\"value\":\"20\"}]}", + }, + }, + Spec: extensions.HorizontalPodAutoscalerSpec{ + ScaleRef: extensions.SubresourceReference{ + Kind: "ReplicationController", + Name: "myrc", + Subresource: "scale", + }, + MinReplicas: newInt(1), + MaxReplicas: 5, + }, + }, } for _, successCase := range successCases { if errs := ValidateHorizontalPodAutoscaler(&successCase); len(errs) != 0 { @@ -203,6 +223,90 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) { }, msg: "must be greater than 0", }, + { + horizontalPodAutoscaler: extensions.HorizontalPodAutoscaler{ + ObjectMeta: api.ObjectMeta{ + Name: "myautoscaler", + Namespace: api.NamespaceDefault, + Annotations: map[string]string{ + podautoscaler.HpaCustomMetricsTargetAnnotationName: "broken", + }, + }, + Spec: extensions.HorizontalPodAutoscalerSpec{ + ScaleRef: extensions.SubresourceReference{ + Kind: "ReplicationController", + Name: "myrc", + Subresource: "scale", + }, + MinReplicas: newInt(1), + MaxReplicas: 5, + }, + }, + msg: "failed to parse custom metrics target annotation", + }, + { + horizontalPodAutoscaler: extensions.HorizontalPodAutoscaler{ + ObjectMeta: api.ObjectMeta{ + Name: "myautoscaler", + Namespace: api.NamespaceDefault, + Annotations: map[string]string{ + podautoscaler.HpaCustomMetricsTargetAnnotationName: "{}", + }, + }, + Spec: extensions.HorizontalPodAutoscalerSpec{ + ScaleRef: extensions.SubresourceReference{ + Kind: "ReplicationController", + Name: "myrc", + Subresource: "scale", + }, + MinReplicas: newInt(1), + MaxReplicas: 5, + }, + }, + msg: "custom metrics target must not be empty", + }, + { + horizontalPodAutoscaler: extensions.HorizontalPodAutoscaler{ + ObjectMeta: api.ObjectMeta{ + Name: "myautoscaler", + Namespace: api.NamespaceDefault, + Annotations: map[string]string{ + podautoscaler.HpaCustomMetricsTargetAnnotationName: "{\"items\":[{\"value\":\"20\"}]}", + }, + }, + Spec: extensions.HorizontalPodAutoscalerSpec{ + ScaleRef: extensions.SubresourceReference{ + Kind: "ReplicationController", + Name: "myrc", + Subresource: "scale", + }, + MinReplicas: newInt(1), + MaxReplicas: 5, + }, + }, + msg: "missing custom metric target name", + }, + { + horizontalPodAutoscaler: extensions.HorizontalPodAutoscaler{ + ObjectMeta: api.ObjectMeta{ + Name: "myautoscaler", + Namespace: api.NamespaceDefault, + Annotations: map[string]string{ + podautoscaler.HpaCustomMetricsTargetAnnotationName: "{\"items\":[{\"name\":\"qps\",\"value\":\"0\"}]}", + }, + }, + Spec: extensions.HorizontalPodAutoscalerSpec{ + ScaleRef: extensions.SubresourceReference{ + Kind: "ReplicationController", + Name: "myrc", + Subresource: "scale", + }, + MinReplicas: newInt(1), + MaxReplicas: 5, + }, + }, + msg: "custom metric target value must be greater than 0", + }, } for _, c := range errorCases { @@ -375,7 +479,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -383,7 +487,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -393,7 +497,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -401,7 +505,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector2}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector2}, Template: validPodTemplateAbc2.Template, UpdateStrategy: validUpdateStrategy, }, @@ -411,7 +515,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -419,7 +523,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateNodeSelector.Template, UpdateStrategy: validUpdateStrategy, }, @@ -438,7 +542,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -446,7 +550,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -456,7 +560,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -464,7 +568,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: invalidSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: invalidSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -474,7 +578,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -482,7 +586,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: invalidPodTemplate.Template, UpdateStrategy: validUpdateStrategy, }, @@ -492,7 +596,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -500,7 +604,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateDef.Template, UpdateStrategy: validUpdateStrategy, }, @@ -510,7 +614,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -518,7 +622,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: readWriteVolumePodTemplate.Template, UpdateStrategy: validUpdateStrategy, }, @@ -528,7 +632,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { old: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: validUpdateStrategy, }, @@ -536,7 +640,7 @@ func TestValidateDaemonSetUpdate(t *testing.T) { update: extensions.DaemonSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: invalidSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: invalidSelector}, Template: validPodTemplateAbc.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -589,7 +693,7 @@ func TestValidateDaemonSet(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: validUpdateStrategy, }, @@ -597,7 +701,7 @@ func TestValidateDaemonSet(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: validUpdateStrategy, }, @@ -613,14 +717,14 @@ func TestValidateDaemonSet(t *testing.T) { "zero-length ID": { ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, }, }, "missing-namespace": { ObjectMeta: api.ObjectMeta{Name: "abc-123"}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, }, }, @@ -633,14 +737,14 @@ func TestValidateDaemonSet(t *testing.T) { "selector_doesnt_match": { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, Template: validPodTemplate.Template, }, }, "invalid template": { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, }, }, "invalid_label": { @@ -652,7 +756,7 @@ func TestValidateDaemonSet(t *testing.T) { }, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, }, }, @@ -677,7 +781,7 @@ func TestValidateDaemonSet(t *testing.T) { }, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, }, }, @@ -687,7 +791,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: api.PodTemplateSpec{ Spec: api.PodSpec{ RestartPolicy: api.RestartPolicyOnFailure, @@ -706,7 +810,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: api.PodTemplateSpec{ Spec: api.PodSpec{ RestartPolicy: api.RestartPolicyNever, @@ -725,7 +829,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: "", @@ -741,7 +845,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -755,7 +859,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -772,7 +876,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -789,7 +893,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -806,7 +910,7 @@ func TestValidateDaemonSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validSelector}, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, Template: validPodTemplate.Template, UpdateStrategy: extensions.DaemonSetUpdateStrategy{ Type: extensions.RollingUpdateDaemonSetStrategyType, @@ -848,8 +952,10 @@ func validDeployment() *extensions.Deployment { Namespace: api.NamespaceDefault, }, Spec: extensions.DeploymentSpec{ - Selector: map[string]string{ - "name": "abc", + Selector: &unversioned.LabelSelector{ + MatchLabels: map[string]string{ + "name": "abc", + }, }, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ @@ -871,7 +977,6 @@ func validDeployment() *extensions.Deployment { }, }, }, - UniqueLabelKey: "my-label", RollbackTo: &extensions.RollbackConfig{ Revision: 1, }, @@ -897,8 +1002,10 @@ func TestValidateDeployment(t *testing.T) { } // selector should match the labels in pod template. invalidSelectorDeployment := validDeployment() - invalidSelectorDeployment.Spec.Selector = map[string]string{ - "name": "def", + invalidSelectorDeployment.Spec.Selector = &unversioned.LabelSelector{ + MatchLabels: map[string]string{ + "name": "def", + }, } errorCases["`selector` does not match template `labels`"] = invalidSelectorDeployment @@ -907,11 +1014,6 @@ func TestValidateDeployment(t *testing.T) { invalidRestartPolicyDeployment.Spec.Template.Spec.RestartPolicy = api.RestartPolicyNever errorCases["Unsupported value: \"Never\""] = invalidRestartPolicyDeployment - // invalid unique label key. - invalidUniqueLabelDeployment := validDeployment() - invalidUniqueLabelDeployment.Spec.UniqueLabelKey = "abc/def/ghi" - errorCases["spec.uniqueLabel: Invalid value"] = invalidUniqueLabelDeployment - // rollingUpdate should be nil for recreate. invalidRecreateDeployment := validDeployment() invalidRecreateDeployment.Spec.Strategy = extensions.DeploymentStrategy{ @@ -1007,7 +1109,7 @@ func TestValidateDeploymentRollback(t *testing.T) { } func TestValidateJob(t *testing.T) { - validSelector := &extensions.LabelSelector{ + validSelector := &unversioned.LabelSelector{ MatchLabels: map[string]string{"a": "b"}, } validPodTemplateSpec := api.PodTemplateSpec{ @@ -1210,6 +1312,8 @@ func TestValidateIngress(t *testing.T) { badHostIP := newValid() badHostIP.Spec.Rules[0].Host = hostIP badHostIPErr := fmt.Sprintf("spec.rules[0].host: Invalid value: '%v'", hostIP) + noSecretName := newValid() + noSecretName.Spec.TLS = []extensions.IngressTLS{{SecretName: ""}} errorCases := map[string]extensions.Ingress{ "spec.backend.serviceName: Required value": servicelessBackend, @@ -1218,6 +1322,7 @@ func TestValidateIngress(t *testing.T) { "spec.rules[0].host: Invalid value": badHost, "spec.rules[0].http.paths: Required value": noPaths, "spec.rules[0].http.paths[0].path: Invalid value": noForwardSlashPath, + "spec.tls[0].secretName: Required value": noSecretName, } errorCases[badPathErr] = badRegexPath errorCases[badHostIPErr] = badHostIP @@ -1529,7 +1634,7 @@ func TestValidateReplicaSetStatusUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, Status: extensions.ReplicaSetStatus{ @@ -1540,7 +1645,7 @@ func TestValidateReplicaSetStatusUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 3, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, Status: extensions.ReplicaSetStatus{ @@ -1561,7 +1666,7 @@ func TestValidateReplicaSetStatusUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, Status: extensions.ReplicaSetStatus{ @@ -1572,7 +1677,7 @@ func TestValidateReplicaSetStatusUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 2, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, Status: extensions.ReplicaSetStatus{ @@ -1637,7 +1742,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1645,7 +1750,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 3, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1654,7 +1759,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1662,7 +1767,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 1, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &readWriteVolumePodTemplate.Template, }, }, @@ -1680,7 +1785,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1688,7 +1793,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 2, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &readWriteVolumePodTemplate.Template, }, }, @@ -1697,7 +1802,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1705,7 +1810,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 2, - Selector: &extensions.LabelSelector{MatchLabels: invalidLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: invalidLabels}, Template: &validPodTemplate.Template, }, }, @@ -1714,7 +1819,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1722,7 +1827,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 2, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &invalidPodTemplate.Template, }, }, @@ -1731,7 +1836,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { old: extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1739,7 +1844,7 @@ func TestValidateReplicaSetUpdate(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: -1, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1795,14 +1900,14 @@ func TestValidateReplicaSet(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, { ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1810,7 +1915,7 @@ func TestValidateReplicaSet(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: 1, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &readWriteVolumePodTemplate.Template, }, }, @@ -1825,14 +1930,14 @@ func TestValidateReplicaSet(t *testing.T) { "zero-length ID": { ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, "missing-namespace": { ObjectMeta: api.ObjectMeta{Name: "abc-123"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1845,21 +1950,21 @@ func TestValidateReplicaSet(t *testing.T) { "selector_doesnt_match": { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, Template: &validPodTemplate.Template, }, }, "invalid manifest": { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, }, }, "read-write persistent disk with > 1 pod": { ObjectMeta: api.ObjectMeta{Name: "abc"}, Spec: extensions.ReplicaSetSpec{ Replicas: 2, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &readWriteVolumePodTemplate.Template, }, }, @@ -1867,7 +1972,7 @@ func TestValidateReplicaSet(t *testing.T) { ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, Spec: extensions.ReplicaSetSpec{ Replicas: -1, - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, }, }, "invalid_label": { @@ -1879,7 +1984,7 @@ func TestValidateReplicaSet(t *testing.T) { }, }, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1904,7 +2009,7 @@ func TestValidateReplicaSet(t *testing.T) { }, }, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &validPodTemplate.Template, }, }, @@ -1914,7 +2019,7 @@ func TestValidateReplicaSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &api.PodTemplateSpec{ Spec: api.PodSpec{ RestartPolicy: api.RestartPolicyOnFailure, @@ -1933,7 +2038,7 @@ func TestValidateReplicaSet(t *testing.T) { Namespace: api.NamespaceDefault, }, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: validLabels}, + Selector: &unversioned.LabelSelector{MatchLabels: validLabels}, Template: &api.PodTemplateSpec{ Spec: api.PodSpec{ RestartPolicy: api.RestartPolicyNever, @@ -1976,3 +2081,126 @@ func newInt(val int) *int { *p = val return p } + +func TestValidatePodSecurityPolicy(t *testing.T) { + validSCC := func() *extensions.PodSecurityPolicy { + return &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{Name: "foo"}, + Spec: extensions.PodSecurityPolicySpec{ + SELinuxContext: extensions.SELinuxContextStrategyOptions{ + Type: extensions.SELinuxStrategyRunAsAny, + }, + RunAsUser: extensions.RunAsUserStrategyOptions{ + Type: extensions.RunAsUserStrategyRunAsAny, + }, + }, + } + } + + noUserOptions := validSCC() + noUserOptions.Spec.RunAsUser.Type = "" + + noSELinuxOptions := validSCC() + noSELinuxOptions.Spec.SELinuxContext.Type = "" + + invalidUserStratType := validSCC() + invalidUserStratType.Spec.RunAsUser.Type = "invalid" + + invalidSELinuxStratType := validSCC() + invalidSELinuxStratType.Spec.SELinuxContext.Type = "invalid" + + missingObjectMetaName := validSCC() + missingObjectMetaName.ObjectMeta.Name = "" + + invalidRangeMinGreaterThanMax := validSCC() + invalidRangeMinGreaterThanMax.Spec.RunAsUser.Ranges = []extensions.IDRange{ + {Min: 2, Max: 1}, + } + + invalidRangeNegativeMin := validSCC() + invalidRangeNegativeMin.Spec.RunAsUser.Ranges = []extensions.IDRange{ + {Min: -1, Max: 10}, + } + + invalidRangeNegativeMax := validSCC() + invalidRangeNegativeMax.Spec.RunAsUser.Ranges = []extensions.IDRange{ + {Min: 1, Max: -10}, + } + + errorCases := map[string]struct { + scc *extensions.PodSecurityPolicy + errorDetail string + }{ + "no user options": { + scc: noUserOptions, + errorDetail: "supported values: MustRunAs, MustRunAsNonRoot, RunAsAny", + }, + "no selinux options": { + scc: noSELinuxOptions, + errorDetail: "supported values: MustRunAs, RunAsAny", + }, + "invalid user strategy type": { + scc: invalidUserStratType, + errorDetail: "supported values: MustRunAs, MustRunAsNonRoot, RunAsAny", + }, + "invalid selinux strategy type": { + scc: invalidSELinuxStratType, + errorDetail: "supported values: MustRunAs, RunAsAny", + }, + "missing object meta name": { + scc: missingObjectMetaName, + errorDetail: "name or generateName is required", + }, + "invalid range min greater than max": { + scc: invalidRangeMinGreaterThanMax, + errorDetail: "min cannot be greater than max", + }, + "invalid range negative min": { + scc: invalidRangeNegativeMin, + errorDetail: "min cannot be negative", + }, + "invalid range negative max": { + scc: invalidRangeNegativeMax, + errorDetail: "max cannot be negative", + }, + } + + for k, v := range errorCases { + if errs := ValidatePodSecurityPolicy(v.scc); len(errs) == 0 || errs[0].Detail != v.errorDetail { + t.Errorf("Expected error with detail %s for %s, got %v", v.errorDetail, k, errs[0].Detail) + } + } + + mustRunAs := validSCC() + mustRunAs.Spec.RunAsUser.Type = extensions.RunAsUserStrategyMustRunAs + mustRunAs.Spec.RunAsUser.Ranges = []extensions.IDRange{ + { + Min: 1, + Max: 1, + }, + } + mustRunAs.Spec.SELinuxContext.Type = extensions.SELinuxStrategyMustRunAs + + runAsNonRoot := validSCC() + runAsNonRoot.Spec.RunAsUser.Type = extensions.RunAsUserStrategyMustRunAsNonRoot + + successCases := map[string]struct { + scc *extensions.PodSecurityPolicy + }{ + "must run as": { + scc: mustRunAs, + }, + "run as any": { + scc: validSCC(), + }, + "run as non-root (user only)": { + scc: runAsNonRoot, + }, + } + + for k, v := range successCases { + if errs := ValidatePodSecurityPolicy(v.scc); len(errs) != 0 { + t.Errorf("Expected success for %s, got %v", k, errs) + } + } +} diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 819cec6a198..8d55f1deba4 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -31,6 +31,7 @@ import ( "k8s.io/kubernetes/pkg/api/rest" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/apiserver/metrics" "k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/runtime" watchjson "k8s.io/kubernetes/pkg/watch/json" @@ -152,10 +153,11 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } } + kind := fqKindToRegister.Kind + if fqKindToRegister.IsEmpty() { return nil, fmt.Errorf("unable to locate fully qualified kind for %v: found %v when registering for %v", reflect.TypeOf(object), fqKinds, a.group.GroupVersion) } - kind := fqKindToRegister.Kind versionedPtr, err := a.group.Creater.New(a.group.GroupVersion.WithKind(kind)) if err != nil { @@ -322,6 +324,14 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag params := []*restful.Parameter{} actions := []action{} + var resourceKind string + kindProvider, ok := storage.(rest.KindProvider) + if ok { + resourceKind = kindProvider.Kind() + } else { + resourceKind = fqKindToRegister.Kind + } + var apiResource unversioned.APIResource // Get the list of actions for the given scope. switch scope.Name() { @@ -339,6 +349,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } apiResource.Name = path apiResource.Namespaced = false + apiResource.Kind = resourceKind namer := rootScopeNaming{scope, a.group.Linker, gpath.Join(a.prefix, itemPath)} // Handler for standard REST verbs (GET, PUT, POST and DELETE). @@ -381,6 +392,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } apiResource.Name = path apiResource.Namespaced = true + apiResource.Kind = resourceKind namer := scopeNaming{scope, a.group.Linker, gpath.Join(a.prefix, itemPath), false} actions = appendIf(actions, action{"LIST", resourcePath, resourceParams, namer}, isLister) @@ -445,7 +457,6 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } for _, action := range actions { reqScope.Namer = action.Namer - m := monitorFilter(action.Verb, resource) namespaced := "" if strings.Contains(action.Path, scope.ArgumentName()) { namespaced = "Namespaced" @@ -458,12 +469,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } else { handler = GetResource(getter, exporter, reqScope) } + handler = metrics.InstrumentRouteFunc(action.Verb, resource, handler) doc := "read the specified " + kind if hasSubresource { doc = "read " + subresource + " of the specified " + kind } route := ws.GET(action.Path).To(handler). - Filter(m). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("read"+namespaced+kind+strings.Title(subresource)). @@ -487,8 +498,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "list " + subresource + " of objects of kind " + kind } - route := ws.GET(action.Path).To(ListResource(lister, watcher, reqScope, false, a.minRequestTimeout)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, ListResource(lister, watcher, reqScope, false, a.minRequestTimeout)) + route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("list"+namespaced+kind+strings.Title(subresource)). @@ -519,8 +530,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "replace " + subresource + " of the specified " + kind } - route := ws.PUT(action.Path).To(UpdateResource(updater, reqScope, a.group.Typer, admit)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, UpdateResource(updater, reqScope, a.group.Typer, admit)) + route := ws.PUT(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("replace"+namespaced+kind+strings.Title(subresource)). @@ -535,8 +546,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "partially update " + subresource + " of the specified " + kind } - route := ws.PATCH(action.Path).To(PatchResource(patcher, reqScope, a.group.Typer, admit, mapping.ObjectConvertor)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, PatchResource(patcher, reqScope, a.group.Typer, admit, mapping.ObjectConvertor)) + route := ws.PATCH(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Consumes(string(api.JSONPatchType), string(api.MergePatchType), string(api.StrategicMergePatchType)). @@ -554,12 +565,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } else { handler = CreateResource(creater, reqScope, a.group.Typer, admit) } + handler = metrics.InstrumentRouteFunc(action.Verb, resource, handler) doc := "create a " + kind if hasSubresource { doc = "create " + subresource + " of a " + kind } route := ws.POST(action.Path).To(handler). - Filter(m). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("create"+namespaced+kind+strings.Title(subresource)). @@ -574,8 +585,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "delete " + subresource + " of a " + kind } - route := ws.DELETE(action.Path).To(DeleteResource(gracefulDeleter, isGracefulDeleter, reqScope, admit)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, DeleteResource(gracefulDeleter, isGracefulDeleter, reqScope, admit)) + route := ws.DELETE(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("delete"+namespaced+kind+strings.Title(subresource)). @@ -592,8 +603,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "delete collection of " + subresource + " of a " + kind } - route := ws.DELETE(action.Path).To(DeleteCollection(collectionDeleter, isCollectionDeleter, reqScope, admit)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, DeleteCollection(collectionDeleter, isCollectionDeleter, reqScope, admit)) + route := ws.DELETE(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("deletecollection"+namespaced+kind+strings.Title(subresource)). @@ -611,8 +622,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "watch changes to " + subresource + " of an object of kind " + kind } - route := ws.GET(action.Path).To(ListResource(lister, watcher, reqScope, true, a.minRequestTimeout)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, ListResource(lister, watcher, reqScope, true, a.minRequestTimeout)) + route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("watch"+namespaced+kind+strings.Title(subresource)). @@ -630,8 +641,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "watch individual changes to a list of " + subresource + " of " + kind } - route := ws.GET(action.Path).To(ListResource(lister, watcher, reqScope, true, a.minRequestTimeout)). - Filter(m). + handler := metrics.InstrumentRouteFunc(action.Verb, resource, ListResource(lister, watcher, reqScope, true, a.minRequestTimeout)) + route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). Operation("watch"+namespaced+kind+strings.Title(subresource)+"List"). @@ -657,9 +668,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "connect " + method + " requests to " + subresource + " of " + kind } + handler := metrics.InstrumentRouteFunc(action.Verb, resource, ConnectResource(connecter, reqScope, admit, path)) route := ws.Method(method).Path(action.Path). - To(ConnectResource(connecter, reqScope, admit, path)). - Filter(m). + To(handler). Doc(doc). Operation("connect" + strings.Title(strings.ToLower(method)) + namespaced + kind + strings.Title(subresource)). Produces("*/*"). @@ -845,8 +856,8 @@ func addProxyRoute(ws *restful.WebService, method string, prefix string, path st if hasSubresource { doc = "proxy " + method + " requests to " + subresource + " of " + kind } - proxyRoute := ws.Method(method).Path(path).To(routeFunction(proxyHandler)). - Filter(monitorFilter("PROXY", resource)). + handler := metrics.InstrumentRouteFunc("PROXY", resource, routeFunction(proxyHandler)) + proxyRoute := ws.Method(method).Path(path).To(handler). Doc(doc). Operation("proxy" + strings.Title(method) + namespaced + kind + strings.Title(subresource)). Produces("*/*"). diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 8f53bd74dd4..8700e106043 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -40,7 +40,6 @@ import ( "k8s.io/kubernetes/pkg/runtime" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/flushwriter" - utilnet "k8s.io/kubernetes/pkg/util/net" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wsstream" "k8s.io/kubernetes/pkg/version" @@ -54,16 +53,6 @@ func init() { metrics.Register() } -// monitorFilter creates a filter that reports the metrics for a given resource and action. -func monitorFilter(action, resource string) restful.FilterFunction { - return func(req *restful.Request, res *restful.Response, chain *restful.FilterChain) { - reqStart := time.Now() - chain.ProcessFilter(req, res) - httpCode := res.StatusCode() - metrics.Monitor(&action, &resource, utilnet.GetHTTPClient(req.Request), &httpCode, reqStart) - } -} - // mux is an object that can register http handlers. type Mux interface { Handle(pattern string, handler http.Handler) @@ -168,13 +157,10 @@ func (g *APIGroupVersion) newInstaller() *APIInstaller { // TODO: document all handlers // InstallSupport registers the APIServer support functions -func InstallSupport(mux Mux, ws *restful.WebService, enableResettingMetrics bool, checks ...healthz.HealthzChecker) { +func InstallSupport(mux Mux, ws *restful.WebService, checks ...healthz.HealthzChecker) { // TODO: convert healthz and metrics to restful and remove container arg healthz.InstallHandler(mux, checks...) mux.Handle("/metrics", prometheus.Handler()) - if enableResettingMetrics { - mux.HandleFunc("/resetMetrics", metrics.Reset) - } // Set up a service to return the git code version. ws.Path("/version") diff --git a/pkg/apiserver/apiserver_test.go b/pkg/apiserver/apiserver_test.go index c558ff5d7f7..f997cd4c5e0 100644 --- a/pkg/apiserver/apiserver_test.go +++ b/pkg/apiserver/apiserver_test.go @@ -179,9 +179,9 @@ func init() { gvk := gv.WithKind(kind) root := bool(kind == "SimpleRoot") if root { - nsMapper.Add(gvk, meta.RESTScopeRoot, false) + nsMapper.Add(gvk, meta.RESTScopeRoot) } else { - nsMapper.Add(gvk, meta.RESTScopeNamespace, false) + nsMapper.Add(gvk, meta.RESTScopeNamespace) } } } @@ -297,7 +297,7 @@ func handleInternal(storage map[string]rest.Storage, admissionControl admission. } ws := new(restful.WebService) - InstallSupport(mux, ws, false) + InstallSupport(mux, ws) container.Add(ws) return &defaultAPIServer{mux, container} } diff --git a/pkg/apiserver/metrics/metrics.go b/pkg/apiserver/metrics/metrics.go index 8e25356de5a..ec7497c4baa 100644 --- a/pkg/apiserver/metrics/metrics.go +++ b/pkg/apiserver/metrics/metrics.go @@ -17,11 +17,15 @@ limitations under the License. package metrics import ( - "io" + "bufio" + "net" "net/http" "strconv" "time" + utilnet "k8s.io/kubernetes/pkg/util/net" + + "github.com/emicklei/go-restful" "github.com/prometheus/client_golang/prometheus" ) @@ -63,14 +67,182 @@ func Register() { } func Monitor(verb, resource *string, client string, httpCode *int, reqStart time.Time) { - requestCounter.WithLabelValues(*verb, *resource, client, strconv.Itoa(*httpCode)).Inc() + requestCounter.WithLabelValues(*verb, *resource, client, codeToString(*httpCode)).Inc() requestLatencies.WithLabelValues(*verb, *resource).Observe(float64((time.Since(reqStart)) / time.Microsecond)) requestLatenciesSummary.WithLabelValues(*verb, *resource).Observe(float64((time.Since(reqStart)) / time.Microsecond)) } -func Reset(w http.ResponseWriter, req *http.Request) { +func Reset() { requestCounter.Reset() requestLatencies.Reset() requestLatenciesSummary.Reset() - io.WriteString(w, "metrics reset\n") +} + +// InstrumentRouteFunc works like Prometheus' InstrumentHandlerFunc but wraps +// the go-restful RouteFunction instead of a HandlerFunc +func InstrumentRouteFunc(verb, resource string, routeFunc restful.RouteFunction) restful.RouteFunction { + return restful.RouteFunction(func(request *restful.Request, response *restful.Response) { + now := time.Now() + + delegate := &responseWriterDelegator{ResponseWriter: response.ResponseWriter} + + _, cn := response.ResponseWriter.(http.CloseNotifier) + _, fl := response.ResponseWriter.(http.Flusher) + _, hj := response.ResponseWriter.(http.Hijacker) + var rw http.ResponseWriter + if cn && fl && hj { + rw = &fancyResponseWriterDelegator{delegate} + } else { + rw = delegate + } + response.ResponseWriter = rw + + routeFunc(request, response) + + elapsed := float64(time.Since(now)) / float64(time.Microsecond) + requestCounter.WithLabelValues(verb, resource, utilnet.GetHTTPClient(request.Request), codeToString(delegate.status)).Inc() + requestLatencies.WithLabelValues(verb, resource).Observe(elapsed) + requestLatenciesSummary.WithLabelValues(verb, resource).Observe(elapsed) + }) +} + +type responseWriterDelegator struct { + http.ResponseWriter + + status int + written int64 + wroteHeader bool +} + +func (r *responseWriterDelegator) WriteHeader(code int) { + r.status = code + r.wroteHeader = true + r.ResponseWriter.WriteHeader(code) +} + +func (r *responseWriterDelegator) Write(b []byte) (int, error) { + if !r.wroteHeader { + r.WriteHeader(http.StatusOK) + } + n, err := r.ResponseWriter.Write(b) + r.written += int64(n) + return n, err +} + +type fancyResponseWriterDelegator struct { + *responseWriterDelegator +} + +func (f *fancyResponseWriterDelegator) CloseNotify() <-chan bool { + return f.ResponseWriter.(http.CloseNotifier).CloseNotify() +} + +func (f *fancyResponseWriterDelegator) Flush() { + f.ResponseWriter.(http.Flusher).Flush() +} + +func (f *fancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return f.ResponseWriter.(http.Hijacker).Hijack() +} + +// Small optimization over Itoa +func codeToString(s int) string { + switch s { + case 100: + return "100" + case 101: + return "101" + + case 200: + return "200" + case 201: + return "201" + case 202: + return "202" + case 203: + return "203" + case 204: + return "204" + case 205: + return "205" + case 206: + return "206" + + case 300: + return "300" + case 301: + return "301" + case 302: + return "302" + case 304: + return "304" + case 305: + return "305" + case 307: + return "307" + + case 400: + return "400" + case 401: + return "401" + case 402: + return "402" + case 403: + return "403" + case 404: + return "404" + case 405: + return "405" + case 406: + return "406" + case 407: + return "407" + case 408: + return "408" + case 409: + return "409" + case 410: + return "410" + case 411: + return "411" + case 412: + return "412" + case 413: + return "413" + case 414: + return "414" + case 415: + return "415" + case 416: + return "416" + case 417: + return "417" + case 418: + return "418" + + case 500: + return "500" + case 501: + return "501" + case 502: + return "502" + case 503: + return "503" + case 504: + return "504" + case 505: + return "505" + + case 428: + return "428" + case 429: + return "429" + case 431: + return "431" + case 511: + return "511" + + default: + return strconv.Itoa(s) + } } diff --git a/pkg/apiserver/resthandler.go b/pkg/apiserver/resthandler.go index 33a936ad575..046d955de12 100644 --- a/pkg/apiserver/resthandler.go +++ b/pkg/apiserver/resthandler.go @@ -80,8 +80,8 @@ type RequestScope struct { Subresource string } -func (scope *RequestScope) err(err error, req *restful.Request, res *restful.Response) { - errorNegotiated(err, scope.Serializer, scope.Kind.GroupVersion(), res.ResponseWriter, req.Request) +func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Request) { + errorNegotiated(err, scope.Serializer, scope.Kind.GroupVersion(), w, req) } // getterFunc performs a get request with the given context and object name. The request @@ -98,7 +98,7 @@ func getResourceHandler(scope RequestScope, getter getterFunc) restful.RouteFunc w := res.ResponseWriter namespace, name, err := scope.Namer.Name(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } ctx := scope.ContextFunc(req) @@ -106,11 +106,11 @@ func getResourceHandler(scope RequestScope, getter getterFunc) restful.RouteFunc result, err := getter(ctx, name, req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if err := setSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } write(http.StatusOK, scope.Kind.GroupVersion(), scope.Serializer, result, w, req.Request) @@ -179,14 +179,14 @@ func ConnectResource(connecter rest.Connecter, scope RequestScope, admit admissi w := res.ResponseWriter namespace, name, err := scope.Namer.Name(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } ctx := scope.ContextFunc(req) ctx = api.WithNamespace(ctx, namespace) opts, subpath, subpathKey := connecter.NewConnectOptions() if err := getRequestOptions(req, scope, opts, subpath, subpathKey); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if admit.Handles(admission.Connect) { @@ -199,13 +199,13 @@ func ConnectResource(connecter rest.Connecter, scope RequestScope, admit admissi err = admit.Admit(admission.NewAttributesRecord(connectRequest, scope.Kind.GroupKind(), namespace, name, scope.Resource.GroupResource(), scope.Subresource, admission.Connect, userInfo)) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } handler, err := connecter.Connect(ctx, name, opts, &responder{scope: scope, req: req, res: res}) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } handler.ServeHTTP(w, req.Request) @@ -224,7 +224,7 @@ func (r *responder) Object(statusCode int, obj runtime.Object) { } func (r *responder) Error(err error) { - r.scope.err(err, r.req, r.res) + r.scope.err(err, r.res.ResponseWriter, r.req.Request) } // ListResource returns a function that handles retrieving a list of resources from a rest.Storage object. @@ -237,7 +237,7 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch namespace, err := scope.Namer.Namespace(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -254,7 +254,7 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch opts := api.ListOptions{} if err := scope.ParameterCodec.DecodeParameters(req.Request.URL.Query(), scope.Kind.GroupVersion(), &opts); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -267,7 +267,7 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch if opts.FieldSelector, err = opts.FieldSelector.Transform(fn); err != nil { // TODO: allow bad request to set field causes based on query parameters err = errors.NewBadRequest(err.Error()) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -283,7 +283,7 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch // and a field selector, since just the name is // sufficient to narrow down the request to a // single object. - scope.err(errors.NewBadRequest("both a name and a field selector provided; please provide one or the other."), req, res) + scope.err(errors.NewBadRequest("both a name and a field selector provided; please provide one or the other."), res.ResponseWriter, req.Request) return } opts.FieldSelector = nameSelector @@ -292,7 +292,7 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch if (opts.Watch || forceWatch) && rw != nil { watcher, err := rw.Watch(ctx, &opts) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } // TODO: Currently we explicitly ignore ?timeout= and use only ?timeoutSeconds=. @@ -312,13 +312,13 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch trace.Step("About to List from storage") result, err := r.List(ctx, &opts) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Listing from storage done") numberOfItems, err := setListSelfLink(result, req, scope.Namer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Self-linking done") @@ -348,7 +348,7 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object namespace, err = scope.Namer.Namespace(req) } if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -358,14 +358,14 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object gv := scope.Kind.GroupVersion() s, err := negotiateInputSerializer(req.Request, scope.Serializer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } decoder := scope.Serializer.DecoderToVersion(s, unversioned.GroupVersion{Group: gv.Group, Version: runtime.APIVersionInternal}) body, err := readBody(req.Request) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -375,12 +375,12 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object obj, gvk, err := decoder.Decode(body, &defaultGVK, original) if err != nil { err = transformDecodeError(typer, err, original, gvk) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if gvk.GroupVersion() != gv { err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%v)", gvk.GroupVersion().String(), gv.String())) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Conversion done") @@ -390,7 +390,7 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object err = admit.Admit(admission.NewAttributesRecord(obj, scope.Kind.GroupKind(), namespace, name, scope.Resource.GroupResource(), scope.Subresource, admission.Create, userInfo)) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -404,13 +404,13 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object return out, err }) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Object stored in database") if err := setSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Self-link added") @@ -450,7 +450,7 @@ func PatchResource(r rest.Patcher, scope RequestScope, typer runtime.ObjectTyper namespace, name, err := scope.Namer.Name(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -459,7 +459,7 @@ func PatchResource(r rest.Patcher, scope RequestScope, typer runtime.ObjectTyper versionedObj, err := converter.ConvertToVersion(r.New(), scope.Kind.GroupVersion().String()) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -473,13 +473,13 @@ func PatchResource(r rest.Patcher, scope RequestScope, typer runtime.ObjectTyper patchJS, err := readBody(req.Request) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } s, ok := scope.Serializer.SerializerForMediaType("application/json", nil) if !ok { - scope.err(fmt.Errorf("no serializer defined for JSON"), req, res) + scope.err(fmt.Errorf("no serializer defined for JSON"), res.ResponseWriter, req.Request) return } gv := scope.Kind.GroupVersion() @@ -499,12 +499,12 @@ func PatchResource(r rest.Patcher, scope RequestScope, typer runtime.ObjectTyper result, err := patchResource(ctx, updateAdmit, timeout, versionedObj, r, name, patchType, patchJS, scope.Namer, codec) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if err := setSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -625,7 +625,7 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType namespace, name, err := scope.Namer.Name(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } ctx := scope.ContextFunc(req) @@ -633,13 +633,13 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType body, err := readBody(req.Request) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } s, err := negotiateInputSerializer(req.Request, scope.Serializer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } defaultGVK := scope.Kind @@ -648,18 +648,18 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType obj, gvk, err := scope.Serializer.DecoderToVersion(s, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, original) if err != nil { err = transformDecodeError(typer, err, original, gvk) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if gvk.GroupVersion() != defaultGVK.GroupVersion() { err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%s)", gvk.GroupVersion(), defaultGVK.GroupVersion())) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Conversion done") if err := checkName(obj, name, namespace, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -668,7 +668,7 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType err = admit.Admit(admission.NewAttributesRecord(obj, scope.Kind.GroupKind(), namespace, name, scope.Resource.GroupResource(), scope.Subresource, admission.Update, userInfo)) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -681,13 +681,13 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType return obj, err }) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Object stored in database") if err := setSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Self-link added") @@ -714,7 +714,7 @@ func DeleteResource(r rest.GracefulDeleter, checkBody bool, scope RequestScope, namespace, name, err := scope.Namer.Name(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } ctx := scope.ContextFunc(req) @@ -724,23 +724,23 @@ func DeleteResource(r rest.GracefulDeleter, checkBody bool, scope RequestScope, if checkBody { body, err := readBody(req.Request) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if len(body) > 0 { s, err := negotiateInputSerializer(req.Request, scope.Serializer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } defaultGVK := scope.Kind.GroupVersion().WithKind("DeleteOptions") obj, _, err := scope.Serializer.DecoderToVersion(s, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if obj != options { - scope.err(fmt.Errorf("decoded object cannot be converted to DeleteOptions"), req, res) + scope.err(fmt.Errorf("decoded object cannot be converted to DeleteOptions"), res.ResponseWriter, req.Request) return } } @@ -751,7 +751,7 @@ func DeleteResource(r rest.GracefulDeleter, checkBody bool, scope RequestScope, err = admit.Admit(admission.NewAttributesRecord(nil, scope.Kind.GroupKind(), namespace, name, scope.Resource.GroupResource(), scope.Subresource, admission.Delete, userInfo)) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -761,7 +761,7 @@ func DeleteResource(r rest.GracefulDeleter, checkBody bool, scope RequestScope, return r.Delete(ctx, name, options) }) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } trace.Step("Object deleted from database") @@ -781,7 +781,7 @@ func DeleteResource(r rest.GracefulDeleter, checkBody bool, scope RequestScope, // when a non-status response is returned, set the self link if _, ok := result.(*unversioned.Status); !ok { if err := setSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -800,7 +800,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco namespace, err := scope.Namer.Namespace(req) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -812,14 +812,14 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco err = admit.Admit(admission.NewAttributesRecord(nil, scope.Kind.GroupKind(), namespace, "", scope.Resource.GroupResource(), scope.Subresource, admission.Delete, userInfo)) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } listOptions := api.ListOptions{} if err := scope.ParameterCodec.DecodeParameters(req.Request.URL.Query(), scope.Kind.GroupVersion(), &listOptions); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -832,7 +832,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco if listOptions.FieldSelector, err = listOptions.FieldSelector.Transform(fn); err != nil { // TODO: allow bad request to set field causes based on query parameters err = errors.NewBadRequest(err.Error()) - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } @@ -841,23 +841,23 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco if checkBody { body, err := readBody(req.Request) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if len(body) > 0 { s, err := negotiateInputSerializer(req.Request, scope.Serializer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } defaultGVK := scope.Kind.GroupVersion().WithKind("DeleteOptions") obj, _, err := scope.Serializer.DecoderToVersion(s, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } if obj != options { - scope.err(fmt.Errorf("decoded object cannot be converted to DeleteOptions"), req, res) + scope.err(fmt.Errorf("decoded object cannot be converted to DeleteOptions"), res.ResponseWriter, req.Request) return } } @@ -867,7 +867,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco return r.DeleteCollection(ctx, options, &listOptions) }) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } @@ -885,7 +885,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco // when a non-status response is returned, set the self link if _, ok := result.(*unversioned.Status); !ok { if _, err := setListSelfLink(result, req, scope.Namer); err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } } diff --git a/pkg/apiserver/testing/types.generated.go b/pkg/apiserver/testing/types.generated.go index 63d1f35a63e..31c69608189 100644 --- a/pkg/apiserver/testing/types.generated.go +++ b/pkg/apiserver/testing/types.generated.go @@ -88,10 +88,10 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [5]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" - yyq2[3] = x.Other != "" - yyq2[4] = len(x.Labels) != 0 + yyq2[1] = x.Other != "" + yyq2[2] = len(x.Labels) != 0 + yyq2[3] = x.Kind != "" + yyq2[4] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { r.EncodeArrayStart(5) @@ -107,28 +107,14 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } + yy4 := &x.ObjectMeta + yy4.CodecEncodeSelf(e) } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy5 := &x.ObjectMeta + yy5.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) @@ -137,7 +123,7 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym7 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Other)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -145,47 +131,11 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq2[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("other")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym8 := z.EncBinary() _ = yym8 if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy10 := &x.ObjectMeta - yy10.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.ObjectMeta - yy11.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[3] { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Other)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("other")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 - if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Other)) } @@ -193,12 +143,12 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[4] { + if yyq2[2] { if x.Labels == nil { r.EncodeNil() } else { - yym16 := z.EncBinary() - _ = yym16 + yym10 := z.EncBinary() + _ = yym10 if false { } else { z.F.EncMapStringStringV(x.Labels, false, e) @@ -208,15 +158,15 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq2[4] { + if yyq2[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("labels")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Labels == nil { r.EncodeNil() } else { - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { z.F.EncMapStringStringV(x.Labels, false, e) @@ -224,6 +174,56 @@ func (x *Simple) CodecEncodeSelf(e *codec1978.Encoder) { } } } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym13 := z.EncBinary() + _ = yym13 + 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) + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[4] { + yym16 := z.EncBinary() + _ = yym16 + 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) + yym17 := z.EncBinary() + _ = yym17 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -285,24 +285,12 @@ func (x *Simple) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys20 := string(yys20Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys20 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv23 := &x.ObjectMeta - yyv23.CodecDecodeSelf(d) + yyv21 := &x.ObjectMeta + yyv21.CodecDecodeSelf(d) } case "other": if r.TryDecodeAsNil() { @@ -314,14 +302,26 @@ func (x *Simple) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Labels = nil } else { - yyv25 := &x.Labels - yym26 := z.DecBinary() - _ = yym26 + yyv23 := &x.Labels + yym24 := z.DecBinary() + _ = yym24 if false { } else { - z.F.DecMapStringStringX(yyv25, false, d) + z.F.DecMapStringStringX(yyv23, false, 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, yys20) } // end switch yys20 @@ -347,43 +347,11 @@ func (x *Simple) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj27++ - if yyhl27 { - yyb27 = yyj27 > l - } else { - yyb27 = r.CheckBreak() - } - if yyb27 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj27++ - if yyhl27 { - yyb27 = yyj27 > l - } else { - yyb27 = r.CheckBreak() - } - if yyb27 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv30 := &x.ObjectMeta - yyv30.CodecDecodeSelf(d) + yyv28 := &x.ObjectMeta + yyv28.CodecDecodeSelf(d) } yyj27++ if yyhl27 { @@ -415,14 +383,46 @@ func (x *Simple) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Labels = nil } else { - yyv32 := &x.Labels - yym33 := z.DecBinary() - _ = yym33 + yyv30 := &x.Labels + yym31 := z.DecBinary() + _ = yym31 if false { } else { - z.F.DecMapStringStringX(yyv32, false, d) + z.F.DecMapStringStringX(yyv30, false, d) } } + yyj27++ + if yyhl27 { + yyb27 = yyj27 > l + } else { + yyb27 = r.CheckBreak() + } + if yyb27 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj27++ + if yyhl27 { + yyb27 = yyj27 > l + } else { + yyb27 = r.CheckBreak() + } + if yyb27 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { yyj27++ if yyhl27 { @@ -456,10 +456,10 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { var yyq35 [5]bool _, _, _ = yysep35, yyq35, yy2arr35 const yyr35 bool = false - yyq35[0] = x.Kind != "" - yyq35[1] = x.APIVersion != "" - yyq35[3] = x.Other != "" - yyq35[4] = len(x.Labels) != 0 + yyq35[1] = x.Other != "" + yyq35[2] = len(x.Labels) != 0 + yyq35[3] = x.Kind != "" + yyq35[4] = x.APIVersion != "" var yynn35 int if yyr35 || yy2arr35 { r.EncodeArrayStart(5) @@ -475,28 +475,14 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr35 || yy2arr35 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq35[0] { - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } + yy37 := &x.ObjectMeta + yy37.CodecEncodeSelf(e) } else { - if yyq35[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("metadata")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy38 := &x.ObjectMeta + yy38.CodecEncodeSelf(e) } if yyr35 || yy2arr35 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) @@ -505,7 +491,7 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym40 if false { } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + r.EncodeString(codecSelferC_UTF81234, string(x.Other)) } } else { r.EncodeString(codecSelferC_UTF81234, "") @@ -513,47 +499,11 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { } else { if yyq35[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + r.EncodeString(codecSelferC_UTF81234, string("other")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym41 := z.EncBinary() _ = yym41 if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr35 || yy2arr35 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy43 := &x.ObjectMeta - yy43.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy44 := &x.ObjectMeta - yy44.CodecEncodeSelf(e) - } - if yyr35 || yy2arr35 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq35[3] { - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Other)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq35[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("other")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym47 := z.EncBinary() - _ = yym47 - if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Other)) } @@ -561,12 +511,12 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr35 || yy2arr35 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq35[4] { + if yyq35[2] { if x.Labels == nil { r.EncodeNil() } else { - yym49 := z.EncBinary() - _ = yym49 + yym43 := z.EncBinary() + _ = yym43 if false { } else { z.F.EncMapStringStringV(x.Labels, false, e) @@ -576,15 +526,15 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq35[4] { + if yyq35[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("labels")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Labels == nil { r.EncodeNil() } else { - yym50 := z.EncBinary() - _ = yym50 + yym44 := z.EncBinary() + _ = yym44 if false { } else { z.F.EncMapStringStringV(x.Labels, false, e) @@ -592,6 +542,56 @@ func (x *SimpleRoot) CodecEncodeSelf(e *codec1978.Encoder) { } } } + if yyr35 || yy2arr35 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq35[3] { + yym46 := z.EncBinary() + _ = yym46 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq35[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym47 := z.EncBinary() + _ = yym47 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr35 || yy2arr35 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq35[4] { + yym49 := z.EncBinary() + _ = yym49 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq35[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym50 := z.EncBinary() + _ = yym50 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr35 || yy2arr35 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -653,24 +653,12 @@ func (x *SimpleRoot) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys53 := string(yys53Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys53 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv56 := &x.ObjectMeta - yyv56.CodecDecodeSelf(d) + yyv54 := &x.ObjectMeta + yyv54.CodecDecodeSelf(d) } case "other": if r.TryDecodeAsNil() { @@ -682,14 +670,26 @@ func (x *SimpleRoot) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Labels = nil } else { - yyv58 := &x.Labels - yym59 := z.DecBinary() - _ = yym59 + yyv56 := &x.Labels + yym57 := z.DecBinary() + _ = yym57 if false { } else { - z.F.DecMapStringStringX(yyv58, false, d) + z.F.DecMapStringStringX(yyv56, false, 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, yys53) } // end switch yys53 @@ -715,43 +715,11 @@ func (x *SimpleRoot) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj60++ - if yyhl60 { - yyb60 = yyj60 > l - } else { - yyb60 = r.CheckBreak() - } - if yyb60 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj60++ - if yyhl60 { - yyb60 = yyj60 > l - } else { - yyb60 = r.CheckBreak() - } - if yyb60 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv63 := &x.ObjectMeta - yyv63.CodecDecodeSelf(d) + yyv61 := &x.ObjectMeta + yyv61.CodecDecodeSelf(d) } yyj60++ if yyhl60 { @@ -783,14 +751,46 @@ func (x *SimpleRoot) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Labels = nil } else { - yyv65 := &x.Labels - yym66 := z.DecBinary() - _ = yym66 + yyv63 := &x.Labels + yym64 := z.DecBinary() + _ = yym64 if false { } else { - z.F.DecMapStringStringX(yyv65, false, d) + z.F.DecMapStringStringX(yyv63, false, d) } } + yyj60++ + if yyhl60 { + yyb60 = yyj60 > l + } else { + yyb60 = r.CheckBreak() + } + if yyb60 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj60++ + if yyhl60 { + yyb60 = yyj60 > l + } else { + yyb60 = r.CheckBreak() + } + if yyb60 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { yyj60++ if yyhl60 { @@ -824,8 +824,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { var yyq68 [5]bool _, _, _ = yysep68, yyq68, yy2arr68 const yyr68 bool = false - yyq68[0] = x.Kind != "" - yyq68[1] = x.APIVersion != "" + yyq68[3] = x.Kind != "" + yyq68[4] = x.APIVersion != "" var yynn68 int if yyr68 || yy2arr68 { r.EncodeArrayStart(5) @@ -841,58 +841,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr68 || yy2arr68 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq68[0] { - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq68[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr68 || yy2arr68 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq68[1] { - yym73 := z.EncBinary() - _ = yym73 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq68[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym74 := z.EncBinary() - _ = yym74 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr68 || yy2arr68 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym76 := z.EncBinary() - _ = yym76 + yym70 := z.EncBinary() + _ = yym70 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Param1)) @@ -901,8 +851,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("param1")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym77 := z.EncBinary() - _ = yym77 + yym71 := z.EncBinary() + _ = yym71 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Param1)) @@ -910,8 +860,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr68 || yy2arr68 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym79 := z.EncBinary() - _ = yym79 + yym73 := z.EncBinary() + _ = yym73 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Param2)) @@ -920,8 +870,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("param2")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym80 := z.EncBinary() - _ = yym80 + yym74 := z.EncBinary() + _ = yym74 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Param2)) @@ -929,8 +879,8 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr68 || yy2arr68 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym82 := z.EncBinary() - _ = yym82 + yym76 := z.EncBinary() + _ = yym76 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) @@ -939,13 +889,63 @@ func (x *SimpleGetOptions) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("atAPath")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym83 := z.EncBinary() - _ = yym83 + yym77 := z.EncBinary() + _ = yym77 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Path)) } } + if yyr68 || yy2arr68 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq68[3] { + yym79 := z.EncBinary() + _ = yym79 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq68[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym80 := z.EncBinary() + _ = yym80 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr68 || yy2arr68 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq68[4] { + yym82 := z.EncBinary() + _ = yym82 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq68[4] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym83 := z.EncBinary() + _ = yym83 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr68 || yy2arr68 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1007,18 +1007,6 @@ func (x *SimpleGetOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys86 := string(yys86Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys86 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "param1": if r.TryDecodeAsNil() { x.Param1 = "" @@ -1037,6 +1025,18 @@ func (x *SimpleGetOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.Path = string(r.DecodeString()) } + 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, yys86) } // end switch yys86 @@ -1062,38 +1062,6 @@ func (x *SimpleGetOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj92++ - if yyhl92 { - yyb92 = yyj92 > l - } else { - yyb92 = r.CheckBreak() - } - if yyb92 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj92++ - if yyhl92 { - yyb92 = yyj92 > l - } else { - yyb92 = r.CheckBreak() - } - if yyb92 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Param1 = "" } else { @@ -1131,6 +1099,38 @@ func (x *SimpleGetOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) } else { x.Path = string(r.DecodeString()) } + yyj92++ + if yyhl92 { + yyb92 = yyj92 > l + } else { + yyb92 = r.CheckBreak() + } + if yyb92 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Kind = "" + } else { + x.Kind = string(r.DecodeString()) + } + yyj92++ + if yyhl92 { + yyb92 = yyj92 > l + } else { + yyb92 = r.CheckBreak() + } + if yyb92 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.APIVersion = "" + } else { + x.APIVersion = string(r.DecodeString()) + } for { yyj92++ if yyhl92 { @@ -1164,9 +1164,9 @@ func (x *SimpleList) CodecEncodeSelf(e *codec1978.Encoder) { var yyq99 [4]bool _, _, _ = yysep99, yyq99, yy2arr99 const yyr99 bool = false - yyq99[0] = x.Kind != "" - yyq99[1] = x.APIVersion != "" - yyq99[3] = len(x.Items) != 0 + yyq99[1] = len(x.Items) != 0 + yyq99[2] = x.Kind != "" + yyq99[3] = x.APIVersion != "" var yynn99 int if yyr99 || yy2arr99 { r.EncodeArrayStart(4) @@ -1182,85 +1182,35 @@ func (x *SimpleList) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr99 || yy2arr99 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq99[0] { - yym101 := z.EncBinary() - _ = yym101 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq99[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym102 := z.EncBinary() - _ = yym102 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr99 || yy2arr99 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq99[1] { - yym104 := z.EncBinary() - _ = yym104 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq99[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym105 := z.EncBinary() - _ = yym105 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr99 || yy2arr99 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy107 := &x.ListMeta - yym108 := z.EncBinary() - _ = yym108 + yy101 := &x.ListMeta + yym102 := z.EncBinary() + _ = yym102 if false { - } else if z.HasExtensions() && z.EncExt(yy107) { + } else if z.HasExtensions() && z.EncExt(yy101) { } else { - z.EncFallback(yy107) + z.EncFallback(yy101) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy109 := &x.ListMeta - yym110 := z.EncBinary() - _ = yym110 + yy103 := &x.ListMeta + yym104 := z.EncBinary() + _ = yym104 if false { - } else if z.HasExtensions() && z.EncExt(yy109) { + } else if z.HasExtensions() && z.EncExt(yy103) { } else { - z.EncFallback(yy109) + z.EncFallback(yy103) } } if yyr99 || yy2arr99 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq99[3] { + if yyq99[1] { if x.Items == nil { r.EncodeNil() } else { - yym112 := z.EncBinary() - _ = yym112 + yym106 := z.EncBinary() + _ = yym106 if false { } else { h.encSliceSimple(([]Simple)(x.Items), e) @@ -1270,15 +1220,15 @@ func (x *SimpleList) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq99[3] { + if yyq99[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("items")) z.EncSendContainerState(codecSelfer_containerMapValue1234) if x.Items == nil { r.EncodeNil() } else { - yym113 := z.EncBinary() - _ = yym113 + yym107 := z.EncBinary() + _ = yym107 if false { } else { h.encSliceSimple(([]Simple)(x.Items), e) @@ -1286,6 +1236,56 @@ func (x *SimpleList) CodecEncodeSelf(e *codec1978.Encoder) { } } } + if yyr99 || yy2arr99 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq99[2] { + yym109 := z.EncBinary() + _ = yym109 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq99[2] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym110 := z.EncBinary() + _ = yym110 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr99 || yy2arr99 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq99[3] { + yym112 := z.EncBinary() + _ = yym112 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq99[3] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym113 := z.EncBinary() + _ = yym113 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr99 || yy2arr99 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -1347,6 +1347,31 @@ func (x *SimpleList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys116 := string(yys116Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys116 { + case "metadata": + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv117 := &x.ListMeta + yym118 := z.DecBinary() + _ = yym118 + if false { + } else if z.HasExtensions() && z.DecExt(yyv117) { + } else { + z.DecFallback(yyv117, false) + } + } + case "items": + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv119 := &x.Items + yym120 := z.DecBinary() + _ = yym120 + if false { + } else { + h.decSliceSimple((*[]Simple)(yyv119), d) + } + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -1359,31 +1384,6 @@ func (x *SimpleList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv119 := &x.ListMeta - yym120 := z.DecBinary() - _ = yym120 - if false { - } else if z.HasExtensions() && z.DecExt(yyv119) { - } else { - z.DecFallback(yyv119, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv121 := &x.Items - yym122 := z.DecBinary() - _ = yym122 - if false { - } else { - h.decSliceSimple((*[]Simple)(yyv121), d) - } - } default: z.DecStructFieldNotFound(-1, yys116) } // end switch yys116 @@ -1409,6 +1409,51 @@ func (x *SimpleList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ListMeta = pkg1_unversioned.ListMeta{} + } else { + yyv124 := &x.ListMeta + yym125 := z.DecBinary() + _ = yym125 + if false { + } else if z.HasExtensions() && z.DecExt(yyv124) { + } else { + z.DecFallback(yyv124, false) + } + } + yyj123++ + if yyhl123 { + yyb123 = yyj123 > l + } else { + yyb123 = r.CheckBreak() + } + if yyb123 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Items = nil + } else { + yyv126 := &x.Items + yym127 := z.DecBinary() + _ = yym127 + if false { + } else { + h.decSliceSimple((*[]Simple)(yyv126), d) + } + } + yyj123++ + if yyhl123 { + yyb123 = yyj123 > l + } else { + yyb123 = r.CheckBreak() + } + if yyb123 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -1430,51 +1475,6 @@ func (x *SimpleList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj123++ - if yyhl123 { - yyb123 = yyj123 > l - } else { - yyb123 = r.CheckBreak() - } - if yyb123 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg1_unversioned.ListMeta{} - } else { - yyv126 := &x.ListMeta - yym127 := z.DecBinary() - _ = yym127 - if false { - } else if z.HasExtensions() && z.DecExt(yyv126) { - } else { - z.DecFallback(yyv126, false) - } - } - yyj123++ - if yyhl123 { - yyb123 = yyj123 > l - } else { - yyb123 = r.CheckBreak() - } - if yyb123 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv128 := &x.Items - yym129 := z.DecBinary() - _ = yym129 - if false { - } else { - h.decSliceSimple((*[]Simple)(yyv128), d) - } - } for { yyj123++ if yyhl123 { diff --git a/pkg/apiserver/validator.go b/pkg/apiserver/validator.go index 6474d37a0d0..5e1870ac87d 100644 --- a/pkg/apiserver/validator.go +++ b/pkg/apiserver/validator.go @@ -59,7 +59,7 @@ func (server *Server) DoServerCheck(prober httpprober.HTTPProber) (probe.Result, } url := utilnet.FormatURL(scheme, server.Addr, server.Port, server.Path) - result, data, err := prober.Probe(url, probeTimeOut) + result, data, err := prober.Probe(url, nil, probeTimeOut) if err != nil { return probe.Unknown, "", err diff --git a/pkg/apiserver/validator_test.go b/pkg/apiserver/validator_test.go index f6cca87bfe2..f02c16300cb 100644 --- a/pkg/apiserver/validator_test.go +++ b/pkg/apiserver/validator_test.go @@ -22,6 +22,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/probe" + "net/http" "net/url" "time" ) @@ -32,7 +33,7 @@ type fakeHttpProber struct { err error } -func (f *fakeHttpProber) Probe(*url.URL, time.Duration) (probe.Result, string, error) { +func (f *fakeHttpProber) Probe(*url.URL, http.Header, time.Duration) (probe.Result, string, error) { return f.result, f.body, f.err } diff --git a/pkg/apiserver/watch.go b/pkg/apiserver/watch.go index 8b951d9e539..086ebfe3d83 100644 --- a/pkg/apiserver/watch.go +++ b/pkg/apiserver/watch.go @@ -68,7 +68,7 @@ func (w *realTimeoutFactory) TimeoutCh() (<-chan time.Time, func() bool) { func serveWatch(watcher watch.Interface, scope RequestScope, req *restful.Request, res *restful.Response, timeout time.Duration) { s, mediaType, err := negotiateOutputSerializer(req.Request, scope.Serializer) if err != nil { - scope.err(err, req, res) + scope.err(err, res.ResponseWriter, req.Request) return } // TODO: replace with typed serialization diff --git a/pkg/apiserver/watch_test.go b/pkg/apiserver/watch_test.go index 7f5165afe88..ab4854b5f5c 100644 --- a/pkg/apiserver/watch_test.go +++ b/pkg/apiserver/watch_test.go @@ -38,7 +38,7 @@ import ( "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -418,8 +418,8 @@ func TestWatchHTTPTimeout(t *testing.T) { if !watcher.Stopped { t.Errorf("Leaked watch on timeout") } - case <-time.After(util.ForeverTestTimeout): - t.Errorf("Failed to stop watcher after %s of timeout signal", util.ForeverTestTimeout.String()) + case <-time.After(wait.ForeverTestTimeout): + t.Errorf("Failed to stop watcher after %s of timeout signal", wait.ForeverTestTimeout.String()) } // Make sure we can't receive any more events through the timeout watch diff --git a/pkg/client/cache/delta_fifo.go b/pkg/client/cache/delta_fifo.go index fcf2c313717..e7cc1aad19e 100644 --- a/pkg/client/cache/delta_fifo.go +++ b/pkg/client/cache/delta_fifo.go @@ -100,6 +100,12 @@ type DeltaFIFO struct { items map[string]Deltas queue []string + // populated is true if the first batch of items inserted by Replace() has been populated + // or Delete/Add/Update was called first. + populated bool + // initialPopulationCount is the number of items inserted by the first call of Replace() + initialPopulationCount int + // keyFunc is used to make the key used for queued item // insertion and retrieval, and should be deterministic. keyFunc KeyFunc @@ -141,11 +147,20 @@ func (f *DeltaFIFO) KeyOf(obj interface{}) (string, error) { return f.keyFunc(obj) } +// Return true if an Add/Update/Delete/AddIfNotPresent are called first, +// or an Update called first but the first batch of items inserted by Replace() has been popped +func (f *DeltaFIFO) HasSynced() bool { + f.lock.Lock() + defer f.lock.Unlock() + return f.populated && f.initialPopulationCount == 0 +} + // Add inserts an item, and puts it in the queue. The item is only enqueued // if it doesn't already exist in the set. func (f *DeltaFIFO) Add(obj interface{}) error { f.lock.Lock() defer f.lock.Unlock() + f.populated = true return f.queueActionLocked(Added, obj) } @@ -153,6 +168,7 @@ func (f *DeltaFIFO) Add(obj interface{}) error { func (f *DeltaFIFO) Update(obj interface{}) error { f.lock.Lock() defer f.lock.Unlock() + f.populated = true return f.queueActionLocked(Updated, obj) } @@ -166,6 +182,7 @@ func (f *DeltaFIFO) Delete(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.populated = true if f.knownObjects == nil { if _, exists := f.items[id]; !exists { // Presumably, this was deleted when a relist happened. @@ -203,6 +220,7 @@ func (f *DeltaFIFO) AddIfNotPresent(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.populated = true if _, exists := f.items[id]; exists { return nil } @@ -354,6 +372,9 @@ func (f *DeltaFIFO) Pop() interface{} { id := f.queue[0] f.queue = f.queue[1:] item, ok := f.items[id] + if f.initialPopulationCount > 0 { + f.initialPopulationCount-- + } if !ok { // Item may have been deleted subsequently. continue @@ -373,6 +394,12 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { f.lock.Lock() defer f.lock.Unlock() keys := make(sets.String, len(list)) + + if !f.populated { + f.populated = true + f.initialPopulationCount = len(list) + } + for _, item := range list { key, err := f.KeyOf(item) if err != nil { diff --git a/pkg/client/cache/delta_fifo_test.go b/pkg/client/cache/delta_fifo_test.go index 6adec860571..8efd982b5a4 100644 --- a/pkg/client/cache/delta_fifo_test.go +++ b/pkg/client/cache/delta_fifo_test.go @@ -327,3 +327,59 @@ func TestDeltaFIFO_KeyOf(t *testing.T) { } } } + +func TestDeltaFIFO_HasSynced(t *testing.T) { + tests := []struct { + actions []func(f *DeltaFIFO) + expectedSynced bool + }{ + { + actions: []func(f *DeltaFIFO){}, + expectedSynced: false, + }, + { + actions: []func(f *DeltaFIFO){ + func(f *DeltaFIFO) { f.Add(mkFifoObj("a", 1)) }, + }, + expectedSynced: true, + }, + { + actions: []func(f *DeltaFIFO){ + func(f *DeltaFIFO) { f.Replace([]interface{}{}, "0") }, + }, + expectedSynced: true, + }, + { + actions: []func(f *DeltaFIFO){ + func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + }, + expectedSynced: false, + }, + { + actions: []func(f *DeltaFIFO){ + func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + func(f *DeltaFIFO) { f.Pop() }, + }, + expectedSynced: false, + }, + { + actions: []func(f *DeltaFIFO){ + func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + func(f *DeltaFIFO) { f.Pop() }, + func(f *DeltaFIFO) { f.Pop() }, + }, + expectedSynced: true, + }, + } + + for i, test := range tests { + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + + for _, action := range test.actions { + action(f) + } + if e, a := test.expectedSynced, f.HasSynced(); a != e { + t.Errorf("test case %v failed, expected: %v , got %v", i, e, a) + } + } +} diff --git a/pkg/client/cache/expiration_cache_test.go b/pkg/client/cache/expiration_cache_test.go index 546b98d919f..2e8cc5b572f 100644 --- a/pkg/client/cache/expiration_cache_test.go +++ b/pkg/client/cache/expiration_cache_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" ) func TestTTLExpirationBasic(t *testing.T) { @@ -55,7 +56,7 @@ func TestTTLExpirationBasic(t *testing.T) { if delKey != key { t.Errorf("Unexpected delete for key %s", key) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Unexpected timeout waiting on delete") } close(deleteChan) @@ -100,7 +101,7 @@ func TestTTLList(t *testing.T) { t.Errorf("Unexpected delete for key %s", delKey) } expireKeys.Delete(delKey) - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Unexpected timeout waiting on delete") return } @@ -113,7 +114,7 @@ func TestTTLPolicy(t *testing.T) { exactlyOnTTL := fakeTime.Add(-ttl) expiredTime := fakeTime.Add(-(ttl + 1)) - policy := TTLPolicy{ttl, &util.FakeClock{Time: fakeTime}} + policy := TTLPolicy{ttl, util.NewFakeClock(fakeTime)} fakeTimestampedEntry := ×tampedEntry{obj: struct{}{}, timestamp: exactlyOnTTL} if policy.IsExpired(fakeTimestampedEntry) { t.Errorf("TTL cache should not expire entries exactly on ttl") diff --git a/pkg/client/cache/fifo.go b/pkg/client/cache/fifo.go index b56687ee0fd..d4076a326d8 100644 --- a/pkg/client/cache/fifo.go +++ b/pkg/client/cache/fifo.go @@ -32,6 +32,9 @@ type Queue interface { // as nothing else (presumably more recent) // has since been added. AddIfNotPresent(interface{}) error + + // Return true if the first batch of items has been popped + HasSynced() bool } // FIFO receives adds and updates from a Reflector, and puts them in a queue for @@ -52,6 +55,13 @@ type FIFO struct { // We depend on the property that items in the set are in the queue and vice versa. items map[string]interface{} queue []string + + // populated is true if the first batch of items inserted by Replace() has been populated + // or Delete/Add/Update was called first. + populated bool + // initialPopulationCount is the number of items inserted by the first call of Replace() + initialPopulationCount int + // keyFunc is used to make the key used for queued item insertion and retrieval, and // should be deterministic. keyFunc KeyFunc @@ -61,6 +71,14 @@ var ( _ = Queue(&FIFO{}) // FIFO is a Queue ) +// Return true if an Add/Update/Delete/AddIfNotPresent are called first, +// or an Update called first but the first batch of items inserted by Replace() has been popped +func (f *FIFO) HasSynced() bool { + f.lock.Lock() + defer f.lock.Unlock() + return f.populated && f.initialPopulationCount == 0 +} + // Add inserts an item, and puts it in the queue. The item is only enqueued // if it doesn't already exist in the set. func (f *FIFO) Add(obj interface{}) error { @@ -70,6 +88,7 @@ func (f *FIFO) Add(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.populated = true if _, exists := f.items[id]; !exists { f.queue = append(f.queue, id) } @@ -91,6 +110,7 @@ func (f *FIFO) AddIfNotPresent(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.populated = true if _, exists := f.items[id]; exists { return nil } @@ -116,6 +136,7 @@ func (f *FIFO) Delete(obj interface{}) error { } f.lock.Lock() defer f.lock.Unlock() + f.populated = true delete(f.items, id) return err } @@ -174,6 +195,9 @@ func (f *FIFO) Pop() interface{} { } id := f.queue[0] f.queue = f.queue[1:] + if f.initialPopulationCount > 0 { + f.initialPopulationCount-- + } item, ok := f.items[id] if !ok { // Item may have been deleted subsequently. @@ -200,6 +224,12 @@ func (f *FIFO) Replace(list []interface{}, resourceVersion string) error { f.lock.Lock() defer f.lock.Unlock() + + if !f.populated { + f.populated = true + f.initialPopulationCount = len(items) + } + f.items = items f.queue = f.queue[:0] for id := range items { diff --git a/pkg/client/cache/fifo_test.go b/pkg/client/cache/fifo_test.go index bf99b5aa152..974fa6d3b73 100644 --- a/pkg/client/cache/fifo_test.go +++ b/pkg/client/cache/fifo_test.go @@ -177,3 +177,59 @@ func TestFIFO_addIfNotPresent(t *testing.T) { } } } + +func TestFIFO_HasSynced(t *testing.T) { + tests := []struct { + actions []func(f *FIFO) + expectedSynced bool + }{ + { + actions: []func(f *FIFO){}, + expectedSynced: false, + }, + { + actions: []func(f *FIFO){ + func(f *FIFO) { f.Add(mkFifoObj("a", 1)) }, + }, + expectedSynced: true, + }, + { + actions: []func(f *FIFO){ + func(f *FIFO) { f.Replace([]interface{}{}, "0") }, + }, + expectedSynced: true, + }, + { + actions: []func(f *FIFO){ + func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + }, + expectedSynced: false, + }, + { + actions: []func(f *FIFO){ + func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + func(f *FIFO) { f.Pop() }, + }, + expectedSynced: false, + }, + { + actions: []func(f *FIFO){ + func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, + func(f *FIFO) { f.Pop() }, + func(f *FIFO) { f.Pop() }, + }, + expectedSynced: true, + }, + } + + for i, test := range tests { + f := NewFIFO(testFifoObjectKeyFunc) + + for _, action := range test.actions { + action(f) + } + if e, a := test.expectedSynced, f.HasSynced(); a != e { + t.Errorf("test case %v failed, expected: %v , got %v", i, e, a) + } + } +} diff --git a/pkg/client/cache/listers.go b/pkg/client/cache/listers.go index d974ad4e938..77982b318b6 100644 --- a/pkg/client/cache/listers.go +++ b/pkg/client/cache/listers.go @@ -21,6 +21,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" ) @@ -235,33 +236,34 @@ func (s *StoreToDeploymentLister) List() (deployments []extensions.Deployment, e return deployments, nil } -// GetDeploymentsForRC returns a list of deployments managing a replication controller. Returns an error only if no matching deployments are found. -func (s *StoreToDeploymentLister) GetDeploymentsForRC(rc *api.ReplicationController) (deployments []extensions.Deployment, err error) { - var selector labels.Selector +// GetDeploymentsForReplicaSet returns a list of deployments managing a replica set. Returns an error only if no matching deployments are found. +func (s *StoreToDeploymentLister) GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) (deployments []extensions.Deployment, err error) { var d extensions.Deployment - if len(rc.Labels) == 0 { - err = fmt.Errorf("no deployments found for replication controller %v because it has no labels", rc.Name) + if len(rs.Labels) == 0 { + err = fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name) return } // TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label for _, m := range s.Store.List() { d = *m.(*extensions.Deployment) - if d.Namespace != rc.Namespace { + if d.Namespace != rs.Namespace { continue } - labelSet := labels.Set(d.Spec.Selector) - selector = labels.Set(d.Spec.Selector).AsSelector() + selector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) + if err != nil { + return nil, fmt.Errorf("failed to convert LabelSelector to Selector: %v", err) + } // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if labelSet.AsSelector().Empty() || !selector.Matches(labels.Set(rc.Labels)) { + if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) { continue } deployments = append(deployments, d) } if len(deployments) == 0 { - err = fmt.Errorf("could not find deployments set for replication controller %s in namespace %s with labels: %v", rc.Name, rc.Namespace, rc.Labels) + err = fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels) } return } @@ -289,6 +291,27 @@ func (s *StoreToReplicaSetLister) List() (rss []extensions.ReplicaSet, err error return rss, nil } +type storeReplicaSetsNamespacer struct { + store Store + namespace string +} + +func (s storeReplicaSetsNamespacer) List(selector labels.Selector) (rss []extensions.ReplicaSet, err error) { + for _, c := range s.store.List() { + rs := *(c.(*extensions.ReplicaSet)) + if s.namespace == api.NamespaceAll || s.namespace == rs.Namespace { + if selector.Matches(labels.Set(rs.Labels)) { + rss = append(rss, rs) + } + } + } + return +} + +func (s *StoreToReplicaSetLister) ReplicaSets(namespace string) storeReplicaSetsNamespacer { + return storeReplicaSetsNamespacer{s.Store, namespace} +} + // GetPodReplicaSets returns a list of ReplicaSets managing a pod. Returns an error only if no matching ReplicaSets are found. func (s *StoreToReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error) { var selector labels.Selector @@ -304,7 +327,7 @@ func (s *StoreToReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensi if rs.Namespace != pod.Namespace { continue } - selector, err = extensions.LabelSelectorAsSelector(rs.Spec.Selector) + selector, err = unversioned.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { err = fmt.Errorf("failed to convert pod selector to selector: %v", err) return @@ -361,7 +384,7 @@ func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []ex if daemonSet.Namespace != pod.Namespace { continue } - selector, err = extensions.LabelSelectorAsSelector(daemonSet.Spec.Selector) + selector, err = unversioned.LabelSelectorAsSelector(daemonSet.Spec.Selector) if err != nil { // this should not happen if the DaemonSet passed validation return nil, err @@ -483,7 +506,7 @@ func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []extensions.Job, err continue } - selector, _ = extensions.LabelSelectorAsSelector(job.Spec.Selector) + selector, _ = unversioned.LabelSelectorAsSelector(job.Spec.Selector) if !selector.Matches(labels.Set(pod.Labels)) { continue } diff --git a/pkg/client/cache/listers_test.go b/pkg/client/cache/listers_test.go index 6322cc25b11..e95df1f21c5 100644 --- a/pkg/client/cache/listers_test.go +++ b/pkg/client/cache/listers_test.go @@ -20,6 +20,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util/sets" @@ -258,7 +259,7 @@ func TestStoreToReplicaSetLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, }, }, }, @@ -297,13 +298,13 @@ func TestStoreToReplicaSetLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "foo"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, { ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, @@ -384,7 +385,7 @@ func TestStoreToDaemonSetLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, }, }, }, @@ -423,13 +424,13 @@ func TestStoreToDaemonSetLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "foo"}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, { ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, @@ -513,7 +514,7 @@ func TestStoreToJobLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "baz"}, }, }, @@ -556,7 +557,7 @@ func TestStoreToJobLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "foo"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, }, @@ -564,7 +565,7 @@ func TestStoreToJobLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, }, @@ -589,7 +590,7 @@ func TestStoreToJobLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "foo"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, }, @@ -597,7 +598,7 @@ func TestStoreToJobLister(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "bar"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, }, diff --git a/pkg/client/cache/reflector.go b/pkg/client/cache/reflector.go index 59eaac779ad..fa761d5c593 100644 --- a/pkg/client/cache/reflector.go +++ b/pkg/client/cache/reflector.go @@ -35,8 +35,8 @@ import ( apierrs "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -157,13 +157,13 @@ outer: // Run starts a watch and handles watch events. Will restart the watch if it is closed. // Run starts a goroutine and returns immediately. func (r *Reflector) Run() { - go util.Until(func() { r.ListAndWatch(util.NeverStop) }, r.period, util.NeverStop) + go wait.Until(func() { r.ListAndWatch(wait.NeverStop) }, r.period, wait.NeverStop) } // RunUntil starts a watch and handles watch events. Will restart the watch if it is closed. // RunUntil starts a goroutine and returns immediately. It will exit when stopCh is closed. func (r *Reflector) RunUntil(stopCh <-chan struct{}) { - go util.Until(func() { r.ListAndWatch(stopCh) }, r.period, stopCh) + go wait.Until(func() { r.ListAndWatch(stopCh) }, r.period, stopCh) } var ( diff --git a/pkg/client/cache/reflector_test.go b/pkg/client/cache/reflector_test.go index b4c0da0b243..223769adea0 100644 --- a/pkg/client/cache/reflector_test.go +++ b/pkg/client/cache/reflector_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -54,15 +54,15 @@ func TestCloseWatchChannelOnError(t *testing.T) { return &api.PodList{ListMeta: unversioned.ListMeta{ResourceVersion: "1"}}, nil }, } - go r.ListAndWatch(util.NeverStop) + go r.ListAndWatch(wait.NeverStop) fw.Error(pod) select { case _, ok := <-fw.ResultChan(): if ok { t.Errorf("Watch channel left open after cancellation") } - case <-time.After(util.ForeverTestTimeout): - t.Errorf("the cancellation is at least %s late", util.ForeverTestTimeout.String()) + case <-time.After(wait.ForeverTestTimeout): + t.Errorf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) break } } @@ -90,8 +90,8 @@ func TestRunUntil(t *testing.T) { if ok { t.Errorf("Watch channel left open after stopping the watch") } - case <-time.After(util.ForeverTestTimeout): - t.Errorf("the cancellation is at least %s late", util.ForeverTestTimeout.String()) + case <-time.After(wait.ForeverTestTimeout): + t.Errorf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) break } } @@ -100,7 +100,7 @@ func TestReflectorResyncChan(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &api.Pod{}, s, time.Millisecond) a, _ := g.resyncChan() - b := time.After(util.ForeverTestTimeout) + b := time.After(wait.ForeverTestTimeout) select { case <-a: t.Logf("got timeout as expected") @@ -129,7 +129,7 @@ func TestReflectorWatchHandlerError(t *testing.T) { fw.Stop() }() var resumeRV string - err := g.watchHandler(fw, &resumeRV, neverExitWatch, util.NeverStop) + err := g.watchHandler(fw, &resumeRV, neverExitWatch, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } @@ -149,7 +149,7 @@ func TestReflectorWatchHandler(t *testing.T) { fw.Stop() }() var resumeRV string - err := g.watchHandler(fw, &resumeRV, neverExitWatch, util.NeverStop) + err := g.watchHandler(fw, &resumeRV, neverExitWatch, wait.NeverStop) if err != nil { t.Errorf("unexpected error %v", err) } @@ -198,7 +198,7 @@ func TestReflectorWatchHandlerTimeout(t *testing.T) { var resumeRV string exit := make(chan time.Time, 1) exit <- time.Now() - err := g.watchHandler(fw, &resumeRV, exit, util.NeverStop) + err := g.watchHandler(fw, &resumeRV, exit, wait.NeverStop) if err != errorResyncRequested { t.Errorf("expected timeout error, but got %q", err) } @@ -242,7 +242,7 @@ func TestReflectorListAndWatch(t *testing.T) { } s := NewFIFO(MetaNamespaceKeyFunc) r := NewReflector(lw, &api.Pod{}, s, 0) - go r.ListAndWatch(util.NeverStop) + go r.ListAndWatch(wait.NeverStop) ids := []string{"foo", "bar", "baz", "qux", "zoo"} var fw *watch.FakeWatcher @@ -359,7 +359,7 @@ func TestReflectorListAndWatchWithErrors(t *testing.T) { }, } r := NewReflector(lw, &api.Pod{}, s, 0) - r.ListAndWatch(util.NeverStop) + r.ListAndWatch(wait.NeverStop) } } @@ -397,7 +397,7 @@ func TestReflectorResync(t *testing.T) { r := NewReflector(lw, &api.Pod{}, s, resyncPeriod) r.now = func() time.Time { return currentTime } - r.ListAndWatch(util.NeverStop) + r.ListAndWatch(wait.NeverStop) if iteration != 2 { t.Errorf("exactly 2 iterations were expected, got: %v", iteration) } diff --git a/pkg/client/clientset_generated/release_1_1/clientset.go b/pkg/client/clientset_generated/internalclientset/clientset.go similarity index 79% rename from pkg/client/clientset_generated/release_1_1/clientset.go rename to pkg/client/clientset_generated/internalclientset/clientset.go index 88a5cb632ad..3fe018b9c64 100644 --- a/pkg/client/clientset_generated/release_1_1/clientset.go +++ b/pkg/client/clientset_generated/internalclientset/clientset.go @@ -14,17 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -package release_1_1 +package internalclientset import ( + "github.com/golang/glog" + core_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" extensions_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" - legacy_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" unversioned "k8s.io/kubernetes/pkg/client/unversioned" ) type Interface interface { Discovery() unversioned.DiscoveryInterface - Legacy() legacy_unversioned.LegacyInterface + Core() core_unversioned.CoreInterface Extensions() extensions_unversioned.ExtensionsInterface } @@ -32,13 +33,13 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *unversioned.DiscoveryClient - *legacy_unversioned.LegacyClient + *core_unversioned.CoreClient *extensions_unversioned.ExtensionsClient } -// Legacy retrieves the LegacyClient -func (c *Clientset) Legacy() legacy_unversioned.LegacyInterface { - return c.LegacyClient +// Core retrieves the CoreClient +func (c *Clientset) Core() core_unversioned.CoreInterface { + return c.CoreClient } // Extensions retrieves the ExtensionsClient @@ -55,27 +56,27 @@ func (c *Clientset) Discovery() unversioned.DiscoveryInterface { func NewForConfig(c *unversioned.Config) (*Clientset, error) { var clientset Clientset var err error - clientset.LegacyClient, err = legacy_unversioned.NewForConfig(c) + clientset.CoreClient, err = core_unversioned.NewForConfig(c) if err != nil { - return nil, err + return &clientset, err } clientset.ExtensionsClient, err = extensions_unversioned.NewForConfig(c) if err != nil { - return nil, err + return &clientset, err } clientset.DiscoveryClient, err = unversioned.NewDiscoveryClientForConfig(c) if err != nil { - return nil, err + glog.Errorf("failed to create the DiscoveryClient: %v", err) } - return &clientset, nil + return &clientset, err } // NewForConfigOrDie creates a new Clientset for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *unversioned.Config) *Clientset { var clientset Clientset - clientset.LegacyClient = legacy_unversioned.NewForConfigOrDie(c) + clientset.CoreClient = core_unversioned.NewForConfigOrDie(c) clientset.ExtensionsClient = extensions_unversioned.NewForConfigOrDie(c) clientset.DiscoveryClient = unversioned.NewDiscoveryClientForConfigOrDie(c) @@ -85,7 +86,7 @@ func NewForConfigOrDie(c *unversioned.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c *unversioned.RESTClient) *Clientset { var clientset Clientset - clientset.LegacyClient = legacy_unversioned.New(c) + clientset.CoreClient = core_unversioned.New(c) clientset.ExtensionsClient = extensions_unversioned.New(c) clientset.DiscoveryClient = unversioned.NewDiscoveryClient(c) diff --git a/pkg/client/clientset_generated/release_1_1/clientset_adaption.go b/pkg/client/clientset_generated/internalclientset/clientset_adaption.go similarity index 85% rename from pkg/client/clientset_generated/release_1_1/clientset_adaption.go rename to pkg/client/clientset_generated/internalclientset/clientset_adaption.go index 118863c4219..f16573a934d 100644 --- a/pkg/client/clientset_generated/release_1_1/clientset_adaption.go +++ b/pkg/client/clientset_generated/internalclientset/clientset_adaption.go @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -package release_1_1 +package internalclientset import ( + core_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" extensions_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" - legacy_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" "k8s.io/kubernetes/pkg/client/unversioned" ) @@ -28,9 +28,9 @@ import ( func FromUnversionedClient(c *unversioned.Client) *Clientset { var clientset Clientset if c != nil { - clientset.LegacyClient = legacy_unversioned.New(c.RESTClient) + clientset.CoreClient = core_unversioned.New(c.RESTClient) } else { - clientset.LegacyClient = legacy_unversioned.New(nil) + clientset.CoreClient = core_unversioned.New(nil) } if c != nil && c.ExtensionsClient != nil { clientset.ExtensionsClient = extensions_unversioned.New(c.ExtensionsClient.RESTClient) diff --git a/pkg/client/leaderelection/leaderelection.go b/pkg/client/leaderelection/leaderelection.go index 6c2f52c6634..e7a3dac8df3 100644 --- a/pkg/client/leaderelection/leaderelection.go +++ b/pkg/client/leaderelection/leaderelection.go @@ -60,7 +60,6 @@ import ( "k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wait" @@ -204,7 +203,7 @@ func (le *LeaderElector) IsLeader() bool { // acquire loops calling tryAcquireOrRenew and returns immediately when tryAcquireOrRenew succeeds. func (le *LeaderElector) acquire() { stop := make(chan struct{}) - util.Until(func() { + wait.Until(func() { succeeded := le.tryAcquireOrRenew() le.maybeReportTransition() if !succeeded { @@ -221,7 +220,7 @@ func (le *LeaderElector) acquire() { // renew loops calling tryAcquireOrRenew and returns immediately when tryAcquireOrRenew fails. func (le *LeaderElector) renew() { stop := make(chan struct{}) - util.Until(func() { + wait.Until(func() { err := wait.Poll(le.config.RetryPeriod, le.config.RenewDeadline, func() (bool, error) { return le.tryAcquireOrRenew(), nil }) diff --git a/pkg/client/record/event_test.go b/pkg/client/record/event_test.go index 3c8983b5b02..61597e0d590 100644 --- a/pkg/client/record/event_test.go +++ b/pkg/client/record/event_test.go @@ -348,7 +348,7 @@ func TestEventf(t *testing.T) { eventBroadcaster := NewBroadcaster() sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) - clock := &util.FakeClock{time.Now()} + clock := util.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock) for index, item := range table { clock.Step(1 * time.Second) @@ -559,7 +559,7 @@ func TestEventfNoNamespace(t *testing.T) { eventBroadcaster := NewBroadcaster() sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) - clock := &util.FakeClock{time.Now()} + clock := util.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock) for index, item := range table { @@ -846,7 +846,7 @@ func TestMultiSinkCache(t *testing.T) { } eventBroadcaster := NewBroadcaster() - clock := &util.FakeClock{time.Now()} + clock := util.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) diff --git a/pkg/client/testing/fake/clientset.go b/pkg/client/testing/fake/clientset.go index b2b3a37b888..154a6d2844d 100644 --- a/pkg/client/testing/fake/clientset.go +++ b/pkg/client/testing/fake/clientset.go @@ -18,12 +18,8 @@ package fake import ( "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/core" - extensions_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" - extensions_unversioned_fake "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned/fake" - legacy_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" - legacy_unversioned_fake "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned/fake" "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" @@ -55,14 +51,6 @@ type Clientset struct { var _ clientset.Interface = &Clientset{} -func (c *Clientset) Legacy() legacy_unversioned.LegacyInterface { - return &legacy_unversioned_fake.FakeLegacy{&c.Fake} -} - -func (c *Clientset) Extensions() extensions_unversioned.ExtensionsInterface { - return &extensions_unversioned_fake.FakeExtensions{&c.Fake} -} - func (c *Clientset) Discovery() unversioned.DiscoveryInterface { return &FakeDiscovery{&c.Fake} } diff --git a/pkg/client/testing/fake/clientset_generated.go b/pkg/client/testing/fake/clientset_generated.go new file mode 100644 index 00000000000..f3a0e9d5ed6 --- /dev/null +++ b/pkg/client/testing/fake/clientset_generated.go @@ -0,0 +1,34 @@ +/* +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. +*/ + +package fake + +import ( + core_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" + core_unversioned_fake "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned/fake" + extensions_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" + extensions_unversioned_fake "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned/fake" +) + +// Core retrieves the CoreClient +func (c *Clientset) Core() core_unversioned.CoreInterface { + return &core_unversioned_fake.FakeCore{&c.Fake} +} + +// Extensions retrieves the ExtensionsClient +func (c *Clientset) Extensions() extensions_unversioned.ExtensionsInterface { + return &extensions_unversioned_fake.FakeExtensions{&c.Fake} +} diff --git a/pkg/client/typed/generated/legacy/unversioned/componentstatus.go b/pkg/client/typed/generated/core/unversioned/componentstatus.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/componentstatus.go rename to pkg/client/typed/generated/core/unversioned/componentstatus.go index 06484f7f4ae..0ef0667dad1 100644 --- a/pkg/client/typed/generated/legacy/unversioned/componentstatus.go +++ b/pkg/client/typed/generated/core/unversioned/componentstatus.go @@ -41,11 +41,11 @@ type ComponentStatusInterface interface { // componentStatuses implements ComponentStatusInterface type componentStatuses struct { - client *LegacyClient + client *CoreClient } // newComponentStatuses returns a ComponentStatuses -func newComponentStatuses(c *LegacyClient) *componentStatuses { +func newComponentStatuses(c *CoreClient) *componentStatuses { return &componentStatuses{ client: c, } diff --git a/pkg/client/typed/generated/core/unversioned/configmap.go b/pkg/client/typed/generated/core/unversioned/configmap.go new file mode 100644 index 00000000000..b43e53d6c44 --- /dev/null +++ b/pkg/client/typed/generated/core/unversioned/configmap.go @@ -0,0 +1,135 @@ +/* +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. +*/ + +package unversioned + +import ( + api "k8s.io/kubernetes/pkg/api" + watch "k8s.io/kubernetes/pkg/watch" +) + +// ConfigMapsGetter has a method to return a ConfigMapInterface. +// A group's client should implement this interface. +type ConfigMapsGetter interface { + ConfigMaps(namespace string) ConfigMapInterface +} + +// ConfigMapInterface has methods to work with ConfigMap resources. +type ConfigMapInterface interface { + Create(*api.ConfigMap) (*api.ConfigMap, error) + Update(*api.ConfigMap) (*api.ConfigMap, error) + Delete(name string, options *api.DeleteOptions) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error + Get(name string) (*api.ConfigMap, error) + List(opts api.ListOptions) (*api.ConfigMapList, error) + Watch(opts api.ListOptions) (watch.Interface, error) + ConfigMapExpansion +} + +// configMaps implements ConfigMapInterface +type configMaps struct { + client *CoreClient + ns string +} + +// newConfigMaps returns a ConfigMaps +func newConfigMaps(c *CoreClient, namespace string) *configMaps { + return &configMaps{ + client: c, + ns: namespace, + } +} + +// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *configMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) { + result = &api.ConfigMap{} + err = c.client.Post(). + Namespace(c.ns). + Resource("configmaps"). + Body(configMap). + Do(). + Into(result) + return +} + +// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *configMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) { + result = &api.ConfigMap{} + err = c.client.Put(). + Namespace(c.ns). + Resource("configmaps"). + Name(configMap.Name). + Body(configMap). + Do(). + Into(result) + return +} + +// Delete takes name of the configMap and deletes it. Returns an error if one occurs. +func (c *configMaps) Delete(name string, options *api.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("configmaps"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *configMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("configmaps"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. +func (c *configMaps) Get(name string) (result *api.ConfigMap, err error) { + result = &api.ConfigMap{} + err = c.client.Get(). + Namespace(c.ns). + Resource("configmaps"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. +func (c *configMaps) List(opts api.ListOptions) (result *api.ConfigMapList, err error) { + result = &api.ConfigMapList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("configmaps"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested configMaps. +func (c *configMaps) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("configmaps"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} diff --git a/pkg/client/typed/generated/legacy/unversioned/legacy_client.go b/pkg/client/typed/generated/core/unversioned/core_client.go similarity index 59% rename from pkg/client/typed/generated/legacy/unversioned/legacy_client.go rename to pkg/client/typed/generated/core/unversioned/core_client.go index 9dda0517ed4..c8119031eed 100644 --- a/pkg/client/typed/generated/legacy/unversioned/legacy_client.go +++ b/pkg/client/typed/generated/core/unversioned/core_client.go @@ -22,8 +22,9 @@ import ( unversioned "k8s.io/kubernetes/pkg/client/unversioned" ) -type LegacyInterface interface { +type CoreInterface interface { ComponentStatusesGetter + ConfigMapsGetter EndpointsGetter EventsGetter LimitRangesGetter @@ -40,73 +41,77 @@ type LegacyInterface interface { ServiceAccountsGetter } -// LegacyClient is used to interact with features provided by the Legacy group. -type LegacyClient struct { +// CoreClient is used to interact with features provided by the Core group. +type CoreClient struct { *unversioned.RESTClient } -func (c *LegacyClient) ComponentStatuses() ComponentStatusInterface { +func (c *CoreClient) ComponentStatuses() ComponentStatusInterface { return newComponentStatuses(c) } -func (c *LegacyClient) Endpoints(namespace string) EndpointsInterface { +func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface { + return newConfigMaps(c, namespace) +} + +func (c *CoreClient) Endpoints(namespace string) EndpointsInterface { return newEndpoints(c, namespace) } -func (c *LegacyClient) Events(namespace string) EventInterface { +func (c *CoreClient) Events(namespace string) EventInterface { return newEvents(c, namespace) } -func (c *LegacyClient) LimitRanges(namespace string) LimitRangeInterface { +func (c *CoreClient) LimitRanges(namespace string) LimitRangeInterface { return newLimitRanges(c, namespace) } -func (c *LegacyClient) Namespaces() NamespaceInterface { +func (c *CoreClient) Namespaces() NamespaceInterface { return newNamespaces(c) } -func (c *LegacyClient) Nodes() NodeInterface { +func (c *CoreClient) Nodes() NodeInterface { return newNodes(c) } -func (c *LegacyClient) PersistentVolumes() PersistentVolumeInterface { +func (c *CoreClient) PersistentVolumes() PersistentVolumeInterface { return newPersistentVolumes(c) } -func (c *LegacyClient) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { +func (c *CoreClient) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { return newPersistentVolumeClaims(c, namespace) } -func (c *LegacyClient) Pods(namespace string) PodInterface { +func (c *CoreClient) Pods(namespace string) PodInterface { return newPods(c, namespace) } -func (c *LegacyClient) PodTemplates(namespace string) PodTemplateInterface { +func (c *CoreClient) PodTemplates(namespace string) PodTemplateInterface { return newPodTemplates(c, namespace) } -func (c *LegacyClient) ReplicationControllers(namespace string) ReplicationControllerInterface { +func (c *CoreClient) ReplicationControllers(namespace string) ReplicationControllerInterface { return newReplicationControllers(c, namespace) } -func (c *LegacyClient) ResourceQuotas(namespace string) ResourceQuotaInterface { +func (c *CoreClient) ResourceQuotas(namespace string) ResourceQuotaInterface { return newResourceQuotas(c, namespace) } -func (c *LegacyClient) Secrets(namespace string) SecretInterface { +func (c *CoreClient) Secrets(namespace string) SecretInterface { return newSecrets(c, namespace) } -func (c *LegacyClient) Services(namespace string) ServiceInterface { +func (c *CoreClient) Services(namespace string) ServiceInterface { return newServices(c, namespace) } -func (c *LegacyClient) ServiceAccounts(namespace string) ServiceAccountInterface { +func (c *CoreClient) ServiceAccounts(namespace string) ServiceAccountInterface { return newServiceAccounts(c, namespace) } -// NewForConfig creates a new LegacyClient for the given config. -func NewForConfig(c *unversioned.Config) (*LegacyClient, error) { +// NewForConfig creates a new CoreClient for the given config. +func NewForConfig(c *unversioned.Config) (*CoreClient, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -115,12 +120,12 @@ func NewForConfig(c *unversioned.Config) (*LegacyClient, error) { if err != nil { return nil, err } - return &LegacyClient{client}, nil + return &CoreClient{client}, nil } -// NewForConfigOrDie creates a new LegacyClient for the given config and +// NewForConfigOrDie creates a new CoreClient for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *unversioned.Config) *LegacyClient { +func NewForConfigOrDie(c *unversioned.Config) *CoreClient { client, err := NewForConfig(c) if err != nil { panic(err) @@ -128,13 +133,13 @@ func NewForConfigOrDie(c *unversioned.Config) *LegacyClient { return client } -// New creates a new LegacyClient for the given RESTClient. -func New(c *unversioned.RESTClient) *LegacyClient { - return &LegacyClient{c} +// New creates a new CoreClient for the given RESTClient. +func New(c *unversioned.RESTClient) *CoreClient { + return &CoreClient{c} } func setConfigDefaults(config *unversioned.Config) error { - // if legacy group is not registered, return an error + // if core group is not registered, return an error g, err := registered.Group("") if err != nil { return err diff --git a/pkg/client/typed/generated/legacy/unversioned/doc.go b/pkg/client/typed/generated/core/unversioned/doc.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/doc.go rename to pkg/client/typed/generated/core/unversioned/doc.go diff --git a/pkg/client/typed/generated/legacy/unversioned/endpoints.go b/pkg/client/typed/generated/core/unversioned/endpoints.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/endpoints.go rename to pkg/client/typed/generated/core/unversioned/endpoints.go index 1c8c8619b7e..78e2a08783e 100644 --- a/pkg/client/typed/generated/legacy/unversioned/endpoints.go +++ b/pkg/client/typed/generated/core/unversioned/endpoints.go @@ -41,12 +41,12 @@ type EndpointsInterface interface { // endpoints implements EndpointsInterface type endpoints struct { - client *LegacyClient + client *CoreClient ns string } // newEndpoints returns a Endpoints -func newEndpoints(c *LegacyClient, namespace string) *endpoints { +func newEndpoints(c *CoreClient, namespace string) *endpoints { return &endpoints{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/event.go b/pkg/client/typed/generated/core/unversioned/event.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/event.go rename to pkg/client/typed/generated/core/unversioned/event.go index e411c24ce26..5627690a6a5 100644 --- a/pkg/client/typed/generated/legacy/unversioned/event.go +++ b/pkg/client/typed/generated/core/unversioned/event.go @@ -41,12 +41,12 @@ type EventInterface interface { // events implements EventInterface type events struct { - client *LegacyClient + client *CoreClient ns string } // newEvents returns a Events -func newEvents(c *LegacyClient, namespace string) *events { +func newEvents(c *CoreClient, namespace string) *events { return &events{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/event_expansion.go b/pkg/client/typed/generated/core/unversioned/event_expansion.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/event_expansion.go rename to pkg/client/typed/generated/core/unversioned/event_expansion.go index c4e6eb860d2..abdf89aa1c4 100644 --- a/pkg/client/typed/generated/legacy/unversioned/event_expansion.go +++ b/pkg/client/typed/generated/core/unversioned/event_expansion.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/runtime" ) +// The EventExpansion interface allows manually adding extra methods to the EventInterface. type EventExpansion interface { // CreateWithEventNamespace is the same as a Create, except that it sends the request to the event.Namespace. CreateWithEventNamespace(event *api.Event) (*api.Event, error) diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/doc.go b/pkg/client/typed/generated/core/unversioned/fake/doc.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/fake/doc.go rename to pkg/client/typed/generated/core/unversioned/fake/doc.go diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_componentstatus.go b/pkg/client/typed/generated/core/unversioned/fake/fake_componentstatus.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_componentstatus.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_componentstatus.go index 7dc9dc5a058..478dd9dbf37 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_componentstatus.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_componentstatus.go @@ -25,7 +25,7 @@ import ( // FakeComponentStatuses implements ComponentStatusInterface type FakeComponentStatuses struct { - Fake *FakeLegacy + Fake *FakeCore } func (c *FakeComponentStatuses) Create(componentStatus *api.ComponentStatus) (result *api.ComponentStatus, err error) { @@ -53,7 +53,7 @@ func (c *FakeComponentStatuses) Delete(name string, options *api.DeleteOptions) } func (c *FakeComponentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewRootDeleteCollectionAction("events", listOptions) + action := core.NewRootDeleteCollectionAction("componentstatuses", listOptions) _, err := c.Fake.Invokes(action, &api.ComponentStatusList{}) return err diff --git a/pkg/client/typed/generated/core/unversioned/fake/fake_configmap.go b/pkg/client/typed/generated/core/unversioned/fake/fake_configmap.go new file mode 100644 index 00000000000..34fa0b229bb --- /dev/null +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_configmap.go @@ -0,0 +1,102 @@ +/* +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. +*/ + +package fake + +import ( + api "k8s.io/kubernetes/pkg/api" + core "k8s.io/kubernetes/pkg/client/testing/core" + labels "k8s.io/kubernetes/pkg/labels" + watch "k8s.io/kubernetes/pkg/watch" +) + +// FakeConfigMaps implements ConfigMapInterface +type FakeConfigMaps struct { + Fake *FakeCore + ns string +} + +func (c *FakeConfigMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(core.NewCreateAction("configmaps", c.ns, configMap), &api.ConfigMap{}) + + if obj == nil { + return nil, err + } + return obj.(*api.ConfigMap), err +} + +func (c *FakeConfigMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(core.NewUpdateAction("configmaps", c.ns, configMap), &api.ConfigMap{}) + + if obj == nil { + return nil, err + } + return obj.(*api.ConfigMap), err +} + +func (c *FakeConfigMaps) Delete(name string, options *api.DeleteOptions) error { + _, err := c.Fake. + Invokes(core.NewDeleteAction("configmaps", c.ns, name), &api.ConfigMap{}) + + return err +} + +func (c *FakeConfigMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + action := core.NewDeleteCollectionAction("configmaps", c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &api.ConfigMapList{}) + return err +} + +func (c *FakeConfigMaps) Get(name string) (result *api.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(core.NewGetAction("configmaps", c.ns, name), &api.ConfigMap{}) + + if obj == nil { + return nil, err + } + return obj.(*api.ConfigMap), err +} + +func (c *FakeConfigMaps) List(opts api.ListOptions) (result *api.ConfigMapList, err error) { + obj, err := c.Fake. + Invokes(core.NewListAction("configmaps", c.ns, opts), &api.ConfigMapList{}) + + if obj == nil { + return nil, err + } + + label := opts.LabelSelector + if label == nil { + label = labels.Everything() + } + list := &api.ConfigMapList{} + for _, item := range obj.(*api.ConfigMapList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested configMaps. +func (c *FakeConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(core.NewWatchAction("configmaps", c.ns, opts)) + +} diff --git a/pkg/client/typed/generated/core/unversioned/fake/fake_core_client.go b/pkg/client/typed/generated/core/unversioned/fake/fake_core_client.go new file mode 100644 index 00000000000..afc6cf6f902 --- /dev/null +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_core_client.go @@ -0,0 +1,90 @@ +/* +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. +*/ + +package fake + +import ( + core "k8s.io/kubernetes/pkg/client/testing/core" + unversioned "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" +) + +type FakeCore struct { + *core.Fake +} + +func (c *FakeCore) ComponentStatuses() unversioned.ComponentStatusInterface { + return &FakeComponentStatuses{c} +} + +func (c *FakeCore) ConfigMaps(namespace string) unversioned.ConfigMapInterface { + return &FakeConfigMaps{c, namespace} +} + +func (c *FakeCore) Endpoints(namespace string) unversioned.EndpointsInterface { + return &FakeEndpoints{c, namespace} +} + +func (c *FakeCore) Events(namespace string) unversioned.EventInterface { + return &FakeEvents{c, namespace} +} + +func (c *FakeCore) LimitRanges(namespace string) unversioned.LimitRangeInterface { + return &FakeLimitRanges{c, namespace} +} + +func (c *FakeCore) Namespaces() unversioned.NamespaceInterface { + return &FakeNamespaces{c} +} + +func (c *FakeCore) Nodes() unversioned.NodeInterface { + return &FakeNodes{c} +} + +func (c *FakeCore) PersistentVolumes() unversioned.PersistentVolumeInterface { + return &FakePersistentVolumes{c} +} + +func (c *FakeCore) PersistentVolumeClaims(namespace string) unversioned.PersistentVolumeClaimInterface { + return &FakePersistentVolumeClaims{c, namespace} +} + +func (c *FakeCore) Pods(namespace string) unversioned.PodInterface { + return &FakePods{c, namespace} +} + +func (c *FakeCore) PodTemplates(namespace string) unversioned.PodTemplateInterface { + return &FakePodTemplates{c, namespace} +} + +func (c *FakeCore) ReplicationControllers(namespace string) unversioned.ReplicationControllerInterface { + return &FakeReplicationControllers{c, namespace} +} + +func (c *FakeCore) ResourceQuotas(namespace string) unversioned.ResourceQuotaInterface { + return &FakeResourceQuotas{c, namespace} +} + +func (c *FakeCore) Secrets(namespace string) unversioned.SecretInterface { + return &FakeSecrets{c, namespace} +} + +func (c *FakeCore) Services(namespace string) unversioned.ServiceInterface { + return &FakeServices{c, namespace} +} + +func (c *FakeCore) ServiceAccounts(namespace string) unversioned.ServiceAccountInterface { + return &FakeServiceAccounts{c, namespace} +} diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_endpoints.go b/pkg/client/typed/generated/core/unversioned/fake/fake_endpoints.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_endpoints.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_endpoints.go index 209c9221cfa..cc25b6e06cb 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_endpoints.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_endpoints.go @@ -25,7 +25,7 @@ import ( // FakeEndpoints implements EndpointsInterface type FakeEndpoints struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -57,7 +57,7 @@ func (c *FakeEndpoints) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeEndpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("endpoints", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.EndpointsList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_event.go b/pkg/client/typed/generated/core/unversioned/fake/fake_event.go similarity index 99% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_event.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_event.go index 166e920bf2d..a9f88153bc7 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_event.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_event.go @@ -25,7 +25,7 @@ import ( // FakeEvents implements EventInterface type FakeEvents struct { - Fake *FakeLegacy + Fake *FakeCore ns string } diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_event_expansion.go b/pkg/client/typed/generated/core/unversioned/fake/fake_event_expansion.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_event_expansion.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_event_expansion.go diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_limitrange.go b/pkg/client/typed/generated/core/unversioned/fake/fake_limitrange.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_limitrange.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_limitrange.go index 223bb720803..cab44ce4ee3 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_limitrange.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_limitrange.go @@ -25,7 +25,7 @@ import ( // FakeLimitRanges implements LimitRangeInterface type FakeLimitRanges struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -57,7 +57,7 @@ func (c *FakeLimitRanges) Delete(name string, options *api.DeleteOptions) error } func (c *FakeLimitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("limitranges", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.LimitRangeList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_namespace.go b/pkg/client/typed/generated/core/unversioned/fake/fake_namespace.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_namespace.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_namespace.go index 8a131c63349..78933814f7e 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_namespace.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_namespace.go @@ -25,7 +25,7 @@ import ( // FakeNamespaces implements NamespaceInterface type FakeNamespaces struct { - Fake *FakeLegacy + Fake *FakeCore } func (c *FakeNamespaces) Create(namespace *api.Namespace) (result *api.Namespace, err error) { @@ -62,7 +62,7 @@ func (c *FakeNamespaces) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeNamespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewRootDeleteCollectionAction("events", listOptions) + action := core.NewRootDeleteCollectionAction("namespaces", listOptions) _, err := c.Fake.Invokes(action, &api.NamespaceList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_namespace_expansion.go b/pkg/client/typed/generated/core/unversioned/fake/fake_namespace_expansion.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_namespace_expansion.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_namespace_expansion.go diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_node.go b/pkg/client/typed/generated/core/unversioned/fake/fake_node.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_node.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_node.go index eabdb7ef7fa..8761c8772cc 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_node.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_node.go @@ -25,7 +25,7 @@ import ( // FakeNodes implements NodeInterface type FakeNodes struct { - Fake *FakeLegacy + Fake *FakeCore } func (c *FakeNodes) Create(node *api.Node) (result *api.Node, err error) { @@ -62,7 +62,7 @@ func (c *FakeNodes) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeNodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewRootDeleteCollectionAction("events", listOptions) + action := core.NewRootDeleteCollectionAction("nodes", listOptions) _, err := c.Fake.Invokes(action, &api.NodeList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolume.go b/pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolume.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolume.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolume.go index 48c4d841f3c..d3d8c79f52d 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolume.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolume.go @@ -25,7 +25,7 @@ import ( // FakePersistentVolumes implements PersistentVolumeInterface type FakePersistentVolumes struct { - Fake *FakeLegacy + Fake *FakeCore } func (c *FakePersistentVolumes) Create(persistentVolume *api.PersistentVolume) (result *api.PersistentVolume, err error) { @@ -62,7 +62,7 @@ func (c *FakePersistentVolumes) Delete(name string, options *api.DeleteOptions) } func (c *FakePersistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewRootDeleteCollectionAction("events", listOptions) + action := core.NewRootDeleteCollectionAction("persistentvolumes", listOptions) _, err := c.Fake.Invokes(action, &api.PersistentVolumeList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolumeclaim.go b/pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolumeclaim.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolumeclaim.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolumeclaim.go index b4f7043a309..ba674f269af 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_persistentvolumeclaim.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_persistentvolumeclaim.go @@ -25,7 +25,7 @@ import ( // FakePersistentVolumeClaims implements PersistentVolumeClaimInterface type FakePersistentVolumeClaims struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -67,7 +67,7 @@ func (c *FakePersistentVolumeClaims) Delete(name string, options *api.DeleteOpti } func (c *FakePersistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("persistentvolumeclaims", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.PersistentVolumeClaimList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_pod.go b/pkg/client/typed/generated/core/unversioned/fake/fake_pod.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_pod.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_pod.go index a717c987b5e..6488c021d0a 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_pod.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_pod.go @@ -25,7 +25,7 @@ import ( // FakePods implements PodInterface type FakePods struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -67,7 +67,7 @@ func (c *FakePods) Delete(name string, options *api.DeleteOptions) error { } func (c *FakePods) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("pods", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.PodList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_pod_expansion.go b/pkg/client/typed/generated/core/unversioned/fake/fake_pod_expansion.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_pod_expansion.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_pod_expansion.go diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_podtemplate.go b/pkg/client/typed/generated/core/unversioned/fake/fake_podtemplate.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_podtemplate.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_podtemplate.go index 1da9b66482a..b900a113c60 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_podtemplate.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_podtemplate.go @@ -25,7 +25,7 @@ import ( // FakePodTemplates implements PodTemplateInterface type FakePodTemplates struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -57,7 +57,7 @@ func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error } func (c *FakePodTemplates) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("podtemplates", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.PodTemplateList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_replicationcontroller.go b/pkg/client/typed/generated/core/unversioned/fake/fake_replicationcontroller.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_replicationcontroller.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_replicationcontroller.go index 6f27c77278e..205f094565a 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_replicationcontroller.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_replicationcontroller.go @@ -25,7 +25,7 @@ import ( // FakeReplicationControllers implements ReplicationControllerInterface type FakeReplicationControllers struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -67,7 +67,7 @@ func (c *FakeReplicationControllers) Delete(name string, options *api.DeleteOpti } func (c *FakeReplicationControllers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("replicationcontrollers", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.ReplicationControllerList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_resourcequota.go b/pkg/client/typed/generated/core/unversioned/fake/fake_resourcequota.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_resourcequota.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_resourcequota.go index 25d6221e483..056e61ed55e 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_resourcequota.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_resourcequota.go @@ -25,7 +25,7 @@ import ( // FakeResourceQuotas implements ResourceQuotaInterface type FakeResourceQuotas struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -67,7 +67,7 @@ func (c *FakeResourceQuotas) Delete(name string, options *api.DeleteOptions) err } func (c *FakeResourceQuotas) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("resourcequotas", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.ResourceQuotaList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_secret.go b/pkg/client/typed/generated/core/unversioned/fake/fake_secret.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_secret.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_secret.go index 27701b811c5..2f09be6e5e8 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_secret.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_secret.go @@ -25,7 +25,7 @@ import ( // FakeSecrets implements SecretInterface type FakeSecrets struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -57,7 +57,7 @@ func (c *FakeSecrets) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeSecrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("secrets", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.SecretList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_service.go b/pkg/client/typed/generated/core/unversioned/fake/fake_service.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_service.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_service.go index aaf73a17f80..2cf38901c5c 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_service.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_service.go @@ -25,7 +25,7 @@ import ( // FakeServices implements ServiceInterface type FakeServices struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -67,7 +67,7 @@ func (c *FakeServices) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeServices) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("services", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.ServiceList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_service_expansion.go b/pkg/client/typed/generated/core/unversioned/fake/fake_service_expansion.go similarity index 100% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_service_expansion.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_service_expansion.go diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_serviceaccount.go b/pkg/client/typed/generated/core/unversioned/fake/fake_serviceaccount.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/fake/fake_serviceaccount.go rename to pkg/client/typed/generated/core/unversioned/fake/fake_serviceaccount.go index a34750494ae..61d7a04f5eb 100644 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_serviceaccount.go +++ b/pkg/client/typed/generated/core/unversioned/fake/fake_serviceaccount.go @@ -25,7 +25,7 @@ import ( // FakeServiceAccounts implements ServiceAccountInterface type FakeServiceAccounts struct { - Fake *FakeLegacy + Fake *FakeCore ns string } @@ -57,7 +57,7 @@ func (c *FakeServiceAccounts) Delete(name string, options *api.DeleteOptions) er } func (c *FakeServiceAccounts) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("serviceaccounts", c.ns, listOptions) _, err := c.Fake.Invokes(action, &api.ServiceAccountList{}) return err diff --git a/pkg/client/typed/generated/legacy/unversioned/generated_expansion.go b/pkg/client/typed/generated/core/unversioned/generated_expansion.go similarity index 96% rename from pkg/client/typed/generated/legacy/unversioned/generated_expansion.go rename to pkg/client/typed/generated/core/unversioned/generated_expansion.go index 16b0a571495..eeb51962e8b 100644 --- a/pkg/client/typed/generated/legacy/unversioned/generated_expansion.go +++ b/pkg/client/typed/generated/core/unversioned/generated_expansion.go @@ -37,3 +37,5 @@ type ResourceQuotaExpansion interface{} type SecretExpansion interface{} type ServiceAccountExpansion interface{} + +type ConfigMapExpansion interface{} diff --git a/pkg/client/typed/generated/legacy/unversioned/limitrange.go b/pkg/client/typed/generated/core/unversioned/limitrange.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/limitrange.go rename to pkg/client/typed/generated/core/unversioned/limitrange.go index d13c745189d..86cc9b07fa7 100644 --- a/pkg/client/typed/generated/legacy/unversioned/limitrange.go +++ b/pkg/client/typed/generated/core/unversioned/limitrange.go @@ -41,12 +41,12 @@ type LimitRangeInterface interface { // limitRanges implements LimitRangeInterface type limitRanges struct { - client *LegacyClient + client *CoreClient ns string } // newLimitRanges returns a LimitRanges -func newLimitRanges(c *LegacyClient, namespace string) *limitRanges { +func newLimitRanges(c *CoreClient, namespace string) *limitRanges { return &limitRanges{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/namespace.go b/pkg/client/typed/generated/core/unversioned/namespace.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/namespace.go rename to pkg/client/typed/generated/core/unversioned/namespace.go index b95f9638276..c1c8b450693 100644 --- a/pkg/client/typed/generated/legacy/unversioned/namespace.go +++ b/pkg/client/typed/generated/core/unversioned/namespace.go @@ -42,11 +42,11 @@ type NamespaceInterface interface { // namespaces implements NamespaceInterface type namespaces struct { - client *LegacyClient + client *CoreClient } // newNamespaces returns a Namespaces -func newNamespaces(c *LegacyClient) *namespaces { +func newNamespaces(c *CoreClient) *namespaces { return &namespaces{ client: c, } diff --git a/pkg/client/typed/generated/legacy/unversioned/namespace_expansion.go b/pkg/client/typed/generated/core/unversioned/namespace_expansion.go similarity index 91% rename from pkg/client/typed/generated/legacy/unversioned/namespace_expansion.go rename to pkg/client/typed/generated/core/unversioned/namespace_expansion.go index 75f3ccfca9e..8f47aec484f 100644 --- a/pkg/client/typed/generated/legacy/unversioned/namespace_expansion.go +++ b/pkg/client/typed/generated/core/unversioned/namespace_expansion.go @@ -18,6 +18,7 @@ package unversioned import "k8s.io/kubernetes/pkg/api" +// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. type NamespaceExpansion interface { Finalize(item *api.Namespace) (*api.Namespace, error) } diff --git a/pkg/client/typed/generated/legacy/unversioned/node.go b/pkg/client/typed/generated/core/unversioned/node.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/node.go rename to pkg/client/typed/generated/core/unversioned/node.go index e6b6537437c..b0c53ef1d4b 100644 --- a/pkg/client/typed/generated/legacy/unversioned/node.go +++ b/pkg/client/typed/generated/core/unversioned/node.go @@ -42,11 +42,11 @@ type NodeInterface interface { // nodes implements NodeInterface type nodes struct { - client *LegacyClient + client *CoreClient } // newNodes returns a Nodes -func newNodes(c *LegacyClient) *nodes { +func newNodes(c *CoreClient) *nodes { return &nodes{ client: c, } diff --git a/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go b/pkg/client/typed/generated/core/unversioned/persistentvolume.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/persistentvolume.go rename to pkg/client/typed/generated/core/unversioned/persistentvolume.go index 1cf23caceeb..6b4d0f017fb 100644 --- a/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go +++ b/pkg/client/typed/generated/core/unversioned/persistentvolume.go @@ -42,11 +42,11 @@ type PersistentVolumeInterface interface { // persistentVolumes implements PersistentVolumeInterface type persistentVolumes struct { - client *LegacyClient + client *CoreClient } // newPersistentVolumes returns a PersistentVolumes -func newPersistentVolumes(c *LegacyClient) *persistentVolumes { +func newPersistentVolumes(c *CoreClient) *persistentVolumes { return &persistentVolumes{ client: c, } diff --git a/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go b/pkg/client/typed/generated/core/unversioned/persistentvolumeclaim.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go rename to pkg/client/typed/generated/core/unversioned/persistentvolumeclaim.go index 8d807204395..2f5b1743736 100644 --- a/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go +++ b/pkg/client/typed/generated/core/unversioned/persistentvolumeclaim.go @@ -42,12 +42,12 @@ type PersistentVolumeClaimInterface interface { // persistentVolumeClaims implements PersistentVolumeClaimInterface type persistentVolumeClaims struct { - client *LegacyClient + client *CoreClient ns string } // newPersistentVolumeClaims returns a PersistentVolumeClaims -func newPersistentVolumeClaims(c *LegacyClient, namespace string) *persistentVolumeClaims { +func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims { return &persistentVolumeClaims{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/pod.go b/pkg/client/typed/generated/core/unversioned/pod.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/pod.go rename to pkg/client/typed/generated/core/unversioned/pod.go index 30e6f059d07..1cdfc8e714b 100644 --- a/pkg/client/typed/generated/legacy/unversioned/pod.go +++ b/pkg/client/typed/generated/core/unversioned/pod.go @@ -42,12 +42,12 @@ type PodInterface interface { // pods implements PodInterface type pods struct { - client *LegacyClient + client *CoreClient ns string } // newPods returns a Pods -func newPods(c *LegacyClient, namespace string) *pods { +func newPods(c *CoreClient, namespace string) *pods { return &pods{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go b/pkg/client/typed/generated/core/unversioned/pod_expansion.go similarity index 94% rename from pkg/client/typed/generated/legacy/unversioned/pod_expansion.go rename to pkg/client/typed/generated/core/unversioned/pod_expansion.go index e14b83882f8..0a46431d588 100644 --- a/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go +++ b/pkg/client/typed/generated/core/unversioned/pod_expansion.go @@ -21,6 +21,7 @@ import ( unversioned "k8s.io/kubernetes/pkg/client/unversioned" ) +// The PodExpansion interface allows manually adding extra methods to the PodInterface. type PodExpansion interface { Bind(binding *api.Binding) error GetLogs(name string, opts *api.PodLogOptions) *unversioned.Request diff --git a/pkg/client/typed/generated/legacy/unversioned/podtemplate.go b/pkg/client/typed/generated/core/unversioned/podtemplate.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/podtemplate.go rename to pkg/client/typed/generated/core/unversioned/podtemplate.go index eebfedbaaae..cccef29f718 100644 --- a/pkg/client/typed/generated/legacy/unversioned/podtemplate.go +++ b/pkg/client/typed/generated/core/unversioned/podtemplate.go @@ -41,12 +41,12 @@ type PodTemplateInterface interface { // podTemplates implements PodTemplateInterface type podTemplates struct { - client *LegacyClient + client *CoreClient ns string } // newPodTemplates returns a PodTemplates -func newPodTemplates(c *LegacyClient, namespace string) *podTemplates { +func newPodTemplates(c *CoreClient, namespace string) *podTemplates { return &podTemplates{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go b/pkg/client/typed/generated/core/unversioned/replicationcontroller.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go rename to pkg/client/typed/generated/core/unversioned/replicationcontroller.go index b5238749a05..6f9f06625ad 100644 --- a/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go +++ b/pkg/client/typed/generated/core/unversioned/replicationcontroller.go @@ -42,12 +42,12 @@ type ReplicationControllerInterface interface { // replicationControllers implements ReplicationControllerInterface type replicationControllers struct { - client *LegacyClient + client *CoreClient ns string } // newReplicationControllers returns a ReplicationControllers -func newReplicationControllers(c *LegacyClient, namespace string) *replicationControllers { +func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers { return &replicationControllers{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/resourcequota.go b/pkg/client/typed/generated/core/unversioned/resourcequota.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/resourcequota.go rename to pkg/client/typed/generated/core/unversioned/resourcequota.go index 750fa1325fc..2d0da73fb3a 100644 --- a/pkg/client/typed/generated/legacy/unversioned/resourcequota.go +++ b/pkg/client/typed/generated/core/unversioned/resourcequota.go @@ -42,12 +42,12 @@ type ResourceQuotaInterface interface { // resourceQuotas implements ResourceQuotaInterface type resourceQuotas struct { - client *LegacyClient + client *CoreClient ns string } // newResourceQuotas returns a ResourceQuotas -func newResourceQuotas(c *LegacyClient, namespace string) *resourceQuotas { +func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas { return &resourceQuotas{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/secret.go b/pkg/client/typed/generated/core/unversioned/secret.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/secret.go rename to pkg/client/typed/generated/core/unversioned/secret.go index 40096f13e27..101fbdb54e5 100644 --- a/pkg/client/typed/generated/legacy/unversioned/secret.go +++ b/pkg/client/typed/generated/core/unversioned/secret.go @@ -41,12 +41,12 @@ type SecretInterface interface { // secrets implements SecretInterface type secrets struct { - client *LegacyClient + client *CoreClient ns string } // newSecrets returns a Secrets -func newSecrets(c *LegacyClient, namespace string) *secrets { +func newSecrets(c *CoreClient, namespace string) *secrets { return &secrets{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/service.go b/pkg/client/typed/generated/core/unversioned/service.go similarity index 98% rename from pkg/client/typed/generated/legacy/unversioned/service.go rename to pkg/client/typed/generated/core/unversioned/service.go index 809f9e05c7f..006f601c271 100644 --- a/pkg/client/typed/generated/legacy/unversioned/service.go +++ b/pkg/client/typed/generated/core/unversioned/service.go @@ -42,12 +42,12 @@ type ServiceInterface interface { // services implements ServiceInterface type services struct { - client *LegacyClient + client *CoreClient ns string } // newServices returns a Services -func newServices(c *LegacyClient, namespace string) *services { +func newServices(c *CoreClient, namespace string) *services { return &services{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/legacy/unversioned/service_expansion.go b/pkg/client/typed/generated/core/unversioned/service_expansion.go similarity index 92% rename from pkg/client/typed/generated/legacy/unversioned/service_expansion.go rename to pkg/client/typed/generated/core/unversioned/service_expansion.go index bdf50da457b..b9fb6af8621 100644 --- a/pkg/client/typed/generated/legacy/unversioned/service_expansion.go +++ b/pkg/client/typed/generated/core/unversioned/service_expansion.go @@ -21,6 +21,7 @@ import ( "k8s.io/kubernetes/pkg/util/net" ) +// The ServiceExpansion interface allows manually adding extra methods to the ServiceInterface. type ServiceExpansion interface { ProxyGet(scheme, name, port, path string, params map[string]string) unversioned.ResponseWrapper } diff --git a/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go b/pkg/client/typed/generated/core/unversioned/serviceaccount.go similarity index 97% rename from pkg/client/typed/generated/legacy/unversioned/serviceaccount.go rename to pkg/client/typed/generated/core/unversioned/serviceaccount.go index 6e2d16727e3..65f7df2638e 100644 --- a/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go +++ b/pkg/client/typed/generated/core/unversioned/serviceaccount.go @@ -41,12 +41,12 @@ type ServiceAccountInterface interface { // serviceAccounts implements ServiceAccountInterface type serviceAccounts struct { - client *LegacyClient + client *CoreClient ns string } // newServiceAccounts returns a ServiceAccounts -func newServiceAccounts(c *LegacyClient, namespace string) *serviceAccounts { +func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts { return &serviceAccounts{ client: c, ns: namespace, diff --git a/pkg/client/typed/generated/extensions/unversioned/deployment_expansion.go b/pkg/client/typed/generated/extensions/unversioned/deployment_expansion.go index 70037bcf9b2..9969aecc93f 100644 --- a/pkg/client/typed/generated/extensions/unversioned/deployment_expansion.go +++ b/pkg/client/typed/generated/extensions/unversioned/deployment_expansion.go @@ -18,6 +18,7 @@ package unversioned import "k8s.io/kubernetes/pkg/apis/extensions" +// The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface. type DeploymentExpansion interface { Rollback(*extensions.DeploymentRollback) error } diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_daemonset.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_daemonset.go index 2bbfaa784af..7de9f927f77 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_daemonset.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_daemonset.go @@ -68,7 +68,7 @@ func (c *FakeDaemonSets) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeDaemonSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("daemonsets", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.DaemonSetList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_deployment.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_deployment.go index b6cc0713ff5..748968a9dbf 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_deployment.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_deployment.go @@ -68,7 +68,7 @@ func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error } func (c *FakeDeployments) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("deployments", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.DeploymentList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_horizontalpodautoscaler.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_horizontalpodautoscaler.go index 52083514f52..71b5cf322de 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_horizontalpodautoscaler.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_horizontalpodautoscaler.go @@ -68,7 +68,7 @@ func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOp } func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("horizontalpodautoscalers", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.HorizontalPodAutoscalerList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_ingress.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_ingress.go index 006271102ab..a331644e47c 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_ingress.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_ingress.go @@ -68,7 +68,7 @@ func (c *FakeIngresses) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeIngresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("ingresses", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.IngressList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_job.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_job.go index 99ac27ec4a4..c1875c006be 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_job.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_job.go @@ -68,7 +68,7 @@ func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error { } func (c *FakeJobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("jobs", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.JobList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_replicaset.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_replicaset.go index 0fc7ec2e756..d861326b7c9 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_replicaset.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_replicaset.go @@ -68,7 +68,7 @@ func (c *FakeReplicaSets) Delete(name string, options *api.DeleteOptions) error } func (c *FakeReplicaSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("replicasets", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.ReplicaSetList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/fake/fake_thirdpartyresource.go b/pkg/client/typed/generated/extensions/unversioned/fake/fake_thirdpartyresource.go index afb78f39985..9a005d57089 100644 --- a/pkg/client/typed/generated/extensions/unversioned/fake/fake_thirdpartyresource.go +++ b/pkg/client/typed/generated/extensions/unversioned/fake/fake_thirdpartyresource.go @@ -58,7 +58,7 @@ func (c *FakeThirdPartyResources) Delete(name string, options *api.DeleteOptions } func (c *FakeThirdPartyResources) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - action := core.NewDeleteCollectionAction("events", c.ns, listOptions) + action := core.NewDeleteCollectionAction("thirdpartyresources", c.ns, listOptions) _, err := c.Fake.Invokes(action, &extensions.ThirdPartyResourceList{}) return err diff --git a/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go b/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go index 3ddd7d80f1f..0690e0c8c33 100644 --- a/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go +++ b/pkg/client/typed/generated/extensions/unversioned/generated_expansion.go @@ -24,8 +24,6 @@ type IngressExpansion interface{} type JobExpansion interface{} -type ScaleExpansion interface{} - type ThirdPartyResourceExpansion interface{} type ReplicaSetExpansion interface{} diff --git a/pkg/client/typed/generated/extensions/unversioned/scale_expansion.go b/pkg/client/typed/generated/extensions/unversioned/scale_expansion.go new file mode 100644 index 00000000000..61a77f260d5 --- /dev/null +++ b/pkg/client/typed/generated/extensions/unversioned/scale_expansion.go @@ -0,0 +1,65 @@ +/* +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. +*/ + +package unversioned + +import ( + "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apis/extensions" +) + +// The ScaleExpansion interface allows manually adding extra methods to the ScaleInterface. +type ScaleExpansion interface { + Get(kind string, name string) (*extensions.Scale, error) + Update(kind string, scale *extensions.Scale) (*extensions.Scale, error) +} + +// Get takes the reference to scale subresource and returns the subresource or error, if one occurs. +func (c *scales) Get(kind string, name string) (result *extensions.Scale, err error) { + result = &extensions.Scale{} + + // TODO this method needs to take a proper unambiguous kind + fullyQualifiedKind := unversioned.GroupVersionKind{Kind: kind} + resource, _ := meta.KindToResource(fullyQualifiedKind) + + err = c.client.Get(). + Namespace(c.ns). + Resource(resource.Resource). + Name(name). + SubResource("scale"). + Do(). + Into(result) + return +} + +func (c *scales) Update(kind string, scale *extensions.Scale) (result *extensions.Scale, err error) { + result = &extensions.Scale{} + + // TODO this method needs to take a proper unambiguous kind + fullyQualifiedKind := unversioned.GroupVersionKind{Kind: kind} + resource, _ := meta.KindToResource(fullyQualifiedKind) + + err = c.client.Put(). + Namespace(scale.Namespace). + Resource(resource.Resource). + Name(scale.Name). + SubResource("scale"). + Body(scale). + Do(). + Into(result) + return +} diff --git a/pkg/client/typed/generated/legacy/unversioned/fake/fake_legacy_client.go b/pkg/client/typed/generated/legacy/unversioned/fake/fake_legacy_client.go deleted file mode 100644 index 8ce7699cfff..00000000000 --- a/pkg/client/typed/generated/legacy/unversioned/fake/fake_legacy_client.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -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. -*/ - -package fake - -import ( - core "k8s.io/kubernetes/pkg/client/testing/core" - unversioned "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" -) - -type FakeLegacy struct { - *core.Fake -} - -func (c *FakeLegacy) ComponentStatuses() unversioned.ComponentStatusInterface { - return &FakeComponentStatuses{c} -} - -func (c *FakeLegacy) Endpoints(namespace string) unversioned.EndpointsInterface { - return &FakeEndpoints{c, namespace} -} - -func (c *FakeLegacy) Events(namespace string) unversioned.EventInterface { - return &FakeEvents{c, namespace} -} - -func (c *FakeLegacy) LimitRanges(namespace string) unversioned.LimitRangeInterface { - return &FakeLimitRanges{c, namespace} -} - -func (c *FakeLegacy) Namespaces() unversioned.NamespaceInterface { - return &FakeNamespaces{c} -} - -func (c *FakeLegacy) Nodes() unversioned.NodeInterface { - return &FakeNodes{c} -} - -func (c *FakeLegacy) PersistentVolumes() unversioned.PersistentVolumeInterface { - return &FakePersistentVolumes{c} -} - -func (c *FakeLegacy) PersistentVolumeClaims(namespace string) unversioned.PersistentVolumeClaimInterface { - return &FakePersistentVolumeClaims{c, namespace} -} - -func (c *FakeLegacy) Pods(namespace string) unversioned.PodInterface { - return &FakePods{c, namespace} -} - -func (c *FakeLegacy) PodTemplates(namespace string) unversioned.PodTemplateInterface { - return &FakePodTemplates{c, namespace} -} - -func (c *FakeLegacy) ReplicationControllers(namespace string) unversioned.ReplicationControllerInterface { - return &FakeReplicationControllers{c, namespace} -} - -func (c *FakeLegacy) ResourceQuotas(namespace string) unversioned.ResourceQuotaInterface { - return &FakeResourceQuotas{c, namespace} -} - -func (c *FakeLegacy) Secrets(namespace string) unversioned.SecretInterface { - return &FakeSecrets{c, namespace} -} - -func (c *FakeLegacy) Services(namespace string) unversioned.ServiceInterface { - return &FakeServices{c, namespace} -} - -func (c *FakeLegacy) ServiceAccounts(namespace string) unversioned.ServiceAccountInterface { - return &FakeServiceAccounts{c, namespace} -} diff --git a/pkg/client/unversioned/client_test.go b/pkg/client/unversioned/client_test.go index 8fdfe4ecd24..487591c5da2 100644 --- a/pkg/client/unversioned/client_test.go +++ b/pkg/client/unversioned/client_test.go @@ -137,17 +137,17 @@ func TestGetServerResources(t *testing.T) { stable := unversioned.APIResourceList{ GroupVersion: "v1", APIResources: []unversioned.APIResource{ - {"pods", true}, - {"services", true}, - {"namespaces", false}, + {"pods", true, "Pod"}, + {"services", true, "Service"}, + {"namespaces", false, "Namespace"}, }, } beta := unversioned.APIResourceList{ GroupVersion: "extensions/v1", APIResources: []unversioned.APIResource{ - {"deployments", true}, - {"ingresses", true}, - {"jobs", true}, + {"deployments", true, "Deployment"}, + {"ingresses", true, "Ingress"}, + {"jobs", true, "Job"}, }, } tests := []struct { diff --git a/pkg/client/unversioned/clientcmd/loader.go b/pkg/client/unversioned/clientcmd/loader.go index 55b3dbcd2ce..215431583da 100644 --- a/pkg/client/unversioned/clientcmd/loader.go +++ b/pkg/client/unversioned/clientcmd/loader.go @@ -227,7 +227,7 @@ func LoadFromFile(filename string) (*clientcmdapi.Config, error) { if err != nil { return nil, err } - glog.V(3).Infoln("Config loaded from file", filename) + glog.V(6).Infoln("Config loaded from file", filename) // set LocationOfOrigin on every Cluster, User, and Context for key, obj := range config.AuthInfos { diff --git a/pkg/client/unversioned/extensions.go b/pkg/client/unversioned/extensions.go index 1044b876cdf..a95bd1b8921 100644 --- a/pkg/client/unversioned/extensions.go +++ b/pkg/client/unversioned/extensions.go @@ -35,6 +35,7 @@ type ExtensionsInterface interface { IngressNamespacer ThirdPartyResourceNamespacer ReplicaSetsNamespacer + PodSecurityPoliciesInterface } // ExtensionsClient is used to interact with experimental Kubernetes features. @@ -44,6 +45,10 @@ type ExtensionsClient struct { *RESTClient } +func (c *ExtensionsClient) PodSecurityPolicies() PodSecurityPolicyInterface { + return newPodSecurityPolicy(c) +} + func (c *ExtensionsClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } diff --git a/pkg/client/unversioned/podsecuritypolicy.go b/pkg/client/unversioned/podsecuritypolicy.go new file mode 100644 index 00000000000..64a34b4b23b --- /dev/null +++ b/pkg/client/unversioned/podsecuritypolicy.go @@ -0,0 +1,111 @@ +/* +Copyright 2014 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. +*/ + +package unversioned + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/watch" +) + +type PodSecurityPoliciesInterface interface { + PodSecurityPolicies() PodSecurityPolicyInterface +} + +type PodSecurityPolicyInterface interface { + Get(name string) (result *extensions.PodSecurityPolicy, err error) + Create(scc *extensions.PodSecurityPolicy) (*extensions.PodSecurityPolicy, error) + List(opts api.ListOptions) (*extensions.PodSecurityPolicyList, error) + Delete(name string) error + Update(*extensions.PodSecurityPolicy) (*extensions.PodSecurityPolicy, error) + Watch(opts api.ListOptions) (watch.Interface, error) +} + +// podSecurityPolicy implements PodSecurityPolicyInterface +type podSecurityPolicy struct { + client *ExtensionsClient +} + +// newPodSecurityPolicy returns a podSecurityPolicy object. +func newPodSecurityPolicy(c *ExtensionsClient) *podSecurityPolicy { + return &podSecurityPolicy{c} +} + +func (s *podSecurityPolicy) Create(scc *extensions.PodSecurityPolicy) (*extensions.PodSecurityPolicy, error) { + result := &extensions.PodSecurityPolicy{} + err := s.client.Post(). + Resource("podsecuritypolicies"). + Body(scc). + Do(). + Into(result) + + return result, err +} + +// List returns a list of PodSecurityPolicies matching the selectors. +func (s *podSecurityPolicy) List(opts api.ListOptions) (*extensions.PodSecurityPolicyList, error) { + result := &extensions.PodSecurityPolicyList{} + + err := s.client.Get(). + Resource("podsecuritypolicies"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + + return result, err +} + +// Get returns the given PodSecurityPolicy, or an error. +func (s *podSecurityPolicy) Get(name string) (*extensions.PodSecurityPolicy, error) { + result := &extensions.PodSecurityPolicy{} + err := s.client.Get(). + Resource("podsecuritypolicies"). + Name(name). + Do(). + Into(result) + + return result, err +} + +// Watch starts watching for PodSecurityPolicies matching the given selectors. +func (s *podSecurityPolicy) Watch(opts api.ListOptions) (watch.Interface, error) { + return s.client.Get(). + Prefix("watch"). + Resource("podsecuritypolicies"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +func (s *podSecurityPolicy) Delete(name string) error { + return s.client.Delete(). + Resource("podsecuritypolicies"). + Name(name). + Do(). + Error() +} + +func (s *podSecurityPolicy) Update(psp *extensions.PodSecurityPolicy) (result *extensions.PodSecurityPolicy, err error) { + result = &extensions.PodSecurityPolicy{} + err = s.client.Put(). + Resource("podsecuritypolicies"). + Name(psp.Name). + Body(psp). + Do(). + Into(result) + + return +} diff --git a/pkg/client/unversioned/podsecuritypolicy_test.go b/pkg/client/unversioned/podsecuritypolicy_test.go new file mode 100644 index 00000000000..dee0f59351f --- /dev/null +++ b/pkg/client/unversioned/podsecuritypolicy_test.go @@ -0,0 +1,138 @@ +/* +Copyright 2015 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. +*/ + +package unversioned_test + +import ( + "fmt" + "net/url" + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/testapi" + "k8s.io/kubernetes/pkg/apis/extensions" + . "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/client/unversioned/testclient/simple" +) + +func TestPodSecurityPolicyCreate(t *testing.T) { + ns := api.NamespaceNone + scc := &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{ + Name: "abc", + }, + } + + c := &simple.Client{ + Request: simple.Request{ + Method: "POST", + Path: testapi.Extensions.ResourcePath(getPSPResourcename(), ns, ""), + Query: simple.BuildQueryValues(nil), + Body: scc, + }, + Response: simple.Response{StatusCode: 200, Body: scc}, + } + + response, err := c.Setup(t).PodSecurityPolicies().Create(scc) + c.Validate(t, response, err) +} + +func TestPodSecurityPolicyGet(t *testing.T) { + ns := api.NamespaceNone + scc := &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{ + Name: "abc", + }, + } + c := &simple.Client{ + Request: simple.Request{ + Method: "GET", + Path: testapi.Extensions.ResourcePath(getPSPResourcename(), ns, "abc"), + Query: simple.BuildQueryValues(nil), + Body: nil, + }, + Response: simple.Response{StatusCode: 200, Body: scc}, + } + + response, err := c.Setup(t).PodSecurityPolicies().Get("abc") + c.Validate(t, response, err) +} + +func TestPodSecurityPolicyList(t *testing.T) { + ns := api.NamespaceNone + sccList := &extensions.PodSecurityPolicyList{ + Items: []extensions.PodSecurityPolicy{ + { + ObjectMeta: api.ObjectMeta{ + Name: "abc", + }, + }, + }, + } + c := &simple.Client{ + Request: simple.Request{ + Method: "GET", + Path: testapi.Extensions.ResourcePath(getPSPResourcename(), ns, ""), + Query: simple.BuildQueryValues(nil), + Body: nil, + }, + Response: simple.Response{StatusCode: 200, Body: sccList}, + } + response, err := c.Setup(t).PodSecurityPolicies().List(api.ListOptions{}) + c.Validate(t, response, err) +} + +func TestPodSecurityPolicyUpdate(t *testing.T) { + ns := api.NamespaceNone + scc := &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{ + Name: "abc", + ResourceVersion: "1", + }, + } + c := &simple.Client{ + Request: simple.Request{Method: "PUT", Path: testapi.Extensions.ResourcePath(getPSPResourcename(), ns, "abc"), Query: simple.BuildQueryValues(nil)}, + Response: simple.Response{StatusCode: 200, Body: scc}, + } + response, err := c.Setup(t).PodSecurityPolicies().Update(scc) + c.Validate(t, response, err) +} + +func TestPodSecurityPolicyDelete(t *testing.T) { + ns := api.NamespaceNone + c := &simple.Client{ + Request: simple.Request{Method: "DELETE", Path: testapi.Extensions.ResourcePath(getPSPResourcename(), ns, "foo"), Query: simple.BuildQueryValues(nil)}, + Response: simple.Response{StatusCode: 200}, + } + err := c.Setup(t).PodSecurityPolicies().Delete("foo") + c.Validate(t, nil, err) +} + +func TestPodSecurityPolicyWatch(t *testing.T) { + c := &simple.Client{ + Request: simple.Request{ + Method: "GET", + Path: fmt.Sprintf("%s/watch/%s", testapi.Extensions.ResourcePath("", "", ""), getPSPResourcename()), + Query: url.Values{"resourceVersion": []string{}}}, + Response: simple.Response{StatusCode: 200}, + } + _, err := c.Setup(t).PodSecurityPolicies().Watch(api.ListOptions{}) + c.Validate(t, nil, err) +} + +func getPSPResourcename() string { + return "podsecuritypolicies" +} diff --git a/pkg/client/unversioned/remotecommand/remotecommand_test.go b/pkg/client/unversioned/remotecommand/remotecommand_test.go index 68fb9eb129b..71acd239d33 100644 --- a/pkg/client/unversioned/remotecommand/remotecommand_test.go +++ b/pkg/client/unversioned/remotecommand/remotecommand_test.go @@ -34,6 +34,19 @@ import ( "k8s.io/kubernetes/pkg/util/httpstream/spdy" ) +type streamAndReply struct { + httpstream.Stream + replySent <-chan struct{} +} + +func waitStreamReply(replySent <-chan struct{}, notify chan<- struct{}, stop <-chan struct{}) { + select { + case <-replySent: + notify <- struct{}{} + case <-stop: + } +} + func fakeExecServer(t *testing.T, i int, stdinData, stdoutData, stderrData, errorData string, tty bool, messageCount int) http.HandlerFunc { // error + stdin + stdout expectedStreams := 3 @@ -50,11 +63,11 @@ func fakeExecServer(t *testing.T, i int, stdinData, stdoutData, stderrData, erro if protocol != StreamProtocolV2Name { t.Fatalf("unexpected protocol: %s", protocol) } - streamCh := make(chan httpstream.Stream) + streamCh := make(chan streamAndReply) upgrader := spdy.NewResponseUpgrader() - conn := upgrader.UpgradeResponse(w, req, func(stream httpstream.Stream) error { - streamCh <- stream + conn := upgrader.UpgradeResponse(w, req, func(stream httpstream.Stream, replySent <-chan struct{}) error { + streamCh <- streamAndReply{Stream: stream, replySent: replySent} return nil }) // from this point on, we can no longer call methods on w @@ -68,6 +81,9 @@ func fakeExecServer(t *testing.T, i int, stdinData, stdoutData, stderrData, erro var errorStream, stdinStream, stdoutStream, stderrStream httpstream.Stream receivedStreams := 0 + replyChan := make(chan struct{}) + stop := make(chan struct{}) + defer close(stop) WaitForStreams: for { select { @@ -76,20 +92,25 @@ func fakeExecServer(t *testing.T, i int, stdinData, stdoutData, stderrData, erro switch streamType { case api.StreamTypeError: errorStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: stdinStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: stdoutStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: stderrStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) default: t.Errorf("%d: unexpected stream type: %q", i, streamType) } + if receivedStreams == expectedStreams { + break WaitForStreams + } + case <-replyChan: + receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } diff --git a/pkg/client/unversioned/request.go b/pkg/client/unversioned/request.go index 3789cdccd2a..3baa5f29ed8 100644 --- a/pkg/client/unversioned/request.go +++ b/pkg/client/unversioned/request.go @@ -361,6 +361,7 @@ var fieldMappings = versionToResourceToFieldMapping{ ObjectNameField: ObjectNameField, EventReason: EventReason, EventSource: EventSource, + EventType: EventType, EventInvolvedKind: EventInvolvedKind, EventInvolvedNamespace: EventInvolvedNamespace, EventInvolvedName: EventInvolvedName, @@ -642,6 +643,7 @@ func (r *Request) Watch() (watch.Interface, error) { return nil, err } if resp.StatusCode != http.StatusOK { + defer resp.Body.Close() if result := r.transformResponse(resp, req); result.err != nil { return nil, result.err } @@ -841,10 +843,13 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu // Did the server give us a status response? isStatusResponse := false - var status *unversioned.Status - result, err := runtime.Decode(r.content.Codec, body) - if out, ok := result.(*unversioned.Status); err == nil && ok && len(out.Status) > 0 { - status = out + // Because release-1.1 server returns Status with empty APIVersion at paths + // to the Extensions resources, we need to use DecodeInto here to provide + // default groupVersion, otherwise a status response won't be correctly + // decoded. + status := &unversioned.Status{} + err := runtime.DecodeInto(r.content.Codec, body, status) + if err == nil && len(status.Status) > 0 { isStatusResponse = true } diff --git a/pkg/client/unversioned/request_test.go b/pkg/client/unversioned/request_test.go index e0823a7909d..2b5bf6d2977 100644 --- a/pkg/client/unversioned/request_test.go +++ b/pkg/client/unversioned/request_test.go @@ -477,7 +477,10 @@ func TestRequestWatch(t *testing.T) { Request: &Request{ content: ContentConfig{GroupVersion: testapi.Default.GroupVersion(), Codec: testapi.Default.Codec()}, client: clientFunc(func(req *http.Request) (*http.Response, error) { - return &http.Response{StatusCode: http.StatusForbidden}, nil + return &http.Response{ + StatusCode: http.StatusForbidden, + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + }, nil }), baseURL: &url.URL{}, }, @@ -490,7 +493,10 @@ func TestRequestWatch(t *testing.T) { Request: &Request{ content: ContentConfig{GroupVersion: testapi.Default.GroupVersion(), Codec: testapi.Default.Codec()}, client: clientFunc(func(req *http.Request) (*http.Response, error) { - return &http.Response{StatusCode: http.StatusUnauthorized}, nil + return &http.Response{ + StatusCode: http.StatusUnauthorized, + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + }, nil }), baseURL: &url.URL{}, }, diff --git a/pkg/client/unversioned/restclient_test.go b/pkg/client/unversioned/restclient_test.go index 8a5968b3131..912611f4abd 100644 --- a/pkg/client/unversioned/restclient_test.go +++ b/pkg/client/unversioned/restclient_test.go @@ -109,7 +109,11 @@ func TestDoRequestFailed(t *testing.T) { t.Errorf("unexpected error type %v", err) } actual := ss.Status() - if !reflect.DeepEqual(status, &actual) { + expected := *status + // The decoder will apply the default Version and Kind to the Status. + expected.APIVersion = "v1" + expected.Kind = "Status" + if !reflect.DeepEqual(&expected, &actual) { t.Errorf("Unexpected mis-match: %s", util.ObjectDiff(status, &actual)) } } diff --git a/pkg/client/unversioned/scale.go b/pkg/client/unversioned/scale.go index 4064ce4dd49..705f6048b59 100644 --- a/pkg/client/unversioned/scale.go +++ b/pkg/client/unversioned/scale.go @@ -52,7 +52,7 @@ func (c *scales) Get(kind string, name string) (result *extensions.Scale, err er // TODO this method needs to take a proper unambiguous kind fullyQualifiedKind := unversioned.GroupVersionKind{Kind: kind} - resource, _ := meta.KindToResource(fullyQualifiedKind, false) + resource, _ := meta.KindToResource(fullyQualifiedKind) err = c.client.Get().Namespace(c.ns).Resource(resource.Resource).Name(name).SubResource("scale").Do().Into(result) return @@ -63,7 +63,7 @@ func (c *scales) Update(kind string, scale *extensions.Scale) (result *extension // TODO this method needs to take a proper unambiguous kind fullyQualifiedKind := unversioned.GroupVersionKind{Kind: kind} - resource, _ := meta.KindToResource(fullyQualifiedKind, false) + resource, _ := meta.KindToResource(fullyQualifiedKind) err = c.client.Put(). Namespace(scale.Namespace). diff --git a/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go b/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go new file mode 100644 index 00000000000..bb611d322c5 --- /dev/null +++ b/pkg/client/unversioned/testclient/fake_podsecuritypolicy.go @@ -0,0 +1,73 @@ +/* +Copyright 2014 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. +*/ + +package testclient + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/watch" +) + +// FakePodSecurityPolicy implements PodSecurityPolicyInterface. 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 FakePodSecurityPolicy struct { + Fake *Fake + Namespace string +} + +func (c *FakePodSecurityPolicy) List(opts api.ListOptions) (*extensions.PodSecurityPolicyList, error) { + obj, err := c.Fake.Invokes(NewListAction("podsecuritypolicies", c.Namespace, opts), &extensions.PodSecurityPolicyList{}) + if obj == nil { + return nil, err + } + + return obj.(*extensions.PodSecurityPolicyList), err +} + +func (c *FakePodSecurityPolicy) Get(name string) (*extensions.PodSecurityPolicy, error) { + obj, err := c.Fake.Invokes(NewGetAction("podsecuritypolicies", c.Namespace, name), &extensions.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*extensions.PodSecurityPolicy), err +} + +func (c *FakePodSecurityPolicy) Create(scc *extensions.PodSecurityPolicy) (*extensions.PodSecurityPolicy, error) { + obj, err := c.Fake.Invokes(NewCreateAction("podsecuritypolicies", c.Namespace, scc), &extensions.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*extensions.PodSecurityPolicy), err +} + +func (c *FakePodSecurityPolicy) Update(scc *extensions.PodSecurityPolicy) (*extensions.PodSecurityPolicy, error) { + obj, err := c.Fake.Invokes(NewUpdateAction("podsecuritypolicies", c.Namespace, scc), &extensions.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*extensions.PodSecurityPolicy), err +} + +func (c *FakePodSecurityPolicy) Delete(name string) error { + _, err := c.Fake.Invokes(NewDeleteAction("podsecuritypolicies", c.Namespace, name), &extensions.PodSecurityPolicy{}) + return err +} + +func (c *FakePodSecurityPolicy) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("podsecuritypolicies", c.Namespace, opts)) +} diff --git a/pkg/client/unversioned/testclient/simple/simple_testclient.go b/pkg/client/unversioned/testclient/simple/simple_testclient.go index 110b4d37e28..7325f16aed1 100644 --- a/pkg/client/unversioned/testclient/simple/simple_testclient.go +++ b/pkg/client/unversioned/testclient/simple/simple_testclient.go @@ -27,7 +27,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" diff --git a/pkg/client/unversioned/testclient/testclient.go b/pkg/client/unversioned/testclient/testclient.go index d66a4dda36f..0da88798418 100644 --- a/pkg/client/unversioned/testclient/testclient.go +++ b/pkg/client/unversioned/testclient/testclient.go @@ -230,6 +230,10 @@ func (c *Fake) Nodes() client.NodeInterface { return &FakeNodes{Fake: c} } +func (c *Fake) PodSecurityPolicies() client.PodSecurityPolicyInterface { + return &FakePodSecurityPolicy{Fake: c} +} + func (c *Fake) Events(namespace string) client.EventInterface { return &FakeEvents{Fake: c, Namespace: namespace} } diff --git a/pkg/cloudprovider/cloud.go b/pkg/cloudprovider/cloud.go index fc4f875499b..d5d99b17aa7 100644 --- a/pkg/cloudprovider/cloud.go +++ b/pkg/cloudprovider/cloud.go @@ -23,6 +23,7 @@ import ( "strings" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/types" ) // Interface is an abstract, pluggable interface for cloud providers. @@ -82,8 +83,8 @@ type LoadBalancer interface { // GetLoadBalancer returns whether the specified load balancer exists, and // if so, what its status is. GetLoadBalancer(name, region string) (status *api.LoadBalancerStatus, exists bool, err error) - // EnsureLoadBalancer creates a new load balancer, or updates an existing one. Returns the status of the balancer - EnsureLoadBalancer(name, region string, loadBalancerIP net.IP, ports []*api.ServicePort, hosts []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) + // EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer + EnsureLoadBalancer(name, region string, loadBalancerIP net.IP, ports []*api.ServicePort, hosts []string, serviceName types.NamespacedName, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) // UpdateLoadBalancer updates hosts under the specified load balancer. UpdateLoadBalancer(name, region string, hosts []string) error // EnsureLoadBalancerDeleted deletes the specified load balancer if it diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 514fe4d97ea..c74cc707722 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -43,6 +43,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/credentialprovider/aws" + "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/sets" "github.com/golang/glog" @@ -54,6 +55,9 @@ const ProviderName = "aws" // The tag name we use to differentiate multiple logically independent clusters running in the same AZ const TagNameKubernetesCluster = "KubernetesCluster" +// The tag name we use to differentiate multiple services. Used currently for ELBs only. +const TagNameKubernetesService = "kubernetes.io/service-name" + // We sometimes read to see if something exists; then try to create it if we didn't find it // This can fail once in a consistent system if done in parallel // In an eventually consistent system, it could fail unboundedly @@ -155,14 +159,18 @@ type Volumes interface { // Attach the disk to the specified instance // instanceName can be empty to mean "the instance on which we are running" // Returns the device (e.g. /dev/xvdf) where we attached the volume - AttachDisk(instanceName string, volumeName string, readOnly bool) (string, error) + AttachDisk(diskName string, instanceName string, readOnly bool) (string, error) // Detach the disk from the specified instance // instanceName can be empty to mean "the instance on which we are running" - DetachDisk(instanceName string, volumeName string) error + // Returns the device where the volume was attached + DetachDisk(diskName string, instanceName string) (string, error) // Create a volume with the specified options - CreateVolume(volumeOptions *VolumeOptions) (volumeName string, err error) - DeleteVolume(volumeName string) error + CreateDisk(volumeOptions *VolumeOptions) (volumeName string, err error) + // Delete the specified volume + // Returns true iff the volume was deleted + // If the was not found, returns (false, nil) + DeleteDisk(volumeName string) (bool, error) // Get labels to apply to volume on creation GetVolumeLabels(volumeName string) (map[string]string, error) @@ -201,6 +209,8 @@ type AWSCloud struct { mutex sync.Mutex } +var _ Volumes = &AWSCloud{} + type AWSCloudConfig struct { Global struct { // TODO: Is there any use for this? We can get it from the instance metadata service @@ -644,18 +654,26 @@ func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error) { return nil, err } if self.nodeName == name || len(name) == 0 { + addresses := []api.NodeAddress{} + internalIP, err := aws.metadata.GetMetadata("local-ipv4") if err != nil { return nil, err } + addresses = append(addresses, api.NodeAddress{Type: api.NodeInternalIP, Address: internalIP}) + // Legacy compatibility: the private ip was the legacy host ip + addresses = append(addresses, api.NodeAddress{Type: api.NodeLegacyHostIP, Address: internalIP}) + externalIP, err := aws.metadata.GetMetadata("public-ipv4") if err != nil { - return nil, err + //TODO: It would be nice to be able to determine the reason for the failure, + // but the AWS client masks all failures with the same error description. + glog.V(2).Info("Could not determine public IP from AWS metadata.") + } else { + addresses = append(addresses, api.NodeAddress{Type: api.NodeExternalIP, Address: externalIP}) } - return []api.NodeAddress{ - {Type: api.NodeInternalIP, Address: internalIP}, - {Type: api.NodeExternalIP, Address: externalIP}, - }, nil + + return addresses, nil } instance, err := aws.getInstanceByNodeName(name) if err != nil { @@ -901,7 +919,7 @@ func (self *awsInstance) getInfo() (*ec2.Instance, error) { // Gets the mountDevice already assigned to the volume, or assigns an unused mountDevice. // If the volume is already assigned, this will return the existing mountDevice with alreadyAttached=true. // Otherwise the mountDevice is assigned by finding the first available mountDevice, and it is returned with alreadyAttached=false. -func (self *awsInstance) getMountDevice(volumeID string) (assigned mountDevice, alreadyAttached bool, err error) { +func (self *awsInstance) getMountDevice(volumeID string, assign bool) (assigned mountDevice, alreadyAttached bool, err error) { instanceType := self.getInstanceType() if instanceType == nil { return "", false, fmt.Errorf("could not get instance type for instance: %s", self.awsID) @@ -939,11 +957,17 @@ func (self *awsInstance) getMountDevice(volumeID string) (assigned mountDevice, // Check to see if this volume is already assigned a device on this machine for mountDevice, mappingVolumeID := range self.deviceMappings { if volumeID == mappingVolumeID { - glog.Warningf("Got assignment call for already-assigned volume: %s@%s", mountDevice, mappingVolumeID) + if assign { + glog.Warningf("Got assignment call for already-assigned volume: %s@%s", mountDevice, mappingVolumeID) + } return mountDevice, true, nil } } + if !assign { + return mountDevice(""), false, nil + } + // Check all the valid mountpoints to see if any of them are free valid := instanceType.getEBSMountDevices() chosen := mountDevice("") @@ -1094,13 +1118,18 @@ func (self *awsDisk) waitForAttachmentStatus(status string) error { } // Deletes the EBS disk -func (self *awsDisk) deleteVolume() error { +func (self *awsDisk) deleteVolume() (bool, error) { request := &ec2.DeleteVolumeInput{VolumeId: aws.String(self.awsID)} _, err := self.ec2.DeleteVolume(request) if err != nil { - return fmt.Errorf("error delete EBS volumes: %v", err) + if awsError, ok := err.(awserr.Error); ok { + if awsError.Code() == "InvalidVolume.NotFound" { + return false, nil + } + } + return false, fmt.Errorf("error deleting EBS volumes: %v", err) } - return nil + return true, nil } // Gets the awsInstance for the EC2 instance on which we are running @@ -1117,10 +1146,13 @@ func (s *AWSCloud) getSelfAWSInstance() (*awsInstance, error) { if err != nil { return nil, fmt.Errorf("error fetching instance-id from ec2 metadata service: %v", err) } - privateDnsName, err := s.metadata.GetMetadata("local-hostname") + // privateDnsName, err := s.metadata.GetMetadata("local-hostname") + // See #11543 - need to use ec2 API to get the privateDnsName in case of private dns zone e.g. mydomain.io + instance, err := s.getInstanceByID(instanceId) if err != nil { - return nil, fmt.Errorf("error fetching local-hostname from ec2 metadata service: %v", err) + return nil, fmt.Errorf("error finding instance %s: %v", instanceId, err) } + privateDnsName := aws.StringValue(instance.PrivateDnsName) availabilityZone, err := getAvailabilityZone(s.metadata) if err != nil { return nil, fmt.Errorf("error fetching availability zone from ec2 metadata service: %v", err) @@ -1155,7 +1187,7 @@ func (aws *AWSCloud) getAwsInstance(nodeName string) (*awsInstance, error) { } // Implements Volumes.AttachDisk -func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly bool) (string, error) { +func (c *AWSCloud) AttachDisk(diskName string, instanceName string, readOnly bool) (string, error) { disk, err := newAWSDisk(c, diskName) if err != nil { return "", err @@ -1172,7 +1204,7 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo return "", errors.New("AWS volumes cannot be mounted read-only") } - mountDevice, alreadyAttached, err := awsInstance.getMountDevice(disk.awsID) + mountDevice, alreadyAttached, err := awsInstance.getMountDevice(disk.awsID, true) if err != nil { return "", err } @@ -1206,7 +1238,7 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo return "", fmt.Errorf("Error attaching EBS volume: %v", err) } - glog.V(2).Info("AttachVolume request returned %v", attachResponse) + glog.V(2).Infof("AttachVolume request returned %v", attachResponse) } err = disk.waitForAttachmentStatus("attached") @@ -1220,15 +1252,25 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo } // Implements Volumes.DetachDisk -func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { +func (aws *AWSCloud) DetachDisk(diskName string, instanceName string) (string, error) { disk, err := newAWSDisk(aws, diskName) if err != nil { - return err + return "", err } awsInstance, err := aws.getAwsInstance(instanceName) if err != nil { - return err + return "", err + } + + mountDevice, alreadyAttached, err := awsInstance.getMountDevice(disk.awsID, false) + if err != nil { + return "", err + } + + if !alreadyAttached { + glog.Warning("DetachDisk called on non-attached disk: ", diskName) + // TODO: Continue? Tolerate non-attached error in DetachVolume? } request := ec2.DetachVolumeInput{ @@ -1238,12 +1280,16 @@ func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { response, err := aws.ec2.DetachVolume(&request) if err != nil { - return fmt.Errorf("error detaching EBS volume: %v", err) + return "", fmt.Errorf("error detaching EBS volume: %v", err) } if response == nil { - return errors.New("no response from DetachVolume") + return "", errors.New("no response from DetachVolume") } + // TODO: Fix this - just remove the cache? + // If we don't have a cache; we don't have to wait any more (the driver does it for us) + // Also, maybe we could get the locally connected drivers from the AWS metadata service? + // At this point we are waiting for the volume being detached. This // releases the volume and invalidates the cache even when there is a timeout. // @@ -1253,6 +1299,7 @@ func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { // works though. An option would be to completely flush the cache upon timeouts. // defer func() { + // TODO: Not thread safe? for mountDevice, existingVolumeID := range awsInstance.deviceMappings { if existingVolumeID == disk.awsID { awsInstance.releaseMountDevice(disk.awsID, mountDevice) @@ -1263,14 +1310,15 @@ func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { err = disk.waitForAttachmentStatus("detached") if err != nil { - return err + return "", err } - return err + hostDevicePath := "/dev/xvd" + string(mountDevice) + return hostDevicePath, err } // Implements Volumes.CreateVolume -func (s *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error) { +func (s *AWSCloud) CreateDisk(volumeOptions *VolumeOptions) (string, error) { // TODO: Should we tag this with the cluster id (so it gets deleted when the cluster does?) request := &ec2.CreateVolumeInput{} @@ -1302,7 +1350,7 @@ func (s *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error) { tagRequest.Tags = tags if _, err := s.createTags(tagRequest); err != nil { // delete the volume and hope it succeeds - delerr := s.DeleteVolume(volumeName) + _, delerr := s.DeleteDisk(volumeName) if delerr != nil { // delete did not succeed, we have a stray volume! return "", fmt.Errorf("error tagging volume %s, could not delete the volume: %v", volumeName, delerr) @@ -1313,11 +1361,11 @@ func (s *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error) { return volumeName, nil } -// Implements Volumes.DeleteVolume -func (aws *AWSCloud) DeleteVolume(volumeName string) error { +// Implements Volumes.DeleteDisk +func (aws *AWSCloud) DeleteDisk(volumeName string) (bool, error) { awsDisk, err := newAWSDisk(aws, volumeName) if err != nil { - return err + return false, err } return awsDisk.deleteVolume() } @@ -1427,6 +1475,7 @@ func isEqualIntPointer(l, r *int64) bool { } return *l == *r } + func isEqualStringPointer(l, r *string) bool { if l == nil { return r == nil @@ -1437,42 +1486,52 @@ func isEqualStringPointer(l, r *string) bool { return *l == *r } -func isEqualIPPermission(l, r *ec2.IpPermission, compareGroupUserIDs bool) bool { - if !isEqualIntPointer(l.FromPort, r.FromPort) { +func ipPermissionExists(newPermission, existing *ec2.IpPermission, compareGroupUserIDs bool) bool { + if !isEqualIntPointer(newPermission.FromPort, existing.FromPort) { return false } - if !isEqualIntPointer(l.ToPort, r.ToPort) { + if !isEqualIntPointer(newPermission.ToPort, existing.ToPort) { return false } - if !isEqualStringPointer(l.IpProtocol, r.IpProtocol) { + if !isEqualStringPointer(newPermission.IpProtocol, existing.IpProtocol) { return false } - if len(l.IpRanges) != len(r.IpRanges) { + if len(newPermission.IpRanges) != len(existing.IpRanges) { return false } - for j := range l.IpRanges { - if !isEqualStringPointer(l.IpRanges[j].CidrIp, r.IpRanges[j].CidrIp) { + for j := range newPermission.IpRanges { + if !isEqualStringPointer(newPermission.IpRanges[j].CidrIp, existing.IpRanges[j].CidrIp) { return false } } - if len(l.UserIdGroupPairs) != len(r.UserIdGroupPairs) { - return false - } - for j := range l.UserIdGroupPairs { - if !isEqualStringPointer(l.UserIdGroupPairs[j].GroupId, r.UserIdGroupPairs[j].GroupId) { - return false - } - if compareGroupUserIDs { - if !isEqualStringPointer(l.UserIdGroupPairs[j].UserId, r.UserIdGroupPairs[j].UserId) { - return false + for _, leftPair := range newPermission.UserIdGroupPairs { + for _, rightPair := range existing.UserIdGroupPairs { + if isEqualUserGroupPair(leftPair, rightPair, compareGroupUserIDs) { + return true } } + return false } return true } +func isEqualUserGroupPair(l, r *ec2.UserIdGroupPair, compareGroupUserIDs bool) bool { + glog.V(2).Infof("Comparing %v to %v", *l.GroupId, *r.GroupId) + if isEqualStringPointer(l.GroupId, r.GroupId) { + if compareGroupUserIDs { + if isEqualStringPointer(l.UserId, r.UserId) { + return true + } + } else { + return true + } + } + + return false +} + // Makes sure the security group includes the specified permissions // Returns true if and only if changes were made // The security group must already exist @@ -1487,6 +1546,8 @@ func (s *AWSCloud) ensureSecurityGroupIngress(securityGroupId string, addPermiss return false, fmt.Errorf("security group not found: %s", securityGroupId) } + glog.V(2).Infof("Existing security group ingress: %s %v", securityGroupId, group.IpPermissions) + changes := []*ec2.IpPermission{} for _, addPermission := range addPermissions { hasUserID := false @@ -1498,7 +1559,7 @@ func (s *AWSCloud) ensureSecurityGroupIngress(securityGroupId string, addPermiss found := false for _, groupPermission := range group.IpPermissions { - if isEqualIPPermission(addPermission, groupPermission, hasUserID) { + if ipPermissionExists(addPermission, groupPermission, hasUserID) { found = true break } @@ -1553,8 +1614,8 @@ func (s *AWSCloud) removeSecurityGroupIngress(securityGroupId string, removePerm var found *ec2.IpPermission for _, groupPermission := range group.IpPermissions { - if isEqualIPPermission(groupPermission, removePermission, hasUserID) { - found = groupPermission + if ipPermissionExists(removePermission, groupPermission, hasUserID) { + found = removePermission break } } @@ -1718,8 +1779,8 @@ func (s *AWSCloud) listSubnetIDsinVPC(vpcId string) ([]string, error) { // EnsureLoadBalancer implements LoadBalancer.EnsureLoadBalancer // TODO(justinsb) It is weird that these take a region. I suspect it won't work cross-region anyway. -func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, ports []*api.ServicePort, hosts []string, affinity api.ServiceAffinity) (*api.LoadBalancerStatus, error) { - glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v)", name, region, publicIP, ports, hosts) +func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, ports []*api.ServicePort, hosts []string, serviceName types.NamespacedName, affinity api.ServiceAffinity) (*api.LoadBalancerStatus, error) { + glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v)", name, region, publicIP, ports, hosts, serviceName) if region != s.region { return nil, fmt.Errorf("requested load balancer region '%s' does not match cluster region '%s'", region, s.region) @@ -1766,7 +1827,7 @@ func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, port var securityGroupID string { sgName := "k8s-elb-" + name - sgDescription := "Security group for Kubernetes ELB " + name + sgDescription := fmt.Sprintf("Security group for Kubernetes ELB %s (%v)", name, serviceName) securityGroupID, err = s.ensureSecurityGroup(sgName, sgDescription, vpcId) if err != nil { glog.Error("Error creating load balancer security group: ", err) @@ -1815,7 +1876,7 @@ func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, port } // Build the load balancer itself - loadBalancer, err := s.ensureLoadBalancer(name, listeners, subnetIDs, securityGroupIDs) + loadBalancer, err := s.ensureLoadBalancer(serviceName, name, listeners, subnetIDs, securityGroupIDs) if err != nil { return nil, err } @@ -1833,11 +1894,11 @@ func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, port err = s.ensureLoadBalancerInstances(orEmpty(loadBalancer.LoadBalancerName), loadBalancer.Instances, instances) if err != nil { - glog.Warning("Error registering instances with the load balancer: %v", err) + glog.Warningf("Error registering instances with the load balancer: %v", err) return nil, err } - glog.V(1).Infof("Loadbalancer %s has DNS name %s", name, orEmpty(loadBalancer.DNSName)) + glog.V(1).Infof("Loadbalancer %s (%v) has DNS name %s", name, serviceName, orEmpty(loadBalancer.DNSName)) // TODO: Wait for creation? @@ -2137,7 +2198,6 @@ func (s *AWSCloud) UpdateLoadBalancer(name, region string, hosts []string) error } // Returns the instance with the specified ID -// This function is currently unused, but seems very likely to be needed again func (a *AWSCloud) getInstanceByID(instanceID string) (*ec2.Instance, error) { instances, err := a.getInstancesByIDs([]*string{&instanceID}) if err != nil { @@ -2272,3 +2332,8 @@ func (s *AWSCloud) addFilters(filters []*ec2.Filter) []*ec2.Filter { } return filters } + +// Returns the cluster name or an empty string +func (s *AWSCloud) getClusterName() string { + return s.filterTags[TagNameKubernetesCluster] +} diff --git a/pkg/cloudprovider/providers/aws/aws_loadbalancer.go b/pkg/cloudprovider/providers/aws/aws_loadbalancer.go index 7f7b5dd3e22..90e0405d822 100644 --- a/pkg/cloudprovider/providers/aws/aws_loadbalancer.go +++ b/pkg/cloudprovider/providers/aws/aws_loadbalancer.go @@ -24,10 +24,11 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elb" "github.com/golang/glog" + "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/sets" ) -func (s *AWSCloud) ensureLoadBalancer(name string, listeners []*elb.Listener, subnetIDs []string, securityGroupIDs []string) (*elb.LoadBalancerDescription, error) { +func (s *AWSCloud) ensureLoadBalancer(namespacedName types.NamespacedName, name string, listeners []*elb.Listener, subnetIDs []string, securityGroupIDs []string) (*elb.LoadBalancerDescription, error) { loadBalancer, err := s.describeLoadBalancer(name) if err != nil { return nil, err @@ -47,7 +48,12 @@ func (s *AWSCloud) ensureLoadBalancer(name string, listeners []*elb.Listener, su createRequest.SecurityGroups = stringPointerArray(securityGroupIDs) - glog.Info("Creating load balancer with name: ", name) + createRequest.Tags = []*elb.Tag{ + {Key: aws.String(TagNameKubernetesCluster), Value: aws.String(s.getClusterName())}, + {Key: aws.String(TagNameKubernetesService), Value: aws.String(namespacedName.String())}, + } + + glog.Infof("Creating load balancer for %v with name: ", namespacedName, name) _, err := s.elb.CreateLoadBalancer(createRequest) if err != nil { return nil, err diff --git a/pkg/cloudprovider/providers/aws/aws_test.go b/pkg/cloudprovider/providers/aws/aws_test.go index 44d701d2347..361c995cc8f 100644 --- a/pkg/cloudprovider/providers/aws/aws_test.go +++ b/pkg/cloudprovider/providers/aws/aws_test.go @@ -30,6 +30,7 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/types" ) const TestClusterId = "clusterid.test" @@ -133,6 +134,8 @@ func NewFakeAWSServices() *FakeAWSServices { s.instanceId = "i-self" s.privateDnsName = "ip-172-20-0-100.ec2.internal" + s.internalIP = "192.168.0.1" + s.externalIP = "1.2.3.4" var selfInstance ec2.Instance selfInstance.InstanceId = &s.instanceId selfInstance.PrivateDnsName = &s.privateDnsName @@ -587,9 +590,10 @@ func TestNodeAddresses(t *testing.T) { // (we test that this produces an error) var instance0 ec2.Instance var instance1 ec2.Instance + var instance2 ec2.Instance //0 - instance0.InstanceId = aws.String("instance-same") + instance0.InstanceId = aws.String("i-self") instance0.PrivateDnsName = aws.String("instance-same.ec2.internal") instance0.PrivateIpAddress = aws.String("192.168.0.1") instance0.PublicIpAddress = aws.String("1.2.3.4") @@ -600,7 +604,7 @@ func TestNodeAddresses(t *testing.T) { instance0.State = &state0 //1 - instance1.InstanceId = aws.String("instance-same") + instance1.InstanceId = aws.String("i-self") instance1.PrivateDnsName = aws.String("instance-same.ec2.internal") instance1.PrivateIpAddress = aws.String("192.168.0.2") instance1.InstanceType = aws.String("c3.large") @@ -609,7 +613,18 @@ func TestNodeAddresses(t *testing.T) { } instance1.State = &state1 - instances := []*ec2.Instance{&instance0, &instance1} + //2 + instance2.InstanceId = aws.String("i-self") + instance2.PrivateDnsName = aws.String("instance-other.ec2.internal") + instance2.PrivateIpAddress = aws.String("192.168.0.1") + instance2.PublicIpAddress = aws.String("1.2.3.4") + instance2.InstanceType = aws.String("c3.large") + state2 := ec2.InstanceState{ + Name: aws.String("running"), + } + instance2.State = &state2 + + instances := []*ec2.Instance{&instance0, &instance1, &instance2} aws1, _ := mockInstancesResp([]*ec2.Instance{}) _, err1 := aws1.NodeAddresses("instance-mismatch.ec2.internal") @@ -698,7 +713,9 @@ func TestLoadBalancerMatchesClusterRegion(t *testing.T) { t.Errorf("Expected GetLoadBalancer region mismatch error.") } - _, err = c.EnsureLoadBalancer("elb-name", badELBRegion, nil, nil, nil, api.ServiceAffinityNone) + serviceName := types.NamespacedName{Namespace: "foo", Name: "bar"} + + _, err = c.EnsureLoadBalancer("elb-name", badELBRegion, nil, nil, nil, serviceName, api.ServiceAffinityNone) if err == nil || err.Error() != errorMessage { t.Errorf("Expected EnsureLoadBalancer region mismatch error.") } @@ -799,3 +816,67 @@ func TestSubnetIDsinVPC(t *testing.T) { } } + +func TestIpPermissionExistsHandlesMultipleGroupIds(t *testing.T) { + oldIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("firstGroupId")}, + {GroupId: aws.String("secondGroupId")}, + {GroupId: aws.String("thirdGroupId")}, + }, + } + + existingIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("secondGroupId")}, + }, + } + + newIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("fourthGroupId")}, + }, + } + + equals := ipPermissionExists(&existingIpPermission, &oldIpPermission, false) + if !equals { + t.Errorf("Should have been considered equal since first is in the second array of groups") + } + + equals = ipPermissionExists(&newIpPermission, &oldIpPermission, false) + if equals { + t.Errorf("Should have not been considered equal since first is not in the second array of groups") + } +} + +func TestIpPermissionExistsHandlesMultipleGroupIdsWithUserIds(t *testing.T) { + oldIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("firstGroupId"), UserId: aws.String("firstUserId")}, + {GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")}, + {GroupId: aws.String("thirdGroupId"), UserId: aws.String("thirdUserId")}, + }, + } + + existingIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")}, + }, + } + + newIpPermission := ec2.IpPermission{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + {GroupId: aws.String("secondGroupId"), UserId: aws.String("anotherUserId")}, + }, + } + + equals := ipPermissionExists(&existingIpPermission, &oldIpPermission, true) + if !equals { + t.Errorf("Should have been considered equal since first is in the second array of groups") + } + + equals = ipPermissionExists(&newIpPermission, &oldIpPermission, true) + if equals { + t.Errorf("Should have not been considered equal since first is not in the second array of groups") + } +} diff --git a/pkg/cloudprovider/providers/fake/fake.go b/pkg/cloudprovider/providers/fake/fake.go index 5a67612858c..fdcc9bcb175 100644 --- a/pkg/cloudprovider/providers/fake/fake.go +++ b/pkg/cloudprovider/providers/fake/fake.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/cloudprovider" + "k8s.io/kubernetes/pkg/types" ) const ProviderName = "fake" @@ -130,7 +131,7 @@ func (f *FakeCloud) GetLoadBalancer(name, region string) (*api.LoadBalancerStatu // EnsureLoadBalancer is a test-spy implementation of LoadBalancer.EnsureLoadBalancer. // It adds an entry "create" into the internal method call record. -func (f *FakeCloud) EnsureLoadBalancer(name, region string, externalIP net.IP, ports []*api.ServicePort, hosts []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) { +func (f *FakeCloud) EnsureLoadBalancer(name, region string, externalIP net.IP, ports []*api.ServicePort, hosts []string, serviceName types.NamespacedName, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) { f.addCall("create") if f.Balancers == nil { f.Balancers = make(map[string]FakeBalancer) diff --git a/pkg/cloudprovider/providers/gce/gce.go b/pkg/cloudprovider/providers/gce/gce.go index b1ba815989c..3f9f542afe6 100644 --- a/pkg/cloudprovider/providers/gce/gce.go +++ b/pkg/cloudprovider/providers/gce/gce.go @@ -17,6 +17,7 @@ limitations under the License. package gce import ( + "encoding/json" "fmt" "io" "net" @@ -31,6 +32,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" + "k8s.io/kubernetes/pkg/types" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/wait" @@ -430,8 +432,12 @@ func isHTTPErrorCode(err error, code int) bool { // Due to an interesting series of design decisions, this handles both creating // new load balancers and updating existing load balancers, recognizing when // each is needed. -func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, ports []*api.ServicePort, hostNames []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) { - glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v)", name, region, requestedIP, ports, hostNames) +func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, ports []*api.ServicePort, hostNames []string, serviceName types.NamespacedName, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) { + portStr := []string{} + for _, p := range ports { + portStr = append(portStr, fmt.Sprintf("%s/%d", p.Protocol, p.Port)) + } + glog.V(2).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v)", name, region, requestedIP, portStr, hostNames, serviceName) if len(hostNames) == 0 { return nil, fmt.Errorf("Cannot EnsureLoadBalancer() with no hosts") @@ -464,23 +470,85 @@ func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, // function in order to maintain the invariant that "if the forwarding rule // exists, the LB has been fully created". ipAddress := "" + + // Through this process we try to keep track of whether it is safe to + // release the IP that was allocated. If the user specifically asked for + // an IP, we assume they are managing it themselves. Otherwise, we will + // release the IP in case of early-terminating failure or upon successful + // creating of the LB. + isUserOwnedIP := false // if this is set, we never release the IP + isSafeToReleaseIP := false + defer func() { + if isUserOwnedIP { + return + } + if isSafeToReleaseIP { + if err := gce.deleteStaticIP(name, region); err != nil { + glog.Errorf("failed to release static IP %s for load balancer (%v(%v), %v): %v", ipAddress, name, serviceName, region, err) + } + glog.V(2).Infof("EnsureLoadBalancer(%v(%v)): released static IP %s", name, serviceName, ipAddress) + } else { + glog.Warningf("orphaning static IP %s during update of load balancer (%v(%v), %v): %v", ipAddress, name, serviceName, region, err) + } + }() + if requestedIP != nil { // If a specific IP address has been requested, we have to respect the // user's request and use that IP. If the forwarding rule was already using // a different IP, it will be harmlessly abandoned because it was only an // ephemeral IP (or it was a different static IP owned by the user, in which // case we shouldn't delete it anyway). - if err := gce.projectOwnsStaticIP(name, region, requestedIP.String()); err != nil { - return nil, err + if isStatic, err := gce.projectOwnsStaticIP(name, region, requestedIP.String()); err != nil { + return nil, fmt.Errorf("failed to test if this GCE project owns the static IP %s: %v", requestedIP.String(), err) + } else if isStatic { + // The requested IP is a static IP, owned and managed by the user. + isUserOwnedIP = true + isSafeToReleaseIP = false + ipAddress = requestedIP.String() + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): using user-provided static IP %s", name, serviceName, ipAddress) + } else if requestedIP.String() == fwdRuleIP { + // The requested IP is not a static IP, but is currently assigned + // to this forwarding rule, so we can keep it. + isUserOwnedIP = false + isSafeToReleaseIP = true + ipAddress, _, err = gce.ensureStaticIP(name, region, fwdRuleIP) + if err != nil { + return nil, fmt.Errorf("failed to ensure static IP %s: %v", fwdRuleIP, err) + } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): using user-provided non-static IP %s", name, serviceName, ipAddress) + } else { + // The requested IP is not static and it is not assigned to the + // current forwarding rule. It might be attached to a different + // rule or it might not be part of this project at all. Either + // way, we can't use it. + return nil, fmt.Errorf("requested ip %s is neither static nor assigned to LB %s(%v): %v", requestedIP.String(), name, serviceName, err) } - ipAddress = requestedIP.String() } else { + // The user did not request a specific IP. + isUserOwnedIP = false + // This will either allocate a new static IP if the forwarding rule didn't - // already have an IP, or it will promote the forwarding rule's IP from - // ephemeral to static. - ipAddress, err = gce.createOrPromoteStaticIP(name, region, fwdRuleIP) + // already have an IP, or it will promote the forwarding rule's current + // IP from ephemeral to static, or it will just get the IP if it is + // already static. + existed := false + ipAddress, existed, err = gce.ensureStaticIP(name, region, fwdRuleIP) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to ensure static IP %s: %v", fwdRuleIP, err) + } + if existed { + // If the IP was not specifically requested by the user, but it + // already existed, it seems to be a failed update cycle. We can + // use this IP and try to run through the process again, but we + // should not release the IP unless it is explicitly flagged as OK. + isSafeToReleaseIP = false + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): adopting static IP %s", name, serviceName, ipAddress) + } else { + // For total clarity. The IP did not pre-exist and the user did + // not ask for a particular one, so we can release the IP in case + // of failure or success. + isSafeToReleaseIP = true + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): allocated static IP %s", name, serviceName, ipAddress) } } @@ -500,10 +568,12 @@ func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, if err := gce.updateFirewall(name, region, desc, "0.0.0.0/0", ports, hosts); err != nil { return nil, err } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): updated firewall", name, serviceName) } else { if err := gce.createFirewall(name, region, desc, "0.0.0.0/0", ports, hosts); err != nil { return nil, err } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created firewall", name, serviceName) } } @@ -520,14 +590,20 @@ func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, // Thus, we have to tear down the forwarding rule if either it or the target // pool needs to be updated. if fwdRuleExists && (fwdRuleNeedsUpdate || tpNeedsUpdate) { + // Begin critical section. If we have to delete the forwarding rule, + // and something should fail before we recreate it, don't release the + // IP. That way we can come back to it later. + isSafeToReleaseIP = false if err := gce.deleteForwardingRule(name, region); err != nil { return nil, fmt.Errorf("failed to delete existing forwarding rule %s for load balancer update: %v", name, err) } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): deleted forwarding rule", name, serviceName) } if tpExists && tpNeedsUpdate { if err := gce.deleteTargetPool(name, region); err != nil { return nil, fmt.Errorf("failed to delete existing target pool %s for load balancer update: %v", name, err) } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): deleted target pool", name, serviceName) } // Once we've deleted the resources (if necessary), build them back up (or for @@ -536,17 +612,18 @@ func (gce *GCECloud) EnsureLoadBalancer(name, region string, requestedIP net.IP, if err := gce.createTargetPool(name, region, hosts, affinityType); err != nil { return nil, fmt.Errorf("failed to create target pool %s: %v", name, err) } + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created target pool", name, serviceName) } if tpNeedsUpdate || fwdRuleNeedsUpdate { if err := gce.createForwardingRule(name, region, ipAddress, ports); err != nil { return nil, fmt.Errorf("failed to create forwarding rule %s: %v", name, err) } - } - - // Now that we're done operating on everything, demote the static IP back to - // ephemeral to avoid taking up the user's static IP quota. - if err := gce.deleteStaticIP(name, region); err != nil { - return nil, fmt.Errorf("failed to release static IP %s after finishing update of load balancer resources: %v", err) + // End critical section. It is safe to release the static IP (which + // just demotes it to ephemeral) now that it is attached. In the case + // of a user-requested IP, the "is user-owned" flag will be set, + // preventing it from actually being released. + isSafeToReleaseIP = true + glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created forwarding rule, IP %s", name, serviceName, ipAddress) } status := &api.LoadBalancerStatus{} @@ -843,46 +920,55 @@ func (gce *GCECloud) computeHostTags(hosts []*gceInstance) ([]string, error) { return tags.List(), nil } -func (gce *GCECloud) projectOwnsStaticIP(name, region string, ipAddress string) error { +func (gce *GCECloud) projectOwnsStaticIP(name, region string, ipAddress string) (bool, error) { addresses, err := gce.service.Addresses.List(gce.projectID, region).Do() if err != nil { - return fmt.Errorf("failed to list gce IP addresses: %v", err) + return false, fmt.Errorf("failed to list gce IP addresses: %v", err) } for _, addr := range addresses.Items { if addr.Address == ipAddress { // This project does own the address, so return success. - return nil + return true, nil } } - return fmt.Errorf("this gce project doesn't own the IP address: %s", ipAddress) + return false, nil } -func (gce *GCECloud) createOrPromoteStaticIP(name, region, existingIP string) (ipAddress string, err error) { +func (gce *GCECloud) ensureStaticIP(name, region, existingIP string) (ipAddress string, created bool, err error) { // If the address doesn't exist, this will create it. // If the existingIP exists but is ephemeral, this will promote it to static. // If the address already exists, this will harmlessly return a StatusConflict // and we'll grab the IP before returning. + existed := false addressObj := &compute.Address{Name: name} if existingIP != "" { addressObj.Address = existingIP } op, err := gce.service.Addresses.Insert(gce.projectID, region, addressObj).Do() - if err != nil && !isHTTPErrorCode(err, http.StatusConflict) { - return "", fmt.Errorf("error creating gce static IP address: %v", err) + if err != nil { + if !isHTTPErrorCode(err, http.StatusConflict) { + return "", false, fmt.Errorf("error creating gce static IP address: %v", err) + } + // StatusConflict == the IP exists already. + existed = true } if op != nil { err := gce.waitForRegionOp(op, region) - if err != nil && !isHTTPErrorCode(err, http.StatusConflict) { - return "", fmt.Errorf("error waiting for gce static IP address to be created: %v", err) + if err != nil { + if !isHTTPErrorCode(err, http.StatusConflict) { + return "", false, fmt.Errorf("error waiting for gce static IP address to be created: %v", err) + } + // StatusConflict == the IP exists already. + existed = true } } // We have to get the address to know which IP was allocated for us. address, err := gce.service.Addresses.Get(gce.projectID, region, name).Do() if err != nil { - return "", fmt.Errorf("error re-getting gce static IP address: %v", err) + return "", false, fmt.Errorf("error re-getting gce static IP address: %v", err) } - return address.Address, nil + return address.Address, existed, nil } // UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer. @@ -953,6 +1039,7 @@ func (gce *GCECloud) UpdateLoadBalancer(name, region string, hostNames []string) // EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted. func (gce *GCECloud) EnsureLoadBalancerDeleted(name, region string) error { + glog.V(2).Infof("EnsureLoadBalancerDeleted(%v, %v", name, region) err := utilerrors.AggregateGoroutines( func() error { return gce.deleteFirewall(name, region) }, // Even though we don't hold on to static IPs for load balancers, it's @@ -1029,7 +1116,7 @@ func (gce *GCECloud) deleteFirewall(name, region string) error { func (gce *GCECloud) deleteStaticIP(name, region string) error { op, err := gce.service.Addresses.Delete(gce.projectID, region, name).Do() if err != nil && isHTTPErrorCode(err, http.StatusNotFound) { - glog.Infof("Static IP address %s already deleted. Continuing to delete other resources.", name) + glog.Infof("Static IP address %s is not reserved", name) } else if err != nil { glog.Warningf("Failed to delete static IP address %s, got error %v", name, err) return err @@ -1816,12 +1903,36 @@ func (gce *GCECloud) GetZone() (cloudprovider.Zone, error) { }, nil } -// Create a new Persistent Disk, with the specified name & size, in the specified zone. -func (gce *GCECloud) CreateDisk(name string, zone string, sizeGb int64) error { - diskToCreate := &compute.Disk{ - Name: name, - SizeGb: sizeGb, +// encodeDiskTags encodes requested volume tags into JSON string, as GCE does +// not support tags on GCE PDs and we use Description field as fallback. +func (gce *GCECloud) encodeDiskTags(tags map[string]string) (string, error) { + if len(tags) == 0 { + // No tags -> empty JSON + return "", nil } + + enc, err := json.Marshal(tags) + if err != nil { + return "", err + } + return string(enc), nil +} + +// CreateDisk creates a new Persistent Disk, with the specified name & size, in +// the specified zone. It stores specified tags endoced in JSON in Description +// field. +func (gce *GCECloud) CreateDisk(name string, zone string, sizeGb int64, tags map[string]string) error { + tagsStr, err := gce.encodeDiskTags(tags) + if err != nil { + return err + } + + diskToCreate := &compute.Disk{ + Name: name, + SizeGb: sizeGb, + Description: tagsStr, + } + createOp, err := gce.service.Disks.Insert(gce.projectID, zone, diskToCreate).Do() if err != nil { return err diff --git a/pkg/cloudprovider/providers/openstack/openstack.go b/pkg/cloudprovider/providers/openstack/openstack.go index 320bc308566..e0e13edf2ac 100644 --- a/pkg/cloudprovider/providers/openstack/openstack.go +++ b/pkg/cloudprovider/providers/openstack/openstack.go @@ -46,6 +46,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/cloudprovider" + "k8s.io/kubernetes/pkg/types" ) const ProviderName = "openstack" @@ -654,8 +655,8 @@ func (lb *LoadBalancer) GetLoadBalancer(name, region string) (*api.LoadBalancerS // a list of regions (from config) and query/create loadbalancers in // each region. -func (lb *LoadBalancer) EnsureLoadBalancer(name, region string, loadBalancerIP net.IP, ports []*api.ServicePort, hosts []string, affinity api.ServiceAffinity) (*api.LoadBalancerStatus, error) { - glog.V(4).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v)", name, region, loadBalancerIP, ports, hosts, affinity) +func (lb *LoadBalancer) EnsureLoadBalancer(name, region string, loadBalancerIP net.IP, ports []*api.ServicePort, hosts []string, serviceName types.NamespacedName, affinity api.ServiceAffinity) (*api.LoadBalancerStatus, error) { + glog.V(4).Infof("EnsureLoadBalancer(%v, %v, %v, %v, %v, %v)", name, region, loadBalancerIP, ports, hosts, serviceName) if len(ports) > 1 { return nil, fmt.Errorf("multiple ports are not yet supported in openstack load balancers") @@ -679,7 +680,7 @@ func (lb *LoadBalancer) EnsureLoadBalancer(name, region string, loadBalancerIP n return nil, fmt.Errorf("unsupported load balancer affinity: %v", affinity) } - glog.V(2).Info("Checking if openstack load balancer already exists: %s", name) + glog.V(2).Infof("Checking if openstack load balancer already exists: %s", name) _, exists, err := lb.GetLoadBalancer(name, region) if err != nil { return nil, fmt.Errorf("error checking if openstack load balancer already exists: %v", err) diff --git a/pkg/controller/controller_utils.go b/pkg/controller/controller_utils.go index 53aca3ac826..a4206d8bd35 100644 --- a/pkg/controller/controller_utils.go +++ b/pkg/controller/controller_utils.go @@ -26,8 +26,9 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/validation" + "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/fields" @@ -321,7 +322,7 @@ func (r RealPodControl) createPods(nodeName, namespace string, template *api.Pod if labels.Set(pod.Labels).AsSelector().Empty() { return fmt.Errorf("unable to create pods, no labels") } - if newPod, err := r.KubeClient.Legacy().Pods(namespace).Create(pod); err != nil { + if newPod, err := r.KubeClient.Core().Pods(namespace).Create(pod); err != nil { r.Recorder.Eventf(object, api.EventTypeWarning, "FailedCreate", "Error creating: %v", err) return fmt.Errorf("unable to create pods: %v", err) } else { @@ -336,7 +337,7 @@ func (r RealPodControl) DeletePod(namespace string, podID string, object runtime if err != nil { return fmt.Errorf("object does not have ObjectMeta, %v", err) } - if err := r.KubeClient.Legacy().Pods(namespace).Delete(podID, nil); err != nil { + if err := r.KubeClient.Core().Pods(namespace).Delete(podID, nil); err != nil { r.Recorder.Eventf(object, api.EventTypeWarning, "FailedDelete", "Error deleting: %v", err) return fmt.Errorf("unable to delete pods: %v", err) } else { @@ -449,7 +450,7 @@ func SyncAllPodsWithStore(kubeClient clientset.Interface, store cache.Store) { var err error listOptions := api.ListOptions{LabelSelector: labels.Everything(), FieldSelector: fields.Everything()} for { - if allPods, err = kubeClient.Legacy().Pods(api.NamespaceAll).List(listOptions); err != nil { + if allPods, err = kubeClient.Core().Pods(api.NamespaceAll).List(listOptions); err != nil { glog.Warningf("Retrying pod list: %v", err) continue } @@ -477,3 +478,16 @@ 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. +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) +} diff --git a/pkg/controller/controller_utils_test.go b/pkg/controller/controller_utils_test.go index 2f3fc8f43f4..9ad8ded5c85 100644 --- a/pkg/controller/controller_utils_test.go +++ b/pkg/controller/controller_utils_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" @@ -43,7 +43,7 @@ import ( // NewFakeControllerExpectationsLookup creates a fake store for PodExpectations. func NewFakeControllerExpectationsLookup(ttl time.Duration) (*ControllerExpectations, *util.FakeClock) { fakeTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) - fakeClock := &util.FakeClock{Time: fakeTime} + fakeClock := util.NewFakeClock(fakeTime) ttlPolicy := &cache.TTLPolicy{Ttl: ttl, Clock: fakeClock} ttlStore := cache.NewFakeExpirationStore( ExpKeyFunc, nil, ttlPolicy, fakeClock) @@ -177,7 +177,7 @@ func TestControllerExpectations(t *testing.T) { } // Expectations have expired because of ttl - fakeClock.Time = fakeClock.Time.Add(ttl + 1) + fakeClock.Step(ttl + 1) if !e.SatisfiedExpectations(rcKey) { t.Errorf("Expectations should have expired but didn't") } diff --git a/pkg/controller/daemon/controller.go b/pkg/controller/daemon/controller.go index 3b4772c53e7..7fbff804288 100644 --- a/pkg/controller/daemon/controller.go +++ b/pkg/controller/daemon/controller.go @@ -24,21 +24,22 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" unversioned_extensions "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/validation/field" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates" @@ -98,7 +99,7 @@ func NewDaemonSetsController(kubeClient clientset.Interface, resyncPeriod contro eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) // TODO: remove the wrapper when every clients have moved to use the clientset. - eventBroadcaster.StartRecordingToSink(&unversioned_legacy.EventSinkImpl{kubeClient.Legacy().Events("")}) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) dsc := &DaemonSetsController{ kubeClient: kubeClient, @@ -146,10 +147,10 @@ func NewDaemonSetsController(kubeClient clientset.Interface, resyncPeriod contro dsc.podStore.Store, dsc.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return dsc.kubeClient.Legacy().Pods(api.NamespaceAll).List(options) + return dsc.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return dsc.kubeClient.Legacy().Pods(api.NamespaceAll).Watch(options) + return dsc.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -164,10 +165,10 @@ func NewDaemonSetsController(kubeClient clientset.Interface, resyncPeriod contro dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return dsc.kubeClient.Legacy().Nodes().List(options) + return dsc.kubeClient.Core().Nodes().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return dsc.kubeClient.Legacy().Nodes().Watch(options) + return dsc.kubeClient.Core().Nodes().Watch(options) }, }, &api.Node{}, @@ -191,7 +192,7 @@ func (dsc *DaemonSetsController) Run(workers int, stopCh <-chan struct{}) { go dsc.podController.Run(stopCh) go dsc.nodeController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(dsc.worker, time.Second, stopCh) + go wait.Until(dsc.worker, time.Second, stopCh) } <-stopCh glog.Infof("Shutting down Daemon Set Controller") @@ -365,7 +366,7 @@ func (dsc *DaemonSetsController) updateNode(old, cur interface{}) { // getNodesToDaemonSetPods returns a map from nodes to daemon pods (corresponding to ds) running on the nodes. func (dsc *DaemonSetsController) getNodesToDaemonPods(ds *extensions.DaemonSet) (map[string][]*api.Pod, error) { nodeToDaemonPods := make(map[string][]*api.Pod) - selector, err := extensions.LabelSelectorAsSelector(ds.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { return nil, err } diff --git a/pkg/controller/daemon/controller_test.go b/pkg/controller/daemon/controller_test.go index e67fd7e76fa..77df3394f81 100644 --- a/pkg/controller/daemon/controller_test.go +++ b/pkg/controller/daemon/controller_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/runtime" @@ -60,7 +60,7 @@ func newDaemonSet(name string) *extensions.DaemonSet { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: simpleDaemonSetLabel}, + Selector: &unversioned.LabelSelector{MatchLabels: simpleDaemonSetLabel}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: simpleDaemonSetLabel, diff --git a/pkg/controller/deployment/deployment_controller.go b/pkg/controller/deployment/deployment_controller.go index 7b2a776a4e2..f562693c80e 100644 --- a/pkg/controller/deployment/deployment_controller.go +++ b/pkg/controller/deployment/deployment_controller.go @@ -29,11 +29,12 @@ import ( "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" + "k8s.io/kubernetes/pkg/kubectl" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" deploymentutil "k8s.io/kubernetes/pkg/util/deployment" @@ -41,6 +42,7 @@ import ( labelsutil "k8s.io/kubernetes/pkg/util/labels" podutil "k8s.io/kubernetes/pkg/util/pod" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" ) @@ -50,13 +52,13 @@ const ( // of all deployments that have fulfilled their expectations at least this often. // This recomputation happens based on contents in the local caches. FullDeploymentResyncPeriod = 30 * time.Second - // We must avoid creating new rc until the rc store has synced. If it hasn't synced, to + // We must avoid creating new replica set until the replica set store has synced. If it hasn't synced, to // avoid a hot loop, we'll wait this long between checks. - RcStoreSyncedPollPeriod = 100 * time.Millisecond + RSStoreSyncedPollPeriod = 100 * time.Millisecond ) // DeploymentController is responsible for synchronizing Deployment objects stored -// in the system with actual running rcs and pods. +// in the system with actual running replica sets and pods. type DeploymentController struct { client clientset.Interface eventRecorder record.EventRecorder @@ -68,13 +70,13 @@ type DeploymentController struct { dStore cache.StoreToDeploymentLister // Watches changes to all deployments dController *framework.Controller - // A store of replication controllers, populated by the rcController - rcStore cache.StoreToReplicationControllerLister - // Watches changes to all replication controllers - rcController *framework.Controller - // rcStoreSynced returns true if the RC store has been synced at least once. + // A store of ReplicaSets, populated by the rsController + rsStore cache.StoreToReplicaSetLister + // Watches changes to all ReplicaSets + rsController *framework.Controller + // rsStoreSynced returns true if the ReplicaSet store has been synced at least once. // Added as a member to the struct to allow injection for testing. - rcStoreSynced func() bool + rsStoreSynced func() bool // A store of pods, populated by the podController podStore cache.StoreToPodLister // Watches changes to all pods @@ -86,9 +88,9 @@ type DeploymentController struct { // A TTLCache of pod creates/deletes each deployment expects to see podExpectations controller.ControllerExpectationsInterface - // A TTLCache of rc creates/deletes each deployment expects to see - // TODO: make expectation model understand (rc) updates (besides adds and deletes) - rcExpectations controller.ControllerExpectationsInterface + // A TTLCache of ReplicaSet creates/deletes each deployment it expects to see + // TODO: make expectation model understand (ReplicaSet) updates (besides adds and deletes) + rsExpectations controller.ControllerExpectationsInterface // Deployments that need to be synced queue *workqueue.Type @@ -99,14 +101,14 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) // TODO: remove the wrapper when every clients have moved to use the clientset. - eventBroadcaster.StartRecordingToSink(&unversioned_legacy.EventSinkImpl{client.Legacy().Events("")}) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{client.Core().Events("")}) dc := &DeploymentController{ client: client, eventRecorder: eventBroadcaster.NewRecorder(api.EventSource{Component: "deployment-controller"}), queue: workqueue.New(), podExpectations: controller.NewControllerExpectations(), - rcExpectations: controller.NewControllerExpectations(), + rsExpectations: controller.NewControllerExpectations(), } dc.dStore.Store, dc.dController = framework.NewInformer( @@ -141,31 +143,31 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller }, ) - dc.rcStore.Store, dc.rcController = framework.NewInformer( + dc.rsStore.Store, dc.rsController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return dc.client.Legacy().ReplicationControllers(api.NamespaceAll).List(options) + return dc.client.Extensions().ReplicaSets(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return dc.client.Legacy().ReplicationControllers(api.NamespaceAll).Watch(options) + return dc.client.Extensions().ReplicaSets(api.NamespaceAll).Watch(options) }, }, - &api.ReplicationController{}, + &extensions.ReplicaSet{}, resyncPeriod(), framework.ResourceEventHandlerFuncs{ - AddFunc: dc.addRC, - UpdateFunc: dc.updateRC, - DeleteFunc: dc.deleteRC, + AddFunc: dc.addReplicaSet, + UpdateFunc: dc.updateReplicaSet, + DeleteFunc: dc.deleteReplicaSet, }, ) dc.podStore.Store, dc.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return dc.client.Legacy().Pods(api.NamespaceAll).List(options) + return dc.client.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return dc.client.Legacy().Pods(api.NamespaceAll).Watch(options) + return dc.client.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -179,7 +181,7 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller ) dc.syncHandler = dc.syncDeployment - dc.rcStoreSynced = dc.rcController.HasSynced + dc.rsStoreSynced = dc.rsController.HasSynced dc.podStoreSynced = dc.podController.HasSynced return dc } @@ -188,40 +190,40 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller func (dc *DeploymentController) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() go dc.dController.Run(stopCh) - go dc.rcController.Run(stopCh) + go dc.rsController.Run(stopCh) go dc.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(dc.worker, time.Second, stopCh) + go wait.Until(dc.worker, time.Second, stopCh) } <-stopCh glog.Infof("Shutting down deployment controller") dc.queue.ShutDown() } -// addRC enqueues the deployment that manages an RC when the RC is created. -func (dc *DeploymentController) addRC(obj interface{}) { - rc := obj.(*api.ReplicationController) - glog.V(4).Infof("Replication controller %s added.", rc.Name) - if d := dc.getDeploymentForRC(rc); d != nil { +// addReplicaSet enqueues the deployment that manages a ReplicaSet when the ReplicaSet is created. +func (dc *DeploymentController) addReplicaSet(obj interface{}) { + rs := obj.(*extensions.ReplicaSet) + glog.V(4).Infof("ReplicaSet %s added.", rs.Name) + if d := dc.getDeploymentForReplicaSet(rs); d != nil { dKey, err := controller.KeyFunc(d) if err != nil { glog.Errorf("Couldn't get key for deployment controller %#v: %v", d, err) return } - dc.rcExpectations.CreationObserved(dKey) + dc.rsExpectations.CreationObserved(dKey) dc.enqueueDeployment(d) } } -// getDeploymentForRC returns the deployment managing the given RC. -// TODO: Surface that we are ignoring multiple deployments for a given controller. -func (dc *DeploymentController) getDeploymentForRC(rc *api.ReplicationController) *extensions.Deployment { - deployments, err := dc.dStore.GetDeploymentsForRC(rc) +// getDeploymentForReplicaSet returns the deployment managing the given ReplicaSet. +// TODO: Surface that we are ignoring multiple deployments for a given ReplicaSet. +func (dc *DeploymentController) getDeploymentForReplicaSet(rs *extensions.ReplicaSet) *extensions.Deployment { + deployments, err := dc.dStore.GetDeploymentsForReplicaSet(rs) if err != nil || len(deployments) == 0 { - glog.V(4).Infof("Error: %v. No deployment found for replication controller %v, deployment controller will avoid syncing.", err, rc.Name) + glog.V(4).Infof("Error: %v. No deployment found for ReplicaSet %v, deployment controller will avoid syncing.", err, rs.Name) return nil } - // Because all RC's belonging to a deployment should have a unique label key, + // Because all ReplicaSet's belonging to a deployment should have a unique label key, // there should never be more than one deployment returned by the above method. // If that happens we should probably dynamically repair the situation by ultimately // trying to clean up one of the controllers, for now we just return one of the two, @@ -229,68 +231,69 @@ func (dc *DeploymentController) getDeploymentForRC(rc *api.ReplicationController return &deployments[0] } -// updateRC figures out what deployment(s) manage an RC when the RC is updated and -// wake them up. If the anything of the RCs have changed, we need to awaken both -// the old and new deployments. old and cur must be *api.ReplicationController types. -func (dc *DeploymentController) updateRC(old, cur interface{}) { +// updateReplicaSet figures out what deployment(s) manage a ReplicaSet when the ReplicaSet +// is updated and wake them up. If the anything of the ReplicaSets have changed, we need to +// awaken both the old and new deployments. old and cur must be *extensions.ReplicaSet +// types. +func (dc *DeploymentController) updateReplicaSet(old, cur interface{}) { if api.Semantic.DeepEqual(old, cur) { // A periodic relist will send update events for all known controllers. return } // TODO: Write a unittest for this case - curRC := cur.(*api.ReplicationController) - glog.V(4).Infof("Replication controller %s updated.", curRC.Name) - if d := dc.getDeploymentForRC(curRC); d != nil { + curRS := cur.(*extensions.ReplicaSet) + glog.V(4).Infof("ReplicaSet %s updated.", curRS.Name) + if d := dc.getDeploymentForReplicaSet(curRS); d != nil { dc.enqueueDeployment(d) } // A number of things could affect the old deployment: labels changing, // pod template changing, etc. - oldRC := old.(*api.ReplicationController) - if !api.Semantic.DeepEqual(oldRC, curRC) { - if oldD := dc.getDeploymentForRC(oldRC); oldD != nil { + oldRS := old.(*extensions.ReplicaSet) + if !api.Semantic.DeepEqual(oldRS, curRS) { + if oldD := dc.getDeploymentForReplicaSet(oldRS); oldD != nil { dc.enqueueDeployment(oldD) } } } -// deleteRC enqueues the deployment that manages an RC when the RC is deleted. -// obj could be an *api.ReplicationController, or a DeletionFinalStateUnknown -// marker item. -func (dc *DeploymentController) deleteRC(obj interface{}) { - rc, ok := obj.(*api.ReplicationController) +// deleteReplicaSet enqueues the deployment that manages a ReplicaSet when +// the ReplicaSet is deleted. obj could be an *extensions.ReplicaSet, or +// a DeletionFinalStateUnknown marker item. +func (dc *DeploymentController) deleteReplicaSet(obj interface{}) { + rs, ok := obj.(*extensions.ReplicaSet) // When a delete is dropped, the relist will notice a pod in the store not // in the list, leading to the insertion of a tombstone object which contains - // the deleted key/value. Note that this value might be stale. If the RC + // the deleted key/value. Note that this value might be stale. If the ReplicaSet // changed labels the new deployment will not be woken up till the periodic resync. if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - glog.Errorf("Couldn't get object from tombstone %+v, could take up to %v before a deployment recreates/updates controllers", obj, FullDeploymentResyncPeriod) + glog.Errorf("Couldn't get object from tombstone %+v, could take up to %v before a deployment recreates/updates replicasets", obj, FullDeploymentResyncPeriod) return } - rc, ok = tombstone.Obj.(*api.ReplicationController) + rs, ok = tombstone.Obj.(*extensions.ReplicaSet) if !ok { - glog.Errorf("Tombstone contained object that is not an rc %+v, could take up to %v before a deployment recreates/updates controllers", obj, FullDeploymentResyncPeriod) + glog.Errorf("Tombstone contained object that is not a ReplicaSet %+v, could take up to %v before a deployment recreates/updates replicasets", obj, FullDeploymentResyncPeriod) return } } - glog.V(4).Infof("Replication controller %s deleted.", rc.Name) - if d := dc.getDeploymentForRC(rc); d != nil { + glog.V(4).Infof("ReplicaSet %s deleted.", rs.Name) + if d := dc.getDeploymentForReplicaSet(rs); d != nil { dc.enqueueDeployment(d) } } -// getDeploymentForPod returns the deployment managing the RC that manages the given Pod. +// getDeploymentForPod returns the deployment managing the ReplicaSet that manages the given Pod. // TODO: Surface that we are ignoring multiple deployments for a given Pod. func (dc *DeploymentController) getDeploymentForPod(pod *api.Pod) *extensions.Deployment { - rcs, err := dc.rcStore.GetPodControllers(pod) + rss, err := dc.rsStore.GetPodReplicaSets(pod) if err != nil { - glog.V(4).Infof("Error: %v. No replication controllers found for pod %v, deployment controller will avoid syncing.", err, pod.Name) + glog.V(4).Infof("Error: %v. No ReplicaSets found for pod %v, deployment controller will avoid syncing.", err, pod.Name) return nil } - for _, rc := range rcs { - deployments, err := dc.dStore.GetDeploymentsForRC(&rc) + for _, rs := range rss { + deployments, err := dc.dStore.GetDeploymentsForReplicaSet(&rs) if err == nil && len(deployments) > 0 { return &deployments[0] } @@ -299,7 +302,7 @@ func (dc *DeploymentController) getDeploymentForPod(pod *api.Pod) *extensions.De return nil } -// updatePod figures out what deployment(s) manage the RC that manages the Pod when the Pod +// updatePod figures out what deployment(s) manage the ReplicaSet that manages the Pod when the Pod // is updated and wake them up. If anything of the Pods have changed, we need to awaken both // the old and new deployments. old and cur must be *api.Pod types. func (dc *DeploymentController) updatePod(old, cur interface{}) { @@ -326,16 +329,17 @@ func (dc *DeploymentController) deletePod(obj interface{}) { // When a delete is dropped, the relist will notice a pod in the store not // in the list, leading to the insertion of a tombstone object which contains // the deleted key/value. Note that this value might be stale. If the pod - // changed labels the new rc will not be woken up till the periodic resync. + // changed labels the new ReplicaSet will not be woken up till the periodic + // resync. if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - glog.Errorf("Couldn't get object from tombstone %+v, could take up to %v before a controller recreates a replica", obj, controller.ExpectationsTimeout) + glog.Errorf("Couldn't get object from tombstone %+v, could take up to %v before a ReplicaSet recreates a replica", obj, controller.ExpectationsTimeout) return } pod, ok = tombstone.Obj.(*api.Pod) if !ok { - glog.Errorf("Tombstone contained object that is not a pod %+v, could take up to %v before controller recreates a replica", obj, controller.ExpectationsTimeout) + glog.Errorf("Tombstone contained object that is not a pod %+v, could take up to %v before ReplicaSet recreates a replica", obj, controller.ExpectationsTimeout) return } } @@ -359,11 +363,11 @@ func (dc *DeploymentController) enqueueDeployment(obj interface{}) { } // TODO: Handle overlapping deployments better. Either disallow them at admission time or - // deterministically avoid syncing deployments that fight over RC's. Currently, we only - // ensure that the same deployment is synced for a given RC. When we periodically relist - // all deployments there will still be some RC instability. One way to handle this is - // by querying the store for all deployments that this deployment overlaps, as well as all - // deployments that overlap this deployments, and sorting them. + // deterministically avoid syncing deployments that fight over ReplicaSet's. Currently, we + // only ensure that the same deployment is synced for a given ReplicaSet. When we + // periodically relist all deployments there will still be some ReplicaSet instability. One + // way to handle this is by querying the store for all deployments that this deployment + // overlaps, as well as all deployments that overlap this deployments, and sorting them. dc.queue.Add(key) } @@ -402,14 +406,14 @@ func (dc *DeploymentController) syncDeployment(key string) error { if !exists { glog.Infof("Deployment has been deleted %v", key) dc.podExpectations.DeleteExpectations(key) - dc.rcExpectations.DeleteExpectations(key) + dc.rsExpectations.DeleteExpectations(key) return nil } d := *obj.(*extensions.Deployment) - if !dc.rcStoreSynced() { - // Sleep so we give the rc reflector goroutine a chance to run. - time.Sleep(RcStoreSyncedPollPeriod) - glog.Infof("Waiting for rc controller to sync, requeuing deployment %s", d.Name) + if !dc.rsStoreSynced() { + // Sleep so we give the replica set reflector goroutine a chance to run. + time.Sleep(RSStoreSyncedPollPeriod) + glog.Infof("Waiting for replica set controller to sync, requeuing deployment %s", d.Name) dc.enqueueDeployment(&d) return nil } @@ -437,38 +441,38 @@ func (dc *DeploymentController) syncDeployment(key string) error { // Rolling back to a revision; no-op if the toRevision is deployment's current revision func (dc *DeploymentController) rollback(deployment *extensions.Deployment, toRevision *int64) (*extensions.Deployment, error) { - newRC, allOldRCs, err := dc.getNewRCAndAllOldRCs(*deployment) + newRS, allOldRSs, err := dc.getNewAndAllOldReplicaSets(*deployment) if err != nil { return nil, err } - allRCs := append(allOldRCs, newRC) + allRSs := append(allOldRSs, newRS) // If rollback revision is 0, rollback to the last revision if *toRevision == 0 { - if *toRevision = lastRevision(allRCs); *toRevision == 0 { + if *toRevision = lastRevision(allRSs); *toRevision == 0 { // If we still can't find the last revision, gives up rollback - dc.emitRollbackWarningEvent(deployment, "DeploymentRollbackRevisionNotFound", "Unable to find last revision.") + dc.emitRollbackWarningEvent(deployment, deploymentutil.RollbackRevisionNotFound, "Unable to find last revision.") // Gives up rollback return dc.updateDeploymentAndClearRollbackTo(deployment) } } - for _, rc := range allRCs { - v, err := deploymentutil.Revision(rc) + for _, rs := range allRSs { + v, err := deploymentutil.Revision(rs) if err != nil { - glog.V(4).Infof("Unable to extract revision from deployment's rc %q: %v", rc.Name, err) + glog.V(4).Infof("Unable to extract revision from deployment's replica set %q: %v", rs.Name, err) continue } if v == *toRevision { - glog.V(4).Infof("Found rc %q with desired revision %d", rc.Name, v) - // rollback by copying podTemplate.Spec from the rc, and increment revision number by 1 + glog.V(4).Infof("Found replica set %q with desired revision %d", rs.Name, v) + // rollback by copying podTemplate.Spec from the replica set, and increment revision number by 1 // no-op if the the spec matches current deployment's podTemplate.Spec - deployment, performedRollback, err := dc.rollbackToTemplate(deployment, rc) + deployment, performedRollback, err := dc.rollbackToTemplate(deployment, rs) if performedRollback && err == nil { dc.emitRollbackNormalEvent(deployment, fmt.Sprintf("Rolled back deployment %q to revision %d", deployment.Name, *toRevision)) } return deployment, err } } - dc.emitRollbackWarningEvent(deployment, "DeploymentRollbackRevisionNotFound", "Unable to find the revision to rollback to.") + dc.emitRollbackWarningEvent(deployment, deploymentutil.RollbackRevisionNotFound, "Unable to find the revision to rollback to.") // Gives up rollback return dc.updateDeploymentAndClearRollbackTo(deployment) } @@ -478,7 +482,7 @@ func (dc *DeploymentController) emitRollbackWarningEvent(deployment *extensions. } func (dc *DeploymentController) emitRollbackNormalEvent(deployment *extensions.Deployment, message string) { - dc.eventRecorder.Eventf(deployment, api.EventTypeNormal, "DeploymentRollback", message) + dc.eventRecorder.Eventf(deployment, api.EventTypeNormal, deploymentutil.RollbackDone, message) } // updateDeploymentAndClearRollbackTo sets .spec.rollbackTo to nil and update the input deployment @@ -489,141 +493,141 @@ func (dc *DeploymentController) updateDeploymentAndClearRollbackTo(deployment *e } func (dc *DeploymentController) syncRecreateDeployment(deployment extensions.Deployment) error { - newRC, oldRCs, err := dc.getNewRCAndOldRCs(deployment) + newRS, oldRSs, err := dc.getNewAndOldReplicaSets(deployment) if err != nil { return err } - allRCs := append(oldRCs, newRC) + allRSs := append(oldRSs, newRS) - // scale down old rcs - scaledDown, err := dc.scaleDownOldRCsForRecreate(oldRCs, deployment) + // scale down old replica sets + scaledDown, err := dc.scaleDownOldReplicaSetsForRecreate(oldRSs, deployment) if err != nil { return err } if scaledDown { // Update DeploymentStatus - return dc.updateDeploymentStatus(allRCs, newRC, deployment) + return dc.updateDeploymentStatus(allRSs, newRS, deployment) } - // scale up new rc - scaledUp, err := dc.scaleUpNewRCForRecreate(newRC, deployment) + // scale up new replica set + scaledUp, err := dc.scaleUpNewReplicaSetForRecreate(newRS, deployment) if err != nil { return err } if scaledUp { // Update DeploymentStatus - return dc.updateDeploymentStatus(allRCs, newRC, deployment) + return dc.updateDeploymentStatus(allRSs, newRS, deployment) } if deployment.Spec.RevisionHistoryLimit != nil { - // Cleanup old RCs - dc.cleanupOldRcs(oldRCs, deployment) + // Cleanup old replica sets + dc.cleanupOldReplicaSets(oldRSs, deployment) } // Sync deployment status - return dc.syncDeploymentStatus(allRCs, newRC, deployment) + return dc.syncDeploymentStatus(allRSs, newRS, deployment) // TODO: raise an event, neither scaled up nor down. } func (dc *DeploymentController) syncRollingUpdateDeployment(deployment extensions.Deployment) error { - newRC, oldRCs, err := dc.getNewRCAndOldRCs(deployment) + newRS, oldRSs, err := dc.getNewAndOldReplicaSets(deployment) if err != nil { return err } - allRCs := append(oldRCs, newRC) + allRSs := append(oldRSs, newRS) // Scale up, if we can. - scaledUp, err := dc.reconcileNewRC(allRCs, newRC, deployment) + scaledUp, err := dc.reconcileNewReplicaSet(allRSs, newRS, deployment) if err != nil { return err } if scaledUp { // Update DeploymentStatus - return dc.updateDeploymentStatus(allRCs, newRC, deployment) + return dc.updateDeploymentStatus(allRSs, newRS, deployment) } // Scale down, if we can. - scaledDown, err := dc.reconcileOldRCs(allRCs, oldRCs, newRC, deployment, true) + scaledDown, err := dc.reconcileOldReplicaSets(allRSs, oldRSs, newRS, deployment, true) if err != nil { return err } if scaledDown { // Update DeploymentStatus - return dc.updateDeploymentStatus(allRCs, newRC, deployment) + return dc.updateDeploymentStatus(allRSs, newRS, deployment) } if deployment.Spec.RevisionHistoryLimit != nil { - // Cleanup old RCs - dc.cleanupOldRcs(oldRCs, deployment) + // Cleanup old replicas sets + dc.cleanupOldReplicaSets(oldRSs, deployment) } // Sync deployment status - return dc.syncDeploymentStatus(allRCs, newRC, deployment) + return dc.syncDeploymentStatus(allRSs, newRS, deployment) // TODO: raise an event, neither scaled up nor down. } // syncDeploymentStatus checks if the status is up-to-date and sync it if necessary -func (dc *DeploymentController) syncDeploymentStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) error { - totalReplicas, updatedReplicas, availableReplicas, _, err := dc.calculateStatus(allRCs, newRC, deployment) +func (dc *DeploymentController) syncDeploymentStatus(allRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, deployment extensions.Deployment) error { + totalReplicas, updatedReplicas, availableReplicas, _, err := dc.calculateStatus(allRSs, newRS, deployment) if err != nil { return err } if deployment.Status.Replicas != totalReplicas || deployment.Status.UpdatedReplicas != updatedReplicas || deployment.Status.AvailableReplicas != availableReplicas { - return dc.updateDeploymentStatus(allRCs, newRC, deployment) + return dc.updateDeploymentStatus(allRSs, newRS, deployment) } return nil } -// getNewRCAndMaybeFilteredOldRCs returns new RC and old RCs of the deployment. If ignoreNoPod is true, -// the returned old RCs won't include the ones with no pods; otherwise, all old RCs will be returned. -func (dc *DeploymentController) getNewRCAndMaybeFilteredOldRCs(deployment extensions.Deployment, ignoreNoPod bool) (*api.ReplicationController, []*api.ReplicationController, error) { - oldRCs, allOldRCs, err := dc.getOldRCs(deployment) +// getNewAndMaybeFilteredOldReplicaSets returns new replica set and old replica sets of the deployment. If ignoreNoPod is true, +// the returned old replica sets won't include the ones with no pods; otherwise, all old replica sets will be returned. +func (dc *DeploymentController) getNewAndMaybeFilteredOldReplicaSets(deployment extensions.Deployment, ignoreNoPod bool) (*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { + oldRSs, allOldRSs, err := dc.getOldReplicaSets(deployment) if err != nil { return nil, nil, err } - maxOldV := maxRevision(allOldRCs) + maxOldV := maxRevision(allOldRSs) - // Get new RC with the updated revision number - newRC, err := dc.getNewRC(deployment, maxOldV) + // Get new replica set with the updated revision number + newRS, err := dc.getNewReplicaSet(deployment, maxOldV) if err != nil { return nil, nil, err } - // Sync deployment's revision number with new RC - if newRC.Annotations != nil && len(newRC.Annotations[deploymentutil.RevisionAnnotation]) > 0 && - (deployment.Annotations == nil || deployment.Annotations[deploymentutil.RevisionAnnotation] != newRC.Annotations[deploymentutil.RevisionAnnotation]) { - if err = dc.updateDeploymentRevision(deployment, newRC.Annotations[deploymentutil.RevisionAnnotation]); err != nil { + // Sync deployment's revision number with new replica set + if newRS.Annotations != nil && len(newRS.Annotations[deploymentutil.RevisionAnnotation]) > 0 && + (deployment.Annotations == nil || deployment.Annotations[deploymentutil.RevisionAnnotation] != newRS.Annotations[deploymentutil.RevisionAnnotation]) { + if err = dc.updateDeploymentRevision(deployment, newRS.Annotations[deploymentutil.RevisionAnnotation]); err != nil { glog.V(4).Infof("Error: %v. Unable to update deployment revision, will retry later.", err) } } if !ignoreNoPod { - return newRC, allOldRCs, nil + return newRS, allOldRSs, nil } - return newRC, oldRCs, nil + return newRS, oldRSs, nil } -// getNewRCAndOldRCs returns new RC and old RCs of the deployment. -// Note that the returned old RCs don't include the ones with no pods. -func (dc *DeploymentController) getNewRCAndOldRCs(deployment extensions.Deployment) (*api.ReplicationController, []*api.ReplicationController, error) { - return dc.getNewRCAndMaybeFilteredOldRCs(deployment, true) +// getNewAndOldReplicaSets returns new replica set and old replica sets of the deployment. +// Note that the returned old replica sets don't include the ones with no pods. +func (dc *DeploymentController) getNewAndOldReplicaSets(deployment extensions.Deployment) (*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { + return dc.getNewAndMaybeFilteredOldReplicaSets(deployment, true) } -// getNewRCAndAllOldRCs returns new RC and old RCs of the deployment. -// Note that all old RCs are returned, include the ones with no pods. -func (dc *DeploymentController) getNewRCAndAllOldRCs(deployment extensions.Deployment) (*api.ReplicationController, []*api.ReplicationController, error) { - return dc.getNewRCAndMaybeFilteredOldRCs(deployment, false) +// getNewAndAllOldReplicaSets returns new replica set and old replica sets of the deployment. +// Note that all old replica sets are returned, include the ones with no pods. +func (dc *DeploymentController) getNewAndAllOldReplicaSets(deployment extensions.Deployment) (*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { + return dc.getNewAndMaybeFilteredOldReplicaSets(deployment, false) } -func maxRevision(allRCs []*api.ReplicationController) int64 { +func maxRevision(allRSs []*extensions.ReplicaSet) int64 { max := int64(0) - for _, rc := range allRCs { - if v, err := deploymentutil.Revision(rc); err != nil { - // Skip the RCs when it failed to parse their revision information - glog.V(4).Infof("Error: %v. Couldn't parse revision for rc %#v, deployment controller will skip it when reconciling revisions.", err, rc) + for _, rs := range allRSs { + if v, err := deploymentutil.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 } @@ -631,13 +635,13 @@ func maxRevision(allRCs []*api.ReplicationController) int64 { return max } -// lastRevision finds the second max revision number in all RCs (the last revision) -func lastRevision(allRCs []*api.ReplicationController) int64 { +// 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 _, rc := range allRCs { - if v, err := deploymentutil.Revision(rc); err != nil { - // Skip the RCs when it failed to parse their revision information - glog.V(4).Infof("Error: %v. Couldn't parse revision for rc %#v, deployment controller will skip it when reconciling revisions.", err, rc) + for _, rs := range allRSs { + if v, err := deploymentutil.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 @@ -648,87 +652,120 @@ func lastRevision(allRCs []*api.ReplicationController) int64 { return secMax } -// getOldRCs returns two sets of old RCs of the deployment. The first set of old RCs doesn't include -// the ones with no pods, and the second set of old RCs include all old RCs. -func (dc *DeploymentController) getOldRCs(deployment extensions.Deployment) ([]*api.ReplicationController, []*api.ReplicationController, error) { - return deploymentutil.GetOldRCsFromLists(deployment, dc.client, +// getOldReplicaSets returns two sets of old replica sets of the deployment. 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. +func (dc *DeploymentController) getOldReplicaSets(deployment extensions.Deployment) ([]*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { + return deploymentutil.GetOldReplicaSetsFromLists(deployment, dc.client, func(namespace string, options api.ListOptions) (*api.PodList, error) { podList, err := dc.podStore.Pods(namespace).List(options.LabelSelector) return &podList, err }, - func(namespace string, options api.ListOptions) ([]api.ReplicationController, error) { - return dc.rcStore.ReplicationControllers(namespace).List(options.LabelSelector) + func(namespace string, options api.ListOptions) ([]extensions.ReplicaSet, error) { + return dc.rsStore.ReplicaSets(namespace).List(options.LabelSelector) }) } -// Returns an RC that matches the intent of the given deployment. -// It creates a new RC if required. -// The revision of the new RC will be updated to maxOldRevision + 1 -func (dc *DeploymentController) getNewRC(deployment extensions.Deployment, maxOldRevision int64) (*api.ReplicationController, error) { - // Calculate revision number for this new RC +// Returns a replica set that matches the intent of the given deployment. +// It creates a new replica set if required. +// The revision of the new replica set will be updated to maxOldRevision + 1 +func (dc *DeploymentController) getNewReplicaSet(deployment extensions.Deployment, maxOldRevision int64) (*extensions.ReplicaSet, error) { + // Calculate revision number for this new replica set newRevision := strconv.FormatInt(maxOldRevision+1, 10) - existingNewRC, err := deploymentutil.GetNewRCFromList(deployment, dc.client, - func(namespace string, options api.ListOptions) ([]api.ReplicationController, error) { - return dc.rcStore.ReplicationControllers(namespace).List(options.LabelSelector) + existingNewRS, err := deploymentutil.GetNewReplicaSetFromList(deployment, dc.client, + func(namespace string, options api.ListOptions) ([]extensions.ReplicaSet, error) { + return dc.rsStore.ReplicaSets(namespace).List(options.LabelSelector) }) if err != nil { return nil, err - } else if existingNewRC != nil { - if existingNewRC.Annotations == nil { - existingNewRC.Annotations = make(map[string]string) + } else if existingNewRS != nil { + // Set existing new replica set's annotation + if setNewReplicaSetAnnotations(&deployment, existingNewRS, newRevision) { + return dc.client.Extensions().ReplicaSets(deployment.ObjectMeta.Namespace).Update(existingNewRS) } - if existingNewRC.Annotations[deploymentutil.RevisionAnnotation] != newRevision { - existingNewRC.Annotations[deploymentutil.RevisionAnnotation] = newRevision - glog.V(4).Infof("update existingNewRC %s revision to %s - %+v\n", existingNewRC.Name, newRevision) - return dc.client.Legacy().ReplicationControllers(deployment.ObjectMeta.Namespace).Update(existingNewRC) - } - return existingNewRC, nil + return existingNewRS, nil } - // Check the rc expectations of deployment before creating a new rc + // Check the replica set expectations of the deployment before creating a new one. dKey, err := controller.KeyFunc(&deployment) if err != nil { return nil, fmt.Errorf("couldn't get key for deployment %#v: %v", deployment, err) } - if !dc.rcExpectations.SatisfiedExpectations(dKey) { + if !dc.rsExpectations.SatisfiedExpectations(dKey) { dc.enqueueDeployment(&deployment) - return nil, fmt.Errorf("RC expectations not met yet before getting new RC\n") + return nil, fmt.Errorf("replica set expectations not met yet before getting new replica set\n") } - // new RC does not exist, create one. + // new ReplicaSet does not exist, create one. namespace := deployment.ObjectMeta.Namespace podTemplateSpecHash := podutil.GetPodTemplateSpecHash(deployment.Spec.Template) - newRCTemplate := deploymentutil.GetNewRCTemplate(deployment) + newRSTemplate := deploymentutil.GetNewReplicaSetTemplate(deployment) // Add podTemplateHash label to selector. - newRCSelector := labelsutil.CloneAndAddLabel(deployment.Spec.Selector, deployment.Spec.UniqueLabelKey, podTemplateSpecHash) + newRSSelector := labelsutil.CloneSelectorAndAddLabel(deployment.Spec.Selector, extensions.DefaultDeploymentUniqueLabelKey, podTemplateSpecHash) - // Set RC expectations (1 rc should be created) + // Set ReplicaSet expectations (1 ReplicaSet should be created) dKey, err = controller.KeyFunc(&deployment) if err != nil { return nil, fmt.Errorf("couldn't get key for deployment controller %#v: %v", deployment, err) } - dc.rcExpectations.ExpectCreations(dKey, 1) - - // Create new RC - newRC := api.ReplicationController{ + dc.rsExpectations.ExpectCreations(dKey, 1) + // Create new ReplicaSet + newRS := extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{ GenerateName: deployment.Name + "-", Namespace: namespace, - Annotations: map[string]string{deploymentutil.RevisionAnnotation: newRevision}, }, - Spec: api.ReplicationControllerSpec{ + Spec: extensions.ReplicaSetSpec{ Replicas: 0, - Selector: newRCSelector, - Template: &newRCTemplate, + Selector: newRSSelector, + Template: &newRSTemplate, }, } - createdRC, err := dc.client.Legacy().ReplicationControllers(namespace).Create(&newRC) + // Set new replica set's annotation + setNewReplicaSetAnnotations(&deployment, &newRS, newRevision) + createdRS, err := dc.client.Extensions().ReplicaSets(namespace).Create(&newRS) if err != nil { - dc.rcExpectations.DeleteExpectations(dKey) - return nil, fmt.Errorf("error creating replication controller: %v", err) + dc.rsExpectations.DeleteExpectations(dKey) + return nil, fmt.Errorf("error creating replica set: %v", err) } err = dc.updateDeploymentRevision(deployment, newRevision) - return createdRC, err + return createdRS, err +} + +// 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, rs *extensions.ReplicaSet, newRevision string) bool { + // First, copy deployment's annotations + annotationChanged := copyDeploymentAnnotationsToReplicaSet(deployment, rs) + // Then, update replica set's revision annotation + if rs.Annotations == nil { + rs.Annotations = make(map[string]string) + } + if rs.Annotations[deploymentutil.RevisionAnnotation] != newRevision { + rs.Annotations[deploymentutil.RevisionAnnotation] = newRevision + annotationChanged = true + glog.V(4).Infof("updating replica set %q's revision to %s - %+v\n", rs.Name, newRevision) + } + return annotationChanged +} + +// copyDeploymentAnnotationsToReplicaSet copies deployment's annotations to replica set's annotations, +// and returns true if replica set's annotation is changed +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 { + // Skip apply annotations + // TODO: How to decide which annotations should / should not be copied? + // See https://github.com/kubernetes/kubernetes/pull/20035#issuecomment-179558615 + if k == kubectl.LastAppliedConfigAnnotation || rs.Annotations[k] == v { + continue + } + rs.Annotations[k] = v + rsAnnotationsChanged = true + } + return rsAnnotationsChanged } func (dc *DeploymentController) updateDeploymentRevision(deployment extensions.Deployment, revision string) error { @@ -740,23 +777,14 @@ func (dc *DeploymentController) updateDeploymentRevision(deployment extensions.D return err } -func (dc *DeploymentController) updateRCRevision(rc api.ReplicationController, revision string) error { - if rc.Annotations == nil { - rc.Annotations = make(map[string]string) - } - rc.Annotations[deploymentutil.RevisionAnnotation] = revision - _, err := dc.client.Legacy().ReplicationControllers(rc.ObjectMeta.Namespace).Update(&rc) - return err -} - -func (dc *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) (bool, error) { - if newRC.Spec.Replicas == deployment.Spec.Replicas { +func (dc *DeploymentController) reconcileNewReplicaSet(allRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, deployment extensions.Deployment) (bool, error) { + if newRS.Spec.Replicas == deployment.Spec.Replicas { // Scaling not required. return false, nil } - if newRC.Spec.Replicas > deployment.Spec.Replicas { + if newRS.Spec.Replicas > deployment.Spec.Replicas { // Scale down. - _, err := dc.scaleRCAndRecordEvent(newRC, deployment.Spec.Replicas, deployment) + _, err := dc.scaleReplicaSetAndRecordEvent(newRS, deployment.Spec.Replicas, deployment) return true, err } // Check if we can scale up. @@ -768,7 +796,7 @@ func (dc *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationControll maxSurge = util.GetValueFromPercent(maxSurge, deployment.Spec.Replicas) } // Find the total number of pods - currentPodCount := deploymentutil.GetReplicaCountForRCs(allRCs) + currentPodCount := deploymentutil.GetReplicaCountForReplicaSets(allRSs) maxTotalPods := deployment.Spec.Replicas + maxSurge if currentPodCount >= maxTotalPods { // Cannot scale up. @@ -777,19 +805,37 @@ func (dc *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationControll // Scale up. scaleUpCount := maxTotalPods - currentPodCount // Do not exceed the number of desired replicas. - scaleUpCount = int(math.Min(float64(scaleUpCount), float64(deployment.Spec.Replicas-newRC.Spec.Replicas))) - newReplicasCount := newRC.Spec.Replicas + scaleUpCount - _, err = dc.scaleRCAndRecordEvent(newRC, newReplicasCount, deployment) + scaleUpCount = int(math.Min(float64(scaleUpCount), float64(deployment.Spec.Replicas-newRS.Spec.Replicas))) + newReplicasCount := newRS.Spec.Replicas + scaleUpCount + _, err = dc.scaleReplicaSetAndRecordEvent(newRS, newReplicasCount, deployment) return true, err } // Set expectationsCheck to false to bypass expectations check when testing -func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationController, oldRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment, expectationsCheck bool) (bool, error) { - oldPodsCount := deploymentutil.GetReplicaCountForRCs(oldRCs) +func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.ReplicaSet, oldRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, deployment extensions.Deployment, expectationsCheck bool) (bool, error) { + oldPodsCount := deploymentutil.GetReplicaCountForReplicaSets(oldRSs) if oldPodsCount == 0 { - // Cant scale down further + // Can't scale down further return false, nil } + + // Check the expectations of deployment before reconciling + dKey, err := controller.KeyFunc(&deployment) + if err != nil { + return false, fmt.Errorf("Couldn't get key for deployment %#v: %v", deployment, err) + } + if expectationsCheck && !dc.podExpectations.SatisfiedExpectations(dKey) { + glog.V(4).Infof("Pod expectations not met yet before reconciling old replica sets\n") + return false, nil + } + + minReadySeconds := deployment.Spec.MinReadySeconds + allPodsCount := deploymentutil.GetReplicaCountForReplicaSets(allRSs) + newRSAvailablePodCount, err := deploymentutil.GetAvailablePodsForReplicaSets(dc.client, []*extensions.ReplicaSet{newRS}, minReadySeconds) + if err != nil { + return false, fmt.Errorf("could not find available pods: %v", err) + } + maxUnavailable, isPercent, err := util.GetIntOrPercentValue(&deployment.Spec.Strategy.RollingUpdate.MaxUnavailable) if err != nil { return false, fmt.Errorf("invalid value for MaxUnavailable: %v", err) @@ -797,69 +843,159 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl if isPercent { maxUnavailable = util.GetValueFromPercent(maxUnavailable, deployment.Spec.Replicas) } - // Check if we can scale down. + + // Check if we can scale down. We can scale down in the following 2 cases: + // * Some old replica sets have unhealthy replicas, we could safely scale down those unhealthy replicas since that won't further + // increase unavailability. + // * New replica set has scaled up and it's replicas becomes ready, then we can scale down old replica sets in a further step. + // + // maxScaledDown := allPodsCount - minAvailable - newReplicaSetPodsUnavailable + // take into account not only maxUnavailable and any surge pods that have been created, but also unavailable pods from + // the newRS, so that the unavailable pods from the newRS would not make us scale down old replica sets in a further + // step(that will increase unavailability). + // + // Concrete example: + // + // * 10 replicas + // * 2 maxUnavailable (absolute number, not percent) + // * 3 maxSurge (absolute number, not percent) + // + // case 1: + // * Deployment is updated, newRS is created with 3 replicas, oldRS is scaled down to 8, and newRS is scaled up to 5. + // * The new replica set pods crashloop and never become available. + // * allPodsCount is 13. minAvailable is 8. newRSPodsUnavailable is 5. + // * A node fails and causes one of the oldRS pods to become unavailable. However, 13 - 8 - 5 = 0, so the oldRS won't be scaled down. + // * The user notices the crashloop and does kubectl rollout undo to rollback. + // * newRSPodsUnavailable is 1, since we rolled back to the good replica set, so maxScaledDown = 13 - 8 - 1 = 4. 4 of the crashlooping pods will be scaled down. + // * The total number of pods will then be 9 and the newRS can be scaled up to 10. + // + // case 2: + // Same example, but pushing a new pod template instead of rolling back (aka "roll over"): + // * The new replica set created must start with 0 replicas because allPodsCount is already at 13. + // * However, newRSPodsUnavailable would also be 0, so the 2 old replica sets could be scaled down by 5 (13 - 8 - 0), which would then + // allow the new replica set to be scaled up by 5. minAvailable := deployment.Spec.Replicas - maxUnavailable - minReadySeconds := deployment.Spec.Strategy.RollingUpdate.MinReadySeconds - // Check the expectations of deployment before counting available pods - dKey, err := controller.KeyFunc(&deployment) - if err != nil { - return false, fmt.Errorf("Couldn't get key for deployment %#v: %v", deployment, err) - } - if expectationsCheck && !dc.podExpectations.SatisfiedExpectations(dKey) { - glog.V(4).Infof("Pod expectations not met yet before reconciling old RCs\n") + newRSUnavailablePodCount := newRS.Spec.Replicas - newRSAvailablePodCount + maxScaledDown := allPodsCount - minAvailable - newRSUnavailablePodCount + if maxScaledDown <= 0 { return false, nil } - // Find the number of ready pods. - readyPodCount, err := deploymentutil.GetAvailablePodsForRCs(dc.client, allRCs, minReadySeconds) - if err != nil { - return false, fmt.Errorf("could not find available pods: %v", err) - } - if readyPodCount <= minAvailable { - // Cannot scale down. + // Clean up unhealthy replicas first, otherwise unhealthy replicas will block deployment + // and cause timeout. See https://github.com/kubernetes/kubernetes/issues/16737 + cleanupCount, err := dc.cleanupUnhealthyReplicas(oldRSs, deployment, maxScaledDown) + if err != nil { return false, nil } - totalScaleDownCount := readyPodCount - minAvailable - totalScaledDown := 0 - for _, targetRC := range oldRCs { - if totalScaleDownCount == 0 { - // No further scaling required. - break - } - if targetRC.Spec.Replicas == 0 { - // cannot scale down this RC. - continue - } - // Scale down. - scaleDownCount := int(math.Min(float64(targetRC.Spec.Replicas), float64(totalScaleDownCount))) - newReplicasCount := targetRC.Spec.Replicas - scaleDownCount - _, err = dc.scaleRCAndRecordEvent(targetRC, newReplicasCount, deployment) - if err != nil { - return false, err - } - totalScaledDown += scaleDownCount - totalScaleDownCount -= scaleDownCount - } - // Expect to see old rcs scaled down by exactly totalScaledDownCount (sum of scaleDownCount) replicas. - dKey, err = controller.KeyFunc(&deployment) + + // Scale down old replica sets, need check maxUnavailable to ensure we can scale down + scaledDownCount, err := dc.scaleDownOldReplicaSetsForRollingUpdate(allRSs, oldRSs, deployment) if err != nil { - return false, fmt.Errorf("Couldn't get key for deployment %#v: %v", deployment, err) + return false, nil } + + totalScaledDown := cleanupCount + scaledDownCount if expectationsCheck { dc.podExpectations.ExpectDeletions(dKey, totalScaledDown) } - return true, err + + return totalScaledDown > 0, nil } -// scaleDownOldRCsForRecreate scales down old rcs when deployment strategy is "Recreate" -func (dc *DeploymentController) scaleDownOldRCsForRecreate(oldRCs []*api.ReplicationController, deployment extensions.Deployment) (bool, error) { - scaled := false - for _, rc := range oldRCs { - // Scaling not required. - if rc.Spec.Replicas == 0 { +// cleanupUnhealthyReplicas will scale down old replica sets with unhealthy replicas, so that all unhealthy replicas will be deleted. +func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.ReplicaSet, deployment extensions.Deployment, maxCleanupCount int) (int, error) { + sort.Sort(controller.ReplicaSetsByCreationTimestamp(oldRSs)) + // Safely scale down all old replica sets with unhealthy replicas. Replica set will sort the pods in the order + // such that not-ready < ready, unscheduled < scheduled, and pending < running. This ensures that unhealthy replicas will + // been deleted first and won't increase unavailability. + totalScaledDown := 0 + for _, targetRS := range oldRSs { + if totalScaledDown >= maxCleanupCount { + break + } + if targetRS.Spec.Replicas == 0 { + // cannot scale down this replica set. continue } - _, err := dc.scaleRCAndRecordEvent(rc, 0, deployment) + readyPodCount, err := deploymentutil.GetAvailablePodsForReplicaSets(dc.client, []*extensions.ReplicaSet{targetRS}, 0) + if err != nil { + return totalScaledDown, fmt.Errorf("could not find available pods: %v", err) + } + if targetRS.Spec.Replicas == readyPodCount { + // no unhealthy replicas found, no scaling required. + continue + } + + scaledDownCount := int(math.Min(float64(maxCleanupCount-totalScaledDown), float64(targetRS.Spec.Replicas-readyPodCount))) + newReplicasCount := targetRS.Spec.Replicas - scaledDownCount + _, err = dc.scaleReplicaSetAndRecordEvent(targetRS, newReplicasCount, deployment) + if err != nil { + return totalScaledDown, err + } + totalScaledDown += scaledDownCount + } + return totalScaledDown, nil +} + +// scaleDownOldReplicaSetsForRollingUpdate scales down old replica sets when deployment strategy is "RollingUpdate". +// Need check maxUnavailable to ensure availability +func (dc *DeploymentController) scaleDownOldReplicaSetsForRollingUpdate(allRSs []*extensions.ReplicaSet, oldRSs []*extensions.ReplicaSet, deployment extensions.Deployment) (int, error) { + maxUnavailable, isPercent, err := util.GetIntOrPercentValue(&deployment.Spec.Strategy.RollingUpdate.MaxUnavailable) + if err != nil { + return 0, fmt.Errorf("invalid value for MaxUnavailable: %v", err) + } + if isPercent { + maxUnavailable = util.GetValueFromPercent(maxUnavailable, deployment.Spec.Replicas) + } + // Check if we can scale down. + minAvailable := deployment.Spec.Replicas - maxUnavailable + minReadySeconds := deployment.Spec.MinReadySeconds + // Find the number of ready pods. + readyPodCount, err := deploymentutil.GetAvailablePodsForReplicaSets(dc.client, allRSs, minReadySeconds) + if err != nil { + return 0, fmt.Errorf("could not find available pods: %v", err) + } + if readyPodCount <= minAvailable { + // Cannot scale down. + return 0, nil + } + + sort.Sort(controller.ReplicaSetsByCreationTimestamp(oldRSs)) + + totalScaledDown := 0 + totalScaleDownCount := readyPodCount - minAvailable + for _, targetRS := range oldRSs { + if totalScaledDown >= totalScaleDownCount { + // No further scaling required. + break + } + if targetRS.Spec.Replicas == 0 { + // cannot scale down this ReplicaSet. + continue + } + // Scale down. + scaleDownCount := int(math.Min(float64(targetRS.Spec.Replicas), float64(totalScaleDownCount-totalScaledDown))) + newReplicasCount := targetRS.Spec.Replicas - scaleDownCount + _, err = dc.scaleReplicaSetAndRecordEvent(targetRS, newReplicasCount, deployment) + if err != nil { + return totalScaledDown, err + } + + totalScaledDown += scaleDownCount + } + + return totalScaledDown, nil +} + +// scaleDownOldReplicaSetsForRecreate scales down old replica sets when deployment strategy is "Recreate" +func (dc *DeploymentController) scaleDownOldReplicaSetsForRecreate(oldRSs []*extensions.ReplicaSet, deployment extensions.Deployment) (bool, error) { + scaled := false + for _, rs := range oldRSs { + // Scaling not required. + if rs.Spec.Replicas == 0 { + continue + } + _, err := dc.scaleReplicaSetAndRecordEvent(rs, 0, deployment) if err != nil { return false, err } @@ -868,34 +1004,34 @@ func (dc *DeploymentController) scaleDownOldRCsForRecreate(oldRCs []*api.Replica return scaled, nil } -// scaleUpNewRCForRecreate scales up new rc when deployment strategy is "Recreate" -func (dc *DeploymentController) scaleUpNewRCForRecreate(newRC *api.ReplicationController, deployment extensions.Deployment) (bool, error) { - if newRC.Spec.Replicas == deployment.Spec.Replicas { +// scaleUpNewReplicaSetForRecreate scales up new replica set when deployment strategy is "Recreate" +func (dc *DeploymentController) scaleUpNewReplicaSetForRecreate(newRS *extensions.ReplicaSet, deployment extensions.Deployment) (bool, error) { + if newRS.Spec.Replicas == deployment.Spec.Replicas { // Scaling not required. return false, nil } - _, err := dc.scaleRCAndRecordEvent(newRC, deployment.Spec.Replicas, deployment) + _, err := dc.scaleReplicaSetAndRecordEvent(newRS, deployment.Spec.Replicas, deployment) return true, err } -func (dc *DeploymentController) cleanupOldRcs(oldRCs []*api.ReplicationController, deployment extensions.Deployment) error { - diff := len(oldRCs) - *deployment.Spec.RevisionHistoryLimit +func (dc *DeploymentController) cleanupOldReplicaSets(oldRSs []*extensions.ReplicaSet, deployment extensions.Deployment) error { + diff := len(oldRSs) - *deployment.Spec.RevisionHistoryLimit if diff <= 0 { return nil } - sort.Sort(controller.ControllersByCreationTimestamp(oldRCs)) + sort.Sort(controller.ReplicaSetsByCreationTimestamp(oldRSs)) var errList []error // TODO: This should be parallelized. for i := 0; i < diff; i++ { - controller := oldRCs[i] - // Avoid delete rc with non-zero replica counts - if controller.Spec.Replicas != 0 || controller.Generation > controller.Status.ObservedGeneration { + rs := oldRSs[i] + // Avoid delete replica set with non-zero replica counts + if rs.Spec.Replicas != 0 || rs.Generation > rs.Status.ObservedGeneration { continue } - if err := dc.client.Legacy().ReplicationControllers(controller.Namespace).Delete(controller.Name, nil); err != nil && !errors.IsNotFound(err) { - glog.V(2).Infof("Failed deleting old rc %v for deployment %v: %v", controller.Name, deployment.Name, err) + if err := dc.client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, nil); err != nil && !errors.IsNotFound(err) { + glog.V(2).Infof("Failed deleting old replica set %v for deployment %v: %v", rs.Name, deployment.Name, err) errList = append(errList, err) } } @@ -903,8 +1039,8 @@ func (dc *DeploymentController) cleanupOldRcs(oldRCs []*api.ReplicationControlle return utilerrors.NewAggregate(errList) } -func (dc *DeploymentController) updateDeploymentStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) error { - totalReplicas, updatedReplicas, availableReplicas, unavailableReplicas, err := dc.calculateStatus(allRCs, newRC, deployment) +func (dc *DeploymentController) updateDeploymentStatus(allRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, deployment extensions.Deployment) error { + totalReplicas, updatedReplicas, availableReplicas, unavailableReplicas, err := dc.calculateStatus(allRSs, newRS, deployment) if err != nil { return err } @@ -920,14 +1056,11 @@ func (dc *DeploymentController) updateDeploymentStatus(allRCs []*api.Replication return err } -func (dc *DeploymentController) calculateStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) (totalReplicas, updatedReplicas, availableReplicas, unavailableReplicas int, err error) { - totalReplicas = deploymentutil.GetReplicaCountForRCs(allRCs) - updatedReplicas = deploymentutil.GetReplicaCountForRCs([]*api.ReplicationController{newRC}) - minReadySeconds := 0 - if deployment.Spec.Strategy.Type == extensions.RollingUpdateDeploymentStrategyType { - minReadySeconds = deployment.Spec.Strategy.RollingUpdate.MinReadySeconds - } - availableReplicas, err = deploymentutil.GetAvailablePodsForRCs(dc.client, allRCs, minReadySeconds) +func (dc *DeploymentController) calculateStatus(allRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, deployment extensions.Deployment) (totalReplicas, updatedReplicas, availableReplicas, unavailableReplicas int, err error) { + totalReplicas = deploymentutil.GetReplicaCountForReplicaSets(allRSs) + updatedReplicas = deploymentutil.GetReplicaCountForReplicaSets([]*extensions.ReplicaSet{newRS}) + minReadySeconds := deployment.Spec.MinReadySeconds + availableReplicas, err = deploymentutil.GetAvailablePodsForReplicaSets(dc.client, allRSs, minReadySeconds) if err != nil { err = fmt.Errorf("failed to count available pods: %v", err) return @@ -936,22 +1069,22 @@ func (dc *DeploymentController) calculateStatus(allRCs []*api.ReplicationControl return } -func (dc *DeploymentController) scaleRCAndRecordEvent(rc *api.ReplicationController, newScale int, deployment extensions.Deployment) (*api.ReplicationController, error) { +func (dc *DeploymentController) scaleReplicaSetAndRecordEvent(rs *extensions.ReplicaSet, newScale int, deployment extensions.Deployment) (*extensions.ReplicaSet, error) { scalingOperation := "down" - if rc.Spec.Replicas < newScale { + if rs.Spec.Replicas < newScale { scalingOperation = "up" } - newRC, err := dc.scaleRC(rc, newScale) + newRS, err := dc.scaleReplicaSet(rs, newScale) if err == nil { - dc.eventRecorder.Eventf(&deployment, api.EventTypeNormal, "ScalingRC", "Scaled %s rc %s to %d", scalingOperation, rc.Name, newScale) + dc.eventRecorder.Eventf(&deployment, api.EventTypeNormal, "ScalingReplicaSet", "Scaled %s replica set %s to %d", scalingOperation, rs.Name, newScale) } - return newRC, err + return newRS, err } -func (dc *DeploymentController) scaleRC(rc *api.ReplicationController, newScale int) (*api.ReplicationController, error) { +func (dc *DeploymentController) scaleReplicaSet(rs *extensions.ReplicaSet, newScale int) (*extensions.ReplicaSet, error) { // TODO: Using client for now, update to use store when it is ready. - rc.Spec.Replicas = newScale - return dc.client.Legacy().ReplicationControllers(rc.ObjectMeta.Namespace).Update(rc) + rs.Spec.Replicas = newScale + return dc.client.Extensions().ReplicaSets(rs.ObjectMeta.Namespace).Update(rs) } func (dc *DeploymentController) updateDeployment(deployment *extensions.Deployment) (*extensions.Deployment, error) { @@ -959,14 +1092,14 @@ func (dc *DeploymentController) updateDeployment(deployment *extensions.Deployme return dc.client.Extensions().Deployments(deployment.ObjectMeta.Namespace).Update(deployment) } -func (dc *DeploymentController) rollbackToTemplate(deployment *extensions.Deployment, rc *api.ReplicationController) (d *extensions.Deployment, performedRollback bool, err error) { - if !reflect.DeepEqual(deploymentutil.GetNewRCTemplate(*deployment), *rc.Spec.Template) { - glog.Infof("Rolling back deployment %s to template spec %+v", deployment.Name, rc.Spec.Template.Spec) - deploymentutil.SetFromRCTemplate(deployment, *rc.Spec.Template) +func (dc *DeploymentController) rollbackToTemplate(deployment *extensions.Deployment, rs *extensions.ReplicaSet) (d *extensions.Deployment, performedRollback bool, err error) { + if !reflect.DeepEqual(deploymentutil.GetNewReplicaSetTemplate(*deployment), *rs.Spec.Template) { + glog.Infof("Rolling back deployment %s to template spec %+v", deployment.Name, rs.Spec.Template.Spec) + deploymentutil.SetFromReplicaSetTemplate(deployment, *rs.Spec.Template) performedRollback = true } else { glog.V(4).Infof("Rolling back to a revision that contains the same template as current deployment %s, skipping rollback...", deployment.Name) - dc.emitRollbackWarningEvent(deployment, "DeploymentRollbackTemplateUnchanged", fmt.Sprintf("The rollback revision contains the same template as current deployment %q", deployment.Name)) + dc.emitRollbackWarningEvent(deployment, deploymentutil.RollbackTemplateUnchanged, fmt.Sprintf("The rollback revision contains the same template as current deployment %q", deployment.Name)) } d, err = dc.updateDeploymentAndClearRollbackTo(deployment) return diff --git a/pkg/controller/deployment/deployment_controller_test.go b/pkg/controller/deployment/deployment_controller_test.go index 2417618a0e3..9faf718d279 100644 --- a/pkg/controller/deployment/deployment_controller_test.go +++ b/pkg/controller/deployment/deployment_controller_test.go @@ -34,7 +34,7 @@ import ( "k8s.io/kubernetes/pkg/util/intstr" ) -func TestDeploymentController_reconcileNewRC(t *testing.T) { +func TestDeploymentController_reconcileNewReplicaSet(t *testing.T) { tests := []struct { deploymentReplicas int maxSurge intstr.IntOrString @@ -87,16 +87,16 @@ func TestDeploymentController_reconcileNewRC(t *testing.T) { for i, test := range tests { t.Logf("executing scenario %d", i) - newRc := rc("foo-v2", test.newReplicas, nil) - oldRc := rc("foo-v2", test.oldReplicas, nil) - allRcs := []*api.ReplicationController{newRc, oldRc} + newRS := rs("foo-v2", test.newReplicas, nil) + oldRS := rs("foo-v2", test.oldReplicas, nil) + allRSs := []*exp.ReplicaSet{newRS, oldRS} deployment := deployment("foo", test.deploymentReplicas, test.maxSurge, intstr.FromInt(0)) fake := fake.Clientset{} controller := &DeploymentController{ client: &fake, eventRecorder: &record.FakeRecorder{}, } - scaled, err := controller.reconcileNewRC(allRcs, newRc, deployment) + scaled, err := controller.reconcileNewReplicaSet(allRSs, newRS, deployment) if err != nil { t.Errorf("unexpected error: %v", err) continue @@ -115,14 +115,278 @@ func TestDeploymentController_reconcileNewRC(t *testing.T) { t.Errorf("expected 1 action during scale, got: %v", fake.Actions()) continue } - updated := fake.Actions()[0].(testclient.UpdateAction).GetObject().(*api.ReplicationController) + updated := fake.Actions()[0].(testclient.UpdateAction).GetObject().(*exp.ReplicaSet) if e, a := test.expectedNewReplicas, updated.Spec.Replicas; e != a { t.Errorf("expected update to %d replicas, got %d", e, a) } } } -func TestDeploymentController_reconcileOldRCs(t *testing.T) { +func TestDeploymentController_reconcileOldReplicaSets(t *testing.T) { + tests := []struct { + deploymentReplicas int + maxUnavailable intstr.IntOrString + oldReplicas int + newReplicas int + readyPodsFromOldRS int + readyPodsFromNewRS int + scaleExpected bool + expectedOldReplicas int + }{ + { + deploymentReplicas: 10, + maxUnavailable: intstr.FromInt(0), + oldReplicas: 10, + newReplicas: 0, + readyPodsFromOldRS: 10, + readyPodsFromNewRS: 0, + scaleExpected: false, + }, + { + deploymentReplicas: 10, + maxUnavailable: intstr.FromInt(2), + oldReplicas: 10, + newReplicas: 0, + readyPodsFromOldRS: 10, + readyPodsFromNewRS: 0, + scaleExpected: true, + expectedOldReplicas: 8, + }, + { // expect unhealthy replicas from old replica sets been cleaned up + deploymentReplicas: 10, + maxUnavailable: intstr.FromInt(2), + oldReplicas: 10, + newReplicas: 0, + readyPodsFromOldRS: 8, + readyPodsFromNewRS: 0, + scaleExpected: true, + expectedOldReplicas: 8, + }, + { // expect 1 unhealthy replica from old replica sets been cleaned up, and 1 ready pod been scaled down + deploymentReplicas: 10, + maxUnavailable: intstr.FromInt(2), + oldReplicas: 10, + newReplicas: 0, + readyPodsFromOldRS: 9, + readyPodsFromNewRS: 0, + scaleExpected: true, + expectedOldReplicas: 8, + }, + { // the unavailable pods from the newRS would not make us scale down old RSs in a further step + deploymentReplicas: 10, + maxUnavailable: intstr.FromInt(2), + oldReplicas: 8, + newReplicas: 2, + readyPodsFromOldRS: 8, + readyPodsFromNewRS: 0, + scaleExpected: false, + }, + } + for i, test := range tests { + t.Logf("executing scenario %d", i) + + newSelector := map[string]string{"foo": "new"} + oldSelector := map[string]string{"foo": "old"} + newRS := rs("foo-new", test.newReplicas, newSelector) + oldRS := rs("foo-old", test.oldReplicas, oldSelector) + oldRSs := []*exp.ReplicaSet{oldRS} + allRSs := []*exp.ReplicaSet{oldRS, newRS} + + deployment := deployment("foo", test.deploymentReplicas, intstr.FromInt(0), test.maxUnavailable) + fakeClientset := fake.Clientset{} + fakeClientset.AddReactor("list", "pods", func(action core.Action) (handled bool, ret runtime.Object, err error) { + switch action.(type) { + case core.ListAction: + podList := &api.PodList{} + for podIndex := 0; podIndex < test.readyPodsFromOldRS; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-oldReadyPod-%d", oldRS.Name, podIndex), + Labels: oldSelector, + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionTrue, + }, + }, + }, + }) + } + for podIndex := 0; podIndex < test.oldReplicas-test.readyPodsFromOldRS; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-oldUnhealthyPod-%d", oldRS.Name, podIndex), + Labels: oldSelector, + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionFalse, + }, + }, + }, + }) + } + for podIndex := 0; podIndex < test.readyPodsFromNewRS; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-newReadyPod-%d", oldRS.Name, podIndex), + Labels: newSelector, + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionTrue, + }, + }, + }, + }) + } + for podIndex := 0; podIndex < test.oldReplicas-test.readyPodsFromOldRS; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-newUnhealthyPod-%d", oldRS.Name, podIndex), + Labels: newSelector, + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionFalse, + }, + }, + }, + }) + } + return true, podList, nil + } + return false, nil, nil + }) + controller := &DeploymentController{ + client: &fakeClientset, + eventRecorder: &record.FakeRecorder{}, + } + + scaled, err := controller.reconcileOldReplicaSets(allRSs, oldRSs, newRS, deployment, false) + if err != nil { + t.Errorf("unexpected error: %v", err) + continue + } + if !test.scaleExpected && scaled { + t.Errorf("unexpected scaling: %v", fakeClientset.Actions()) + } + if test.scaleExpected && !scaled { + t.Errorf("expected scaling to occur") + continue + } + continue + } +} + +func TestDeploymentController_cleanupUnhealthyReplicas(t *testing.T) { + tests := []struct { + oldReplicas int + readyPods int + unHealthyPods int + maxCleanupCount int + cleanupCountExpected int + }{ + { + oldReplicas: 10, + readyPods: 8, + unHealthyPods: 2, + maxCleanupCount: 1, + cleanupCountExpected: 1, + }, + { + oldReplicas: 10, + readyPods: 8, + unHealthyPods: 2, + maxCleanupCount: 3, + cleanupCountExpected: 2, + }, + { + oldReplicas: 10, + readyPods: 8, + unHealthyPods: 2, + maxCleanupCount: 0, + cleanupCountExpected: 0, + }, + { + oldReplicas: 10, + readyPods: 10, + unHealthyPods: 0, + maxCleanupCount: 3, + cleanupCountExpected: 0, + }, + } + + for i, test := range tests { + t.Logf("executing scenario %d", i) + oldRS := rs("foo-v2", test.oldReplicas, nil) + oldRSs := []*exp.ReplicaSet{oldRS} + deployment := deployment("foo", 10, intstr.FromInt(2), intstr.FromInt(2)) + fakeClientset := fake.Clientset{} + fakeClientset.AddReactor("list", "pods", func(action core.Action) (handled bool, ret runtime.Object, err error) { + switch action.(type) { + case core.ListAction: + podList := &api.PodList{} + for podIndex := 0; podIndex < test.readyPods; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-readyPod-%d", oldRS.Name, podIndex), + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionTrue, + }, + }, + }, + }) + } + for podIndex := 0; podIndex < test.unHealthyPods; podIndex++ { + podList.Items = append(podList.Items, api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: fmt.Sprintf("%s-unHealthyPod-%d", oldRS.Name, podIndex), + }, + Status: api.PodStatus{ + Conditions: []api.PodCondition{ + { + Type: api.PodReady, + Status: api.ConditionFalse, + }, + }, + }, + }) + } + return true, podList, nil + } + return false, nil, nil + }) + + controller := &DeploymentController{ + client: &fakeClientset, + eventRecorder: &record.FakeRecorder{}, + } + cleanupCount, err := controller.cleanupUnhealthyReplicas(oldRSs, deployment, test.maxCleanupCount) + if err != nil { + t.Errorf("unexpected error: %v", err) + continue + } + if cleanupCount != test.cleanupCountExpected { + t.Errorf("expected %v unhealthy replicas been cleaned up, got %v", test.cleanupCountExpected, cleanupCount) + continue + } + } +} + +func TestDeploymentController_scaleDownOldReplicaSetsForRollingUpdate(t *testing.T) { tests := []struct { deploymentReplicas int maxUnavailable intstr.IntOrString @@ -164,9 +428,9 @@ func TestDeploymentController_reconcileOldRCs(t *testing.T) { for i, test := range tests { t.Logf("executing scenario %d", i) - oldRc := rc("foo-v2", test.oldReplicas, nil) - allRcs := []*api.ReplicationController{oldRc} - oldRcs := []*api.ReplicationController{oldRc} + oldRS := rs("foo-v2", test.oldReplicas, nil) + allRSs := []*exp.ReplicaSet{oldRS} + oldRSs := []*exp.ReplicaSet{oldRS} deployment := deployment("foo", test.deploymentReplicas, intstr.FromInt(0), test.maxUnavailable) fakeClientset := fake.Clientset{} fakeClientset.AddReactor("list", "pods", func(action core.Action) (handled bool, ret runtime.Object, err error) { @@ -176,7 +440,8 @@ func TestDeploymentController_reconcileOldRCs(t *testing.T) { for podIndex := 0; podIndex < test.readyPods; podIndex++ { podList.Items = append(podList.Items, api.Pod{ ObjectMeta: api.ObjectMeta{ - Name: fmt.Sprintf("%s-pod-%d", oldRc.Name, podIndex), + Name: fmt.Sprintf("%s-pod-%d", oldRS.Name, podIndex), + Labels: map[string]string{"foo": "bar"}, }, Status: api.PodStatus{ Conditions: []api.PodCondition{ @@ -196,18 +461,18 @@ func TestDeploymentController_reconcileOldRCs(t *testing.T) { client: &fakeClientset, eventRecorder: &record.FakeRecorder{}, } - scaled, err := controller.reconcileOldRCs(allRcs, oldRcs, nil, deployment, false) + scaled, err := controller.scaleDownOldReplicaSetsForRollingUpdate(allRSs, oldRSs, deployment) if err != nil { t.Errorf("unexpected error: %v", err) continue } if !test.scaleExpected { - if scaled { + if scaled != 0 { t.Errorf("unexpected scaling: %v", fakeClientset.Actions()) } continue } - if test.scaleExpected && !scaled { + if test.scaleExpected && scaled == 0 { t.Errorf("expected scaling to occur; actions: %v", fakeClientset.Actions()) continue } @@ -228,42 +493,42 @@ func TestDeploymentController_reconcileOldRCs(t *testing.T) { t.Errorf("expected an update action") continue } - updated := updateAction.GetObject().(*api.ReplicationController) + updated := updateAction.GetObject().(*exp.ReplicaSet) if e, a := test.expectedOldReplicas, updated.Spec.Replicas; e != a { t.Errorf("expected update to %d replicas, got %d", e, a) } } } -func TestDeploymentController_cleanupOldRCs(t *testing.T) { +func TestDeploymentController_cleanupOldReplicaSets(t *testing.T) { selector := map[string]string{"foo": "bar"} tests := []struct { - oldRCs []*api.ReplicationController + oldRSs []*exp.ReplicaSet revisionHistoryLimit int expectedDeletions int }{ { - oldRCs: []*api.ReplicationController{ - rc("foo-1", 0, selector), - rc("foo-2", 0, selector), - rc("foo-3", 0, selector), + oldRSs: []*exp.ReplicaSet{ + rs("foo-1", 0, selector), + rs("foo-2", 0, selector), + rs("foo-3", 0, selector), }, revisionHistoryLimit: 1, expectedDeletions: 2, }, { - oldRCs: []*api.ReplicationController{ - rc("foo-1", 0, selector), - rc("foo-2", 0, selector), + oldRSs: []*exp.ReplicaSet{ + rs("foo-1", 0, selector), + rs("foo-2", 0, selector), }, revisionHistoryLimit: 0, expectedDeletions: 2, }, { - oldRCs: []*api.ReplicationController{ - rc("foo-1", 1, selector), - rc("foo-2", 1, selector), + oldRSs: []*exp.ReplicaSet{ + rs("foo-1", 1, selector), + rs("foo-2", 1, selector), }, revisionHistoryLimit: 0, expectedDeletions: 0, @@ -275,14 +540,14 @@ func TestDeploymentController_cleanupOldRCs(t *testing.T) { controller := NewDeploymentController(fake, controller.NoResyncPeriodFunc) controller.eventRecorder = &record.FakeRecorder{} - controller.rcStoreSynced = alwaysReady + controller.rsStoreSynced = alwaysReady controller.podStoreSynced = alwaysReady - for _, rc := range test.oldRCs { - controller.rcStore.Add(rc) + for _, rs := range test.oldRSs { + controller.rsStore.Add(rs) } d := newDeployment(1, &tests[i].revisionHistoryLimit) - controller.cleanupOldRcs(test.oldRCs, *d) + controller.cleanupOldReplicaSets(test.oldRSs, *d) gotDeletions := 0 for _, action := range fake.Actions() { @@ -291,20 +556,20 @@ func TestDeploymentController_cleanupOldRCs(t *testing.T) { } } if gotDeletions != test.expectedDeletions { - t.Errorf("expect %v old rcs been deleted, but got %v", test.expectedDeletions, gotDeletions) + t.Errorf("expect %v old replica sets been deleted, but got %v", test.expectedDeletions, gotDeletions) continue } } } -func rc(name string, replicas int, selector map[string]string) *api.ReplicationController { - return &api.ReplicationController{ +func rs(name string, replicas int, selector map[string]string) *exp.ReplicaSet { + return &exp.ReplicaSet{ ObjectMeta: api.ObjectMeta{ Name: name, }, - Spec: api.ReplicationControllerSpec{ + Spec: exp.ReplicaSetSpec{ Replicas: replicas, - Selector: selector, + Selector: &unversioned.LabelSelector{MatchLabels: selector}, Template: &api.PodTemplateSpec{}, }, } @@ -345,7 +610,7 @@ func newDeployment(replicas int, revisionHistoryLimit *int) *exp.Deployment { RollingUpdate: &exp.RollingUpdateDeployment{}, }, Replicas: replicas, - Selector: map[string]string{"foo": "bar"}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{ @@ -376,13 +641,13 @@ func getKey(d *exp.Deployment, t *testing.T) string { } } -func newReplicationController(d *exp.Deployment, name string, replicas int) *api.ReplicationController { - return &api.ReplicationController{ +func newReplicaSet(d *exp.Deployment, name string, replicas int) *exp.ReplicaSet { + return &exp.ReplicaSet{ ObjectMeta: api.ObjectMeta{ Name: name, Namespace: api.NamespaceDefault, }, - Spec: api.ReplicationControllerSpec{ + Spec: exp.ReplicaSetSpec{ Replicas: replicas, Template: &d.Spec.Template, }, @@ -400,7 +665,7 @@ type fixture struct { client *fake.Clientset // Objects to put in the store. dStore []*exp.Deployment - rcStore []*api.ReplicationController + rsStore []*exp.ReplicaSet podStore []*api.Pod // Actions expected to happen on the client. Objects from here are also @@ -414,14 +679,14 @@ func (f *fixture) expectUpdateDeploymentAction(d *exp.Deployment) { f.objects.Items = append(f.objects.Items, d) } -func (f *fixture) expectCreateRCAction(rc *api.ReplicationController) { - f.actions = append(f.actions, core.NewCreateAction("replicationcontrollers", rc.Namespace, rc)) - f.objects.Items = append(f.objects.Items, rc) +func (f *fixture) expectCreateRSAction(rs *exp.ReplicaSet) { + f.actions = append(f.actions, core.NewCreateAction("replicasets", rs.Namespace, rs)) + f.objects.Items = append(f.objects.Items, rs) } -func (f *fixture) expectUpdateRCAction(rc *api.ReplicationController) { - f.actions = append(f.actions, core.NewUpdateAction("replicationcontrollers", rc.Namespace, rc)) - f.objects.Items = append(f.objects.Items, rc) +func (f *fixture) expectUpdateRSAction(rs *exp.ReplicaSet) { + f.actions = append(f.actions, core.NewUpdateAction("replicasets", rs.Namespace, rs)) + f.objects.Items = append(f.objects.Items, rs) } func (f *fixture) expectListPodAction(namespace string, opt api.ListOptions) { @@ -439,13 +704,13 @@ func (f *fixture) run(deploymentName string) { f.client = fake.NewSimpleClientset(f.objects) c := NewDeploymentController(f.client, controller.NoResyncPeriodFunc) c.eventRecorder = &record.FakeRecorder{} - c.rcStoreSynced = alwaysReady + c.rsStoreSynced = alwaysReady c.podStoreSynced = alwaysReady for _, d := range f.dStore { c.dStore.Store.Add(d) } - for _, rc := range f.rcStore { - c.rcStore.Store.Add(rc) + for _, rs := range f.rsStore { + c.rsStore.Store.Add(rs) } for _, pod := range f.podStore { c.podStore.Store.Add(pod) @@ -475,22 +740,22 @@ func (f *fixture) run(deploymentName string) { } } -func TestSyncDeploymentCreatesRC(t *testing.T) { +func TestSyncDeploymentCreatesReplicaSet(t *testing.T) { f := newFixture(t) d := newDeployment(1, nil) f.dStore = append(f.dStore, d) - // expect that one rc with zero replicas is created + // expect that one ReplicaSet with zero replicas is created // then is updated to 1 replica - rc := newReplicationController(d, "deploymentrc-4186632231", 0) - updatedRC := newReplicationController(d, "deploymentrc-4186632231", 1) + rs := newReplicaSet(d, "deploymentrs-4186632231", 0) + updatedRS := newReplicaSet(d, "deploymentrs-4186632231", 1) opt := newListOptions() - f.expectCreateRCAction(rc) + f.expectCreateRSAction(rs) f.expectUpdateDeploymentAction(d) - f.expectUpdateRCAction(updatedRC) - f.expectListPodAction(rc.Namespace, opt) + f.expectUpdateRSAction(updatedRS) + f.expectListPodAction(rs.Namespace, opt) f.expectUpdateDeploymentAction(d) f.run(getKey(d, t)) diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index 5e2bda0169e..a8d327eb745 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -27,14 +27,14 @@ import ( "k8s.io/kubernetes/pkg/api/errors" podutil "k8s.io/kubernetes/pkg/api/pod" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" @@ -53,7 +53,7 @@ var ( ) // NewEndpointController returns a new *EndpointController. -func NewEndpointController(client *client.Client, resyncPeriod controller.ResyncPeriodFunc) *EndpointController { +func NewEndpointController(client *clientset.Clientset, resyncPeriod controller.ResyncPeriodFunc) *EndpointController { e := &EndpointController{ client: client, queue: workqueue.New(), @@ -62,10 +62,10 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync e.serviceStore.Store, e.serviceController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return e.client.Services(api.NamespaceAll).List(options) + return e.client.Core().Services(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return e.client.Services(api.NamespaceAll).Watch(options) + return e.client.Core().Services(api.NamespaceAll).Watch(options) }, }, &api.Service{}, @@ -83,10 +83,10 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync e.podStore.Store, e.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return e.client.Pods(api.NamespaceAll).List(options) + return e.client.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return e.client.Pods(api.NamespaceAll).Watch(options) + return e.client.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -103,7 +103,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync // EndpointController manages selector-based service endpoints. type EndpointController struct { - client *client.Client + client *clientset.Clientset serviceStore cache.StoreToServiceLister podStore cache.StoreToPodLister @@ -128,7 +128,7 @@ func (e *EndpointController) Run(workers int, stopCh <-chan struct{}) { go e.serviceController.Run(stopCh) go e.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(e.worker, time.Second, stopCh) + go wait.Until(e.worker, time.Second, stopCh) } go func() { defer utilruntime.HandleCrash() @@ -268,7 +268,7 @@ func (e *EndpointController) syncService(key string) { // Don't retry, as the key isn't going to magically become understandable. return } - err = e.client.Endpoints(namespace).Delete(name) + err = e.client.Endpoints(namespace).Delete(name, nil) if err != nil && !errors.IsNotFound(err) { glog.Errorf("Error deleting endpoint %q: %v", key, err) e.queue.Add(key) // Retry diff --git a/pkg/controller/endpoint/endpoints_controller_test.go b/pkg/controller/endpoint/endpoints_controller_test.go index 2e23a8060b4..da8fc6cd5ca 100644 --- a/pkg/controller/endpoint/endpoints_controller_test.go +++ b/pkg/controller/endpoint/endpoints_controller_test.go @@ -28,6 +28,7 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" _ "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/runtime" @@ -104,7 +105,7 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) endpoints.serviceStore.Store.Add(&api.Service{ ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: ns}, @@ -137,7 +138,7 @@ func TestCheckLeftoverEndpoints(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) endpoints.checkLeftoverEndpoints() @@ -166,7 +167,7 @@ func TestSyncEndpointsProtocolTCP(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 0) endpoints.serviceStore.Store.Add(&api.Service{ @@ -208,7 +209,7 @@ func TestSyncEndpointsProtocolUDP(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 0) endpoints.serviceStore.Store.Add(&api.Service{ @@ -247,7 +248,7 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAll(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 0) endpoints.serviceStore.Store.Add(&api.Service{ @@ -285,7 +286,7 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAllNotReady(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 0, 1, 1) endpoints.serviceStore.Store.Add(&api.Service{ @@ -323,7 +324,7 @@ func TestSyncEndpointsItemsEmptySelectorSelectsAllMixed(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 1) endpoints.serviceStore.Store.Add(&api.Service{ @@ -365,7 +366,7 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 0) endpoints.serviceStore.Store.Add(&api.Service{ @@ -406,7 +407,7 @@ func TestSyncEndpointsItemsPreexistingIdentical(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, api.NamespaceDefault, 1, 1, 0) endpoints.serviceStore.Store.Add(&api.Service{ @@ -426,7 +427,7 @@ func TestSyncEndpointsItems(t *testing.T) { serverResponse{http.StatusOK, &api.Endpoints{}}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 3, 2, 0) addPods(endpoints.podStore.Store, "blah", 5, 2, 0) // make sure these aren't found! @@ -469,7 +470,7 @@ func TestSyncEndpointsItemsWithLabels(t *testing.T) { serverResponse{http.StatusOK, &api.Endpoints{}}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 3, 2, 0) serviceLabels := map[string]string{"foo": "bar"} @@ -530,7 +531,7 @@ func TestSyncEndpointsItemsPreexistingLabelsChange(t *testing.T) { }}) // TODO: Uncomment when fix #19254 // defer testServer.Close() - client := client.NewOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + client := clientset.NewForConfigOrDie(&client.Config{Host: testServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) endpoints := NewEndpointController(client, controller.NoResyncPeriodFunc) addPods(endpoints.podStore.Store, ns, 1, 1, 0) serviceLabels := map[string]string{"baz": "blah"} diff --git a/pkg/controller/framework/controller.go b/pkg/controller/framework/controller.go index 59c9693e689..ed819525266 100644 --- a/pkg/controller/framework/controller.go +++ b/pkg/controller/framework/controller.go @@ -22,8 +22,8 @@ import ( "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" ) // Config contains all the settings for a Controller. @@ -94,17 +94,12 @@ func (c *Controller) Run(stopCh <-chan struct{}) { r.RunUntil(stopCh) - util.Until(c.processLoop, time.Second, stopCh) + wait.Until(c.processLoop, time.Second, stopCh) } // Returns true once this controller has completed an initial resource listing func (c *Controller) HasSynced() bool { - c.reflectorMutex.RLock() - defer c.reflectorMutex.RUnlock() - if c.reflector == nil { - return false - } - return c.reflector.LastSyncResourceVersion() != "" + return c.config.Queue.HasSynced() } // Requeue adds the provided object back into the queue if it does not already exist. diff --git a/pkg/controller/gc/gc_controller.go b/pkg/controller/gc/gc_controller.go index b7ff87aeddb..bf09ae928b2 100644 --- a/pkg/controller/gc/gc_controller.go +++ b/pkg/controller/gc/gc_controller.go @@ -23,14 +23,14 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" "github.com/golang/glog" @@ -41,19 +41,19 @@ const ( ) type GCController struct { - kubeClient client.Interface + kubeClient clientset.Interface podStore cache.StoreToPodLister podStoreSyncer *framework.Controller deletePod func(namespace, name string) error threshold int } -func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc, threshold int) *GCController { +func New(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, threshold int) *GCController { gcc := &GCController{ kubeClient: kubeClient, threshold: threshold, deletePod: func(namespace, name string) error { - return kubeClient.Pods(namespace).Delete(name, api.NewDeleteOptions(0)) + return kubeClient.Core().Pods(namespace).Delete(name, api.NewDeleteOptions(0)) }, } @@ -63,11 +63,11 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc, &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = terminatedSelector - return gcc.kubeClient.Pods(api.NamespaceAll).List(options) + return gcc.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = terminatedSelector - return gcc.kubeClient.Pods(api.NamespaceAll).Watch(options) + return gcc.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -79,7 +79,7 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc, func (gcc *GCController) Run(stop <-chan struct{}) { go gcc.podStoreSyncer.Run(stop) - go util.Until(gcc.gc, gcCheckPeriod, stop) + go wait.Until(gcc.gc, gcCheckPeriod, stop) <-stop } diff --git a/pkg/controller/gc/gc_controller_test.go b/pkg/controller/gc/gc_controller_test.go index 037a6c892b2..1e42e07bf84 100644 --- a/pkg/controller/gc/gc_controller_test.go +++ b/pkg/controller/gc/gc_controller_test.go @@ -23,7 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/util/sets" ) @@ -66,7 +66,7 @@ func TestGC(t *testing.T) { } for i, test := range testCases { - client := testclient.NewSimpleFake() + client := fake.NewSimpleClientset() gcc := New(client, controller.NoResyncPeriodFunc, test.threshold) deletedPodNames := make([]string, 0) var lock sync.Mutex diff --git a/pkg/controller/job/controller.go b/pkg/controller/job/controller.go index 9ed5037cb77..5acb0685f26 100644 --- a/pkg/controller/job/controller.go +++ b/pkg/controller/job/controller.go @@ -27,15 +27,15 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" replicationcontroller "k8s.io/kubernetes/pkg/controller/replication" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" ) @@ -74,7 +74,7 @@ func NewJobController(kubeClient clientset.Interface, resyncPeriod controller.Re eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) // TODO: remove the wrapper when every clients have moved to use the clientset. - eventBroadcaster.StartRecordingToSink(&unversioned_legacy.EventSinkImpl{kubeClient.Legacy().Events("")}) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) jm := &JobController{ kubeClient: kubeClient, @@ -113,10 +113,10 @@ func NewJobController(kubeClient clientset.Interface, resyncPeriod controller.Re jm.podStore.Store, jm.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return jm.kubeClient.Legacy().Pods(api.NamespaceAll).List(options) + return jm.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return jm.kubeClient.Legacy().Pods(api.NamespaceAll).Watch(options) + return jm.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -140,7 +140,7 @@ func (jm *JobController) Run(workers int, stopCh <-chan struct{}) { go jm.jobController.Run(stopCh) go jm.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(jm.worker, time.Second, stopCh) + go wait.Until(jm.worker, time.Second, stopCh) } <-stopCh glog.Infof("Shutting down Job Manager") @@ -317,7 +317,7 @@ func (jm *JobController) syncJob(key string) error { return err } jobNeedsSync := jm.expectations.SatisfiedExpectations(jobKey) - selector, _ := extensions.LabelSelectorAsSelector(job.Spec.Selector) + selector, _ := unversioned.LabelSelectorAsSelector(job.Spec.Selector) podList, err := jm.podStore.Pods(job.Namespace).List(selector) if err != nil { glog.Errorf("Error getting pods for job %q: %v", key, err) diff --git a/pkg/controller/job/controller_test.go b/pkg/controller/job/controller_test.go index 477797a711a..c8838ead320 100644 --- a/pkg/controller/job/controller_test.go +++ b/pkg/controller/job/controller_test.go @@ -25,14 +25,14 @@ import ( "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/core" "k8s.io/kubernetes/pkg/client/testing/fake" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/controller" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/rand" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -45,7 +45,7 @@ func newJob(parallelism, completions int) *extensions.Job { Namespace: api.NamespaceDefault, }, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, Template: api.PodTemplateSpec{ @@ -496,7 +496,7 @@ func TestJobPodLookup(t *testing.T) { job: &extensions.Job{ ObjectMeta: api.ObjectMeta{Name: "foo"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar"}, }, }, @@ -515,11 +515,11 @@ func TestJobPodLookup(t *testing.T) { job: &extensions.Job{ ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ - MatchExpressions: []extensions.LabelSelectorRequirement{ + Selector: &unversioned.LabelSelector{ + MatchExpressions: []unversioned.LabelSelectorRequirement{ { Key: "foo", - Operator: extensions.LabelSelectorOpIn, + Operator: unversioned.LabelSelectorOpIn, Values: []string{"bar"}, }, }, @@ -626,7 +626,7 @@ func TestWatchJobs(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.jobController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) // We're sending new job to see if it reaches syncHandler. testJob.Name = "foo" @@ -691,7 +691,7 @@ func TestWatchPods(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.podController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) pods := newPodList(1, api.PodRunning, testJob) testPod := pods[0] diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index c7ad7c58249..1d35fc9ffa1 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -17,18 +17,18 @@ limitations under the License. package namespace import ( - "fmt" "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/runtime" utilruntime "k8s.io/kubernetes/pkg/util/runtime" - "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" + "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" "github.com/golang/glog" @@ -36,527 +36,120 @@ import ( // NamespaceController is responsible for performing actions dependent upon a namespace phase type NamespaceController struct { - controller *framework.Controller - StopEverything chan struct{} + // client that purges namespace content, must have list/delete privileges on all content + kubeClient clientset.Interface + // store that holds the namespaces + store cache.Store + // controller that observes the namespaces + controller *framework.Controller + // namespaces that have been queued up for processing by workers + queue *workqueue.Type + // list of versions to process + versions *unversioned.APIVersions } // NewNamespaceController creates a new NamespaceController -func NewNamespaceController(kubeClient client.Interface, versions *unversioned.APIVersions, resyncPeriod time.Duration) *NamespaceController { - var controller *framework.Controller - _, controller = framework.NewInformer( +func NewNamespaceController(kubeClient clientset.Interface, versions *unversioned.APIVersions, resyncPeriod time.Duration) *NamespaceController { + // create the controller so we can inject the enqueue function + namespaceController := &NamespaceController{ + kubeClient: kubeClient, + versions: versions, + queue: workqueue.New(), + } + + // configure the backing store/controller + store, controller := framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return kubeClient.Namespaces().List(options) + return kubeClient.Core().Namespaces().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return kubeClient.Namespaces().Watch(options) + return kubeClient.Core().Namespaces().Watch(options) }, }, &api.Namespace{}, - // TODO: Can we have much longer period here? resyncPeriod, framework.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { namespace := obj.(*api.Namespace) - if err := syncNamespace(kubeClient, versions, namespace); err != nil { - if estimate, ok := err.(*contentRemainingError); ok { - go func() { - // Estimate is the aggregate total of TerminationGracePeriodSeconds, which defaults to 30s - // for pods. However, most processes will terminate faster - within a few seconds, probably - // with a peak within 5-10s. So this division is a heuristic that avoids waiting the full - // duration when in many cases things complete more quickly. The extra second added is to - // ensure we never wait 0 seconds. - t := estimate.Estimate/2 + 1 - glog.V(4).Infof("Content remaining in namespace %s, waiting %d seconds", namespace.Name, t) - time.Sleep(time.Duration(t) * time.Second) - if err := controller.Requeue(namespace); err != nil { - utilruntime.HandleError(err) - } - }() - return - } - utilruntime.HandleError(err) - } + namespaceController.enqueueNamespace(namespace) }, UpdateFunc: func(oldObj, newObj interface{}) { namespace := newObj.(*api.Namespace) - if err := syncNamespace(kubeClient, versions, namespace); err != nil { - if estimate, ok := err.(*contentRemainingError); ok { - go func() { - t := estimate.Estimate/2 + 1 - glog.V(4).Infof("Content remaining in namespace %s, waiting %d seconds", namespace.Name, t) - time.Sleep(time.Duration(t) * time.Second) - if err := controller.Requeue(namespace); err != nil { - utilruntime.HandleError(err) - } - }() - return - } - utilruntime.HandleError(err) - } + namespaceController.enqueueNamespace(namespace) }, }, ) - return &NamespaceController{ - controller: controller, - } + namespaceController.store = store + namespaceController.controller = controller + return namespaceController } -// Run begins observing the system. It starts a goroutine and returns immediately. -func (nm *NamespaceController) Run() { - if nm.StopEverything == nil { - nm.StopEverything = make(chan struct{}) - go nm.controller.Run(nm.StopEverything) +// enqueueNamespace adds an object to the controller work queue +// obj could be an *api.Namespace, or a DeletionFinalStateUnknown item. +func (nm *NamespaceController) enqueueNamespace(obj interface{}) { + key, err := controller.KeyFunc(obj) + if err != nil { + glog.Errorf("Couldn't get key for object %+v: %v", obj, err) + return } + nm.queue.Add(key) } -// Stop gracefully shutsdown this controller -func (nm *NamespaceController) Stop() { - if nm.StopEverything != nil { - close(nm.StopEverything) - nm.StopEverything = nil - } -} - -// finalized returns true if the spec.finalizers is empty list -func finalized(namespace *api.Namespace) bool { - return len(namespace.Spec.Finalizers) == 0 -} - -// finalize will finalize the namespace for kubernetes -func finalizeNamespaceFunc(kubeClient client.Interface, namespace *api.Namespace) (*api.Namespace, error) { - namespaceFinalize := api.Namespace{} - namespaceFinalize.ObjectMeta = namespace.ObjectMeta - namespaceFinalize.Spec = namespace.Spec - finalizerSet := sets.NewString() - for i := range namespace.Spec.Finalizers { - if namespace.Spec.Finalizers[i] != api.FinalizerKubernetes { - finalizerSet.Insert(string(namespace.Spec.Finalizers[i])) - } - } - namespaceFinalize.Spec.Finalizers = make([]api.FinalizerName, 0, len(finalizerSet)) - for _, value := range finalizerSet.List() { - namespaceFinalize.Spec.Finalizers = append(namespaceFinalize.Spec.Finalizers, api.FinalizerName(value)) - } - namespace, err := kubeClient.Namespaces().Finalize(&namespaceFinalize) - if err != nil { - // it was removed already, so life is good - if errors.IsNotFound(err) { - return namespace, nil - } - } - return namespace, err -} - -type contentRemainingError struct { - Estimate int64 -} - -func (e *contentRemainingError) Error() string { - return fmt.Sprintf("some content remains in the namespace, estimate %d seconds before it is removed", e.Estimate) -} - -// deleteAllContent will delete all content known to the system in a namespace. It returns an estimate -// of the time remaining before the remaining resources are deleted. If estimate > 0 not all resources -// are guaranteed to be gone. -func deleteAllContent(kubeClient client.Interface, versions *unversioned.APIVersions, namespace string, before unversioned.Time) (estimate int64, err error) { - err = deleteServiceAccounts(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deleteServices(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deleteReplicationControllers(kubeClient, namespace) - if err != nil { - return estimate, err - } - estimate, err = deletePods(kubeClient, namespace, before) - if err != nil { - return estimate, err - } - err = deleteSecrets(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deletePersistentVolumeClaims(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deleteLimitRanges(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deleteResourceQuotas(kubeClient, namespace) - if err != nil { - return estimate, err - } - err = deleteEvents(kubeClient, namespace) - if err != nil { - return estimate, err - } - // If experimental mode, delete all experimental resources for the namespace. - if containsVersion(versions, "extensions/v1beta1") { - resources, err := kubeClient.Discovery().ServerResourcesForGroupVersion("extensions/v1beta1") - if err != nil { - return estimate, err - } - if containsResource(resources, "horizontalpodautoscalers") { - err = deleteHorizontalPodAutoscalers(kubeClient.Extensions(), namespace) - if err != nil { - return estimate, err - } - } - if containsResource(resources, "ingresses") { - err = deleteIngress(kubeClient.Extensions(), namespace) - if err != nil { - return estimate, err - } - } - if containsResource(resources, "daemonsets") { - err = deleteDaemonSets(kubeClient.Extensions(), namespace) - if err != nil { - return estimate, err - } - } - if containsResource(resources, "jobs") { - err = deleteJobs(kubeClient.Extensions(), namespace) - if err != nil { - return estimate, err - } - } - if containsResource(resources, "deployments") { - err = deleteDeployments(kubeClient.Extensions(), namespace) - if err != nil { - return estimate, err - } - } - } - return estimate, nil -} - -// updateNamespaceFunc is a function that makes an update to a namespace -type updateNamespaceFunc func(kubeClient client.Interface, namespace *api.Namespace) (*api.Namespace, error) - -// retryOnConflictError retries the specified fn if there was a conflict error -// TODO RetryOnConflict should be a generic concept in client code -func retryOnConflictError(kubeClient client.Interface, namespace *api.Namespace, fn updateNamespaceFunc) (result *api.Namespace, err error) { - latestNamespace := namespace +// worker processes the queue of namespace objects. +// Each namespace can be in the queue at most once. +// The system ensures that no two workers can process +// the same namespace at the same time. +func (nm *NamespaceController) worker() { for { - result, err = fn(kubeClient, latestNamespace) - if err == nil { - return result, nil - } - if !errors.IsConflict(err) { - return nil, err - } - latestNamespace, err = kubeClient.Namespaces().Get(latestNamespace.Name) - if err != nil { - return nil, err - } - } - return -} - -// updateNamespaceStatusFunc will verify that the status of the namespace is correct -func updateNamespaceStatusFunc(kubeClient client.Interface, namespace *api.Namespace) (*api.Namespace, error) { - if namespace.DeletionTimestamp.IsZero() || namespace.Status.Phase == api.NamespaceTerminating { - return namespace, nil - } - newNamespace := api.Namespace{} - newNamespace.ObjectMeta = namespace.ObjectMeta - newNamespace.Status = namespace.Status - newNamespace.Status.Phase = api.NamespaceTerminating - return kubeClient.Namespaces().Status(&newNamespace) -} - -// syncNamespace orchestrates deletion of a Namespace and its associated content. -func syncNamespace(kubeClient client.Interface, versions *unversioned.APIVersions, namespace *api.Namespace) error { - if namespace.DeletionTimestamp == nil { - return nil - } - - // multiple controllers may edit a namespace during termination - // first get the latest state of the namespace before proceeding - // if the namespace was deleted already, don't do anything - namespace, err := kubeClient.Namespaces().Get(namespace.Name) - if err != nil { - if errors.IsNotFound(err) { - return nil - } - return err - } - - glog.V(4).Infof("Syncing namespace %s", namespace.Name) - - // ensure that the status is up to date on the namespace - // if we get a not found error, we assume the namespace is truly gone - namespace, err = retryOnConflictError(kubeClient, namespace, updateNamespaceStatusFunc) - if err != nil { - if errors.IsNotFound(err) { - return nil - } - return err - } - - // if the namespace is already finalized, delete it - if finalized(namespace) { - err = kubeClient.Namespaces().Delete(namespace.Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - return nil - } - - // there may still be content for us to remove - estimate, err := deleteAllContent(kubeClient, versions, namespace.Name, *namespace.DeletionTimestamp) - if err != nil { - return err - } - if estimate > 0 { - return &contentRemainingError{estimate} - } - - // we have removed content, so mark it finalized by us - result, err := retryOnConflictError(kubeClient, namespace, finalizeNamespaceFunc) - if err != nil { - return err - } - - // now check if all finalizers have reported that we delete now - if finalized(result) { - err = kubeClient.Namespaces().Delete(namespace.Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - - return nil -} - -func deleteLimitRanges(kubeClient client.Interface, ns string) error { - items, err := kubeClient.LimitRanges(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := kubeClient.LimitRanges(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteResourceQuotas(kubeClient client.Interface, ns string) error { - resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range resourceQuotas.Items { - err := kubeClient.ResourceQuotas(ns).Delete(resourceQuotas.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteServiceAccounts(kubeClient client.Interface, ns string) error { - items, err := kubeClient.ServiceAccounts(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := kubeClient.ServiceAccounts(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteServices(kubeClient client.Interface, ns string) error { - items, err := kubeClient.Services(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := kubeClient.Services(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteReplicationControllers(kubeClient client.Interface, ns string) error { - items, err := kubeClient.ReplicationControllers(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := kubeClient.ReplicationControllers(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deletePods(kubeClient client.Interface, ns string, before unversioned.Time) (int64, error) { - items, err := kubeClient.Pods(ns).List(api.ListOptions{}) - if err != nil { - return 0, err - } - expired := unversioned.Now().After(before.Time) - var deleteOptions *api.DeleteOptions - if expired { - deleteOptions = api.NewDeleteOptions(0) - } - estimate := int64(0) - for i := range items.Items { - if items.Items[i].Spec.TerminationGracePeriodSeconds != nil { - grace := *items.Items[i].Spec.TerminationGracePeriodSeconds - if grace > estimate { - estimate = grace + func() { + key, quit := nm.queue.Get() + if quit { + return } - } - err := kubeClient.Pods(ns).Delete(items.Items[i].Name, deleteOptions) - if err != nil && !errors.IsNotFound(err) { - return 0, err - } + defer nm.queue.Done(key) + if err := nm.syncNamespaceFromKey(key.(string)); err != nil { + if estimate, ok := err.(*contentRemainingError); ok { + go func() { + t := estimate.Estimate/2 + 1 + glog.V(4).Infof("Content remaining in namespace %s, waiting %d seconds", key, t) + time.Sleep(time.Duration(t) * time.Second) + nm.queue.Add(key) + }() + } + } + }() } - if expired { - estimate = 0 - } - return estimate, nil } -func deleteEvents(kubeClient client.Interface, ns string) error { - return kubeClient.Events(ns).DeleteCollection(nil, api.ListOptions{}) -} +// syncNamespaceFromKey looks for a namespace with the specified key in its store and synchronizes it +func (nm *NamespaceController) syncNamespaceFromKey(key string) (err error) { + startTime := time.Now() + defer glog.V(4).Infof("Finished syncing namespace %q (%v)", key, time.Now().Sub(startTime)) -func deleteSecrets(kubeClient client.Interface, ns string) error { - items, err := kubeClient.Secrets(ns).List(api.ListOptions{}) + obj, exists, err := nm.store.GetByKey(key) + if !exists { + glog.Infof("Namespace has been deleted %v", key) + return nil + } if err != nil { + glog.Infof("Unable to retrieve namespace %v from store: %v", key, err) + nm.queue.Add(key) return err } - for i := range items.Items { - err := kubeClient.Secrets(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil + namespace := obj.(*api.Namespace) + return syncNamespace(nm.kubeClient, nm.versions, namespace) } -func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error { - items, err := kubeClient.PersistentVolumeClaims(ns).List(api.ListOptions{}) - if err != nil { - return err +// Run starts observing the system with the specified number of workers. +func (nm *NamespaceController) Run(workers int, stopCh <-chan struct{}) { + defer utilruntime.HandleCrash() + go nm.controller.Run(stopCh) + for i := 0; i < workers; i++ { + go wait.Until(nm.worker, time.Second, stopCh) } - for i := range items.Items { - err := kubeClient.PersistentVolumeClaims(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.HorizontalPodAutoscalers(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := expClient.HorizontalPodAutoscalers(ns).Delete(items.Items[i].Name, nil) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.DaemonSets(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := expClient.DaemonSets(ns).Delete(items.Items[i].Name) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteJobs(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Jobs(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := expClient.Jobs(ns).Delete(items.Items[i].Name, nil) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteDeployments(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Deployments(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := expClient.Deployments(ns).Delete(items.Items[i].Name, nil) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -func deleteIngress(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Ingress(ns).List(api.ListOptions{}) - if err != nil { - return err - } - for i := range items.Items { - err := expClient.Ingress(ns).Delete(items.Items[i].Name, nil) - if err != nil && !errors.IsNotFound(err) { - return err - } - } - return nil -} - -// TODO: this is duplicated logic. Move it somewhere central? -func containsVersion(versions *unversioned.APIVersions, version string) bool { - for ix := range versions.Versions { - if versions.Versions[ix] == version { - return true - } - } - return false -} - -// TODO: this is duplicated logic. Move it somewhere central? -func containsResource(resources *unversioned.APIResourceList, resourceName string) bool { - if resources == nil { - return false - } - for ix := range resources.APIResources { - resource := resources.APIResources[ix] - if resource.Name == resourceName { - return true - } - } - return false + <-stopCh + glog.Infof("Shutting down NamespaceController") + nm.queue.ShutDown() } diff --git a/pkg/controller/namespace/namespace_controller_test.go b/pkg/controller/namespace/namespace_controller_test.go index 597ed9df275..c1d7bf57f6a 100644 --- a/pkg/controller/namespace/namespace_controller_test.go +++ b/pkg/controller/namespace/namespace_controller_test.go @@ -20,13 +20,13 @@ import ( "fmt" "strings" "testing" - "time" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" - client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/util/sets" ) @@ -46,7 +46,7 @@ func TestFinalized(t *testing.T) { } func TestFinalizeNamespaceFunc(t *testing.T) { - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} testNamespace := &api.Namespace{ ObjectMeta: api.ObjectMeta{ Name: "test", @@ -64,7 +64,7 @@ func TestFinalizeNamespaceFunc(t *testing.T) { if !actions[0].Matches("create", "namespaces") || actions[0].GetSubresource() != "finalize" { t.Errorf("Expected finalize-namespace action %v", actions[0]) } - finalizers := actions[0].(testclient.CreateAction).GetObject().(*api.Namespace).Spec.Finalizers + finalizers := actions[0].(core.CreateAction).GetObject().(*api.Namespace).Spec.Finalizers if len(finalizers) != 1 { t.Errorf("There should be a single finalizer remaining") } @@ -103,25 +103,26 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV // TODO: Reuse the constants for all these strings from testclient pendingActionSet := sets.NewString( strings.Join([]string{"get", "namespaces", ""}, "-"), - strings.Join([]string{"list", "replicationcontrollers", ""}, "-"), + strings.Join([]string{"delete-collection", "replicationcontrollers", ""}, "-"), strings.Join([]string{"list", "services", ""}, "-"), strings.Join([]string{"list", "pods", ""}, "-"), - strings.Join([]string{"list", "resourcequotas", ""}, "-"), - strings.Join([]string{"list", "secrets", ""}, "-"), - strings.Join([]string{"list", "limitranges", ""}, "-"), + strings.Join([]string{"delete-collection", "resourcequotas", ""}, "-"), + strings.Join([]string{"delete-collection", "secrets", ""}, "-"), + strings.Join([]string{"delete-collection", "configmaps", ""}, "-"), + strings.Join([]string{"delete-collection", "limitranges", ""}, "-"), strings.Join([]string{"delete-collection", "events", ""}, "-"), - strings.Join([]string{"list", "serviceaccounts", ""}, "-"), - strings.Join([]string{"list", "persistentvolumeclaims", ""}, "-"), + strings.Join([]string{"delete-collection", "serviceaccounts", ""}, "-"), + strings.Join([]string{"delete-collection", "persistentvolumeclaims", ""}, "-"), strings.Join([]string{"create", "namespaces", "finalize"}, "-"), ) if containsVersion(versions, "extensions/v1beta1") { pendingActionSet.Insert( - strings.Join([]string{"list", "daemonsets", ""}, "-"), - strings.Join([]string{"list", "deployments", ""}, "-"), - strings.Join([]string{"list", "jobs", ""}, "-"), - strings.Join([]string{"list", "horizontalpodautoscalers", ""}, "-"), - strings.Join([]string{"list", "ingresses", ""}, "-"), + strings.Join([]string{"delete-collection", "daemonsets", ""}, "-"), + strings.Join([]string{"delete-collection", "deployments", ""}, "-"), + strings.Join([]string{"delete-collection", "jobs", ""}, "-"), + strings.Join([]string{"delete-collection", "horizontalpodautoscalers", ""}, "-"), + strings.Join([]string{"delete-collection", "ingresses", ""}, "-"), strings.Join([]string{"get", "resource", ""}, "-"), ) } @@ -144,7 +145,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV } for scenario, testInput := range scenarios { - mockClient := testclient.NewSimpleFake(testInput.testNamespace) + mockClient := fake.NewSimpleClientset(testInput.testNamespace) if containsVersion(versions, "extensions/v1beta1") { resources := []unversioned.APIResource{} for _, resource := range []string{"daemonsets", "deployments", "jobs", "horizontalpodautoscalers", "ingresses"} { @@ -175,9 +176,9 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV } func TestRetryOnConflictError(t *testing.T) { - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} numTries := 0 - retryOnce := func(kubeClient client.Interface, namespace *api.Namespace) (*api.Namespace, error) { + retryOnce := func(kubeClient clientset.Interface, namespace *api.Namespace) (*api.Namespace, error) { numTries++ if numTries <= 1 { return namespace, errors.NewConflict(api.Resource("namespaces"), namespace.Name, fmt.Errorf("ERROR!")) @@ -203,7 +204,7 @@ func TestSyncNamespaceThatIsTerminatingV1Beta1(t *testing.T) { } func TestSyncNamespaceThatIsActive(t *testing.T) { - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} testNamespace := &api.Namespace{ ObjectMeta: api.ObjectMeta{ Name: "test", @@ -224,25 +225,3 @@ func TestSyncNamespaceThatIsActive(t *testing.T) { t.Errorf("Expected no action from controller, but got: %v", mockClient.Actions()) } } - -func TestRunStop(t *testing.T) { - mockClient := &testclient.Fake{} - - nsController := NewNamespaceController(mockClient, &unversioned.APIVersions{}, 1*time.Second) - - if nsController.StopEverything != nil { - t.Errorf("Non-running manager should not have a stop channel. Got %v", nsController.StopEverything) - } - - nsController.Run() - - if nsController.StopEverything == nil { - t.Errorf("Running manager should have a stop channel. Got nil") - } - - nsController.Stop() - - if nsController.StopEverything != nil { - t.Errorf("Non-running manager should not have a stop channel. Got %v", nsController.StopEverything) - } -} diff --git a/pkg/controller/namespace/namespace_controller_utils.go b/pkg/controller/namespace/namespace_controller_utils.go new file mode 100644 index 00000000000..75350f94f81 --- /dev/null +++ b/pkg/controller/namespace/namespace_controller_utils.go @@ -0,0 +1,372 @@ +/* +Copyright 2015 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. +*/ + +package namespace + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/errors" + "k8s.io/kubernetes/pkg/api/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + extensions_unversioned "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" + "k8s.io/kubernetes/pkg/util/sets" + + "github.com/golang/glog" +) + +// contentRemainingError is used to inform the caller that content is not fully removed from the namespace +type contentRemainingError struct { + Estimate int64 +} + +func (e *contentRemainingError) Error() string { + return fmt.Sprintf("some content remains in the namespace, estimate %d seconds before it is removed", e.Estimate) +} + +// updateNamespaceFunc is a function that makes an update to a namespace +type updateNamespaceFunc func(kubeClient clientset.Interface, namespace *api.Namespace) (*api.Namespace, error) + +// retryOnConflictError retries the specified fn if there was a conflict error +// TODO RetryOnConflict should be a generic concept in client code +func retryOnConflictError(kubeClient clientset.Interface, namespace *api.Namespace, fn updateNamespaceFunc) (result *api.Namespace, err error) { + latestNamespace := namespace + for { + result, err = fn(kubeClient, latestNamespace) + if err == nil { + return result, nil + } + if !errors.IsConflict(err) { + return nil, err + } + latestNamespace, err = kubeClient.Core().Namespaces().Get(latestNamespace.Name) + if err != nil { + return nil, err + } + } + return +} + +// updateNamespaceStatusFunc will verify that the status of the namespace is correct +func updateNamespaceStatusFunc(kubeClient clientset.Interface, namespace *api.Namespace) (*api.Namespace, error) { + if namespace.DeletionTimestamp.IsZero() || namespace.Status.Phase == api.NamespaceTerminating { + return namespace, nil + } + newNamespace := api.Namespace{} + newNamespace.ObjectMeta = namespace.ObjectMeta + newNamespace.Status = namespace.Status + newNamespace.Status.Phase = api.NamespaceTerminating + return kubeClient.Core().Namespaces().UpdateStatus(&newNamespace) +} + +// finalized returns true if the namespace.Spec.Finalizers is an empty list +func finalized(namespace *api.Namespace) bool { + return len(namespace.Spec.Finalizers) == 0 +} + +// finalizeNamespaceFunc removes the kubernetes token and finalizes the namespace +func finalizeNamespaceFunc(kubeClient clientset.Interface, namespace *api.Namespace) (*api.Namespace, error) { + namespaceFinalize := api.Namespace{} + namespaceFinalize.ObjectMeta = namespace.ObjectMeta + namespaceFinalize.Spec = namespace.Spec + finalizerSet := sets.NewString() + for i := range namespace.Spec.Finalizers { + if namespace.Spec.Finalizers[i] != api.FinalizerKubernetes { + finalizerSet.Insert(string(namespace.Spec.Finalizers[i])) + } + } + namespaceFinalize.Spec.Finalizers = make([]api.FinalizerName, 0, len(finalizerSet)) + for _, value := range finalizerSet.List() { + namespaceFinalize.Spec.Finalizers = append(namespaceFinalize.Spec.Finalizers, api.FinalizerName(value)) + } + namespace, err := kubeClient.Core().Namespaces().Finalize(&namespaceFinalize) + if err != nil { + // it was removed already, so life is good + if errors.IsNotFound(err) { + return namespace, nil + } + } + return namespace, err +} + +// deleteAllContent will delete all content known to the system in a namespace. It returns an estimate +// of the time remaining before the remaining resources are deleted. If estimate > 0 not all resources +// are guaranteed to be gone. +// TODO: this should use discovery to delete arbitrary namespace content +func deleteAllContent(kubeClient clientset.Interface, versions *unversioned.APIVersions, namespace string, before unversioned.Time) (estimate int64, err error) { + err = deleteServiceAccounts(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteServices(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteReplicationControllers(kubeClient, namespace) + if err != nil { + return estimate, err + } + estimate, err = deletePods(kubeClient, namespace, before) + if err != nil { + return estimate, err + } + err = deleteSecrets(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteConfigMaps(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deletePersistentVolumeClaims(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteLimitRanges(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteResourceQuotas(kubeClient, namespace) + if err != nil { + return estimate, err + } + err = deleteEvents(kubeClient, namespace) + if err != nil { + return estimate, err + } + // If experimental mode, delete all experimental resources for the namespace. + if containsVersion(versions, "extensions/v1beta1") { + resources, err := kubeClient.Discovery().ServerResourcesForGroupVersion("extensions/v1beta1") + if err != nil { + return estimate, err + } + if containsResource(resources, "horizontalpodautoscalers") { + err = deleteHorizontalPodAutoscalers(kubeClient.Extensions(), namespace) + if err != nil { + return estimate, err + } + } + if containsResource(resources, "ingresses") { + err = deleteIngress(kubeClient.Extensions(), namespace) + if err != nil { + return estimate, err + } + } + if containsResource(resources, "daemonsets") { + err = deleteDaemonSets(kubeClient.Extensions(), namespace) + if err != nil { + return estimate, err + } + } + if containsResource(resources, "jobs") { + err = deleteJobs(kubeClient.Extensions(), namespace) + if err != nil { + return estimate, err + } + } + if containsResource(resources, "deployments") { + err = deleteDeployments(kubeClient.Extensions(), namespace) + if err != nil { + return estimate, err + } + } + } + return estimate, nil +} + +// syncNamespace orchestrates deletion of a Namespace and its associated content. +func syncNamespace(kubeClient clientset.Interface, versions *unversioned.APIVersions, namespace *api.Namespace) error { + if namespace.DeletionTimestamp == nil { + return nil + } + + // multiple controllers may edit a namespace during termination + // first get the latest state of the namespace before proceeding + // if the namespace was deleted already, don't do anything + namespace, err := kubeClient.Core().Namespaces().Get(namespace.Name) + if err != nil { + if errors.IsNotFound(err) { + return nil + } + return err + } + + glog.V(4).Infof("Syncing namespace %s", namespace.Name) + + // ensure that the status is up to date on the namespace + // if we get a not found error, we assume the namespace is truly gone + namespace, err = retryOnConflictError(kubeClient, namespace, updateNamespaceStatusFunc) + if err != nil { + if errors.IsNotFound(err) { + return nil + } + return err + } + + // if the namespace is already finalized, delete it + if finalized(namespace) { + err = kubeClient.Core().Namespaces().Delete(namespace.Name, nil) + if err != nil && !errors.IsNotFound(err) { + return err + } + return nil + } + + // there may still be content for us to remove + estimate, err := deleteAllContent(kubeClient, versions, namespace.Name, *namespace.DeletionTimestamp) + if err != nil { + return err + } + if estimate > 0 { + return &contentRemainingError{estimate} + } + + // we have removed content, so mark it finalized by us + result, err := retryOnConflictError(kubeClient, namespace, finalizeNamespaceFunc) + if err != nil { + return err + } + + // now check if all finalizers have reported that we delete now + if finalized(result) { + err = kubeClient.Core().Namespaces().Delete(namespace.Name, nil) + if err != nil && !errors.IsNotFound(err) { + return err + } + } + + return nil +} + +func deleteLimitRanges(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().LimitRanges(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteResourceQuotas(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().ResourceQuotas(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteServiceAccounts(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().ServiceAccounts(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteServices(kubeClient clientset.Interface, ns string) error { + items, err := kubeClient.Core().Services(ns).List(api.ListOptions{}) + if err != nil { + return err + } + for i := range items.Items { + err := kubeClient.Core().Services(ns).Delete(items.Items[i].Name, nil) + if err != nil && !errors.IsNotFound(err) { + return err + } + } + return nil +} + +func deleteReplicationControllers(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().ReplicationControllers(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deletePods(kubeClient clientset.Interface, ns string, before unversioned.Time) (int64, error) { + items, err := kubeClient.Core().Pods(ns).List(api.ListOptions{}) + if err != nil { + return 0, err + } + expired := unversioned.Now().After(before.Time) + var deleteOptions *api.DeleteOptions + if expired { + deleteOptions = api.NewDeleteOptions(0) + } + estimate := int64(0) + for i := range items.Items { + if items.Items[i].Spec.TerminationGracePeriodSeconds != nil { + grace := *items.Items[i].Spec.TerminationGracePeriodSeconds + if grace > estimate { + estimate = grace + } + } + err := kubeClient.Core().Pods(ns).Delete(items.Items[i].Name, deleteOptions) + if err != nil && !errors.IsNotFound(err) { + return 0, err + } + } + if expired { + estimate = 0 + } + return estimate, nil +} + +func deleteEvents(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().Events(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteSecrets(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().Secrets(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteConfigMaps(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().ConfigMaps(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deletePersistentVolumeClaims(kubeClient clientset.Interface, ns string) error { + return kubeClient.Core().PersistentVolumeClaims(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteHorizontalPodAutoscalers(expClient extensions_unversioned.ExtensionsInterface, ns string) error { + return expClient.HorizontalPodAutoscalers(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteDaemonSets(expClient extensions_unversioned.ExtensionsInterface, ns string) error { + return expClient.DaemonSets(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteJobs(expClient extensions_unversioned.ExtensionsInterface, ns string) error { + return expClient.Jobs(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteDeployments(expClient extensions_unversioned.ExtensionsInterface, ns string) error { + return expClient.Deployments(ns).DeleteCollection(nil, api.ListOptions{}) +} + +func deleteIngress(expClient extensions_unversioned.ExtensionsInterface, ns string) error { + return expClient.Ingresses(ns).DeleteCollection(nil, api.ListOptions{}) +} + +// TODO: this is duplicated logic. Move it somewhere central? +func containsVersion(versions *unversioned.APIVersions, version string) bool { + for ix := range versions.Versions { + if versions.Versions[ix] == version { + return true + } + } + return false +} + +// TODO: this is duplicated logic. Move it somewhere central? +func containsResource(resources *unversioned.APIResourceList, resourceName string) bool { + if resources == nil { + return false + } + for ix := range resources.APIResources { + resource := resources.APIResources[ix] + if resource.Name == resourceName { + return true + } + } + return false +} diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go index 74fe5b188b7..b89947c9889 100644 --- a/pkg/controller/node/nodecontroller.go +++ b/pkg/controller/node/nodecontroller.go @@ -28,7 +28,9 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/controller" @@ -40,6 +42,7 @@ import ( "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/watch" ) @@ -67,7 +70,7 @@ type NodeController struct { clusterCIDR *net.IPNet deletingPodsRateLimiter util.RateLimiter knownNodeSet sets.String - kubeClient client.Interface + kubeClient clientset.Interface // Method for easy mocking in unittest. lookupIP func(host string) ([]net.IP, error) // Value used if sync_nodes_status=False. NodeController will not proactively @@ -122,7 +125,7 @@ type NodeController struct { // NewNodeController returns a new node controller to sync instances from cloudprovider. func NewNodeController( cloud cloudprovider.Interface, - kubeClient client.Interface, + kubeClient clientset.Interface, podEvictionTimeout time.Duration, deletionEvictionLimiter util.RateLimiter, terminationEvictionLimiter util.RateLimiter, @@ -136,7 +139,7 @@ func NewNodeController( eventBroadcaster.StartLogging(glog.Infof) if kubeClient != nil { glog.Infof("Sending events to api server.") - eventBroadcaster.StartRecordingToSink(kubeClient.Events("")) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) } else { glog.Infof("No api server defined - no events will be sent to API server.") } @@ -169,10 +172,10 @@ func NewNodeController( nc.podStore.Store, nc.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return nc.kubeClient.Pods(api.NamespaceAll).List(options) + return nc.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return nc.kubeClient.Pods(api.NamespaceAll).Watch(options) + return nc.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -185,10 +188,10 @@ func NewNodeController( nc.nodeStore.Store, nc.nodeController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return nc.kubeClient.Nodes().List(options) + return nc.kubeClient.Core().Nodes().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return nc.kubeClient.Nodes().Watch(options) + return nc.kubeClient.Core().Nodes().Watch(options) }, }, &api.Node{}, @@ -213,16 +216,16 @@ func NewNodeController( // Run starts an asynchronous loop that monitors the status of cluster nodes. func (nc *NodeController) Run(period time.Duration) { - go nc.nodeController.Run(util.NeverStop) - go nc.podController.Run(util.NeverStop) - go nc.daemonSetController.Run(util.NeverStop) + go nc.nodeController.Run(wait.NeverStop) + go nc.podController.Run(wait.NeverStop) + go nc.daemonSetController.Run(wait.NeverStop) // Incorporate the results of node status pushed from kubelet to master. - go util.Until(func() { + go wait.Until(func() { if err := nc.monitorNodeStatus(); err != nil { glog.Errorf("Error monitoring node status: %v", err) } - }, nc.nodeMonitorPeriod, util.NeverStop) + }, nc.nodeMonitorPeriod, wait.NeverStop) // Managing eviction of nodes: // 1. when we delete pods off a node, if the node was not empty at the time we then @@ -236,7 +239,7 @@ func (nc *NodeController) Run(period time.Duration) { // b. If there are no pods left terminating, exit // c. If there are pods still terminating, wait for their estimated completion // before retrying - go util.Until(func() { + go wait.Until(func() { nc.evictorLock.Lock() defer nc.evictorLock.Unlock() nc.podEvictor.Try(func(value TimedValue) (bool, time.Duration) { @@ -251,11 +254,11 @@ func (nc *NodeController) Run(period time.Duration) { } return true, 0 }) - }, nodeEvictionPeriod, util.NeverStop) + }, nodeEvictionPeriod, wait.NeverStop) // TODO: replace with a controller that ensures pods that are terminating complete // in a particular time period - go util.Until(func() { + go wait.Until(func() { nc.evictorLock.Lock() defer nc.evictorLock.Unlock() nc.terminationEvictor.Try(func(value TimedValue) (bool, time.Duration) { @@ -278,7 +281,7 @@ func (nc *NodeController) Run(period time.Duration) { } return false, remaining }) - }, nodeEvictionPeriod, util.NeverStop) + }, nodeEvictionPeriod, wait.NeverStop) } // Generates num pod CIDRs that could be assigned to nodes. @@ -363,9 +366,9 @@ func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) { } } -func forcefullyDeletePod(c client.Interface, pod *api.Pod) { +func forcefullyDeletePod(c clientset.Interface, pod *api.Pod) { var zero int64 - err := c.Pods(pod.Namespace).Delete(pod.Name, &api.DeleteOptions{GracePeriodSeconds: &zero}) + err := c.Core().Pods(pod.Namespace).Delete(pod.Name, &api.DeleteOptions{GracePeriodSeconds: &zero}) if err != nil { utilruntime.HandleError(err) } @@ -375,7 +378,7 @@ func forcefullyDeletePod(c client.Interface, pod *api.Pod) { // post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or // not reachable for a long period of time. func (nc *NodeController) monitorNodeStatus() error { - nodes, err := nc.kubeClient.Nodes().List(api.ListOptions{}) + nodes, err := nc.kubeClient.Core().Nodes().List(api.ListOptions{}) if err != nil { return err } @@ -419,7 +422,7 @@ func (nc *NodeController) monitorNodeStatus() error { break } name := node.Name - node, err = nc.kubeClient.Nodes().Get(name) + node, err = nc.kubeClient.Core().Nodes().Get(name) if err != nil { glog.Errorf("Failed while getting a Node to retry updating NodeStatus. Probably Node %s was deleted.", name) break @@ -485,7 +488,7 @@ func (nc *NodeController) monitorNodeStatus() error { continue } - if err := nc.kubeClient.Nodes().Delete(node.Name); err != nil { + if err := nc.kubeClient.Core().Nodes().Delete(node.Name, nil); err != nil { glog.Errorf("Unable to delete node %s: %v", node.Name, err) continue } @@ -518,7 +521,7 @@ func (nc *NodeController) reconcileNodeCIDRs(nodes *api.NodeList) { } glog.V(4).Infof("Assigning node %s CIDR %s", node.Name, podCIDR) node.Spec.PodCIDR = podCIDR - if _, err := nc.kubeClient.Nodes().Update(&node); err != nil { + if _, err := nc.kubeClient.Core().Nodes().Update(&node); err != nil { nc.recordNodeStatusChange(&node, "CIDRAssignmentFailed") } } @@ -696,7 +699,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap } if !api.Semantic.DeepEqual(nc.getCondition(&node.Status, api.NodeReady), &lastReadyCondition) { - if _, err = nc.kubeClient.Nodes().UpdateStatus(node); err != nil { + if _, err = nc.kubeClient.Core().Nodes().UpdateStatus(node); err != nil { glog.Errorf("Error updating node %s: %v", node.Name, err) return gracePeriod, lastReadyCondition, readyCondition, err } else { @@ -718,7 +721,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap func (nc *NodeController) hasPods(nodeName string) (bool, error) { selector := fields.OneTermEqualSelector(client.PodHost, nodeName) options := api.ListOptions{FieldSelector: selector} - pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) + pods, err := nc.kubeClient.Core().Pods(api.NamespaceAll).List(options) if err != nil { return false, err } @@ -753,7 +756,7 @@ func (nc *NodeController) deletePods(nodeName string) (bool, error) { remaining := false selector := fields.OneTermEqualSelector(client.PodHost, nodeName) options := api.ListOptions{FieldSelector: selector} - pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) + pods, err := nc.kubeClient.Core().Pods(api.NamespaceAll).List(options) if err != nil { return remaining, err } @@ -779,7 +782,7 @@ func (nc *NodeController) deletePods(nodeName string) (bool, error) { glog.V(2).Infof("Starting deletion of pod %v", pod.Name) nc.recorder.Eventf(&pod, api.EventTypeNormal, "NodeControllerEviction", "Marking for deletion Pod %s from Node %s", pod.Name, nodeName) - if err := nc.kubeClient.Pods(pod.Namespace).Delete(pod.Name, nil); err != nil { + if err := nc.kubeClient.Core().Pods(pod.Namespace).Delete(pod.Name, nil); err != nil { return false, err } remaining = true @@ -792,7 +795,7 @@ func (nc *NodeController) deletePods(nodeName string) (bool, error) { func (nc *NodeController) markAllPodsNotReady(nodeName string) error { glog.V(2).Infof("Update ready status of pods on node [%v]", nodeName) opts := api.ListOptions{FieldSelector: fields.OneTermEqualSelector(client.PodHost, nodeName)} - pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(opts) + pods, err := nc.kubeClient.Core().Pods(api.NamespaceAll).List(opts) if err != nil { return err } @@ -808,7 +811,7 @@ func (nc *NodeController) markAllPodsNotReady(nodeName string) error { if cond.Type == api.PodReady { pod.Status.Conditions[i].Status = api.ConditionFalse glog.V(2).Infof("Updating ready status of pod %v to false", pod.Name) - pod, err := nc.kubeClient.Pods(pod.Namespace).UpdateStatus(&pod) + pod, err := nc.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(&pod) if err != nil { glog.Warningf("Failed to updated status for pod %q: %v", format.Pod(pod), err) errMsg = append(errMsg, fmt.Sprintf("%v", err)) @@ -834,7 +837,7 @@ func (nc *NodeController) terminatePods(nodeName string, since time.Time) (bool, selector := fields.OneTermEqualSelector(client.PodHost, nodeName) options := api.ListOptions{FieldSelector: selector} - pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) + pods, err := nc.kubeClient.Core().Pods(api.NamespaceAll).List(options) if err != nil { return false, nextAttempt, err } @@ -863,7 +866,7 @@ func (nc *NodeController) terminatePods(nodeName string, since time.Time) (bool, remaining = 0 glog.V(2).Infof("Removing pod %v after %s grace period", pod.Name, grace) nc.recordNodeEvent(nodeName, api.EventTypeNormal, "TerminatingEvictedPod", fmt.Sprintf("Pod %s has exceeded the grace period for deletion after being evicted from Node %q and is being force killed", pod.Name, nodeName)) - if err := nc.kubeClient.Pods(pod.Namespace).Delete(pod.Name, api.NewDeleteOptions(0)); err != nil { + if err := nc.kubeClient.Core().Pods(pod.Namespace).Delete(pod.Name, api.NewDeleteOptions(0)); err != nil { glog.Errorf("Error completing deletion of pod %s: %v", pod.Name, err) complete = false } diff --git a/pkg/controller/node/nodecontroller_test.go b/pkg/controller/node/nodecontroller_test.go index 644230d3c82..74ea2e008cd 100644 --- a/pkg/controller/node/nodecontroller_test.go +++ b/pkg/controller/node/nodecontroller_test.go @@ -28,8 +28,8 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/watch" ) @@ -45,7 +45,7 @@ const ( // PodsInterface and PodInterface to test list & delet pods, which is implemented in // the embedded client.Fake field. type FakeNodeHandler struct { - *testclient.Fake + *fake.Clientset // Input: Hooks determine if request is valid or not CreateHook func(*FakeNodeHandler, *api.Node) bool @@ -62,8 +62,17 @@ type FakeNodeHandler struct { createLock sync.Mutex } -func (c *FakeNodeHandler) Nodes() client.NodeInterface { - return c +type FakeLegacyHandler struct { + unversioned_core.CoreInterface + n *FakeNodeHandler +} + +func (c *FakeNodeHandler) Core() unversioned_core.CoreInterface { + return &FakeLegacyHandler{c.Clientset.Core(), c} +} + +func (m *FakeLegacyHandler) Nodes() unversioned_core.NodeInterface { + return m.n } func (m *FakeNodeHandler) Create(node *api.Node) (*api.Node, error) { @@ -115,12 +124,16 @@ func (m *FakeNodeHandler) List(opts api.ListOptions) (*api.NodeList, error) { return nodeList, nil } -func (m *FakeNodeHandler) Delete(id string) error { +func (m *FakeNodeHandler) Delete(id string, opt *api.DeleteOptions) error { m.DeletedNodes = append(m.DeletedNodes, newNode(id)) m.RequestCount++ return nil } +func (m *FakeNodeHandler) DeleteCollection(opt *api.DeleteOptions, listOpts api.ListOptions) error { + return nil +} + func (m *FakeNodeHandler) Update(node *api.Node) (*api.Node, error) { nodeCopy := *node m.UpdatedNodes = append(m.UpdatedNodes, &nodeCopy) @@ -162,7 +175,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, daemonSets: nil, timeToPass: 0, @@ -191,7 +204,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, daemonSets: nil, timeToPass: evictionTimeout, @@ -230,7 +243,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake( + Clientset: fake.NewSimpleClientset( &api.PodList{ Items: []api.Pod{ { @@ -254,7 +267,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { Namespace: "default", }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"daemon": "yes"}, }, }, @@ -296,7 +309,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, daemonSets: nil, timeToPass: time.Hour, @@ -335,7 +348,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, daemonSets: nil, timeToPass: evictionTimeout - testNodeMonitorGracePeriod, @@ -374,7 +387,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, daemonSets: nil, timeToPass: 60 * time.Minute, @@ -396,7 +409,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) { for _, item := range table { nodeController := NewNodeController(nil, item.fakeNodeHandler, - evictionTimeout, util.NewFakeRateLimiter(), util.NewFakeRateLimiter(), testNodeMonitorGracePeriod, + evictionTimeout, util.NewFakeAlwaysRateLimiter(), util.NewFakeAlwaysRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) nodeController.now = func() unversioned.Time { return fakeNow } for _, ds := range item.daemonSets { @@ -460,7 +473,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedRequestCount: 2, // List+Update expectedNodes: []*api.Node{ @@ -504,7 +517,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedRequestCount: 1, // List expectedNodes: nil, @@ -546,7 +559,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedRequestCount: 3, // (List+)List+Update timeToPass: time.Hour, @@ -638,7 +651,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedRequestCount: 1, // List expectedNodes: nil, @@ -646,8 +659,8 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { } for i, item := range table { - nodeController := NewNodeController(nil, item.fakeNodeHandler, 5*time.Minute, util.NewFakeRateLimiter(), - util.NewFakeRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) + nodeController := NewNodeController(nil, item.fakeNodeHandler, 5*time.Minute, util.NewFakeAlwaysRateLimiter(), + util.NewFakeAlwaysRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) nodeController.now = func() unversioned.Time { return fakeNow } if err := nodeController.monitorNodeStatus(); err != nil { t.Errorf("unexpected error: %v", err) @@ -691,7 +704,7 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedPodStatusUpdate: false, }, @@ -725,7 +738,7 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, expectedPodStatusUpdate: false, }, @@ -766,7 +779,7 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0")}}), }, timeToPass: 1 * time.Minute, newNodeStatus: api.NodeStatus{ @@ -796,8 +809,8 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { } for i, item := range table { - nodeController := NewNodeController(nil, item.fakeNodeHandler, 5*time.Minute, util.NewFakeRateLimiter(), - util.NewFakeRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) + nodeController := NewNodeController(nil, item.fakeNodeHandler, 5*time.Minute, util.NewFakeAlwaysRateLimiter(), + util.NewFakeAlwaysRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) nodeController.now = func() unversioned.Time { return fakeNow } if err := nodeController.monitorNodeStatus(); err != nil { t.Errorf("Case[%d] unexpected error: %v", i, err) @@ -875,16 +888,16 @@ func TestNodeDeletion(t *testing.T) { }, }, }, - Fake: testclient.NewSimpleFake(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0"), *newPod("pod1", "node1")}}), + Clientset: fake.NewSimpleClientset(&api.PodList{Items: []api.Pod{*newPod("pod0", "node0"), *newPod("pod1", "node1")}}), } - nodeController := NewNodeController(nil, fakeNodeHandler, 5*time.Minute, util.NewFakeRateLimiter(), util.NewFakeRateLimiter(), + nodeController := NewNodeController(nil, fakeNodeHandler, 5*time.Minute, util.NewFakeAlwaysRateLimiter(), util.NewFakeAlwaysRateLimiter(), testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorPeriod, nil, false) nodeController.now = func() unversioned.Time { return fakeNow } if err := nodeController.monitorNodeStatus(); err != nil { t.Errorf("unexpected error: %v", err) } - fakeNodeHandler.Delete("node1") + fakeNodeHandler.Delete("node1", nil) if err := nodeController.monitorNodeStatus(); err != nil { t.Errorf("unexpected error: %v", err) } diff --git a/pkg/controller/node/rate_limited_queue_test.go b/pkg/controller/node/rate_limited_queue_test.go index e0bccd54e92..a04711466ff 100644 --- a/pkg/controller/node/rate_limited_queue_test.go +++ b/pkg/controller/node/rate_limited_queue_test.go @@ -39,7 +39,7 @@ func CheckSetEq(lhs, rhs sets.String) bool { } func TestAddNode(t *testing.T) { - evictor := NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor := NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -62,7 +62,7 @@ func TestAddNode(t *testing.T) { } func TestDelNode(t *testing.T) { - evictor := NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor := NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -84,7 +84,7 @@ func TestDelNode(t *testing.T) { t.Errorf("Invalid map. Got %v, expected %v", evictor.queue.set, setPattern) } - evictor = NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor = NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -106,7 +106,7 @@ func TestDelNode(t *testing.T) { t.Errorf("Invalid map. Got %v, expected %v", evictor.queue.set, setPattern) } - evictor = NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor = NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -130,7 +130,7 @@ func TestDelNode(t *testing.T) { } func TestTry(t *testing.T) { - evictor := NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor := NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -152,7 +152,7 @@ func TestTry(t *testing.T) { } func TestTryOrdering(t *testing.T) { - evictor := NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor := NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") @@ -184,7 +184,7 @@ func TestTryOrdering(t *testing.T) { } func TestTryRemovingWhileTry(t *testing.T) { - evictor := NewRateLimitedTimedQueue(util.NewFakeRateLimiter()) + evictor := NewRateLimitedTimedQueue(util.NewFakeAlwaysRateLimiter()) evictor.Add("first") evictor.Add("second") evictor.Add("third") diff --git a/pkg/controller/persistentvolume/options/options.go b/pkg/controller/persistentvolume/options/options.go new file mode 100644 index 00000000000..c3b6c175ad9 --- /dev/null +++ b/pkg/controller/persistentvolume/options/options.go @@ -0,0 +1,87 @@ +/* +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. +*/ + +package options + +import ( + "time" + + "github.com/spf13/pflag" +) + +// VolumeConfigFlags is used to bind CLI flags to variables. This top-level struct contains *all* enumerated +// CLI flags meant to configure all volume plugins. From this config, the binary will create many instances +// of volume.VolumeConfig which are then passed to the appropriate plugin. The ControllerManager binary is the only +// part of the code which knows what plugins are supported and which CLI flags correspond to each plugin. +type VolumeConfigFlags struct { + PersistentVolumeRecyclerMaximumRetry int + PersistentVolumeRecyclerMinimumTimeoutNFS int + PersistentVolumeRecyclerPodTemplateFilePathNFS string + PersistentVolumeRecyclerIncrementTimeoutNFS int + PersistentVolumeRecyclerPodTemplateFilePathHostPath string + PersistentVolumeRecyclerMinimumTimeoutHostPath int + PersistentVolumeRecyclerIncrementTimeoutHostPath int + EnableHostPathProvisioning bool +} + +type PersistentVolumeControllerOptions struct { + PVClaimBinderSyncPeriod time.Duration + VolumeConfigFlags VolumeConfigFlags +} + +func NewPersistentVolumeControllerOptions() PersistentVolumeControllerOptions { + return PersistentVolumeControllerOptions{ + PVClaimBinderSyncPeriod: 10 * time.Minute, + VolumeConfigFlags: VolumeConfigFlags{ + // default values here + PersistentVolumeRecyclerMaximumRetry: 3, + PersistentVolumeRecyclerMinimumTimeoutNFS: 300, + PersistentVolumeRecyclerIncrementTimeoutNFS: 30, + PersistentVolumeRecyclerMinimumTimeoutHostPath: 60, + PersistentVolumeRecyclerIncrementTimeoutHostPath: 30, + EnableHostPathProvisioning: false, + }, + } +} + +func (o *PersistentVolumeControllerOptions) AddFlags(fs *pflag.FlagSet) { + fs.DurationVar(&o.PVClaimBinderSyncPeriod, "pvclaimbinder-sync-period", o.PVClaimBinderSyncPeriod, + "The period for syncing persistent volumes and persistent volume claims") + fs.StringVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerPodTemplateFilePathNFS, + "pv-recycler-pod-template-filepath-nfs", o.VolumeConfigFlags.PersistentVolumeRecyclerPodTemplateFilePathNFS, + "The file path to a pod definition used as a template for NFS persistent volume recycling") + fs.IntVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerMinimumTimeoutNFS, "pv-recycler-minimum-timeout-nfs", + o.VolumeConfigFlags.PersistentVolumeRecyclerMinimumTimeoutNFS, "The minimum ActiveDeadlineSeconds to use for an NFS Recycler pod") + fs.IntVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerIncrementTimeoutNFS, "pv-recycler-increment-timeout-nfs", + o.VolumeConfigFlags.PersistentVolumeRecyclerIncrementTimeoutNFS, "the increment of time added per Gi to ActiveDeadlineSeconds for an NFS scrubber pod") + fs.StringVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerPodTemplateFilePathHostPath, "pv-recycler-pod-template-filepath-hostpath", + o.VolumeConfigFlags.PersistentVolumeRecyclerPodTemplateFilePathHostPath, + "The file path to a pod definition used as a template for HostPath persistent volume recycling. "+ + "This is for development and testing only and will not work in a multi-node cluster.") + fs.IntVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerMinimumTimeoutHostPath, "pv-recycler-minimum-timeout-hostpath", + o.VolumeConfigFlags.PersistentVolumeRecyclerMinimumTimeoutHostPath, + "The minimum ActiveDeadlineSeconds to use for a HostPath Recycler pod. This is for development and testing only and will not work in a multi-node cluster.") + fs.IntVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerIncrementTimeoutHostPath, "pv-recycler-timeout-increment-hostpath", + o.VolumeConfigFlags.PersistentVolumeRecyclerIncrementTimeoutHostPath, + "the increment of time added per Gi to ActiveDeadlineSeconds for a HostPath scrubber pod. "+ + "This is for development and testing only and will not work in a multi-node cluster.") + fs.IntVar(&o.VolumeConfigFlags.PersistentVolumeRecyclerMaximumRetry, "pv-recycler-maximum-retry", + o.VolumeConfigFlags.PersistentVolumeRecyclerMaximumRetry, + "Maximum number of attempts to recycle or delete a persistent volume") + fs.BoolVar(&o.VolumeConfigFlags.EnableHostPathProvisioning, "enable-hostpath-provisioner", o.VolumeConfigFlags.EnableHostPathProvisioning, + "Enable HostPath PV provisioning when running without a cloud provider. This allows testing and development of provisioning features. "+ + "HostPath provisioning is not supported in any way, won't work in a multi-node cluster, and should not be used for anything other than testing or development.") +} diff --git a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go index baf4eae6a5f..4962d420c42 100644 --- a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go @@ -24,7 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/runtime" @@ -55,10 +55,10 @@ func NewPersistentVolumeClaimBinder(kubeClient clientset.Interface, syncPeriod t _, volumeController := framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return kubeClient.Legacy().PersistentVolumes().List(options) + return kubeClient.Core().PersistentVolumes().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return kubeClient.Legacy().PersistentVolumes().Watch(options) + return kubeClient.Core().PersistentVolumes().Watch(options) }, }, &api.PersistentVolume{}, @@ -73,10 +73,10 @@ func NewPersistentVolumeClaimBinder(kubeClient clientset.Interface, syncPeriod t _, claimController := framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return kubeClient.Legacy().PersistentVolumeClaims(api.NamespaceAll).List(options) + return kubeClient.Core().PersistentVolumeClaims(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return kubeClient.Legacy().PersistentVolumeClaims(api.NamespaceAll).Watch(options) + return kubeClient.Core().PersistentVolumeClaims(api.NamespaceAll).Watch(options) }, }, &api.PersistentVolumeClaim{}, @@ -281,13 +281,19 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl if volume.Spec.ClaimRef == nil { return fmt.Errorf("PersistentVolume[%s] expected to be bound but found nil claimRef: %+v", volume.Name, volume) } else { - _, err := binderClient.GetPersistentVolumeClaim(volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name) + claim, err := binderClient.GetPersistentVolumeClaim(volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name) + + // A volume is Released when its bound claim cannot be found in the API server. + // A claim by the same name can be found if deleted and recreated before this controller can release + // the volume from the original claim, so a UID check is necessary. if err != nil { if errors.IsNotFound(err) { nextPhase = api.VolumeReleased } else { return err } + } else if claim != nil && claim.UID != volume.Spec.ClaimRef.UID { + nextPhase = api.VolumeReleased } } @@ -462,29 +468,29 @@ type realBinderClient struct { } func (c *realBinderClient) GetPersistentVolume(name string) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Get(name) + return c.client.Core().PersistentVolumes().Get(name) } func (c *realBinderClient) UpdatePersistentVolume(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Update(volume) + return c.client.Core().PersistentVolumes().Update(volume) } func (c *realBinderClient) DeletePersistentVolume(volume *api.PersistentVolume) error { - return c.client.Legacy().PersistentVolumes().Delete(volume.Name, nil) + return c.client.Core().PersistentVolumes().Delete(volume.Name, nil) } func (c *realBinderClient) UpdatePersistentVolumeStatus(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().UpdateStatus(volume) + return c.client.Core().PersistentVolumes().UpdateStatus(volume) } func (c *realBinderClient) GetPersistentVolumeClaim(namespace, name string) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(namespace).Get(name) + return c.client.Core().PersistentVolumeClaims(namespace).Get(name) } func (c *realBinderClient) UpdatePersistentVolumeClaim(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(claim.Namespace).Update(claim) + return c.client.Core().PersistentVolumeClaims(claim.Namespace).Update(claim) } func (c *realBinderClient) UpdatePersistentVolumeClaimStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(claim.Namespace).UpdateStatus(claim) + return c.client.Core().PersistentVolumeClaims(claim.Namespace).UpdateStatus(claim) } diff --git a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller_test.go b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller_test.go index bdef616d6cf..d68fb095ca5 100644 --- a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller_test.go +++ b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller_test.go @@ -152,6 +152,68 @@ func TestClaimRace(t *testing.T) { } } +func TestNewClaimWithSameNameAsOldClaim(t *testing.T) { + c1 := &api.PersistentVolumeClaim{ + ObjectMeta: api.ObjectMeta{ + Name: "c1", + Namespace: "foo", + UID: "12345", + }, + Spec: api.PersistentVolumeClaimSpec{ + AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce}, + Resources: api.ResourceRequirements{ + Requests: api.ResourceList{ + api.ResourceName(api.ResourceStorage): resource.MustParse("3Gi"), + }, + }, + }, + Status: api.PersistentVolumeClaimStatus{ + Phase: api.ClaimBound, + }, + } + c1.ObjectMeta.SelfLink = testapi.Default.SelfLink("pvc", "") + + v := &api.PersistentVolume{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: api.PersistentVolumeSpec{ + ClaimRef: &api.ObjectReference{ + Name: c1.Name, + Namespace: c1.Namespace, + UID: "45678", + }, + AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce}, + Capacity: api.ResourceList{ + api.ResourceName(api.ResourceStorage): resource.MustParse("10Gi"), + }, + PersistentVolumeSource: api.PersistentVolumeSource{ + HostPath: &api.HostPathVolumeSource{ + Path: "/tmp/data01", + }, + }, + }, + Status: api.PersistentVolumeStatus{ + Phase: api.VolumeBound, + }, + } + + volumeIndex := NewPersistentVolumeOrderedIndex() + mockClient := &mockBinderClient{ + claim: c1, + volume: v, + } + + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(host_path.ProbeRecyclableVolumePlugins(newMockRecycler, volume.VolumeConfig{}), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) + + syncVolume(volumeIndex, mockClient, v) + if mockClient.volume.Status.Phase != api.VolumeReleased { + t.Errorf("Expected phase %s but got %s", api.VolumeReleased, mockClient.volume.Status.Phase) + } + +} + func TestClaimSyncAfterVolumeProvisioning(t *testing.T) { tmpDir, err := utiltesting.MkTmpdir("claimbinder-test") if err != nil { @@ -300,7 +362,7 @@ func TestExampleObjects(t *testing.T) { clientset.AddReactor("*", "*", core.ObjectReaction(o, api.RESTMapper)) if reflect.TypeOf(scenario.expected) == reflect.TypeOf(&api.PersistentVolumeClaim{}) { - pvc, err := clientset.Legacy().PersistentVolumeClaims("ns").Get("doesntmatter") + pvc, err := clientset.Core().PersistentVolumeClaims("ns").Get("doesntmatter") if err != nil { t.Fatalf("Error retrieving object: %v", err) } @@ -321,7 +383,7 @@ func TestExampleObjects(t *testing.T) { } if reflect.TypeOf(scenario.expected) == reflect.TypeOf(&api.PersistentVolume{}) { - pv, err := clientset.Legacy().PersistentVolumes().Get("doesntmatter") + pv, err := clientset.Core().PersistentVolumes().Get("doesntmatter") if err != nil { t.Fatalf("Error retrieving object: %v", err) } @@ -366,7 +428,7 @@ func TestBindingWithExamples(t *testing.T) { clientset := &fake.Clientset{} clientset.AddReactor("*", "*", core.ObjectReaction(o, api.RESTMapper)) - pv, err := clientset.Legacy().PersistentVolumes().Get("any") + pv, err := clientset.Core().PersistentVolumes().Get("any") if err != nil { t.Errorf("Unexpected error getting PV from client: %v", err) } @@ -381,7 +443,7 @@ func TestBindingWithExamples(t *testing.T) { // Test that !Pending gets correctly added pv.Status.Phase = api.VolumeAvailable - claim, error := clientset.Legacy().PersistentVolumeClaims("ns").Get("any") + claim, error := clientset.Core().PersistentVolumeClaims("ns").Get("any") if error != nil { t.Errorf("Unexpected error getting PVC from client: %v", err) } diff --git a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go index 32a30de2a53..ed50edf512e 100644 --- a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go @@ -23,7 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/conversion" @@ -202,7 +202,7 @@ func (controller *PersistentVolumeProvisionerController) reconcileClaim(claim *a claim.Annotations[pvProvisioningRequiredAnnotationKey] = pvProvisioningCompletedAnnotationValue _, err = controller.client.UpdatePersistentVolumeClaim(claim) if err != nil { - glog.Error("error updating persistent volume claim: %v", err) + glog.Errorf("error updating persistent volume claim: %v", err) } return nil @@ -246,7 +246,7 @@ func (controller *PersistentVolumeProvisionerController) reconcileVolume(pv *api glog.V(5).Infof("PersistentVolume[%s] provisioning in progress", pv.Name) err := provisionVolume(pv, controller) if err != nil { - return fmt.Errorf("Error provisioning PersistentVolume[%s]: %v", err) + return fmt.Errorf("Error provisioning PersistentVolume[%s]: %v", pv.Name, err) } return nil @@ -283,7 +283,7 @@ func provisionVolume(pv *api.PersistentVolume, controller *PersistentVolumeProvi if pv, apiErr := controller.client.UpdatePersistentVolumeStatus(pv); apiErr != nil { return fmt.Errorf("PersistentVolume[%s] failed provisioning and also failed status update: %v - %v", pv.Name, err, apiErr) } - return fmt.Errorf("PersistentVolume[%s] failed provisioning : %v", pv.Name, err, err) + return fmt.Errorf("PersistentVolume[%s] failed provisioning: %v", pv.Name, err) } clone, err := conversion.NewCloner().DeepCopy(pv) @@ -382,51 +382,51 @@ type realControllerClient struct { } func (c *realControllerClient) GetPersistentVolume(name string) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Get(name) + return c.client.Core().PersistentVolumes().Get(name) } func (c *realControllerClient) ListPersistentVolumes(options api.ListOptions) (*api.PersistentVolumeList, error) { - return c.client.Legacy().PersistentVolumes().List(options) + return c.client.Core().PersistentVolumes().List(options) } func (c *realControllerClient) WatchPersistentVolumes(options api.ListOptions) (watch.Interface, error) { - return c.client.Legacy().PersistentVolumes().Watch(options) + return c.client.Core().PersistentVolumes().Watch(options) } func (c *realControllerClient) CreatePersistentVolume(pv *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Create(pv) + return c.client.Core().PersistentVolumes().Create(pv) } func (c *realControllerClient) UpdatePersistentVolume(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Update(volume) + return c.client.Core().PersistentVolumes().Update(volume) } func (c *realControllerClient) DeletePersistentVolume(volume *api.PersistentVolume) error { - return c.client.Legacy().PersistentVolumes().Delete(volume.Name, nil) + return c.client.Core().PersistentVolumes().Delete(volume.Name, nil) } func (c *realControllerClient) UpdatePersistentVolumeStatus(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().UpdateStatus(volume) + return c.client.Core().PersistentVolumes().UpdateStatus(volume) } func (c *realControllerClient) GetPersistentVolumeClaim(namespace, name string) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(namespace).Get(name) + return c.client.Core().PersistentVolumeClaims(namespace).Get(name) } func (c *realControllerClient) ListPersistentVolumeClaims(namespace string, options api.ListOptions) (*api.PersistentVolumeClaimList, error) { - return c.client.Legacy().PersistentVolumeClaims(namespace).List(options) + return c.client.Core().PersistentVolumeClaims(namespace).List(options) } func (c *realControllerClient) WatchPersistentVolumeClaims(namespace string, options api.ListOptions) (watch.Interface, error) { - return c.client.Legacy().PersistentVolumeClaims(namespace).Watch(options) + return c.client.Core().PersistentVolumeClaims(namespace).Watch(options) } func (c *realControllerClient) UpdatePersistentVolumeClaim(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(claim.Namespace).Update(claim) + return c.client.Core().PersistentVolumeClaims(claim.Namespace).Update(claim) } func (c *realControllerClient) UpdatePersistentVolumeClaimStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) { - return c.client.Legacy().PersistentVolumeClaims(claim.Namespace).UpdateStatus(claim) + return c.client.Core().PersistentVolumeClaims(claim.Namespace).UpdateStatus(claim) } func (c *realControllerClient) GetKubeClient() clientset.Interface { diff --git a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go index 6362f1c3a17..2b9661ee34a 100644 --- a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go +++ b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" fake_cloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/volume" diff --git a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go index fe1020bde46..3b71aa38056 100644 --- a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go @@ -23,7 +23,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/runtime" @@ -46,15 +46,33 @@ type PersistentVolumeRecycler struct { kubeClient clientset.Interface pluginMgr volume.VolumePluginMgr cloud cloudprovider.Interface + maximumRetry int + syncPeriod time.Duration + // Local cache of failed recycle / delete operations. Map volume.Name -> status of the volume. + // Only PVs in Released state have an entry here. + releasedVolumes map[string]releasedVolumeStatus } -// PersistentVolumeRecycler creates a new PersistentVolumeRecycler -func NewPersistentVolumeRecycler(kubeClient clientset.Interface, syncPeriod time.Duration, plugins []volume.VolumePlugin, cloud cloudprovider.Interface) (*PersistentVolumeRecycler, error) { +// releasedVolumeStatus holds state of failed delete/recycle operation on a +// volume. The controller re-tries the operation several times and it stores +// retry count + timestamp of the last attempt here. +type releasedVolumeStatus struct { + // How many recycle/delete operations failed. + retryCount int + // Timestamp of the last attempt. + lastAttempt time.Time +} + +// NewPersistentVolumeRecycler creates a new PersistentVolumeRecycler +func NewPersistentVolumeRecycler(kubeClient clientset.Interface, syncPeriod time.Duration, maximumRetry int, plugins []volume.VolumePlugin, cloud cloudprovider.Interface) (*PersistentVolumeRecycler, error) { recyclerClient := NewRecyclerClient(kubeClient) recycler := &PersistentVolumeRecycler{ - client: recyclerClient, - kubeClient: kubeClient, - cloud: cloud, + client: recyclerClient, + kubeClient: kubeClient, + cloud: cloud, + maximumRetry: maximumRetry, + syncPeriod: syncPeriod, + releasedVolumes: make(map[string]releasedVolumeStatus), } if err := recycler.pluginMgr.InitPlugins(plugins, recycler); err != nil { @@ -64,10 +82,10 @@ func NewPersistentVolumeRecycler(kubeClient clientset.Interface, syncPeriod time _, volumeController := framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return kubeClient.Legacy().PersistentVolumes().List(options) + return kubeClient.Core().PersistentVolumes().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return kubeClient.Legacy().PersistentVolumes().Watch(options) + return kubeClient.Core().PersistentVolumes().Watch(options) }, }, &api.PersistentVolume{}, @@ -89,6 +107,14 @@ func NewPersistentVolumeRecycler(kubeClient clientset.Interface, syncPeriod time } recycler.reclaimVolume(pv) }, + DeleteFunc: func(obj interface{}) { + pv, ok := obj.(*api.PersistentVolume) + if !ok { + glog.Errorf("Error casting object to PersistentVolume: %v", obj) + return + } + recycler.removeReleasedVolume(pv) + }, }, ) @@ -96,17 +122,50 @@ func NewPersistentVolumeRecycler(kubeClient clientset.Interface, syncPeriod time return recycler, nil } -func (recycler *PersistentVolumeRecycler) reclaimVolume(pv *api.PersistentVolume) error { - if pv.Status.Phase == api.VolumeReleased && pv.Spec.ClaimRef != nil { - glog.V(5).Infof("Reclaiming PersistentVolume[%s]\n", pv.Name) +// shouldRecycle checks a volume and returns nil, if the volume should be +// recycled right now. Otherwise it returns an error with reason why it should +// not be recycled. +func (recycler *PersistentVolumeRecycler) shouldRecycle(pv *api.PersistentVolume) error { + if pv.Spec.ClaimRef == nil { + return fmt.Errorf("Volume does not have a reference to claim") + } + if pv.Status.Phase != api.VolumeReleased { + return fmt.Errorf("The volume is not in 'Released' phase") + } - latest, err := recycler.client.GetPersistentVolume(pv.Name) - if err != nil { - return fmt.Errorf("Could not find PersistentVolume %s", pv.Name) - } - if latest.Status.Phase != api.VolumeReleased { - return fmt.Errorf("PersistentVolume[%s] phase is %s, expected %s. Skipping.", pv.Name, latest.Status.Phase, api.VolumeReleased) - } + // The volume is Released, should we retry recycling? + status, found := recycler.releasedVolumes[pv.Name] + if !found { + // We don't know anything about this volume. The controller has been + // restarted or the volume has been marked as Released by another + // controller. Recycle/delete this volume as if it was just Released. + glog.V(5).Infof("PersistentVolume[%s] not found in local cache, recycling", pv.Name) + return nil + } + + // Check the timestamp + expectedRetry := status.lastAttempt.Add(recycler.syncPeriod) + if time.Now().After(expectedRetry) { + glog.V(5).Infof("PersistentVolume[%s] retrying recycle after timeout", pv.Name) + return nil + } + // It's too early + glog.V(5).Infof("PersistentVolume[%s] skipping recycle, it's too early: now: %v, next retry: %v", pv.Name, time.Now(), expectedRetry) + return fmt.Errorf("Too early after previous failure") +} + +func (recycler *PersistentVolumeRecycler) reclaimVolume(pv *api.PersistentVolume) error { + glog.V(5).Infof("Recycler: checking PersistentVolume[%s]\n", pv.Name) + // Always load the latest version of the volume + newPV, err := recycler.client.GetPersistentVolume(pv.Name) + if err != nil { + return fmt.Errorf("Could not find PersistentVolume %s", pv.Name) + } + pv = newPV + + err = recycler.shouldRecycle(pv) + if err == nil { + glog.V(5).Infof("Reclaiming PersistentVolume[%s]\n", pv.Name) // both handleRecycle and handleDelete block until completion // TODO: allow parallel recycling operations to increase throughput @@ -125,10 +184,41 @@ func (recycler *PersistentVolumeRecycler) reclaimVolume(pv *api.PersistentVolume glog.Errorf(errMsg) return fmt.Errorf(errMsg) } + return nil } + glog.V(3).Infof("PersistentVolume[%s] phase %s - skipping: %v", pv.Name, pv.Status.Phase, err) return nil } +// handleReleaseFailure evaluates a failed Recycle/Delete operation, updates +// internal controller state with new nr. of attempts and timestamp of the last +// attempt. Based on the number of failures it returns the next state of the +// volume (Released / Failed). +func (recycler *PersistentVolumeRecycler) handleReleaseFailure(pv *api.PersistentVolume) api.PersistentVolumePhase { + status, found := recycler.releasedVolumes[pv.Name] + if !found { + // First failure, set retryCount to 0 (will be inceremented few lines below) + status = releasedVolumeStatus{} + } + status.retryCount += 1 + + if status.retryCount > recycler.maximumRetry { + // This was the last attempt. Remove any internal state and mark the + // volume as Failed. + glog.V(3).Infof("PersistentVolume[%s] failed %d times - marking Failed", pv.Name, status.retryCount) + recycler.removeReleasedVolume(pv) + return api.VolumeFailed + } + + status.lastAttempt = time.Now() + recycler.releasedVolumes[pv.Name] = status + return api.VolumeReleased +} + +func (recycler *PersistentVolumeRecycler) removeReleasedVolume(pv *api.PersistentVolume) { + delete(recycler.releasedVolumes, pv.Name) +} + func (recycler *PersistentVolumeRecycler) handleRecycle(pv *api.PersistentVolume) error { glog.V(5).Infof("Recycling PersistentVolume[%s]\n", pv.Name) @@ -154,9 +244,12 @@ func (recycler *PersistentVolumeRecycler) handleRecycle(pv *api.PersistentVolume if err := volRecycler.Recycle(); err != nil { glog.Errorf("PersistentVolume[%s] failed recycling: %+v", pv.Name, err) pv.Status.Message = fmt.Sprintf("Recycling error: %s", err) - nextPhase = api.VolumeFailed + nextPhase = recycler.handleReleaseFailure(pv) } else { glog.V(5).Infof("PersistentVolume[%s] successfully recycled\n", pv.Name) + // The volume has been recycled. Remove any internal state to make + // any subsequent bind+recycle cycle working. + recycler.removeReleasedVolume(pv) nextPhase = api.VolumePending } } @@ -200,9 +293,10 @@ func (recycler *PersistentVolumeRecycler) handleDelete(pv *api.PersistentVolume) if err != nil { glog.Errorf("PersistentVolume[%s] failed deletion: %+v", pv.Name, err) pv.Status.Message = fmt.Sprintf("Deletion error: %s", err) - nextPhase = api.VolumeFailed + nextPhase = recycler.handleReleaseFailure(pv) } else { glog.V(5).Infof("PersistentVolume[%s] successfully deleted through plugin\n", pv.Name) + recycler.removeReleasedVolume(pv) // after successful deletion through the plugin, we can also remove the PV from the cluster if err := recycler.client.DeletePersistentVolume(pv); err != nil { return fmt.Errorf("error deleting persistent volume: %+v", err) @@ -258,19 +352,19 @@ type realRecyclerClient struct { } func (c *realRecyclerClient) GetPersistentVolume(name string) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Get(name) + return c.client.Core().PersistentVolumes().Get(name) } func (c *realRecyclerClient) UpdatePersistentVolume(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().Update(volume) + return c.client.Core().PersistentVolumes().Update(volume) } func (c *realRecyclerClient) DeletePersistentVolume(volume *api.PersistentVolume) error { - return c.client.Legacy().PersistentVolumes().Delete(volume.Name, nil) + return c.client.Core().PersistentVolumes().Delete(volume.Name, nil) } func (c *realRecyclerClient) UpdatePersistentVolumeStatus(volume *api.PersistentVolume) (*api.PersistentVolume, error) { - return c.client.Legacy().PersistentVolumes().UpdateStatus(volume) + return c.client.Core().PersistentVolumes().UpdateStatus(volume) } // PersistentVolumeRecycler is host to the volume plugins, but does not actually mount any volumes. diff --git a/pkg/controller/persistentvolume/persistentvolume_recycler_controller_test.go b/pkg/controller/persistentvolume/persistentvolume_recycler_controller_test.go index ad559a8e52a..9e6b372f30c 100644 --- a/pkg/controller/persistentvolume/persistentvolume_recycler_controller_test.go +++ b/pkg/controller/persistentvolume/persistentvolume_recycler_controller_test.go @@ -17,16 +17,149 @@ limitations under the License. package persistentvolume import ( + "fmt" "testing" + "time" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/volume" + "k8s.io/kubernetes/pkg/volume/host_path" +) + +const ( + mySyncPeriod = 2 * time.Second + myMaximumRetry = 3 ) func TestFailedRecycling(t *testing.T) { - pv := &api.PersistentVolume{ + pv := preparePV() + + mockClient := &mockBinderClient{ + volume: pv, + } + + // no Init called for pluginMgr and no plugins are available. Volume should fail recycling. + plugMgr := volume.VolumePluginMgr{} + + recycler := &PersistentVolumeRecycler{ + kubeClient: fake.NewSimpleClientset(), + client: mockClient, + pluginMgr: plugMgr, + releasedVolumes: make(map[string]releasedVolumeStatus), + } + + err := recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("Unexpected non-nil error: %v", err) + } + + if mockClient.volume.Status.Phase != api.VolumeFailed { + t.Errorf("Expected %s but got %s", api.VolumeFailed, mockClient.volume.Status.Phase) + } + + // Use a new volume for the next test + pv = preparePV() + mockClient.volume = pv + + pv.Spec.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimDelete + err = recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("Unexpected non-nil error: %v", err) + } + + if mockClient.volume.Status.Phase != api.VolumeFailed { + t.Errorf("Expected %s but got %s", api.VolumeFailed, mockClient.volume.Status.Phase) + } +} + +func TestRecyclingRetry(t *testing.T) { + // Test that recycler controller retries to recycle a volume several times, which succeeds eventually + pv := preparePV() + + mockClient := &mockBinderClient{ + volume: pv, + } + + plugMgr := volume.VolumePluginMgr{} + // Use a fake NewRecycler function + plugMgr.InitPlugins(host_path.ProbeRecyclableVolumePlugins(newFailingMockRecycler, volume.VolumeConfig{}), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) + // Reset a global call counter + failedCallCount = 0 + + recycler := &PersistentVolumeRecycler{ + kubeClient: fake.NewSimpleClientset(), + client: mockClient, + pluginMgr: plugMgr, + syncPeriod: mySyncPeriod, + maximumRetry: myMaximumRetry, + releasedVolumes: make(map[string]releasedVolumeStatus), + } + + // All but the last attempt will fail + testRecycleFailures(t, recycler, mockClient, pv, myMaximumRetry-1) + + // The last attempt should succeed + err := recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("Last step: Recycler failed: %v", err) + } + + if mockClient.volume.Status.Phase != api.VolumePending { + t.Errorf("Last step: The volume should be Pending, but is %s instead", mockClient.volume.Status.Phase) + } + // Check the cache, it should not have any entry + status, found := recycler.releasedVolumes[pv.Name] + if found { + t.Errorf("Last step: Expected PV to be removed from cache, got %v", status) + } +} + +func TestRecyclingRetryAlwaysFail(t *testing.T) { + // Test that recycler controller retries to recycle a volume several times, which always fails. + pv := preparePV() + + mockClient := &mockBinderClient{ + volume: pv, + } + + plugMgr := volume.VolumePluginMgr{} + // Use a fake NewRecycler function + plugMgr.InitPlugins(host_path.ProbeRecyclableVolumePlugins(newAlwaysFailingMockRecycler, volume.VolumeConfig{}), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) + // Reset a global call counter + failedCallCount = 0 + + recycler := &PersistentVolumeRecycler{ + kubeClient: fake.NewSimpleClientset(), + client: mockClient, + pluginMgr: plugMgr, + syncPeriod: mySyncPeriod, + maximumRetry: myMaximumRetry, + releasedVolumes: make(map[string]releasedVolumeStatus), + } + + // myMaximumRetry recycle attempts will fail + testRecycleFailures(t, recycler, mockClient, pv, myMaximumRetry) + + // The volume should be failed after myMaximumRetry attempts + err := recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("Last step: Recycler failed: %v", err) + } + + if mockClient.volume.Status.Phase != api.VolumeFailed { + t.Errorf("Last step: The volume should be Failed, but is %s instead", mockClient.volume.Status.Phase) + } + // Check the cache, it should not have any entry + status, found := recycler.releasedVolumes[pv.Name] + if found { + t.Errorf("Last step: Expected PV to be removed from cache, got %v", status) + } +} + +func preparePV() *api.PersistentVolume { + return &api.PersistentVolume{ Spec: api.PersistentVolumeSpec{ AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce}, Capacity: api.ResourceList{ @@ -34,7 +167,7 @@ func TestFailedRecycling(t *testing.T) { }, PersistentVolumeSource: api.PersistentVolumeSource{ HostPath: &api.HostPathVolumeSource{ - Path: "/somepath/data02", + Path: "/tmp/data02", }, }, PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimRecycle, @@ -47,36 +180,85 @@ func TestFailedRecycling(t *testing.T) { Phase: api.VolumeReleased, }, } +} - mockClient := &mockBinderClient{ - volume: pv, - } +// Test that `count` attempts to recycle a PV fails. +func testRecycleFailures(t *testing.T, recycler *PersistentVolumeRecycler, mockClient *mockBinderClient, pv *api.PersistentVolume, count int) { + for i := 1; i <= count; i++ { + err := recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("STEP %d: Recycler faled: %v", i, err) + } - // no Init called for pluginMgr and no plugins are available. Volume should fail recycling. - plugMgr := volume.VolumePluginMgr{} + // Check the status, it should be failed + if mockClient.volume.Status.Phase != api.VolumeReleased { + t.Errorf("STEP %d: The volume should be Released, but is %s instead", i, mockClient.volume.Status.Phase) + } - recycler := &PersistentVolumeRecycler{ - kubeClient: fake.NewSimpleClientset(), - client: mockClient, - pluginMgr: plugMgr, - } + // Check the failed volume cache + status, found := recycler.releasedVolumes[pv.Name] + if !found { + t.Errorf("STEP %d: cannot find released volume status", i) + } + if status.retryCount != i { + t.Errorf("STEP %d: Expected nr. of attempts to be %d, got %d", i, i, status.retryCount) + } - err := recycler.reclaimVolume(pv) - if err != nil { - t.Errorf("Unexpected non-nil error: %v", err) - } + // call reclaimVolume too early, it should not increment the retryCount + time.Sleep(mySyncPeriod / 2) + err = recycler.reclaimVolume(pv) + if err != nil { + t.Errorf("STEP %d: Recycler failed: %v", i, err) + } - if mockClient.volume.Status.Phase != api.VolumeFailed { - t.Errorf("Expected %s but got %s", api.VolumeFailed, mockClient.volume.Status.Phase) - } + status, found = recycler.releasedVolumes[pv.Name] + if !found { + t.Errorf("STEP %d: cannot find released volume status", i) + } + if status.retryCount != i { + t.Errorf("STEP %d: Expected nr. of attempts to be %d, got %d", i, i, status.retryCount) + } - pv.Spec.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimDelete - err = recycler.reclaimVolume(pv) - if err != nil { - t.Errorf("Unexpected non-nil error: %v", err) - } - - if mockClient.volume.Status.Phase != api.VolumeFailed { - t.Errorf("Expected %s but got %s", api.VolumeFailed, mockClient.volume.Status.Phase) + // Call the next reclaimVolume() after full pvRecycleRetryPeriod + time.Sleep(mySyncPeriod / 2) } } + +func newFailingMockRecycler(spec *volume.Spec, host volume.VolumeHost, config volume.VolumeConfig) (volume.Recycler, error) { + return &failingMockRecycler{ + path: spec.PersistentVolume.Spec.HostPath.Path, + errorCount: myMaximumRetry - 1, // fail two times and then successfuly recycle the volume + }, nil +} + +func newAlwaysFailingMockRecycler(spec *volume.Spec, host volume.VolumeHost, config volume.VolumeConfig) (volume.Recycler, error) { + return &failingMockRecycler{ + path: spec.PersistentVolume.Spec.HostPath.Path, + errorCount: 1000, // always fail + }, nil +} + +type failingMockRecycler struct { + path string + // How many times should the recycler fail before returning success. + errorCount int + volume.MetricsNil +} + +// Counter of failingMockRecycler.Recycle() calls. Global variable just for +// testing. It's too much code to create a custom volume plugin, which would +// hold this variable. +var failedCallCount = 0 + +func (r *failingMockRecycler) GetPath() string { + return r.path +} + +func (r *failingMockRecycler) Recycle() error { + failedCallCount += 1 + if failedCallCount <= r.errorCount { + return fmt.Errorf("Failing for %d. time", failedCallCount) + } + // return nil means recycle passed + return nil +} diff --git a/pkg/controller/persistentvolume/types.go b/pkg/controller/persistentvolume/types.go index df9a0bb011f..42ca3680180 100644 --- a/pkg/controller/persistentvolume/types.go +++ b/pkg/controller/persistentvolume/types.go @@ -117,7 +117,7 @@ func (pvIndex *persistentVolumeOrderedIndex) findByClaim(claim *api.PersistentVo continue } - if claim.Name == volume.Spec.ClaimRef.Name && claim.Namespace == volume.Spec.ClaimRef.Namespace { + if claim.Name == volume.Spec.ClaimRef.Name && claim.Namespace == volume.Spec.ClaimRef.Namespace && claim.UID == volume.Spec.ClaimRef.UID { // exact match! No search required. return volume, nil } diff --git a/pkg/controller/podautoscaler/horizontal.go b/pkg/controller/podautoscaler/horizontal.go index 4220f6158fc..4fa3e33716a 100644 --- a/pkg/controller/podautoscaler/horizontal.go +++ b/pkg/controller/podautoscaler/horizontal.go @@ -17,29 +17,35 @@ limitations under the License. package podautoscaler import ( + "encoding/json" "fmt" "math" "time" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/record" - client "k8s.io/kubernetes/pkg/client/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" + unversioned_extensions "k8s.io/kubernetes/pkg/client/typed/generated/extensions/unversioned" "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) const ( // Usage shoud exceed the tolerance before we start downscale or upscale the pods. // TODO: make it a flag or HPA spec element. tolerance = 0.1 + + HpaCustomMetricsTargetAnnotationName = "alpha/target.custom-metrics.podautoscaler.kubernetes.io" + HpaCustomMetricsStatusAnnotationName = "alpha/status.custom-metrics.podautoscaler.kubernetes.io" ) type HorizontalController struct { - scaleNamespacer client.ScaleNamespacer - hpaNamespacer client.HorizontalPodAutoscalersNamespacer + scaleNamespacer unversioned_extensions.ScalesGetter + hpaNamespacer unversioned_extensions.HorizontalPodAutoscalersGetter metricsClient metrics.MetricsClient eventRecorder record.EventRecorder @@ -48,7 +54,7 @@ type HorizontalController struct { var downscaleForbiddenWindow = 5 * time.Minute var upscaleForbiddenWindow = 3 * time.Minute -func NewHorizontalController(evtNamespacer client.EventNamespacer, scaleNamespacer client.ScaleNamespacer, hpaNamespacer client.HorizontalPodAutoscalersNamespacer, metricsClient metrics.MetricsClient) *HorizontalController { +func NewHorizontalController(evtNamespacer unversioned_core.EventsGetter, scaleNamespacer unversioned_extensions.ScalesGetter, hpaNamespacer unversioned_extensions.HorizontalPodAutoscalersGetter, metricsClient metrics.MetricsClient) *HorizontalController { broadcaster := record.NewBroadcaster() broadcaster.StartRecordingToSink(evtNamespacer.Events("")) recorder := broadcaster.NewRecorder(api.EventSource{Component: "horizontal-pod-autoscaler"}) @@ -62,11 +68,11 @@ func NewHorizontalController(evtNamespacer client.EventNamespacer, scaleNamespac } func (a *HorizontalController) Run(syncPeriod time.Duration) { - go util.Until(func() { + go wait.Until(func() { if err := a.reconcileAutoscalers(); err != nil { glog.Errorf("Couldn't reconcile horizontal pod autoscalers: %v", err) } - }, syncPeriod, util.NeverStop) + }, syncPeriod, wait.NeverStop) } func (a *HorizontalController) computeReplicasForCPUUtilization(hpa extensions.HorizontalPodAutoscaler, scale *extensions.Scale) (int, *int, time.Time, error) { @@ -93,6 +99,71 @@ func (a *HorizontalController) computeReplicasForCPUUtilization(hpa extensions.H } } +// Computes the desired number of replicas based on the CustomMetrics passed in cmAnnotation as json-serialized +// extensions.CustomMetricsTargetList. +// Returns number of replicas, status string (also json-serialized extensions.CustomMetricsCurrentStatusList), +// last timestamp of the metrics involved in computations or error, if occurred. +func (a *HorizontalController) computeReplicasForCustomMetrics(hpa extensions.HorizontalPodAutoscaler, scale *extensions.Scale, + cmAnnotation string) (int, string, time.Time, error) { + + currentReplicas := scale.Status.Replicas + replicas := 0 + timestamp := time.Time{} + + if cmAnnotation == "" { + return 0, "", time.Time{}, nil + } + + var targetList extensions.CustomMetricTargetList + if err := json.Unmarshal([]byte(cmAnnotation), &targetList); err != nil { + return 0, "", time.Time{}, fmt.Errorf("failed to parse custom metrics annotation: %v", err) + } + if len(targetList.Items) == 0 { + return 0, "", time.Time{}, fmt.Errorf("no custom metrics in annotation") + } + + statusList := extensions.CustomMetricCurrentStatusList{ + Items: make([]extensions.CustomMetricCurrentStatus, 0), + } + + for _, customMetricTarget := range targetList.Items { + value, currentTimestamp, err := a.metricsClient.GetCustomMetric(customMetricTarget.Name, hpa.Namespace, scale.Status.Selector) + // TODO: what to do on partial errors (like metrics obtained for 75% of pods). + if err != nil { + a.eventRecorder.Event(&hpa, api.EventTypeWarning, "FailedGetCustomMetrics", err.Error()) + return 0, "", time.Time{}, fmt.Errorf("failed to get custom metric value: %v", err) + } + floatTarget := float64(customMetricTarget.TargetValue.MilliValue()) / 1000.0 + usageRatio := *value / floatTarget + + replicaCountProposal := 0 + if math.Abs(1.0-usageRatio) > tolerance { + replicaCountProposal = int(math.Ceil(usageRatio * float64(currentReplicas))) + } else { + replicaCountProposal = currentReplicas + } + if replicaCountProposal > replicas { + timestamp = currentTimestamp + replicas = replicaCountProposal + } + quantity, err := resource.ParseQuantity(fmt.Sprintf("%.3f", *value)) + if err != nil { + return 0, "", time.Time{}, fmt.Errorf("failed to set custom metric value: %v", err) + } + statusList.Items = append(statusList.Items, extensions.CustomMetricCurrentStatus{ + Name: customMetricTarget.Name, + CurrentValue: *quantity, + }) + } + byteStatusList, err := json.Marshal(statusList) + if err != nil { + return 0, "", time.Time{}, fmt.Errorf("failed to serialize custom metric status: %v", err) + } + + return replicas, string(byteStatusList), timestamp, nil + +} + func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodAutoscaler) error { reference := fmt.Sprintf("%s/%s/%s", hpa.Spec.ScaleRef.Kind, hpa.Namespace, hpa.Spec.ScaleRef.Name) @@ -103,10 +174,40 @@ func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodA } currentReplicas := scale.Status.Replicas - desiredReplicas, currentUtilization, timestamp, err := a.computeReplicasForCPUUtilization(hpa, scale) - if err != nil { - a.eventRecorder.Event(&hpa, api.EventTypeWarning, "FailedComputeReplicas", err.Error()) - return fmt.Errorf("failed to compute desired number of replicas based on CPU utilization for %s: %v", reference, err) + cpuDesiredReplicas := 0 + var cpuCurrentUtilization *int = nil + cpuTimestamp := time.Time{} + + cmDesiredReplicas := 0 + cmStatus := "" + cmTimestamp := time.Time{} + + if hpa.Spec.CPUUtilization != nil { + cpuDesiredReplicas, cpuCurrentUtilization, cpuTimestamp, err = a.computeReplicasForCPUUtilization(hpa, scale) + if err != nil { + a.eventRecorder.Event(&hpa, api.EventTypeWarning, "FailedComputeReplicas", err.Error()) + return fmt.Errorf("failed to compute desired number of replicas based on CPU utilization for %s: %v", reference, err) + } + } + + if cmAnnotation, cmAnnotationFound := hpa.Annotations[HpaCustomMetricsTargetAnnotationName]; cmAnnotationFound { + cmDesiredReplicas, cmStatus, cmTimestamp, err = a.computeReplicasForCustomMetrics(hpa, scale, cmAnnotation) + if err != nil { + a.eventRecorder.Event(&hpa, api.EventTypeWarning, "FailedComputeCMReplicas", err.Error()) + return fmt.Errorf("failed to compute desired number of replicas based on Custom Metrics for %s: %v", reference, err) + } + } + + desiredReplicas := 0 + timestamp := time.Time{} + + if cpuDesiredReplicas > desiredReplicas { + desiredReplicas = cpuDesiredReplicas + timestamp = cpuTimestamp + } + if cmDesiredReplicas > desiredReplicas { + desiredReplicas = cmDesiredReplicas + timestamp = cmTimestamp } if hpa.Spec.MinReplicas != nil && desiredReplicas < *hpa.Spec.MinReplicas { @@ -158,9 +259,13 @@ func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodA hpa.Status = extensions.HorizontalPodAutoscalerStatus{ CurrentReplicas: currentReplicas, DesiredReplicas: desiredReplicas, - CurrentCPUUtilizationPercentage: currentUtilization, + CurrentCPUUtilizationPercentage: cpuCurrentUtilization, LastScaleTime: hpa.Status.LastScaleTime, } + if cmStatus != "" { + hpa.Annotations[HpaCustomMetricsStatusAnnotationName] = cmStatus + } + if rescale { now := unversioned.NewTime(time.Now()) hpa.Status.LastScaleTime = &now diff --git a/pkg/controller/podautoscaler/horizontal_test.go b/pkg/controller/podautoscaler/horizontal_test.go index bd0bd63b691..949fe0aed74 100644 --- a/pkg/controller/podautoscaler/horizontal_test.go +++ b/pkg/controller/podautoscaler/horizontal_test.go @@ -27,6 +27,8 @@ import ( "k8s.io/kubernetes/pkg/api/resource" _ "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" @@ -62,12 +64,13 @@ type testCase struct { CPUTarget int reportedLevels []uint64 reportedCPURequests []resource.Quantity + cmTarget *extensions.CustomMetricTargetList scaleUpdated bool eventCreated bool verifyEvents bool } -func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { +func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset { namespace := "test-namespace" hpaName := "test-hpa" rcName := "test-rc" @@ -76,8 +79,8 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { tc.scaleUpdated = false tc.eventCreated = false - fakeClient := &testclient.Fake{} - fakeClient.AddReactor("list", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient := &fake.Clientset{} + fakeClient.AddReactor("list", "horizontalpodautoscalers", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := &extensions.HorizontalPodAutoscalerList{ Items: []extensions.HorizontalPodAutoscaler{ { @@ -101,10 +104,18 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { if tc.CPUTarget > 0.0 { obj.Items[0].Spec.CPUUtilization = &extensions.CPUTargetUtilization{TargetPercentage: tc.CPUTarget} } + if tc.cmTarget != nil { + b, err := json.Marshal(tc.cmTarget) + if err != nil { + t.Fatalf("Failed to marshal cm: %v", err) + } + obj.Items[0].Annotations = make(map[string]string) + obj.Items[0].Annotations[HpaCustomMetricsTargetAnnotationName] = string(b) + } return true, obj, nil }) - fakeClient.AddReactor("get", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("get", "replicationController", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := &extensions.Scale{ ObjectMeta: api.ObjectMeta{ Name: rcName, @@ -121,7 +132,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, obj, nil }) - fakeClient.AddReactor("list", "pods", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("list", "pods", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := &api.PodList{} for i := 0; i < len(tc.reportedCPURequests); i++ { podName := fmt.Sprintf("%s-%d", podNamePrefix, i) @@ -153,7 +164,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, obj, nil }) - fakeClient.AddProxyReactor("services", func(action testclient.Action) (handled bool, ret client.ResponseWrapper, err error) { + fakeClient.AddProxyReactor("services", func(action core.Action) (handled bool, ret client.ResponseWrapper, err error) { timestamp := time.Now() metrics := heapster.MetricResultList{} for _, level := range tc.reportedLevels { @@ -167,7 +178,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, newFakeResponseWrapper(heapsterRawMemResponse), nil }) - fakeClient.AddReactor("update", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("update", "replicationController", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := action.(testclient.UpdateAction).GetObject().(*extensions.Scale) replicas := action.(testclient.UpdateAction).GetObject().(*extensions.Scale).Spec.Replicas assert.Equal(t, tc.desiredReplicas, replicas) @@ -175,7 +186,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, obj, nil }) - fakeClient.AddReactor("update", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("update", "horizontalpodautoscalers", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := action.(testclient.UpdateAction).GetObject().(*extensions.HorizontalPodAutoscaler) assert.Equal(t, namespace, obj.Namespace) assert.Equal(t, hpaName, obj.Name) @@ -183,7 +194,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, obj, nil }) - fakeClient.AddReactor("*", "events", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("*", "events", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := action.(testclient.CreateAction).GetObject().(*api.Event) if tc.verifyEvents { assert.Equal(t, "SuccessfulRescale", obj.Reason) @@ -206,7 +217,7 @@ func (tc *testCase) verifyResults(t *testing.T) { func (tc *testCase) runTest(t *testing.T) { testClient := tc.prepareTestClient(t) metricsClient := metrics.NewHeapsterMetricsClient(testClient, metrics.DefaultHeapsterNamespace, metrics.DefaultHeapsterScheme, metrics.DefaultHeapsterService, metrics.DefaultHeapsterPort) - hpaController := NewHorizontalController(testClient, testClient.Extensions(), testClient.Extensions(), metricsClient) + hpaController := NewHorizontalController(testClient.Core(), testClient.Extensions(), testClient.Extensions(), metricsClient) err := hpaController.reconcileAutoscalers() assert.Equal(t, nil, err) if tc.verifyEvents { @@ -229,6 +240,25 @@ func TestScaleUp(t *testing.T) { tc.runTest(t) } +func TestScaleUpCM(t *testing.T) { + tc := testCase{ + minReplicas: 2, + maxReplicas: 6, + initialReplicas: 3, + desiredReplicas: 4, + CPUTarget: 0, + cmTarget: &extensions.CustomMetricTargetList{ + Items: []extensions.CustomMetricTarget{{ + Name: "qps", + TargetValue: resource.MustParse("15.0"), + }}, + }, + reportedLevels: []uint64{20, 10, 30}, + reportedCPURequests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")}, + } + tc.runTest(t) +} + func TestScaleDown(t *testing.T) { tc := testCase{ minReplicas: 2, @@ -242,6 +272,24 @@ func TestScaleDown(t *testing.T) { tc.runTest(t) } +func TestScaleDownCM(t *testing.T) { + tc := testCase{ + minReplicas: 2, + maxReplicas: 6, + initialReplicas: 5, + desiredReplicas: 3, + CPUTarget: 0, + cmTarget: &extensions.CustomMetricTargetList{ + Items: []extensions.CustomMetricTarget{{ + Name: "qps", + TargetValue: resource.MustParse("20"), + }}}, + reportedLevels: []uint64{12, 12, 12, 12, 12}, + reportedCPURequests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")}, + } + tc.runTest(t) +} + func TestTolerance(t *testing.T) { tc := testCase{ minReplicas: 1, @@ -255,6 +303,23 @@ func TestTolerance(t *testing.T) { tc.runTest(t) } +func TestToleranceCM(t *testing.T) { + tc := testCase{ + minReplicas: 1, + maxReplicas: 5, + initialReplicas: 3, + desiredReplicas: 3, + cmTarget: &extensions.CustomMetricTargetList{ + Items: []extensions.CustomMetricTarget{{ + Name: "qps", + TargetValue: resource.MustParse("20"), + }}}, + reportedLevels: []uint64{20, 21, 21}, + reportedCPURequests: []resource.Quantity{resource.MustParse("0.9"), resource.MustParse("1.0"), resource.MustParse("1.1")}, + } + tc.runTest(t) +} + func TestMinReplicas(t *testing.T) { tc := testCase{ minReplicas: 2, diff --git a/pkg/controller/podautoscaler/metrics/metrics_client.go b/pkg/controller/podautoscaler/metrics/metrics_client.go index a6f15342d6c..12d22a8e32b 100644 --- a/pkg/controller/podautoscaler/metrics/metrics_client.go +++ b/pkg/controller/podautoscaler/metrics/metrics_client.go @@ -24,7 +24,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/labels" heapster "k8s.io/heapster/api/v1/types" @@ -66,7 +66,7 @@ type metricDefinition struct { // HeapsterMetricsClient is Heapster-based implementation of MetricsClient type HeapsterMetricsClient struct { - client client.Interface + client clientset.Interface heapsterNamespace string heapsterScheme string heapsterService string @@ -90,7 +90,7 @@ func getHeapsterCustomMetricDefinition(metricName string) metricDefinition { } // NewHeapsterMetricsClient returns a new instance of Heapster-based implementation of MetricsClient interface. -func NewHeapsterMetricsClient(client client.Interface, namespace, scheme, service, port string) *HeapsterMetricsClient { +func NewHeapsterMetricsClient(client clientset.Interface, namespace, scheme, service, port string) *HeapsterMetricsClient { return &HeapsterMetricsClient{ client: client, heapsterNamespace: namespace, @@ -113,7 +113,7 @@ func (h *HeapsterMetricsClient) GetCpuConsumptionAndRequestInMillis(namespace st avgRequest int64, timestamp time.Time, err error) { labelSelector := labels.SelectorFromSet(labels.Set(selector)) - podList, err := h.client.Pods(namespace). + podList, err := h.client.Core().Pods(namespace). List(api.ListOptions{LabelSelector: labelSelector}) if err != nil { @@ -136,7 +136,7 @@ func (h *HeapsterMetricsClient) GetCpuConsumptionAndRequestInMillis(namespace st if missing || requestSum == 0 { return 0, 0, time.Time{}, fmt.Errorf("some pods do not have request for cpu") } - glog.Infof("Sum of CPU requested: %d", requestSum) + glog.V(4).Infof("%s %v - sum of CPU requested: %d", namespace, selector, requestSum) requestAvg := requestSum / int64(len(podList.Items)) // Consumption is already averaged and in millis. consumption, timestamp, err := h.getForPods(heapsterCpuUsageMetricDefinition, namespace, podNames) @@ -152,7 +152,7 @@ func (h *HeapsterMetricsClient) GetCustomMetric(customMetricName string, namespa metricSpec := getHeapsterCustomMetricDefinition(customMetricName) labelSelector := labels.SelectorFromSet(labels.Set(selector)) - podList, err := h.client.Pods(namespace).List(api.ListOptions{LabelSelector: labelSelector}) + podList, err := h.client.Core().Pods(namespace).List(api.ListOptions{LabelSelector: labelSelector}) if err != nil { return nil, time.Time{}, fmt.Errorf("failed to get pod list: %v", err) @@ -179,7 +179,7 @@ func (h *HeapsterMetricsClient) getForPods(metricSpec metricDefinition, namespac strings.Join(podNames, ","), metricSpec.name) - resultRaw, err := h.client.Services(h.heapsterNamespace). + resultRaw, err := h.client.Core().Services(h.heapsterNamespace). ProxyGet(h.heapsterScheme, h.heapsterService, h.heapsterPort, metricPath, map[string]string{"start": startTime.Format(time.RFC3339)}). DoRaw() @@ -193,7 +193,7 @@ func (h *HeapsterMetricsClient) getForPods(metricSpec metricDefinition, namespac return nil, time.Time{}, fmt.Errorf("failed to unmarshall heapster response: %v", err) } - glog.Infof("Metrics available: %s", string(resultRaw)) + glog.V(4).Infof("Heapster metrics result: %s", string(resultRaw)) sum, count, timestamp := metricSpec.aggregator(metrics) if count != len(podNames) { diff --git a/pkg/controller/podautoscaler/metrics/metrics_client_test.go b/pkg/controller/podautoscaler/metrics/metrics_client_test.go index c87201c0d7a..438f10bddd2 100644 --- a/pkg/controller/podautoscaler/metrics/metrics_client_test.go +++ b/pkg/controller/podautoscaler/metrics/metrics_client_test.go @@ -26,8 +26,9 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" _ "k8s.io/kubernetes/pkg/apimachinery/registered" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/runtime" heapster "k8s.io/heapster/api/v1/types" @@ -70,16 +71,16 @@ type testCase struct { selector map[string]string } -func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { +func (tc *testCase) prepareTestClient(t *testing.T) *fake.Clientset { namespace := "test-namespace" tc.namespace = namespace podNamePrefix := "test-pod" selector := map[string]string{"name": podNamePrefix} tc.selector = selector - fakeClient := &testclient.Fake{} + fakeClient := &fake.Clientset{} - fakeClient.AddReactor("list", "pods", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { + fakeClient.AddReactor("list", "pods", func(action core.Action) (handled bool, ret runtime.Object, err error) { obj := &api.PodList{} for i := 0; i < tc.replicas; i++ { podName := fmt.Sprintf("%s-%d", podNamePrefix, i) @@ -109,7 +110,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { return true, obj, nil }) - fakeClient.AddProxyReactor("services", func(action testclient.Action) (handled bool, ret client.ResponseWrapper, err error) { + fakeClient.AddProxyReactor("services", func(action core.Action) (handled bool, ret client.ResponseWrapper, err error) { metrics := heapster.MetricResultList{} var latestTimestamp time.Time for _, reportedMetricPoints := range tc.reportedMetricsPoints { diff --git a/pkg/controller/replicaset/options/options.go b/pkg/controller/replicaset/options/options.go new file mode 100644 index 00000000000..91951a54927 --- /dev/null +++ b/pkg/controller/replicaset/options/options.go @@ -0,0 +1,35 @@ +/* +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. +*/ + +package options + +import ( + "github.com/spf13/pflag" +) + +type ReplicasetControllerOptions struct { + ConcurrentRSSyncs int +} + +func NewReplicasetControllerOptions() ReplicasetControllerOptions { + return ReplicasetControllerOptions{ + ConcurrentRSSyncs: 5, + } +} + +func (o *ReplicasetControllerOptions) AddFlags(fs *pflag.FlagSet) { + fs.IntVar(&o.ConcurrentRSSyncs, "concurrent-replicaset-syncs", o.ConcurrentRSSyncs, "The number of replicasets that are allowed to sync concurrently. Larger number = more reponsive replica management, but more CPU (and network) load") +} diff --git a/pkg/controller/replicaset/replica_set.go b/pkg/controller/replicaset/replica_set.go index ddd0ae6518a..8ca3393e279 100644 --- a/pkg/controller/replicaset/replica_set.go +++ b/pkg/controller/replicaset/replica_set.go @@ -26,16 +26,17 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" ) @@ -93,7 +94,7 @@ type ReplicaSetController struct { func NewReplicaSetController(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, burstReplicas int) *ReplicaSetController { eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) - eventBroadcaster.StartRecordingToSink(&unversioned_legacy.EventSinkImpl{kubeClient.Legacy().Events("")}) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) rsc := &ReplicaSetController{ kubeClient: kubeClient, @@ -150,10 +151,10 @@ func NewReplicaSetController(kubeClient clientset.Interface, resyncPeriod contro rsc.podStore.Store, rsc.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return rsc.kubeClient.Legacy().Pods(api.NamespaceAll).List(options) + return rsc.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return rsc.kubeClient.Legacy().Pods(api.NamespaceAll).Watch(options) + return rsc.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -187,7 +188,7 @@ func (rsc *ReplicaSetController) Run(workers int, stopCh <-chan struct{}) { go rsc.rsController.Run(stopCh) go rsc.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(rsc.worker, time.Second, stopCh) + go wait.Until(rsc.worker, time.Second, stopCh) } <-stopCh glog.Infof("Shutting down ReplicaSet Controller") @@ -436,7 +437,7 @@ func (rsc *ReplicaSetController) syncReplicaSet(key string) error { return err } rsNeedsSync := rsc.expectations.SatisfiedExpectations(rsKey) - selector, err := extensions.LabelSelectorAsSelector(rs.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { glog.Errorf("Error converting pod selector to selector: %v", err) return err diff --git a/pkg/controller/replicaset/replica_set_test.go b/pkg/controller/replicaset/replica_set_test.go index ce838caa6d3..4476060e432 100644 --- a/pkg/controller/replicaset/replica_set_test.go +++ b/pkg/controller/replicaset/replica_set_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/core" "k8s.io/kubernetes/pkg/client/testing/fake" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -41,6 +41,7 @@ import ( "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" utiltesting "k8s.io/kubernetes/pkg/util/testing" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -66,7 +67,7 @@ func newReplicaSet(replicas int, selectorMap map[string]string) *extensions.Repl }, Spec: extensions.ReplicaSetSpec{ Replicas: replicas, - Selector: &extensions.LabelSelector{MatchLabels: selectorMap}, + Selector: &unversioned.LabelSelector{MatchLabels: selectorMap}, Template: &api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{ @@ -198,7 +199,7 @@ func TestDeleteFinalStateUnknown(t *testing.T) { if key != expected { t.Errorf("Unexpected sync all for ReplicaSet %v, expected %v", key, expected) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Processing DeleteFinalStateUnknown took longer than expected") } } @@ -379,7 +380,7 @@ func TestPodControllerLookup(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "foo"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, @@ -394,7 +395,7 @@ func TestPodControllerLookup(t *testing.T) { { ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.ReplicaSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, @@ -454,14 +455,14 @@ func TestWatchControllers(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.rsController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) testRSSpec.Name = "foo" fakeWatch.Add(&testRSSpec) select { case <-received: - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected 1 call but got 0") } } @@ -498,7 +499,7 @@ func TestWatchPods(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.podController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) pods := newPodList(nil, 1, api.PodRunning, labelMap, testRSSpec) testPod := pods.Items[0] @@ -507,7 +508,7 @@ func TestWatchPods(t *testing.T) { select { case <-received: - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected 1 call but got 0") } } @@ -529,7 +530,7 @@ func TestUpdatePods(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) // Put 2 ReplicaSets and one pod into the controller's stores labelMap1 := map[string]string{"foo": "bar"} @@ -537,7 +538,7 @@ func TestUpdatePods(t *testing.T) { manager.rsStore.Store.Add(testRSSpec1) testRSSpec2 := *testRSSpec1 labelMap2 := map[string]string{"bar": "foo"} - testRSSpec2.Spec.Selector = &extensions.LabelSelector{MatchLabels: labelMap2} + testRSSpec2.Spec.Selector = &unversioned.LabelSelector{MatchLabels: labelMap2} testRSSpec2.Name = "barfoo" manager.rsStore.Store.Add(&testRSSpec2) @@ -558,7 +559,7 @@ func TestUpdatePods(t *testing.T) { if !expected.Has(got) { t.Errorf("Expected keys %#v got %v", expected, got) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected update notifications for replica sets within 100ms each") } } @@ -599,7 +600,7 @@ func TestControllerUpdateRequeue(t *testing.T) { if key != expectedKey { t.Errorf("Expected requeue of replica set with key %s got %s", expectedKey, key) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): manager.queue.ShutDown() t.Errorf("Expected to find a ReplicaSet in the queue, found none.") } diff --git a/pkg/controller/replication/replication_controller.go b/pkg/controller/replication/replication_controller.go index 93b62394b73..b757d3bc0f4 100644 --- a/pkg/controller/replication/replication_controller.go +++ b/pkg/controller/replication/replication_controller.go @@ -27,15 +27,15 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" ) @@ -95,7 +95,7 @@ type ReplicationManager struct { func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, burstReplicas int) *ReplicationManager { eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) - eventBroadcaster.StartRecordingToSink(&unversioned_legacy.EventSinkImpl{kubeClient.Legacy().Events("")}) + eventBroadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) rm := &ReplicationManager{ kubeClient: kubeClient, @@ -111,10 +111,10 @@ func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controll rm.rcStore.Store, rm.rcController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return rm.kubeClient.Legacy().ReplicationControllers(api.NamespaceAll).List(options) + return rm.kubeClient.Core().ReplicationControllers(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return rm.kubeClient.Legacy().ReplicationControllers(api.NamespaceAll).Watch(options) + return rm.kubeClient.Core().ReplicationControllers(api.NamespaceAll).Watch(options) }, }, &api.ReplicationController{}, @@ -152,10 +152,10 @@ func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controll rm.podStore.Store, rm.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return rm.kubeClient.Legacy().Pods(api.NamespaceAll).List(options) + return rm.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return rm.kubeClient.Legacy().Pods(api.NamespaceAll).Watch(options) + return rm.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -191,7 +191,7 @@ func (rm *ReplicationManager) Run(workers int, stopCh <-chan struct{}) { go rm.rcController.Run(stopCh) go rm.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(rm.worker, time.Second, stopCh) + go wait.Until(rm.worker, time.Second, stopCh) } <-stopCh glog.Infof("Shutting down RC Manager") @@ -453,7 +453,7 @@ func (rm *ReplicationManager) syncReplicationController(key string) error { } // Always updates status as pods come up or die. - if err := updateReplicaCount(rm.kubeClient.Legacy().ReplicationControllers(rc.Namespace), rc, len(filteredPods)); err != nil { + if err := updateReplicaCount(rm.kubeClient.Core().ReplicationControllers(rc.Namespace), rc, len(filteredPods)); err != nil { // Multiple things could lead to this update failing. Requeuing the controller ensures // we retry with some fairness. glog.V(2).Infof("Failed to update replica count for controller %v/%v; requeuing; error: %v", rc.Namespace, rc.Name, err) diff --git a/pkg/controller/replication/replication_controller_test.go b/pkg/controller/replication/replication_controller_test.go index b0763129049..b5361d73bee 100644 --- a/pkg/controller/replication/replication_controller_test.go +++ b/pkg/controller/replication/replication_controller_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/core" "k8s.io/kubernetes/pkg/client/testing/fake" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -39,6 +39,7 @@ import ( "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" utiltesting "k8s.io/kubernetes/pkg/util/testing" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -193,7 +194,7 @@ func TestDeleteFinalStateUnknown(t *testing.T) { if key != expected { t.Errorf("Unexpected sync all for rc %v, expected %v", key, expected) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Processing DeleteFinalStateUnknown took longer than expected") } } @@ -441,14 +442,14 @@ func TestWatchControllers(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.rcController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) testControllerSpec.Name = "foo" fakeWatch.Add(&testControllerSpec) select { case <-received: - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected 1 call but got 0") } } @@ -484,7 +485,7 @@ func TestWatchPods(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) go manager.podController.Run(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) pods := newPodList(nil, 1, api.PodRunning, testControllerSpec) testPod := pods.Items[0] @@ -493,7 +494,7 @@ func TestWatchPods(t *testing.T) { select { case <-received: - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected 1 call but got 0") } } @@ -515,7 +516,7 @@ func TestUpdatePods(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) - go util.Until(manager.worker, 10*time.Millisecond, stopCh) + go wait.Until(manager.worker, 10*time.Millisecond, stopCh) // Put 2 rcs and one pod into the controller's stores testControllerSpec1 := newReplicationController(1) @@ -542,7 +543,7 @@ func TestUpdatePods(t *testing.T) { if !expected.Has(got) { t.Errorf("Expected keys %#v got %v", expected, got) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected update notifications for controllers within 100ms each") } } @@ -583,7 +584,7 @@ func TestControllerUpdateRequeue(t *testing.T) { if key != expectedKey { t.Errorf("Expected requeue of controller with key %s got %s", expectedKey, key) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): manager.queue.ShutDown() t.Errorf("Expected to find an rc in the queue, found none.") } @@ -600,7 +601,7 @@ func TestControllerUpdateStatusWithFailure(t *testing.T) { c.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { return true, &api.ReplicationController{}, fmt.Errorf("Fake error") }) - fakeRCClient := c.Legacy().ReplicationControllers("default") + fakeRCClient := c.Core().ReplicationControllers("default") numReplicas := 10 updateReplicaCount(fakeRCClient, *rc, numReplicas) updates, gets := 0, 0 diff --git a/pkg/controller/replication/replication_controller_utils.go b/pkg/controller/replication/replication_controller_utils.go index f052afd8f35..db68d9987cf 100644 --- a/pkg/controller/replication/replication_controller_utils.go +++ b/pkg/controller/replication/replication_controller_utils.go @@ -21,11 +21,11 @@ package replication import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - unversioned_legacy "k8s.io/kubernetes/pkg/client/typed/generated/legacy/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" ) // updateReplicaCount attempts to update the Status.Replicas of the given controller, with a single GET/PUT retry. -func updateReplicaCount(rcClient unversioned_legacy.ReplicationControllerInterface, controller api.ReplicationController, numReplicas int) (updateErr error) { +func updateReplicaCount(rcClient unversioned_core.ReplicationControllerInterface, controller api.ReplicationController, numReplicas int) (updateErr error) { // This is the steady state. It happens when the rc doesn't have any expectations, since // we do a periodic relist every 30s. If the generations differ but the replicas are // the same, a caller might've resized to the same replica count. diff --git a/pkg/controller/resourcequota/resource_quota_controller.go b/pkg/controller/resourcequota/resource_quota_controller.go index 6dbfa464455..58f0f5444c1 100644 --- a/pkg/controller/resourcequota/resource_quota_controller.go +++ b/pkg/controller/resourcequota/resource_quota_controller.go @@ -24,12 +24,12 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" utilruntime "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/pkg/watch" ) @@ -37,7 +37,7 @@ import ( // ResourceQuotaController is responsible for tracking quota usage status in the system type ResourceQuotaController struct { // Must have authority to list all resources in the system, and update quota status - kubeClient client.Interface + kubeClient clientset.Interface // An index of resource quota objects by namespace rqIndexer cache.Indexer // Watches changes to all resource quota @@ -55,7 +55,7 @@ type ResourceQuotaController struct { } // NewResourceQuotaController creates a new ResourceQuotaController -func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc) *ResourceQuotaController { +func NewResourceQuotaController(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc) *ResourceQuotaController { rq := &ResourceQuotaController{ kubeClient: kubeClient, @@ -66,10 +66,10 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro rq.rqIndexer, rq.rqController = framework.NewIndexerInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return rq.kubeClient.ResourceQuotas(api.NamespaceAll).List(options) + return rq.kubeClient.Core().ResourceQuotas(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return rq.kubeClient.ResourceQuotas(api.NamespaceAll).Watch(options) + return rq.kubeClient.Core().ResourceQuotas(api.NamespaceAll).Watch(options) }, }, &api.ResourceQuota{}, @@ -106,10 +106,10 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro rq.podStore.Store, rq.podController = framework.NewInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return rq.kubeClient.Pods(api.NamespaceAll).List(options) + return rq.kubeClient.Core().Pods(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return rq.kubeClient.Pods(api.NamespaceAll).Watch(options) + return rq.kubeClient.Core().Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, @@ -166,9 +166,9 @@ func (rq *ResourceQuotaController) Run(workers int, stopCh <-chan struct{}) { go rq.rqController.Run(stopCh) go rq.podController.Run(stopCh) for i := 0; i < workers; i++ { - go util.Until(rq.worker, time.Second, stopCh) + go wait.Until(rq.worker, time.Second, stopCh) } - go util.Until(func() { rq.enqueueAll() }, rq.resyncPeriod(), stopCh) + go wait.Until(func() { rq.enqueueAll() }, rq.resyncPeriod(), stopCh) <-stopCh glog.Infof("Shutting down ResourceQuotaController") rq.queue.ShutDown() @@ -265,7 +265,7 @@ func (rq *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e pods := &api.PodList{} if set[api.ResourcePods] || set[api.ResourceMemory] || set[api.ResourceCPU] { - pods, err = rq.kubeClient.Pods(usage.Namespace).List(api.ListOptions{}) + pods, err = rq.kubeClient.Core().Pods(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } @@ -288,31 +288,31 @@ func (rq *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e case api.ResourcePods: value = resource.NewQuantity(int64(len(filteredPods)), resource.DecimalSI) case api.ResourceServices: - items, err := rq.kubeClient.Services(usage.Namespace).List(api.ListOptions{}) + items, err := rq.kubeClient.Core().Services(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceReplicationControllers: - items, err := rq.kubeClient.ReplicationControllers(usage.Namespace).List(api.ListOptions{}) + items, err := rq.kubeClient.Core().ReplicationControllers(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceQuotas: - items, err := rq.kubeClient.ResourceQuotas(usage.Namespace).List(api.ListOptions{}) + items, err := rq.kubeClient.Core().ResourceQuotas(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceSecrets: - items, err := rq.kubeClient.Secrets(usage.Namespace).List(api.ListOptions{}) + items, err := rq.kubeClient.Core().Secrets(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourcePersistentVolumeClaims: - items, err := rq.kubeClient.PersistentVolumeClaims(usage.Namespace).List(api.ListOptions{}) + items, err := rq.kubeClient.Core().PersistentVolumeClaims(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } @@ -334,7 +334,7 @@ func (rq *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e // update the usage only if it changed if dirty { - _, err = rq.kubeClient.ResourceQuotas(usage.Namespace).UpdateStatus(&usage) + _, err = rq.kubeClient.Core().ResourceQuotas(usage.Namespace).UpdateStatus(&usage) return err } return nil diff --git a/pkg/controller/resourcequota/resource_quota_controller_test.go b/pkg/controller/resourcequota/resource_quota_controller_test.go index 42443c1d797..726c8245081 100644 --- a/pkg/controller/resourcequota/resource_quota_controller_test.go +++ b/pkg/controller/resourcequota/resource_quota_controller_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/util/sets" @@ -173,7 +174,7 @@ func TestSyncResourceQuota(t *testing.T) { }, } - kubeClient := testclient.NewSimpleFake(&podList, "a) + kubeClient := fake.NewSimpleClientset(&podList, "a) ResourceQuotaController := NewResourceQuotaController(kubeClient, controller.StaticResyncPeriodFunc(time.Second)) err := ResourceQuotaController.syncResourceQuota(quota) @@ -230,7 +231,7 @@ func TestSyncResourceQuotaSpecChange(t *testing.T) { }, } - kubeClient := testclient.NewSimpleFake("a) + kubeClient := fake.NewSimpleClientset("a) ResourceQuotaController := NewResourceQuotaController(kubeClient, controller.StaticResyncPeriodFunc(time.Second)) err := ResourceQuotaController.syncResourceQuota(quota) @@ -277,7 +278,7 @@ func TestSyncResourceQuotaNoChange(t *testing.T) { }, } - kubeClient := testclient.NewSimpleFake(&api.PodList{}, "a) + kubeClient := fake.NewSimpleClientset(&api.PodList{}, "a) ResourceQuotaController := NewResourceQuotaController(kubeClient, controller.StaticResyncPeriodFunc(time.Second)) err := ResourceQuotaController.syncResourceQuota(quota) diff --git a/pkg/controller/route/routecontroller.go b/pkg/controller/route/routecontroller.go index a54decba46f..f21ee3a57ca 100644 --- a/pkg/controller/route/routecontroller.go +++ b/pkg/controller/route/routecontroller.go @@ -23,19 +23,19 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) type RouteController struct { routes cloudprovider.Routes - kubeClient client.Interface + kubeClient clientset.Interface clusterName string clusterCIDR *net.IPNet } -func New(routes cloudprovider.Routes, kubeClient client.Interface, clusterName string, clusterCIDR *net.IPNet) *RouteController { +func New(routes cloudprovider.Routes, kubeClient clientset.Interface, clusterName string, clusterCIDR *net.IPNet) *RouteController { return &RouteController{ routes: routes, kubeClient: kubeClient, @@ -45,11 +45,11 @@ func New(routes cloudprovider.Routes, kubeClient client.Interface, clusterName s } func (rc *RouteController) Run(syncPeriod time.Duration) { - go util.Until(func() { + go wait.Until(func() { if err := rc.reconcileNodeRoutes(); err != nil { glog.Errorf("Couldn't reconcile node routes: %v", err) } - }, syncPeriod, util.NeverStop) + }, syncPeriod, wait.NeverStop) } func (rc *RouteController) reconcileNodeRoutes() error { @@ -59,7 +59,7 @@ func (rc *RouteController) reconcileNodeRoutes() error { } // TODO (cjcullen): use pkg/controller/framework.NewInformer to watch this // and reduce the number of lists needed. - nodeList, err := rc.kubeClient.Nodes().List(api.ListOptions{}) + nodeList, err := rc.kubeClient.Core().Nodes().List(api.ListOptions{}) if err != nil { return fmt.Errorf("error listing nodes: %v", err) } diff --git a/pkg/controller/service/servicecontroller.go b/pkg/controller/service/servicecontroller.go index 4cc83a549ab..7cec070bf36 100644 --- a/pkg/controller/service/servicecontroller.go +++ b/pkg/controller/service/servicecontroller.go @@ -27,8 +27,9 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" - client "k8s.io/kubernetes/pkg/client/unversioned" + unversioned_core "k8s.io/kubernetes/pkg/client/typed/generated/core/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/types" @@ -67,7 +68,7 @@ type serviceCache struct { type ServiceController struct { cloud cloudprovider.Interface - kubeClient client.Interface + kubeClient clientset.Interface clusterName string balancer cloudprovider.LoadBalancer zone cloudprovider.Zone @@ -79,9 +80,9 @@ type ServiceController struct { // New returns a new service controller to keep cloud provider service resources // (like load balancers) in sync with the registry. -func New(cloud cloudprovider.Interface, kubeClient client.Interface, clusterName string) *ServiceController { +func New(cloud cloudprovider.Interface, kubeClient clientset.Interface, clusterName string) *ServiceController { broadcaster := record.NewBroadcaster() - broadcaster.StartRecordingToSink(kubeClient.Events("")) + broadcaster.StartRecordingToSink(&unversioned_core.EventSinkImpl{kubeClient.Core().Events("")}) recorder := broadcaster.NewRecorder(api.EventSource{Component: "service-controller"}) return &ServiceController{ @@ -115,8 +116,8 @@ func (s *ServiceController) Run(serviceSyncPeriod, nodeSyncPeriod time.Duration) // We have to make this check beecause the ListWatch that we use in // WatchServices requires Client functions that aren't in the interface // for some reason. - if _, ok := s.kubeClient.(*client.Client); !ok { - return fmt.Errorf("ServiceController only works with real Client objects, but was passed something else satisfying the client Interface.") + if _, ok := s.kubeClient.(*clientset.Clientset); !ok { + return fmt.Errorf("ServiceController only works with real Client objects, but was passed something else satisfying the clientset.Interface.") } // Get the currently existing set of services and then all future creates @@ -133,13 +134,13 @@ func (s *ServiceController) Run(serviceSyncPeriod, nodeSyncPeriod time.Duration) }), s.cache, ) - lw := cache.NewListWatchFromClient(s.kubeClient.(*client.Client), "services", api.NamespaceAll, fields.Everything()) + lw := cache.NewListWatchFromClient(s.kubeClient.(*clientset.Clientset).CoreClient, "services", api.NamespaceAll, fields.Everything()) cache.NewReflector(lw, &api.Service{}, serviceQueue, serviceSyncPeriod).Run() for i := 0; i < workerGoroutines; i++ { go s.watchServices(serviceQueue) } - nodeLW := cache.NewListWatchFromClient(s.kubeClient.(*client.Client), "nodes", api.NamespaceAll, fields.Everything()) + nodeLW := cache.NewListWatchFromClient(s.kubeClient.(*clientset.Clientset).CoreClient, "nodes", api.NamespaceAll, fields.Everything()) cache.NewReflector(nodeLW, &api.Node{}, s.nodeLister.Store, 0).Run() go s.nodeSyncLoop(nodeSyncPeriod) return nil @@ -273,7 +274,7 @@ func (s *ServiceController) processDelta(delta *cache.Delta) (error, bool) { // Returns whatever error occurred along with a boolean indicator of whether it // should be retried. func (s *ServiceController) createLoadBalancerIfNeeded(namespacedName types.NamespacedName, service, appliedState *api.Service) (error, bool) { - if appliedState != nil && !needsUpdate(appliedState, service) { + if appliedState != nil && !s.needsUpdate(appliedState, service) { glog.Infof("LB already exists and doesn't need update for service %s", namespacedName) return nil, notRetryable } @@ -320,7 +321,7 @@ func (s *ServiceController) createLoadBalancerIfNeeded(namespacedName types.Name // The load balancer doesn't exist yet, so create it. s.eventRecorder.Event(service, api.EventTypeNormal, "CreatingLoadBalancer", "Creating load balancer") - err := s.createLoadBalancer(service) + err := s.createLoadBalancer(service, namespacedName) if err != nil { return fmt.Errorf("Failed to create load balancer for service %s: %v", namespacedName, err), retryable } @@ -343,7 +344,7 @@ func (s *ServiceController) createLoadBalancerIfNeeded(namespacedName types.Name func (s *ServiceController) persistUpdate(service *api.Service) error { var err error for i := 0; i < clientRetryCount; i++ { - _, err = s.kubeClient.Services(service.Namespace).UpdateStatus(service) + _, err = s.kubeClient.Core().Services(service.Namespace).UpdateStatus(service) if err == nil { return nil } @@ -351,24 +352,26 @@ func (s *ServiceController) persistUpdate(service *api.Service) error { // out so that we can process the delete, which we should soon be receiving // if we haven't already. if errors.IsNotFound(err) { - glog.Infof("Not persisting update to service that no longer exists: %v", err) + glog.Infof("Not persisting update to service '%s/%s' that no longer exists: %v", + service.Namespace, service.Name, err) return nil } // TODO: Try to resolve the conflict if the change was unrelated to load // balancer status. For now, just rely on the fact that we'll // also process the update that caused the resource version to change. if errors.IsConflict(err) { - glog.V(4).Infof("Not persisting update to service that has been changed since we received it: %v", err) + glog.V(4).Infof("Not persisting update to service '%s/%s' that has been changed since we received it: %v", + service.Namespace, service.Name, err) return nil } - glog.Warningf("Failed to persist updated LoadBalancerStatus to service %s after creating its load balancer: %v", - service.Name, err) + glog.Warningf("Failed to persist updated LoadBalancerStatus to service '%s/%s' after creating its load balancer: %v", + service.Namespace, service.Name, err) time.Sleep(clientRetryInterval) } return err } -func (s *ServiceController) createLoadBalancer(service *api.Service) error { +func (s *ServiceController) createLoadBalancer(service *api.Service, serviceName types.NamespacedName) error { ports, err := getPortsForLB(service) if err != nil { return err @@ -382,7 +385,7 @@ func (s *ServiceController) createLoadBalancer(service *api.Service) error { // - Not all cloud providers support all protocols and the next step is expected to return // an error for unsupported protocols status, err := s.balancer.EnsureLoadBalancer(name, s.zone.Region, net.ParseIP(service.Spec.LoadBalancerIP), - ports, hostsFromNodeList(&nodes), service.Spec.SessionAffinity) + ports, hostsFromNodeList(&nodes), serviceName, service.Spec.SessionAffinity) if err != nil { return err } else { @@ -456,24 +459,32 @@ func (s *serviceCache) delete(serviceName string) { delete(s.serviceMap, serviceName) } -func needsUpdate(oldService *api.Service, newService *api.Service) bool { +func (s *ServiceController) needsUpdate(oldService *api.Service, newService *api.Service) bool { if !wantsLoadBalancer(oldService) && !wantsLoadBalancer(newService) { return false } if wantsLoadBalancer(oldService) != wantsLoadBalancer(newService) { + s.eventRecorder.Eventf(newService, api.EventTypeNormal, "Type", "%v -> %v", + oldService.Spec.Type, newService.Spec.Type) return true } if !portsEqualForLB(oldService, newService) || oldService.Spec.SessionAffinity != newService.Spec.SessionAffinity { return true } if !loadBalancerIPsAreEqual(oldService, newService) { + s.eventRecorder.Eventf(newService, api.EventTypeNormal, "LoadbalancerIP", "%v -> %v", + oldService.Spec.LoadBalancerIP, newService.Spec.LoadBalancerIP) return true } if len(oldService.Spec.ExternalIPs) != len(newService.Spec.ExternalIPs) { + s.eventRecorder.Eventf(newService, api.EventTypeNormal, "ExternalIP", "Count: %v -> %v", + len(oldService.Spec.ExternalIPs), len(newService.Spec.ExternalIPs)) return true } for i := range oldService.Spec.ExternalIPs { if oldService.Spec.ExternalIPs[i] != newService.Spec.ExternalIPs[i] { + s.eventRecorder.Eventf(newService, api.EventTypeNormal, "ExternalIP", "Added: %v", + newService.Spec.ExternalIPs[i]) return true } } diff --git a/pkg/controller/service/servicecontroller_test.go b/pkg/controller/service/servicecontroller_test.go index 72ae9eb3dc4..26b0fa7b601 100644 --- a/pkg/controller/service/servicecontroller_test.go +++ b/pkg/controller/service/servicecontroller_test.go @@ -21,7 +21,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" fakecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake" "k8s.io/kubernetes/pkg/types" ) @@ -90,7 +90,7 @@ func TestCreateExternalLoadBalancer(t *testing.T) { for _, item := range table { cloud := &fakecloud.FakeCloud{} cloud.Region = region - client := &testclient.Fake{} + client := &fake.Clientset{} controller := New(cloud, client, "test-cluster") controller.init() cloud.Calls = nil // ignore any cloud calls made in init() @@ -210,7 +210,7 @@ func TestUpdateNodesInExternalLoadBalancer(t *testing.T) { cloud := &fakecloud.FakeCloud{} cloud.Region = region - client := &testclient.Fake{} + client := &fake.Clientset{} controller := New(cloud, client, "test-cluster2") controller.init() cloud.Calls = nil // ignore any cloud calls made in init() diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller.go b/pkg/controller/serviceaccount/serviceaccounts_controller.go index c3a355c2aad..1a367d6b24f 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller.go @@ -25,6 +25,7 @@ import ( apierrs "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/fields" @@ -66,7 +67,7 @@ func DefaultServiceAccountsControllerOptions() ServiceAccountsControllerOptions } // NewServiceAccountsController returns a new *ServiceAccountsController. -func NewServiceAccountsController(cl client.Interface, options ServiceAccountsControllerOptions) *ServiceAccountsController { +func NewServiceAccountsController(cl clientset.Interface, options ServiceAccountsControllerOptions) *ServiceAccountsController { e := &ServiceAccountsController{ client: cl, serviceAccountsToEnsure: options.ServiceAccounts, @@ -81,11 +82,11 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = accountSelector - return e.client.ServiceAccounts(api.NamespaceAll).List(options) + return e.client.Core().ServiceAccounts(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = accountSelector - return e.client.ServiceAccounts(api.NamespaceAll).Watch(options) + return e.client.Core().ServiceAccounts(api.NamespaceAll).Watch(options) }, }, &api.ServiceAccount{}, @@ -99,10 +100,10 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo e.namespaces, e.namespaceController = framework.NewIndexerInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return e.client.Namespaces().List(options) + return e.client.Core().Namespaces().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return e.client.Namespaces().Watch(options) + return e.client.Core().Namespaces().Watch(options) }, }, &api.Namespace{}, @@ -121,7 +122,7 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo type ServiceAccountsController struct { stopChan chan struct{} - client client.Interface + client clientset.Interface serviceAccountsToEnsure []api.ServiceAccount serviceAccounts cache.Indexer @@ -216,7 +217,7 @@ func (e *ServiceAccountsController) createServiceAccountIfNeeded(sa api.ServiceA // createDefaultServiceAccount creates a default ServiceAccount in the specified namespace func (e *ServiceAccountsController) createServiceAccount(sa api.ServiceAccount, namespace string) { sa.Namespace = namespace - if _, err := e.client.ServiceAccounts(namespace).Create(&sa); err != nil && !apierrs.IsAlreadyExists(err) { + if _, err := e.client.Core().ServiceAccounts(namespace).Create(&sa); err != nil && !apierrs.IsAlreadyExists(err) { glog.Error(err) } } diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller_test.go b/pkg/controller/serviceaccount/serviceaccounts_controller_test.go index f569e811a52..7294eddc664 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller_test.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller_test.go @@ -20,6 +20,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/util/sets" ) @@ -149,7 +150,7 @@ func TestServiceAccountCreation(t *testing.T) { } for k, tc := range testcases { - client := testclient.NewSimpleFake(defaultServiceAccount, managedServiceAccount) + client := fake.NewSimpleClientset(defaultServiceAccount, managedServiceAccount) options := DefaultServiceAccountsControllerOptions() options.ServiceAccounts = []api.ServiceAccount{ {ObjectMeta: api.ObjectMeta{Name: defaultName}}, diff --git a/pkg/controller/serviceaccount/tokengetter.go b/pkg/controller/serviceaccount/tokengetter.go index 3dfdc415f55..e87fd9096dc 100644 --- a/pkg/controller/serviceaccount/tokengetter.go +++ b/pkg/controller/serviceaccount/tokengetter.go @@ -18,7 +18,7 @@ package serviceaccount import ( "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/registry/generic" "k8s.io/kubernetes/pkg/registry/secret" secretetcd "k8s.io/kubernetes/pkg/registry/secret/etcd" @@ -28,23 +28,23 @@ import ( "k8s.io/kubernetes/pkg/storage" ) -// clientGetter implements ServiceAccountTokenGetter using a client.Interface +// clientGetter implements ServiceAccountTokenGetter using a clientset.Interface type clientGetter struct { - client client.Interface + client clientset.Interface } // NewGetterFromClient returns a ServiceAccountTokenGetter that // uses the specified client to retrieve service accounts and secrets. // The client should NOT authenticate using a service account token // the returned getter will be used to retrieve, or recursion will result. -func NewGetterFromClient(c client.Interface) serviceaccount.ServiceAccountTokenGetter { +func NewGetterFromClient(c clientset.Interface) serviceaccount.ServiceAccountTokenGetter { return clientGetter{c} } func (c clientGetter) GetServiceAccount(namespace, name string) (*api.ServiceAccount, error) { - return c.client.ServiceAccounts(namespace).Get(name) + return c.client.Core().ServiceAccounts(namespace).Get(name) } func (c clientGetter) GetSecret(namespace, name string) (*api.Secret, error) { - return c.client.Secrets(namespace).Get(name) + return c.client.Core().Secrets(namespace).Get(name) } // registryGetter implements ServiceAccountTokenGetter using a service account and secret registry diff --git a/pkg/controller/serviceaccount/tokens_controller.go b/pkg/controller/serviceaccount/tokens_controller.go index e64c9522bd8..59ea09a7081 100644 --- a/pkg/controller/serviceaccount/tokens_controller.go +++ b/pkg/controller/serviceaccount/tokens_controller.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/fields" @@ -61,7 +62,7 @@ type TokensControllerOptions struct { } // NewTokensController returns a new *TokensController. -func NewTokensController(cl client.Interface, options TokensControllerOptions) *TokensController { +func NewTokensController(cl clientset.Interface, options TokensControllerOptions) *TokensController { e := &TokensController{ client: cl, token: options.TokenGenerator, @@ -71,10 +72,10 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return e.client.ServiceAccounts(api.NamespaceAll).List(options) + return e.client.Core().ServiceAccounts(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return e.client.ServiceAccounts(api.NamespaceAll).Watch(options) + return e.client.Core().ServiceAccounts(api.NamespaceAll).Watch(options) }, }, &api.ServiceAccount{}, @@ -92,11 +93,11 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = tokenSelector - return e.client.Secrets(api.NamespaceAll).List(options) + return e.client.Core().Secrets(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = tokenSelector - return e.client.Secrets(api.NamespaceAll).Watch(options) + return e.client.Core().Secrets(api.NamespaceAll).Watch(options) }, }, &api.Secret{}, @@ -119,7 +120,7 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * type TokensController struct { stopChan chan struct{} - client client.Interface + client clientset.Interface token serviceaccount.TokenGenerator rootCA []byte @@ -291,7 +292,7 @@ func (e *TokensController) createSecretIfNeeded(serviceAccount *api.ServiceAccou func (e *TokensController) createSecret(serviceAccount *api.ServiceAccount) error { // We don't want to update the cache's copy of the service account // so add the secret to a freshly retrieved copy of the service account - serviceAccounts := e.client.ServiceAccounts(serviceAccount.Namespace) + serviceAccounts := e.client.Core().ServiceAccounts(serviceAccount.Namespace) liveServiceAccount, err := serviceAccounts.Get(serviceAccount.Name) if err != nil { return err @@ -329,7 +330,7 @@ func (e *TokensController) createSecret(serviceAccount *api.ServiceAccount) erro } // Save the secret - if _, err := e.client.Secrets(serviceAccount.Namespace).Create(secret); err != nil { + if _, err := e.client.Core().Secrets(serviceAccount.Namespace).Create(secret); err != nil { return err } @@ -339,7 +340,7 @@ func (e *TokensController) createSecret(serviceAccount *api.ServiceAccount) erro if err != nil { // we weren't able to use the token, try to clean it up. glog.V(2).Infof("Deleting secret %s/%s because reference couldn't be added (%v)", secret.Namespace, secret.Name, err) - if err := e.client.Secrets(secret.Namespace).Delete(secret.Name); err != nil { + if err := e.client.Core().Secrets(secret.Namespace).Delete(secret.Name, nil); err != nil { glog.Error(err) // if we fail, just log it } } @@ -389,7 +390,7 @@ func (e *TokensController) generateTokenIfNeeded(serviceAccount *api.ServiceAcco secret.Annotations[api.ServiceAccountUIDKey] = string(serviceAccount.UID) // Save the secret - if _, err := e.client.Secrets(secret.Namespace).Update(secret); err != nil { + if _, err := e.client.Core().Secrets(secret.Namespace).Update(secret); err != nil { return err } return nil @@ -397,7 +398,7 @@ func (e *TokensController) generateTokenIfNeeded(serviceAccount *api.ServiceAcco // deleteSecret deletes the given secret func (e *TokensController) deleteSecret(secret *api.Secret) error { - return e.client.Secrets(secret.Namespace).Delete(secret.Name) + return e.client.Core().Secrets(secret.Namespace).Delete(secret.Name, nil) } // removeSecretReferenceIfNeeded updates the given ServiceAccount to remove a reference to the given secretName if needed. @@ -410,7 +411,7 @@ func (e *TokensController) removeSecretReferenceIfNeeded(serviceAccount *api.Ser // We don't want to update the cache's copy of the service account // so remove the secret from a freshly retrieved copy of the service account - serviceAccounts := e.client.ServiceAccounts(serviceAccount.Namespace) + serviceAccounts := e.client.Core().ServiceAccounts(serviceAccount.Namespace) serviceAccount, err := serviceAccounts.Get(serviceAccount.Name) if err != nil { return err @@ -460,7 +461,7 @@ func (e *TokensController) getServiceAccount(secret *api.Secret, fetchOnCacheMis } if fetchOnCacheMiss { - serviceAccount, err := e.client.ServiceAccounts(secret.Namespace).Get(name) + serviceAccount, err := e.client.Core().ServiceAccounts(secret.Namespace).Get(name) if apierrors.IsNotFound(err) { return nil, nil } diff --git a/pkg/controller/serviceaccount/tokens_controller_test.go b/pkg/controller/serviceaccount/tokens_controller_test.go index 2cfbc39373a..e39e752d1c2 100644 --- a/pkg/controller/serviceaccount/tokens_controller_test.go +++ b/pkg/controller/serviceaccount/tokens_controller_test.go @@ -21,7 +21,8 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/runtime" utilrand "k8s.io/kubernetes/pkg/util/rand" ) @@ -179,16 +180,16 @@ func TestTokenCreation(t *testing.T) { UpdatedSecret *api.Secret DeletedSecret *api.Secret - ExpectedActions []testclient.Action + ExpectedActions []core.Action }{ "new serviceaccount with no secrets": { ClientObjects: []runtime.Object{serviceAccount(emptySecretReferences()), createdTokenSecret()}, AddedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), }, }, "new serviceaccount with no secrets with unsynced secret store": { @@ -197,20 +198,20 @@ func TestTokenCreation(t *testing.T) { SecretsSyncPending: true, AddedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), }, }, "new serviceaccount with missing secrets": { ClientObjects: []runtime.Object{serviceAccount(missingSecretReferences()), createdTokenSecret()}, AddedServiceAccount: serviceAccount(missingSecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(missingSecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(missingSecretReferences()))), }, }, "new serviceaccount with missing secrets with unsynced secret store": { @@ -219,16 +220,16 @@ func TestTokenCreation(t *testing.T) { SecretsSyncPending: true, AddedServiceAccount: serviceAccount(missingSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "new serviceaccount with non-token secrets": { ClientObjects: []runtime.Object{serviceAccount(regularSecretReferences()), createdTokenSecret(), opaqueSecret()}, AddedServiceAccount: serviceAccount(regularSecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(regularSecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(regularSecretReferences()))), }, }, "new serviceaccount with token secrets": { @@ -236,14 +237,14 @@ func TestTokenCreation(t *testing.T) { ExistingSecrets: []*api.Secret{serviceAccountTokenSecret()}, AddedServiceAccount: serviceAccount(tokenSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "new serviceaccount with no secrets with resource conflict": { ClientObjects: []runtime.Object{updatedServiceAccount(emptySecretReferences()), createdTokenSecret()}, AddedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), }, }, @@ -251,10 +252,10 @@ func TestTokenCreation(t *testing.T) { ClientObjects: []runtime.Object{serviceAccount(emptySecretReferences()), createdTokenSecret()}, UpdatedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), }, }, "updated serviceaccount with no secrets with unsynced secret store": { @@ -263,20 +264,20 @@ func TestTokenCreation(t *testing.T) { SecretsSyncPending: true, UpdatedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(emptySecretReferences()))), }, }, "updated serviceaccount with missing secrets": { ClientObjects: []runtime.Object{serviceAccount(missingSecretReferences()), createdTokenSecret()}, UpdatedServiceAccount: serviceAccount(missingSecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(missingSecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(missingSecretReferences()))), }, }, "updated serviceaccount with missing secrets with unsynced secret store": { @@ -285,54 +286,54 @@ func TestTokenCreation(t *testing.T) { SecretsSyncPending: true, UpdatedServiceAccount: serviceAccount(missingSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "updated serviceaccount with non-token secrets": { ClientObjects: []runtime.Object{serviceAccount(regularSecretReferences()), createdTokenSecret(), opaqueSecret()}, UpdatedServiceAccount: serviceAccount(regularSecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(regularSecretReferences()))), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewCreateAction("secrets", api.NamespaceDefault, createdTokenSecret()), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(addTokenSecretReference(regularSecretReferences()))), }, }, "updated serviceaccount with token secrets": { ExistingSecrets: []*api.Secret{serviceAccountTokenSecret()}, UpdatedServiceAccount: serviceAccount(tokenSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "updated serviceaccount with no secrets with resource conflict": { ClientObjects: []runtime.Object{updatedServiceAccount(emptySecretReferences()), createdTokenSecret()}, UpdatedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), }, }, "deleted serviceaccount with no secrets": { DeletedServiceAccount: serviceAccount(emptySecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "deleted serviceaccount with missing secrets": { DeletedServiceAccount: serviceAccount(missingSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "deleted serviceaccount with non-token secrets": { ClientObjects: []runtime.Object{opaqueSecret()}, DeletedServiceAccount: serviceAccount(regularSecretReferences()), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "deleted serviceaccount with token secrets": { ClientObjects: []runtime.Object{serviceAccountTokenSecret()}, ExistingSecrets: []*api.Secret{serviceAccountTokenSecret()}, DeletedServiceAccount: serviceAccount(tokenSecretReferences()), - ExpectedActions: []testclient.Action{ - testclient.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), + ExpectedActions: []core.Action{ + core.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), }, }, @@ -340,24 +341,24 @@ func TestTokenCreation(t *testing.T) { ClientObjects: []runtime.Object{serviceAccountTokenSecret()}, AddedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), }, }, "added secret with serviceaccount": { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), AddedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "added token secret without token data": { ClientObjects: []runtime.Object{serviceAccountTokenSecretWithoutTokenData()}, ExistingServiceAccount: serviceAccount(tokenSecretReferences()), AddedSecret: serviceAccountTokenSecretWithoutTokenData(), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, "added token secret without ca data": { @@ -365,8 +366,8 @@ func TestTokenCreation(t *testing.T) { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), AddedSecret: serviceAccountTokenSecretWithoutCAData(), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, "added token secret with mismatched ca data": { @@ -374,8 +375,8 @@ func TestTokenCreation(t *testing.T) { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), AddedSecret: serviceAccountTokenSecretWithCAData([]byte("mismatched")), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, @@ -383,24 +384,24 @@ func TestTokenCreation(t *testing.T) { ClientObjects: []runtime.Object{serviceAccountTokenSecret()}, UpdatedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewDeleteAction("secrets", api.NamespaceDefault, "token-secret-1"), }, }, "updated secret with serviceaccount": { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), UpdatedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "updated token secret without token data": { ClientObjects: []runtime.Object{serviceAccountTokenSecretWithoutTokenData()}, ExistingServiceAccount: serviceAccount(tokenSecretReferences()), UpdatedSecret: serviceAccountTokenSecretWithoutTokenData(), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, "updated token secret without ca data": { @@ -408,8 +409,8 @@ func TestTokenCreation(t *testing.T) { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), UpdatedSecret: serviceAccountTokenSecretWithoutCAData(), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, "updated token secret with mismatched ca data": { @@ -417,30 +418,30 @@ func TestTokenCreation(t *testing.T) { ExistingServiceAccount: serviceAccount(tokenSecretReferences()), UpdatedSecret: serviceAccountTokenSecretWithCAData([]byte("mismatched")), - ExpectedActions: []testclient.Action{ - testclient.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), + ExpectedActions: []core.Action{ + core.NewUpdateAction("secrets", api.NamespaceDefault, serviceAccountTokenSecret()), }, }, "deleted secret without serviceaccount": { DeletedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, "deleted secret with serviceaccount with reference": { ClientObjects: []runtime.Object{serviceAccount(tokenSecretReferences())}, ExistingServiceAccount: serviceAccount(tokenSecretReferences()), DeletedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{ - testclient.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), - testclient.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(emptySecretReferences())), + ExpectedActions: []core.Action{ + core.NewGetAction("serviceaccounts", api.NamespaceDefault, "default"), + core.NewUpdateAction("serviceaccounts", api.NamespaceDefault, serviceAccount(emptySecretReferences())), }, }, "deleted secret with serviceaccount without reference": { ExistingServiceAccount: serviceAccount(emptySecretReferences()), DeletedSecret: serviceAccountTokenSecret(), - ExpectedActions: []testclient.Action{}, + ExpectedActions: []core.Action{}, }, } @@ -451,7 +452,7 @@ func TestTokenCreation(t *testing.T) { generator := &testGenerator{Token: "ABC"} - client := testclient.NewSimpleFake(tc.ClientObjects...) + client := fake.NewSimpleClientset(tc.ClientObjects...) controller := NewTokensController(client, TokensControllerOptions{TokenGenerator: generator, RootCA: []byte("CA Data")}) diff --git a/pkg/genericapiserver/genericapiserver.go b/pkg/genericapiserver/genericapiserver.go index ac1f125aa57..d48942c02ca 100644 --- a/pkg/genericapiserver/genericapiserver.go +++ b/pkg/genericapiserver/genericapiserver.go @@ -24,6 +24,7 @@ import ( "net/http/pprof" "path" "regexp" + "sort" "strconv" "strings" "time" @@ -301,6 +302,10 @@ type GenericAPIServer struct { ProxyTransport http.RoundTripper KubernetesServiceNodePort int + + // Map storing information about all groups to be exposed in discovery response. + // The map is from name to the group. + apiGroupsForDiscovery map[string]unversioned.APIGroup } func (s *GenericAPIServer) StorageDecorator() generic.StorageDecorator { @@ -379,7 +384,10 @@ func setDefaults(c *Config) { // If the caller wants to add additional endpoints not using the GenericAPIServer's // auth, then the caller should create a handler for those endpoints, which delegates the // any unhandled paths to "Handler". -func New(c *Config) *GenericAPIServer { +func New(c *Config) (*GenericAPIServer, error) { + if c.Serializer == nil { + return nil, fmt.Errorf("Genericapiserver.New() called with config.Serializer == nil") + } setDefaults(c) s := &GenericAPIServer{ @@ -415,6 +423,7 @@ func New(c *Config) *GenericAPIServer { ExtraEndpointPorts: c.ExtraEndpointPorts, KubernetesServiceNodePort: c.KubernetesServiceNodePort, + apiGroupsForDiscovery: map[string]unversioned.APIGroup{}, } var handlerContainer *restful.Container @@ -433,7 +442,7 @@ func New(c *Config) *GenericAPIServer { s.init(c) - return s + return s, nil } func (s *GenericAPIServer) NewRequestInfoResolver() *apiserver.RequestInfoResolver { @@ -543,6 +552,8 @@ func (s *GenericAPIServer) init(c *Config) { } else { s.InsecureHandler = handler } + + s.installGroupsDiscoveryHandler() } // Exposes the given group versions in API. @@ -555,6 +566,25 @@ func (s *GenericAPIServer) InstallAPIGroups(groupsInfo []APIGroupInfo) error { return nil } +// Installs handler at /apis to list all group versions for discovery +func (s *GenericAPIServer) installGroupsDiscoveryHandler() { + apiserver.AddApisWebService(s.Serializer, s.HandlerContainer, s.APIGroupPrefix, func() []unversioned.APIGroup { + // Return the list of supported groups in sorted order (to have a deterministic order). + groups := []unversioned.APIGroup{} + groupNames := make([]string, len(s.apiGroupsForDiscovery)) + var i int = 0 + for groupName := range s.apiGroupsForDiscovery { + groupNames[i] = groupName + i++ + } + sort.Strings(groupNames) + for _, groupName := range groupNames { + groups = append(groups, s.apiGroupsForDiscovery[groupName]) + } + return groups + }) +} + func (s *GenericAPIServer) Run(options *ServerRunOptions) { // We serve on 2 ports. See docs/accessing_the_api.md secureLocation := "" @@ -675,6 +705,15 @@ func (s *GenericAPIServer) installAPIGroup(apiGroupInfo *APIGroupInfo) error { // Add a handler at /api to enumerate the supported api versions. apiserver.AddApiWebService(s.Serializer, s.HandlerContainer, apiPrefix, apiVersions) } else { + // Do not register empty group or empty version. Doing so claims /apis/ for the wrong entity to be returned. + // Catching these here places the error much closer to its origin + if len(apiGroupInfo.GroupMeta.GroupVersion.Group) == 0 { + return fmt.Errorf("cannot register handler with an empty group for %#v", *apiGroupInfo) + } + if len(apiGroupInfo.GroupMeta.GroupVersion.Version) == 0 { + return fmt.Errorf("cannot register handler with an empty version for %#v", *apiGroupInfo) + } + // Add a handler at /apis/ to enumerate all versions supported by this group. apiVersionsForDiscovery := []unversioned.GroupVersionForDiscovery{} for _, groupVersion := range apiGroupInfo.GroupMeta.GroupVersions { @@ -692,12 +731,21 @@ func (s *GenericAPIServer) installAPIGroup(apiGroupInfo *APIGroupInfo) error { Versions: apiVersionsForDiscovery, PreferredVersion: preferedVersionForDiscovery, } + s.AddAPIGroupForDiscovery(apiGroup) apiserver.AddGroupWebService(s.Serializer, s.HandlerContainer, apiPrefix+"/"+apiGroup.Name, apiGroup) } apiserver.InstallServiceErrorHandler(s.Serializer, s.HandlerContainer, s.NewRequestInfoResolver(), apiVersions) return nil } +func (s *GenericAPIServer) AddAPIGroupForDiscovery(apiGroup unversioned.APIGroup) { + s.apiGroupsForDiscovery[apiGroup.Name] = apiGroup +} + +func (s *GenericAPIServer) RemoveAPIGroupForDiscovery(groupName string) { + delete(s.apiGroupsForDiscovery, groupName) +} + func (s *GenericAPIServer) getAPIGroupVersion(apiGroupInfo *APIGroupInfo, groupVersion unversioned.GroupVersion, apiPrefix string) (*apiserver.APIGroupVersion, error) { storage := make(map[string]rest.Storage) for k, v := range apiGroupInfo.VersionedResourcesStorageMap[groupVersion.Version] { diff --git a/pkg/genericapiserver/genericapiserver_test.go b/pkg/genericapiserver/genericapiserver_test.go index be22c99e342..6b7209a8218 100644 --- a/pkg/genericapiserver/genericapiserver_test.go +++ b/pkg/genericapiserver/genericapiserver_test.go @@ -54,8 +54,12 @@ func TestNew(t *testing.T) { config.ProxyDialer = func(network, addr string) (net.Conn, error) { return nil, nil } config.ProxyTLSClientConfig = &tls.Config{} + config.Serializer = api.Codecs - s := New(&config) + s, err := New(&config) + if err != nil { + t.Fatalf("Error in bringing up the server: %v", err) + } // Verify many of the variables match their config counterparts assert.Equal(s.enableLogsSupport, config.EnableLogsSupport) @@ -96,7 +100,11 @@ func TestInstallAPIGroups(t *testing.T) { config.APIGroupPrefix = "/apiGroupPrefix" config.Serializer = api.Codecs - s := New(&config) + s, err := New(&config) + if err != nil { + t.Fatalf("Error in bringing up the server: %v", err) + } + apiGroupMeta := registered.GroupOrDie(api.GroupName) extensionsGroupMeta := registered.GroupOrDie(extensions.GroupName) apiGroupsInfo := []APIGroupInfo{ diff --git a/pkg/kubectl/cmd/annotate.go b/pkg/kubectl/cmd/annotate.go index 23ed867bb32..daebf57d1f6 100644 --- a/pkg/kubectl/cmd/annotate.go +++ b/pkg/kubectl/cmd/annotate.go @@ -46,6 +46,9 @@ type AnnotateOptions struct { all bool resourceVersion string + changeCause string + recordChangeCause bool + f *cmdutil.Factory out io.Writer cmd *cobra.Command @@ -111,6 +114,7 @@ func NewCmdAnnotate(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmd.Flags().StringVar(&options.resourceVersion, "resource-version", "", "If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.") usage := "Filename, directory, or URL to a file identifying the resource to update the annotation" kubectl.AddJsonFilenameFlag(cmd, &options.filenames, usage) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -151,6 +155,9 @@ func (o *AnnotateOptions) Complete(f *cmdutil.Factory, out io.Writer, cmd *cobra return err } + o.recordChangeCause = cmdutil.GetRecordFlag(cmd) + o.changeCause = f.Command() + mapper, typer := f.Object() o.builder = resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). ContinueOnError(). @@ -199,6 +206,10 @@ func (o AnnotateOptions) RunAnnotate() error { if err != nil { return err } + // If we should record change-cause, add it to new annotations + if cmdutil.ContainsChangeCause(info) || o.recordChangeCause { + o.newAnnotations[kubectl.ChangeCauseAnnotation] = o.changeCause + } if err := o.updateAnnotations(obj); err != nil { return err } @@ -292,6 +303,10 @@ func validateAnnotations(removeAnnotations []string, newAnnotations map[string]s func validateNoAnnotationOverwrites(meta *api.ObjectMeta, annotations map[string]string) error { var buf bytes.Buffer for key := range annotations { + // change-cause annotation can always be overwritten + if key == kubectl.ChangeCauseAnnotation { + continue + } if value, found := meta.Annotations[key]; found { if buf.Len() > 0 { buf.WriteString("; ") diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index ef63b040092..89c6a6c1f64 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -69,6 +69,7 @@ func NewCmdApply(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmd.MarkFlagRequired("filename") cmdutil.AddValidateFlags(cmd) cmdutil.AddOutputFlagsForMutation(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -132,6 +133,13 @@ func RunApply(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *Ap if err := kubectl.CreateApplyAnnotation(info, encoder); err != nil { return cmdutil.AddSourceToErr("creating", info.Source, err) } + + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil { + return cmdutil.AddSourceToErr("creating", info.Source, err) + } + } + // Then create the resource and skip the three-way merge if err := createAndRefresh(info); err != nil { return cmdutil.AddSourceToErr("creating", info.Source, err) @@ -166,6 +174,17 @@ func RunApply(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *Ap return cmdutil.AddSourceToErr(fmt.Sprintf("applying patch:\n%s\nto:\n%v\nfor:", patch, info), info.Source, err) } + if cmdutil.ShouldRecord(cmd, info) { + patch, err = cmdutil.ChangeResourcePatch(info, f.Command()) + if err != nil { + return err + } + _, err = helper.Patch(info.Namespace, info.Name, api.StrategicMergePatchType, patch) + if err != nil { + return cmdutil.AddSourceToErr(fmt.Sprintf("applying patch:\n%s\nto:\n%v\nfor:", patch, info), info.Source, err) + } + } + count++ cmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, "configured") return nil diff --git a/pkg/kubectl/cmd/autoscale.go b/pkg/kubectl/cmd/autoscale.go index 6647db01180..343c3a8a55d 100644 --- a/pkg/kubectl/cmd/autoscale.go +++ b/pkg/kubectl/cmd/autoscale.go @@ -64,6 +64,7 @@ func NewCmdAutoscale(f *cmdutil.Factory, out io.Writer) *cobra.Command { usage := "Filename, directory, or URL to a file identifying the resource to autoscale." kubectl.AddJsonFilenameFlag(cmd, &filenames, usage) cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -139,6 +140,12 @@ func RunAutoscale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args [] if err != nil { return err } + if cmdutil.ShouldRecord(cmd, hpa) { + if err := cmdutil.RecordChangeCause(hpa.Object, f.Command()); err != nil { + return err + } + object = hpa.Object + } // TODO: extract this flag to a central location, when such a location exists. if cmdutil.GetFlagBool(cmd, "dry-run") { return f.PrintObject(cmd, object, out) diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go index 84f9d54647b..2abffaf3766 100644 --- a/pkg/kubectl/cmd/cmd.go +++ b/pkg/kubectl/cmd/cmd.go @@ -125,6 +125,7 @@ __custom_func() { * persistentvolumeclaims (aka 'pvc') * quota * resourcequotas (aka 'quota') + * replicasets (aka 'rs') * replicationcontrollers (aka 'rc') * secrets * serviceaccounts diff --git a/pkg/kubectl/cmd/cmd_test.go b/pkg/kubectl/cmd/cmd_test.go index 72f4ac867f6..88c2bbc2595 100644 --- a/pkg/kubectl/cmd/cmd_test.go +++ b/pkg/kubectl/cmd/cmd_test.go @@ -124,9 +124,8 @@ func newExternalScheme() (*runtime.Scheme, meta.RESTMapper, runtime.Codec) { for kind := range scheme.KnownTypes(gv) { gvk := gv.WithKind(kind) - mixedCase := false scope := meta.RESTScopeNamespace - mapper.Add(gvk, scope, mixedCase) + mapper.Add(gvk, scope) } } @@ -195,7 +194,7 @@ func NewTestFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) { Describer: func(*meta.RESTMapping) (kubectl.Describer, error) { return t.Describer, t.Err }, - Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { + Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { return t.Printer, t.Err }, Validator: func(validate bool, cacheDir string) (validation.Schema, error) { @@ -253,7 +252,7 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) { Describer: func(*meta.RESTMapping) (kubectl.Describer, error) { return t.Describer, t.Err }, - Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { + Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { return t.Printer, t.Err }, Validator: func(validate bool, cacheDir string) (validation.Schema, error) { @@ -291,6 +290,7 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) { } rf := cmdutil.NewFactory(nil) f.PodSelectorForObject = rf.PodSelectorForObject + f.MapBasedSelectorForObject = rf.MapBasedSelectorForObject f.PortsForObject = rf.PortsForObject f.LabelsForObject = rf.LabelsForObject f.CanBeExposed = rf.CanBeExposed @@ -327,7 +327,7 @@ func stringBody(body string) io.ReadCloser { func ExamplePrintReplicationControllerWithNamespace() { f, tf, codec := NewAPIFactory() - tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, []string{}) + tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, false, []string{}) tf.Client = &fake.RESTClient{ Codec: codec, Client: nil, @@ -369,7 +369,7 @@ func ExamplePrintReplicationControllerWithNamespace() { func ExamplePrintPodWithWideFormat() { f, tf, codec := NewAPIFactory() - tf.Printer = kubectl.NewHumanReadablePrinter(false, false, true, false, false, []string{}) + tf.Printer = kubectl.NewHumanReadablePrinter(false, false, true, false, false, false, []string{}) tf.Client = &fake.RESTClient{ Codec: codec, Client: nil, @@ -402,6 +402,45 @@ func ExamplePrintPodWithWideFormat() { // test1 1/2 podPhase 6 10y kubernetes-minion-abcd } +func ExamplePrintPodWithShowLabels() { + f, tf, codec := NewAPIFactory() + tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, true, false, []string{}) + tf.Client = &fake.RESTClient{ + Codec: codec, + Client: nil, + } + nodeName := "kubernetes-minion-abcd" + cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr) + pod := &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: "test1", + CreationTimestamp: unversioned.Time{Time: time.Now().AddDate(-10, 0, 0)}, + Labels: map[string]string{ + "l1": "key", + "l2": "value", + }, + }, + Spec: api.PodSpec{ + Containers: make([]api.Container, 2), + NodeName: nodeName, + }, + Status: api.PodStatus{ + Phase: "podPhase", + ContainerStatuses: []api.ContainerStatus{ + {Ready: true, RestartCount: 3, State: api.ContainerState{Running: &api.ContainerStateRunning{}}}, + {RestartCount: 3}, + }, + }, + } + err := f.PrintObject(cmd, pod, os.Stdout) + if err != nil { + fmt.Printf("Unexpected error: %v", err) + } + // Output: + // NAME READY STATUS RESTARTS AGE LABELS + // test1 1/2 podPhase 6 10y l1=key,l2=value +} + func newAllPhasePodList() *api.PodList { nodeName := "kubernetes-minion-abcd" return &api.PodList{ @@ -496,7 +535,7 @@ func newAllPhasePodList() *api.PodList { func ExamplePrintPodHideTerminated() { f, tf, codec := NewAPIFactory() - tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, false, []string{}) + tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) tf.Client = &fake.RESTClient{ Codec: codec, Client: nil, @@ -516,7 +555,7 @@ func ExamplePrintPodHideTerminated() { func ExamplePrintPodShowAll() { f, tf, codec := NewAPIFactory() - tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, true, false, []string{}) + tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, true, false, false, []string{}) tf.Client = &fake.RESTClient{ Codec: codec, Client: nil, @@ -538,7 +577,7 @@ func ExamplePrintPodShowAll() { func ExamplePrintServiceWithNamespacesAndLabels() { f, tf, codec := NewAPIFactory() - tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, []string{"l1"}) + tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, false, []string{"l1"}) tf.Client = &fake.RESTClient{ Codec: codec, Client: nil, diff --git a/pkg/kubectl/cmd/config/current_context_test.go b/pkg/kubectl/cmd/config/current_context_test.go index ea40bc2f29b..169c654435a 100644 --- a/pkg/kubectl/cmd/config/current_context_test.go +++ b/pkg/kubectl/cmd/config/current_context_test.go @@ -66,6 +66,7 @@ func (test currentContextTest) run(t *testing.T) { pathOptions := NewDefaultPathOptions() pathOptions.GlobalFile = fakeKubeFile.Name() + pathOptions.EnvVar = "" options := CurrentContextOptions{ ConfigAccess: pathOptions, } diff --git a/pkg/kubectl/cmd/create.go b/pkg/kubectl/cmd/create.go index 10b30ba4ef3..6c4061ea04f 100644 --- a/pkg/kubectl/cmd/create.go +++ b/pkg/kubectl/cmd/create.go @@ -73,6 +73,7 @@ func NewCmdCreate(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddValidateFlags(cmd) cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) // create subcommands cmd.AddCommand(NewCmdCreateNamespace(f, out)) @@ -120,6 +121,12 @@ func RunCreate(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *C return cmdutil.AddSourceToErr("creating", info.Source, err) } + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil { + return cmdutil.AddSourceToErr("creating", info.Source, err) + } + } + if err := createAndRefresh(info); err != nil { return cmdutil.AddSourceToErr("creating", info.Source, err) } diff --git a/pkg/kubectl/cmd/delete.go b/pkg/kubectl/cmd/delete.go index 94973d6e584..7dffd4f9909 100644 --- a/pkg/kubectl/cmd/delete.go +++ b/pkg/kubectl/cmd/delete.go @@ -71,7 +71,7 @@ func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command { // retrieve a list of handled resources from printer as valid args validArgs := []string{} - p, err := f.Printer(nil, false, false, false, false, false, []string{}) + p, err := f.Printer(nil, false, false, false, false, false, false, []string{}) cmdutil.CheckErr(err) if p != nil { validArgs = p.HandledResources() diff --git a/pkg/kubectl/cmd/drain.go b/pkg/kubectl/cmd/drain.go index e05985d74a6..89cba686db3 100644 --- a/pkg/kubectl/cmd/drain.go +++ b/pkg/kubectl/cmd/drain.go @@ -17,6 +17,7 @@ limitations under the License. package cmd import ( + "errors" "fmt" "io" "reflect" @@ -41,6 +42,7 @@ type DrainOptions struct { factory *cmdutil.Factory Force bool GracePeriodSeconds int + IgnoreDaemonsets bool mapper meta.RESTMapper nodeInfo *resource.Info out io.Writer @@ -98,9 +100,12 @@ const ( The given node will be marked unschedulable to prevent new pods from arriving. Then drain deletes all pods except mirror pods (which cannot be deleted through -the API server). If there are any pods that are neither mirror pods nor -managed by a ReplicationController, Job, or DaemonSet, then drain will not -delete any pods unless you use --force. +the API server). If there are DaemonSet-managed pods, drain will not proceed +without --ignore-daemonsets, and regardless it will not delete any +DaemonSet-managed pods, because those pods would be immediately replaced by the +DaemonSet controller, which ignores unschedulable marknigs. If there are any +pods that are neither mirror pods nor managed--by ReplicationController, +DaemonSet or Job--, then drain will not delete any pods unless you use --force. When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again. @@ -127,6 +132,7 @@ func NewCmdDrain(f *cmdutil.Factory, out io.Writer) *cobra.Command { }, } cmd.Flags().BoolVar(&options.Force, "force", false, "Continue even if there are pods not managed by a ReplicationController, Job, or DaemonSet.") + cmd.Flags().BoolVar(&options.IgnoreDaemonsets, "ignore-daemonsets", false, "Ignore DaemonSet-managed pods.") cmd.Flags().IntVar(&options.GracePeriodSeconds, "grace-period", -1, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.") return cmd } @@ -196,6 +202,7 @@ func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) { return pods, err } unreplicatedPodNames := []string{} + daemonSetPodNames := []string{} for _, pod := range podList.Items { _, found := pod.ObjectMeta.Annotations[types.ConfigMirrorAnnotationKey] @@ -204,6 +211,7 @@ func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) { continue } replicated := false + daemonset_pod := false creatorRef, found := pod.ObjectMeta.Annotations[controller.CreatedByAnnotation] if found { @@ -227,7 +235,11 @@ func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) { // gone/missing, not for any other cause. TODO(mml): something more // sophisticated than this if err == nil && ds != nil { - replicated = true + // Otherwise, treat daemonset-managed pods as unmanaged since + // DaemonSet Controller currently ignores the unschedulable bit. + // FIXME(mml): Add link to the issue concerning a proper way to drain + // daemonset pods, probably using taints. + daemonset_pod = true } } else if sr.Reference.Kind == "Job" { job, err := o.client.Jobs(sr.Reference.Namespace).Get(sr.Reference.Name) @@ -240,24 +252,63 @@ func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) { } } } - if replicated || o.Force { - pods = append(pods, pod) - } - if !replicated { + + switch { + case daemonset_pod: + daemonSetPodNames = append(daemonSetPodNames, pod.Name) + case !replicated: unreplicatedPodNames = append(unreplicatedPodNames, pod.Name) + if o.Force { + pods = append(pods, pod) + } + default: + pods = append(pods, pod) } } - if len(unreplicatedPodNames) > 0 { - joined := strings.Join(unreplicatedPodNames, ", ") - if !o.Force { - return pods, fmt.Errorf("refusing to continue due to pods managed by neither a ReplicationController, nor a Job, nor a DaemonSet: %s (use --force to override)", joined) - } - fmt.Fprintf(o.out, "WARNING: About to delete these pods managed by neither a ReplicationController, nor a Job, nor a DaemonSet: %s\n", joined) + daemonSetErrors := !o.IgnoreDaemonsets && len(daemonSetPodNames) > 0 + unreplicatedErrors := !o.Force && len(unreplicatedPodNames) > 0 + + switch { + case daemonSetErrors && unreplicatedErrors: + return []api.Pod{}, errors.New(unmanagedMsg(unreplicatedPodNames, daemonSetPodNames, true)) + case daemonSetErrors && !unreplicatedErrors: + return []api.Pod{}, errors.New(unmanagedMsg([]string{}, daemonSetPodNames, true)) + case unreplicatedErrors && !daemonSetErrors: + return []api.Pod{}, errors.New(unmanagedMsg(unreplicatedPodNames, []string{}, true)) } + + if len(unreplicatedPodNames) > 0 { + fmt.Fprintf(o.out, "WARNING: About to delete these %s\n", unmanagedMsg(unreplicatedPodNames, []string{}, false)) + } + if len(daemonSetPodNames) > 0 { + fmt.Fprintf(o.out, "WARNING: Skipping %s\n", unmanagedMsg([]string{}, daemonSetPodNames, false)) + } + return pods, nil } +// Helper for generating errors or warnings about unmanaged pods. +func unmanagedMsg(unreplicatedNames []string, daemonSetNames []string, include_guidance bool) string { + msgs := []string{} + if len(unreplicatedNames) > 0 { + msg := fmt.Sprintf("pods not managed by ReplicationController, Job, or DaemonSet: %s", strings.Join(unreplicatedNames, ",")) + if include_guidance { + msg += " (use --force to override)" + } + msgs = append(msgs, msg) + } + if len(daemonSetNames) > 0 { + msg := fmt.Sprintf("DaemonSet-managed pods: %s", strings.Join(daemonSetNames, ",")) + if include_guidance { + msg += " (use --ignore-daemonsets to ignore)" + } + msgs = append(msgs, msg) + } + + return strings.Join(msgs, " and ") +} + // deletePods deletes the pods on the api server func (o *DrainOptions) deletePods(pods []api.Pod) error { deleteOptions := api.DeleteOptions{} diff --git a/pkg/kubectl/cmd/drain_test.go b/pkg/kubectl/cmd/drain_test.go index a9691a7fa0d..b0aa36649ae 100644 --- a/pkg/kubectl/cmd/drain_test.go +++ b/pkg/kubectl/cmd/drain_test.go @@ -242,7 +242,7 @@ func TestDrain(t *testing.T) { SelfLink: "/apis/extensions/v1beta1/namespaces/default/daemonsets/ds", }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: labels}, + Selector: &unversioned.LabelSelector{MatchLabels: labels}, }, } @@ -270,7 +270,7 @@ func TestDrain(t *testing.T) { SelfLink: "/apis/extensions/v1beta1/namespaces/default/jobs/job", }, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{MatchLabels: labels}, + Selector: &unversioned.LabelSelector{MatchLabels: labels}, }, } @@ -323,8 +323,18 @@ func TestDrain(t *testing.T) { pods: []api.Pod{ds_pod}, rcs: []api.ReplicationController{rc}, args: []string{"node"}, + expectFatal: true, + expectDelete: false, + }, + { + description: "DS-managed pod with --ignore-daemonsets", + node: node, + expected: cordoned_node, + pods: []api.Pod{ds_pod}, + rcs: []api.ReplicationController{rc}, + args: []string{"node", "--ignore-daemonsets"}, expectFatal: false, - expectDelete: true, + expectDelete: false, }, { description: "Job-managed pod", diff --git a/pkg/kubectl/cmd/edit.go b/pkg/kubectl/cmd/edit.go index e98407bf846..7543c4a0e54 100644 --- a/pkg/kubectl/cmd/edit.go +++ b/pkg/kubectl/cmd/edit.go @@ -97,6 +97,7 @@ func NewCmdEdit(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmd.Flags().String("output-version", "", "Output the formatted object with the given version (default api-version).") cmd.Flags().Bool("windows-line-endings", gruntime.GOOS == "windows", "Use Windows line-endings (default Unix line-endings)") cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -232,6 +233,12 @@ func RunEdit(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []strin if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), updates, encoder); err != nil { return preservedFile(err, file, out) } + if cmdutil.ShouldRecord(cmd, updates) { + err = cmdutil.RecordChangeCause(updates.Object, f.Command()) + if err != nil { + return err + } + } // encode updates back to "edited" since we'll only generate patch from "edited" if edited, err = runtime.Encode(encoder, updates.Object); err != nil { return preservedFile(err, file, out) diff --git a/pkg/kubectl/cmd/explain.go b/pkg/kubectl/cmd/explain.go index b227f628e4d..765091c034a 100644 --- a/pkg/kubectl/cmd/explain.go +++ b/pkg/kubectl/cmd/explain.go @@ -98,7 +98,7 @@ func RunExplain(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st } } - schema, err := f.SwaggerSchema(apiVersion) + schema, err := f.SwaggerSchema(apiVersion.WithKind(gvk.Kind)) if err != nil { return err } diff --git a/pkg/kubectl/cmd/expose.go b/pkg/kubectl/cmd/expose.go index 05469713164..9455065c6cd 100644 --- a/pkg/kubectl/cmd/expose.go +++ b/pkg/kubectl/cmd/expose.go @@ -95,6 +95,7 @@ func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command { usage := "Filename, directory, or URL to a file identifying the resource to expose a service" kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -148,9 +149,9 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str // For objects that need a pod selector, derive it from the exposed object in case a user // didn't explicitly specify one via --selector if s, found := params["selector"]; found && kubectl.IsZero(s) { - s, err := f.PodSelectorForObject(inputObject) + s, err := f.MapBasedSelectorForObject(inputObject) if err != nil { - return cmdutil.UsageError(cmd, fmt.Sprintf("couldn't find selectors via --selector flag or introspection: %s", err)) + return cmdutil.UsageError(cmd, fmt.Sprintf("couldn't retrieve selectors via --selector flag or introspection: %s", err)) } params["selector"] = s } @@ -210,6 +211,12 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str if err != nil { return err } + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(object, f.Command()); err != nil { + return err + } + } + info.Refresh(object, true) // TODO: extract this flag to a central location, when such a location exists. if cmdutil.GetFlagBool(cmd, "dry-run") { return f.PrintObject(cmd, object, out) diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index e20d520ef1b..c8123c9ff5b 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -78,7 +78,7 @@ func NewCmdGet(f *cmdutil.Factory, out io.Writer) *cobra.Command { // retrieve a list of handled resources from printer as valid args validArgs := []string{} - p, err := f.Printer(nil, false, false, false, false, false, []string{}) + p, err := f.Printer(nil, false, false, false, false, false, false, []string{}) cmdutil.CheckErr(err) if p != nil { validArgs = p.HandledResources() diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go index 8069d003f6f..39c401d5204 100644 --- a/pkg/kubectl/cmd/label.go +++ b/pkg/kubectl/cmd/label.go @@ -72,7 +72,7 @@ func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command { // retrieve a list of handled resources from printer as valid args validArgs := []string{} - p, err := f.Printer(nil, false, false, false, false, false, []string{}) + p, err := f.Printer(nil, false, false, false, false, false, false, []string{}) cmdutil.CheckErr(err) if p != nil { validArgs = p.HandledResources() @@ -97,6 +97,7 @@ func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command { usage := "Filename, directory, or URL to a file identifying the resource to update the labels" kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, without sending it.") + cmdutil.AddRecordFlag(cmd) return cmd } @@ -252,6 +253,11 @@ func RunLabel(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri if err := labelFunc(obj, overwrite, resourceVersion, lbls, remove); err != nil { return err } + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(obj, f.Command()); err != nil { + return err + } + } newData, err := json.Marshal(obj) if err != nil { return err diff --git a/pkg/kubectl/cmd/patch.go b/pkg/kubectl/cmd/patch.go index b537adaa186..9bce6f2088f 100644 --- a/pkg/kubectl/cmd/patch.go +++ b/pkg/kubectl/cmd/patch.go @@ -70,6 +70,7 @@ func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmd.Flags().StringP("patch", "p", "", "The patch to be applied to the resource JSON file.") cmd.MarkFlagRequired("patch") cmdutil.AddOutputFlagsForMutation(cmd) + cmdutil.AddRecordFlag(cmd) usage := "Filename, directory, or URL to a file identifying the resource to update" kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) @@ -124,6 +125,16 @@ func RunPatch(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri if err != nil { return err } + if cmdutil.ShouldRecord(cmd, info) { + patchBytes, err = cmdutil.ChangeResourcePatch(info, f.Command()) + if err != nil { + return err + } + _, err = helper.Patch(namespace, name, api.StrategicMergePatchType, patchBytes) + if err != nil { + return err + } + } cmdutil.PrintSuccess(mapper, shortOutput, out, "", name, "patched") return nil } diff --git a/pkg/kubectl/cmd/replace.go b/pkg/kubectl/cmd/replace.go index 226e5c434d0..81eacecbd41 100644 --- a/pkg/kubectl/cmd/replace.go +++ b/pkg/kubectl/cmd/replace.go @@ -84,6 +84,7 @@ func NewCmdReplace(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddValidateFlags(cmd) cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -133,6 +134,12 @@ func RunReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st return cmdutil.AddSourceToErr("replacing", info.Source, err) } + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil { + return cmdutil.AddSourceToErr("replacing", info.Source, err) + } + } + // Serialize the object with the annotation applied. obj, err := resource.NewHelper(info.Client, info.Mapping).Replace(info.Namespace, info.Name, true, info.Object) if err != nil { @@ -220,6 +227,12 @@ func forceReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args [] return err } + if cmdutil.ShouldRecord(cmd, info) { + if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil { + return cmdutil.AddSourceToErr("replacing", info.Source, err) + } + } + obj, err := resource.NewHelper(info.Client, info.Mapping).Create(info.Namespace, true, info.Object) if err != nil { return err diff --git a/pkg/kubectl/cmd/rollingupdate.go b/pkg/kubectl/cmd/rollingupdate.go index 14664310485..c3e79637142 100644 --- a/pkg/kubectl/cmd/rollingupdate.go +++ b/pkg/kubectl/cmd/rollingupdate.go @@ -365,7 +365,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg if err != nil { return err } - _, res := meta.KindToResource(kind, false) + _, res := meta.KindToResource(kind) cmdutil.PrintSuccess(mapper, false, out, res.Resource, oldName, message) return nil } diff --git a/pkg/kubectl/cmd/rollout/rollout.go b/pkg/kubectl/cmd/rollout/rollout.go index 16e77940f28..8fbb53595cf 100644 --- a/pkg/kubectl/cmd/rollout/rollout.go +++ b/pkg/kubectl/cmd/rollout/rollout.go @@ -24,8 +24,9 @@ import ( ) const ( - rollout_long = `rollout manages a deployment using subcommands` - rollout_example = `` + rollout_long = `rollout manages a deployment using subcommands like "kubectl rollout undo deployment/abc"` + rollout_example = `# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc` rollout_valid_resources = `Valid resource types include: * deployments ` @@ -43,7 +44,11 @@ func NewCmdRollout(f *cmdutil.Factory, out io.Writer) *cobra.Command { }, } + // subcommands cmd.AddCommand(NewCmdRolloutHistory(f, out)) + cmd.AddCommand(NewCmdRolloutPause(f, out)) + cmd.AddCommand(NewCmdRolloutResume(f, out)) + cmd.AddCommand(NewCmdRolloutUndo(f, out)) return cmd } diff --git a/pkg/kubectl/cmd/rollout/rollout_pause.go b/pkg/kubectl/cmd/rollout/rollout_pause.go new file mode 100644 index 00000000000..ae07dcefd5f --- /dev/null +++ b/pkg/kubectl/cmd/rollout/rollout_pause.go @@ -0,0 +1,118 @@ +/* +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. +*/ + +package rollout + +import ( + "fmt" + "io" + + "github.com/spf13/cobra" + + "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/kubectl" + cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" + "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/runtime" +) + +// PauseConfig is the start of the data required to perform the operation. As new fields are added, add them here instead of +// referencing the cmd.Flags() +type PauseConfig struct { + PauseObject func(object runtime.Object) (bool, error) + Mapper meta.RESTMapper + Typer runtime.ObjectTyper + Info *resource.Info + + Out io.Writer + Filenames []string +} + +const ( + pause_long = `Mark the provided resource as paused + +Paused resources will not be reconciled by a controller. +Use \"kubectl rollout resume\" to resume a paused resource. +Currently only deployments support being paused.` + + pause_example = `# Mark the nginx deployment as paused. Any current state of +# the deployment will continue its function, new updates to the deployment will not +# have an effect as long as the deployment is paused. +$ kubectl rollout pause deployment/nginx` +) + +func NewCmdRolloutPause(f *cmdutil.Factory, out io.Writer) *cobra.Command { + opts := &PauseConfig{} + + cmd := &cobra.Command{ + Use: "pause RESOURCE", + Short: "Mark the provided resource as paused", + Long: pause_long, + Example: pause_example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(opts.CompletePause(f, cmd, out, args)) + cmdutil.CheckErr(opts.RunPause()) + }, + } + + usage := "Filename, directory, or URL to a file identifying the resource to get from a server." + kubectl.AddJsonFilenameFlag(cmd, &opts.Filenames, usage) + return cmd +} + +func (o *PauseConfig) CompletePause(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, args []string) error { + if len(args) == 0 && len(o.Filenames) == 0 { + return cmdutil.UsageError(cmd, cmd.Use) + } + + o.Mapper, o.Typer = f.Object() + o.PauseObject = f.PauseObject + o.Out = out + + cmdNamespace, enforceNamespace, err := f.DefaultNamespace() + if err != nil { + return err + } + + infos, err := resource.NewBuilder(o.Mapper, o.Typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). + NamespaceParam(cmdNamespace).DefaultNamespace(). + FilenameParam(enforceNamespace, o.Filenames...). + ResourceTypeOrNameArgs(true, args...). + SingleResourceType(). + Latest(). + Do().Infos() + if err != nil { + return err + } + if len(infos) != 1 { + return fmt.Errorf("rollout pause is only supported on individual resources - %d resources were found", len(infos)) + } + o.Info = infos[0] + return nil +} + +func (o PauseConfig) RunPause() error { + isAlreadyPaused, err := o.PauseObject(o.Info.Object) + if err != nil { + return err + } + if isAlreadyPaused { + cmdutil.PrintSuccess(o.Mapper, false, o.Out, o.Info.Mapping.Resource, o.Info.Name, "already paused") + return nil + } + cmdutil.PrintSuccess(o.Mapper, false, o.Out, o.Info.Mapping.Resource, o.Info.Name, "paused") + return nil +} diff --git a/pkg/kubectl/cmd/rollout/rollout_resume.go b/pkg/kubectl/cmd/rollout/rollout_resume.go new file mode 100644 index 00000000000..a38147e75fa --- /dev/null +++ b/pkg/kubectl/cmd/rollout/rollout_resume.go @@ -0,0 +1,116 @@ +/* +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. +*/ + +package rollout + +import ( + "fmt" + "io" + + "github.com/spf13/cobra" + + "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/kubectl" + cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" + "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/runtime" +) + +// ResumeConfig is the start of the data required to perform the operation. As new fields are added, add them here instead of +// referencing the cmd.Flags() +type ResumeConfig struct { + ResumeObject func(object runtime.Object) (bool, error) + Mapper meta.RESTMapper + Typer runtime.ObjectTyper + Info *resource.Info + + Out io.Writer + Filenames []string +} + +const ( + resume_long = `Resume a paused resource + +Paused resources will not be reconciled by a controller. By resuming a +resource, we allow it to be reconciled again. +Currently only deployments support being resumed.` + + resume_example = `# Resume an already paused deployment +$ kubectl rollout resume deployment/nginx` +) + +func NewCmdRolloutResume(f *cmdutil.Factory, out io.Writer) *cobra.Command { + opts := &ResumeConfig{} + + cmd := &cobra.Command{ + Use: "resume RESOURCE", + Short: "Resume a paused resource", + Long: resume_long, + Example: resume_example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(opts.CompleteResume(f, cmd, out, args)) + cmdutil.CheckErr(opts.RunResume()) + }, + } + + usage := "Filename, directory, or URL to a file identifying the resource to get from a server." + kubectl.AddJsonFilenameFlag(cmd, &opts.Filenames, usage) + return cmd +} + +func (o *ResumeConfig) CompleteResume(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, args []string) error { + if len(args) == 0 && len(o.Filenames) == 0 { + return cmdutil.UsageError(cmd, cmd.Use) + } + + o.Mapper, o.Typer = f.Object() + o.ResumeObject = f.ResumeObject + o.Out = out + + cmdNamespace, enforceNamespace, err := f.DefaultNamespace() + if err != nil { + return err + } + + infos, err := resource.NewBuilder(o.Mapper, o.Typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). + NamespaceParam(cmdNamespace).DefaultNamespace(). + FilenameParam(enforceNamespace, o.Filenames...). + ResourceTypeOrNameArgs(true, args...). + SingleResourceType(). + Latest(). + Do().Infos() + if err != nil { + return err + } + if len(infos) != 1 { + return fmt.Errorf("rollout resume is only supported on individual resources - %d resources were found", len(infos)) + } + o.Info = infos[0] + return nil +} + +func (o ResumeConfig) RunResume() error { + isAlreadyResumed, err := o.ResumeObject(o.Info.Object) + if err != nil { + return err + } + if isAlreadyResumed { + cmdutil.PrintSuccess(o.Mapper, false, o.Out, o.Info.Mapping.Resource, o.Info.Name, "already resumed") + return nil + } + cmdutil.PrintSuccess(o.Mapper, false, o.Out, o.Info.Mapping.Resource, o.Info.Name, "resumed") + return nil +} diff --git a/pkg/kubectl/cmd/rollout/rollout_undo.go b/pkg/kubectl/cmd/rollout/rollout_undo.go new file mode 100644 index 00000000000..ccaf429ee76 --- /dev/null +++ b/pkg/kubectl/cmd/rollout/rollout_undo.go @@ -0,0 +1,111 @@ +/* +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. +*/ + +package rollout + +import ( + "fmt" + "io" + + "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/kubectl" + cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" + "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/runtime" + + "github.com/spf13/cobra" +) + +// UndoOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of +// referencing the cmd.Flags() +type UndoOptions struct { + Rollbacker kubectl.Rollbacker + Mapper meta.RESTMapper + Typer runtime.ObjectTyper + Info *resource.Info + ToRevision int64 + Out io.Writer + Filenames []string +} + +const ( + undo_long = `undo rolls back to a previous rollout.` + undo_example = `# Rollback to the previous deployment +$ kubectl rollout undo deployment/abc` +) + +func NewCmdRolloutUndo(f *cmdutil.Factory, out io.Writer) *cobra.Command { + options := &UndoOptions{} + + cmd := &cobra.Command{ + Use: "undo (TYPE NAME | TYPE/NAME) [flags]", + Short: "undoes a previous rollout", + Long: undo_long, + Example: undo_example, + Run: func(cmd *cobra.Command, args []string) { + cmdutil.CheckErr(options.CompleteUndo(f, cmd, out, args)) + cmdutil.CheckErr(options.RunUndo()) + }, + } + + cmd.Flags().Int64("to-revision", 0, "The revision to rollback to. Default to 0 (last revision).") + usage := "Filename, directory, or URL to a file identifying the resource to get from a server." + kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) + return cmd +} + +func (o *UndoOptions) CompleteUndo(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, args []string) error { + if len(args) == 0 && len(o.Filenames) == 0 { + return cmdutil.UsageError(cmd, "Required resource not specified.") + } + + o.ToRevision = cmdutil.GetFlagInt64(cmd, "to-revision") + o.Mapper, o.Typer = f.Object() + o.Out = out + + cmdNamespace, enforceNamespace, err := f.DefaultNamespace() + if err != nil { + return err + } + + infos, err := resource.NewBuilder(o.Mapper, o.Typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). + NamespaceParam(cmdNamespace).DefaultNamespace(). + FilenameParam(enforceNamespace, o.Filenames...). + ResourceTypeOrNameArgs(true, args...). + Latest(). + Flatten(). + Do(). + Infos() + if err != nil { + return err + } + + if len(infos) != 1 { + return fmt.Errorf("rollout undo is only supported on individual resources - %d resources were found", len(infos)) + } + o.Info = infos[0] + o.Rollbacker, err = f.Rollbacker(o.Info.ResourceMapping()) + return err +} + +func (o *UndoOptions) RunUndo() error { + result, err := o.Rollbacker.Rollback(o.Info.Namespace, o.Info.Name, nil, o.ToRevision, o.Info.Object) + if err != nil { + return err + } + cmdutil.PrintSuccess(o.Mapper, false, o.Out, o.Info.Mapping.Resource, o.Info.Name, result) + return nil +} diff --git a/pkg/kubectl/cmd/run.go b/pkg/kubectl/cmd/run.go index e7804bc9de5..78aba153831 100644 --- a/pkg/kubectl/cmd/run.go +++ b/pkg/kubectl/cmd/run.go @@ -83,6 +83,7 @@ func NewCmdRun(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *c cmdutil.AddPrinterFlags(cmd) addRunFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd) + cmdutil.AddRecordFlag(cmd) return cmd } @@ -425,6 +426,15 @@ func createGeneratedObject(f *cmdutil.Factory, cmd *cobra.Command, generator kub return nil, "", nil, nil, err } + annotations, err := mapping.MetadataAccessor.Annotations(obj) + if err != nil { + return nil, "", nil, nil, err + } + if cmdutil.GetRecordFlag(cmd) || len(annotations[kubectl.ChangeCauseAnnotation]) > 0 { + if err := cmdutil.RecordChangeCause(obj, f.Command()); err != nil { + return nil, "", nil, nil, err + } + } // TODO: extract this flag to a central location, when such a location exists. if !cmdutil.GetFlagBool(cmd, "dry-run") { resourceMapper := &resource.Mapper{ diff --git a/pkg/kubectl/cmd/run_test.go b/pkg/kubectl/cmd/run_test.go index 520c7de30d3..8f7ebedbf04 100644 --- a/pkg/kubectl/cmd/run_test.go +++ b/pkg/kubectl/cmd/run_test.go @@ -300,6 +300,7 @@ func TestGenerateService(t *testing.T) { cmd := &cobra.Command{} cmd.Flags().String("output", "", "") cmd.Flags().Bool(cmdutil.ApplyAnnotationsFlag, false, "") + cmd.Flags().Bool("record", false, "Record current kubectl command in the resource annotation.") addRunFlags(cmd) if !test.expectPOST { diff --git a/pkg/kubectl/cmd/scale.go b/pkg/kubectl/cmd/scale.go index 2637fa2b0af..6ffd435661a 100644 --- a/pkg/kubectl/cmd/scale.go +++ b/pkg/kubectl/cmd/scale.go @@ -23,6 +23,7 @@ import ( "github.com/spf13/cobra" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/kubectl" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/resource" @@ -82,6 +83,7 @@ func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command { cmd.MarkFlagRequired("replicas") cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a scale operation, zero means don't wait.") cmdutil.AddOutputFlagsForMutation(cmd) + cmdutil.AddRecordFlag(cmd) usage := "Filename, directory, or URL to a file identifying the resource to set a new size" kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) @@ -149,6 +151,24 @@ func RunScale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri errs = append(errs, err) continue } + if cmdutil.ShouldRecord(cmd, info) { + patchBytes, err := cmdutil.ChangeResourcePatch(info, f.Command()) + if err != nil { + errs = append(errs, err) + continue + } + mapping := info.ResourceMapping() + client, err := f.ClientForMapping(mapping) + if err != nil { + return err + } + helper := resource.NewHelper(client, mapping) + _, err = helper.Patch(info.Namespace, info.Name, api.StrategicMergePatchType, patchBytes) + if err != nil { + errs = append(errs, err) + continue + } + } cmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, "scaled") } diff --git a/pkg/kubectl/cmd/util/factory.go b/pkg/kubectl/cmd/util/factory.go index 4ae94131ce7..77b728d3e5e 100644 --- a/pkg/kubectl/cmd/util/factory.go +++ b/pkg/kubectl/cmd/util/factory.go @@ -27,6 +27,7 @@ import ( "os/user" "path" "strconv" + "strings" "time" "github.com/emicklei/go-restful/swagger" @@ -39,7 +40,7 @@ import ( "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/client/unversioned/clientcmd" "k8s.io/kubernetes/pkg/kubectl" @@ -62,6 +63,7 @@ const ( type Factory struct { clients *ClientCache flags *pflag.FlagSet + cmd string // Returns interfaces for dealing with arbitrary runtime.Objects. Object func() (meta.RESTMapper, runtime.ObjectTyper) @@ -81,25 +83,35 @@ type Factory struct { // Returns a Describer for displaying the specified RESTMapping type or an error. Describer func(mapping *meta.RESTMapping) (kubectl.Describer, error) // Returns a Printer for formatting objects of the given type or an error. - Printer func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) + Printer func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) // Returns a Scaler for changing the size of the specified RESTMapping type or an error Scaler func(mapping *meta.RESTMapping) (kubectl.Scaler, error) // Returns a Reaper for gracefully shutting down resources. Reaper func(mapping *meta.RESTMapping) (kubectl.Reaper, error) // Returns a HistoryViewer for viewing change history HistoryViewer func(mapping *meta.RESTMapping) (kubectl.HistoryViewer, error) + // Returns a Rollbacker for changing the rollback version of the specified RESTMapping type or an error + Rollbacker func(mapping *meta.RESTMapping) (kubectl.Rollbacker, error) // PodSelectorForObject returns the pod selector associated with the provided object PodSelectorForObject func(object runtime.Object) (string, error) + // MapBasedSelectorForObject returns the map-based selector associated with the provided object. If a + // new set-based selector is provided, an error is returned if the selector cannot be converted to a + // map-based selector + MapBasedSelectorForObject func(object runtime.Object) (string, error) // PortsForObject returns the ports associated with the provided object PortsForObject func(object runtime.Object) ([]string, error) // LabelsForObject returns the labels associated with the provided object LabelsForObject func(object runtime.Object) (map[string]string, error) // LogsForObject returns a request for the logs associated with the provided object LogsForObject func(object, options runtime.Object) (*client.Request, error) + // PauseObject marks the provided object as paused ie. it will not be reconciled by its controller. + PauseObject func(object runtime.Object) (bool, error) + // ResumeObject resumes a paused object ie. it will be reconciled by its controller. + ResumeObject func(object runtime.Object) (bool, error) // Returns a schema that can validate objects stored on disk. Validator func(validate bool, cacheDir string) (validation.Schema, error) - // SwaggerSchema returns the schema declaration for the provided group version. - SwaggerSchema func(unversioned.GroupVersion) (*swagger.ApiDeclaration, error) + // SwaggerSchema returns the schema declaration for the provided group version kind. + SwaggerSchema func(unversioned.GroupVersionKind) (*swagger.ApiDeclaration, error) // Returns the default namespace to use in cases where no // other namespace is specified and whether the namespace was // overriden. @@ -178,6 +190,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { return &Factory{ clients: clients, flags: flags, + cmd: recordCommand(os.Args), Object: func() (meta.RESTMapper, runtime.ObjectTyper) { cfg, err := clientConfig.ClientConfig() @@ -229,8 +242,8 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { JSONEncoder: func() runtime.Encoder { return api.Codecs.LegacyCodec(registered.EnabledVersions()...) }, - Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { - return kubectl.NewHumanReadablePrinter(noHeaders, withNamespace, wide, showAll, absoluteTimestamps, columnLabels), nil + Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, showLabels bool, absoluteTimestamps bool, columnLabels []string) (kubectl.ResourcePrinter, error) { + return kubectl.NewHumanReadablePrinter(noHeaders, withNamespace, wide, showAll, showLabels, absoluteTimestamps, columnLabels), nil }, PodSelectorForObject: func(object runtime.Object) (string, error) { // TODO: replace with a swagger schema based approach (identify pod selector via schema introspection) @@ -248,7 +261,41 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { } return kubectl.MakeLabels(t.Spec.Selector), nil case *extensions.Deployment: + selector, err := unversioned.LabelSelectorAsSelector(t.Spec.Selector) + if err != nil { + return "", fmt.Errorf("failed to convert label selector to selector: %v", err) + } + return selector.String(), nil + default: + gvk, err := api.Scheme.ObjectKind(object) + if err != nil { + return "", err + } + return "", fmt.Errorf("cannot extract pod selector from %v", gvk) + } + }, + MapBasedSelectorForObject: func(object runtime.Object) (string, error) { + // TODO: replace with a swagger schema based approach (identify pod selector via schema introspection) + switch t := object.(type) { + case *api.ReplicationController: return kubectl.MakeLabels(t.Spec.Selector), nil + case *api.Pod: + if len(t.Labels) == 0 { + return "", fmt.Errorf("the pod has no labels and cannot be exposed") + } + return kubectl.MakeLabels(t.Labels), nil + case *api.Service: + if t.Spec.Selector == nil { + return "", fmt.Errorf("the service has no pod selector set") + } + return kubectl.MakeLabels(t.Spec.Selector), nil + case *extensions.Deployment: + // TODO(madhusudancs): Make this smarter by admitting MatchExpressions with Equals + // operator, DoubleEquals operator and In operator with only one element in the set. + if len(t.Spec.Selector.MatchExpressions) > 0 { + return "", fmt.Errorf("couldn't convert expressions - \"%+v\" to map-based selector format") + } + return kubectl.MakeLabels(t.Spec.Selector.MatchLabels), nil default: gvk, err := api.Scheme.ObjectKind(object) if err != nil { @@ -300,6 +347,50 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { return nil, fmt.Errorf("cannot get the logs from %v", gvk) } }, + PauseObject: func(object runtime.Object) (bool, error) { + c, err := clients.ClientForVersion(nil) + if err != nil { + return false, err + } + + switch t := object.(type) { + case *extensions.Deployment: + if t.Spec.Paused { + return true, nil + } + t.Spec.Paused = true + _, err := c.Extensions().Deployments(t.Namespace).Update(t) + return false, err + default: + gvk, err := api.Scheme.ObjectKind(object) + if err != nil { + return false, err + } + return false, fmt.Errorf("cannot pause %v", gvk) + } + }, + ResumeObject: func(object runtime.Object) (bool, error) { + c, err := clients.ClientForVersion(nil) + if err != nil { + return false, err + } + + switch t := object.(type) { + case *extensions.Deployment: + if !t.Spec.Paused { + return true, nil + } + t.Spec.Paused = false + _, err := c.Extensions().Deployments(t.Namespace).Update(t) + return false, err + default: + gvk, err := api.Scheme.ObjectKind(object) + if err != nil { + return false, err + } + return false, fmt.Errorf("cannot resume %v", gvk) + } + }, Scaler: func(mapping *meta.RESTMapping) (kubectl.Scaler, error) { mappingVersion := mapping.GroupVersionKind.GroupVersion() client, err := clients.ClientForVersion(&mappingVersion) @@ -325,6 +416,14 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { } return kubectl.HistoryViewerFor(mapping.GroupVersionKind.GroupKind(), clientset) }, + Rollbacker: func(mapping *meta.RESTMapping) (kubectl.Rollbacker, error) { + mappingVersion := mapping.GroupVersionKind.GroupVersion() + client, err := clients.ClientForVersion(&mappingVersion) + if err != nil { + return nil, err + } + return kubectl.RollbackerFor(mapping.GroupVersionKind.GroupKind(), client) + }, Validator: func(validate bool, cacheDir string) (validation.Schema, error) { if validate { client, err := clients.ClientForVersion(nil) @@ -347,7 +446,8 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { } return validation.NullSchema{}, nil }, - SwaggerSchema: func(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error) { + SwaggerSchema: func(gvk unversioned.GroupVersionKind) (*swagger.ApiDeclaration, error) { + version := gvk.GroupVersion() client, err := clients.ClientForVersion(&version) if err != nil { return nil, err @@ -385,11 +485,20 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { } switch t := object.(type) { case *api.ReplicationController: - return GetFirstPod(client, t.Namespace, t.Spec.Selector) + selector := labels.SelectorFromSet(t.Spec.Selector) + return GetFirstPod(client, t.Namespace, selector) case *extensions.Deployment: - return GetFirstPod(client, t.Namespace, t.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(t.Spec.Selector) + if err != nil { + return nil, fmt.Errorf("failed to convert label selector to selector: %v", err) + } + return GetFirstPod(client, t.Namespace, selector) case *extensions.Job: - return GetFirstPod(client, t.Namespace, t.Spec.Selector.MatchLabels) + selector, err := unversioned.LabelSelectorAsSelector(t.Spec.Selector) + if err != nil { + return nil, fmt.Errorf("failed to convert label selector to selector: %v", err) + } + return GetFirstPod(client, t.Namespace, selector) case *api.Pod: return t, nil default: @@ -407,12 +516,11 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { } // GetFirstPod returns the first pod of an object from its namespace and selector -func GetFirstPod(client *client.Client, namespace string, selector map[string]string) (*api.Pod, error) { +func GetFirstPod(client *client.Client, namespace string, selector labels.Selector) (*api.Pod, error) { var pods *api.PodList for pods == nil || len(pods.Items) == 0 { var err error - labelSelector := labels.SelectorFromSet(selector) - options := api.ListOptions{LabelSelector: labelSelector} + options := api.ListOptions{LabelSelector: selector} if pods, err = client.Pods(namespace).List(options); err != nil { return nil, err } @@ -424,6 +532,17 @@ func GetFirstPod(client *client.Client, namespace string, selector map[string]st return pod, nil } +func recordCommand(args []string) string { + if len(args) > 0 { + args[0] = "kubectl" + } + return strings.Join(args, " ") +} + +func (f *Factory) Command() string { + return f.cmd +} + // BindFlags adds any flags that are common to all kubectl sub commands. func (f *Factory) BindFlags(flags *pflag.FlagSet) { // any flags defined by external projects (not part of pflags) @@ -681,7 +800,7 @@ func (f *Factory) PrinterForMapping(cmd *cobra.Command, mapping *meta.RESTMappin if err != nil { columnLabel = []string{} } - printer, err = f.Printer(mapping, GetFlagBool(cmd, "no-headers"), withNamespace, GetWideFlag(cmd), GetFlagBool(cmd, "show-all"), isWatch(cmd), columnLabel) + printer, err = f.Printer(mapping, GetFlagBool(cmd, "no-headers"), withNamespace, GetWideFlag(cmd), GetFlagBool(cmd, "show-all"), GetFlagBool(cmd, "show-labels"), isWatch(cmd), columnLabel) if err != nil { return nil, err } diff --git a/pkg/kubectl/cmd/util/helpers.go b/pkg/kubectl/cmd/util/helpers.go index d5705b4abd0..19cc401e7d0 100644 --- a/pkg/kubectl/cmd/util/helpers.go +++ b/pkg/kubectl/cmd/util/helpers.go @@ -18,6 +18,7 @@ package util import ( "bytes" + "encoding/json" "fmt" "io" "io/ioutil" @@ -27,6 +28,7 @@ import ( "strings" "time" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/unversioned/clientcmd" @@ -34,6 +36,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/resource" "k8s.io/kubernetes/pkg/runtime" utilerrors "k8s.io/kubernetes/pkg/util/errors" + "k8s.io/kubernetes/pkg/util/strategicpatch" "github.com/evanphx/json-patch" "github.com/golang/glog" @@ -434,3 +437,56 @@ func UpdateObject(info *resource.Info, codec runtime.Codec, updateFn func(runtim return info.Object, nil } + +// AddCmdRecordFlag adds --record flag to command +func AddRecordFlag(cmd *cobra.Command) { + cmd.Flags().Bool("record", false, "Record current kubectl command in the resource annotation.") +} + +func GetRecordFlag(cmd *cobra.Command) bool { + return GetFlagBool(cmd, "record") +} + +// RecordChangeCause annotate change-cause to input runtime object. +func RecordChangeCause(obj runtime.Object, changeCause string) error { + meta, err := api.ObjectMetaFor(obj) + if err != nil { + return err + } + if meta.Annotations == nil { + meta.Annotations = make(map[string]string) + } + meta.Annotations[kubectl.ChangeCauseAnnotation] = changeCause + return nil +} + +// ChangeResourcePatch creates a strategic merge patch between the origin input resource info +// and the annotated with change-cause input resource info. +func ChangeResourcePatch(info *resource.Info, changeCause string) ([]byte, error) { + oldData, err := json.Marshal(info.Object) + if err != nil { + return nil, err + } + if err := RecordChangeCause(info.Object, changeCause); err != nil { + return nil, err + } + newData, err := json.Marshal(info.Object) + if err != nil { + return nil, err + } + return strategicpatch.CreateTwoWayMergePatch(oldData, newData, info.Object) +} + +// containsChangeCause checks if input resource info contains change-cause annotation. +func ContainsChangeCause(info *resource.Info) bool { + annotations, err := info.Mapping.MetadataAccessor.Annotations(info.Object) + if err != nil { + return false + } + return len(annotations[kubectl.ChangeCauseAnnotation]) > 0 +} + +// ShouldRecord checks if we should record current change cause +func ShouldRecord(cmd *cobra.Command, info *resource.Info) bool { + return GetRecordFlag(cmd) || ContainsChangeCause(info) +} diff --git a/pkg/kubectl/cmd/util/printing.go b/pkg/kubectl/cmd/util/printing.go index ce68ca2d12e..40d7c07fa06 100644 --- a/pkg/kubectl/cmd/util/printing.go +++ b/pkg/kubectl/cmd/util/printing.go @@ -33,6 +33,7 @@ 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].") cmd.Flags().String("output-version", "", "Output the formatted object with the given version (default api-version).") cmd.Flags().Bool("no-headers", false, "When using the default output, don't print headers.") + cmd.Flags().Bool("show-labels", false, "When printing, show all labels as the last column (default hide labels column)") // template shorthand -t is deprecated to support -t for --tty // TODO: remove template flag shorthand -t cmd.Flags().StringP("template", "t", "", "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].") diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 7984b1dccac..72a60e72ef8 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -32,7 +32,7 @@ import ( "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fieldpath" "k8s.io/kubernetes/pkg/fields" @@ -87,6 +87,7 @@ func describerMap(c *client.Client) map[unversioned.GroupKind]Describer { api.Kind("Endpoints"): &EndpointsDescriber{c}, api.Kind("ConfigMap"): &ConfigMapDescriber{c}, + extensions.Kind("ReplicaSet"): &ReplicaSetDescriber{c}, extensions.Kind("HorizontalPodAutoscaler"): &HorizontalPodAutoscalerDescriber{c}, extensions.Kind("DaemonSet"): &DaemonSetDescriber{c}, extensions.Kind("Deployment"): &DeploymentDescriber{clientset.FromUnversionedClient(c)}, @@ -421,10 +422,7 @@ type PodDescriber struct { } func (d *PodDescriber) Describe(namespace, name string) (string, error) { - rc := d.ReplicationControllers(namespace) - pc := d.Pods(namespace) - - pod, err := pc.Get(name) + pod, err := d.Pods(namespace).Get(name) if err != nil { eventsInterface := d.Events(namespace) selector := eventsInterface.GetFieldSelector(&name, &namespace, nil, nil) @@ -448,15 +446,10 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) { events, _ = d.Events(namespace).Search(ref) } - rcs, err := getReplicationControllersForLabels(rc, labels.Set(pod.Labels)) - if err != nil { - return "", err - } - - return describePod(pod, rcs, events) + return describePod(pod, events) } -func describePod(pod *api.Pod, rcs []api.ReplicationController, events *api.EventList) (string, error) { +func describePod(pod *api.Pod, events *api.EventList) (string, error) { return tabbedString(func(out io.Writer) error { fmt.Fprintf(out, "Name:\t%s\n", pod.Name) fmt.Fprintf(out, "Namespace:\t%s\n", pod.Namespace) @@ -475,10 +468,6 @@ func describePod(pod *api.Pod, rcs []api.ReplicationController, events *api.Even fmt.Fprintf(out, "Reason:\t%s\n", pod.Status.Reason) fmt.Fprintf(out, "Message:\t%s\n", pod.Status.Message) fmt.Fprintf(out, "IP:\t%s\n", pod.Status.PodIP) - var matchingRCs []*api.ReplicationController - for _, rc := range rcs { - matchingRCs = append(matchingRCs, &rc) - } fmt.Fprintf(out, "Controllers:\t%s\n", printControllers(pod.Annotations)) fmt.Fprintf(out, "Containers:\n") describeContainers(pod, out) @@ -899,6 +888,58 @@ func DescribePodTemplate(template *api.PodTemplateSpec) (string, error) { }) } +// ReplicaSetDescriber generates information about a ReplicaSet and the pods it has created. +type ReplicaSetDescriber struct { + client.Interface +} + +func (d *ReplicaSetDescriber) Describe(namespace, name string) (string, error) { + rsc := d.Extensions().ReplicaSets(namespace) + pc := d.Pods(namespace) + + rs, err := rsc.Get(name) + if err != nil { + return "", err + } + + selector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) + if err != nil { + return "", err + } + + running, waiting, succeeded, failed, err := getPodStatusForController(pc, selector) + if err != nil { + return "", err + } + + events, _ := d.Events(namespace).Search(rs) + + return describeReplicaSet(rs, events, running, waiting, succeeded, failed) +} + +func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, running, waiting, succeeded, failed int) (string, error) { + return tabbedString(func(out io.Writer) error { + fmt.Fprintf(out, "Name:\t%s\n", rs.Name) + fmt.Fprintf(out, "Namespace:\t%s\n", rs.Namespace) + if rs.Spec.Template != nil { + fmt.Fprintf(out, "Image(s):\t%s\n", makeImageList(&rs.Spec.Template.Spec)) + } else { + fmt.Fprintf(out, "Image(s):\t%s\n", "") + } + fmt.Fprintf(out, "Selector:\t%s\n", unversioned.FormatLabelSelector(rs.Spec.Selector)) + fmt.Fprintf(out, "Labels:\t%s\n", labels.FormatLabels(rs.Labels)) + fmt.Fprintf(out, "Replicas:\t%d current / %d desired\n", rs.Status.Replicas, rs.Spec.Replicas) + fmt.Fprintf(out, "Pods Status:\t%d Running / %d Waiting / %d Succeeded / %d Failed\n", running, waiting, succeeded, failed) + if rs.Spec.Template != nil { + describeVolumes(rs.Spec.Template.Spec.Volumes, out) + } + if events != nil { + DescribeEvents(events, out) + } + return nil + }) +} + // JobDescriber generates information about a job and the pods it has created. type JobDescriber struct { client *client.Client @@ -920,7 +961,7 @@ func describeJob(job *extensions.Job, events *api.EventList) (string, error) { fmt.Fprintf(out, "Name:\t%s\n", job.Name) fmt.Fprintf(out, "Namespace:\t%s\n", job.Namespace) fmt.Fprintf(out, "Image(s):\t%s\n", makeImageList(&job.Spec.Template.Spec)) - selector, _ := extensions.LabelSelectorAsSelector(job.Spec.Selector) + selector, _ := unversioned.LabelSelectorAsSelector(job.Spec.Selector) fmt.Fprintf(out, "Selector:\t%s\n", selector) fmt.Fprintf(out, "Parallelism:\t%d\n", *job.Spec.Parallelism) if job.Spec.Completions != nil { @@ -958,7 +999,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string) (string, error) { return "", err } - selector, err := extensions.LabelSelectorAsSelector(daemon.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(daemon.Spec.Selector) if err != nil { return "", err } @@ -976,7 +1017,7 @@ func describeDaemonSet(daemon *extensions.DaemonSet, events *api.EventList, runn return tabbedString(func(out io.Writer) error { fmt.Fprintf(out, "Name:\t%s\n", daemon.Name) fmt.Fprintf(out, "Image(s):\t%s\n", makeImageList(&daemon.Spec.Template.Spec)) - selector, err := extensions.LabelSelectorAsSelector(daemon.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(daemon.Spec.Selector) if err != nil { // this shouldn't happen if LabelSelector passed validation return err @@ -1084,6 +1125,9 @@ func (i *IngressDescriber) describeIngress(ing *extensions.Ingress) (string, err ns = api.NamespaceSystem } fmt.Fprintf(out, "Default backend:\t%s (%s)\n", backendStringer(def), i.describeBackend(ns, def)) + if len(ing.Spec.TLS) != 0 { + describeIngressTLS(out, ing.Spec.TLS) + } fmt.Fprint(out, "Rules:\n Host\tPath\tBackends\n") fmt.Fprint(out, " ----\t----\t--------\n") for _, rules := range ing.Spec.Rules { @@ -1105,6 +1149,14 @@ func (i *IngressDescriber) describeIngress(ing *extensions.Ingress) (string, err }) } +func describeIngressTLS(out io.Writer, ingTLS []extensions.IngressTLS) { + fmt.Fprintf(out, "TLS:\n") + for _, t := range ingTLS { + fmt.Fprintf(out, " %v terminates %v\n", t.SecretName, strings.Join(t.Hosts, ",")) + } + return +} + // TODO: Move from annotations into Ingress status. func describeIngressAnnotations(out io.Writer, annotations map[string]string) { fmt.Fprintf(out, "Annotations:\n") @@ -1596,31 +1648,36 @@ func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error) if err != nil { return "", err } + selector, err := unversioned.LabelSelectorAsSelector(d.Spec.Selector) + if err != nil { + return "", err + } return tabbedString(func(out io.Writer) error { fmt.Fprintf(out, "Name:\t%s\n", d.ObjectMeta.Name) fmt.Fprintf(out, "Namespace:\t%s\n", d.ObjectMeta.Namespace) fmt.Fprintf(out, "CreationTimestamp:\t%s\n", d.CreationTimestamp.Time.Format(time.RFC1123Z)) fmt.Fprintf(out, "Labels:\t%s\n", labels.FormatLabels(d.Labels)) - fmt.Fprintf(out, "Selector:\t%s\n", labels.FormatLabels(d.Spec.Selector)) + fmt.Fprintf(out, "Selector:\t%s\n", selector) fmt.Fprintf(out, "Replicas:\t%d updated | %d total | %d available | %d unavailable\n", d.Status.UpdatedReplicas, d.Spec.Replicas, d.Status.AvailableReplicas, d.Status.UnavailableReplicas) fmt.Fprintf(out, "StrategyType:\t%s\n", d.Spec.Strategy.Type) + fmt.Fprintf(out, "MinReadySeconds:\t%d\n", d.Spec.MinReadySeconds) if d.Spec.Strategy.RollingUpdate != nil { ru := d.Spec.Strategy.RollingUpdate - fmt.Fprintf(out, "RollingUpdateStrategy:\t%s max unavailable, %s max surge, %d min ready seconds\n", ru.MaxUnavailable.String(), ru.MaxSurge.String(), ru.MinReadySeconds) + fmt.Fprintf(out, "RollingUpdateStrategy:\t%s max unavailable, %s max surge\n", ru.MaxUnavailable.String(), ru.MaxSurge.String()) } - oldRCs, _, err := deploymentutil.GetOldRCs(*d, dd) + oldRSs, _, err := deploymentutil.GetOldReplicaSets(*d, dd) if err == nil { - fmt.Fprintf(out, "OldReplicationControllers:\t%s\n", printReplicationControllersByLabels(oldRCs)) + fmt.Fprintf(out, "OldReplicaSets:\t%s\n", printReplicaSetsByLabels(oldRSs)) } - newRC, err := deploymentutil.GetNewRC(*d, dd) + newRS, err := deploymentutil.GetNewReplicaSet(*d, dd) if err == nil { - var newRCs []*api.ReplicationController - if newRC != nil { - newRCs = append(newRCs, newRC) + var newRSs []*extensions.ReplicaSet + if newRS != nil { + newRSs = append(newRSs, newRS) } - fmt.Fprintf(out, "NewReplicationController:\t%s\n", printReplicationControllersByLabels(newRCs)) + fmt.Fprintf(out, "NewReplicaSet:\t%s\n", printReplicaSetsByLabels(newRSs)) } - events, err := dd.Legacy().Events(namespace).Search(d) + events, err := dd.Core().Events(namespace).Search(d) if err == nil && events != nil { DescribeEvents(events, out) } @@ -1644,7 +1701,7 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La // Find the ones that match labelsToMatch. var matchingDaemonSets []extensions.DaemonSet for _, ds := range dss.Items { - selector, err := extensions.LabelSelectorAsSelector(ds.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { // this should never happen if the DaemonSet passed validation return nil, err @@ -1656,29 +1713,6 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La return matchingDaemonSets, nil } -// Get all replication controllers whose selectors would match a given set of -// labels. -// TODO Move this to pkg/client and ideally implement it server-side (instead -// of getting all RC's and searching through them manually). -func getReplicationControllersForLabels(c client.ReplicationControllerInterface, labelsToMatch labels.Labels) ([]api.ReplicationController, error) { - // Get all replication controllers. - // TODO this needs a namespace scope as argument - rcs, err := c.List(api.ListOptions{}) - if err != nil { - return nil, fmt.Errorf("error getting replication controllers: %v", err) - } - - // Find the ones that match labelsToMatch. - var matchingRCs []api.ReplicationController - for _, controller := range rcs.Items { - selector := labels.SelectorFromSet(controller.Spec.Selector) - if selector.Matches(labelsToMatch) { - matchingRCs = append(matchingRCs, controller) - } - } - return matchingRCs, nil -} - func printReplicationControllersByLabels(matchingRCs []*api.ReplicationController) string { // Format the matching RC's into strings. var rcStrings []string @@ -1693,6 +1727,20 @@ func printReplicationControllersByLabels(matchingRCs []*api.ReplicationControlle return list } +func printReplicaSetsByLabels(matchingRSs []*extensions.ReplicaSet) string { + // Format the matching ReplicaSets into strings. + var rsStrings []string + for _, rs := range matchingRSs { + rsStrings = append(rsStrings, fmt.Sprintf("%s (%d/%d replicas created)", rs.Name, rs.Status.Replicas, rs.Spec.Replicas)) + } + + list := strings.Join(rsStrings, ", ") + if list == "" { + return "" + } + return list +} + func getPodStatusForController(c client.PodInterface, selector labels.Selector) (running, waiting, succeeded, failed int, err error) { options := api.ListOptions{LabelSelector: selector} rcPods, err := c.List(options) diff --git a/pkg/kubectl/history.go b/pkg/kubectl/history.go index f864e535c2f..01995f37674 100644 --- a/pkg/kubectl/history.go +++ b/pkg/kubectl/history.go @@ -25,7 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/runtime" deploymentutil "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/util/errors" @@ -58,7 +58,7 @@ type DeploymentHistoryViewer struct { c clientset.Interface } -// History returns a revision-to-RC map as the revision history of a deployment +// History returns a revision-to-replicaset map as the revision history of a deployment func (h *DeploymentHistoryViewer) History(namespace, name string) (HistoryInfo, error) { historyInfo := HistoryInfo{ RevisionToTemplate: make(map[int64]*api.PodTemplateSpec), @@ -67,31 +67,26 @@ func (h *DeploymentHistoryViewer) History(namespace, name string) (HistoryInfo, if err != nil { return historyInfo, fmt.Errorf("failed to retrieve deployment %s: %v", name, err) } - _, allOldRCs, err := deploymentutil.GetOldRCs(*deployment, h.c) + _, allOldRSs, err := deploymentutil.GetOldReplicaSets(*deployment, h.c) if err != nil { - return historyInfo, fmt.Errorf("failed to retrieve old RCs from deployment %s: %v", name, err) + return historyInfo, fmt.Errorf("failed to retrieve old replica sets from deployment %s: %v", name, err) } - newRC, err := deploymentutil.GetNewRC(*deployment, h.c) + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, h.c) if err != nil { - return historyInfo, fmt.Errorf("failed to retrieve new RC from deployment %s: %v", name, err) + return historyInfo, fmt.Errorf("failed to retrieve new replica set from deployment %s: %v", name, err) } - allRCs := append(allOldRCs, newRC) - for _, rc := range allRCs { - v, err := deploymentutil.Revision(rc) + allRSs := append(allOldRSs, newRS) + for _, rs := range allRSs { + v, err := deploymentutil.Revision(rs) if err != nil { - return historyInfo, fmt.Errorf("failed to retrieve revision out of RC %s from deployment %s: %v", rc.Name, name, err) + continue } - historyInfo.RevisionToTemplate[v] = rc.Spec.Template - changeCause, err := getChangeCause(rc) - if err != nil { - return historyInfo, fmt.Errorf("failed to retrieve change-cause out of RC %s from deployment %s: %v", rc.Name, name, err) - } - if len(changeCause) > 0 { - if historyInfo.RevisionToTemplate[v].Annotations == nil { - historyInfo.RevisionToTemplate[v].Annotations = make(map[string]string) - } - historyInfo.RevisionToTemplate[v].Annotations[ChangeCauseAnnotation] = changeCause + historyInfo.RevisionToTemplate[v] = rs.Spec.Template + changeCause := getChangeCause(rs) + if historyInfo.RevisionToTemplate[v].Annotations == nil { + historyInfo.RevisionToTemplate[v].Annotations = make(map[string]string) } + historyInfo.RevisionToTemplate[v].Annotations[ChangeCauseAnnotation] = changeCause } return historyInfo, nil } @@ -130,10 +125,10 @@ func PrintRolloutHistory(historyInfo HistoryInfo, resource, name string) (string } // getChangeCause returns the change-cause annotation of the input object -func getChangeCause(obj runtime.Object) (string, error) { +func getChangeCause(obj runtime.Object) string { meta, err := api.ObjectMetaFor(obj) if err != nil { - return "", err + return "" } - return meta.Annotations[ChangeCauseAnnotation], nil + return meta.Annotations[ChangeCauseAnnotation] } diff --git a/pkg/kubectl/kubectl.go b/pkg/kubectl/kubectl.go index f2f4d6a9bbb..aa3db5ed082 100644 --- a/pkg/kubectl/kubectl.go +++ b/pkg/kubectl/kubectl.go @@ -113,10 +113,12 @@ func expandResourceShortcut(resource unversioned.GroupVersionResource) unversion "no": api.SchemeGroupVersion.WithResource("nodes"), "ns": api.SchemeGroupVersion.WithResource("namespaces"), "po": api.SchemeGroupVersion.WithResource("pods"), + "psp": api.SchemeGroupVersion.WithResource("podSecurityPolicies"), "pvc": api.SchemeGroupVersion.WithResource("persistentvolumeclaims"), "pv": api.SchemeGroupVersion.WithResource("persistentvolumes"), "quota": api.SchemeGroupVersion.WithResource("resourcequotas"), "rc": api.SchemeGroupVersion.WithResource("replicationcontrollers"), + "rs": extensions.SchemeGroupVersion.WithResource("replicasets"), "svc": api.SchemeGroupVersion.WithResource("services"), } if expanded, ok := shortForms[resource.Resource]; ok { diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go index f5e6d22c45e..3d5d4e2329d 100644 --- a/pkg/kubectl/resource_printer.go +++ b/pkg/kubectl/resource_printer.go @@ -234,7 +234,7 @@ func (p *NamePrinter) PrintObj(obj runtime.Object, w io.Writer) error { if gvk != nil { // TODO: this is wrong, it assumes that meta knows about all Kinds - should take a RESTMapper - _, resource := meta.KindToResource(*gvk, false) + _, resource := meta.KindToResource(*gvk) fmt.Fprintf(w, "%s/%s\n", resource.Resource, name) } else { @@ -304,6 +304,7 @@ type PrintOptions struct { WithNamespace bool Wide bool ShowAll bool + ShowLabels bool AbsoluteTimestamps bool ColumnLabels []string } @@ -319,7 +320,7 @@ type HumanReadablePrinter struct { } // NewHumanReadablePrinter creates a HumanReadablePrinter. -func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) *HumanReadablePrinter { +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{ @@ -327,6 +328,7 @@ func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, showAll b WithNamespace: withNamespace, Wide: wide, ShowAll: showAll, + ShowLabels: showLabels, AbsoluteTimestamps: absoluteTimestamps, ColumnLabels: columnLabels, }, @@ -395,26 +397,28 @@ func (h *HumanReadablePrinter) HandledResources() []string { var podColumns = []string{"NAME", "READY", "STATUS", "RESTARTS", "AGE"} var podTemplateColumns = []string{"TEMPLATE", "CONTAINER(S)", "IMAGE(S)", "PODLABELS"} var replicationControllerColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS", "AGE"} +var replicaSetColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS", "AGE"} var jobColumns = []string{"JOB", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "SUCCESSFUL"} var serviceColumns = []string{"NAME", "CLUSTER-IP", "EXTERNAL-IP", "PORT(S)", "SELECTOR", "AGE"} var ingressColumns = []string{"NAME", "RULE", "BACKEND", "ADDRESS"} var endpointColumns = []string{"NAME", "ENDPOINTS", "AGE"} -var nodeColumns = []string{"NAME", "LABELS", "STATUS", "AGE"} +var nodeColumns = []string{"NAME", "STATUS", "AGE"} var daemonSetColumns = []string{"NAME", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "NODE-SELECTOR"} var eventColumns = []string{"FIRSTSEEN", "LASTSEEN", "COUNT", "NAME", "KIND", "SUBOBJECT", "TYPE", "REASON", "SOURCE", "MESSAGE"} var limitRangeColumns = []string{"NAME", "AGE"} var resourceQuotaColumns = []string{"NAME", "AGE"} -var namespaceColumns = []string{"NAME", "LABELS", "STATUS", "AGE"} +var namespaceColumns = []string{"NAME", "STATUS", "AGE"} var secretColumns = []string{"NAME", "TYPE", "DATA", "AGE"} var serviceAccountColumns = []string{"NAME", "SECRETS", "AGE"} -var persistentVolumeColumns = []string{"NAME", "LABELS", "CAPACITY", "ACCESSMODES", "STATUS", "CLAIM", "REASON", "AGE"} -var persistentVolumeClaimColumns = []string{"NAME", "LABELS", "STATUS", "VOLUME", "CAPACITY", "ACCESSMODES", "AGE"} +var persistentVolumeColumns = []string{"NAME", "CAPACITY", "ACCESSMODES", "STATUS", "CLAIM", "REASON", "AGE"} +var persistentVolumeClaimColumns = []string{"NAME", "STATUS", "VOLUME", "CAPACITY", "ACCESSMODES", "AGE"} var componentStatusColumns = []string{"NAME", "STATUS", "MESSAGE", "ERROR"} var thirdPartyResourceColumns = []string{"NAME", "DESCRIPTION", "VERSION(S)"} var horizontalPodAutoscalerColumns = []string{"NAME", "REFERENCE", "TARGET", "CURRENT", "MINPODS", "MAXPODS", "AGE"} var withNamespacePrefixColumns = []string{"NAMESPACE"} // TODO(erictune): print cluster name too. var deploymentColumns = []string{"NAME", "DESIRED", "CURRENT", "UP-TO-DATE", "AVAILABLE", "AGE"} var configMapColumns = []string{"NAME", "DATA", "AGE"} +var podSecurityPolicyColumns = []string{"NAME", "PRIV", "CAPS", "VOLUMEPLUGINS", "SELINUX", "RUNASUSER"} // addDefaultHandlers adds print handlers for default Kubernetes types. func (h *HumanReadablePrinter) addDefaultHandlers() { @@ -424,6 +428,8 @@ func (h *HumanReadablePrinter) addDefaultHandlers() { h.Handler(podTemplateColumns, printPodTemplateList) h.Handler(replicationControllerColumns, printReplicationController) h.Handler(replicationControllerColumns, printReplicationControllerList) + h.Handler(replicaSetColumns, printReplicaSet) + h.Handler(replicaSetColumns, printReplicaSetList) h.Handler(daemonSetColumns, printDaemonSet) h.Handler(daemonSetColumns, printDaemonSetList) h.Handler(jobColumns, printJob) @@ -462,6 +468,8 @@ func (h *HumanReadablePrinter) addDefaultHandlers() { h.Handler(horizontalPodAutoscalerColumns, printHorizontalPodAutoscalerList) h.Handler(configMapColumns, printConfigMap) h.Handler(configMapColumns, printConfigMapList) + h.Handler(podSecurityPolicyColumns, printPodSecurityPolicy) + h.Handler(podSecurityPolicyColumns, printPodSecurityPolicyList) } func (h *HumanReadablePrinter) unknown(data []byte, w io.Writer) error { @@ -606,8 +614,14 @@ func printPodBase(pod *api.Pod, w io.Writer, options PrintOptions) error { } } - _, err := fmt.Fprint(w, appendLabels(pod.Labels, options.ColumnLabels)) - return err + if _, err := fmt.Fprint(w, appendLabels(pod.Labels, options.ColumnLabels)); err != nil { + return err + } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, pod.Labels)); err != nil { + return err + } + + return nil } func printPodList(podList *api.PodList, w io.Writer, options PrintOptions) error { @@ -645,6 +659,9 @@ func printPodTemplate(pod *api.PodTemplate, w io.Writer, options PrintOptions) e if _, err := fmt.Fprint(w, appendLabels(pod.Labels, options.ColumnLabels)); err != nil { return err } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, pod.Labels)); err != nil { + return err + } // Lay out all the other containers on separate lines. extraLinePrefix := "\t" @@ -699,6 +716,9 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ if _, err := fmt.Fprint(w, appendLabels(controller.Labels, options.ColumnLabels)); err != nil { return err } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, controller.Labels)); err != nil { + return err + } // Lay out all the other containers on separate lines. extraLinePrefix := "\t" @@ -726,6 +746,63 @@ func printReplicationControllerList(list *api.ReplicationControllerList, w io.Wr return nil } +func printReplicaSet(rs *extensions.ReplicaSet, w io.Writer, options PrintOptions) error { + name := rs.Name + namespace := rs.Namespace + containers := rs.Spec.Template.Spec.Containers + var firstContainer api.Container + if len(containers) > 0 { + firstContainer, containers = containers[0], containers[1:] + } + + if options.WithNamespace { + if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil { + return err + } + } + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\t%s", + name, + firstContainer.Name, + firstContainer.Image, + unversioned.FormatLabelSelector(rs.Spec.Selector), + rs.Spec.Replicas, + translateTimestamp(rs.CreationTimestamp), + ); err != nil { + return err + } + if _, err := fmt.Fprint(w, appendLabels(rs.Labels, options.ColumnLabels)); err != nil { + return err + } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, rs.Labels)); err != nil { + return err + } + + // Lay out all the other containers on separate lines. + extraLinePrefix := "\t" + if options.WithNamespace { + extraLinePrefix = "\t\t" + } + for _, container := range containers { + _, err := fmt.Fprintf(w, "%s%s\t%s\t%s\t%s", extraLinePrefix, container.Name, container.Image, "", "") + if err != nil { + return err + } + if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil { + return err + } + } + return nil +} + +func printReplicaSetList(list *extensions.ReplicaSetList, w io.Writer, options PrintOptions) error { + for _, rs := range list.Items { + if err := printReplicaSet(&rs, w, options); err != nil { + return err + } + } + return nil +} + func printJob(job *extensions.Job, w io.Writer, options PrintOptions) error { name := job.Name namespace := job.Namespace @@ -740,7 +817,7 @@ func printJob(job *extensions.Job, w io.Writer, options PrintOptions) error { } } - selector, _ := extensions.LabelSelectorAsSelector(job.Spec.Selector) + selector, _ := unversioned.LabelSelectorAsSelector(job.Spec.Selector) _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d", name, firstContainer.Name, @@ -753,6 +830,9 @@ func printJob(job *extensions.Job, w io.Writer, options PrintOptions) error { if _, err := fmt.Fprint(w, appendLabels(job.Labels, options.ColumnLabels)); err != nil { return err } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, job.Labels)); err != nil { + return err + } // Lay out all the other containers on separate lines. extraLinePrefix := "\t" @@ -849,7 +929,8 @@ func printService(svc *api.Service, w io.Writer, options PrintOptions) error { if _, err := fmt.Fprint(w, appendLabels(svc.Labels, options.ColumnLabels)); err != nil { return err } - return nil + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, svc.Labels)) + return err } func printServiceList(list *api.ServiceList, w io.Writer, options PrintOptions) error { @@ -880,7 +961,7 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options PrintOptions } } - if _, err := fmt.Fprintf(w, "%s\t%v\t%v\t%v\n", + if _, err := fmt.Fprintf(w, "%s\t%v\t%v\t%v", name, "-", backendStringer(ingress.Spec.Backend), @@ -888,6 +969,10 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options PrintOptions return err } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, ingress.Labels)); err != nil { + return err + } + // Lay out all the rules on separate lines. extraLinePrefix := "" if options.WithNamespace { @@ -941,7 +1026,7 @@ func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options PrintOptions) return err } } - selector, err := extensions.LabelSelectorAsSelector(ds.Spec.Selector) + selector, err := unversioned.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { // this shouldn't happen if LabelSelector passed validation return err @@ -958,6 +1043,9 @@ func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options PrintOptions) if _, err := fmt.Fprint(w, appendLabels(ds.Labels, options.ColumnLabels)); err != nil { return err } + if _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, ds.Labels)); err != nil { + return err + } // Lay out all the other containers on separate lines. extraLinePrefix := "\t" @@ -997,7 +1085,10 @@ func printEndpoints(endpoints *api.Endpoints, w io.Writer, options PrintOptions) if _, err := fmt.Fprintf(w, "%s\t%s\t%s", name, formatEndpoints(endpoints, nil), translateTimestamp(endpoints.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(endpoints.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(endpoints.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, endpoints.Labels)) return err } @@ -1015,10 +1106,13 @@ func printNamespace(item *api.Namespace, w io.Writer, options PrintOptions) erro return fmt.Errorf("namespace is not namespaced") } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", item.Name, labels.FormatLabels(item.Labels), item.Status.Phase, translateTimestamp(item.CreationTimestamp)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s", item.Name, item.Status.Phase, translateTimestamp(item.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, item.Labels)) return err } @@ -1043,7 +1137,10 @@ func printSecret(item *api.Secret, w io.Writer, options PrintOptions) error { if _, err := fmt.Fprintf(w, "%s\t%s\t%v\t%s", name, item.Type, len(item.Data), translateTimestamp(item.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, item.Labels)) return err } @@ -1069,7 +1166,10 @@ func printServiceAccount(item *api.ServiceAccount, w io.Writer, options PrintOpt if _, err := fmt.Fprintf(w, "%s\t%d\t%s", name, len(item.Secrets), translateTimestamp(item.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, item.Labels)) return err } @@ -1110,10 +1210,14 @@ 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\t%s", node.Name, labels.FormatLabels(node.Labels), strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s", node.Name, strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(node.Labels, options.ColumnLabels)) + // Display caller specify column labels first. + if _, err := fmt.Fprint(w, appendLabels(node.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, node.Labels)) return err } @@ -1144,9 +1248,8 @@ func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options PrintO aQty := pv.Spec.Capacity[api.ResourceStorage] aSize := aQty.String() - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", name, - labels.FormatLabels(pv.Labels), aSize, modesStr, pv.Status.Phase, claimRefUID, @@ -1155,7 +1258,10 @@ func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options PrintO ); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(pv.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(pv.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, pv.Labels)) return err } @@ -1178,7 +1284,6 @@ func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, opt } } - labels := labels.FormatLabels(pvc.Labels) phase := pvc.Status.Phase storage := pvc.Spec.Resources.Requests[api.ResourceStorage] capacity := "" @@ -1189,10 +1294,13 @@ func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, opt capacity = storage.String() } - if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", name, labels, phase, pvc.Spec.VolumeName, capacity, accessModes, translateTimestamp(pvc.CreationTimestamp)); err != nil { + if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s", name, phase, pvc.Spec.VolumeName, capacity, accessModes, translateTimestamp(pvc.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(pvc.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(pvc.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, pvc.Labels)) return err } @@ -1238,7 +1346,10 @@ func printEvent(event *api.Event, w io.Writer, options PrintOptions) error { ); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(event.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(event.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, event.Labels)) return err } @@ -1270,7 +1381,10 @@ func printLimitRange(limitRange *api.LimitRange, w io.Writer, options PrintOptio ); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(limitRange.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(limitRange.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, limitRange.Labels)) return err } @@ -1301,7 +1415,10 @@ func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, options P ); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(resourceQuota.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(resourceQuota.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, resourceQuota.Labels)) return err } @@ -1338,7 +1455,10 @@ 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 { return err } - _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, item.Labels)) return err } @@ -1390,7 +1510,10 @@ func printDeployment(deployment *extensions.Deployment, w io.Writer, options Pri 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 { return err } - _, err := fmt.Fprint(w, appendLabels(deployment.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(deployment.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, deployment.Labels)) return err } @@ -1440,7 +1563,10 @@ func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io. ); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(hpa.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(hpa.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, hpa.Labels)) return err } @@ -1465,7 +1591,10 @@ func printConfigMap(configMap *api.ConfigMap, w io.Writer, options PrintOptions) if _, err := fmt.Fprintf(w, "%s\t%v\t%s", name, len(configMap.Data), translateTimestamp(configMap.CreationTimestamp)); err != nil { return err } - _, err := fmt.Fprint(w, appendLabels(configMap.Labels, options.ColumnLabels)) + if _, err := fmt.Fprint(w, appendLabels(configMap.Labels, options.ColumnLabels)); err != nil { + return err + } + _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, configMap.Labels)) return err } @@ -1478,6 +1607,23 @@ func printConfigMapList(list *api.ConfigMapList, w io.Writer, options PrintOptio return nil } +func printPodSecurityPolicy(item *extensions.PodSecurityPolicy, w io.Writer, options PrintOptions) error { + _, err := fmt.Fprintf(w, "%s\t%t\t%v\t%t\t%s\t%s\n", item.Name, item.Spec.Privileged, + item.Spec.Capabilities, item.Spec.Volumes, item.Spec.SELinuxContext.Type, + item.Spec.RunAsUser.Type) + return err +} + +func printPodSecurityPolicyList(list *extensions.PodSecurityPolicyList, w io.Writer, options PrintOptions) error { + for _, item := range list.Items { + if err := printPodSecurityPolicy(&item, w, options); err != nil { + return err + } + } + + return nil +} + func appendLabels(itemLabels map[string]string, columnLabels []string) string { var buffer bytes.Buffer @@ -1489,6 +1635,19 @@ func appendLabels(itemLabels map[string]string, columnLabels []string) string { buffer.WriteString("") } } + + return buffer.String() +} + +// Append all labels to a single column. We need this even when show-labels flag* is +// false, since this adds newline delimiter to the end of each row. +func appendAllLabels(showLabels bool, itemLabels map[string]string) string { + var buffer bytes.Buffer + + if showLabels { + buffer.WriteString(fmt.Sprint("\t")) + buffer.WriteString(labels.FormatLabels(itemLabels)) + } buffer.WriteString("\n") return buffer.String() @@ -1529,6 +1688,16 @@ func formatWideHeaders(wide bool, t reflect.Type) []string { return nil } +// headers for --show-labels=true +func formatShowLabelsHeader(showLabels bool, t reflect.Type) []string { + if showLabels { + if t.String() != "*api.ThirdPartyResource" && t.String() != "*api.ThirdPartyResourceList" { + return []string{"LABELS"} + } + } + return nil +} + // GetNewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text. func GetNewTabWriter(output io.Writer) *tabwriter.Writer { return tabwriter.NewWriter(output, tabwriterMinWidth, tabwriterWidth, tabwriterPadding, tabwriterPadChar, tabwriterFlags) @@ -1547,6 +1716,8 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er 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(withNamespacePrefixColumns, headers...) } diff --git a/pkg/kubectl/resource_printer_test.go b/pkg/kubectl/resource_printer_test.go index dfb2da28a5f..9e17063c395 100644 --- a/pkg/kubectl/resource_printer_test.go +++ b/pkg/kubectl/resource_printer_test.go @@ -224,7 +224,7 @@ func ErrorPrintHandler(obj *TestPrintType, w io.Writer, options PrintOptions) er func TestCustomTypePrinting(t *testing.T) { columns := []string{"Data"} - printer := NewHumanReadablePrinter(false, false, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) printer.Handler(columns, PrintCustomType) obj := TestPrintType{"test object"} @@ -241,7 +241,7 @@ func TestCustomTypePrinting(t *testing.T) { func TestPrintHandlerError(t *testing.T) { columns := []string{"Data"} - printer := NewHumanReadablePrinter(false, false, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) printer.Handler(columns, ErrorPrintHandler) obj := TestPrintType{"test object"} buffer := &bytes.Buffer{} @@ -252,7 +252,7 @@ func TestPrintHandlerError(t *testing.T) { } func TestUnknownTypePrinting(t *testing.T) { - printer := NewHumanReadablePrinter(false, false, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) buffer := &bytes.Buffer{} err := printer.PrintObj(&TestUnknownType{}, buffer) if err == nil { @@ -456,8 +456,8 @@ func TestPrinters(t *testing.T) { t.Fatal(err) } printers := map[string]ResourcePrinter{ - "humanReadable": NewHumanReadablePrinter(true, false, false, false, false, []string{}), - "humanReadableHeaders": NewHumanReadablePrinter(false, false, false, false, false, []string{}), + "humanReadable": NewHumanReadablePrinter(true, false, false, false, false, false, []string{}), + "humanReadableHeaders": NewHumanReadablePrinter(false, false, false, false, false, false, []string{}), "json": &JSONPrinter{}, "yaml": &YAMLPrinter{}, "template": templatePrinter, @@ -500,7 +500,7 @@ func TestPrinters(t *testing.T) { func TestPrintEventsResultSorted(t *testing.T) { // Arrange - printer := NewHumanReadablePrinter(false /* noHeaders */, false, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false /* noHeaders */, false, false, false, false, false, []string{}) obj := api.EventList{ Items: []api.Event{ @@ -544,7 +544,7 @@ func TestPrintEventsResultSorted(t *testing.T) { } func TestPrintNodeStatus(t *testing.T) { - printer := NewHumanReadablePrinter(false, false, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) table := []struct { node api.Node status string @@ -755,7 +755,7 @@ func TestPrintHumanReadableService(t *testing.T) { for _, svc := range tests { buff := bytes.Buffer{} - printService(&svc, &buff, PrintOptions{false, false, false, false, false, []string{}}) + printService(&svc, &buff, PrintOptions{false, false, false, false, false, false, []string{}}) output := string(buff.Bytes()) ip := svc.Spec.ClusterIP if !strings.Contains(output, ip) { @@ -937,7 +937,7 @@ func TestPrintHumanReadableWithNamespace(t *testing.T) { for _, test := range table { if test.isNamespaced { // Expect output to include namespace when requested. - printer := NewHumanReadablePrinter(false, true, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, true, false, false, false, false, []string{}) buffer := &bytes.Buffer{} err := printer.PrintObj(test.obj, buffer) if err != nil { @@ -949,7 +949,7 @@ func TestPrintHumanReadableWithNamespace(t *testing.T) { } } else { // Expect error when trying to get all namespaces for un-namespaced object. - printer := NewHumanReadablePrinter(false, true, false, false, false, []string{}) + printer := NewHumanReadablePrinter(false, true, false, false, false, false, []string{}) buffer := &bytes.Buffer{} err := printer.PrintObj(test.obj, buffer) if err == nil { @@ -1044,7 +1044,7 @@ func TestPrintPod(t *testing.T) { buf := bytes.NewBuffer([]byte{}) for _, test := range tests { - printPod(&test.pod, buf, PrintOptions{false, false, false, true, false, []string{}}) + printPod(&test.pod, buf, PrintOptions{false, false, false, true, false, false, []string{}}) // We ignore time if !strings.HasPrefix(buf.String(), test.expect) { t.Fatalf("Expected: %s, got: %s", test.expect, buf.String()) @@ -1137,7 +1137,7 @@ func TestPrintNonTerminatedPod(t *testing.T) { buf := bytes.NewBuffer([]byte{}) for _, test := range tests { - printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, []string{}}) + printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, false, []string{}}) // We ignore time if !strings.HasPrefix(buf.String(), test.expect) { t.Fatalf("Expected: %s, got: %s", test.expect, buf.String()) @@ -1197,7 +1197,7 @@ func TestPrintPodWithLabels(t *testing.T) { buf := bytes.NewBuffer([]byte{}) for _, test := range tests { - printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, test.labelColumns}) + printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, false, test.labelColumns}) // We ignore time if !strings.HasPrefix(buf.String(), test.startsWith) || !strings.HasSuffix(buf.String(), test.endsWith) { t.Fatalf("Expected to start with: %s and end with: %s, but got: %s", test.startsWith, test.endsWith, buf.String()) @@ -1261,10 +1261,70 @@ func TestPrintDeployment(t *testing.T) { buf := bytes.NewBuffer([]byte{}) for _, test := range tests { - printDeployment(&test.deployment, buf, PrintOptions{false, false, false, true, false, []string{}}) + printDeployment(&test.deployment, buf, PrintOptions{false, false, false, true, false, false, []string{}}) if buf.String() != test.expect { t.Fatalf("Expected: %s, got: %s", test.expect, buf.String()) } buf.Reset() } } + +func TestPrintPodShowLabels(t *testing.T) { + tests := []struct { + pod api.Pod + startsWith string + endsWith string + showLabels bool + }{ + { + // Test name, num of containers, restarts, container ready status + api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: "test1", + Labels: map[string]string{"col1": "asd", "COL2": "zxc"}, + }, + Spec: api.PodSpec{Containers: make([]api.Container, 2)}, + Status: api.PodStatus{ + Phase: "podPhase", + ContainerStatuses: []api.ContainerStatus{ + {Ready: true, RestartCount: 3, State: api.ContainerState{Running: &api.ContainerStateRunning{}}}, + {RestartCount: 3}, + }, + }, + }, + "test1\t1/2\tpodPhase\t6\t", + "\tCOL2=zxc,col1=asd\n", + true, + }, + { + // Test name, num of containers, restarts, container ready status + api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: "test1", + Labels: map[string]string{"col3": "asd", "COL4": "zxc"}, + }, + Spec: api.PodSpec{Containers: make([]api.Container, 2)}, + Status: api.PodStatus{ + Phase: "podPhase", + ContainerStatuses: []api.ContainerStatus{ + {Ready: true, RestartCount: 3, State: api.ContainerState{Running: &api.ContainerStateRunning{}}}, + {RestartCount: 3}, + }, + }, + }, + "test1\t1/2\tpodPhase\t6\t", + "\n", + false, + }, + } + + buf := bytes.NewBuffer([]byte{}) + for _, test := range tests { + printPod(&test.pod, buf, PrintOptions{false, false, false, false, test.showLabels, false, []string{}}) + // We ignore time + if !strings.HasPrefix(buf.String(), test.startsWith) || !strings.HasSuffix(buf.String(), test.endsWith) { + t.Fatalf("Expected to start with: %s and end with: %s, but got: %s", test.startsWith, test.endsWith, buf.String()) + } + buf.Reset() + } +} diff --git a/pkg/kubectl/rollback.go b/pkg/kubectl/rollback.go new file mode 100644 index 00000000000..9f53b25af6f --- /dev/null +++ b/pkg/kubectl/rollback.go @@ -0,0 +1,118 @@ +/* +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. +*/ + +package kubectl + +import ( + "fmt" + "os" + "os/signal" + "syscall" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apis/extensions" + client "k8s.io/kubernetes/pkg/client/unversioned" + "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) +} + +func RollbackerFor(kind unversioned.GroupKind, c client.Interface) (Rollbacker, error) { + switch kind { + case extensions.Kind("Deployment"): + return &DeploymentRollbacker{c}, nil + } + return nil, fmt.Errorf("no rollbacker has been implemented for %q", kind) +} + +type DeploymentRollbacker struct { + c client.Interface +} + +func (r *DeploymentRollbacker) Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error) { + deploymentRollback := &extensions.DeploymentRollback{ + Name: name, + UpdatedAnnotations: updatedAnnotations, + RollbackTo: extensions.RollbackConfig{ + Revision: toRevision, + }, + } + result := "" + + // Get current events + events, err := r.c.Events(namespace).List(api.ListOptions{}) + if err != nil { + return result, err + } + // Do the rollback + if err := r.c.Extensions().Deployments(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}) + if err != nil { + return result, err + } + result = watchRollbackEvent(watch) + return result, err +} + +// watchRollbackEvent watches for rollback events and returns rollback result +func watchRollbackEvent(w watch.Interface) string { + signals := make(chan os.Signal, 1) + signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGTERM) + for { + select { + case event, ok := <-w.ResultChan(): + if !ok { + return "" + } + obj, ok := event.Object.(*api.Event) + if !ok { + w.Stop() + return "" + } + isRollback, result := isRollbackEvent(obj) + if isRollback { + w.Stop() + return result + } + case <-signals: + w.Stop() + } + } +} + +// isRollbackEvent checks if the input event is about rollback, and returns true and +// related result string back if it is. +func isRollbackEvent(e *api.Event) (bool, string) { + rollbackEventReasons := []string{deploymentutil.RollbackRevisionNotFound, deploymentutil.RollbackTemplateUnchanged, deploymentutil.RollbackDone} + for _, reason := range rollbackEventReasons { + if e.Reason == reason { + if reason == deploymentutil.RollbackDone { + return true, "rolled back" + } + return true, fmt.Sprintf("skipped rollback (%s: %s)", e.Reason, e.Message) + } + } + return false, "" +} diff --git a/pkg/kubectl/run.go b/pkg/kubectl/run.go index 43359a6792d..e0ed8ada89f 100644 --- a/pkg/kubectl/run.go +++ b/pkg/kubectl/run.go @@ -23,6 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util/validation" @@ -102,14 +103,13 @@ func (DeploymentV1Beta1) Generate(genericParams map[string]interface{}) (runtime }, Spec: extensions.DeploymentSpec{ Replicas: count, - Selector: labels, + Selector: &unversioned.LabelSelector{MatchLabels: labels}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: labels, }, Spec: *podSpec, }, - UniqueLabelKey: extensions.DefaultDeploymentUniqueLabelKey, }, } return &deployment, nil @@ -266,7 +266,7 @@ func (JobV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object Labels: labels, }, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: labels, }, Template: api.PodTemplateSpec{ diff --git a/pkg/kubectl/run_test.go b/pkg/kubectl/run_test.go index 449fdd0d634..27a366c418b 100644 --- a/pkg/kubectl/run_test.go +++ b/pkg/kubectl/run_test.go @@ -22,6 +22,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" ) @@ -654,9 +655,8 @@ func TestGenerateDeployment(t *testing.T) { Labels: map[string]string{"foo": "bar", "baz": "blah"}, }, Spec: extensions.DeploymentSpec{ - Replicas: 3, - Selector: map[string]string{"foo": "bar", "baz": "blah"}, - UniqueLabelKey: extensions.DefaultDeploymentUniqueLabelKey, + Replicas: 3, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"foo": "bar", "baz": "blah"}}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{"foo": "bar", "baz": "blah"}, @@ -746,7 +746,7 @@ func TestGenerateJob(t *testing.T) { Labels: map[string]string{"foo": "bar", "baz": "blah"}, }, Spec: extensions.JobSpec{ - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"foo": "bar", "baz": "blah"}, }, Template: api.PodTemplateSpec{ diff --git a/pkg/kubectl/scale.go b/pkg/kubectl/scale.go index 80f07df9201..74fe84a6bcb 100644 --- a/pkg/kubectl/scale.go +++ b/pkg/kubectl/scale.go @@ -44,10 +44,13 @@ func ScalerFor(kind unversioned.GroupKind, c client.Interface) (Scaler, error) { switch kind { case api.Kind("ReplicationController"): return &ReplicationControllerScaler{c}, nil + case extensions.Kind("ReplicaSet"): + return &ReplicaSetScaler{c.Extensions()}, nil case extensions.Kind("Job"): return &JobScaler{c.Extensions()}, nil - case extensions.Kind("Deployment"): - return &DeploymentScaler{c.Extensions()}, nil + // TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). + // case extensions.Kind("Deployment"): + // return &DeploymentScaler{c.Extensions()}, nil } return nil, fmt.Errorf("no scaler has been implemented for %q", kind) } @@ -186,6 +189,68 @@ func (scaler *ReplicationControllerScaler) Scale(namespace, name string, newSize return nil } +// ValidateReplicaSet ensures that the preconditions match. Returns nil if they are valid, an error otherwise +func (precondition *ScalePrecondition) ValidateReplicaSet(replicaSet *extensions.ReplicaSet) error { + if precondition.Size != -1 && replicaSet.Spec.Replicas != precondition.Size { + return PreconditionError{"replicas", strconv.Itoa(precondition.Size), strconv.Itoa(replicaSet.Spec.Replicas)} + } + if len(precondition.ResourceVersion) != 0 && replicaSet.ResourceVersion != precondition.ResourceVersion { + return PreconditionError{"resource version", precondition.ResourceVersion, replicaSet.ResourceVersion} + } + return nil +} + +type ReplicaSetScaler struct { + c client.ExtensionsInterface +} + +func (scaler *ReplicaSetScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error { + rs, err := scaler.c.ReplicaSets(namespace).Get(name) + if err != nil { + return ScaleError{ScaleGetFailure, "Unknown", err} + } + if preconditions != nil { + if err := preconditions.ValidateReplicaSet(rs); err != nil { + return err + } + } + rs.Spec.Replicas = int(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} + } + return ScaleError{ScaleUpdateFailure, rs.ResourceVersion, err} + } + return nil +} + +// Scale updates a ReplicaSet to a new size, with optional precondition check (if preconditions is +// not nil), optional retries (if retry is not nil), and then optionally waits for it's replica +// count to reach the new value (if wait is not nil). +func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error { + if preconditions == nil { + preconditions = &ScalePrecondition{-1, ""} + } + if retry == nil { + // Make it try only once, immediately + retry = &RetryParams{Interval: time.Millisecond, Timeout: time.Millisecond} + } + cond := ScaleCondition(scaler, preconditions, namespace, name, newSize) + if err := wait.Poll(retry.Interval, retry.Timeout, cond); err != nil { + return err + } + if waitForReplicas != nil { + rs, err := scaler.c.ReplicaSets(namespace).Get(name) + if err != nil { + return err + } + return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, + client.ReplicaSetHasDesiredReplicas(scaler.c, rs)) + } + return nil +} + // ValidateJob ensures that the preconditions match. Returns nil if they are valid, an error otherwise. func (precondition *ScalePrecondition) ValidateJob(job *extensions.Job) error { if precondition.Size != -1 && job.Spec.Parallelism == nil { @@ -263,53 +328,57 @@ func (precondition *ScalePrecondition) ValidateDeployment(deployment *extensions return nil } -type DeploymentScaler struct { - c client.ExtensionsInterface -} +// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). +// type DeploymentScaler struct { +// c client.ExtensionsInterface +// } -// ScaleSimple is responsible for updating a deployment's desired replicas count. -func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error { - deployment, err := scaler.c.Deployments(namespace).Get(name) - if err != nil { - return ScaleError{ScaleGetFailure, "Unknown", err} - } - if preconditions != nil { - if err := preconditions.ValidateDeployment(deployment); err != nil { - return err - } - } - scale := extensions.ScaleFromDeployment(deployment) - scale.Spec.Replicas = int(newSize) - if _, err := scaler.c.Scales(namespace).Update("Deployment", scale); err != nil { - if errors.IsInvalid(err) { - return ScaleError{ScaleUpdateInvalidFailure, deployment.ResourceVersion, err} - } - return ScaleError{ScaleUpdateFailure, deployment.ResourceVersion, err} - } - return nil -} +// // ScaleSimple is responsible for updating a deployment's desired replicas count. +// func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error { +// deployment, err := scaler.c.Deployments(namespace).Get(name) +// if err != nil { +// return ScaleError{ScaleGetFailure, "Unknown", err} +// } +// if preconditions != nil { +// if err := preconditions.ValidateDeployment(deployment); err != nil { +// return err +// } +// } +// scale, err := extensions.ScaleFromDeployment(deployment) +// if err != nil { +// return ScaleError{ScaleUpdateFailure, deployment.ResourceVersion, err} +// } +// scale.Spec.Replicas = int(newSize) +// if _, err := scaler.c.Scales(namespace).Update("Deployment", scale); err != nil { +// if errors.IsInvalid(err) { +// return ScaleError{ScaleUpdateInvalidFailure, deployment.ResourceVersion, err} +// } +// return ScaleError{ScaleUpdateFailure, deployment.ResourceVersion, err} +// } +// return nil +// } -// Scale updates a deployment to a new size, with optional precondition check (if preconditions is not nil), -// optional retries (if retry is not nil), and then optionally waits for the status to reach desired count. -func (scaler *DeploymentScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error { - if preconditions == nil { - preconditions = &ScalePrecondition{-1, ""} - } - if retry == nil { - // Make it try only once, immediately - retry = &RetryParams{Interval: time.Millisecond, Timeout: time.Millisecond} - } - cond := ScaleCondition(scaler, preconditions, namespace, name, newSize) - if err := wait.Poll(retry.Interval, retry.Timeout, cond); err != nil { - return err - } - if waitForReplicas != nil { - deployment, err := scaler.c.Deployments(namespace).Get(name) - if err != nil { - return err - } - return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, - client.DeploymentHasDesiredReplicas(scaler.c, deployment)) - } - return nil -} +// // Scale updates a deployment to a new size, with optional precondition check (if preconditions is not nil), +// // optional retries (if retry is not nil), and then optionally waits for the status to reach desired count. +// func (scaler *DeploymentScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error { +// if preconditions == nil { +// preconditions = &ScalePrecondition{-1, ""} +// } +// if retry == nil { +// // Make it try only once, immediately +// retry = &RetryParams{Interval: time.Millisecond, Timeout: time.Millisecond} +// } +// cond := ScaleCondition(scaler, preconditions, namespace, name, newSize) +// if err := wait.Poll(retry.Interval, retry.Timeout, cond); err != nil { +// return err +// } +// if waitForReplicas != nil { +// deployment, err := scaler.c.Deployments(namespace).Get(name) +// if err != nil { +// return err +// } +// return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout, +// client.DeploymentHasDesiredReplicas(scaler.c, deployment)) +// } +// return nil +// } diff --git a/pkg/kubectl/scale_test.go b/pkg/kubectl/scale_test.go index 02d222ecfe5..ceff36021ae 100644 --- a/pkg/kubectl/scale_test.go +++ b/pkg/kubectl/scale_test.go @@ -488,143 +488,145 @@ func TestValidateJob(t *testing.T) { } } -type ErrorScales struct { - testclient.FakeScales - invalid bool -} +// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). -func (c *ErrorScales) Update(kind string, scale *extensions.Scale) (*extensions.Scale, error) { - if c.invalid { - return nil, kerrors.NewInvalid(extensions.Kind(scale.Kind), scale.Name, nil) - } - return nil, errors.New("scale update failure") -} +// type ErrorScales struct { +// testclient.FakeScales +// invalid bool +// } -func (c *ErrorScales) Get(kind, name string) (*extensions.Scale, error) { - return &extensions.Scale{ - Spec: extensions.ScaleSpec{ - Replicas: 0, - }, - }, nil -} +// func (c *ErrorScales) Update(kind string, scale *extensions.Scale) (*extensions.Scale, error) { +// if c.invalid { +// return nil, kerrors.NewInvalid(extensions.Kind(scale.Kind), scale.Name, nil) +// } +// return nil, errors.New("scale update failure") +// } -type ErrorDeployments struct { - testclient.FakeDeployments - invalid bool -} +// func (c *ErrorScales) Get(kind, name string) (*extensions.Scale, error) { +// return &extensions.Scale{ +// Spec: extensions.ScaleSpec{ +// Replicas: 0, +// }, +// }, nil +// } -func (c *ErrorDeployments) Update(deployment *extensions.Deployment) (*extensions.Deployment, error) { - if c.invalid { - return nil, kerrors.NewInvalid(extensions.Kind(deployment.Kind), deployment.Name, nil) - } - return nil, errors.New("deployment update failure") -} +// type ErrorDeployments struct { +// testclient.FakeDeployments +// invalid bool +// } -func (c *ErrorDeployments) Get(name string) (*extensions.Deployment, error) { - return &extensions.Deployment{ - Spec: extensions.DeploymentSpec{ - Replicas: 0, - }, - }, nil -} +// func (c *ErrorDeployments) Update(deployment *extensions.Deployment) (*extensions.Deployment, error) { +// if c.invalid { +// return nil, kerrors.NewInvalid(extensions.Kind(deployment.Kind), deployment.Name, nil) +// } +// return nil, errors.New("deployment update failure") +// } -type ErrorDeploymentClient struct { - testclient.FakeExperimental - invalid bool -} +// func (c *ErrorDeployments) Get(name string) (*extensions.Deployment, error) { +// return &extensions.Deployment{ +// Spec: extensions.DeploymentSpec{ +// Replicas: 0, +// }, +// }, nil +// } -func (c *ErrorDeploymentClient) Deployments(namespace string) client.DeploymentInterface { - return &ErrorDeployments{testclient.FakeDeployments{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid} -} +// type ErrorDeploymentClient struct { +// testclient.FakeExperimental +// invalid bool +// } -func (c *ErrorDeploymentClient) Scales(namespace string) client.ScaleInterface { - return &ErrorScales{testclient.FakeScales{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid} -} +// func (c *ErrorDeploymentClient) Deployments(namespace string) client.DeploymentInterface { +// return &ErrorDeployments{testclient.FakeDeployments{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid} +// } -func TestDeploymentScaleRetry(t *testing.T) { - fake := &ErrorDeploymentClient{FakeExperimental: testclient.FakeExperimental{Fake: &testclient.Fake{}}, invalid: false} - scaler := &DeploymentScaler{fake} - preconditions := &ScalePrecondition{-1, ""} - count := uint(3) - name := "foo" - namespace := "default" +// func (c *ErrorDeploymentClient) Scales(namespace string) client.ScaleInterface { +// return &ErrorScales{testclient.FakeScales{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid} +// } - scaleFunc := ScaleCondition(scaler, preconditions, namespace, name, count) - pass, err := scaleFunc() - if pass != false { - t.Errorf("Expected an update failure to return pass = false, got pass = %v", pass) - } - if err != nil { - t.Errorf("Did not expect an error on update failure, got %v", err) - } - preconditions = &ScalePrecondition{3, ""} - scaleFunc = ScaleCondition(scaler, preconditions, namespace, name, count) - pass, err = scaleFunc() - if err == nil { - t.Errorf("Expected error on precondition failure") - } -} +// func TestDeploymentScaleRetry(t *testing.T) { +// fake := &ErrorDeploymentClient{FakeExperimental: testclient.FakeExperimental{Fake: &testclient.Fake{}}, invalid: false} +// scaler := &DeploymentScaler{fake} +// preconditions := &ScalePrecondition{-1, ""} +// count := uint(3) +// name := "foo" +// namespace := "default" -func TestDeploymentScale(t *testing.T) { - fake := &testclient.FakeExperimental{Fake: &testclient.Fake{}} - scaler := DeploymentScaler{fake} - preconditions := ScalePrecondition{-1, ""} - count := uint(3) - name := "foo" - scaler.Scale("default", name, count, &preconditions, nil, nil) +// scaleFunc := ScaleCondition(scaler, preconditions, namespace, name, count) +// pass, err := scaleFunc() +// if pass != false { +// t.Errorf("Expected an update failure to return pass = false, got pass = %v", pass) +// } +// if err != nil { +// t.Errorf("Did not expect an error on update failure, got %v", err) +// } +// preconditions = &ScalePrecondition{3, ""} +// scaleFunc = ScaleCondition(scaler, preconditions, namespace, name, count) +// pass, err = scaleFunc() +// if err == nil { +// t.Errorf("Expected error on precondition failure") +// } +// } - actions := fake.Actions() - if len(actions) != 2 { - t.Errorf("unexpected actions: %v, expected 2 actions (get, update)", actions) - } - if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "deployments" || action.GetName() != name { - t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name) - } - // TODO: The testclient needs to support subresources - if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "Deployment" || action.GetObject().(*extensions.Scale).Spec.Replicas != int(count) { - t.Errorf("unexpected action %v, expected update-deployment-scale with replicas = %d", actions[1], count) - } -} +// func TestDeploymentScale(t *testing.T) { +// fake := &testclient.FakeExperimental{Fake: &testclient.Fake{}} +// scaler := DeploymentScaler{fake} +// preconditions := ScalePrecondition{-1, ""} +// count := uint(3) +// name := "foo" +// scaler.Scale("default", name, count, &preconditions, nil, nil) -func TestDeploymentScaleInvalid(t *testing.T) { - fake := &ErrorDeploymentClient{FakeExperimental: testclient.FakeExperimental{Fake: &testclient.Fake{}}, invalid: true} - scaler := DeploymentScaler{fake} - preconditions := ScalePrecondition{-1, ""} - count := uint(3) - name := "foo" - namespace := "default" +// actions := fake.Actions() +// if len(actions) != 2 { +// t.Errorf("unexpected actions: %v, expected 2 actions (get, update)", actions) +// } +// if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "deployments" || action.GetName() != name { +// t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name) +// } +// // TODO: The testclient needs to support subresources +// if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "Deployment" || action.GetObject().(*extensions.Scale).Spec.Replicas != int(count) { +// t.Errorf("unexpected action %v, expected update-deployment-scale with replicas = %d", actions[1], count) +// } +// } - scaleFunc := ScaleCondition(&scaler, &preconditions, namespace, name, count) - pass, err := scaleFunc() - if pass { - t.Errorf("Expected an update failure to return pass = false, got pass = %v", pass) - } - e, ok := err.(ScaleError) - if err == nil || !ok || e.FailureType != ScaleUpdateInvalidFailure { - t.Errorf("Expected error on invalid update failure, got %v", err) - } -} +// func TestDeploymentScaleInvalid(t *testing.T) { +// fake := &ErrorDeploymentClient{FakeExperimental: testclient.FakeExperimental{Fake: &testclient.Fake{}}, invalid: true} +// scaler := DeploymentScaler{fake} +// preconditions := ScalePrecondition{-1, ""} +// count := uint(3) +// name := "foo" +// namespace := "default" -func TestDeploymentScaleFailsPreconditions(t *testing.T) { - fake := testclient.NewSimpleFake(&extensions.Deployment{ - Spec: extensions.DeploymentSpec{ - Replicas: 10, - }, - }) - scaler := DeploymentScaler{&testclient.FakeExperimental{fake}} - preconditions := ScalePrecondition{2, ""} - count := uint(3) - name := "foo" - scaler.Scale("default", name, count, &preconditions, nil, nil) +// scaleFunc := ScaleCondition(&scaler, &preconditions, namespace, name, count) +// pass, err := scaleFunc() +// if pass { +// t.Errorf("Expected an update failure to return pass = false, got pass = %v", pass) +// } +// e, ok := err.(ScaleError) +// if err == nil || !ok || e.FailureType != ScaleUpdateInvalidFailure { +// t.Errorf("Expected error on invalid update failure, got %v", err) +// } +// } - actions := fake.Actions() - if len(actions) != 1 { - t.Errorf("unexpected actions: %v, expected 1 actions (get)", actions) - } - if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "deployments" || action.GetName() != name { - t.Errorf("unexpected action: %v, expected get-deployment %s", actions[0], name) - } -} +// func TestDeploymentScaleFailsPreconditions(t *testing.T) { +// fake := testclient.NewSimpleFake(&extensions.Deployment{ +// Spec: extensions.DeploymentSpec{ +// Replicas: 10, +// }, +// }) +// scaler := DeploymentScaler{&testclient.FakeExperimental{fake}} +// preconditions := ScalePrecondition{2, ""} +// count := uint(3) +// name := "foo" +// scaler.Scale("default", name, count, &preconditions, nil, nil) + +// actions := fake.Actions() +// if len(actions) != 1 { +// t.Errorf("unexpected actions: %v, expected 1 actions (get)", actions) +// } +// if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "deployments" || action.GetName() != name { +// t.Errorf("unexpected action: %v, expected get-deployment %s", actions[0], name) +// } +// } func TestValidateDeployment(t *testing.T) { zero, ten, twenty := 0, 10, 20 diff --git a/pkg/kubectl/stop.go b/pkg/kubectl/stop.go index 11409dfc11a..a430089b878 100644 --- a/pkg/kubectl/stop.go +++ b/pkg/kubectl/stop.go @@ -63,6 +63,9 @@ func ReaperFor(kind unversioned.GroupKind, c client.Interface) (Reaper, error) { case api.Kind("ReplicationController"): return &ReplicationControllerReaper{c, Interval, Timeout}, nil + case extensions.Kind("ReplicaSet"): + return &ReplicaSetReaper{c, Interval, Timeout}, nil + case extensions.Kind("DaemonSet"): return &DaemonSetReaper{c, Interval, Timeout}, nil @@ -87,6 +90,10 @@ type ReplicationControllerReaper struct { client.Interface pollInterval, timeout time.Duration } +type ReplicaSetReaper struct { + client.Interface + pollInterval, timeout time.Duration +} type DaemonSetReaper struct { client.Interface pollInterval, timeout time.Duration @@ -190,6 +197,81 @@ func (reaper *ReplicationControllerReaper) Stop(namespace, name string, timeout return nil } +// TODO(madhusudancs): Implement it when controllerRef is implemented - https://github.com/kubernetes/kubernetes/issues/2210 +// getOverlappingReplicaSets finds ReplicaSets that this ReplicaSet overlaps, as well as ReplicaSets overlapping this ReplicaSet. +func getOverlappingReplicaSets(c client.ReplicaSetInterface, rs *extensions.ReplicaSet) ([]extensions.ReplicaSet, []extensions.ReplicaSet, error) { + var overlappingRSs, exactMatchRSs []extensions.ReplicaSet + return overlappingRSs, exactMatchRSs, nil +} + +func (reaper *ReplicaSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error { + rsc := reaper.Extensions().ReplicaSets(namespace) + scaler, err := ScalerFor(extensions.Kind("ReplicaSet"), *reaper) + if err != nil { + return err + } + rs, err := rsc.Get(name) + if err != nil { + return err + } + if timeout == 0 { + timeout = Timeout + time.Duration(10*rs.Spec.Replicas)*time.Second + } + + // The ReplicaSet controller will try and detect all matching ReplicaSets + // for a pod's labels, and only sync the oldest one. This means if we have + // a pod with labels [(k1: v1), (k2: v2)] and two ReplicaSets: rs1 with + // selector [(k1=v1)], and rs2 with selector [(k1=v1),(k2=v2)], the + // ReplicaSet controller will sync the older of the two ReplicaSets. + // + // If there are ReplicaSets with a superset of labels, eg: + // deleting: (k1=v1), superset: (k2=v2, k1=v1) + // - It isn't safe to delete the ReplicaSet because there could be a pod + // with labels (k1=v1) that isn't managed by the superset ReplicaSet. + // We can't scale it down either, because there could be a pod + // (k2=v2, k1=v1) that it deletes causing a fight with the superset + // ReplicaSet. + // If there are ReplicaSets with a subset of labels, eg: + // deleting: (k2=v2, k1=v1), subset: (k1=v1), superset: (k2=v2, k1=v1, k3=v3) + // - Even if it's safe to delete this ReplicaSet without a scale down because + // all it's pods are being controlled by the subset ReplicaSet the code + // returns an error. + + // In theory, creating overlapping ReplicaSets is user error, so the loop below + // tries to account for this logic only in the common case, where we end up + // with multiple ReplicaSets that have an exact match on selectors. + + // TODO(madhusudancs): Re-evaluate again when controllerRef is implemented - + // https://github.com/kubernetes/kubernetes/issues/2210 + overlappingRSs, exactMatchRSs, err := getOverlappingReplicaSets(rsc, rs) + if err != nil { + return fmt.Errorf("error getting ReplicaSets: %v", err) + } + + if len(overlappingRSs) > 0 { + var names []string + for _, overlappingRS := range overlappingRSs { + names = append(names, overlappingRS.Name) + } + return fmt.Errorf( + "Detected overlapping ReplicaSets for ReplicaSet %v: %v, please manage deletion individually with --cascade=false.", + rs.Name, strings.Join(names, ",")) + } + if len(exactMatchRSs) == 0 { + // No overlapping ReplicaSets. + retry := NewRetryParams(reaper.pollInterval, reaper.timeout) + waitForReplicas := NewRetryParams(reaper.pollInterval, timeout) + if err = scaler.Scale(namespace, name, 0, nil, retry, waitForReplicas); err != nil { + return err + } + } + + if err := rsc.Delete(name, gracePeriod); err != nil { + return err + } + return nil +} + func (reaper *DaemonSetReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *api.DeleteOptions) error { ds, err := reaper.Extensions().DaemonSets(namespace).Get(name) if err != nil { @@ -251,7 +333,7 @@ func (reaper *JobReaper) Stop(namespace, name string, timeout time.Duration, gra return err } // at this point only dead pods are left, that should be removed - selector, _ := extensions.LabelSelectorAsSelector(job.Spec.Selector) + selector, _ := unversioned.LabelSelectorAsSelector(job.Spec.Selector) options := api.ListOptions{LabelSelector: selector} podList, err := pods.List(options) if err != nil { diff --git a/pkg/kubectl/stop_test.go b/pkg/kubectl/stop_test.go index 2e2b5d343ea..5540815b347 100644 --- a/pkg/kubectl/stop_test.go +++ b/pkg/kubectl/stop_test.go @@ -264,6 +264,116 @@ func TestReplicationControllerStop(t *testing.T) { } } +func TestReplicaSetStop(t *testing.T) { + name := "foo" + ns := "default" + tests := []struct { + Name string + Objs []runtime.Object + StopError error + ExpectedActions []string + }{ + { + Name: "OnlyOneRS", + Objs: []runtime.Object{ + &extensions.ReplicaSet{ // GET + ObjectMeta: api.ObjectMeta{ + Name: name, + Namespace: ns, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: 0, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"k1": "v1"}}, + }, + }, + &extensions.ReplicaSetList{ // LIST + Items: []extensions.ReplicaSet{ + { + ObjectMeta: api.ObjectMeta{ + Name: name, + Namespace: ns, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: 0, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"k1": "v1"}}, + }, + }, + }, + }, + }, + StopError: nil, + ExpectedActions: []string{"get", "get", "update", "get", "get", "delete"}, + }, + { + Name: "NoOverlapping", + Objs: []runtime.Object{ + &extensions.ReplicaSet{ // GET + ObjectMeta: api.ObjectMeta{ + Name: name, + Namespace: ns, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: 0, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"k1": "v1"}}, + }, + }, + &extensions.ReplicaSetList{ // LIST + Items: []extensions.ReplicaSet{ + { + ObjectMeta: api.ObjectMeta{ + Name: "baz", + Namespace: ns, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: 0, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"k3": "v3"}}, + }, + }, + { + ObjectMeta: api.ObjectMeta{ + Name: name, + Namespace: ns, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: 0, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"k1": "v1"}}, + }, + }, + }, + }, + }, + StopError: nil, + ExpectedActions: []string{"get", "get", "update", "get", "get", "delete"}, + }, + // TODO: Implement tests for overlapping replica sets, similar to replication controllers, + // when the overlapping checks are implemented for replica sets. + } + + for _, test := range tests { + fake := testclient.NewSimpleFake(test.Objs...) + reaper := ReplicaSetReaper{fake, time.Millisecond, time.Millisecond} + err := reaper.Stop(ns, name, 0, nil) + if !reflect.DeepEqual(err, test.StopError) { + t.Errorf("%s unexpected error: %v", test.Name, err) + continue + } + + actions := fake.Actions() + if len(actions) != len(test.ExpectedActions) { + t.Errorf("%s unexpected actions: %v, expected %d actions got %d", test.Name, actions, len(test.ExpectedActions), len(actions)) + continue + } + for i, verb := range test.ExpectedActions { + if actions[i].GetResource() != "replicasets" { + t.Errorf("%s unexpected action: %+v, expected %s-replicaSet", test.Name, actions[i], verb) + } + if actions[i].GetVerb() != verb { + t.Errorf("%s unexpected action: %+v, expected %s-replicaSet", test.Name, actions[i], verb) + } + } + } +} + func TestJobStop(t *testing.T) { name := "foo" ns := "default" @@ -284,7 +394,7 @@ func TestJobStop(t *testing.T) { }, Spec: extensions.JobSpec{ Parallelism: &zero, - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"k1": "v1"}, }, }, @@ -298,7 +408,7 @@ func TestJobStop(t *testing.T) { }, Spec: extensions.JobSpec{ Parallelism: &zero, - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"k1": "v1"}, }, }, @@ -320,7 +430,7 @@ func TestJobStop(t *testing.T) { }, Spec: extensions.JobSpec{ Parallelism: &zero, - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"k1": "v1"}, }, }, @@ -334,7 +444,7 @@ func TestJobStop(t *testing.T) { }, Spec: extensions.JobSpec{ Parallelism: &zero, - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"k1": "v1"}, }, }, diff --git a/pkg/kubectl/testing/types.generated.go b/pkg/kubectl/testing/types.generated.go index 5888f237fdc..6ec3d88d1f8 100644 --- a/pkg/kubectl/testing/types.generated.go +++ b/pkg/kubectl/testing/types.generated.go @@ -88,9 +88,9 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [7]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" - yyq2[2] = true + yyq2[0] = true + yyq2[5] = x.Kind != "" + yyq2[6] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { r.EncodeArrayStart(7) @@ -107,74 +107,24 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[2] { - yy10 := &x.ObjectMeta - yy10.CodecEncodeSelf(e) + yy4 := &x.ObjectMeta + yy4.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq2[2] { + if yyq2[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.ObjectMeta - yy11.CodecEncodeSelf(e) + yy5 := &x.ObjectMeta + yy5.CodecEncodeSelf(e) } } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym13 := z.EncBinary() - _ = yym13 + yym7 := z.EncBinary() + _ = yym7 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) @@ -183,8 +133,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("Key")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Key)) @@ -195,8 +145,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.Map == nil { r.EncodeNil() } else { - yym16 := z.EncBinary() - _ = yym16 + yym10 := z.EncBinary() + _ = yym10 if false { } else { z.F.EncMapStringIntV(x.Map, false, e) @@ -209,8 +159,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.Map == nil { r.EncodeNil() } else { - yym17 := z.EncBinary() - _ = yym17 + yym11 := z.EncBinary() + _ = yym11 if false { } else { z.F.EncMapStringIntV(x.Map, false, e) @@ -222,8 +172,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.StringList == nil { r.EncodeNil() } else { - yym19 := z.EncBinary() - _ = yym19 + yym13 := z.EncBinary() + _ = yym13 if false { } else { z.F.EncSliceStringV(x.StringList, false, e) @@ -236,8 +186,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.StringList == nil { r.EncodeNil() } else { - yym20 := z.EncBinary() - _ = yym20 + yym14 := z.EncBinary() + _ = yym14 if false { } else { z.F.EncSliceStringV(x.StringList, false, e) @@ -249,8 +199,8 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.IntList == nil { r.EncodeNil() } else { - yym22 := z.EncBinary() - _ = yym22 + yym16 := z.EncBinary() + _ = yym16 if false { } else { z.F.EncSliceIntV(x.IntList, false, e) @@ -263,11 +213,61 @@ func (x *TestStruct) CodecEncodeSelf(e *codec1978.Encoder) { if x.IntList == nil { r.EncodeNil() } else { + yym17 := z.EncBinary() + _ = yym17 + if false { + } else { + z.F.EncSliceIntV(x.IntList, false, e) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[5] { + yym19 := z.EncBinary() + _ = yym19 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[5] { + 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[6] { + yym22 := z.EncBinary() + _ = yym22 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq2[6] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) yym23 := z.EncBinary() _ = yym23 if false { } else { - z.F.EncSliceIntV(x.IntList, false, e) + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } @@ -332,24 +332,12 @@ func (x *TestStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys26 := string(yys26Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys26 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } case "metadata": if r.TryDecodeAsNil() { x.ObjectMeta = pkg2_api.ObjectMeta{} } else { - yyv29 := &x.ObjectMeta - yyv29.CodecDecodeSelf(d) + yyv27 := &x.ObjectMeta + yyv27.CodecDecodeSelf(d) } case "Key": if r.TryDecodeAsNil() { @@ -361,38 +349,50 @@ func (x *TestStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Map = nil } else { - yyv31 := &x.Map - yym32 := z.DecBinary() - _ = yym32 + yyv29 := &x.Map + yym30 := z.DecBinary() + _ = yym30 if false { } else { - z.F.DecMapStringIntX(yyv31, false, d) + z.F.DecMapStringIntX(yyv29, false, d) } } case "StringList": if r.TryDecodeAsNil() { x.StringList = nil } else { - yyv33 := &x.StringList - yym34 := z.DecBinary() - _ = yym34 + yyv31 := &x.StringList + yym32 := z.DecBinary() + _ = yym32 if false { } else { - z.F.DecSliceStringX(yyv33, false, d) + z.F.DecSliceStringX(yyv31, false, d) } } case "IntList": if r.TryDecodeAsNil() { x.IntList = nil } else { - yyv35 := &x.IntList - yym36 := z.DecBinary() - _ = yym36 + yyv33 := &x.IntList + yym34 := z.DecBinary() + _ = yym34 if false { } else { - z.F.DecSliceIntX(yyv35, false, d) + z.F.DecSliceIntX(yyv33, false, 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, yys26) } // end switch yys26 @@ -418,6 +418,105 @@ func (x *TestStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv38 := &x.ObjectMeta + yyv38.CodecDecodeSelf(d) + } + yyj37++ + if yyhl37 { + yyb37 = yyj37 > l + } else { + yyb37 = r.CheckBreak() + } + if yyb37 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Key = "" + } else { + x.Key = string(r.DecodeString()) + } + yyj37++ + if yyhl37 { + yyb37 = yyj37 > l + } else { + yyb37 = r.CheckBreak() + } + if yyb37 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Map = nil + } else { + yyv40 := &x.Map + yym41 := z.DecBinary() + _ = yym41 + if false { + } else { + z.F.DecMapStringIntX(yyv40, false, d) + } + } + yyj37++ + if yyhl37 { + yyb37 = yyj37 > l + } else { + yyb37 = r.CheckBreak() + } + if yyb37 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.StringList = nil + } else { + yyv42 := &x.StringList + yym43 := z.DecBinary() + _ = yym43 + if false { + } else { + z.F.DecSliceStringX(yyv42, false, d) + } + } + yyj37++ + if yyhl37 { + yyb37 = yyj37 > l + } else { + yyb37 = r.CheckBreak() + } + if yyb37 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.IntList = nil + } else { + yyv44 := &x.IntList + yym45 := z.DecBinary() + _ = yym45 + if false { + } else { + z.F.DecSliceIntX(yyv44, false, d) + } + } + yyj37++ + if yyhl37 { + yyb37 = yyj37 > l + } else { + yyb37 = r.CheckBreak() + } + if yyb37 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -439,105 +538,6 @@ func (x *TestStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj37++ - if yyhl37 { - yyb37 = yyj37 > l - } else { - yyb37 = r.CheckBreak() - } - if yyb37 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv40 := &x.ObjectMeta - yyv40.CodecDecodeSelf(d) - } - yyj37++ - if yyhl37 { - yyb37 = yyj37 > l - } else { - yyb37 = r.CheckBreak() - } - if yyb37 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Key = "" - } else { - x.Key = string(r.DecodeString()) - } - yyj37++ - if yyhl37 { - yyb37 = yyj37 > l - } else { - yyb37 = r.CheckBreak() - } - if yyb37 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Map = nil - } else { - yyv42 := &x.Map - yym43 := z.DecBinary() - _ = yym43 - if false { - } else { - z.F.DecMapStringIntX(yyv42, false, d) - } - } - yyj37++ - if yyhl37 { - yyb37 = yyj37 > l - } else { - yyb37 = r.CheckBreak() - } - if yyb37 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.StringList = nil - } else { - yyv44 := &x.StringList - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - z.F.DecSliceStringX(yyv44, false, d) - } - } - yyj37++ - if yyhl37 { - yyb37 = yyj37 > l - } else { - yyb37 = r.CheckBreak() - } - if yyb37 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.IntList = nil - } else { - yyv46 := &x.IntList - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - z.F.DecSliceIntX(yyv46, false, d) - } - } for { yyj37++ if yyhl37 { diff --git a/pkg/kubelet/cadvisor/cadvisor_fake.go b/pkg/kubelet/cadvisor/cadvisor_fake.go index 0ec3abba1ab..780147f932c 100644 --- a/pkg/kubelet/cadvisor/cadvisor_fake.go +++ b/pkg/kubelet/cadvisor/cadvisor_fake.go @@ -36,6 +36,10 @@ func (c *Fake) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) return new(cadvisorapi.ContainerInfo), nil } +func (c *Fake) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + return map[string]cadvisorapiv2.ContainerInfo{}, nil +} + func (c *Fake) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) { return map[string]*cadvisorapi.ContainerInfo{}, nil } diff --git a/pkg/kubelet/cadvisor/cadvisor_linux.go b/pkg/kubelet/cadvisor/cadvisor_linux.go index dbc351fd830..2a23053f8f7 100644 --- a/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -137,6 +137,10 @@ func (cc *cadvisorClient) ContainerInfo(name string, req *cadvisorapi.ContainerI return cc.GetContainerInfo(name, req) } +func (cc *cadvisorClient) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + return cc.GetContainerInfoV2(name, options) +} + func (cc *cadvisorClient) VersionInfo() (*cadvisorapi.VersionInfo, error) { return cc.GetVersionInfo() } diff --git a/pkg/kubelet/cadvisor/cadvisor_mock.go b/pkg/kubelet/cadvisor/cadvisor_mock.go index 4cdbe05a01d..8823db7bcd2 100644 --- a/pkg/kubelet/cadvisor/cadvisor_mock.go +++ b/pkg/kubelet/cadvisor/cadvisor_mock.go @@ -40,6 +40,12 @@ func (c *Mock) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) return args.Get(0).(*cadvisorapi.ContainerInfo), args.Error(1) } +// ContainerInfoV2 is a mock implementation of Interface.ContainerInfoV2. +func (c *Mock) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + args := c.Called(name, options) + return args.Get(0).(map[string]cadvisorapiv2.ContainerInfo), args.Error(1) +} + func (c *Mock) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) { args := c.Called(name, req) return args.Get(0).(map[string]*cadvisorapi.ContainerInfo), args.Error(1) diff --git a/pkg/kubelet/cadvisor/cadvisor_unsupported.go b/pkg/kubelet/cadvisor/cadvisor_unsupported.go index 566d4742d6c..e0bcd4d6de6 100644 --- a/pkg/kubelet/cadvisor/cadvisor_unsupported.go +++ b/pkg/kubelet/cadvisor/cadvisor_unsupported.go @@ -49,6 +49,10 @@ func (cu *cadvisorUnsupported) ContainerInfo(name string, req *cadvisorapi.Conta return nil, unsupportedErr } +func (cu *cadvisorUnsupported) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + return nil, unsupportedErr +} + func (cu *cadvisorUnsupported) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) { return nil, unsupportedErr } diff --git a/pkg/kubelet/cadvisor/types.go b/pkg/kubelet/cadvisor/types.go index 75842b9c930..5bfbd2a0f06 100644 --- a/pkg/kubelet/cadvisor/types.go +++ b/pkg/kubelet/cadvisor/types.go @@ -27,6 +27,7 @@ type Interface interface { Start() error DockerContainer(name string, req *cadvisorapi.ContainerInfoRequest) (cadvisorapi.ContainerInfo, error) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) + ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) MachineInfo() (*cadvisorapi.MachineInfo, error) diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go index 31d016e9ca7..17644008655 100644 --- a/pkg/kubelet/cm/container_manager_linux.go +++ b/pkg/kubelet/cm/container_manager_linux.go @@ -33,12 +33,12 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/kubelet/cadvisor" - "k8s.io/kubernetes/pkg/util" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/mount" "k8s.io/kubernetes/pkg/util/oom" "k8s.io/kubernetes/pkg/util/sets" utilsysctl "k8s.io/kubernetes/pkg/util/sysctl" + "k8s.io/kubernetes/pkg/util/wait" ) const ( @@ -272,7 +272,7 @@ func (cm *containerManagerImpl) Start(nodeConfig NodeConfig) error { } // Run ensure state functions every minute. - go util.Until(func() { + go wait.Until(func() { for _, cont := range cm.systemContainers { if cont.ensureStateFunc != nil { if err := cont.ensureStateFunc(cont.manager); err != nil { @@ -280,7 +280,7 @@ func (cm *containerManagerImpl) Start(nodeConfig NodeConfig) error { } } } - }, time.Minute, util.NeverStop) + }, time.Minute, wait.NeverStop) return nil } @@ -300,6 +300,19 @@ func (cm *containerManagerImpl) SystemContainersLimit() api.ResourceList { } } +func isProcessRunningInHost(pid int) (bool, error) { + // Get init mount namespace. Mount namespace is unique for all containers. + initMntNs, err := os.Readlink("/proc/1/ns/mnt") + if err != nil { + return false, fmt.Errorf("failed to find mount namespace of init process") + } + processMntNs, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/mnt", pid)) + if err != nil { + return false, fmt.Errorf("failed to find mount namespace of process %q", pid) + } + return initMntNs == processMntNs, nil +} + // Ensures that the Docker daemon is in the desired container. func ensureDockerInContainer(cadvisor cadvisor.Interface, oomScoreAdj int, manager *fs.Manager) error { // What container is Docker in? @@ -322,6 +335,15 @@ func ensureDockerInContainer(cadvisor cadvisor.Interface, oomScoreAdj int, manag // Move if the pid is not already in the desired container. errs := []error{} for _, pid := range pids { + if runningInHost, err := isProcessRunningInHost(pid); err != nil { + errs = append(errs, err) + // Err on the side of caution. Avoid moving the docker daemon unless we are able to identify its context. + continue + } else if !runningInHost { + // Docker daemon is running inside a container. Don't touch that. + continue + } + cont, err := getContainer(pid) if err != nil { errs = append(errs, fmt.Errorf("failed to find container of PID %d: %v", pid, err)) @@ -365,10 +387,6 @@ func getContainer(pid int) (string, error) { // The reason of leaving kernel threads at root cgroup is that we don't want to tie the // execution of these threads with to-be defined /system quota and create priority inversions. // -// The reason of leaving process 1 at root cgroup is that libcontainer hardcoded on -// the base cgroup path based on process 1. Please see: -// https://github.com/kubernetes/kubernetes/issues/12789#issuecomment-132384126 -// for detail explanation. func ensureSystemContainer(rootContainer *fs.Manager, manager *fs.Manager) error { // Move non-kernel PIDs to the system container. attemptsRemaining := 10 @@ -387,7 +405,7 @@ func ensureSystemContainer(rootContainer *fs.Manager, manager *fs.Manager) error // Remove kernel pids and other protected PIDs (pid 1, PIDs already in system & kubelet containers) pids := make([]int, 0, len(allPids)) for _, pid := range allPids { - if isKernelPid(pid) { + if pid == 1 || isKernelPid(pid) { continue } diff --git a/pkg/kubelet/config/apiserver.go b/pkg/kubelet/config/apiserver.go index fa01dca3035..f78c5e3515a 100644 --- a/pkg/kubelet/config/apiserver.go +++ b/pkg/kubelet/config/apiserver.go @@ -20,14 +20,15 @@ package config import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fields" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) // NewSourceApiserver creates a config source that watches and pulls from the apiserver. -func NewSourceApiserver(c *client.Client, nodeName string, updates chan<- interface{}) { - lw := cache.NewListWatchFromClient(c, "pods", api.NamespaceAll, fields.OneTermEqualSelector(client.PodHost, nodeName)) +func NewSourceApiserver(c *clientset.Clientset, nodeName string, updates chan<- interface{}) { + lw := cache.NewListWatchFromClient(c.CoreClient, "pods", api.NamespaceAll, fields.OneTermEqualSelector(client.PodHost, nodeName)) newSourceApiserverFromLW(lw, updates) } diff --git a/pkg/kubelet/config/file.go b/pkg/kubelet/config/file.go index eff6c6956b6..da5cd74007d 100644 --- a/pkg/kubelet/config/file.go +++ b/pkg/kubelet/config/file.go @@ -27,7 +27,7 @@ import ( "k8s.io/kubernetes/pkg/api" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "github.com/golang/glog" ) @@ -45,7 +45,7 @@ func NewSourceFile(path string, nodeName string, period time.Duration, updates c updates: updates, } glog.V(1).Infof("Watching path %q", path) - go util.Until(config.run, period, util.NeverStop) + go wait.Until(config.run, period, wait.NeverStop) } func (s *sourceFile) run() { diff --git a/pkg/kubelet/config/file_test.go b/pkg/kubelet/config/file_test.go index bfa26291edc..fad1f227b99 100644 --- a/pkg/kubelet/config/file_test.go +++ b/pkg/kubelet/config/file_test.go @@ -29,8 +29,8 @@ import ( kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/securitycontext" - "k8s.io/kubernetes/pkg/util" utiltesting "k8s.io/kubernetes/pkg/util/testing" + "k8s.io/kubernetes/pkg/util/wait" ) func TestExtractFromNonExistentFile(t *testing.T) { @@ -53,7 +53,7 @@ func TestUpdateOnNonExistentFile(t *testing.T) { t.Fatalf("Expected %#v, Got %#v", expected, update) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Expected update, timeout instead") } } @@ -154,7 +154,7 @@ func TestReadPodsFromFile(t *testing.T) { if !api.Semantic.DeepEqual(testCase.expected, update) { t.Errorf("%s: Expected %#v, Got %#v", testCase.desc, testCase.expected, update) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("%s: Expected update, timeout instead", testCase.desc) } }() diff --git a/pkg/kubelet/config/http.go b/pkg/kubelet/config/http.go index fbdde92352f..11bed577278 100644 --- a/pkg/kubelet/config/http.go +++ b/pkg/kubelet/config/http.go @@ -26,7 +26,7 @@ import ( "k8s.io/kubernetes/pkg/api" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "github.com/golang/glog" ) @@ -49,7 +49,7 @@ func NewSourceURL(url string, header http.Header, nodeName string, period time.D data: nil, } glog.V(1).Infof("Watching URL %s", url) - go util.Until(config.run, period, util.NeverStop) + go wait.Until(config.run, period, wait.NeverStop) } func (s *sourceURL) run() { diff --git a/pkg/kubelet/container/fake_runtime.go b/pkg/kubelet/container/fake_runtime.go index 8a64dc959cc..f30c46e9ec6 100644 --- a/pkg/kubelet/container/fake_runtime.go +++ b/pkg/kubelet/container/fake_runtime.go @@ -236,15 +236,6 @@ func (f *FakeRuntime) KillContainerInPod(container api.Container, pod *api.Pod) return f.Err } -func (f *FakeRuntime) GetAPIPodStatus(*api.Pod) (*api.PodStatus, error) { - f.Lock() - defer f.Unlock() - - f.CalledFunctions = append(f.CalledFunctions, "GetAPIPodStatus") - status := f.APIPodStatus - return &status, f.Err -} - func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error) { f.Lock() defer f.Unlock() @@ -254,15 +245,6 @@ func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*PodS return &status, f.Err } -func (f *FakeRuntime) ConvertPodStatusToAPIPodStatus(_ *api.Pod, _ *PodStatus) (*api.PodStatus, error) { - f.Lock() - defer f.Unlock() - - f.CalledFunctions = append(f.CalledFunctions, "ConvertPodStatusToAPIPodStatus") - status := f.APIPodStatus - return &status, f.Err -} - func (f *FakeRuntime) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool) error { f.Lock() defer f.Unlock() diff --git a/pkg/kubelet/container/helpers.go b/pkg/kubelet/container/helpers.go index 3f43363d272..f5346950b61 100644 --- a/pkg/kubelet/container/helpers.go +++ b/pkg/kubelet/container/helpers.go @@ -36,10 +36,11 @@ type HandlerRunner interface { Run(containerID ContainerID, pod *api.Pod, container *api.Container, handler *api.Handler) error } -// RunContainerOptionsGenerator generates the options that necessary for -// container runtime to run a container. -type RunContainerOptionsGenerator interface { +// RuntimeHelper wraps kubelet to make container runtime +// able to get necessary informations like the RunContainerOptions, DNS settings. +type RuntimeHelper interface { GenerateRunContainerOptions(pod *api.Pod, container *api.Container) (*RunContainerOptions, error) + GetClusterDNS(pod *api.Pod) (dnsServers []string, dnsSearches []string, err error) } // ShouldContainerBeRestarted checks whether a container needs to be restarted. @@ -71,34 +72,6 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu return true } -// TODO(random-liu): This should be removed soon after rkt implements GetPodStatus. -func ShouldContainerBeRestartedOldVersion(container *api.Container, pod *api.Pod, podStatus *api.PodStatus) bool { - // Get all dead container status. - var resultStatus []*api.ContainerStatus - for i, containerStatus := range podStatus.ContainerStatuses { - if containerStatus.Name == container.Name && containerStatus.State.Terminated != nil { - resultStatus = append(resultStatus, &podStatus.ContainerStatuses[i]) - } - } - - // Check RestartPolicy for dead container. - if len(resultStatus) > 0 { - if pod.Spec.RestartPolicy == api.RestartPolicyNever { - glog.V(4).Infof("Already ran container %q of pod %q, do nothing", container.Name, format.Pod(pod)) - return false - } - if pod.Spec.RestartPolicy == api.RestartPolicyOnFailure { - // Check the exit code of last run. Note: This assumes the result is sorted - // by the created time in reverse order. - if resultStatus[0].State.Terminated.ExitCode == 0 { - glog.V(4).Infof("Already successfully ran container %q of pod %q, do nothing", container.Name, format.Pod(pod)) - return false - } - } - } - return true -} - // TODO(random-liu): Convert PodStatus to running Pod, should be deprecated soon func ConvertPodStatusToRunningPod(podStatus *PodStatus) Pod { runningPod := Pod{ diff --git a/pkg/kubelet/container/image_puller_test.go b/pkg/kubelet/container/image_puller_test.go index df48428fa56..f8d3ae16f3b 100644 --- a/pkg/kubelet/container/image_puller_test.go +++ b/pkg/kubelet/container/image_puller_test.go @@ -98,7 +98,7 @@ func TestPuller(t *testing.T) { } backOff := util.NewBackOff(time.Second, time.Minute) - fakeClock := &util.FakeClock{Time: time.Now()} + fakeClock := util.NewFakeClock(time.Now()) backOff.Clock = fakeClock fakeRuntime := &FakeRuntime{} diff --git a/pkg/kubelet/container/runtime.go b/pkg/kubelet/container/runtime.go index 4f3dabadbbd..67edb6a985e 100644 --- a/pkg/kubelet/container/runtime.go +++ b/pkg/kubelet/container/runtime.go @@ -69,20 +69,9 @@ type Runtime interface { // KillPod kills all the containers of a pod. Pod may be nil, running pod must not be. // TODO(random-liu): Return PodSyncResult in KillPod. KillPod(pod *api.Pod, runningPod Pod) error - // GetAPIPodStatus retrieves the api.PodStatus of the pod, including the information of - // all containers in the pod. Clients of this interface assume the - // containers' statuses in a pod always have a deterministic ordering - // (e.g., sorted by name). - GetAPIPodStatus(*api.Pod) (*api.PodStatus, error) // GetPodStatus retrieves the status of the pod, including the // information of all containers in the pod that are visble in Runtime. GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error) - // ConvertPodStatusToAPIPodStatus converts the PodStatus object to api.PodStatus. - // This function is needed because Docker generates some high-level and/or - // pod-level information for api.PodStatus (e.g., check whether the image - // exists to determine the reason). We should try generalizing the logic - // for all container runtimes in kubelet and remove this funciton. - ConvertPodStatusToAPIPodStatus(*api.Pod, *PodStatus) (*api.PodStatus, error) // PullImage pulls an image from the network to local storage using the supplied // secrets if necessary. PullImage(image ImageSpec, pullSecrets []api.Secret) error @@ -141,6 +130,14 @@ type Pod struct { Containers []*Container } +// PodPair contains both runtime#Pod and api#Pod +type PodPair struct { + // APIPod is the api.Pod + APIPod *api.Pod + // RunningPod is the pod defined defined in pkg/kubelet/container/runtime#Pod + RunningPod *Pod +} + // ContainerID is a type that identifies a container. type ContainerID struct { // The type of the container runtime. e.g. 'docker', 'rkt'. @@ -467,3 +464,7 @@ func ParsePodFullName(podFullName string) (string, string, error) { } return parts[0], parts[1], nil } + +// Option is a functional option type for Runtime, useful for +// completely optional settings. +type Option func(Runtime) diff --git a/pkg/kubelet/container/runtime_mock.go b/pkg/kubelet/container/runtime_mock.go index fd8eaec88eb..7503ba3cc35 100644 --- a/pkg/kubelet/container/runtime_mock.go +++ b/pkg/kubelet/container/runtime_mock.go @@ -77,21 +77,11 @@ func (r *Mock) KillContainerInPod(container api.Container, pod *api.Pod) error { return args.Error(0) } -func (r *Mock) GetAPIPodStatus(pod *api.Pod) (*api.PodStatus, error) { - args := r.Called(pod) - return args.Get(0).(*api.PodStatus), args.Error(1) -} - func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error) { args := r.Called(uid, name, namespace) return args.Get(0).(*PodStatus), args.Error(1) } -func (r *Mock) ConvertPodStatusToAPIPodStatus(pod *api.Pod, podStatus *PodStatus) (*api.PodStatus, error) { - args := r.Called(pod, podStatus) - return args.Get(0).(*api.PodStatus), args.Error(1) -} - func (r *Mock) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool) error { args := r.Called(containerID, cmd, stdin, stdout, stderr, tty) return args.Error(0) diff --git a/pkg/kubelet/container/serialized_image_puller.go b/pkg/kubelet/container/serialized_image_puller.go index e8d3deffb64..04507491994 100644 --- a/pkg/kubelet/container/serialized_image_puller.go +++ b/pkg/kubelet/container/serialized_image_puller.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) type imagePullRequest struct { @@ -59,7 +60,7 @@ func NewSerializedImagePuller(recorder record.EventRecorder, runtime Runtime, im backOff: imageBackOff, pullRequests: make(chan *imagePullRequest, 10), } - go util.Until(imagePuller.pullImages, time.Second, util.NeverStop) + go wait.Until(imagePuller.pullImages, time.Second, wait.NeverStop) return imagePuller } diff --git a/pkg/kubelet/container/serialized_image_puller_test.go b/pkg/kubelet/container/serialized_image_puller_test.go index 9313dfc09e6..df0f003a2e6 100644 --- a/pkg/kubelet/container/serialized_image_puller_test.go +++ b/pkg/kubelet/container/serialized_image_puller_test.go @@ -98,7 +98,7 @@ func TestSerializedPuller(t *testing.T) { } backOff := util.NewBackOff(time.Second, time.Minute) - fakeClock := &util.FakeClock{Time: time.Now()} + fakeClock := util.NewFakeClock(time.Now()) backOff.Clock = fakeClock fakeRuntime := &FakeRuntime{} diff --git a/pkg/kubelet/custommetrics/custom_metrics.go b/pkg/kubelet/custommetrics/custom_metrics.go new file mode 100644 index 00000000000..4a01211a178 --- /dev/null +++ b/pkg/kubelet/custommetrics/custom_metrics.go @@ -0,0 +1,48 @@ +/* +Copyright 2015 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. +*/ + +// Package custommetrics contains support for instrumenting cAdvisor to gather custom metrics from pods. +package custommetrics + +import ( + "path" + + "k8s.io/kubernetes/pkg/api" +) + +const ( + CustomMetricsDefinitionContainerFile = "definition.json" + + CustomMetricsDefinitionDir = "/etc/custom-metrics" +) + +// Alpha implementation. +// Returns a path to a cAdvisor-specific custom metrics configuration. +func GetCAdvisorCustomMetricsDefinitionPath(container *api.Container) (*string, error) { + // Assuemes that the container has Custom Metrics enabled if it has "/etc/custom-metrics" directory + // mounted as a volume. Custom Metrics definition is expected to be in "definition.json". + if container.VolumeMounts != nil { + for _, volumeMount := range container.VolumeMounts { + if path.Clean(volumeMount.MountPath) == path.Clean(CustomMetricsDefinitionDir) { + // TODO: add defintion file validation. + definitionPath := path.Clean(path.Join(volumeMount.MountPath, CustomMetricsDefinitionContainerFile)) + return &definitionPath, nil + } + } + } + // No Custom Metrics definition available. + return nil, nil +} diff --git a/pkg/kubelet/custommetrics/custom_metrics_test.go b/pkg/kubelet/custommetrics/custom_metrics_test.go new file mode 100644 index 00000000000..54892ad1bd0 --- /dev/null +++ b/pkg/kubelet/custommetrics/custom_metrics_test.go @@ -0,0 +1,48 @@ +/* +Copyright 2015 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. +*/ + +package custommetrics + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "k8s.io/kubernetes/pkg/api" +) + +func TestGetCAdvisorCustomMetricsDefinitionPath(t *testing.T) { + + regularContainer := &api.Container{ + Name: "test_container", + } + + cmContainer := &api.Container{ + Name: "test_container", + VolumeMounts: []api.VolumeMount{ + { + Name: "cm", + MountPath: CustomMetricsDefinitionDir, + }, + }, + } + path, err := GetCAdvisorCustomMetricsDefinitionPath(regularContainer) + assert.Nil(t, path) + assert.NoError(t, err) + + path, err = GetCAdvisorCustomMetricsDefinitionPath(cmContainer) + assert.NotEmpty(t, *path) + assert.NoError(t, err) +} diff --git a/pkg/kubelet/dockertools/convert.go b/pkg/kubelet/dockertools/convert.go index 3a8e9908ca6..5de70028349 100644 --- a/pkg/kubelet/dockertools/convert.go +++ b/pkg/kubelet/dockertools/convert.go @@ -21,8 +21,6 @@ import ( "strings" docker "github.com/fsouza/go-dockerclient" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) @@ -83,31 +81,3 @@ func toRuntimeImage(image *docker.APIImages) (*kubecontainer.Image, error) { Size: image.VirtualSize, }, nil } - -// convert ContainerStatus to api.ContainerStatus. -func containerStatusToAPIContainerStatus(containerStatus *kubecontainer.ContainerStatus) *api.ContainerStatus { - containerID := DockerPrefix + containerStatus.ID.ID - status := api.ContainerStatus{ - Name: containerStatus.Name, - RestartCount: containerStatus.RestartCount, - Image: containerStatus.Image, - ImageID: containerStatus.ImageID, - ContainerID: containerID, - } - switch containerStatus.State { - case kubecontainer.ContainerStateRunning: - status.State.Running = &api.ContainerStateRunning{StartedAt: unversioned.NewTime(containerStatus.StartedAt)} - case kubecontainer.ContainerStateExited: - status.State.Terminated = &api.ContainerStateTerminated{ - ExitCode: containerStatus.ExitCode, - Reason: containerStatus.Reason, - Message: containerStatus.Message, - StartedAt: unversioned.NewTime(containerStatus.StartedAt), - FinishedAt: unversioned.NewTime(containerStatus.FinishedAt), - ContainerID: containerID, - } - default: - status.State.Waiting = &api.ContainerStateWaiting{} - } - return &status -} diff --git a/pkg/kubelet/dockertools/docker.go b/pkg/kubelet/dockertools/docker.go index 8d499c4db70..91f6ba1ae74 100644 --- a/pkg/kubelet/dockertools/docker.go +++ b/pkg/kubelet/dockertools/docker.go @@ -81,6 +81,17 @@ type KubeletContainerName struct { ContainerName string } +// containerNamePrefix is used to identify the containers on the node managed by this +// process. +var containerNamePrefix = "k8s" + +// SetContainerNamePrefix allows the container prefix name for this process to be changed. +// This is intended to support testing and bootstrapping experimentation. It cannot be +// changed once the Kubelet starts. +func SetContainerNamePrefix(prefix string) { + containerNamePrefix = prefix +} + // DockerPuller is an abstract interface for testability. It abstracts image pull operations. type DockerPuller interface { Pull(image string, secrets []api.Secret) error @@ -209,8 +220,6 @@ func (p throttledDockerPuller) IsImagePresent(name string) (bool, error) { return p.puller.IsImagePresent(name) } -const containerNamePrefix = "k8s" - // Creates a name which can be reversed to identify both full pod name and container name. func BuildDockerName(dockerName KubeletContainerName, container *api.Container) (string, string) { containerName := dockerName.ContainerName + "." + strconv.FormatUint(kubecontainer.HashContainer(container), 16) diff --git a/pkg/kubelet/dockertools/fake_docker_client.go b/pkg/kubelet/dockertools/fake_docker_client.go index f73eebffdee..2b7364ed9cb 100644 --- a/pkg/kubelet/dockertools/fake_docker_client.go +++ b/pkg/kubelet/dockertools/fake_docker_client.go @@ -250,7 +250,7 @@ func (f *FakeDockerClient) CreateContainer(c docker.CreateContainerOptions) (*do // Docker likes to add a '/', so copy that behavior. name := "/" + c.Name f.Created = append(f.Created, name) - // The newest container should be in front, because we assume so in GetAPIPodStatus() + // The newest container should be in front, because we assume so in GetPodStatus() f.ContainerList = append([]docker.APIContainers{ {ID: name, Names: []string{name}, Image: c.Config.Image, Labels: c.Config.Labels}, }, f.ContainerList...) @@ -300,7 +300,7 @@ func (f *FakeDockerClient) StopContainer(id string, timeout uint) error { var newList []docker.APIContainers for _, container := range f.ContainerList { if container.ID == id { - // The newest exited container should be in front. Because we assume so in GetAPIPodStatus() + // The newest exited container should be in front. Because we assume so in GetPodStatus() f.ExitedContainerList = append([]docker.APIContainers{container}, f.ExitedContainerList...) continue } diff --git a/pkg/kubelet/dockertools/fake_manager.go b/pkg/kubelet/dockertools/fake_manager.go index 4f0a96cb58c..a193dda631b 100644 --- a/pkg/kubelet/dockertools/fake_manager.go +++ b/pkg/kubelet/dockertools/fake_manager.go @@ -40,14 +40,14 @@ func NewFakeDockerManager( containerLogsDir string, osInterface kubecontainer.OSInterface, networkPlugin network.NetworkPlugin, - generator kubecontainer.RunContainerOptionsGenerator, + runtimeHelper kubecontainer.RuntimeHelper, httpClient kubetypes.HttpGetter, imageBackOff *util.Backoff) *DockerManager { fakeOOMAdjuster := oom.NewFakeOOMAdjuster() fakeProcFs := procfs.NewFakeProcFS() dm := NewDockerManager(client, recorder, livenessManager, containerRefManager, machineInfo, podInfraContainerImage, qps, - burst, containerLogsDir, osInterface, networkPlugin, generator, httpClient, &NativeExecHandler{}, - fakeOOMAdjuster, fakeProcFs, false, imageBackOff, true) + burst, containerLogsDir, osInterface, networkPlugin, runtimeHelper, httpClient, &NativeExecHandler{}, + fakeOOMAdjuster, fakeProcFs, false, imageBackOff, true, false, true) dm.dockerPuller = &FakeDockerPuller{} return dm } diff --git a/pkg/kubelet/dockertools/labels.go b/pkg/kubelet/dockertools/labels.go index fd7ad7c8985..5b501465b88 100644 --- a/pkg/kubelet/dockertools/labels.go +++ b/pkg/kubelet/dockertools/labels.go @@ -23,6 +23,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/custommetrics" "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/types" @@ -47,6 +48,8 @@ const ( // TODO(random-liu): Keep this for old containers, remove this when we drop support for v1.1. kubernetesPodLabel = "io.kubernetes.pod.data" + + cadvisorPrometheusMetricsLabel = "io.cadvisor.metric.prometheus" ) // Container information which has been labelled on each docker container @@ -64,7 +67,23 @@ type labelledContainerInfo struct { PreStopHandler *api.Handler } -func newLabels(container *api.Container, pod *api.Pod, restartCount int) map[string]string { +func GetContainerName(labels map[string]string) string { + return labels[kubernetesContainerNameLabel] +} + +func GetPodName(labels map[string]string) string { + return labels[kubernetesPodNameLabel] +} + +func GetPodUID(labels map[string]string) string { + return labels[kubernetesPodUIDLabel] +} + +func GetPodNamespace(labels map[string]string) string { + return labels[kubernetesPodNamespaceLabel] +} + +func newLabels(container *api.Container, pod *api.Pod, restartCount int, enableCustomMetrics bool) map[string]string { labels := map[string]string{} labels[kubernetesPodNameLabel] = pod.Name labels[kubernetesPodNamespaceLabel] = pod.Namespace @@ -90,6 +109,13 @@ func newLabels(container *api.Container, pod *api.Pod, restartCount int) map[str } } + if enableCustomMetrics { + path, err := custommetrics.GetCAdvisorCustomMetricsDefinitionPath(container) + if path != nil && err == nil { + labels[cadvisorPrometheusMetricsLabel] = *path + } + } + return labels } diff --git a/pkg/kubelet/dockertools/labels_test.go b/pkg/kubelet/dockertools/labels_test.go index 74d38552fec..48eaa8059c5 100644 --- a/pkg/kubelet/dockertools/labels_test.go +++ b/pkg/kubelet/dockertools/labels_test.go @@ -81,7 +81,7 @@ func TestLabels(t *testing.T) { } // Test whether we can get right information from label - labels := newLabels(container, pod, restartCount) + labels := newLabels(container, pod, restartCount, false) containerInfo := getContainerInfoFromLabel(labels) if !reflect.DeepEqual(containerInfo, expected) { t.Errorf("expected %v, got %v", expected, containerInfo) @@ -97,7 +97,7 @@ func TestLabels(t *testing.T) { expected.PreStopHandler = nil // Because container is changed, the Hash should be updated expected.Hash = strconv.FormatUint(kubecontainer.HashContainer(container), 16) - labels = newLabels(container, pod, restartCount) + labels = newLabels(container, pod, restartCount, false) containerInfo = getContainerInfoFromLabel(labels) if !reflect.DeepEqual(containerInfo, expected) { t.Errorf("expected %v, got %v", expected, containerInfo) diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index 21495a49d3f..05767146163 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -25,7 +25,7 @@ import ( "os" "os/exec" "path" - "sort" + "regexp" "strconv" "strings" "sync" @@ -34,7 +34,6 @@ import ( "github.com/coreos/go-semver/semver" docker "github.com/fsouza/go-dockerclient" "github.com/golang/glog" - "github.com/golang/groupcache/lru" cadvisorapi "github.com/google/cadvisor/info/v1" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" @@ -55,7 +54,6 @@ import ( "k8s.io/kubernetes/pkg/util/oom" "k8s.io/kubernetes/pkg/util/procfs" utilruntime "k8s.io/kubernetes/pkg/util/runtime" - "k8s.io/kubernetes/pkg/util/sets" utilstrings "k8s.io/kubernetes/pkg/util/strings" ) @@ -64,8 +62,6 @@ const ( MinimumDockerAPIVersion = "1.18" - maxReasonCacheEntries = 200 - // ndots specifies the minimum number of dots that a domain name must contain for the resolver to consider it as FQDN (fully-qualified) // we want to able to consider SRV lookup names like _dns._udp.kube-dns.default.svc to be considered relative. // hence, setting ndots to be 5. @@ -100,17 +96,10 @@ type DockerManager struct { // The image name of the pod infra container. podInfraContainerImage string - // reasonCache stores the failure reason of the last container creation - // and/or start in a string, keyed by _. The goal - // is to propagate this reason to the container status. This endeavor is - // "best-effort" for two reasons: - // 1. The cache is not persisted. - // 2. We use an LRU cache to avoid extra garbage collection work. This - // means that some entries may be recycled before a pod has been - // deleted. - reasonCache reasonInfoCache - // TODO(yifan): Record the pull failure so we can eliminate the image checking - // in GetAPIPodStatus()? + // (Optional) Additional environment variables to be set for the pod infra container. + podInfraContainerEnv []api.EnvVar + + // TODO(yifan): Record the pull failure so we can eliminate the image checking? // Lower level docker image puller. dockerPuller DockerPuller @@ -129,8 +118,8 @@ type DockerManager struct { // Health check results. livenessManager proberesults.Manager - // Generator of runtime container options. - generator kubecontainer.RunContainerOptionsGenerator + // RuntimeHelper that wraps kubelet to generate runtime container options. + runtimeHelper kubecontainer.RuntimeHelper // Runner of lifecycle events. runner kubecontainer.HandlerRunner @@ -149,6 +138,26 @@ type DockerManager struct { // Container GC manager containerGC *containerGC + + // Support for gathering custom metrics. + enableCustomMetrics bool + + // If true, the "hairpin mode" flag is set on container interfaces. + // A false value means the kubelet just backs off from setting it, + // it might already be true. + configureHairpinMode bool +} + +func PodInfraContainerEnv(env map[string]string) kubecontainer.Option { + return func(rt kubecontainer.Runtime) { + dm := rt.(*DockerManager) + for k, v := range env { + dm.podInfraContainerEnv = append(dm.podInfraContainerEnv, api.EnvVar{ + Name: k, + Value: v, + }) + } + } } func NewDockerManager( @@ -163,14 +172,17 @@ func NewDockerManager( containerLogsDir string, osInterface kubecontainer.OSInterface, networkPlugin network.NetworkPlugin, - generator kubecontainer.RunContainerOptionsGenerator, + runtimeHelper kubecontainer.RuntimeHelper, httpClient kubetypes.HttpGetter, execHandler ExecHandler, oomAdjuster *oom.OOMAdjuster, procFs procfs.ProcFSInterface, cpuCFSQuota bool, imageBackOff *util.Backoff, - serializeImagePulls bool) *DockerManager { + serializeImagePulls bool, + enableCustomMetrics bool, + hairpinMode bool, + options ...kubecontainer.Option) *DockerManager { // Work out the location of the Docker runtime, defaulting to /var/lib/docker // if there are any problems. @@ -180,30 +192,10 @@ func NewDockerManager( glog.Errorf("Failed to execute Info() call to the Docker client: %v", err) glog.Warningf("Using fallback default of /var/lib/docker for location of Docker runtime") } else { - driverStatus := dockerInfo.Get("DriverStatus") - // The DriverStatus is a*string* which represents a list of list of strings (pairs) e.g. - // DriverStatus=[["Root Dir","/var/lib/docker/aufs"],["Backing Filesystem","extfs"],["Dirs","279"]] - // Strip out the square brakcets and quotes. - s := strings.Replace(driverStatus, "[", "", -1) - s = strings.Replace(s, "]", "", -1) - s = strings.Replace(s, `"`, "", -1) - // Separate by commas. - ss := strings.Split(s, ",") - // Search for the Root Dir string - for i, k := range ss { - if k == "Root Dir" && i+1 < len(ss) { - // Discard the /aufs suffix. - dockerRoot, _ = path.Split(ss[i+1]) - // Trim the last slash. - dockerRoot = strings.TrimSuffix(dockerRoot, "/") - glog.Infof("Setting dockerRoot to %s", dockerRoot) - } - - } + dockerRoot = dockerInfo.Get("DockerRootDir") + glog.Infof("Setting dockerRoot to %s", dockerRoot) } - reasonCache := reasonInfoCache{cache: lru.New(maxReasonCacheEntries)} - dm := &DockerManager{ client: client, recorder: recorder, @@ -211,17 +203,18 @@ func NewDockerManager( os: osInterface, machineInfo: machineInfo, podInfraContainerImage: podInfraContainerImage, - reasonCache: reasonCache, dockerPuller: newDockerPuller(client, qps, burst), dockerRoot: dockerRoot, containerLogsDir: containerLogsDir, networkPlugin: networkPlugin, livenessManager: livenessManager, - generator: generator, + runtimeHelper: runtimeHelper, execHandler: execHandler, oomAdjuster: oomAdjuster, procFs: procFs, cpuCFSQuota: cpuCFSQuota, + enableCustomMetrics: enableCustomMetrics, + configureHairpinMode: hairpinMode, } dm.runner = lifecycle.NewHandlerRunner(httpClient, dm, dm) if serializeImagePulls { @@ -231,44 +224,12 @@ func NewDockerManager( } dm.containerGC = NewContainerGC(client, containerLogsDir) - return dm -} - -// A cache which stores strings keyed by _. -type reasonInfoCache struct { - lock sync.RWMutex - cache *lru.Cache -} -type reasonInfo struct { - reason string - message string -} - -func (sc *reasonInfoCache) composeKey(uid types.UID, name string) string { - return fmt.Sprintf("%s_%s", uid, name) -} - -func (sc *reasonInfoCache) Add(uid types.UID, name string, reason, message string) { - sc.lock.Lock() - defer sc.lock.Unlock() - sc.cache.Add(sc.composeKey(uid, name), reasonInfo{reason, message}) -} - -func (sc *reasonInfoCache) Remove(uid types.UID, name string) { - sc.lock.Lock() - defer sc.lock.Unlock() - sc.cache.Remove(sc.composeKey(uid, name)) -} - -func (sc *reasonInfoCache) Get(uid types.UID, name string) (reasonInfo, bool) { - sc.lock.RLock() - defer sc.lock.RUnlock() - value, ok := sc.cache.Get(sc.composeKey(uid, name)) - if ok { - return value.(reasonInfo), ok - } else { - return reasonInfo{"", ""}, ok + // apply optional settings.. + for _, optf := range options { + optf(dm) } + + return dm } // GetContainerLogs returns logs of a specific container. By @@ -424,123 +385,6 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin return &status, "", nil } -// GetAPIPodStatus returns docker related status for all containers in the pod -// spec. -func (dm *DockerManager) GetAPIPodStatus(pod *api.Pod) (*api.PodStatus, error) { - // Get the pod status. - podStatus, err := dm.GetPodStatus(pod.UID, pod.Name, pod.Namespace) - if err != nil { - return nil, err - } - return dm.ConvertPodStatusToAPIPodStatus(pod, podStatus) -} - -func (dm *DockerManager) ConvertPodStatusToAPIPodStatus(pod *api.Pod, podStatus *kubecontainer.PodStatus) (*api.PodStatus, error) { - var apiPodStatus api.PodStatus - uid := pod.UID - - statuses := make(map[string]*api.ContainerStatus, len(pod.Spec.Containers)) - // Create a map of expected containers based on the pod spec. - expectedContainers := make(map[string]api.Container) - for _, container := range pod.Spec.Containers { - expectedContainers[container.Name] = container - } - - containerDone := sets.NewString() - apiPodStatus.PodIP = podStatus.IP - for _, containerStatus := range podStatus.ContainerStatuses { - cName := containerStatus.Name - if _, ok := expectedContainers[cName]; !ok { - // This would also ignore the infra container. - continue - } - if containerDone.Has(cName) { - continue - } - status := containerStatusToAPIContainerStatus(containerStatus) - if existing, found := statuses[cName]; found { - existing.LastTerminationState = status.State - containerDone.Insert(cName) - } else { - statuses[cName] = status - } - } - - // Handle the containers for which we cannot find any associated active or dead docker containers or are in restart backoff - // Fetch old containers statuses from old pod status. - oldStatuses := make(map[string]api.ContainerStatus, len(pod.Spec.Containers)) - for _, status := range pod.Status.ContainerStatuses { - oldStatuses[status.Name] = status - } - for _, container := range pod.Spec.Containers { - if containerStatus, found := statuses[container.Name]; found { - reasonInfo, ok := dm.reasonCache.Get(uid, container.Name) - if ok && reasonInfo.reason == kubecontainer.ErrCrashLoopBackOff.Error() { - containerStatus.LastTerminationState = containerStatus.State - containerStatus.State = api.ContainerState{ - Waiting: &api.ContainerStateWaiting{ - Reason: reasonInfo.reason, - Message: reasonInfo.message, - }, - } - } - continue - } - var containerStatus api.ContainerStatus - containerStatus.Name = container.Name - containerStatus.Image = container.Image - if oldStatus, found := oldStatuses[container.Name]; found { - // Some states may be lost due to GC; apply the last observed - // values if possible. - containerStatus.RestartCount = oldStatus.RestartCount - containerStatus.LastTerminationState = oldStatus.LastTerminationState - } - // TODO(dchen1107): docker/docker/issues/8365 to figure out if the image exists - reasonInfo, ok := dm.reasonCache.Get(uid, container.Name) - - if !ok { - // default position for a container - // At this point there are no active or dead containers, the reasonCache is empty (no entry or the entry has expired) - // its reasonable to say the container is being created till a more accurate reason is logged - containerStatus.State = api.ContainerState{ - Waiting: &api.ContainerStateWaiting{ - Reason: fmt.Sprintf("ContainerCreating"), - Message: fmt.Sprintf("Image: %s is ready, container is creating", container.Image), - }, - } - } else if reasonInfo.reason == kubecontainer.ErrImagePullBackOff.Error() || - reasonInfo.reason == kubecontainer.ErrImageInspect.Error() || - reasonInfo.reason == kubecontainer.ErrImagePull.Error() || - reasonInfo.reason == kubecontainer.ErrImageNeverPull.Error() { - // mark it as waiting, reason will be filled bellow - containerStatus.State = api.ContainerState{Waiting: &api.ContainerStateWaiting{}} - } else if reasonInfo.reason == kubecontainer.ErrRunContainer.Error() { - // mark it as waiting, reason will be filled bellow - containerStatus.State = api.ContainerState{Waiting: &api.ContainerStateWaiting{}} - } - statuses[container.Name] = &containerStatus - } - - apiPodStatus.ContainerStatuses = make([]api.ContainerStatus, 0) - for containerName, status := range statuses { - if status.State.Waiting != nil { - status.State.Running = nil - // For containers in the waiting state, fill in a specific reason if it is recorded. - if reasonInfo, ok := dm.reasonCache.Get(uid, containerName); ok { - status.State.Waiting.Reason = reasonInfo.reason - status.State.Waiting.Message = reasonInfo.message - } - } - apiPodStatus.ContainerStatuses = append(apiPodStatus.ContainerStatuses, *status) - } - - // Sort the container statuses since clients of this interface expect the list - // of containers in a pod to behave like the output of `docker list`, which has a - // deterministic order. - sort.Sort(kubetypes.SortedContainerStatuses(apiPodStatus.ContainerStatuses)) - return &apiPodStatus, nil -} - // makeEnvList converts EnvVar list to a list of strings, in the form of // '=', which can be understood by docker. func makeEnvList(envs []kubecontainer.EnvVar) (result []string) { @@ -656,7 +500,7 @@ func (dm *DockerManager) runContainer( // Pod information is recorded on the container as labels to preserve it in the event the pod is deleted // while the Kubelet is down and there is no information available to recover the pod. // TODO: keep these labels up to date if the pod changes - labels := newLabels(container, pod, restartCount) + labels := newLabels(container, pod, restartCount, dm.enableCustomMetrics) // TODO(random-liu): Remove this when we start to use new labels for KillContainerInPod if container.Lifecycle != nil && container.Lifecycle.PreStop != nil { @@ -947,6 +791,7 @@ func (dm *DockerManager) podInfraContainerChanged(pod *api.Pod, podInfraContaine Image: dm.podInfraContainerImage, Ports: ports, ImagePullPolicy: podInfraContainerImagePullPolicy, + Env: dm.podInfraContainerEnv, } return podInfraContainerStatus.Hash != kubecontainer.HashContainer(expectedPodInfraContainer), nil } @@ -964,24 +809,33 @@ type dockerVersion struct { *semver.Version } +// Older versions of Docker could return non-semantically versioned values (distros like Fedora +// included partial values such as 1.8.1.fc21 which is not semver). Force those values to be semver. +var almostSemverRegexp = regexp.MustCompile(`^(\d+\.\d+\.\d+)\.(.*)$`) + +// newDockerVersion returns a semantically versioned docker version value func newDockerVersion(version string) (dockerVersion, error) { sem, err := semver.NewVersion(version) if err != nil { - return dockerVersion{}, err + matches := almostSemverRegexp.FindStringSubmatch(version) + if matches == nil { + return dockerVersion{}, err + } + sem, err = semver.NewVersion(strings.Join(matches[1:], "-")) } - return dockerVersion{sem}, nil + return dockerVersion{sem}, err } func (r dockerVersion) Compare(other string) (int, error) { - v, err := semver.NewVersion(other) + v, err := newDockerVersion(other) if err != nil { return -1, err } - if r.LessThan(*v) { + if r.LessThan(*v.Version) { return -1, nil } - if v.LessThan(*r.Version) { + if v.Version.LessThan(*r.Version) { return 1, nil } return 0, nil @@ -1520,6 +1374,38 @@ func containerAndPodFromLabels(inspect *docker.Container) (pod *api.Pod, contain return } +func (dm *DockerManager) applyOOMScoreAdj(container *api.Container, containerInfo *docker.Container) error { + cgroupName, err := dm.procFs.GetFullContainerName(containerInfo.State.Pid) + if err != nil { + if err == os.ErrNotExist { + // Container exited. We cannot do anything about it. Ignore this error. + glog.V(2).Infof("Failed to apply OOM score adj on container %q with ID %q. Init process does not exist.", containerInfo.Name, containerInfo.ID) + return nil + } + return err + } + // Set OOM score of the container based on the priority of the container. + // Processes in lower-priority pods should be killed first if the system runs out of memory. + // The main pod infrastructure container is considered high priority, since if it is killed the + // whole pod will die. + // TODO: Cache this value. + var oomScoreAdj int + if containerInfo.Name == PodInfraContainerName { + oomScoreAdj = qos.PodInfraOOMAdj + } else { + oomScoreAdj = qos.GetContainerOOMScoreAdjust(container, int64(dm.machineInfo.MemoryCapacity)) + } + if err = dm.oomAdjuster.ApplyOOMScoreAdjContainer(cgroupName, oomScoreAdj, 5); err != nil { + if err == os.ErrNotExist { + // Container exited. We cannot do anything about it. Ignore this error. + glog.V(2).Infof("Failed to apply OOM score adj on container %q with ID %q. Init process does not exist.", containerInfo.Name, containerInfo.ID) + return nil + } + return err + } + return nil +} + // Run a single container from a pod. Returns the docker container ID // If do not need to pass labels, just pass nil. func (dm *DockerManager) runContainerInPod(pod *api.Pod, container *api.Container, netMode, ipcMode, pidMode string, restartCount int) (kubecontainer.ContainerID, error) { @@ -1533,7 +1419,7 @@ func (dm *DockerManager) runContainerInPod(pod *api.Pod, container *api.Containe glog.Errorf("Can't make a ref to pod %v, container %v: '%v'", pod.Name, container.Name, err) } - opts, err := dm.generator.GenerateRunContainerOptions(pod, container) + opts, err := dm.runtimeHelper.GenerateRunContainerOptions(pod, container) if err != nil { return kubecontainer.ContainerID{}, fmt.Errorf("GenerateRunContainerOptions: %v", err) } @@ -1581,24 +1467,9 @@ func (dm *DockerManager) runContainerInPod(pod *api.Pod, container *api.Containe return kubecontainer.ContainerID{}, fmt.Errorf("can't get init PID for container %q", id) } - // Set OOM score of the container based on the priority of the container. - // Processes in lower-priority pods should be killed first if the system runs out of memory. - // The main pod infrastructure container is considered high priority, since if it is killed the - // whole pod will die. - var oomScoreAdj int - if container.Name == PodInfraContainerName { - oomScoreAdj = qos.PodInfraOOMAdj - } else { - oomScoreAdj = qos.GetContainerOOMScoreAdjust(container, int64(dm.machineInfo.MemoryCapacity)) + if err := dm.applyOOMScoreAdj(container, containerInfo); err != nil { + return kubecontainer.ContainerID{}, fmt.Errorf("failed to apply oom-score-adj to container %q- %v", err, containerInfo.Name) } - cgroupName, err := dm.procFs.GetFullContainerName(containerInfo.State.Pid) - if err != nil { - return kubecontainer.ContainerID{}, fmt.Errorf("GetFullContainerName: %v", err) - } - if err = dm.oomAdjuster.ApplyOOMScoreAdjContainer(cgroupName, oomScoreAdj, 5); err != nil { - return kubecontainer.ContainerID{}, fmt.Errorf("ApplyOOMScoreAdjContainer: %v", err) - } - // The addNDotsOption call appends the ndots option to the resolv.conf file generated by docker. // This resolv.conf file is shared by all containers of the same pod, and needs to be modified only once per pod. // we modify it when the pause container is created since it is the first container created in the pod since it holds @@ -1654,7 +1525,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubecontainer.Do netNamespace := "" var ports []api.ContainerPort - if dm.networkPlugin.Name() == "cni" { + if dm.networkPlugin.Name() == "cni" || dm.networkPlugin.Name() == "kubenet" { netNamespace = "none" } @@ -1673,6 +1544,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubecontainer.Do Image: dm.podInfraContainerImage, Ports: ports, ImagePullPolicy: podInfraContainerImagePullPolicy, + Env: dm.podInfraContainerEnv, } // No pod secrets for the infra container. @@ -1816,20 +1688,6 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub }, nil } -// updateReasonCache updates the failure reason based on the registered error. -func (dm *DockerManager) updateReasonCache(pod *api.Pod, container *api.Container, briefError string, err error) { - if briefError == "" || err == nil { - return - } - errString := err.Error() - dm.reasonCache.Add(pod.UID, container.Name, briefError, errString) -} - -// clearReasonCache removes the entry in the reason cache. -func (dm *DockerManager) clearReasonCache(pod *api.Pod, container *api.Container) { - dm.reasonCache.Remove(pod.UID, container.Name) -} - // Sync the running pod to match the specified desired pod. func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubecontainer.PodStatus, pullSecrets []api.Secret, backOff *util.Backoff) (result kubecontainer.PodSyncResult) { start := time.Now() @@ -1939,7 +1797,7 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubec result.Fail(err) return } - if !usesHostNetwork(pod) { + if !usesHostNetwork(pod) && dm.configureHairpinMode { if err = hairpin.SetUpContainer(podInfraContainer.State.Pid, "eth0"); err != nil { glog.Warningf("Hairpin setup failed for pod %q: %v", format.Pod(pod), err) } @@ -1970,13 +1828,11 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubec err, msg := dm.imagePuller.PullImage(pod, container, pullSecrets) if err != nil { startContainerResult.Fail(err, msg) - dm.updateReasonCache(pod, container, err.Error(), errors.New(msg)) continue } if container.SecurityContext != nil && container.SecurityContext.RunAsNonRoot != nil && *container.SecurityContext.RunAsNonRoot { err := dm.verifyNonRoot(container) - dm.updateReasonCache(pod, container, kubecontainer.ErrVerifyNonRoot.Error(), err) if err != nil { startContainerResult.Fail(kubecontainer.ErrVerifyNonRoot, err.Error()) glog.Errorf("Error running pod %q container %q: %v", format.Pod(pod), container.Name, err) @@ -1997,7 +1853,6 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubec // See createPodInfraContainer for infra container setup. namespaceMode := fmt.Sprintf("container:%v", podInfraContainerID) _, err = dm.runContainerInPod(pod, container, namespaceMode, namespaceMode, getPidMode(pod), restartCount) - dm.updateReasonCache(pod, container, kubecontainer.ErrRunContainer.Error(), err) if err != nil { startContainerResult.Fail(kubecontainer.ErrRunContainer, err.Error()) // TODO(bburns) : Perhaps blacklist a container after N failures? @@ -2005,8 +1860,6 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubec continue } // Successfully started the container; clear the entry in the failure - // reason cache. - dm.clearReasonCache(pod, container) } return } @@ -2089,14 +1942,12 @@ func (dm *DockerManager) doBackOff(pod *api.Pod, container *api.Container, podSt dm.recorder.Eventf(ref, api.EventTypeWarning, kubecontainer.BackOffStartContainer, "Back-off restarting failed docker container") } err := fmt.Errorf("Back-off %s restarting failed container=%s pod=%s", backOff.Get(stableName), container.Name, format.Pod(pod)) - dm.updateReasonCache(pod, container, kubecontainer.ErrCrashLoopBackOff.Error(), err) glog.Infof("%s", err.Error()) return true, kubecontainer.ErrCrashLoopBackOff, err.Error() } backOff.Next(stableName, ts) } - dm.clearReasonCache(pod, container) return false, nil, "" } diff --git a/pkg/kubelet/dockertools/manager_test.go b/pkg/kubelet/dockertools/manager_test.go index 93dc54944d6..1f06b71fb76 100644 --- a/pkg/kubelet/dockertools/manager_test.go +++ b/pkg/kubelet/dockertools/manager_test.go @@ -31,10 +31,8 @@ import ( docker "github.com/fsouza/go-dockerclient" cadvisorapi "github.com/google/cadvisor/info/v1" - "github.com/stretchr/testify/assert" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/record" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/network" @@ -58,13 +56,15 @@ func (f *fakeHTTP) Get(url string) (*http.Response, error) { return nil, f.err } -type fakeOptionGenerator struct{} +// fakeRuntimeHelper implementes kubecontainer.RuntimeHelper inter +// faces for testing purposes. +type fakeRuntimeHelper struct{} -var _ kubecontainer.RunContainerOptionsGenerator = &fakeOptionGenerator{} +var _ kubecontainer.RuntimeHelper = &fakeRuntimeHelper{} var testPodContainerDir string -func (*fakeOptionGenerator) GenerateRunContainerOptions(pod *api.Pod, container *api.Container) (*kubecontainer.RunContainerOptions, error) { +func (f *fakeRuntimeHelper) GenerateRunContainerOptions(pod *api.Pod, container *api.Container) (*kubecontainer.RunContainerOptions, error) { var opts kubecontainer.RunContainerOptions var err error if len(container.TerminationMessagePath) != 0 { @@ -77,12 +77,15 @@ func (*fakeOptionGenerator) GenerateRunContainerOptions(pod *api.Pod, container return &opts, nil } +func (f *fakeRuntimeHelper) GetClusterDNS(pod *api.Pod) ([]string, []string, error) { + return nil, nil, fmt.Errorf("not implemented") +} + func newTestDockerManagerWithHTTPClient(fakeHTTPClient *fakeHTTP) (*DockerManager, *FakeDockerClient) { fakeDocker := NewFakeDockerClient() fakeRecorder := &record.FakeRecorder{} containerRefManager := kubecontainer.NewRefManager() networkPlugin, _ := network.InitNetworkPlugin([]network.NetworkPlugin{}, "", network.NewFakeHost(nil)) - optionGenerator := &fakeOptionGenerator{} dockerManager := NewFakeDockerManager( fakeDocker, fakeRecorder, @@ -93,7 +96,7 @@ func newTestDockerManagerWithHTTPClient(fakeHTTPClient *fakeHTTP) (*DockerManage 0, 0, "", kubecontainer.FakeOS{}, networkPlugin, - optionGenerator, + &fakeRuntimeHelper{}, fakeHTTPClient, util.NewBackOff(time.Second, 300*time.Second)) @@ -112,6 +115,35 @@ func matchString(t *testing.T, pattern, str string) bool { return match } +func TestNewDockerVersion(t *testing.T) { + cases := []struct { + value string + out string + err bool + }{ + {value: "1", err: true}, + {value: "1.8", err: true}, + {value: "1.8.1", out: "1.8.1"}, + {value: "1.8.1.fc21", out: "1.8.1-fc21"}, + {value: "1.8.1.fc21.other", out: "1.8.1-fc21.other"}, + {value: "1.8.1-fc21.other", out: "1.8.1-fc21.other"}, + {value: "1.8.1-beta.12", out: "1.8.1-beta.12"}, + } + for _, test := range cases { + v, err := newDockerVersion(test.value) + switch { + case err != nil && test.err: + continue + case (err != nil) != test.err: + t.Errorf("error for %q: expected %t, got %v", test.value, test.err, err) + continue + } + if v.String() != test.out { + t.Errorf("unexpected parsed version %q for %q", v, test.value) + } + } +} + func TestSetEntrypointAndCommand(t *testing.T) { cases := []struct { name string @@ -547,18 +579,14 @@ func runSyncPod(t *testing.T, dm *DockerManager, fakeDocker *FakeDockerClient, p if err != nil { t.Errorf("unexpected error: %v", err) } - var apiPodStatus *api.PodStatus - apiPodStatus, err = dm.ConvertPodStatusToAPIPodStatus(pod, podStatus) - if err != nil { - t.Errorf("unexpected error: %v", err) - } fakeDocker.ClearCalls() if backOff == nil { backOff = util.NewBackOff(time.Second, time.Minute) } - //TODO(random-liu): Add test for PodSyncResult - result := dm.SyncPod(pod, *apiPodStatus, podStatus, []api.Secret{}, backOff) + // TODO(random-liu): Add test for PodSyncResult + // api.PodStatus is not used in SyncPod now, pass in an empty one. + result := dm.SyncPod(pod, api.PodStatus{}, podStatus, []api.Secret{}, backOff) err = result.Error() if err != nil && !expectErr { t.Errorf("unexpected error: %v", err) @@ -890,65 +918,6 @@ func TestSyncPodsDoesNothing(t *testing.T) { }) } -func TestSyncPodWithPullPolicy(t *testing.T) { - dm, fakeDocker := newTestDockerManager() - puller := dm.dockerPuller.(*FakeDockerPuller) - puller.HasImages = []string{"existing_one", "want:latest"} - dm.podInfraContainerImage = "pod_infra_image" - - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - UID: "12345678", - Name: "foo", - Namespace: "new", - }, - Spec: api.PodSpec{ - Containers: []api.Container{ - {Name: "bar", Image: "pull_always_image", ImagePullPolicy: api.PullAlways}, - {Name: "bar2", Image: "pull_if_not_present_image", ImagePullPolicy: api.PullIfNotPresent}, - {Name: "bar3", Image: "existing_one", ImagePullPolicy: api.PullIfNotPresent}, - {Name: "bar4", Image: "want:latest", ImagePullPolicy: api.PullIfNotPresent}, - {Name: "bar5", Image: "pull_never_image", ImagePullPolicy: api.PullNever}, - }, - }, - } - - expectedStatusMap := map[string]api.ContainerState{ - "bar": {Running: &api.ContainerStateRunning{unversioned.Now()}}, - "bar2": {Running: &api.ContainerStateRunning{unversioned.Now()}}, - "bar3": {Running: &api.ContainerStateRunning{unversioned.Now()}}, - "bar4": {Running: &api.ContainerStateRunning{unversioned.Now()}}, - "bar5": {Waiting: &api.ContainerStateWaiting{Reason: kubecontainer.ErrImageNeverPull.Error(), - Message: "Container image \"pull_never_image\" is not present with pull policy of Never"}}, - } - - runSyncPod(t, dm, fakeDocker, pod, nil, true) - statuses, err := dm.GetAPIPodStatus(pod) - if err != nil { - t.Errorf("unable to get pod status") - } - for _, c := range pod.Spec.Containers { - if containerStatus, ok := api.GetContainerStatus(statuses.ContainerStatuses, c.Name); ok { - // copy the StartedAt time, to make the structs match - if containerStatus.State.Running != nil && expectedStatusMap[c.Name].Running != nil { - expectedStatusMap[c.Name].Running.StartedAt = containerStatus.State.Running.StartedAt - } - assert.Equal(t, expectedStatusMap[c.Name], containerStatus.State, "for container %s", c.Name) - } - } - - fakeDocker.Lock() - defer fakeDocker.Unlock() - - pulledImageSorted := puller.ImagesPulled[:] - sort.Strings(pulledImageSorted) - assert.Equal(t, []string{"pod_infra_image", "pull_always_image", "pull_if_not_present_image"}, pulledImageSorted) - - if len(fakeDocker.Created) != 5 { - t.Errorf("Unexpected containers created %v", fakeDocker.Created) - } -} - func TestSyncPodWithRestartPolicy(t *testing.T) { dm, fakeDocker := newTestDockerManager() containers := []api.Container{ @@ -1053,114 +1022,8 @@ func TestSyncPodWithRestartPolicy(t *testing.T) { } } -func TestGetAPIPodStatusWithLastTermination(t *testing.T) { - dm, fakeDocker := newTestDockerManager() - containers := []api.Container{ - {Name: "succeeded"}, - {Name: "failed"}, - } - - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - UID: "12345678", - Name: "foo", - Namespace: "new", - }, - Spec: api.PodSpec{ - Containers: containers, - }, - } - - dockerContainers := []*docker.Container{ - { - ID: "9876", - Name: "/k8s_POD." + strconv.FormatUint(generatePodInfraContainerHash(pod), 16) + "_foo_new_12345678_0", - State: docker.State{ - StartedAt: time.Now(), - FinishedAt: time.Now(), - Running: true, - }, - }, - { - ID: "1234", - Name: "/k8s_succeeded." + strconv.FormatUint(kubecontainer.HashContainer(&containers[0]), 16) + "_foo_new_12345678_0", - State: docker.State{ - ExitCode: 0, - StartedAt: time.Now(), - FinishedAt: time.Now(), - }, - }, - { - ID: "5678", - Name: "/k8s_failed." + strconv.FormatUint(kubecontainer.HashContainer(&containers[1]), 16) + "_foo_new_12345678_0", - State: docker.State{ - ExitCode: 42, - StartedAt: time.Now(), - FinishedAt: time.Now(), - }, - }, - } - - tests := []struct { - policy api.RestartPolicy - created []string - stopped []string - lastTerminations []string - }{ - { - api.RestartPolicyAlways, - []string{"succeeded", "failed"}, - []string{}, - []string{"docker://1234", "docker://5678"}, - }, - { - api.RestartPolicyOnFailure, - []string{"failed"}, - []string{}, - []string{"docker://5678"}, - }, - { - api.RestartPolicyNever, - []string{}, - []string{"9876"}, - []string{}, - }, - } - - for i, tt := range tests { - fakeDocker.SetFakeContainers(dockerContainers) - fakeDocker.ClearCalls() - pod.Spec.RestartPolicy = tt.policy - runSyncPod(t, dm, fakeDocker, pod, nil, false) - - // Check if we can retrieve the pod status. - status, err := dm.GetAPIPodStatus(pod) - if err != nil { - t.Fatalf("unexpected error %v", err) - } - terminatedContainers := []string{} - for _, cs := range status.ContainerStatuses { - if cs.LastTerminationState.Terminated != nil { - terminatedContainers = append(terminatedContainers, cs.LastTerminationState.Terminated.ContainerID) - } - } - sort.StringSlice(terminatedContainers).Sort() - sort.StringSlice(tt.lastTerminations).Sort() - if !reflect.DeepEqual(terminatedContainers, tt.lastTerminations) { - t.Errorf("Expected(sorted): %#v, Actual(sorted): %#v", tt.lastTerminations, terminatedContainers) - } - - if err := fakeDocker.AssertCreated(tt.created); err != nil { - t.Errorf("%d: %v", i, err) - } - if err := fakeDocker.AssertStopped(tt.stopped); err != nil { - t.Errorf("%d: %v", i, err) - } - } -} - func TestSyncPodBackoff(t *testing.T) { - var fakeClock = &util.FakeClock{Time: time.Now()} + var fakeClock = util.NewFakeClock(time.Now()) startTime := fakeClock.Now() dm, fakeDocker := newTestDockerManager() @@ -1232,7 +1095,7 @@ func TestSyncPodBackoff(t *testing.T) { backOff.Clock = fakeClock for _, c := range tests { fakeDocker.SetFakeContainers(dockerContainers) - fakeClock.Time = startTime.Add(time.Duration(c.tick) * time.Second) + fakeClock.SetTime(startTime.Add(time.Duration(c.tick) * time.Second)) runSyncPod(t, dm, fakeDocker, pod, backOff, c.expectErr) verifyCalls(t, fakeDocker, c.result) @@ -1248,101 +1111,10 @@ func TestSyncPodBackoff(t *testing.T) { } } } -func TestGetPodCreationFailureReason(t *testing.T) { - dm, fakeDocker := newTestDockerManager() - // Inject the creation failure error to docker. - failureReason := "RunContainerError" - fakeDocker.Errors = map[string]error{ - "create": fmt.Errorf("%s", failureReason), - } - - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - UID: "12345678", - Name: "foo", - Namespace: "new", - }, - Spec: api.PodSpec{ - Containers: []api.Container{{Name: "bar"}}, - }, - } - - // Pretend that the pod infra container has already been created, so that - // we can run the user containers. - fakeDocker.SetFakeRunningContainers([]*docker.Container{{ - ID: "9876", - Name: "/k8s_POD." + strconv.FormatUint(generatePodInfraContainerHash(pod), 16) + "_foo_new_12345678_0", - }}) - - runSyncPod(t, dm, fakeDocker, pod, nil, true) - // Check if we can retrieve the pod status. - status, err := dm.GetAPIPodStatus(pod) - if err != nil { - t.Fatalf("unexpected error %v", err) - } - - if len(status.ContainerStatuses) < 1 { - t.Errorf("expected 1 container status, got %d", len(status.ContainerStatuses)) - } else { - state := status.ContainerStatuses[0].State - if state.Waiting == nil { - t.Errorf("expected waiting state, got %#v", state) - } else if state.Waiting.Reason != failureReason { - t.Errorf("expected reason %q, got %q", failureReason, state.Waiting.Reason) - } - } -} - -func TestGetPodPullImageFailureReason(t *testing.T) { - dm, fakeDocker := newTestDockerManager() - // Initialize the FakeDockerPuller so that it'd try to pull non-existent - // images. - puller := dm.dockerPuller.(*FakeDockerPuller) - puller.HasImages = []string{} - // Inject the pull image failure error. - failureReason := kubecontainer.ErrImagePull.Error() - puller.ErrorsToInject = []error{fmt.Errorf("%s", failureReason)} - - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - UID: "12345678", - Name: "foo", - Namespace: "new", - }, - Spec: api.PodSpec{ - Containers: []api.Container{{Name: "bar", Image: "realImage", ImagePullPolicy: api.PullAlways}}, - }, - } - // Pretend that the pod infra container has already been created, so that - // we can run the user containers. - fakeDocker.SetFakeRunningContainers([]*docker.Container{{ - ID: "9876", - Name: "/k8s_POD." + strconv.FormatUint(generatePodInfraContainerHash(pod), 16) + "_foo_new_12345678_0", - }}) - runSyncPod(t, dm, fakeDocker, pod, nil, true) - // Check if we can retrieve the pod status. - status, err := dm.GetAPIPodStatus(pod) - if err != nil { - t.Fatalf("unexpected error %v", err) - } - - if len(status.ContainerStatuses) < 1 { - t.Errorf("expected 1 container status, got %d", len(status.ContainerStatuses)) - } else { - state := status.ContainerStatuses[0].State - if state.Waiting == nil { - t.Errorf("expected waiting state, got %#v", state) - } else if state.Waiting.Reason != failureReason { - t.Errorf("expected reason %q, got %q", failureReason, state.Waiting.Reason) - } - } -} func TestGetRestartCount(t *testing.T) { dm, fakeDocker := newTestDockerManager() - containers := []api.Container{ - {Name: "bar"}, - } + containerName := "bar" pod := api.Pod{ ObjectMeta: api.ObjectMeta{ UID: "12345678", @@ -1350,67 +1122,83 @@ func TestGetRestartCount(t *testing.T) { Namespace: "new", }, Spec: api.PodSpec{ - Containers: containers, + Containers: []api.Container{ + {Name: containerName}, + }, RestartPolicy: "Always", }, + Status: api.PodStatus{ + ContainerStatuses: []api.ContainerStatus{ + { + Name: containerName, + RestartCount: 3, + }, + }, + }, } // Helper function for verifying the restart count. - verifyRestartCount := func(pod *api.Pod, expectedCount int) api.PodStatus { + verifyRestartCount := func(pod *api.Pod, expectedCount int) { runSyncPod(t, dm, fakeDocker, pod, nil, false) - status, err := dm.GetAPIPodStatus(pod) + status, err := dm.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { t.Fatalf("Unexpected error %v", err) } - restartCount := status.ContainerStatuses[0].RestartCount + cs := status.FindContainerStatusByName(containerName) + if cs == nil { + t.Fatal("Can't find status for container %q", containerName) + } + restartCount := cs.RestartCount if restartCount != expectedCount { t.Errorf("expected %d restart count, got %d", expectedCount, restartCount) } - return *status } killOneContainer := func(pod *api.Pod) { - status, err := dm.GetAPIPodStatus(pod) + status, err := dm.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { t.Fatalf("Unexpected error %v", err) } - containerID := kubecontainer.ParseContainerID(status.ContainerStatuses[0].ContainerID) - dm.KillContainerInPod(containerID, &pod.Spec.Containers[0], pod, "test container restart count.") + cs := status.FindContainerStatusByName(containerName) + if cs == nil { + t.Fatal("Can't find status for container %q", containerName) + } + dm.KillContainerInPod(cs.ID, &pod.Spec.Containers[0], pod, "test container restart count.") } // Container "bar" starts the first time. // TODO: container lists are expected to be sorted reversely by time. // We should fix FakeDockerClient to sort the list before returning. // (randome-liu) Just partially sorted now. - pod.Status = verifyRestartCount(&pod, 0) + verifyRestartCount(&pod, 0) killOneContainer(&pod) // Poor container "bar" has been killed, and should be restarted with restart count 1 - pod.Status = verifyRestartCount(&pod, 1) + verifyRestartCount(&pod, 1) killOneContainer(&pod) // Poor container "bar" has been killed again, and should be restarted with restart count 2 - pod.Status = verifyRestartCount(&pod, 2) + verifyRestartCount(&pod, 2) killOneContainer(&pod) // Poor container "bar" has been killed again ang again, and should be restarted with restart count 3 - pod.Status = verifyRestartCount(&pod, 3) + verifyRestartCount(&pod, 3) // The oldest container has been garbage collected exitedContainers := fakeDocker.ExitedContainerList fakeDocker.ExitedContainerList = exitedContainers[:len(exitedContainers)-1] - pod.Status = verifyRestartCount(&pod, 3) + verifyRestartCount(&pod, 3) // The last two oldest containers have been garbage collected fakeDocker.ExitedContainerList = exitedContainers[:len(exitedContainers)-2] - pod.Status = verifyRestartCount(&pod, 3) + verifyRestartCount(&pod, 3) - // All exited containers have been garbage collected + // All exited containers have been garbage collected, restart count should be got from old api pod status fakeDocker.ExitedContainerList = []docker.APIContainers{} - pod.Status = verifyRestartCount(&pod, 3) + verifyRestartCount(&pod, 3) killOneContainer(&pod) // Poor container "bar" has been killed again ang again and again, and should be restarted with restart count 4 - pod.Status = verifyRestartCount(&pod, 4) + verifyRestartCount(&pod, 4) } func TestGetTerminationMessagePath(t *testing.T) { @@ -1681,57 +1469,6 @@ func TestSyncPodWithHostNetwork(t *testing.T) { } } -func TestGetAPIPodStatusSortedContainers(t *testing.T) { - dm, fakeDocker := newTestDockerManager() - specContainerList := []api.Container{} - expectedOrder := []string{} - - numContainers := 10 - podName := "foo" - podNs := "test" - podUID := "uid1" - fakeConfig := &docker.Config{ - Image: "some:latest", - } - - dockerContainers := []*docker.Container{} - for i := 0; i < numContainers; i++ { - id := fmt.Sprintf("%v", i) - containerName := fmt.Sprintf("%vcontainer", id) - expectedOrder = append(expectedOrder, containerName) - dockerContainers = append(dockerContainers, &docker.Container{ - ID: id, - Name: fmt.Sprintf("/k8s_%v_%v_%v_%v_42", containerName, podName, podNs, podUID), - Config: fakeConfig, - Image: fmt.Sprintf("%vimageid", id), - }) - specContainerList = append(specContainerList, api.Container{Name: containerName}) - } - fakeDocker.SetFakeRunningContainers(dockerContainers) - fakeDocker.ClearCalls() - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - UID: types.UID(podUID), - Name: podName, - Namespace: podNs, - }, - Spec: api.PodSpec{ - Containers: specContainerList, - }, - } - for i := 0; i < 5; i++ { - status, err := dm.GetAPIPodStatus(pod) - if err != nil { - t.Fatalf("unexpected error %v", err) - } - for i, c := range status.ContainerStatuses { - if expectedOrder[i] != c.Name { - t.Fatalf("Container status not sorted, expected %v at index %d, but found %v", expectedOrder[i], i, c.Name) - } - } - } -} - func TestVerifyNonRoot(t *testing.T) { dm, fakeDocker := newTestDockerManager() @@ -1893,3 +1630,5 @@ func TestGetIPCMode(t *testing.T) { t.Errorf("expected host ipc mode for pod but got %v", ipcMode) } } + +// TODO(random-liu): Add unit test for returned PodSyncResult (issue #20478) diff --git a/pkg/kubelet/image_manager.go b/pkg/kubelet/image_manager.go index 73eeb09efb3..96c15fac95b 100644 --- a/pkg/kubelet/image_manager.go +++ b/pkg/kubelet/image_manager.go @@ -28,8 +28,8 @@ import ( "k8s.io/kubernetes/pkg/kubelet/cadvisor" "k8s.io/kubernetes/pkg/kubelet/container" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" ) const ( @@ -130,7 +130,7 @@ func newImageManager(runtime container.Runtime, cadvisorInterface cadvisor.Inter } func (im *realImageManager) Start() error { - go util.Until(func() { + go wait.Until(func() { // Initial detection make detected time "unknown" in the past. var ts time.Time if im.initialized { @@ -142,7 +142,7 @@ func (im *realImageManager) Start() error { } else { im.initialized = true } - }, 5*time.Minute, util.NeverStop) + }, 5*time.Minute, wait.NeverStop) return nil } diff --git a/pkg/kubelet/image_manager_test.go b/pkg/kubelet/image_manager_test.go index 538277b55e3..b023475607e 100644 --- a/pkg/kubelet/image_manager_test.go +++ b/pkg/kubelet/image_manager_test.go @@ -431,8 +431,8 @@ func TestGarbageCollectImageNotOldEnough(t *testing.T) { }, } - fakeClock := util.FakeClock{Time: time.Now()} - fmt.Println(fakeClock.Now()) + fakeClock := util.NewFakeClock(time.Now()) + t.Log(fakeClock.Now()) require.NoError(t, manager.detectImages(fakeClock.Now())) require.Equal(t, manager.imageRecordsLen(), 2) // no space freed since one image is in used, and another one is not old enough diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index f7ca16a3b7c..b88ff60e70c 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -34,13 +34,14 @@ import ( "github.com/golang/glog" cadvisorapi "github.com/google/cadvisor/info/v1" + cadvisorapiv2 "github.com/google/cadvisor/info/v2" "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" @@ -59,6 +60,7 @@ import ( proberesults "k8s.io/kubernetes/pkg/kubelet/prober/results" "k8s.io/kubernetes/pkg/kubelet/rkt" "k8s.io/kubernetes/pkg/kubelet/server" + "k8s.io/kubernetes/pkg/kubelet/server/stats" "k8s.io/kubernetes/pkg/kubelet/status" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util/format" @@ -80,6 +82,7 @@ import ( "k8s.io/kubernetes/pkg/util/selinux" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/validation/field" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/watch" @@ -148,8 +151,7 @@ func NewMainKubelet( hostname string, nodeName string, dockerClient dockertools.DockerInterface, - kubeClient client.Interface, - clientset clientset.Interface, + kubeClient clientset.Interface, rootDirectory string, podInfraContainerImage string, resyncInterval time.Duration, @@ -202,6 +204,10 @@ func NewMainKubelet( flannelExperimentalOverlay bool, nodeIP net.IP, reservation kubetypes.Reservation, + enableCustomMetrics bool, + volumeStatsAggPeriod time.Duration, + containerRuntimeOptions []kubecontainer.Option, + hairpinMode bool, ) (*Kubelet, error) { if rootDirectory == "" { return nil, fmt.Errorf("invalid root directory %q", rootDirectory) @@ -220,10 +226,10 @@ func NewMainKubelet( // than an interface. There is no way to construct a list+watcher using resource name. listWatch := &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return kubeClient.Services(api.NamespaceAll).List(options) + return kubeClient.Core().Services(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return kubeClient.Services(api.NamespaceAll).Watch(options) + return kubeClient.Core().Services(api.NamespaceAll).Watch(options) }, } cache.NewReflector(listWatch, &api.Service{}, serviceStore, 0).Run() @@ -238,11 +244,11 @@ func NewMainKubelet( listWatch := &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = fieldSelector - return kubeClient.Nodes().List(options) + return kubeClient.Core().Nodes().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = fieldSelector - return kubeClient.Nodes().Watch(options) + return kubeClient.Core().Nodes().Watch(options) }, } cache.NewReflector(listWatch, &api.Node{}, nodeStore, 0).Run() @@ -270,12 +276,18 @@ func NewMainKubelet( oomWatcher := NewOOMWatcher(cadvisorInterface, recorder) + // TODO: remove when internal cbr0 implementation gets removed in favor + // of the kubenet network plugin + if networkPluginName == "kubenet" { + configureCBR0 = false + flannelExperimentalOverlay = false + } + klet := &Kubelet{ hostname: hostname, nodeName: nodeName, dockerClient: dockerClient, kubeClient: kubeClient, - clientset: clientset, rootDirectory: rootDirectory, resyncInterval: resyncInterval, containerRefManager: containerRefManager, @@ -320,7 +332,11 @@ func NewMainKubelet( clock: util.RealClock{}, outOfDiskTransitionFrequency: outOfDiskTransitionFrequency, reservation: reservation, + enableCustomMetrics: enableCustomMetrics, } + // TODO: Factor out "StatsProvider" from Kubelet so we don't have a cyclic dependency + klet.resourceAnalyzer = stats.NewResourceAnalyzer(klet, volumeStatsAggPeriod) + if klet.flannelExperimentalOverlay { glog.Infof("Flannel is in charge of podCIDR and overlay networking.") } @@ -351,6 +367,7 @@ func NewMainKubelet( // Initialize the runtime. switch containerRuntime { case "docker": + glog.Infof("Hairpin mode set to %v", hairpinMode) // Only supported one for now, continue. klet.containerRuntime = dockertools.NewDockerManager( dockerClient, @@ -372,8 +389,12 @@ func NewMainKubelet( klet.cpuCFSQuota, imageBackOff, serializeImagePulls, + enableCustomMetrics, + hairpinMode, + containerRuntimeOptions..., ) case "rkt": + // TODO: Include hairpin mode settings in rkt? conf := &rkt.Config{ Path: rktPath, Stage1Image: rktStage1Image, @@ -400,7 +421,8 @@ func NewMainKubelet( } klet.pleg = pleg.NewGenericPLEG(klet.containerRuntime, plegChannelCapacity, plegRelistPeriod, klet.podCache) - klet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, configureCBR0, podCIDR, klet.isContainerRuntimeVersionCompatible) + klet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, configureCBR0, klet.isContainerRuntimeVersionCompatible) + klet.updatePodCIDR(podCIDR) // setup containerGC containerGC, err := kubecontainer.NewContainerGC(klet.containerRuntime, containerGCPolicy) @@ -450,7 +472,7 @@ func NewMainKubelet( klet.podWorkers = newPodWorkers(klet.syncPod, recorder, klet.workQueue, klet.resyncInterval, backOffPeriod, klet.podCache) klet.backOff = util.NewBackOff(backOffPeriod, MaxContainerBackOff) - klet.podKillingCh = make(chan *kubecontainer.Pod, podKillingChannelCapacity) + klet.podKillingCh = make(chan *kubecontainer.PodPair, podKillingChannelCapacity) klet.sourcesSeen = sets.NewString() return klet, nil } @@ -469,8 +491,7 @@ type Kubelet struct { nodeName string dockerClient dockertools.DockerInterface runtimeCache kubecontainer.RuntimeCache - kubeClient client.Interface - clientset clientset.Interface + kubeClient clientset.Interface rootDirectory string podWorkers PodWorkers @@ -601,6 +622,9 @@ type Kubelet struct { // Watcher of out of memory events. oomWatcher OOMWatcher + // Monitor resource usage + resourceAnalyzer stats.ResourceAnalyzer + // If non-empty, pass this to the container runtime as the root cgroup. cgroupRoot string @@ -632,7 +656,7 @@ type Kubelet struct { backOff *util.Backoff // Channel for sending pods to kill. - podKillingCh chan *kubecontainer.Pod + podKillingCh chan *kubecontainer.PodPair // The configuration file used as the base to generate the container's // DNS resolver configuration file. This can be used in conjunction with @@ -640,6 +664,7 @@ type Kubelet struct { resolverConfig string // Optionally shape the bandwidth of a pod + // TODO: remove when kubenet plugin is ready shaper bandwidth.BandwidthShaper // True if container cpu limits should be enforced via cgroup CFS quota @@ -677,6 +702,9 @@ type Kubelet struct { // reservation specifies resources which are reserved for non-pod usage, including kubernetes and // non-kubernetes system processes. reservation kubetypes.Reservation + + // support gathering custom metrics. + enableCustomMetrics bool } // Validate given node IP belongs to the current host @@ -869,38 +897,23 @@ func (kl *Kubelet) GetNode() (*api.Node, error) { // Starts garbage collection threads. func (kl *Kubelet) StartGarbageCollection() { - go util.Until(func() { + go wait.Until(func() { if err := kl.containerGC.GarbageCollect(); err != nil { glog.Errorf("Container garbage collection failed: %v", err) } - }, time.Minute, util.NeverStop) + }, time.Minute, wait.NeverStop) - go util.Until(func() { + go wait.Until(func() { if err := kl.imageManager.GarbageCollect(); err != nil { glog.Errorf("Image garbage collection failed: %v", err) } - }, 5*time.Minute, util.NeverStop) + }, 5*time.Minute, wait.NeverStop) } // initializeModules will initialize internal modules that do not require the container runtime to be up. // Note that the modules here must not depend on modules that are not initialized here. func (kl *Kubelet) initializeModules() error { - // Promethues metrics. - metrics.Register(kl.runtimeCache) - - // Step 1: Setup filesystem directories. - if err := kl.setupDataDirs(); err != nil { - return err - } - - // Step 2: If the container logs directory does not exist, create it. - if _, err := os.Stat(containerLogsDir); err != nil { - if err := kl.os.Mkdir(containerLogsDir, 0755); err != nil { - glog.Errorf("Failed to create directory %q: %v", containerLogsDir, err) - } - } - - // Step 3: Move Kubelet to a container, if required. + // Step 1: Move Kubelet to a container, if required. if kl.resourceContainer != "" { // Fixme: I need to reside inside ContainerManager interface. err := util.RunInResourceContainer(kl.resourceContainer) @@ -910,20 +923,38 @@ func (kl *Kubelet) initializeModules() error { glog.Infof("Running in container %q", kl.resourceContainer) } - // Step 4: Start the image manager. + // Step 2: Promethues metrics. + metrics.Register(kl.runtimeCache) + + // Step 3: Setup filesystem directories. + if err := kl.setupDataDirs(); err != nil { + return err + } + + // Step 4: If the container logs directory does not exist, create it. + if _, err := os.Stat(containerLogsDir); err != nil { + if err := kl.os.Mkdir(containerLogsDir, 0755); err != nil { + glog.Errorf("Failed to create directory %q: %v", containerLogsDir, err) + } + } + + // Step 5: Start the image manager. if err := kl.imageManager.Start(); err != nil { return fmt.Errorf("Failed to start ImageManager, images may not be garbage collected: %v", err) } - // Step 5: Start container manager. + // Step 6: Start container manager. if err := kl.containerManager.Start(kl.nodeConfig); err != nil { return fmt.Errorf("Failed to start ContainerManager %v", err) } - // Step 6: Start out of memory watcher. + // Step 7: Start out of memory watcher. if err := kl.oomWatcher.Start(kl.nodeRef); err != nil { return fmt.Errorf("Failed to start OOM watcher %v", err) } + + // Step 7: Start resource analyzer + kl.resourceAnalyzer.Start() return nil } @@ -950,14 +981,14 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) { if kl.kubeClient != nil { // Start syncing node status immediately, this may set up things the runtime needs to run. - go util.Until(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, util.NeverStop) + go wait.Until(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, wait.NeverStop) } - go util.Until(kl.syncNetworkStatus, 30*time.Second, util.NeverStop) - go util.Until(kl.updateRuntimeUp, 5*time.Second, util.NeverStop) + go wait.Until(kl.syncNetworkStatus, 30*time.Second, wait.NeverStop) + go wait.Until(kl.updateRuntimeUp, 5*time.Second, wait.NeverStop) // Start a goroutine responsible for killing pods (that are not properly // handled by pod workers). - go util.Until(kl.podKiller, 1*time.Second, util.NeverStop) + go wait.Until(kl.podKiller, 1*time.Second, wait.NeverStop) // Start component sync loops. kl.statusManager.Start() @@ -1055,12 +1086,12 @@ func (kl *Kubelet) registerWithApiserver() { continue } glog.V(2).Infof("Attempting to register node %s", node.Name) - if _, err := kl.kubeClient.Nodes().Create(node); err != nil { + if _, err := kl.kubeClient.Core().Nodes().Create(node); err != nil { if !apierrors.IsAlreadyExists(err) { glog.V(2).Infof("Unable to register %s with the apiserver: %v", node.Name, err) continue } - currentNode, err := kl.kubeClient.Nodes().Get(kl.nodeName) + currentNode, err := kl.kubeClient.Core().Nodes().Get(kl.nodeName) if err != nil { glog.Errorf("error getting node %q: %v", kl.nodeName, err) continue @@ -1078,7 +1109,7 @@ func (kl *Kubelet) registerWithApiserver() { "Previously %q had externalID %q; now it is %q; will delete and recreate.", kl.nodeName, node.Spec.ExternalID, currentNode.Spec.ExternalID, ) - if err := kl.kubeClient.Nodes().Delete(node.Name); err != nil { + if err := kl.kubeClient.Core().Nodes().Delete(node.Name, nil); err != nil { glog.Errorf("Unable to delete old node: %v", err) } else { glog.Errorf("Deleted old node object %q", kl.nodeName) @@ -1155,7 +1186,7 @@ func makeMounts(pod *api.Pod, podDir string, container *api.Container, podVolume // - container is not already mounting on /etc/hosts // When the pause container is being created, its IP is still unknown. Hence, PodIP will not have been set. mountEtcHostsFile := (pod.Spec.SecurityContext == nil || !pod.Spec.SecurityContext.HostNetwork) && len(pod.Status.PodIP) > 0 - glog.V(4).Infof("Will create hosts mount for container:%q, podIP:%s: %v", container.Name, pod.Status.PodIP, mountEtcHostsFile) + glog.V(3).Infof("container: %v/%v/%v podIP: %q creating hosts mount: %v", pod.Namespace, pod.Name, container.Name, pod.Status.PodIP, mountEtcHostsFile) mounts := []kubecontainer.Mount{} for _, mount := range container.VolumeMounts { mountEtcHostsFile = mountEtcHostsFile && (mount.MountPath != etcHostsPath) @@ -1291,7 +1322,7 @@ func (kl *Kubelet) GenerateRunContainerOptions(pod *api.Pod, container *api.Cont } } - opts.DNS, opts.DNSSearch, err = kl.getClusterDNS(pod) + opts.DNS, opts.DNSSearch, err = kl.GetClusterDNS(pod) if err != nil { return nil, err } @@ -1410,7 +1441,7 @@ func (kl *Kubelet) makeEnvironmentVariables(pod *api.Pod, container *api.Contain key := envVar.ValueFrom.ConfigMapKeyRef.Key configMap, ok := configMaps[name] if !ok { - configMap, err = kl.kubeClient.ConfigMaps(pod.Namespace).Get(name) + configMap, err = kl.kubeClient.Core().ConfigMaps(pod.Namespace).Get(name) if err != nil { return result, err } @@ -1424,7 +1455,7 @@ func (kl *Kubelet) makeEnvironmentVariables(pod *api.Pod, container *api.Contain key := envVar.ValueFrom.SecretKeyRef.Key secret, ok := secrets[name] if !ok { - secret, err = kl.kubeClient.Secrets(pod.Namespace).Get(name) + secret, err = kl.kubeClient.Core().Secrets(pod.Namespace).Get(name) if err != nil { return result, err } @@ -1460,9 +1491,9 @@ func (kl *Kubelet) podFieldSelectorRuntimeValue(fs *api.ObjectFieldSelector, pod return fieldpath.ExtractFieldPathAsString(pod, internalFieldPath) } -// getClusterDNS returns a list of the DNS servers and a list of the DNS search +// GetClusterDNS returns a list of the DNS servers and a list of the DNS search // domains of the cluster. -func (kl *Kubelet) getClusterDNS(pod *api.Pod) ([]string, []string, error) { +func (kl *Kubelet) GetClusterDNS(pod *api.Pod) ([]string, []string, error) { var hostDNS, hostSearch []string // Get host DNS settings if kl.resolverConfig != "" { @@ -1616,10 +1647,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, podStatus *kubecont } } - apiPodStatus, err := kl.generatePodStatus(pod, podStatus) - if err != nil { - return err - } + apiPodStatus := kl.generatePodStatus(pod, podStatus) // Record the time it takes for the pod to become running. existingStatus, ok := kl.statusManager.GetPodStatus(pod.UID) if !ok || existingStatus.Phase == api.PodPending && apiPodStatus.Phase == api.PodRunning && @@ -1716,7 +1744,7 @@ func (kl *Kubelet) getPullSecretsForPod(pod *api.Pod) ([]api.Secret, error) { pullSecrets := []api.Secret{} for _, secretRef := range pod.Spec.ImagePullSecrets { - secret, err := kl.kubeClient.Secrets(pod.Namespace).Get(secretRef.Name) + secret, err := kl.kubeClient.Core().Secrets(pod.Namespace).Get(secretRef.Name) if err != nil { glog.Warningf("Unable to retrieve pull secret %s/%s for %s/%s due to %v. The image pull may not succeed.", pod.Namespace, secretRef.Name, pod.Namespace, pod.Name, err) continue @@ -1728,13 +1756,41 @@ func (kl *Kubelet) getPullSecretsForPod(pod *api.Pod) ([]api.Secret, error) { return pullSecrets, nil } +// Return name of a volume. When the volume is a PersistentVolumeClaim, +// it returns name of the real PersistentVolume bound to the claim. +// It returns errror when the clam is not bound yet. +func (kl *Kubelet) resolveVolumeName(pod *api.Pod, volume *api.Volume) (string, error) { + claimSource := volume.VolumeSource.PersistentVolumeClaim + if claimSource != nil { + // resolve real volume behind the claim + claim, err := kl.kubeClient.Core().PersistentVolumeClaims(pod.Namespace).Get(claimSource.ClaimName) + if err != nil { + return "", fmt.Errorf("Cannot find claim %s/%s for volume %s", pod.Namespace, claimSource.ClaimName, volume.Name) + } + if claim.Status.Phase != api.ClaimBound { + return "", fmt.Errorf("Claim for volume %s/%s is not bound yet", pod.Namespace, claimSource.ClaimName) + } + // Use the real bound volume instead of PersistentVolume.Name + return claim.Spec.VolumeName, nil + } + return volume.Name, nil +} + // Stores all volumes defined by the set of pods into a map. +// It stores real volumes there, i.e. persistent volume claims are resolved +// to volumes that are bound to them. // Keys for each entry are in the format (POD_ID)/(VOLUME_NAME) -func getDesiredVolumes(pods []*api.Pod) map[string]api.Volume { +func (kl *Kubelet) getDesiredVolumes(pods []*api.Pod) map[string]api.Volume { desiredVolumes := make(map[string]api.Volume) for _, pod := range pods { for _, volume := range pod.Spec.Volumes { - identifier := path.Join(string(pod.UID), volume.Name) + volumeName, err := kl.resolveVolumeName(pod, &volume) + if err != nil { + glog.V(3).Infof("%v", err) + // Ignore the error and hope it's resolved next time + continue + } + identifier := path.Join(string(pod.UID), volumeName) desiredVolumes[identifier] = volume } } @@ -1795,11 +1851,12 @@ func (kl *Kubelet) cleanupBandwidthLimits(allPods []*api.Pod) error { } status, found := kl.statusManager.GetPodStatus(pod.UID) if !found { - statusPtr, err := kl.containerRuntime.GetAPIPodStatus(pod) + // TODO(random-liu): Cleanup status get functions. (issue #20477) + s, err := kl.containerRuntime.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { return err } - status = *statusPtr + status = kl.generatePodStatus(pod, s) } if status.Phase == api.PodRunning { possibleCIDRs.Insert(fmt.Sprintf("%s/32", status.PodIP)) @@ -1818,8 +1875,11 @@ func (kl *Kubelet) cleanupBandwidthLimits(allPods []*api.Pod) error { // Compares the map of current volumes to the map of desired volumes. // If an active volume does not have a respective desired volume, clean it up. +// This method is blocking: +// 1) it talks to API server to find volumes bound to persistent volume claims +// 2) it talks to cloud to detach volumes func (kl *Kubelet) cleanupOrphanedVolumes(pods []*api.Pod, runningPods []*kubecontainer.Pod) error { - desiredVolumes := getDesiredVolumes(pods) + desiredVolumes := kl.getDesiredVolumes(pods) currentVolumes := kl.getPodVolumesFromDisk() runningSet := sets.String{} @@ -1827,7 +1887,7 @@ func (kl *Kubelet) cleanupOrphanedVolumes(pods []*api.Pod, runningPods []*kubeco runningSet.Insert(string(pod.ID)) } - for name, vol := range currentVolumes { + for name, cleanerTuple := range currentVolumes { if _, ok := desiredVolumes[name]; !ok { parts := strings.Split(name, "/") if runningSet.Has(parts[0]) { @@ -1840,10 +1900,19 @@ func (kl *Kubelet) cleanupOrphanedVolumes(pods []*api.Pod, runningPods []*kubeco // TODO(yifan): Refactor this hacky string manipulation. kl.volumeManager.DeleteVolumes(types.UID(parts[0])) //TODO (jonesdl) This should not block other kubelet synchronization procedures - err := vol.TearDown() + err := cleanerTuple.Cleaner.TearDown() if err != nil { glog.Errorf("Could not tear down volume %q: %v", name, err) } + + // volume is unmounted. some volumes also require detachment from the node. + if cleanerTuple.Detacher != nil { + detacher := *cleanerTuple.Detacher + err = detacher.Detach() + if err != nil { + glog.Errorf("Could not detach volume %q: %v", name, err) + } + } } } return nil @@ -1961,13 +2030,16 @@ func (kl *Kubelet) removeOrphanedPodStatuses(pods []*api.Pod, mirrorPods []*api. kl.statusManager.RemoveOrphanedStatuses(podUIDs) } -func (kl *Kubelet) deletePod(uid types.UID) error { +func (kl *Kubelet) deletePod(pod *api.Pod) error { + if pod == nil { + return fmt.Errorf("deletePod does not allow nil pod") + } if !kl.allSourcesReady() { // If the sources aren't ready, skip deletion, as we may accidentally delete pods // for sources that haven't reported yet. return fmt.Errorf("skipping delete because sources aren't ready yet") } - kl.podWorkers.ForgetWorker(uid) + kl.podWorkers.ForgetWorker(pod.UID) // Runtime cache may not have been updated to with the pod, but it's okay // because the periodic cleanup routine will attempt to delete again later. @@ -1975,12 +2047,13 @@ func (kl *Kubelet) deletePod(uid types.UID) error { if err != nil { return fmt.Errorf("error listing containers: %v", err) } - pod := kubecontainer.Pods(runningPods).FindPod("", uid) - if pod.IsEmpty() { + runningPod := kubecontainer.Pods(runningPods).FindPod("", pod.UID) + if runningPod.IsEmpty() { return fmt.Errorf("pod not found") } + podPair := kubecontainer.PodPair{pod, &runningPod} - kl.podKillingCh <- &pod + kl.podKillingCh <- &podPair // TODO: delete the mirror pod here? // We leave the volume/directory cleanup to the periodic cleanup routine. @@ -2023,7 +2096,7 @@ func (kl *Kubelet) HandlePodCleanups() error { } for _, pod := range runningPods { if _, found := desiredPods[pod.ID]; !found { - kl.podKillingCh <- pod + kl.podKillingCh <- &kubecontainer.PodPair{nil, pod} } } @@ -2082,25 +2155,27 @@ func (kl *Kubelet) podKiller() { defer close(resultCh) for { select { - case pod, ok := <-kl.podKillingCh: + case podPair, ok := <-kl.podKillingCh: + runningPod := podPair.RunningPod + apiPod := podPair.APIPod if !ok { return } - if killing.Has(string(pod.ID)) { + if killing.Has(string(runningPod.ID)) { // The pod is already being killed. break } - killing.Insert(string(pod.ID)) - go func(pod *kubecontainer.Pod, ch chan types.UID) { + killing.Insert(string(runningPod.ID)) + go func(apiPod *api.Pod, runningPod *kubecontainer.Pod, ch chan types.UID) { defer func() { - ch <- pod.ID + ch <- runningPod.ID }() - glog.V(2).Infof("Killing unwanted pod %q", pod.Name) - err := kl.killPod(nil, pod, nil) + glog.V(2).Infof("Killing unwanted pod %q", runningPod.Name) + err := kl.killPod(apiPod, runningPod, nil) if err != nil { - glog.Errorf("Failed killing the pod %q: %v", pod.Name, err) + glog.Errorf("Failed killing the pod %q: %v", runningPod.Name, err) } - }(pod, resultCh) + }(apiPod, runningPod, resultCh) case podID := <-resultCh: killing.Delete(string(podID)) @@ -2294,8 +2369,20 @@ func (kl *Kubelet) syncLoopIteration(updates <-chan kubetypes.PodUpdate, handler case update := <-kl.livenessManager.Updates(): // We only care about failures (signalling container death) here. if update.Result == proberesults.Failure { - glog.V(1).Infof("SyncLoop (container unhealthy): %q", format.Pod(update.Pod)) - handler.HandlePodSyncs([]*api.Pod{update.Pod}) + // We should not use the pod from livenessManager, because it is never updated after + // initialization. + // TODO(random-liu): This is just a quick fix. We should: + // * Just pass pod UID in probe updates to make this less confusing. + // * Maybe probe manager should rely on pod manager, or at least the pod in probe manager + // should be updated. + pod, ok := kl.podManager.GetPodByUID(update.Pod.UID) + if !ok { + // If the pod no longer exists, ignore the update. + glog.V(4).Infof("SyncLoop (container unhealthy): ignore irrelevant update: %#v", update) + break + } + glog.V(1).Infof("SyncLoop (container unhealthy): %q", format.Pod(pod)) + handler.HandlePodSyncs([]*api.Pod{pod}) } case <-housekeepingCh: if !kl.allSourcesReady() { @@ -2388,7 +2475,7 @@ func (kl *Kubelet) HandlePodDeletions(pods []*api.Pod) { } // Deletion is allowed to fail because the periodic cleanup routine // will trigger deletion again. - if err := kl.deletePod(pod.UID); err != nil { + if err := kl.deletePod(pod); err != nil { glog.V(2).Infof("Failed to delete pod %q, err: %v", format.Pod(pod), err) } kl.probeManager.RemovePod(pod) @@ -2560,6 +2647,8 @@ func (kl *Kubelet) updateRuntimeUp() { kl.runtimeState.setRuntimeSync(kl.clock.Now()) } +// TODO: remove when kubenet plugin is ready +// NOTE!!! if you make changes here, also make them to kubenet func (kl *Kubelet) reconcileCBR0(podCIDR string) error { if podCIDR == "" { glog.V(5).Info("PodCIDR not set. Will not configure cbr0.") @@ -2610,9 +2699,7 @@ func (kl *Kubelet) syncNetworkStatus() { glog.Infof("Flannel server handshake failed %v", err) return } - glog.Infof("Setting cidr: %v -> %v", - kl.runtimeState.podCIDR(), podCIDR) - kl.runtimeState.setPodCIDR(podCIDR) + kl.updatePodCIDR(podCIDR) } if err := ensureIPTablesMasqRule(kl.nonMasqueradeCIDR); err != nil { err = fmt.Errorf("Error on adding ip table rules: %v", err) @@ -2969,7 +3056,7 @@ func (kl *Kubelet) isContainerRuntimeVersionCompatible() error { // tryUpdateNodeStatus tries to update node status to master. If ReconcileCBR0 // is set, this function will also confirm that cbr0 is configured correctly. func (kl *Kubelet) tryUpdateNodeStatus() error { - node, err := kl.kubeClient.Nodes().Get(kl.nodeName) + node, err := kl.kubeClient.Core().Nodes().Get(kl.nodeName) if err != nil { return fmt.Errorf("error getting node %q: %v", kl.nodeName, err) } @@ -2984,7 +3071,7 @@ func (kl *Kubelet) tryUpdateNodeStatus() error { if node.Spec.PodCIDR != flannelPodCIDR { node.Spec.PodCIDR = flannelPodCIDR glog.Infof("Updating podcidr to %v", node.Spec.PodCIDR) - if updatedNode, err := kl.kubeClient.Nodes().Update(node); err != nil { + if updatedNode, err := kl.kubeClient.Core().Nodes().Update(node); err != nil { glog.Warningf("Failed to update podCIDR: %v", err) } else { // Update the node resourceVersion so the status update doesn't fail. @@ -2992,14 +3079,14 @@ func (kl *Kubelet) tryUpdateNodeStatus() error { } } } else if kl.reconcileCIDR { - kl.runtimeState.setPodCIDR(node.Spec.PodCIDR) + kl.updatePodCIDR(node.Spec.PodCIDR) } if err := kl.setNodeStatus(node); err != nil { return err } // Update the current status on the API server - _, err = kl.kubeClient.Nodes().UpdateStatus(node) + _, err = kl.kubeClient.Core().Nodes().UpdateStatus(node) return err } @@ -3075,20 +3162,7 @@ func GetPhase(spec *api.PodSpec, info []api.ContainerStatus) api.PodPhase { } } -// Get the internal PodStatus from the cache if the cache exists; -// otherwise, query the runtime directly. -func (kl *Kubelet) getRuntimePodStatus(pod *api.Pod) (*kubecontainer.PodStatus, error) { - start := kl.clock.Now() - defer func() { - metrics.PodStatusLatency.Observe(metrics.SinceInMicroseconds(start)) - }() - if kl.podCache != nil { - return kl.podCache.Get(pod.UID) - } - return kl.containerRuntime.GetPodStatus(pod.UID, pod.Name, pod.Namespace) -} - -func (kl *Kubelet) generatePodStatus(pod *api.Pod, podStatus *kubecontainer.PodStatus) (api.PodStatus, error) { +func (kl *Kubelet) generatePodStatus(pod *api.Pod, podStatus *kubecontainer.PodStatus) api.PodStatus { glog.V(3).Infof("Generating status for %q", format.Pod(pod)) // TODO: Consider include the container information. if kl.pastActiveDeadline(pod) { @@ -3097,7 +3171,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod, podStatus *kubecontainer.PodS return api.PodStatus{ Phase: api.PodFailed, Reason: reason, - Message: "Pod was active on the node longer than specified deadline"}, nil + Message: "Pod was active on the node longer than specified deadline"} } s := kl.convertStatusToAPIStatus(pod, podStatus) @@ -3120,7 +3194,7 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod, podStatus *kubecontainer.PodS } } - return *s, nil + return *s } // TODO(random-liu): Move this to some better place. @@ -3370,6 +3444,19 @@ func (kl *Kubelet) GetContainerInfo(podFullName string, podUID types.UID, contai return &ci, nil } +// GetContainerInfoV2 returns stats (from Cadvisor) for containers. +func (kl *Kubelet) GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + return kl.cadvisor.ContainerInfoV2(name, options) +} + +func (kl *Kubelet) DockerImagesFsInfo() (cadvisorapiv2.FsInfo, error) { + return kl.cadvisor.DockerImagesFsInfo() +} + +func (kl *Kubelet) RootFsInfo() (cadvisorapiv2.FsInfo, error) { + return kl.cadvisor.RootFsInfo() +} + // Returns stats (from Cadvisor) for a non-Kubernetes container. func (kl *Kubelet) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) { if subcontainers { @@ -3398,11 +3485,11 @@ func (kl *Kubelet) GetCachedMachineInfo() (*cadvisorapi.MachineInfo, error) { } func (kl *Kubelet) ListenAndServe(address net.IP, port uint, tlsOptions *server.TLSOptions, auth server.AuthInterface, enableDebuggingHandlers bool) { - server.ListenAndServeKubeletServer(kl, address, port, tlsOptions, auth, enableDebuggingHandlers) + server.ListenAndServeKubeletServer(kl, kl.resourceAnalyzer, address, port, tlsOptions, auth, enableDebuggingHandlers) } func (kl *Kubelet) ListenAndServeReadOnly(address net.IP, port uint) { - server.ListenAndServeKubeletReadOnlyServer(kl, address, port) + server.ListenAndServeKubeletReadOnlyServer(kl, kl.resourceAnalyzer, address, port) } // GetRuntime returns the current Runtime implementation in use by the kubelet. This func @@ -3411,6 +3498,24 @@ func (kl *Kubelet) GetRuntime() kubecontainer.Runtime { return kl.containerRuntime } +func (kl *Kubelet) updatePodCIDR(cidr string) { + if kl.runtimeState.podCIDR() == cidr { + return + } + + glog.Infof("Setting Pod CIDR: %v -> %v", kl.runtimeState.podCIDR(), cidr) + kl.runtimeState.setPodCIDR(cidr) + + if kl.networkPlugin != nil { + details := make(map[string]interface{}) + details[network.NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR] = cidr + kl.networkPlugin.Event(network.NET_PLUGIN_EVENT_POD_CIDR_CHANGE, details) + } +} +func (kl *Kubelet) GetNodeConfig() cm.NodeConfig { + return kl.nodeConfig +} + var minRsrc = resource.MustParse("1k") var maxRsrc = resource.MustParse("1P") diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index 6a753d03482..9ae5cf2fde0 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -40,6 +40,8 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/capabilities" "k8s.io/kubernetes/pkg/client/record" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/kubelet/cadvisor" "k8s.io/kubernetes/pkg/kubelet/cm" @@ -59,6 +61,7 @@ import ( "k8s.io/kubernetes/pkg/util/bandwidth" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/volume" _ "k8s.io/kubernetes/pkg/volume/host_path" @@ -87,7 +90,7 @@ type TestKubelet struct { kubelet *Kubelet fakeRuntime *kubecontainer.FakeRuntime fakeCadvisor *cadvisor.Mock - fakeKubeClient *testclient.Fake + fakeKubeClient *fake.Clientset fakeMirrorClient *kubepod.FakeMirrorClient fakeClock *util.FakeClock } @@ -108,14 +111,14 @@ func newTestKubelet(t *testing.T) *TestKubelet { }, } fakeRecorder := &record.FakeRecorder{} - fakeKubeClient := &testclient.Fake{} + fakeKubeClient := &fake.Clientset{} kubelet := &Kubelet{} kubelet.kubeClient = fakeKubeClient kubelet.os = kubecontainer.FakeOS{} kubelet.hostname = testKubeletHostname kubelet.nodeName = testKubeletHostname - kubelet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, false, "" /* Pod CIDR */, func() error { return nil }) + kubelet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, false, func() error { return nil }) kubelet.networkPlugin, _ = network.InitNetworkPlugin([]network.NetworkPlugin{}, "", network.NewFakeHost(nil)) if tempDir, err := ioutil.TempDir("/tmp", "kubelet_test."); err != nil { t.Fatalf("can't make a temp rootdir: %v", err) @@ -173,10 +176,10 @@ func newTestKubelet(t *testing.T) *TestKubelet { LowThresholdPercent: 80, } kubelet.imageManager, err = newImageManager(fakeRuntime, mockCadvisor, fakeRecorder, fakeNodeRef, fakeImageGCPolicy) - fakeClock := &util.FakeClock{Time: time.Now()} + fakeClock := util.NewFakeClock(time.Now()) kubelet.backOff = util.NewBackOff(time.Second, time.Minute) kubelet.backOff.Clock = fakeClock - kubelet.podKillingCh = make(chan *kubecontainer.Pod, 20) + kubelet.podKillingCh = make(chan *kubecontainer.PodPair, 20) kubelet.resyncInterval = 10 * time.Second kubelet.reservation = kubetypes.Reservation{ Kubernetes: api.ResourceList{ @@ -477,7 +480,8 @@ func TestSyncPodsDeletesWhenSourcesAreReady(t *testing.T) { func TestMountExternalVolumes(t *testing.T) { testKubelet := newTestKubelet(t) kubelet := testKubelet.kubelet - kubelet.volumePluginMgr.InitPlugins([]volume.VolumePlugin{&volume.FakeVolumePlugin{PluginName: "fake", Host: nil}}, &volumeHost{kubelet}) + plug := &volume.FakeVolumePlugin{PluginName: "fake", Host: nil} + kubelet.volumePluginMgr.InitPlugins([]volume.VolumePlugin{plug}, &volumeHost{kubelet}) pod := api.Pod{ ObjectMeta: api.ObjectMeta{ @@ -507,6 +511,9 @@ func TestMountExternalVolumes(t *testing.T) { t.Errorf("api.Pod volumes map is missing key: %s. %#v", name, podVolumes) } } + if plug.NewAttacherCallCount != 1 { + t.Errorf("Expected plugin NewAttacher to be called %d times but got %d", 1, plug.NewAttacherCallCount) + } } func TestGetPodVolumesFromDisk(t *testing.T) { @@ -538,7 +545,7 @@ func TestGetPodVolumesFromDisk(t *testing.T) { for _, ep := range expectedPaths { found := false for _, cl := range volumesFound { - if ep == cl.GetPath() { + if ep == cl.Cleaner.GetPath() { found = true break } @@ -547,6 +554,109 @@ func TestGetPodVolumesFromDisk(t *testing.T) { t.Errorf("Could not find a volume with path %s", ep) } } + if plug.NewDetacherCallCount != len(volsOnDisk) { + t.Errorf("Expected plugin NewDetacher to be called %d times but got %d", len(volsOnDisk), plug.NewDetacherCallCount) + } +} + +// Test for https://github.com/kubernetes/kubernetes/pull/19600 +func TestCleanupOrphanedVolumes(t *testing.T) { + testKubelet := newTestKubelet(t) + kubelet := testKubelet.kubelet + kubeClient := testKubelet.fakeKubeClient + plug := &volume.FakeVolumePlugin{PluginName: "fake", Host: nil} + kubelet.volumePluginMgr.InitPlugins([]volume.VolumePlugin{plug}, &volumeHost{kubelet}) + + // create a volume "on disk" + volsOnDisk := []struct { + podUID types.UID + volName string + }{ + {"podUID", "myrealvol"}, + } + + pathsOnDisk := []string{} + for i := range volsOnDisk { + fv := volume.FakeVolume{PodUID: volsOnDisk[i].podUID, VolName: volsOnDisk[i].volName, Plugin: plug} + fv.SetUp(nil) + pathsOnDisk = append(pathsOnDisk, fv.GetPath()) + } + + // store the claim in fake kubelet database + claim := api.PersistentVolumeClaim{ + ObjectMeta: api.ObjectMeta{ + Name: "myclaim", + Namespace: "test", + }, + Spec: api.PersistentVolumeClaimSpec{ + VolumeName: "myrealvol", + }, + Status: api.PersistentVolumeClaimStatus{ + Phase: api.ClaimBound, + }, + } + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.PersistentVolumeClaimList{Items: []api.PersistentVolumeClaim{ + claim, + }}).ReactionChain + + // Create a pod referencing the volume via a PersistentVolumeClaim + pod := api.Pod{ + ObjectMeta: api.ObjectMeta{ + UID: "podUID", + Name: "pod", + Namespace: "test", + }, + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + Name: "myvolumeclaim", + VolumeSource: api.VolumeSource{ + PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{ + ClaimName: "myclaim", + }, + }, + }, + }, + }, + } + + // The pod is pending and not running yet. Test that cleanupOrphanedVolumes + // won't remove the volume from disk if the volume is referenced only + // indirectly by a claim. + err := kubelet.cleanupOrphanedVolumes([]*api.Pod{&pod}, []*kubecontainer.Pod{}) + if err != nil { + t.Errorf("cleanupOrphanedVolumes failed: %v", err) + } + + volumesFound := kubelet.getPodVolumesFromDisk() + if len(volumesFound) != len(pathsOnDisk) { + t.Errorf("Expected to find %d cleaners, got %d", len(pathsOnDisk), len(volumesFound)) + } + for _, ep := range pathsOnDisk { + found := false + for _, cl := range volumesFound { + if ep == cl.Cleaner.GetPath() { + found = true + break + } + } + if !found { + t.Errorf("Could not find a volume with path %s", ep) + } + } + + // The pod is deleted -> kubelet should delete the volume + err = kubelet.cleanupOrphanedVolumes([]*api.Pod{}, []*kubecontainer.Pod{}) + if err != nil { + t.Errorf("cleanupOrphanedVolumes failed: %v", err) + } + volumesFound = kubelet.getPodVolumesFromDisk() + if len(volumesFound) != 0 { + t.Errorf("Expected to find 0 cleaners, got %d", len(volumesFound)) + } + for _, cl := range volumesFound { + t.Errorf("Found unexpected volume %s", cl.Cleaner.GetPath()) + } } type stubVolume struct { @@ -2541,7 +2651,7 @@ func TestUpdateNewNodeStatus(t *testing.T) { fakeRuntime.RuntimeType = "docker" fakeRuntime.VersionInfo = "1.5.0" kubeClient := testKubelet.fakeKubeClient - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ {ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}}, }}).ReactionChain machineInfo := &cadvisorapi.MachineInfo{ @@ -2664,7 +2774,7 @@ func TestUpdateNewNodeOutOfDiskStatusWithTransitionFrequency(t *testing.T) { testKubelet := newTestKubelet(t) kubelet := testKubelet.kubelet kubeClient := testKubelet.fakeKubeClient - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ {ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}}, }}).ReactionChain machineInfo := &cadvisorapi.MachineInfo{ @@ -2743,7 +2853,7 @@ func TestDockerRuntimeVersion(t *testing.T) { fakeRuntime.VersionInfo = "1.10.0-rc1-fc24" fakeRuntime.APIVersionInfo = "1.22" kubeClient := testKubelet.fakeKubeClient - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}, Spec: api.NodeSpec{}, @@ -2859,7 +2969,7 @@ func TestDockerRuntimeVersion(t *testing.T) { }, } - kubelet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, false, "", kubelet.isContainerRuntimeVersionCompatible) + kubelet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, false, kubelet.isContainerRuntimeVersionCompatible) kubelet.updateRuntimeUp() if err := kubelet.updateNodeStatus(); err != nil { t.Errorf("unexpected error: %v", err) @@ -2927,7 +3037,7 @@ func TestUpdateExistingNodeStatus(t *testing.T) { fakeRuntime.RuntimeType = "docker" fakeRuntime.VersionInfo = "1.5.0" kubeClient := testKubelet.fakeKubeClient - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}, Spec: api.NodeSpec{}, @@ -3086,7 +3196,7 @@ func TestUpdateExistingNodeOutOfDiskStatusWithTransitionFrequency(t *testing.T) kubelet := testKubelet.kubelet clock := testKubelet.fakeClock kubeClient := testKubelet.fakeKubeClient - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}, Spec: api.NodeSpec{}, @@ -3240,7 +3350,7 @@ func TestUpdateNodeStatusWithoutContainerRuntime(t *testing.T) { fakeRuntime := testKubelet.fakeRuntime fakeRuntime.RuntimeType = "docker" fakeRuntime.VersionInfo = "1.5.0" - kubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{ + kubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{ {ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}}, }}).ReactionChain mockCadvisor := testKubelet.fakeCadvisor @@ -3322,7 +3432,7 @@ func TestUpdateNodeStatusWithoutContainerRuntime(t *testing.T) { }, }, } - kubelet.runtimeState = newRuntimeState(time.Duration(0), false, "" /* Pod CIDR */, func() error { return nil }) + kubelet.runtimeState = newRuntimeState(time.Duration(0), false, func() error { return nil }) kubelet.updateRuntimeUp() if err := kubelet.updateNodeStatus(); err != nil { t.Errorf("unexpected error: %v", err) @@ -3364,7 +3474,7 @@ func TestUpdateNodeStatusError(t *testing.T) { testKubelet := newTestKubelet(t) kubelet := testKubelet.kubelet // No matching node for the kubelet - testKubelet.fakeKubeClient.ReactionChain = testclient.NewSimpleFake(&api.NodeList{Items: []api.Node{}}).ReactionChain + testKubelet.fakeKubeClient.ReactionChain = fake.NewSimpleClientset(&api.NodeList{Items: []api.Node{}}).ReactionChain if err := kubelet.updateNodeStatus(); err == nil { t.Errorf("unexpected non error: %v", err) @@ -3728,20 +3838,20 @@ func TestRegisterExistingNodeWithApiserver(t *testing.T) { testKubelet := newTestKubelet(t) kubelet := testKubelet.kubelet kubeClient := testKubelet.fakeKubeClient - kubeClient.AddReactor("create", "nodes", func(action testclient.Action) (bool, runtime.Object, error) { + kubeClient.AddReactor("create", "nodes", func(action core.Action) (bool, runtime.Object, error) { // Return an error on create. return true, &api.Node{}, &apierrors.StatusError{ ErrStatus: unversioned.Status{Reason: unversioned.StatusReasonAlreadyExists}, } }) - kubeClient.AddReactor("get", "nodes", func(action testclient.Action) (bool, runtime.Object, error) { + kubeClient.AddReactor("get", "nodes", func(action core.Action) (bool, runtime.Object, error) { // Return an existing (matching) node on get. return true, &api.Node{ ObjectMeta: api.ObjectMeta{Name: testKubeletHostname}, Spec: api.NodeSpec{ExternalID: testKubeletHostname}, }, nil }) - kubeClient.AddReactor("*", "*", func(action testclient.Action) (bool, runtime.Object, error) { + kubeClient.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { return true, nil, fmt.Errorf("no reaction implemented for %s", action) }) machineInfo := &cadvisorapi.MachineInfo{ @@ -3775,7 +3885,7 @@ func TestRegisterExistingNodeWithApiserver(t *testing.T) { done <- struct{}{} }() select { - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("timed out waiting for registration") case <-done: return @@ -4118,13 +4228,13 @@ func TestDoesNotDeletePodDirsIfContainerIsRunning(t *testing.T) { } func TestCleanupBandwidthLimits(t *testing.T) { + // TODO(random-liu): We removed the test case for pod status not cached here. We should add a higher + // layer status getter function and test that function instead. tests := []struct { status *api.PodStatus pods []*api.Pod inputCIDRs []string expectResetCIDRs []string - cacheStatus bool - expectedCalls []string name string }{ { @@ -4149,35 +4259,8 @@ func TestCleanupBandwidthLimits(t *testing.T) { }, inputCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, expectResetCIDRs: []string{"2.3.4.5/32", "5.6.7.8/32"}, - expectedCalls: []string{"GetAPIPodStatus"}, name: "pod running", }, - { - status: &api.PodStatus{ - PodIP: "1.2.3.4", - Phase: api.PodRunning, - }, - pods: []*api.Pod{ - { - ObjectMeta: api.ObjectMeta{ - Name: "foo", - Annotations: map[string]string{ - "kubernetes.io/ingress-bandwidth": "10M", - }, - }, - }, - { - ObjectMeta: api.ObjectMeta{ - Name: "bar", - }, - }, - }, - inputCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, - expectResetCIDRs: []string{"2.3.4.5/32", "5.6.7.8/32"}, - expectedCalls: []string{}, - cacheStatus: true, - name: "pod running with cache", - }, { status: &api.PodStatus{ PodIP: "1.2.3.4", @@ -4200,7 +4283,6 @@ func TestCleanupBandwidthLimits(t *testing.T) { }, inputCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, expectResetCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, - expectedCalls: []string{"GetAPIPodStatus"}, name: "pod not running", }, { @@ -4208,32 +4290,6 @@ func TestCleanupBandwidthLimits(t *testing.T) { PodIP: "1.2.3.4", Phase: api.PodFailed, }, - pods: []*api.Pod{ - { - ObjectMeta: api.ObjectMeta{ - Name: "foo", - Annotations: map[string]string{ - "kubernetes.io/ingress-bandwidth": "10M", - }, - }, - }, - { - ObjectMeta: api.ObjectMeta{ - Name: "bar", - }, - }, - }, - inputCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, - expectResetCIDRs: []string{"1.2.3.4/32", "2.3.4.5/32", "5.6.7.8/32"}, - expectedCalls: []string{}, - cacheStatus: true, - name: "pod not running with cache", - }, - { - status: &api.PodStatus{ - PodIP: "1.2.3.4", - Phase: api.PodRunning, - }, pods: []*api.Pod{ { ObjectMeta: api.ObjectMeta{ @@ -4258,12 +4314,9 @@ func TestCleanupBandwidthLimits(t *testing.T) { testKube := newTestKubelet(t) testKube.kubelet.shaper = shaper - testKube.fakeRuntime.APIPodStatus = *test.status - if test.cacheStatus { - for _, pod := range test.pods { - testKube.kubelet.statusManager.SetPodStatus(pod, *test.status) - } + for _, pod := range test.pods { + testKube.kubelet.statusManager.SetPodStatus(pod, *test.status) } err := testKube.kubelet.cleanupBandwidthLimits(test.pods) @@ -4273,14 +4326,6 @@ func TestCleanupBandwidthLimits(t *testing.T) { if !reflect.DeepEqual(shaper.ResetCIDRs, test.expectResetCIDRs) { t.Errorf("[%s]\nexpected: %v, saw: %v", test.name, test.expectResetCIDRs, shaper.ResetCIDRs) } - - if test.cacheStatus { - if len(testKube.fakeRuntime.CalledFunctions) != 0 { - t.Errorf("unexpected function calls: %v", testKube.fakeRuntime.CalledFunctions) - } - } else if !reflect.DeepEqual(testKube.fakeRuntime.CalledFunctions, test.expectedCalls) { - t.Errorf("[%s], expected %v, saw %v", test.name, test.expectedCalls, testKube.fakeRuntime.CalledFunctions) - } } } @@ -4413,3 +4458,5 @@ func TestGetPodsToSync(t *testing.T) { t.Errorf("expected %d pods to sync, got %d", 3, len(podsToSync)) } } + +// TODO(random-liu): Add unit test for convertStatusToAPIStatus (issue #20478) diff --git a/pkg/kubelet/lifecycle/handlers.go b/pkg/kubelet/lifecycle/handlers.go index a25b388f434..de7a765264a 100644 --- a/pkg/kubelet/lifecycle/handlers.go +++ b/pkg/kubelet/lifecycle/handlers.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" + "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/intstr" ) @@ -35,7 +36,7 @@ type HandlerRunner struct { } type podStatusProvider interface { - GetAPIPodStatus(pod *api.Pod) (*api.PodStatus, error) + GetPodStatus(uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error) } func NewHandlerRunner(httpGetter kubetypes.HttpGetter, commandRunner kubecontainer.ContainerCommandRunner, containerManager podStatusProvider) kubecontainer.HandlerRunner { @@ -86,15 +87,15 @@ func resolvePort(portReference intstr.IntOrString, container *api.Container) (in func (hr *HandlerRunner) runHTTPHandler(pod *api.Pod, container *api.Container, handler *api.Handler) error { host := handler.HTTPGet.Host if len(host) == 0 { - status, err := hr.containerManager.GetAPIPodStatus(pod) + status, err := hr.containerManager.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { glog.Errorf("Unable to get pod info, event handlers may be invalid.") return err } - if status.PodIP == "" { + if status.IP == "" { return fmt.Errorf("failed to find networking container: %v", status) } - host = status.PodIP + host = status.IP } var port int if handler.HTTPGet.Port.Type == intstr.String && len(handler.HTTPGet.Port.StrVal) == 0 { diff --git a/pkg/kubelet/metrics/metrics.go b/pkg/kubelet/metrics/metrics.go index 4c8a5215948..1463826aa9e 100644 --- a/pkg/kubelet/metrics/metrics.go +++ b/pkg/kubelet/metrics/metrics.go @@ -37,6 +37,7 @@ const ( PodWorkerStartLatencyKey = "pod_worker_start_latency_microseconds" PLEGRelistLatencyKey = "pleg_relist_latency_microseconds" PLEGRelistIntervalKey = "pleg_relist_interval_microseconds" + MetricsVolumeCalcLatencyKey = "metrics_volume_calc_microseconds" ) var ( @@ -121,6 +122,13 @@ var ( Help: "Interval in microseconds between relisting in PLEG.", }, ) + MetricsVolumeCalcLatency = prometheus.NewSummary( + prometheus.SummaryOpts{ + Subsystem: KubeletSubsystem, + Name: MetricsVolumeCalcLatencyKey, + Help: "Latency in microseconds for calculating volume metrics.", + }, + ) ) var registerMetrics sync.Once @@ -141,6 +149,7 @@ func Register(containerCache kubecontainer.RuntimeCache) { prometheus.MustRegister(newPodAndContainerCollector(containerCache)) prometheus.MustRegister(PLEGRelistLatency) prometheus.MustRegister(PLEGRelistInterval) + prometheus.MustRegister(MetricsVolumeCalcLatency) }) } diff --git a/pkg/kubelet/network/cni/cni.go b/pkg/kubelet/network/cni/cni.go index 5a124e08bd3..6fa7615348f 100644 --- a/pkg/kubelet/network/cni/cni.go +++ b/pkg/kubelet/network/cni/cni.go @@ -97,6 +97,9 @@ func (plugin *cniNetworkPlugin) Init(host network.Host) error { return nil } +func (plugin *cniNetworkPlugin) Event(name string, details map[string]interface{}) { +} + func (plugin *cniNetworkPlugin) Name() string { return CNIPluginName } diff --git a/pkg/kubelet/network/cni/cni_test.go b/pkg/kubelet/network/cni/cni_test.go index 7287abdb669..0ef947bec67 100644 --- a/pkg/kubelet/network/cni/cni_test.go +++ b/pkg/kubelet/network/cni/cni_test.go @@ -28,12 +28,13 @@ import ( "testing" "text/template" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + docker "github.com/fsouza/go-dockerclient" cadvisorapi "github.com/google/cadvisor/info/v1" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/record" - client "k8s.io/kubernetes/pkg/client/unversioned" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/dockertools" "k8s.io/kubernetes/pkg/kubelet/network" @@ -111,10 +112,10 @@ func tearDownPlugin(tmpDir string) { } type fakeNetworkHost struct { - kubeClient client.Interface + kubeClient clientset.Interface } -func NewFakeHost(kubeClient client.Interface) *fakeNetworkHost { +func NewFakeHost(kubeClient clientset.Interface) *fakeNetworkHost { host := &fakeNetworkHost{kubeClient: kubeClient} return host } @@ -123,7 +124,7 @@ func (fnh *fakeNetworkHost) GetPodByName(name, namespace string) (*api.Pod, bool return nil, false } -func (fnh *fakeNetworkHost) GetKubeClient() client.Interface { +func (fnh *fakeNetworkHost) GetKubeClient() clientset.Interface { return nil } diff --git a/pkg/kubelet/network/exec/exec.go b/pkg/kubelet/network/exec/exec.go index 6f2144581b3..52d895d9962 100644 --- a/pkg/kubelet/network/exec/exec.go +++ b/pkg/kubelet/network/exec/exec.go @@ -120,6 +120,9 @@ func (plugin *execNetworkPlugin) getExecutable() string { return path.Join(plugin.execPath, execName) } +func (plugin *execNetworkPlugin) Event(name string, details map[string]interface{}) { +} + func (plugin *execNetworkPlugin) Name() string { return plugin.execName } diff --git a/pkg/kubelet/network/kubenet/kubenet_linux.go b/pkg/kubelet/network/kubenet/kubenet_linux.go new file mode 100644 index 00000000000..4eebe27e397 --- /dev/null +++ b/pkg/kubelet/network/kubenet/kubenet_linux.go @@ -0,0 +1,287 @@ +// +build linux + +/* +Copyright 2014 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. +*/ + +package kubenet + +import ( + "fmt" + "net" + "strings" + "syscall" + + "github.com/vishvananda/netlink" + + "github.com/appc/cni/libcni" + "github.com/golang/glog" + kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/dockertools" + "k8s.io/kubernetes/pkg/kubelet/network" + "k8s.io/kubernetes/pkg/util/bandwidth" +) + +const ( + KubenetPluginName = "kubenet" + BridgeName = "cbr0" + DefaultCNIDir = "/opt/cni/bin" + DefaultInterfaceName = "eth0" +) + +type kubenetNetworkPlugin struct { + host network.Host + netConfig *libcni.NetworkConfig + cniConfig *libcni.CNIConfig + shaper bandwidth.BandwidthShaper + + podCIDRs map[kubecontainer.DockerID]string + MTU int +} + +func NewPlugin() network.NetworkPlugin { + return &kubenetNetworkPlugin{ + podCIDRs: make(map[kubecontainer.DockerID]string), + MTU: 1460, + } +} + +func (plugin *kubenetNetworkPlugin) Init(host network.Host) error { + plugin.host = host + plugin.cniConfig = &libcni.CNIConfig{ + Path: []string{DefaultCNIDir}, + } + + if link, err := findMinMTU(); err == nil { + plugin.MTU = link.MTU + glog.V(5).Infof("Using interface %s MTU %d as bridge MTU", link.Name, link.MTU) + } else { + glog.Warningf("Failed to find default bridge MTU: %v", err) + } + + return nil +} + +func findMinMTU() (*net.Interface, error) { + intfs, err := net.Interfaces() + if err != nil { + return nil, err + } + + mtu := 999999 + defIntfIndex := -1 + for i, intf := range intfs { + if ((intf.Flags & net.FlagUp) != 0) && (intf.Flags&(net.FlagLoopback|net.FlagPointToPoint) == 0) { + if intf.MTU < mtu { + mtu = intf.MTU + defIntfIndex = i + } + } + } + + if mtu >= 999999 || mtu < 576 || defIntfIndex < 0 { + return nil, fmt.Errorf("no suitable interface", BridgeName) + } + + return &intfs[defIntfIndex], nil +} + +const NET_CONFIG_TEMPLATE = `{ + "cniVersion": "0.1.0", + "name": "kubenet", + "type": "bridge", + "bridge": "%s", + "mtu": %d, + "addIf": "%s", + "isGateway": true, + "ipMasq": true, + "ipam": { + "type": "host-local", + "subnet": "%s", + "gateway": "%s", + "routes": [ + { "dst": "0.0.0.0/0" } + ] + } +}` + +func (plugin *kubenetNetworkPlugin) Event(name string, details map[string]interface{}) { + if name != network.NET_PLUGIN_EVENT_POD_CIDR_CHANGE { + return + } + + podCIDR, ok := details[network.NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR].(string) + if !ok { + glog.Warningf("%s event didn't contain pod CIDR", network.NET_PLUGIN_EVENT_POD_CIDR_CHANGE) + return + } + + if plugin.netConfig != nil { + glog.V(5).Infof("Ignoring subsequent pod CIDR update to %s", podCIDR) + return + } + + glog.V(5).Infof("PodCIDR is set to %q", podCIDR) + _, cidr, err := net.ParseCIDR(podCIDR) + if err == nil { + // Set bridge address to first address in IPNet + cidr.IP.To4()[3] += 1 + + json := fmt.Sprintf(NET_CONFIG_TEMPLATE, BridgeName, plugin.MTU, DefaultInterfaceName, podCIDR, cidr.IP.String()) + plugin.netConfig, err = libcni.ConfFromBytes([]byte(json)) + if err == nil { + glog.V(5).Infof("CNI network config:\n%s", json) + + // Ensure cbr0 has no conflicting addresses; CNI's 'bridge' + // plugin will bail out if the bridge has an unexpected one + plugin.clearBridgeAddressesExcept(cidr.IP.String()) + } + } + + if err != nil { + glog.Warningf("Failed to generate CNI network config: %v", err) + } +} + +func (plugin *kubenetNetworkPlugin) clearBridgeAddressesExcept(keep string) { + bridge, err := netlink.LinkByName(BridgeName) + if err != nil { + return + } + + addrs, err := netlink.AddrList(bridge, syscall.AF_INET) + if err != nil { + return + } + + for _, addr := range addrs { + if addr.IPNet.String() != keep { + glog.V(5).Infof("Removing old address %s from %s", addr.IPNet.String(), BridgeName) + netlink.AddrDel(bridge, &addr) + } + } +} + +func (plugin *kubenetNetworkPlugin) Name() string { + return KubenetPluginName +} + +func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error { + // Can't set up pods if we don't have a PodCIDR yet + if plugin.netConfig == nil { + return fmt.Errorf("Kubenet needs a PodCIDR to set up pods") + } + + runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager) + if !ok { + return fmt.Errorf("Kubenet execution called on non-docker runtime") + } + netnsPath, err := runtime.GetNetNS(id.ContainerID()) + if err != nil { + return err + } + + rt := buildCNIRuntimeConf(name, namespace, id.ContainerID(), netnsPath) + if err != nil { + return fmt.Errorf("Error building CNI config: %v", err) + } + + res, err := plugin.cniConfig.AddNetwork(plugin.netConfig, rt) + if err != nil { + return fmt.Errorf("Error adding container to network: %v", err) + } + if res.IP4 == nil { + return fmt.Errorf("CNI plugin reported no IPv4 address for container %v.", id) + } + + plugin.podCIDRs[id] = res.IP4.IP.String() + + // The first SetUpPod call creates the bridge; ensure shaping is enabled + if plugin.shaper == nil { + plugin.shaper = bandwidth.NewTCShaper(BridgeName) + if plugin.shaper == nil { + return fmt.Errorf("Failed to create bandwidth shaper!") + } + plugin.shaper.ReconcileInterface() + } + + // TODO: get ingress/egress from Pod.Spec and add pod CIDR to shaper + + return nil +} + +func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error { + if plugin.netConfig == nil { + return fmt.Errorf("Kubenet needs a PodCIDR to tear down pods") + } + + runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager) + if !ok { + return fmt.Errorf("Kubenet execution called on non-docker runtime") + } + netnsPath, err := runtime.GetNetNS(id.ContainerID()) + if err != nil { + return err + } + + rt := buildCNIRuntimeConf(name, namespace, id.ContainerID(), netnsPath) + if err != nil { + return fmt.Errorf("Error building CNI config: %v", err) + } + + // no cached CIDR is Ok during teardown + if cidr, ok := plugin.podCIDRs[id]; ok { + glog.V(5).Infof("Removing pod CIDR %s from shaper", cidr) + // shaper wants /32 + if addr, _, err := net.ParseCIDR(cidr); err != nil { + if err = plugin.shaper.Reset(fmt.Sprintf("%s/32", addr.String())); err != nil { + glog.Warningf("Failed to remove pod CIDR %s from shaper: %v", cidr, err) + } + } + } + delete(plugin.podCIDRs, id) + + if err := plugin.cniConfig.DelNetwork(plugin.netConfig, rt); err != nil { + return fmt.Errorf("Error removing container from network: %v", err) + } + + return nil +} + +// TODO: Use the addToNetwork function to obtain the IP of the Pod. That will assume idempotent ADD call to the plugin. +// Also fix the runtime's call to Status function to be done only in the case that the IP is lost, no need to do periodic calls +func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) { + cidr, ok := plugin.podCIDRs[id] + if !ok { + return nil, fmt.Errorf("No IP address found for pod %v", id) + } + + ip, _, err := net.ParseCIDR(strings.Trim(cidr, "\n")) + if err != nil { + return nil, err + } + return &network.PodNetworkStatus{IP: ip}, nil +} + +func buildCNIRuntimeConf(podName string, podNs string, podInfraContainerID kubecontainer.ContainerID, podNetnsPath string) *libcni.RuntimeConf { + glog.V(4).Infof("Kubenet: using netns path %v", podNetnsPath) + glog.V(4).Infof("Kubenet: using podns path %v", podNs) + + return &libcni.RuntimeConf{ + ContainerID: podInfraContainerID.ID, + NetNS: podNetnsPath, + IfName: DefaultInterfaceName, + } +} diff --git a/pkg/kubelet/network/kubenet/kubenet_unsupported.go b/pkg/kubelet/network/kubenet/kubenet_unsupported.go new file mode 100644 index 00000000000..751db291370 --- /dev/null +++ b/pkg/kubelet/network/kubenet/kubenet_unsupported.go @@ -0,0 +1,55 @@ +// +build !linux + +/* +Copyright 2014 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. +*/ + +package kubenet + +import ( + "fmt" + + kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/network" +) + +type kubenetNetworkPlugin struct { +} + +func NewPlugin() network.NetworkPlugin { + return &kubenetNetworkPlugin{} +} + +func (plugin *kubenetNetworkPlugin) Init(host network.Host) error { + return fmt.Errorf("Kubenet is not supported in this build") +} +func (plugin *kubenetNetworkPlugin) Event(name string, details map[string]interface{}) { +} + +func (plugin *kubenetNetworkPlugin) Name() string { + return "kubenet" +} + +func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error { + return fmt.Errorf("Kubenet is not supported in this build") +} + +func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error { + return fmt.Errorf("Kubenet is not supported in this build") +} + +func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) { + return nil, fmt.Errorf("Kubenet is not supported in this build") +} diff --git a/pkg/kubelet/network/plugins.go b/pkg/kubelet/network/plugins.go index 162de06ceaa..25ab60447ce 100644 --- a/pkg/kubelet/network/plugins.go +++ b/pkg/kubelet/network/plugins.go @@ -21,10 +21,11 @@ import ( "net" "strings" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" - client "k8s.io/kubernetes/pkg/client/unversioned" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/validation" @@ -32,12 +33,21 @@ import ( const DefaultPluginName = "kubernetes.io/no-op" +// Called when the node's Pod CIDR is known when using the +// controller manager's --allocate-node-cidrs=true option +const NET_PLUGIN_EVENT_POD_CIDR_CHANGE = "pod-cidr-change" +const NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR = "pod-cidr" + // Plugin is an interface to network plugins for the kubelet type NetworkPlugin interface { // Init initializes the plugin. This will be called exactly once // before any other methods are called. Init(host Host) error + // Called on various events like: + // NET_PLUGIN_EVENT_POD_CIDR_CHANGE + Event(name string, details map[string]interface{}) + // Name returns the plugin's name. This will be used when searching // for a plugin by name, e.g. Name() string @@ -72,7 +82,7 @@ type Host interface { GetPodByName(namespace, name string) (*api.Pod, bool) // GetKubeClient returns a client interface - GetKubeClient() client.Interface + GetKubeClient() clientset.Interface // GetContainerRuntime returns the container runtime that implements the containers (e.g. docker/rkt) GetRuntime() kubecontainer.Runtime @@ -129,6 +139,9 @@ func (plugin *noopNetworkPlugin) Init(host Host) error { return nil } +func (plugin *noopNetworkPlugin) Event(name string, details map[string]interface{}) { +} + func (plugin *noopNetworkPlugin) Name() string { return DefaultPluginName } diff --git a/pkg/kubelet/network/testing.go b/pkg/kubelet/network/testing.go index 6b82534e38b..ba0eb1fae51 100644 --- a/pkg/kubelet/network/testing.go +++ b/pkg/kubelet/network/testing.go @@ -21,15 +21,15 @@ package network import ( "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) type fakeNetworkHost struct { - kubeClient client.Interface + kubeClient clientset.Interface } -func NewFakeHost(kubeClient client.Interface) *fakeNetworkHost { +func NewFakeHost(kubeClient clientset.Interface) *fakeNetworkHost { host := &fakeNetworkHost{kubeClient: kubeClient} return host } @@ -38,7 +38,7 @@ func (fnh *fakeNetworkHost) GetPodByName(name, namespace string) (*api.Pod, bool return nil, false } -func (fnh *fakeNetworkHost) GetKubeClient() client.Interface { +func (fnh *fakeNetworkHost) GetKubeClient() clientset.Interface { return nil } diff --git a/pkg/kubelet/networks.go b/pkg/kubelet/networks.go index 5ec7a00fe7d..43674f80410 100644 --- a/pkg/kubelet/networks.go +++ b/pkg/kubelet/networks.go @@ -18,7 +18,7 @@ package kubelet import ( "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) @@ -32,7 +32,7 @@ func (nh *networkHost) GetPodByName(name, namespace string) (*api.Pod, bool) { return nh.kubelet.GetPodByName(name, namespace) } -func (nh *networkHost) GetKubeClient() client.Interface { +func (nh *networkHost) GetKubeClient() clientset.Interface { return nh.kubelet.kubeClient } diff --git a/pkg/kubelet/pleg/generic.go b/pkg/kubelet/pleg/generic.go index 07ecf71ed1b..c603659ca33 100644 --- a/pkg/kubelet/pleg/generic.go +++ b/pkg/kubelet/pleg/generic.go @@ -24,8 +24,8 @@ import ( kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/metrics" "k8s.io/kubernetes/pkg/types" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" ) // GenericPLEG is an extremely simple generic PLEG that relies solely on @@ -110,7 +110,7 @@ func (g *GenericPLEG) Watch() chan *PodLifecycleEvent { // Start spawns a goroutine to relist periodically. func (g *GenericPLEG) Start() { - go util.Until(g.relist, g.relistPeriod, util.NeverStop) + go wait.Until(g.relist, g.relistPeriod, wait.NeverStop) } func generateEvent(podID types.UID, cid string, oldState, newState plegContainerState) *PodLifecycleEvent { diff --git a/pkg/kubelet/pod/mirror_client.go b/pkg/kubelet/pod/mirror_client.go index 3eeee0794f1..f2133d3c28f 100644 --- a/pkg/kubelet/pod/mirror_client.go +++ b/pkg/kubelet/pod/mirror_client.go @@ -20,7 +20,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) @@ -34,10 +34,10 @@ type MirrorClient interface { type basicMirrorClient struct { // mirror pods are stored in the kubelet directly because they need to be // in sync with the internal pods. - apiserverClient client.Interface + apiserverClient clientset.Interface } -func NewBasicMirrorClient(apiserverClient client.Interface) MirrorClient { +func NewBasicMirrorClient(apiserverClient clientset.Interface) MirrorClient { return &basicMirrorClient{apiserverClient: apiserverClient} } @@ -55,7 +55,7 @@ func (mc *basicMirrorClient) CreateMirrorPod(pod *api.Pod) error { } hash := getPodHash(pod) copyPod.Annotations[kubetypes.ConfigMirrorAnnotationKey] = hash - apiPod, err := mc.apiserverClient.Pods(copyPod.Namespace).Create(©Pod) + apiPod, err := mc.apiserverClient.Core().Pods(copyPod.Namespace).Create(©Pod) if err != nil && errors.IsAlreadyExists(err) { // Check if the existing pod is the same as the pod we want to create. if h, ok := apiPod.Annotations[kubetypes.ConfigMirrorAnnotationKey]; ok && h == hash { @@ -76,7 +76,7 @@ func (mc *basicMirrorClient) DeleteMirrorPod(podFullName string) error { return err } glog.V(4).Infof("Deleting a mirror pod %q", podFullName) - if err := mc.apiserverClient.Pods(namespace).Delete(name, api.NewDeleteOptions(0)); err != nil && !errors.IsNotFound(err) { + if err := mc.apiserverClient.Core().Pods(namespace).Delete(name, api.NewDeleteOptions(0)); err != nil && !errors.IsNotFound(err) { glog.Errorf("Failed deleting a mirror pod %q: %v", podFullName, err) } return nil diff --git a/pkg/kubelet/pod_workers.go b/pkg/kubelet/pod_workers.go index 9e1f9efa60c..15e7cf668b4 100644 --- a/pkg/kubelet/pod_workers.go +++ b/pkg/kubelet/pod_workers.go @@ -28,6 +28,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/util/queue" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" ) // PodWorkers is an abstract interface for testability. @@ -39,6 +40,14 @@ type PodWorkers interface { type syncPodFnType func(*api.Pod, *api.Pod, *kubecontainer.PodStatus, kubetypes.SyncPodType) error +const ( + // jitter factor for resyncInterval + workerResyncIntervalJitterFactor = 0.5 + + // jitter factor for backOffPeriod + workerBackOffPeriodJitterFactor = 0.5 +) + type podWorkers struct { // Protects all per worker fields. podLock sync.Mutex @@ -209,10 +218,10 @@ func (p *podWorkers) wrapUp(uid types.UID, syncErr error) { switch { case syncErr == nil: // No error; requeue at the regular resync interval. - p.workQueue.Enqueue(uid, p.resyncInterval) + p.workQueue.Enqueue(uid, wait.Jitter(p.resyncInterval, workerResyncIntervalJitterFactor)) default: // Error occurred during the sync; back off and then retry. - p.workQueue.Enqueue(uid, p.backOffPeriod) + p.workQueue.Enqueue(uid, wait.Jitter(p.backOffPeriod, workerBackOffPeriodJitterFactor)) } p.checkForUpdates(uid) } diff --git a/pkg/kubelet/prober/manager.go b/pkg/kubelet/prober/manager.go index 969a42c443b..2282d8e6285 100644 --- a/pkg/kubelet/prober/manager.go +++ b/pkg/kubelet/prober/manager.go @@ -27,8 +27,8 @@ import ( "k8s.io/kubernetes/pkg/kubelet/status" "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/types" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" ) // Manager manages pod probing. It creates a probe "worker" for every container that specifies a @@ -97,7 +97,7 @@ func NewManager( // Start syncing probe status. This should only be called once. func (m *manager) Start() { // Start syncing readiness. - go util.Forever(m.updateReadiness, 0) + go wait.Forever(m.updateReadiness, 0) } // Key uniquely identifying container probes @@ -171,7 +171,7 @@ func (m *manager) RemovePod(pod *api.Pod) { for _, probeType := range [...]probeType{readiness, liveness} { key.probeType = probeType if worker, ok := m.workers[key]; ok { - close(worker.stop) + worker.stop() } } } @@ -188,7 +188,7 @@ func (m *manager) CleanupPods(activePods []*api.Pod) { for key, worker := range m.workers { if _, ok := desiredPods[key.podUID]; !ok { - close(worker.stop) + worker.stop() } } } diff --git a/pkg/kubelet/prober/manager_test.go b/pkg/kubelet/prober/manager_test.go index b915aa424cb..ac64843f0ff 100644 --- a/pkg/kubelet/prober/manager_test.go +++ b/pkg/kubelet/prober/manager_test.go @@ -18,6 +18,7 @@ package prober import ( "fmt" + "strconv" "testing" "time" @@ -26,7 +27,7 @@ import ( kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/prober/results" "k8s.io/kubernetes/pkg/probe" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wait" ) @@ -174,6 +175,31 @@ func TestCleanupPods(t *testing.T) { } } +func TestCleanupRepeated(t *testing.T) { + m := newTestManager() + defer cleanup(t, m) + podTemplate := api.Pod{ + Spec: api.PodSpec{ + Containers: []api.Container{{ + Name: "prober1", + ReadinessProbe: defaultProbe, + LivenessProbe: defaultProbe, + }}, + }, + } + + const numTestPods = 100 + for i := 0; i < numTestPods; i++ { + pod := podTemplate + pod.UID = types.UID(strconv.Itoa(i)) + m.AddPod(&pod) + } + + for i := 0; i < 10; i++ { + m.CleanupPods([]*api.Pod{}) + } +} + func TestUpdatePodStatus(t *testing.T) { unprobed := api.ContainerStatus{ Name: "unprobed_container", @@ -260,7 +286,7 @@ func TestUpdateReadiness(t *testing.T) { // Start syncing readiness without leaking goroutine. stopCh := make(chan struct{}) - go util.Until(m.updateReadiness, 0, stopCh) + go wait.Until(m.updateReadiness, 0, stopCh) defer func() { close(stopCh) // Send an update to exit updateReadiness() @@ -332,7 +358,7 @@ func waitForWorkerExit(m *manager, workerPaths []probeKey) error { continue // Already exited, no need to poll. } glog.Infof("Polling %v", w) - if err := wait.Poll(interval, util.ForeverTestTimeout, condition); err != nil { + if err := wait.Poll(interval, wait.ForeverTestTimeout, condition); err != nil { return err } } @@ -357,7 +383,7 @@ func waitForReadyStatus(m *manager, ready bool) error { return status.ContainerStatuses[0].Ready == ready, nil } glog.Infof("Polling for ready state %v", ready) - if err := wait.Poll(interval, util.ForeverTestTimeout, condition); err != nil { + if err := wait.Poll(interval, wait.ForeverTestTimeout, condition); err != nil { return err } @@ -378,7 +404,7 @@ func cleanup(t *testing.T, m *manager) { if exited, _ := condition(); exited { return // Already exited, no need to poll. } - if err := wait.Poll(interval, util.ForeverTestTimeout, condition); err != nil { + if err := wait.Poll(interval, wait.ForeverTestTimeout, condition); err != nil { t.Fatalf("Error during cleanup: %v", err) } } diff --git a/pkg/kubelet/prober/prober.go b/pkg/kubelet/prober/prober.go index 12ba3e64729..11d225aaf82 100644 --- a/pkg/kubelet/prober/prober.go +++ b/pkg/kubelet/prober/prober.go @@ -19,6 +19,7 @@ package prober import ( "fmt" "net" + "net/http" "net/url" "strconv" "strings" @@ -126,6 +127,16 @@ func (pb *prober) runProbeWithRetries(p *api.Probe, pod *api.Pod, status api.Pod return result, output, err } +// buildHeaderMap takes a list of HTTPHeader string +// pairs and returns a a populated string->[]string http.Header map. +func buildHeader(headerList []api.HTTPHeader) http.Header { + headers := make(http.Header) + for _, header := range headerList { + headers[header.Name] = append(headers[header.Name], header.Value) + } + return headers +} + func (pb *prober) runProbe(p *api.Probe, pod *api.Pod, status api.PodStatus, container api.Container, containerID kubecontainer.ContainerID) (probe.Result, string, error) { timeout := time.Duration(p.TimeoutSeconds) * time.Second if p.Exec != nil { @@ -145,7 +156,9 @@ func (pb *prober) runProbe(p *api.Probe, pod *api.Pod, status api.PodStatus, con path := p.HTTPGet.Path glog.V(4).Infof("HTTP-Probe Host: %v://%v, Port: %v, Path: %v", scheme, host, port, path) url := formatURL(scheme, host, port, path) - return pb.http.Probe(url, timeout) + headers := buildHeader(p.HTTPGet.HTTPHeaders) + glog.V(4).Infof("HTTP-Probe Headers: %v", headers) + return pb.http.Probe(url, headers, timeout) } if p.TCPSocket != nil { port, err := extractPort(p.TCPSocket.Port, container) diff --git a/pkg/kubelet/prober/prober_test.go b/pkg/kubelet/prober/prober_test.go index e2f2dd02ecc..b1c28172504 100644 --- a/pkg/kubelet/prober/prober_test.go +++ b/pkg/kubelet/prober/prober_test.go @@ -19,6 +19,8 @@ package prober import ( "errors" "fmt" + "net/http" + "reflect" "testing" "k8s.io/kubernetes/pkg/api" @@ -164,6 +166,33 @@ func TestGetTCPAddrParts(t *testing.T) { } } +func TestHTTPHeaders(t *testing.T) { + testCases := []struct { + input []api.HTTPHeader + output http.Header + }{ + {[]api.HTTPHeader{}, http.Header{}}, + {[]api.HTTPHeader{ + {"X-Muffins-Or-Cupcakes", "Muffins"}, + }, http.Header{"X-Muffins-Or-Cupcakes": {"Muffins"}}}, + {[]api.HTTPHeader{ + {"X-Muffins-Or-Cupcakes", "Muffins"}, + {"X-Muffins-Or-Plumcakes", "Muffins!"}, + }, http.Header{"X-Muffins-Or-Cupcakes": {"Muffins"}, + "X-Muffins-Or-Plumcakes": {"Muffins!"}}}, + {[]api.HTTPHeader{ + {"X-Muffins-Or-Cupcakes", "Muffins"}, + {"X-Muffins-Or-Cupcakes", "Cupcakes, too"}, + }, http.Header{"X-Muffins-Or-Cupcakes": {"Muffins", "Cupcakes, too"}}}, + } + for _, test := range testCases { + headers := buildHeader(test.input) + if !reflect.DeepEqual(test.output, headers) { + t.Errorf("Expected %#v, got %#v", test.output, headers) + } + } +} + func TestProbe(t *testing.T) { prober := &prober{ refManager: kubecontainer.NewRefManager(), diff --git a/pkg/kubelet/prober/results/results_manager_test.go b/pkg/kubelet/prober/results/results_manager_test.go index 64e815b8fb4..d42aebb6e9a 100644 --- a/pkg/kubelet/prober/results/results_manager_test.go +++ b/pkg/kubelet/prober/results/results_manager_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" "k8s.io/kubernetes/pkg/api" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) func TestCacheOperations(t *testing.T) { @@ -58,7 +58,7 @@ func TestUpdates(t *testing.T) { if expected != u { t.Errorf("Expected update %v, recieved %v: %s %s", expected, u, msg) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out waiting for update %v: %s", expected, msg) } } diff --git a/pkg/kubelet/prober/testing.go b/pkg/kubelet/prober/testing.go index 9ea4541cbc3..9ddb808903a 100644 --- a/pkg/kubelet/prober/testing.go +++ b/pkg/kubelet/prober/testing.go @@ -23,7 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/record" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubepod "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/prober/results" @@ -97,7 +97,7 @@ func newTestManager() *manager { refManager := kubecontainer.NewRefManager() refManager.SetRef(testContainerID, &api.ObjectReference{}) // Suppress prober warnings. m := NewManager( - status.NewManager(&testclient.Fake{}, kubepod.NewBasicPodManager(nil)), + status.NewManager(&fake.Clientset{}, kubepod.NewBasicPodManager(nil)), results.NewManager(), nil, // runner refManager, diff --git a/pkg/kubelet/prober/worker.go b/pkg/kubelet/prober/worker.go index 60f4c6d6747..3441cfc4da1 100644 --- a/pkg/kubelet/prober/worker.go +++ b/pkg/kubelet/prober/worker.go @@ -17,6 +17,7 @@ limitations under the License. package prober import ( + "math/rand" "time" "github.com/golang/glog" @@ -32,8 +33,8 @@ import ( // stop channel is closed. The worker uses the probe Manager's statusManager to get up-to-date // container IDs. type worker struct { - // Channel for stopping the probe, it should be closed to trigger a stop. - stop chan struct{} + // Channel for stopping the probe. + stopCh chan struct{} // The pod containing this probe (read-only) pod *api.Pod @@ -70,7 +71,7 @@ func newWorker( container api.Container) *worker { w := &worker{ - stop: make(chan struct{}), + stopCh: make(chan struct{}, 1), // Buffer so stop() can be non-blocking. pod: pod, container: container, probeType: probeType, @@ -93,7 +94,8 @@ func newWorker( // run periodically probes the container. func (w *worker) run() { - probeTicker := time.NewTicker(time.Duration(w.spec.PeriodSeconds) * time.Second) + probeTickerPeriod := time.Duration(w.spec.PeriodSeconds) * time.Second + probeTicker := time.NewTicker(probeTickerPeriod) defer func() { // Clean up. @@ -105,11 +107,15 @@ func (w *worker) run() { w.probeManager.removeWorker(w.pod.UID, w.container.Name, w.probeType) }() + // If kubelet restarted the probes could be started in rapid succession. + // Let the worker wait for a random portion of tickerPeriod before probing. + time.Sleep(time.Duration(rand.Float64() * float64(probeTickerPeriod))) + probeLoop: for w.doProbe() { // Wait for next probe tick. select { - case <-w.stop: + case <-w.stopCh: break probeLoop case <-probeTicker.C: // continue @@ -117,6 +123,15 @@ probeLoop: } } +// stop stops the probe worker. The worker handles cleanup and removes itself from its manager. +// It is safe to call stop multiple times. +func (w *worker) stop() { + select { + case w.stopCh <- struct{}{}: + default: // Non-blocking. + } +} + // doProbe probes the container once and records the result. // Returns whether the worker should continue. func (w *worker) doProbe() (keepGoing bool) { diff --git a/pkg/kubelet/prober/worker_test.go b/pkg/kubelet/prober/worker_test.go index 1dd1dc3cff0..26a87dd2dcf 100644 --- a/pkg/kubelet/prober/worker_test.go +++ b/pkg/kubelet/prober/worker_test.go @@ -24,13 +24,12 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/record" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubepod "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/prober/results" "k8s.io/kubernetes/pkg/kubelet/status" "k8s.io/kubernetes/pkg/probe" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/exec" "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wait" @@ -118,7 +117,7 @@ func TestDoProbe(t *testing.T) { } // Clean up. - m.statusManager = status.NewManager(&testclient.Fake{}, kubepod.NewBasicPodManager(nil)) + m.statusManager = status.NewManager(&fake.Clientset{}, kubepod.NewBasicPodManager(nil)) resultsManager(m, probeType).Remove(testContainerID) } } @@ -232,12 +231,14 @@ func TestCleanUp(t *testing.T) { return ready == results.Success, nil } if ready, _ := condition(); !ready { - if err := wait.Poll(100*time.Millisecond, util.ForeverTestTimeout, condition); err != nil { + if err := wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, condition); err != nil { t.Fatalf("[%s] Error waiting for worker ready: %v", probeType, err) } } - close(w.stop) + for i := 0; i < 10; i++ { + w.stop() // Stop should be callable multiple times without consequence. + } if err := waitForWorkerExit(m, []probeKey{key}); err != nil { t.Fatalf("[%s] error waiting for worker exit: %v", probeType, err) } diff --git a/pkg/kubelet/rkt/fake_rkt_interface.go b/pkg/kubelet/rkt/fake_rkt_interface.go index a1850282d42..25e73e4b246 100644 --- a/pkg/kubelet/rkt/fake_rkt_interface.go +++ b/pkg/kubelet/rkt/fake_rkt_interface.go @@ -21,10 +21,13 @@ import ( "strconv" "sync" + "k8s.io/kubernetes/pkg/api" + "github.com/coreos/go-systemd/dbus" rktapi "github.com/coreos/rkt/api/v1alpha" "golang.org/x/net/context" "google.golang.org/grpc" + kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) // fakeRktInterface mocks the rktapi.PublicAPIClient interface for testing purpose. @@ -142,3 +145,18 @@ func (f *fakeSystemd) RestartUnit(name string, mode string, ch chan<- string) (i func (f *fakeSystemd) Reload() error { return fmt.Errorf("Not implemented") } + +// fakeRuntimeHelper implementes kubecontainer.RuntimeHelper interfaces for testing purpose. +type fakeRuntimeHelper struct { + dnsServers []string + dnsSearches []string + err error +} + +func (f *fakeRuntimeHelper) GenerateRunContainerOptions(pod *api.Pod, container *api.Container) (*kubecontainer.RunContainerOptions, error) { + return nil, fmt.Errorf("Not implemented") +} + +func (f *fakeRuntimeHelper) GetClusterDNS(pod *api.Pod) ([]string, []string, error) { + return f.dnsServers, f.dnsSearches, f.err +} diff --git a/pkg/kubelet/rkt/rkt.go b/pkg/kubelet/rkt/rkt.go index 0c3de458307..3691d53f7c0 100644 --- a/pkg/kubelet/rkt/rkt.go +++ b/pkg/kubelet/rkt/rkt.go @@ -25,7 +25,6 @@ import ( "os" "os/exec" "path" - "sort" "strconv" "strings" "syscall" @@ -39,7 +38,6 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/credentialprovider" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" @@ -79,9 +77,9 @@ const ( k8sRktNamespaceAnno = "rkt.kubernetes.io/namespace" //TODO: remove the creation time annotation once this is closed: https://github.com/coreos/rkt/issues/1789 k8sRktCreationTimeAnno = "rkt.kubernetes.io/created" - k8sRktContainerHashAnno = "rkt.kubernetes.io/containerhash" - k8sRktRestartCountAnno = "rkt.kubernetes.io/restartcount" - k8sRktTerminationMessagePathAnno = "rkt.kubernetes.io/terminationMessagePath" + k8sRktContainerHashAnno = "rkt.kubernetes.io/container-hash" + k8sRktRestartCountAnno = "rkt.kubernetes.io/restart-count" + k8sRktTerminationMessagePathAnno = "rkt.kubernetes.io/termination-message-path" dockerPrefix = "docker://" authDir = "auth.d" @@ -90,6 +88,12 @@ const ( defaultImageTag = "latest" defaultRktAPIServiceAddr = "localhost:15441" defaultNetworkName = "rkt.kubernetes.io" + + // ndots specifies the minimum number of dots that a domain name must contain for the resolver to consider it as FQDN (fully-qualified) + // we want to able to consider SRV lookup names like _dns._udp.kube-dns.default.svc to be considered relative. + // hence, setting ndots to be 5. + // TODO(yifan): Move this and dockertools.ndotsDNSOption to a common package. + defaultDNSOption = "ndots:5" ) // Runtime implements the Containerruntime for rkt. The implementation @@ -107,7 +111,7 @@ type Runtime struct { dockerKeyring credentialprovider.DockerKeyring containerRefManager *kubecontainer.RefManager - generator kubecontainer.RunContainerOptionsGenerator + runtimeHelper kubecontainer.RuntimeHelper recorder record.EventRecorder livenessManager proberesults.Manager volumeGetter volumeGetter @@ -131,7 +135,7 @@ type volumeGetter interface { // It will test if the rkt binary is in the $PATH, and whether we can get the // version of it. If so, creates the rkt container runtime, otherwise returns an error. func New(config *Config, - generator kubecontainer.RunContainerOptionsGenerator, + runtimeHelper kubecontainer.RuntimeHelper, recorder record.EventRecorder, containerRefManager *kubecontainer.RefManager, livenessManager proberesults.Manager, @@ -169,7 +173,7 @@ func New(config *Config, config: config, dockerKeyring: credentialprovider.NewDockerKeyring(), containerRefManager: containerRefManager, - generator: generator, + runtimeHelper: runtimeHelper, recorder: recorder, livenessManager: livenessManager, volumeGetter: volumeGetter, @@ -262,17 +266,18 @@ func setIsolators(app *appctypes.App, c *api.Container, ctx *api.SecurityContext request string } - resources := make(map[api.ResourceName]resource) + // If limit is empty, populate it with request and vice versa. + resources := make(map[api.ResourceName]*resource) for name, quantity := range c.Resources.Limits { - resources[name] = resource{limit: quantity.String()} + resources[name] = &resource{limit: quantity.String(), request: quantity.String()} } for name, quantity := range c.Resources.Requests { r, ok := resources[name] - if !ok { - r = resource{} + if ok { + r.request = quantity.String() + continue } - r.request = quantity.String() - resources[name] = r + resources[name] = &resource{limit: quantity.String(), request: quantity.String()} } for name, res := range resources { @@ -581,7 +586,7 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, c api.Container, pullSecrets [ return err } - opts, err := r.generator.GenerateRunContainerOptions(pod, &c) + opts, err := r.runtimeHelper.GenerateRunContainerOptions(pod, &c) if err != nil { return err } @@ -701,6 +706,35 @@ func serviceFilePath(serviceName string) string { return path.Join(systemdServiceDir, serviceName) } +// generateRunCommand crafts a 'rkt run-prepared' command with necessary parameters. +func (r *Runtime) generateRunCommand(pod *api.Pod, uuid string) (string, error) { + runPrepared := r.buildCommand("run-prepared").Args + + // Setup network configuration. + if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.HostNetwork { + runPrepared = append(runPrepared, "--net=host") + } else { + runPrepared = append(runPrepared, fmt.Sprintf("--net=%s", defaultNetworkName)) + } + + // Setup DNS. + dnsServers, dnsSearches, err := r.runtimeHelper.GetClusterDNS(pod) + if err != nil { + return "", err + } + for _, server := range dnsServers { + runPrepared = append(runPrepared, fmt.Sprintf("--dns=%s", server)) + } + for _, search := range dnsSearches { + runPrepared = append(runPrepared, fmt.Sprintf("--dns-search=%s", search)) + } + if len(dnsServers) > 0 || len(dnsSearches) > 0 { + runPrepared = append(runPrepared, fmt.Sprintf("--dns-opt=%s", defaultDNSOption)) + } + runPrepared = append(runPrepared, uuid) + return strings.Join(runPrepared, " "), nil +} + // preparePod will: // // 1. Invoke 'rkt prepare' to prepare the pod, and get the rkt pod uuid. @@ -753,11 +787,9 @@ func (r *Runtime) preparePod(pod *api.Pod, pullSecrets []api.Secret) (string, *k glog.V(4).Infof("'rkt prepare' returns %q", uuid) // Create systemd service file for the rkt pod. - var runPrepared string - if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.HostNetwork { - runPrepared = fmt.Sprintf("%s run-prepared --mds-register=false --net=host %s", r.rktBinAbsPath, uuid) - } else { - runPrepared = fmt.Sprintf("%s run-prepared --mds-register=false --net=%s %s", r.rktBinAbsPath, defaultNetworkName, uuid) + runPrepared, err := r.generateRunCommand(pod, uuid) + if err != nil { + return "", nil, fmt.Errorf("failed to generate 'rkt run-prepared' command: %v", err) } // TODO handle pod.Spec.HostPID @@ -1020,16 +1052,6 @@ func (r *Runtime) KillPod(pod *api.Pod, runningPod kubecontainer.Pod) error { return nil } -// GetAPIPodStatus returns the status of the given pod. -func (r *Runtime) GetAPIPodStatus(pod *api.Pod) (*api.PodStatus, error) { - // Get the pod status. - podStatus, err := r.GetPodStatus(pod.UID, pod.Name, pod.Namespace) - if err != nil { - return nil, err - } - return r.ConvertPodStatusToAPIPodStatus(pod, podStatus) -} - func (r *Runtime) Type() string { return RktType } @@ -1066,7 +1088,7 @@ func (r *Runtime) SyncPod(pod *api.Pod, podStatus api.PodStatus, internalPodStat c := runningPod.FindContainerByName(container.Name) if c == nil { - if kubecontainer.ShouldContainerBeRestartedOldVersion(&container, pod, &podStatus) { + if kubecontainer.ShouldContainerBeRestarted(&container, pod, internalPodStatus) { glog.V(3).Infof("Container %+v is dead, but RestartPolicy says that we should restart it.", container) // TODO(yifan): Containers in one pod are fate-sharing at this moment, see: // https://github.com/appc/spec/issues/276. @@ -1427,7 +1449,7 @@ func (r *Runtime) GetPodStatus(uid types.UID, name, namespace string) (*kubecont for _, pod := range listResp.Pods { manifest, creationTime, restartCount, err := getPodInfo(pod) if err != nil { - glog.Warning("rkt: Couldn't get necessary info from the rkt pod, (uuid %q): %v", pod.Id, err) + glog.Warningf("rkt: Couldn't get necessary info from the rkt pod, (uuid %q): %v", pod.Id, err) continue } @@ -1466,77 +1488,3 @@ type sortByRestartCount []*kubecontainer.ContainerStatus func (s sortByRestartCount) Len() int { return len(s) } func (s sortByRestartCount) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s sortByRestartCount) Less(i, j int) bool { return s[i].RestartCount < s[j].RestartCount } - -// TODO(yifan): Delete this function when the logic is moved to kubelet. -func (r *Runtime) ConvertPodStatusToAPIPodStatus(pod *api.Pod, status *kubecontainer.PodStatus) (*api.PodStatus, error) { - apiPodStatus := &api.PodStatus{PodIP: status.IP} - - // Sort in the reverse order of the restart count because the - // lastest one will have the largest restart count. - sort.Sort(sort.Reverse(sortByRestartCount(status.ContainerStatuses))) - - containerStatuses := make(map[string]*api.ContainerStatus) - for _, c := range status.ContainerStatuses { - var st api.ContainerState - switch c.State { - case kubecontainer.ContainerStateRunning: - st.Running = &api.ContainerStateRunning{ - StartedAt: unversioned.NewTime(c.StartedAt), - } - case kubecontainer.ContainerStateExited: - if pod.Spec.RestartPolicy == api.RestartPolicyAlways || - pod.Spec.RestartPolicy == api.RestartPolicyOnFailure && c.ExitCode != 0 { - // TODO(yifan): Add reason and message. - st.Waiting = &api.ContainerStateWaiting{} - break - } - st.Terminated = &api.ContainerStateTerminated{ - ExitCode: c.ExitCode, - StartedAt: unversioned.NewTime(c.StartedAt), - Reason: c.Reason, - Message: c.Message, - // TODO(yifan): Add finishedAt, signal. - ContainerID: c.ID.String(), - } - default: - // Unknown state. - // TODO(yifan): Add reason and message. - st.Waiting = &api.ContainerStateWaiting{} - } - - status, ok := containerStatuses[c.Name] - if !ok { - containerStatuses[c.Name] = &api.ContainerStatus{ - Name: c.Name, - Image: c.Image, - ImageID: c.ImageID, - ContainerID: c.ID.String(), - RestartCount: c.RestartCount, - State: st, - } - continue - } - - // Found multiple container statuses, fill that as last termination state. - if status.LastTerminationState.Waiting == nil && - status.LastTerminationState.Running == nil && - status.LastTerminationState.Terminated == nil { - status.LastTerminationState = st - } - } - - for _, c := range pod.Spec.Containers { - cs, ok := containerStatuses[c.Name] - if !ok { - cs = &api.ContainerStatus{ - Name: c.Name, - Image: c.Image, - // TODO(yifan): Add reason and message. - State: api.ContainerState{Waiting: &api.ContainerStateWaiting{}}, - } - } - apiPodStatus.ContainerStatuses = append(apiPodStatus.ContainerStatuses, *cs) - } - - return apiPodStatus, nil -} diff --git a/pkg/kubelet/rkt/rkt_test.go b/pkg/kubelet/rkt/rkt_test.go index f0ee5431c29..bbb655ee385 100644 --- a/pkg/kubelet/rkt/rkt_test.go +++ b/pkg/kubelet/rkt/rkt_test.go @@ -887,8 +887,8 @@ func TestSetApp(t *testing.T) { Args: []string{"hello", "world", "$(env-bar)"}, WorkingDir: tmpDir, Resources: api.ResourceRequirements{ - Limits: api.ResourceList{"cpu": resource.MustParse("50m"), "memory": resource.MustParse("50M")}, - Requests: api.ResourceList{"cpu": resource.MustParse("5m"), "memory": resource.MustParse("5M")}, + Limits: api.ResourceList{"cpu": resource.MustParse("50m")}, + Requests: api.ResourceList{"memory": resource.MustParse("5M")}, }, }, opts: &kubecontainer.RunContainerOptions{ @@ -934,8 +934,8 @@ func TestSetApp(t *testing.T) { Isolators: []appctypes.Isolator{ generateCapRetainIsolator(t, "CAP_SYS_CHROOT", "CAP_SYS_BOOT"), generateCapRevokeIsolator(t, "CAP_SETUID", "CAP_SETGID"), - generateCPUIsolator(t, "5m", "50m"), - generateMemoryIsolator(t, "5M", "50M"), + generateCPUIsolator(t, "50m", "50m"), + generateMemoryIsolator(t, "5M", "5M"), }, }, }, @@ -955,3 +955,102 @@ func TestSetApp(t *testing.T) { } } } + +func TestGenerateRunCommand(t *testing.T) { + tests := []struct { + pod *api.Pod + uuid string + + dnsServers []string + dnsSearches []string + err error + + expect string + }{ + // Case #0, returns error. + { + &api.Pod{ + Spec: api.PodSpec{}, + }, + "rkt-uuid-foo", + []string{}, + []string{}, + fmt.Errorf("failed to get cluster dns"), + "", + }, + // Case #1, returns no dns, with private-net. + { + &api.Pod{}, + "rkt-uuid-foo", + []string{}, + []string{}, + nil, + "/bin/rkt/rkt --debug=false --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=rkt.kubernetes.io rkt-uuid-foo", + }, + // Case #2, returns no dns, with host-net. + { + &api.Pod{ + Spec: api.PodSpec{ + SecurityContext: &api.PodSecurityContext{ + HostNetwork: true, + }, + }, + }, + "rkt-uuid-foo", + []string{}, + []string{}, + nil, + "/bin/rkt/rkt --debug=false --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host rkt-uuid-foo", + }, + // Case #3, returns dns, dns searches, with private-net. + { + &api.Pod{ + Spec: api.PodSpec{ + SecurityContext: &api.PodSecurityContext{ + HostNetwork: false, + }, + }, + }, + "rkt-uuid-foo", + []string{"127.0.0.1"}, + []string{"."}, + nil, + "/bin/rkt/rkt --debug=false --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=rkt.kubernetes.io --dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 rkt-uuid-foo", + }, + // Case #4, returns dns, dns searches, with host-network. + { + &api.Pod{ + Spec: api.PodSpec{ + SecurityContext: &api.PodSecurityContext{ + HostNetwork: true, + }, + }, + }, + "rkt-uuid-foo", + []string{"127.0.0.1"}, + []string{"."}, + nil, + "/bin/rkt/rkt --debug=false --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host --dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 rkt-uuid-foo", + }, + } + + rkt := &Runtime{ + rktBinAbsPath: "/bin/rkt/rkt", + config: &Config{ + Path: "/bin/rkt/rkt", + Stage1Image: "/bin/rkt/stage1-coreos.aci", + Dir: "/var/data", + InsecureOptions: "image,ondisk", + LocalConfigDir: "/var/rkt/local/data", + }, + } + + for i, tt := range tests { + testCaseHint := fmt.Sprintf("test case #%d", i) + rkt.runtimeHelper = &fakeRuntimeHelper{tt.dnsServers, tt.dnsSearches, tt.err} + + result, err := rkt.generateRunCommand(tt.pod, tt.uuid) + assert.Equal(t, tt.err, err, testCaseHint) + assert.Equal(t, tt.expect, result, testCaseHint) + } +} diff --git a/pkg/kubelet/runonce.go b/pkg/kubelet/runonce.go index d1088e31061..c959dee3b2b 100644 --- a/pkg/kubelet/runonce.go +++ b/pkg/kubelet/runonce.go @@ -23,7 +23,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/kubelet/container" + kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util/format" ) @@ -89,10 +89,10 @@ func (kl *Kubelet) runOnce(pods []*api.Pod, retryDelay time.Duration) (results [ results = append(results, res) if res.Err != nil { // TODO(proppy): report which containers failed the pod. - glog.Infof("failed to start pod %q: %v", res.Pod.Name, res.Err) - failedPods = append(failedPods, res.Pod.Name) + glog.Infof("failed to start pod %q: %v", format.Pod(res.Pod), res.Err) + failedPods = append(failedPods, format.Pod(res.Pod)) } else { - glog.Infof("started pod %q", res.Pod.Name) + glog.Infof("started pod %q", format.Pod(res.Pod)) } } if len(failedPods) > 0 { @@ -107,25 +107,17 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error { delay := retryDelay retry := 0 for { - pods, err := kl.containerRuntime.GetPods(false) - if err != nil { - return fmt.Errorf("failed to get kubelet pods: %v", err) - } - p := container.Pods(pods).FindPodByID(pod.UID) - running, err := kl.isPodRunning(pod, p) - if err != nil { - return fmt.Errorf("failed to check pod status: %v", err) - } - if running { - glog.Infof("pod %q containers running", pod.Name) - return nil - } - glog.Infof("pod %q containers not running: syncing", pod.Name) - status, err := kl.containerRuntime.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { - glog.Errorf("Unable to get status for pod %q: %v", pod.Name, err) + return fmt.Errorf("Unable to get status for pod %q: %v", format.Pod(pod), err) } + + if kl.isPodRunning(pod, status) { + glog.Infof("pod %q containers running", format.Pod(pod)) + return nil + } + glog.Infof("pod %q containers not running: syncing", format.Pod(pod)) + glog.Infof("Creating a mirror pod for static pod %q", format.Pod(pod)) if err := kl.podManager.CreateMirrorPod(pod); err != nil { glog.Errorf("Failed creating a mirror pod %q: %v", format.Pod(pod), err) @@ -133,13 +125,13 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error { mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) if err = kl.syncPod(pod, mirrorPod, status, kubetypes.SyncPodUpdate); err != nil { - return fmt.Errorf("error syncing pod: %v", err) + return fmt.Errorf("error syncing pod %q: %v", format.Pod(pod), err) } if retry >= runOnceMaxRetries { - return fmt.Errorf("timeout error: pod %q containers not running after %d retries", pod.Name, runOnceMaxRetries) + return fmt.Errorf("timeout error: pod %q containers not running after %d retries", format.Pod(pod), runOnceMaxRetries) } // TODO(proppy): health checking would be better than waiting + checking the state at the next iteration. - glog.Infof("pod %q containers synced, waiting for %v", pod.Name, delay) + glog.Infof("pod %q containers synced, waiting for %v", format.Pod(pod), delay) time.Sleep(delay) retry++ delay *= runOnceRetryDelayBackoff @@ -147,18 +139,13 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error { } // isPodRunning returns true if all containers of a manifest are running. -func (kl *Kubelet) isPodRunning(pod *api.Pod, runningPod container.Pod) (bool, error) { - // TODO(random-liu): Change this to new pod status - status, err := kl.containerRuntime.GetAPIPodStatus(pod) - if err != nil { - glog.Infof("Failed to get the status of pod %q: %v", format.Pod(pod), err) - return false, err - } - for _, st := range status.ContainerStatuses { - if st.State.Running == nil { - glog.Infof("Container %q not running: %#v", st.Name, st.State) - return false, nil +func (kl *Kubelet) isPodRunning(pod *api.Pod, status *kubecontainer.PodStatus) bool { + for _, c := range pod.Spec.Containers { + cs := status.FindContainerStatusByName(c.Name) + if cs == nil || cs.State != kubecontainer.ContainerStateRunning { + glog.Infof("Container %q for pod %q not running", c.Name, format.Pod(pod)) + return false } } - return true, nil + return true } diff --git a/pkg/kubelet/runonce_test.go b/pkg/kubelet/runonce_test.go index df7edb71dc8..95ac9d0be3a 100644 --- a/pkg/kubelet/runonce_test.go +++ b/pkg/kubelet/runonce_test.go @@ -31,6 +31,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/network" kubepod "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/status" + "k8s.io/kubernetes/pkg/util" utiltesting "k8s.io/kubernetes/pkg/util/testing" ) @@ -67,6 +68,8 @@ func TestRunOnce(t *testing.T) { volumeManager: newVolumeManager(), diskSpaceManager: diskSpaceManager, containerRuntime: fakeRuntime, + reasonCache: NewReasonCache(), + clock: util.RealClock{}, } kb.containerManager = cm.NewStubContainerManager() @@ -90,6 +93,20 @@ func TestRunOnce(t *testing.T) { }, } podManager.SetPods(pods) + // The original test here is totally meaningless, because fakeruntime will always return an empty podStatus. While + // the originial logic of isPodRunning happens to return true when podstatus is empty, so the test can always pass. + // Now the logic in isPodRunning is changed, to let the test pass, we set the podstatus directly in fake runtime. + // This is also a meaningless test, because the isPodRunning will also always return true after setting this. However, + // because runonce is never used in kubernetes now, we should deprioritize the cleanup work. + // TODO(random-liu) Fix the test, make it meaningful. + fakeRuntime.PodStatus = kubecontainer.PodStatus{ + ContainerStatuses: []*kubecontainer.ContainerStatus{ + { + Name: "bar", + State: kubecontainer.ContainerStateRunning, + }, + }, + } results, err := kb.runOnce(pods, time.Millisecond) if err != nil { t.Errorf("unexpected error: %v", err) diff --git a/pkg/kubelet/runtime.go b/pkg/kubelet/runtime.go index e97e8245780..6e3c413ad41 100644 --- a/pkg/kubelet/runtime.go +++ b/pkg/kubelet/runtime.go @@ -94,7 +94,6 @@ func (s *runtimeState) errors() []string { func newRuntimeState( runtimeSyncThreshold time.Duration, configureNetwork bool, - cidr string, runtimeCompatibility func() error, ) *runtimeState { var networkError error = nil @@ -105,7 +104,6 @@ func newRuntimeState( lastBaseRuntimeSync: time.Time{}, baseRuntimeSyncThreshold: runtimeSyncThreshold, networkError: networkError, - cidr: cidr, internalError: nil, runtimeCompatibility: runtimeCompatibility, } diff --git a/pkg/kubelet/server/server.go b/pkg/kubelet/server/server.go index 6ebd6cfe8ff..88b7ee9f5fc 100644 --- a/pkg/kubelet/server/server.go +++ b/pkg/kubelet/server/server.go @@ -33,6 +33,7 @@ import ( restful "github.com/emicklei/go-restful" "github.com/golang/glog" cadvisorapi "github.com/google/cadvisor/info/v1" + cadvisorapiv2 "github.com/google/cadvisor/info/v2" "github.com/prometheus/client_golang/prometheus" "k8s.io/kubernetes/pkg/api" @@ -45,6 +46,7 @@ import ( "k8s.io/kubernetes/pkg/client/unversioned/remotecommand" "k8s.io/kubernetes/pkg/healthz" "k8s.io/kubernetes/pkg/httplog" + "k8s.io/kubernetes/pkg/kubelet/cm" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/server/portforward" "k8s.io/kubernetes/pkg/kubelet/server/stats" @@ -56,13 +58,15 @@ import ( "k8s.io/kubernetes/pkg/util/limitwriter" utilruntime "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wsstream" + "k8s.io/kubernetes/pkg/volume" ) // Server is a http.Handler which exposes kubelet functionality over HTTP. type Server struct { - auth AuthInterface - host HostInterface - restfulCont containerInterface + auth AuthInterface + host HostInterface + restfulCont containerInterface + resourceAnalyzer stats.ResourceAnalyzer } type TLSOptions struct { @@ -100,9 +104,9 @@ func (a *filteringContainer) RegisteredHandlePaths() []string { } // ListenAndServeKubeletServer initializes a server to respond to HTTP network requests on the Kubelet. -func ListenAndServeKubeletServer(host HostInterface, address net.IP, port uint, tlsOptions *TLSOptions, auth AuthInterface, enableDebuggingHandlers bool) { +func ListenAndServeKubeletServer(host HostInterface, resourceAnalyzer stats.ResourceAnalyzer, address net.IP, port uint, tlsOptions *TLSOptions, auth AuthInterface, enableDebuggingHandlers bool) { glog.Infof("Starting to listen on %s:%d", address, port) - handler := NewServer(host, auth, enableDebuggingHandlers) + handler := NewServer(host, resourceAnalyzer, auth, enableDebuggingHandlers) s := &http.Server{ Addr: net.JoinHostPort(address.String(), strconv.FormatUint(uint64(port), 10)), Handler: &handler, @@ -117,9 +121,9 @@ func ListenAndServeKubeletServer(host HostInterface, address net.IP, port uint, } // ListenAndServeKubeletReadOnlyServer initializes a server to respond to HTTP network requests on the Kubelet. -func ListenAndServeKubeletReadOnlyServer(host HostInterface, address net.IP, port uint) { +func ListenAndServeKubeletReadOnlyServer(host HostInterface, resourceAnalyzer stats.ResourceAnalyzer, address net.IP, port uint) { glog.V(1).Infof("Starting to listen read-only on %s:%d", address, port) - s := NewServer(host, nil, false) + s := NewServer(host, resourceAnalyzer, nil, false) server := &http.Server{ Addr: net.JoinHostPort(address.String(), strconv.FormatUint(uint64(port), 10)), @@ -140,6 +144,7 @@ type AuthInterface interface { // For testablitiy. type HostInterface interface { GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) + GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) GetCachedMachineInfo() (*cadvisorapi.MachineInfo, error) GetPods() []*api.Pod @@ -154,15 +159,21 @@ type HostInterface interface { StreamingConnectionIdleTimeout() time.Duration ResyncInterval() time.Duration GetHostname() string + GetNode() (*api.Node, error) + GetNodeConfig() cm.NodeConfig LatestLoopEntryTime() time.Time + DockerImagesFsInfo() (cadvisorapiv2.FsInfo, error) + RootFsInfo() (cadvisorapiv2.FsInfo, error) + ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) } // NewServer initializes and configures a kubelet.Server object to handle HTTP requests. -func NewServer(host HostInterface, auth AuthInterface, enableDebuggingHandlers bool) Server { +func NewServer(host HostInterface, resourceAnalyzer stats.ResourceAnalyzer, auth AuthInterface, enableDebuggingHandlers bool) Server { server := Server{ - host: host, - auth: auth, - restfulCont: &filteringContainer{Container: restful.NewContainer()}, + host: host, + resourceAnalyzer: resourceAnalyzer, + auth: auth, + restfulCont: &filteringContainer{Container: restful.NewContainer()}, } if auth != nil { server.InstallAuthFilter() @@ -222,7 +233,7 @@ func (s *Server) InstallDefaultHandlers() { Operation("getPods")) s.restfulCont.Add(ws) - s.restfulCont.Add(stats.CreateHandlers(s.host)) + s.restfulCont.Add(stats.CreateHandlers(s.host, s.resourceAnalyzer)) s.restfulCont.Handle("/metrics", prometheus.Handler()) ws = new(restful.WebService) @@ -606,6 +617,15 @@ func standardShellChannels(stdin, stdout, stderr bool) []wsstream.ChannelType { return channels } +// streamAndReply holds both a Stream and a channel that is closed when the stream's reply frame is +// enqueued. Consumers can wait for replySent to be closed prior to proceeding, to ensure that the +// replyFrame is enqueued before the connection's goaway frame is sent (e.g. if a stream was +// received and right after, the connection gets closed). +type streamAndReply struct { + httpstream.Stream + replySent <-chan struct{} +} + func (s *Server) createStreams(request *restful.Request, response *restful.Response) (io.Reader, io.WriteCloser, io.WriteCloser, io.WriteCloser, Closer, bool, bool) { tty := request.QueryParameter(api.ExecTTYParam) == "1" stdin := request.QueryParameter(api.ExecStdinParam) == "1" @@ -664,11 +684,11 @@ func (s *Server) createStreams(request *restful.Request, response *restful.Respo return nil, nil, nil, nil, nil, false, false } - streamCh := make(chan httpstream.Stream) + streamCh := make(chan streamAndReply) upgrader := spdy.NewResponseUpgrader() - conn := upgrader.UpgradeResponse(response.ResponseWriter, request.Request, func(stream httpstream.Stream) error { - streamCh <- stream + conn := upgrader.UpgradeResponse(response.ResponseWriter, request.Request, func(stream httpstream.Stream, replySent <-chan struct{}) error { + streamCh <- streamAndReply{Stream: stream, replySent: replySent} return nil }) // from this point on, we can no longer call methods on response @@ -686,6 +706,9 @@ func (s *Server) createStreams(request *restful.Request, response *restful.Respo var errorStream, stdinStream, stdoutStream, stderrStream httpstream.Stream receivedStreams := 0 + replyChan := make(chan struct{}) + stop := make(chan struct{}) + defer close(stop) WaitForStreams: for { select { @@ -694,19 +717,21 @@ WaitForStreams: switch streamType { case api.StreamTypeError: errorStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: stdinStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: stdoutStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: stderrStream = stream - receivedStreams++ + go waitStreamReply(stream.replySent, replyChan, stop) default: glog.Errorf("Unexpected stream type: '%s'", streamType) } + case <-replyChan: + receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } @@ -721,6 +746,16 @@ WaitForStreams: return stdinStream, stdoutStream, stderrStream, errorStream, conn, tty, true } +// waitStreamReply waits until either replySent or stop is closed. If replySent is closed, it sends +// an empty struct to the notify channel. +func waitStreamReply(replySent <-chan struct{}, notify chan<- struct{}, stop <-chan struct{}) { + select { + case <-replySent: + notify <- struct{}{} + case <-stop: + } +} + func getPodCoordinates(request *restful.Request) (namespace, pod string, uid types.UID) { namespace = request.PathParameter("podNamespace") pod = request.PathParameter("podID") @@ -796,8 +831,8 @@ func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder Po // forward streams. It checks each stream's port and stream type headers, // rejecting any streams that with missing or invalid values. Each valid // stream is sent to the streams channel. -func portForwardStreamReceived(streams chan httpstream.Stream) func(httpstream.Stream) error { - return func(stream httpstream.Stream) error { +func portForwardStreamReceived(streams chan httpstream.Stream) func(httpstream.Stream, <-chan struct{}) error { + return func(stream httpstream.Stream, replySent <-chan struct{}) error { // make sure it has a valid port header portString := stream.Headers().Get(api.PortHeader) if len(portString) == 0 { diff --git a/pkg/kubelet/server/server_test.go b/pkg/kubelet/server/server_test.go index f1a5cf70a19..cf5dd1ea7ee 100644 --- a/pkg/kubelet/server/server_test.go +++ b/pkg/kubelet/server/server_test.go @@ -34,16 +34,20 @@ import ( "time" cadvisorapi "github.com/google/cadvisor/info/v1" + cadvisorapiv2 "github.com/google/cadvisor/info/v2" "k8s.io/kubernetes/pkg/api" apierrs "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/auth/authorizer" "k8s.io/kubernetes/pkg/auth/user" + "k8s.io/kubernetes/pkg/kubelet/cm" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/server/stats" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/httpstream" "k8s.io/kubernetes/pkg/util/httpstream/spdy" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/volume" ) type fakeKubelet struct { @@ -129,6 +133,26 @@ func (fk *fakeKubelet) StreamingConnectionIdleTimeout() time.Duration { return fk.streamingConnectionIdleTimeoutFunc() } +// Unused functions +func (_ *fakeKubelet) GetContainerInfoV2(_ string, _ cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + return nil, nil +} + +func (_ *fakeKubelet) DockerImagesFsInfo() (cadvisorapiv2.FsInfo, error) { + return cadvisorapiv2.FsInfo{}, fmt.Errorf("Unsupported Operation DockerImagesFsInfo") +} + +func (_ *fakeKubelet) RootFsInfo() (cadvisorapiv2.FsInfo, error) { + return cadvisorapiv2.FsInfo{}, fmt.Errorf("Unsupport Operation RootFsInfo") +} + +func (_ *fakeKubelet) GetNode() (*api.Node, error) { return nil, nil } +func (_ *fakeKubelet) GetNodeConfig() cm.NodeConfig { return cm.NodeConfig{} } + +func (fk *fakeKubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) { + return map[string]volume.Volume{}, true +} + type fakeAuth struct { authenticateFunc func(*http.Request) (user.Info, bool, error) attributesFunc func(user.Info, *http.Request) authorizer.Attributes @@ -178,7 +202,11 @@ func newServerTest() *serverTestFramework { return nil }, } - server := NewServer(fw.fakeKubelet, fw.fakeAuth, true) + server := NewServer( + fw.fakeKubelet, + stats.NewResourceAnalyzer(fw.fakeKubelet, time.Minute), + fw.fakeAuth, + true) fw.serverUnderTest = &server // TODO: Close() this when fix #19254 fw.testHTTPServer = httptest.NewServer(fw.serverUnderTest) @@ -1699,7 +1727,9 @@ func TestPortForwardStreamReceived(t *testing.T) { if len(test.streamType) > 0 { stream.headers.Set("streamType", test.streamType) } - err := f(stream) + replySent := make(chan struct{}) + err := f(stream, replySent) + close(replySent) if len(test.expectedError) > 0 { if err == nil { t.Errorf("%s: expected err=%q, but it was nil", name, test.expectedError) diff --git a/pkg/kubelet/server/stats/fs_resource_analyzer.go b/pkg/kubelet/server/stats/fs_resource_analyzer.go new file mode 100644 index 00000000000..829bab8107d --- /dev/null +++ b/pkg/kubelet/server/stats/fs_resource_analyzer.go @@ -0,0 +1,153 @@ +/* +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. +*/ + +package stats + +import ( + "sync/atomic" + "time" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/kubelet/metrics" + "k8s.io/kubernetes/pkg/kubelet/util/format" + "k8s.io/kubernetes/pkg/types" + "k8s.io/kubernetes/pkg/util/wait" + "k8s.io/kubernetes/pkg/volume" + + "github.com/golang/glog" +) + +// Map to PodVolumeStats pointers since the addresses for map values are not constant and can cause pain +// if we need ever to get a pointer to one of the values (e.g. you can't) +type Cache map[types.UID]*PodVolumeStats + +// PodVolumeStats encapsulates all VolumeStats for a pod +type PodVolumeStats struct { + Volumes []VolumeStats +} + +// fsResourceAnalyzerInterface is for embedding fs functions into ResourceAnalyzer +type fsResourceAnalyzerInterface interface { + GetPodVolumeStats(uid types.UID) (PodVolumeStats, bool) +} + +// diskResourceAnalyzer provider stats about fs resource usage +type fsResourceAnalyzer struct { + statsProvider StatsProvider + calcVolumePeriod time.Duration + cachedVolumeStats atomic.Value +} + +var _ fsResourceAnalyzerInterface = &fsResourceAnalyzer{} + +// newFsResourceAnalyzer returns a new fsResourceAnalyzer implementation +func newFsResourceAnalyzer(statsProvider StatsProvider, calcVolumePeriod time.Duration) *fsResourceAnalyzer { + return &fsResourceAnalyzer{ + statsProvider: statsProvider, + calcVolumePeriod: calcVolumePeriod, + } +} + +// Start eager background caching of volume stats. +func (s *fsResourceAnalyzer) Start() { + if s.calcVolumePeriod <= 0 { + glog.Info("Volume stats collection disabled.") + return + } + glog.Info("Starting FS ResourceAnalyzer") + go wait.Forever(func() { + startTime := time.Now() + s.updateCachedPodVolumeStats() + glog.V(3).Infof("Finished calculating volume stats in %v.", time.Now().Sub(startTime)) + metrics.MetricsVolumeCalcLatency.Observe(metrics.SinceInMicroseconds(startTime)) + }, s.calcVolumePeriod) +} + +// updateCachedPodVolumeStats calculates and caches the PodVolumeStats for every Pod known to the kubelet. +func (s *fsResourceAnalyzer) updateCachedPodVolumeStats() { + // Calculate the new volume stats map + pods := s.statsProvider.GetPods() + newCache := make(Cache) + // TODO: Prevent 1 pod metrics hanging from blocking other pods. Schedule pods independently and spaced + // evenly across the period to prevent cpu spikes. Ideally resource collection consumes the resources + // allocated to the pod itself to isolate bad actors. + // See issue #20675 + for _, pod := range pods { + podUid := pod.GetUID() + stats, found := s.getPodVolumeStats(pod) + if !found { + glog.Warningf("Could not locate volumes for pod %s", format.Pod(pod)) + continue + } + newCache[podUid] = &stats + } + // Update the cache reference + s.cachedVolumeStats.Store(newCache) +} + +// getPodVolumeStats calculates PodVolumeStats for a given pod and returns the result. +func (s *fsResourceAnalyzer) getPodVolumeStats(pod *api.Pod) (PodVolumeStats, bool) { + // Find all Volumes for the Pod + volumes, found := s.statsProvider.ListVolumesForPod(pod.UID) + if !found { + return PodVolumeStats{}, found + } + + // Call GetMetrics on each Volume and copy the result to a new VolumeStats.FsStats + stats := make([]VolumeStats, 0, len(volumes)) + for name, v := range volumes { + metric, err := v.GetMetrics() + if err != nil { + // Expected for Volumes that don't support Metrics + // TODO: Disambiguate unsupported from errors + // See issue #20676 + glog.V(4).Infof("Failed to calculate volume metrics for pod %s volume %s: %+v", + format.Pod(pod), name, err) + continue + } + stats = append(stats, s.parsePodVolumeStats(name, metric)) + } + return PodVolumeStats{Volumes: stats}, true +} + +func (s *fsResourceAnalyzer) parsePodVolumeStats(podName string, metric *volume.Metrics) VolumeStats { + available := uint64(metric.Available.Value()) + capacity := uint64(metric.Capacity.Value()) + used := uint64((metric.Used.Value())) + return VolumeStats{ + Name: podName, + FsStats: FsStats{ + AvailableBytes: &available, + CapacityBytes: &capacity, + UsedBytes: &used}} +} + +// GetPodVolumeStats returns the PodVolumeStats for a given pod. Results are looked up from a cache that +// is eagerly populated in the background, and never calculated on the fly. +func (s *fsResourceAnalyzer) GetPodVolumeStats(uid types.UID) (PodVolumeStats, bool) { + // Cache hasn't been initialized yet + if s.cachedVolumeStats.Load() == nil { + return PodVolumeStats{}, false + } + cache := s.cachedVolumeStats.Load().(Cache) + stats, f := cache[uid] + if !f { + // TODO: Differentiate between stats being empty + // See issue #20679 + return PodVolumeStats{}, false + } + return *stats, true +} diff --git a/pkg/kubelet/server/stats/fs_resource_analyzer_test.go b/pkg/kubelet/server/stats/fs_resource_analyzer_test.go new file mode 100644 index 00000000000..3c0d28c92e8 --- /dev/null +++ b/pkg/kubelet/server/stats/fs_resource_analyzer_test.go @@ -0,0 +1,178 @@ +/* +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. +*/ + +package stats + +import ( + "fmt" + "testing" + "time" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/resource" + "k8s.io/kubernetes/pkg/types" + "k8s.io/kubernetes/pkg/volume" + + "github.com/stretchr/testify/assert" +) + +// TestGetPodVolumeStats tests that GetPodVolumeStats reads from the cache and returns the value +func TestGetPodVolumeStats(t *testing.T) { + instance := newFsResourceAnalyzer(&MockStatsProvider{}, time.Minute*5) + stats, found := instance.GetPodVolumeStats("testpod1") + assert.False(t, found) + assert.Equal(t, PodVolumeStats{}, stats) + + instance.cachedVolumeStats.Store(make(Cache)) + stats, found = instance.GetPodVolumeStats("testpod1") + assert.False(t, found) + assert.Equal(t, PodVolumeStats{}, stats) + + available := uint64(100) + used := uint64(200) + capacity := uint64(400) + vs1 := VolumeStats{ + Name: "vol1", + FsStats: FsStats{ + AvailableBytes: &available, + UsedBytes: &used, + CapacityBytes: &capacity, + }, + } + pvs := &PodVolumeStats{ + Volumes: []VolumeStats{vs1}, + } + + instance.cachedVolumeStats.Load().(Cache)["testpod1"] = pvs + stats, found = instance.GetPodVolumeStats("testpod1") + assert.True(t, found) + assert.Equal(t, *pvs, stats) +} + +// TestUpdateCachedPodVolumeStats tests that the cache is updated from the stats provider +func TestUpdateCachedPodVolumeStats(t *testing.T) { + statsPr := &MockStatsProvider{} + instance := newFsResourceAnalyzer(statsPr, time.Minute*5) + + // Mock retrieving pods + pods := []*api.Pod{ + {ObjectMeta: api.ObjectMeta{UID: "testpod1"}}, + {ObjectMeta: api.ObjectMeta{UID: "testpod2"}}, + } + statsPr.On("GetPods").Return(pods) + + // Mock volumes for pod1 + m1 := &volume.Metrics{ + Available: resource.NewQuantity(100, resource.DecimalSI), + Used: resource.NewQuantity(200, resource.DecimalSI), + Capacity: resource.NewQuantity(400, resource.DecimalSI), + } + v1 := &volume.MockVolume{} + v1.On("GetMetrics").Return(m1, nil) + + m2 := &volume.Metrics{ + Available: resource.NewQuantity(600, resource.DecimalSI), + Used: resource.NewQuantity(700, resource.DecimalSI), + Capacity: resource.NewQuantity(1400, resource.DecimalSI), + } + v2 := &volume.MockVolume{} + v2.On("GetMetrics").Return(m2, nil) + tp1Volumes := map[string]volume.Volume{ + "v1": v1, + "v2": v2, + } + statsPr.On("ListVolumesForPod", types.UID("testpod1")).Return(tp1Volumes, true) + + // Mock volumes for pod2 + m3 := &volume.Metrics{ + Available: resource.NewQuantity(800, resource.DecimalSI), + Used: resource.NewQuantity(900, resource.DecimalSI), + Capacity: resource.NewQuantity(1800, resource.DecimalSI), + } + v3 := &volume.MockVolume{} + v3.On("GetMetrics").Return(m3, nil) + v4 := &volume.MockVolume{} + v4.On("GetMetrics").Return(nil, fmt.Errorf("Error calculating stats")) + tp2Volumes := map[string]volume.Volume{ + "v3": v3, + "v4": v4, + } + statsPr.On("ListVolumesForPod", types.UID("testpod2")).Return(tp2Volumes, true) + + instance.updateCachedPodVolumeStats() + + actual1, found := instance.GetPodVolumeStats("testpod1") + assert.True(t, found) + assert.Len(t, actual1.Volumes, 2) + v1available := uint64(100) + v1used := uint64(200) + v1capacity := uint64(400) + assert.Contains(t, actual1.Volumes, VolumeStats{ + Name: "v1", + FsStats: FsStats{ + AvailableBytes: &v1available, + UsedBytes: &v1used, + CapacityBytes: &v1capacity, + }, + }) + + v2available := uint64(600) + v2used := uint64(700) + v2capacity := uint64(1400) + assert.Contains(t, actual1.Volumes, VolumeStats{ + Name: "v2", + FsStats: FsStats{ + AvailableBytes: &v2available, + UsedBytes: &v2used, + CapacityBytes: &v2capacity, + }, + }) + + v3available := uint64(800) + v3used := uint64(900) + v3capacity := uint64(1800) + actual2, found := instance.GetPodVolumeStats("testpod2") + assert.True(t, found) + assert.Len(t, actual2.Volumes, 1) + assert.Contains(t, actual2.Volumes, VolumeStats{ + Name: "v3", + FsStats: FsStats{ + AvailableBytes: &v3available, + UsedBytes: &v3used, + CapacityBytes: &v3capacity, + }, + }) + + // Make sure the cache gets updated. The mocking libraries have trouble + pods = []*api.Pod{ + {ObjectMeta: api.ObjectMeta{UID: "testpod3"}}, + } + statsPr.On("GetPods").Return(pods) + + // pod3 volumes + m1 = &volume.Metrics{ + Available: resource.NewQuantity(150, resource.DecimalSI), + Used: resource.NewQuantity(200, resource.DecimalSI), + Capacity: resource.NewQuantity(600, resource.DecimalSI), + } + v1 = &volume.MockVolume{} + v1.On("GetMetrics").Return(m1, nil) + + tp1Volumes = map[string]volume.Volume{ + "v1": v1, + } + statsPr.On("ListVolumesForPod", types.UID("testpod3")).Return(tp1Volumes, true) +} diff --git a/pkg/kubelet/server/stats/handler.go b/pkg/kubelet/server/stats/handler.go index 2bbfc9128f1..2175f3eca37 100644 --- a/pkg/kubelet/server/stats/handler.go +++ b/pkg/kubelet/server/stats/handler.go @@ -27,25 +27,36 @@ import ( "github.com/emicklei/go-restful" "github.com/golang/glog" cadvisorapi "github.com/google/cadvisor/info/v1" + cadvisorapiv2 "github.com/google/cadvisor/info/v2" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/kubelet/cm" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/types" + "k8s.io/kubernetes/pkg/volume" ) // Host methods required by stats handlers. type StatsProvider interface { GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) + GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) GetPodByName(namespace, name string) (*api.Pod, bool) + GetNode() (*api.Node, error) + GetNodeConfig() cm.NodeConfig + DockerImagesFsInfo() (cadvisorapiv2.FsInfo, error) + RootFsInfo() (cadvisorapiv2.FsInfo, error) + ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) + GetPods() []*api.Pod } type handler struct { - provider StatsProvider + provider StatsProvider + summaryProvider SummaryProvider } -func CreateHandlers(provider StatsProvider) *restful.WebService { - h := &handler{provider} +func CreateHandlers(provider StatsProvider, resourceAnalyzer ResourceAnalyzer) *restful.WebService { + h := &handler{provider, NewSummaryProvider(provider, resourceAnalyzer)} ws := &restful.WebService{} ws.Path("/stats/"). @@ -137,11 +148,12 @@ func (h *handler) handleStats(request *restful.Request, response *restful.Respon // Handles stats summary requests to /stats/summary func (h *handler) handleSummary(request *restful.Request, response *restful.Response) { - summary := Summary{} - - // TODO(timstclair): Fill in summary from cAdvisor v2 endpoint. - - writeResponse(response, summary) + summary, err := h.summaryProvider.Get() + if err != nil { + handleError(response, err) + } else { + writeResponse(response, summary) + } } // Handles non-kubernetes container stats requests to /stats/container/ diff --git a/pkg/kubelet/server/stats/mock_stats_provider.go b/pkg/kubelet/server/stats/mock_stats_provider.go new file mode 100644 index 00000000000..b95a823d250 --- /dev/null +++ b/pkg/kubelet/server/stats/mock_stats_provider.go @@ -0,0 +1,244 @@ +/* +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. +*/ + +package stats + +import "github.com/stretchr/testify/mock" + +import cadvisorapi "github.com/google/cadvisor/info/v1" +import cadvisorapiv2 "github.com/google/cadvisor/info/v2" +import "k8s.io/kubernetes/pkg/api" +import "k8s.io/kubernetes/pkg/kubelet/cm" + +import "k8s.io/kubernetes/pkg/types" +import "k8s.io/kubernetes/pkg/volume" + +// DO NOT EDIT +// GENERATED BY mockery + +type MockStatsProvider struct { + mock.Mock +} + +// GetContainerInfo provides a mock function with given fields: podFullName, uid, containerName, req +func (_m *MockStatsProvider) GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) { + ret := _m.Called(podFullName, uid, containerName, req) + + var r0 *cadvisorapi.ContainerInfo + if rf, ok := ret.Get(0).(func(string, types.UID, string, *cadvisorapi.ContainerInfoRequest) *cadvisorapi.ContainerInfo); ok { + r0 = rf(podFullName, uid, containerName, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cadvisorapi.ContainerInfo) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string, types.UID, string, *cadvisorapi.ContainerInfoRequest) error); ok { + r1 = rf(podFullName, uid, containerName, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetContainerInfoV2 provides a mock function with given fields: name, options +func (_m *MockStatsProvider) GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { + ret := _m.Called(name, options) + + var r0 map[string]cadvisorapiv2.ContainerInfo + if rf, ok := ret.Get(0).(func(string, cadvisorapiv2.RequestOptions) map[string]cadvisorapiv2.ContainerInfo); ok { + r0 = rf(name, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]cadvisorapiv2.ContainerInfo) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string, cadvisorapiv2.RequestOptions) error); ok { + r1 = rf(name, options) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetRawContainerInfo provides a mock function with given fields: containerName, req, subcontainers +func (_m *MockStatsProvider) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) { + ret := _m.Called(containerName, req, subcontainers) + + var r0 map[string]*cadvisorapi.ContainerInfo + if rf, ok := ret.Get(0).(func(string, *cadvisorapi.ContainerInfoRequest, bool) map[string]*cadvisorapi.ContainerInfo); ok { + r0 = rf(containerName, req, subcontainers) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]*cadvisorapi.ContainerInfo) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string, *cadvisorapi.ContainerInfoRequest, bool) error); ok { + r1 = rf(containerName, req, subcontainers) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetPodByName provides a mock function with given fields: namespace, name +func (_m *MockStatsProvider) GetPodByName(namespace string, name string) (*api.Pod, bool) { + ret := _m.Called(namespace, name) + + var r0 *api.Pod + if rf, ok := ret.Get(0).(func(string, string) *api.Pod); ok { + r0 = rf(namespace, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*api.Pod) + } + } + + var r1 bool + if rf, ok := ret.Get(1).(func(string, string) bool); ok { + r1 = rf(namespace, name) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// GetNode provides a mock function with given fields: +func (_m *MockStatsProvider) GetNode() (*api.Node, error) { + ret := _m.Called() + + var r0 *api.Node + if rf, ok := ret.Get(0).(func() *api.Node); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*api.Node) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetNodeConfig provides a mock function with given fields: +func (_m *MockStatsProvider) GetNodeConfig() cm.NodeConfig { + ret := _m.Called() + + var r0 cm.NodeConfig + if rf, ok := ret.Get(0).(func() cm.NodeConfig); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(cm.NodeConfig) + } + + return r0 +} + +// DockerImagesFsInfo provides a mock function with given fields: +func (_m *MockStatsProvider) DockerImagesFsInfo() (cadvisorapiv2.FsInfo, error) { + ret := _m.Called() + + var r0 cadvisorapiv2.FsInfo + if rf, ok := ret.Get(0).(func() cadvisorapiv2.FsInfo); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(cadvisorapiv2.FsInfo) + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RootFsInfo provides a mock function with given fields: +func (_m *MockStatsProvider) RootFsInfo() (cadvisorapiv2.FsInfo, error) { + ret := _m.Called() + + var r0 cadvisorapiv2.FsInfo + if rf, ok := ret.Get(0).(func() cadvisorapiv2.FsInfo); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(cadvisorapiv2.FsInfo) + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListVolumesForPod provides a mock function with given fields: podUID +func (_m *MockStatsProvider) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) { + ret := _m.Called(podUID) + + var r0 map[string]volume.Volume + if rf, ok := ret.Get(0).(func(types.UID) map[string]volume.Volume); ok { + r0 = rf(podUID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]volume.Volume) + } + } + + var r1 bool + if rf, ok := ret.Get(1).(func(types.UID) bool); ok { + r1 = rf(podUID) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// GetPods provides a mock function with given fields: +func (_m *MockStatsProvider) GetPods() []*api.Pod { + ret := _m.Called() + + var r0 []*api.Pod + if rf, ok := ret.Get(0).(func() []*api.Pod); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*api.Pod) + } + } + + return r0 +} diff --git a/pkg/kubelet/server/stats/resource_analyzer.go b/pkg/kubelet/server/stats/resource_analyzer.go new file mode 100644 index 00000000000..34f05d75afb --- /dev/null +++ b/pkg/kubelet/server/stats/resource_analyzer.go @@ -0,0 +1,43 @@ +/* +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. +*/ + +package stats + +import "time" + +// ResourceAnalyzer provides statistics on node resource consumption +type ResourceAnalyzer interface { + Start() + + fsResourceAnalyzerInterface +} + +// resourceAnalyzer implements ResourceAnalyzer +type resourceAnalyzer struct { + *fsResourceAnalyzer +} + +var _ ResourceAnalyzer = &resourceAnalyzer{} + +// NewResourceAnalyzer returns a new ResourceAnalyzer +func NewResourceAnalyzer(statsProvider StatsProvider, calVolumeFrequency time.Duration) ResourceAnalyzer { + return &resourceAnalyzer{newFsResourceAnalyzer(statsProvider, calVolumeFrequency)} +} + +// Start starts background functions necessary for the ResourceAnalyzer to function +func (ra *resourceAnalyzer) Start() { + ra.fsResourceAnalyzer.Start() +} diff --git a/pkg/kubelet/server/stats/summary.go b/pkg/kubelet/server/stats/summary.go new file mode 100644 index 00000000000..4f5fba9a17b --- /dev/null +++ b/pkg/kubelet/server/stats/summary.go @@ -0,0 +1,360 @@ +/* +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. +*/ + +package stats + +import ( + "fmt" + "runtime" + "time" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/kubelet/cm" + "k8s.io/kubernetes/pkg/kubelet/dockertools" + "k8s.io/kubernetes/pkg/kubelet/leaky" + "k8s.io/kubernetes/pkg/types" + + "github.com/golang/glog" + cadvisorapiv1 "github.com/google/cadvisor/info/v1" + cadvisorapiv2 "github.com/google/cadvisor/info/v2" +) + +type SummaryProvider interface { + // Get provides a new Summary using the latest results from cadvisor + Get() (*Summary, error) +} + +type summaryProviderImpl struct { + provider StatsProvider + resourceAnalyzer ResourceAnalyzer +} + +var _ SummaryProvider = &summaryProviderImpl{} + +// NewSummaryProvider returns a new SummaryProvider +func NewSummaryProvider(statsProvider StatsProvider, resourceAnalyzer ResourceAnalyzer) SummaryProvider { + stackBuff := []byte{} + runtime.Stack(stackBuff, false) + return &summaryProviderImpl{statsProvider, resourceAnalyzer} +} + +// Get implements the SummaryProvider interface +// Query cadvisor for the latest resource metrics and build into a summary +func (sp *summaryProviderImpl) Get() (*Summary, error) { + options := cadvisorapiv2.RequestOptions{ + IdType: cadvisorapiv2.TypeName, + Count: 2, // 2 samples are needed to compute "instantaneous" CPU + Recursive: true, + } + infos, err := sp.provider.GetContainerInfoV2("/", options) + if err != nil { + return nil, err + } + + node, err := sp.provider.GetNode() + if err != nil { + return nil, err + } + + nodeConfig := sp.provider.GetNodeConfig() + rootFsInfo, err := sp.provider.RootFsInfo() + if err != nil { + return nil, err + } + imageFsInfo, err := sp.provider.DockerImagesFsInfo() + if err != nil { + return nil, err + } + + sb := &summaryBuilder{sp.resourceAnalyzer, node, nodeConfig, rootFsInfo, imageFsInfo, infos} + return sb.build() +} + +// summaryBuilder aggregates the datastructures provided by cadvisor into a Summary result +type summaryBuilder struct { + resourceAnalyzer ResourceAnalyzer + node *api.Node + nodeConfig cm.NodeConfig + rootFsInfo cadvisorapiv2.FsInfo + imageFsInfo cadvisorapiv2.FsInfo + infos map[string]cadvisorapiv2.ContainerInfo +} + +// build returns a Summary from aggregating the input data +func (sb *summaryBuilder) build() (*Summary, error) { + rootInfo, found := sb.infos["/"] + if !found { + return nil, fmt.Errorf("Missing stats for root container") + } + cstat, found := sb.latestContainerStats(&rootInfo) + if !found { + return nil, fmt.Errorf("Missing stats for root container") + } + + rootStats := sb.containerInfoV2ToStats("", &rootInfo) + nodeStats := NodeStats{ + NodeName: sb.node.Name, + CPU: rootStats.CPU, + Memory: rootStats.Memory, + Network: sb.containerInfoV2ToNetworkStats(&rootInfo), + Fs: &FsStats{ + AvailableBytes: &sb.rootFsInfo.Available, + CapacityBytes: &sb.rootFsInfo.Capacity, + UsedBytes: &sb.rootFsInfo.Usage}, + StartTime: rootStats.StartTime, + } + + systemContainers := map[string]string{ + SystemContainerKubelet: sb.nodeConfig.KubeletContainerName, + SystemContainerRuntime: sb.nodeConfig.DockerDaemonContainerName, // TODO: add support for other runtimes + SystemContainerMisc: sb.nodeConfig.SystemContainerName, + } + for sys, name := range systemContainers { + if info, ok := sb.infos[name]; ok { + nodeStats.SystemContainers = append(nodeStats.SystemContainers, sb.containerInfoV2ToStats(sys, &info)) + } + } + + summary := Summary{ + Time: unversioned.NewTime(cstat.Timestamp), + Node: nodeStats, + Pods: sb.buildSummaryPods(), + } + return &summary, nil +} + +// containerInfoV2FsStats populates the container fs stats +func (sb *summaryBuilder) containerInfoV2FsStats( + info *cadvisorapiv2.ContainerInfo, + cs *ContainerStats) { + + // The container logs live on the node rootfs device + cs.Logs = &FsStats{ + AvailableBytes: &sb.rootFsInfo.Available, + CapacityBytes: &sb.rootFsInfo.Capacity, + } + + // The container rootFs lives on the imageFs devices (which may not be the node root fs) + cs.Rootfs = &FsStats{ + AvailableBytes: &sb.imageFsInfo.Available, + CapacityBytes: &sb.imageFsInfo.Capacity, + } + + lcs, found := sb.latestContainerStats(info) + if !found { + return + } + cfs := lcs.Filesystem + if cfs != nil && cfs.BaseUsageBytes != nil { + rootfsUsage := *cfs.BaseUsageBytes + cs.Rootfs.UsedBytes = &rootfsUsage + if cfs.TotalUsageBytes != nil { + logsUsage := *cfs.TotalUsageBytes - *cfs.BaseUsageBytes + cs.Logs.UsedBytes = &logsUsage + } + } +} + +// latestContainerStats returns the latest container stats from cadvisor, or nil if none exist +func (sb *summaryBuilder) latestContainerStats(info *cadvisorapiv2.ContainerInfo) (*cadvisorapiv2.ContainerStats, bool) { + stats := info.Stats + if len(stats) < 1 { + return nil, false + } + latest := stats[len(stats)-1] + if latest == nil { + return nil, false + } + return latest, true +} + +// buildSummaryPods aggregates and returns the container stats in cinfos by the Pod managing the container. +// Containers not managed by a Pod are omitted. +func (sb *summaryBuilder) buildSummaryPods() []PodStats { + // Map each container to a pod and update the PodStats with container data + podToStats := map[PodReference]*PodStats{} + for _, cinfo := range sb.infos { + // Build the Pod key if this container is managed by a Pod + if !sb.isPodManagedContainer(&cinfo) { + continue + } + ref := sb.buildPodRef(&cinfo) + + // Lookup the PodStats for the pod using the PodRef. If none exists, initialize a new entry. + stats, found := podToStats[ref] + if !found { + stats = &PodStats{PodRef: ref} + podToStats[ref] = stats + } + + // Update the PodStats entry with the stats from the container by adding it to stats.Containers + containerName := dockertools.GetContainerName(cinfo.Spec.Labels) + if containerName == leaky.PodInfraContainerName { + // Special case for infrastructure container which is hidden from the user and has network stats + stats.Network = sb.containerInfoV2ToNetworkStats(&cinfo) + stats.StartTime = unversioned.NewTime(cinfo.Spec.CreationTime) + } else { + stats.Containers = append(stats.Containers, sb.containerInfoV2ToStats(containerName, &cinfo)) + } + } + + // Add each PodStats to the result + result := make([]PodStats, 0, len(podToStats)) + for _, stats := range podToStats { + // Lookup the volume stats for each pod + podUID := types.UID(stats.PodRef.UID) + if vstats, found := sb.resourceAnalyzer.GetPodVolumeStats(podUID); found { + stats.VolumeStats = vstats.Volumes + } + result = append(result, *stats) + } + return result +} + +// buildPodRef returns a PodReference that identifies the Pod managing cinfo +func (sb *summaryBuilder) buildPodRef(cinfo *cadvisorapiv2.ContainerInfo) PodReference { + podName := dockertools.GetPodName(cinfo.Spec.Labels) + podNamespace := dockertools.GetPodNamespace(cinfo.Spec.Labels) + podUID := dockertools.GetPodUID(cinfo.Spec.Labels) + return PodReference{Name: podName, Namespace: podNamespace, UID: podUID} +} + +// isPodManagedContainer returns true if the cinfo container is managed by a Pod +func (sb *summaryBuilder) isPodManagedContainer(cinfo *cadvisorapiv2.ContainerInfo) bool { + podName := dockertools.GetPodName(cinfo.Spec.Labels) + podNamespace := dockertools.GetPodNamespace(cinfo.Spec.Labels) + managed := podName != "" && podNamespace != "" + if !managed && podName != podNamespace { + glog.Warningf( + "Expect container to have either both podName (%s) and podNamespace (%s) labels, or neither.", + podName, podNamespace) + } + return managed +} + +func (sb *summaryBuilder) containerInfoV2ToStats( + name string, + info *cadvisorapiv2.ContainerInfo) ContainerStats { + stats := ContainerStats{ + Name: name, + StartTime: unversioned.NewTime(info.Spec.CreationTime), + } + cstat, found := sb.latestContainerStats(info) + if !found { + return stats + } + if info.Spec.HasCpu { + cpuStats := CPUStats{} + if cstat.CpuInst != nil { + cpuStats.UsageNanoCores = &cstat.CpuInst.Usage.Total + } + if cstat.Cpu != nil { + cpuStats.UsageCoreNanoSeconds = &cstat.Cpu.Usage.Total + } + stats.CPU = &cpuStats + } + if info.Spec.HasMemory { + pageFaults := cstat.Memory.ContainerData.Pgfault + majorPageFaults := cstat.Memory.ContainerData.Pgmajfault + stats.Memory = &MemoryStats{ + UsageBytes: &cstat.Memory.Usage, + WorkingSetBytes: &cstat.Memory.WorkingSet, + PageFaults: &pageFaults, + MajorPageFaults: &majorPageFaults, + } + } + sb.containerInfoV2FsStats(info, &stats) + stats.UserDefinedMetrics = sb.containerInfoV2ToUserDefinedMetrics(info) + return stats +} + +func (sb *summaryBuilder) containerInfoV2ToNetworkStats(info *cadvisorapiv2.ContainerInfo) *NetworkStats { + if !info.Spec.HasNetwork { + return nil + } + cstat, found := sb.latestContainerStats(info) + if !found { + return nil + } + var ( + rxBytes uint64 + rxErrors uint64 + txBytes uint64 + txErrors uint64 + ) + // TODO(stclair): check for overflow + for _, inter := range cstat.Network.Interfaces { + rxBytes += inter.RxBytes + rxErrors += inter.RxErrors + txBytes += inter.TxBytes + txErrors += inter.TxErrors + } + return &NetworkStats{ + RxBytes: &rxBytes, + RxErrors: &rxErrors, + TxBytes: &txBytes, + TxErrors: &txErrors, + } +} + +func (sb *summaryBuilder) containerInfoV2ToUserDefinedMetrics(info *cadvisorapiv2.ContainerInfo) []UserDefinedMetric { + type specVal struct { + ref UserDefinedMetricDescriptor + valType cadvisorapiv1.DataType + time time.Time + value float64 + } + udmMap := map[string]*specVal{} + for _, spec := range info.Spec.CustomMetrics { + udmMap[spec.Name] = &specVal{ + ref: UserDefinedMetricDescriptor{ + Name: spec.Name, + Type: UserDefinedMetricType(spec.Type), + Units: spec.Units, + }, + valType: spec.Format, + } + } + for _, stat := range info.Stats { + for name, values := range stat.CustomMetrics { + specVal, ok := udmMap[name] + if !ok { + glog.Warningf("spec for custom metric %q is missing from cAdvisor output. Spec: %+v, Metrics: %+v", name, info.Spec, stat.CustomMetrics) + continue + } + for _, value := range values { + // Pick the most recent value + if value.Timestamp.Before(specVal.time) { + continue + } + specVal.time = value.Timestamp + specVal.value = value.FloatValue + if specVal.valType == cadvisorapiv1.IntType { + specVal.value = float64(value.IntValue) + } + } + } + } + var udm []UserDefinedMetric + for _, specVal := range udmMap { + udm = append(udm, UserDefinedMetric{ + UserDefinedMetricDescriptor: specVal.ref, + Value: specVal.value, + }) + } + return udm +} diff --git a/pkg/kubelet/server/stats/summary_test.go b/pkg/kubelet/server/stats/summary_test.go new file mode 100644 index 00000000000..1a8c4955bda --- /dev/null +++ b/pkg/kubelet/server/stats/summary_test.go @@ -0,0 +1,354 @@ +/* +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. +*/ + +package stats + +import ( + "testing" + "time" + + "github.com/google/cadvisor/info/v1" + "github.com/google/cadvisor/info/v2" + fuzz "github.com/google/gofuzz" + "github.com/stretchr/testify/assert" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/kubelet/cm" + "k8s.io/kubernetes/pkg/kubelet/leaky" +) + +const ( + // Offsets from seed value in generated container stats. + offsetCPUUsageCores = iota + offsetCPUUsageCoreSeconds + offsetMemPageFaults + offsetMemMajorPageFaults + offsetMemUsageBytes + offsetMemWorkingSetBytes + offsetNetRxBytes + offsetNetRxErrors + offsetNetTxBytes + offsetNetTxErrors +) + +func TestBuildSummary(t *testing.T) { + node := api.Node{} + node.Name = "FooNode" + nodeConfig := cm.NodeConfig{ + DockerDaemonContainerName: "/docker-daemon", + SystemContainerName: "/system", + KubeletContainerName: "/kubelet", + } + const ( + namespace0 = "test0" + namespace2 = "test2" + ) + const ( + seedRoot = 0 + seedRuntime = 100 + seedKubelet = 200 + seedMisc = 300 + seedPod0Infra = 1000 + seedPod0Container0 = 2000 + seedPod0Container1 = 2001 + seedPod1Infra = 3000 + seedPod1Container = 4000 + seedPod2Infra = 5000 + seedPod2Container = 6000 + ) + const ( + pName0 = "pod0" + pName1 = "pod1" + pName2 = "pod0" // ensure pName2 conflicts with pName0, but is in a different namespace + ) + const ( + cName00 = "c0" + cName01 = "c1" + cName10 = "c0" // ensure cName10 conflicts with cName02, but is in a different pod + cName20 = "c1" // ensure cName20 conflicts with cName01, but is in a different pod + namespace + ) + + prf0 := PodReference{Name: pName0, Namespace: namespace0, UID: "UID" + pName0} + prf1 := PodReference{Name: pName1, Namespace: namespace0, UID: "UID" + pName1} + prf2 := PodReference{Name: pName2, Namespace: namespace2, UID: "UID" + pName2} + infos := map[string]v2.ContainerInfo{ + "/": summaryTestContainerInfo(seedRoot, "", "", ""), + "/docker-daemon": summaryTestContainerInfo(seedRuntime, "", "", ""), + "/kubelet": summaryTestContainerInfo(seedKubelet, "", "", ""), + "/system": summaryTestContainerInfo(seedMisc, "", "", ""), + // Pod0 - Namespace0 + "/pod0-i": summaryTestContainerInfo(seedPod0Infra, pName0, namespace0, leaky.PodInfraContainerName), + "/pod0-c0": summaryTestContainerInfo(seedPod0Container0, pName0, namespace0, cName00), + "/pod0-c2": summaryTestContainerInfo(seedPod0Container1, pName0, namespace0, cName01), + // Pod1 - Namespace0 + "/pod1-i": summaryTestContainerInfo(seedPod1Infra, pName1, namespace0, leaky.PodInfraContainerName), + "/pod1-c0": summaryTestContainerInfo(seedPod1Container, pName1, namespace0, cName10), + // Pod2 - Namespace2 + "/pod2-i": summaryTestContainerInfo(seedPod2Infra, pName2, namespace2, leaky.PodInfraContainerName), + "/pod2-c0": summaryTestContainerInfo(seedPod2Container, pName2, namespace2, cName20), + } + + rootfs := v2.FsInfo{} + imagefs := v2.FsInfo{} + + sb := &summaryBuilder{ + newFsResourceAnalyzer(&MockStatsProvider{}, time.Minute*5), &node, nodeConfig, rootfs, imagefs, infos} + summary, err := sb.build() + + assert.NoError(t, err) + nodeStats := summary.Node + assert.Equal(t, "FooNode", nodeStats.NodeName) + checkCPUStats(t, "Node", seedRoot, nodeStats.CPU) + checkMemoryStats(t, "Node", seedRoot, nodeStats.Memory) + checkNetworkStats(t, "Node", seedRoot, nodeStats.Network) + + systemSeeds := map[string]int{ + SystemContainerRuntime: seedRuntime, + SystemContainerKubelet: seedKubelet, + SystemContainerMisc: seedMisc, + } + for _, sys := range nodeStats.SystemContainers { + name := sys.Name + seed, found := systemSeeds[name] + if !found { + t.Errorf("Unknown SystemContainer: %q", name) + } + checkCPUStats(t, name, seed, sys.CPU) + checkMemoryStats(t, name, seed, sys.Memory) + } + + assert.Equal(t, 3, len(summary.Pods)) + indexPods := make(map[PodReference]PodStats, len(summary.Pods)) + for _, pod := range summary.Pods { + indexPods[pod.PodRef] = pod + } + + // Validate Pod0 Results + ps, found := indexPods[prf0] + assert.True(t, found) + assert.Len(t, ps.Containers, 2) + indexCon := make(map[string]ContainerStats, len(ps.Containers)) + for _, con := range ps.Containers { + indexCon[con.Name] = con + } + con := indexCon[cName00] + checkCPUStats(t, "container", seedPod0Container0, con.CPU) + checkMemoryStats(t, "container", seedPod0Container0, con.Memory) + + con = indexCon[cName01] + checkCPUStats(t, "container", seedPod0Container1, con.CPU) + checkMemoryStats(t, "container", seedPod0Container1, con.Memory) + + checkNetworkStats(t, "Pod", seedPod0Infra, ps.Network) + + // Validate Pod1 Results + ps, found = indexPods[prf1] + assert.True(t, found) + assert.Len(t, ps.Containers, 1) + con = ps.Containers[0] + assert.Equal(t, cName10, con.Name) + checkCPUStats(t, "container", seedPod1Container, con.CPU) + checkMemoryStats(t, "container", seedPod1Container, con.Memory) + checkNetworkStats(t, "Pod", seedPod1Infra, ps.Network) + + // Validate Pod2 Results + ps, found = indexPods[prf2] + assert.True(t, found) + assert.Len(t, ps.Containers, 1) + con = ps.Containers[0] + assert.Equal(t, cName20, con.Name) + checkCPUStats(t, "container", seedPod2Container, con.CPU) + checkMemoryStats(t, "container", seedPod2Container, con.Memory) + checkNetworkStats(t, "Pod", seedPod2Infra, ps.Network) +} + +func generateCustomMetricSpec() []v1.MetricSpec { + f := fuzz.New().NilChance(0).Funcs( + func(e *v1.MetricSpec, c fuzz.Continue) { + c.Fuzz(&e.Name) + switch c.Intn(3) { + case 0: + e.Type = v1.MetricGauge + case 1: + e.Type = v1.MetricCumulative + case 2: + e.Type = v1.MetricDelta + } + switch c.Intn(2) { + case 0: + e.Format = v1.IntType + case 1: + e.Format = v1.FloatType + } + c.Fuzz(&e.Units) + }) + var ret []v1.MetricSpec + f.Fuzz(&ret) + return ret +} + +func generateCustomMetrics(spec []v1.MetricSpec) map[string][]v1.MetricVal { + ret := map[string][]v1.MetricVal{} + for _, metricSpec := range spec { + f := fuzz.New().NilChance(0).Funcs( + func(e *v1.MetricVal, c fuzz.Continue) { + switch metricSpec.Format { + case v1.IntType: + c.Fuzz(&e.IntValue) + case v1.FloatType: + c.Fuzz(&e.FloatValue) + } + }) + + var metrics []v1.MetricVal + f.Fuzz(&metrics) + ret[metricSpec.Name] = metrics + } + return ret +} + +func summaryTestContainerInfo(seed int, podName string, podNamespace string, containerName string) v2.ContainerInfo { + labels := map[string]string{} + if podName != "" { + labels = map[string]string{ + "io.kubernetes.pod.name": podName, + "io.kubernetes.pod.uid": "UID" + podName, + "io.kubernetes.pod.namespace": podNamespace, + "io.kubernetes.container.name": containerName, + } + } + spec := v2.ContainerSpec{ + HasCpu: true, + HasMemory: true, + HasNetwork: true, + Labels: labels, + CustomMetrics: generateCustomMetricSpec(), + } + + stats := v2.ContainerStats{ + Cpu: &v1.CpuStats{}, + CpuInst: &v2.CpuInstStats{}, + Memory: &v1.MemoryStats{ + Usage: uint64(seed + offsetMemUsageBytes), + WorkingSet: uint64(seed + offsetMemWorkingSetBytes), + ContainerData: v1.MemoryStatsMemoryData{ + Pgfault: uint64(seed + offsetMemPageFaults), + Pgmajfault: uint64(seed + offsetMemMajorPageFaults), + }, + }, + Network: &v2.NetworkStats{ + Interfaces: []v1.InterfaceStats{{ + RxBytes: uint64(seed + offsetNetRxBytes), + RxErrors: uint64(seed + offsetNetRxErrors), + TxBytes: uint64(seed + offsetNetTxBytes), + TxErrors: uint64(seed + offsetNetTxErrors), + }}, + }, + CustomMetrics: generateCustomMetrics(spec.CustomMetrics), + } + stats.Cpu.Usage.Total = uint64(seed + offsetCPUUsageCoreSeconds) + stats.CpuInst.Usage.Total = uint64(seed + offsetCPUUsageCores) + return v2.ContainerInfo{ + Spec: spec, + Stats: []*v2.ContainerStats{&stats}, + } +} + +func checkNetworkStats(t *testing.T, label string, seed int, stats *NetworkStats) { + assert.EqualValues(t, seed+offsetNetRxBytes, *stats.RxBytes, label+".Net.RxBytes") + assert.EqualValues(t, seed+offsetNetRxErrors, *stats.RxErrors, label+".Net.RxErrors") + assert.EqualValues(t, seed+offsetNetTxBytes, *stats.TxBytes, label+".Net.TxBytes") + assert.EqualValues(t, seed+offsetNetTxErrors, *stats.TxErrors, label+".Net.TxErrors") +} + +func checkCPUStats(t *testing.T, label string, seed int, stats *CPUStats) { + assert.EqualValues(t, seed+offsetCPUUsageCores, *stats.UsageNanoCores, label+".CPU.UsageCores") + assert.EqualValues(t, seed+offsetCPUUsageCoreSeconds, *stats.UsageCoreNanoSeconds, label+".CPU.UsageCoreSeconds") +} + +func checkMemoryStats(t *testing.T, label string, seed int, stats *MemoryStats) { + assert.EqualValues(t, seed+offsetMemUsageBytes, *stats.UsageBytes, label+".Mem.UsageBytes") + assert.EqualValues(t, seed+offsetMemWorkingSetBytes, *stats.WorkingSetBytes, label+".Mem.WorkingSetBytes") + assert.EqualValues(t, seed+offsetMemPageFaults, *stats.PageFaults, label+".Mem.PageFaults") + assert.EqualValues(t, seed+offsetMemMajorPageFaults, *stats.MajorPageFaults, label+".Mem.MajorPageFaults") +} + +func TestCustomMetrics(t *testing.T) { + spec := []v1.MetricSpec{ + { + Name: "qos", + Type: v1.MetricGauge, + Format: v1.IntType, + Units: "per second", + }, + { + Name: "cpuLoad", + Type: v1.MetricCumulative, + Format: v1.FloatType, + Units: "count", + }, + } + metrics := map[string][]v1.MetricVal{ + "qos": { + { + Timestamp: time.Now(), + IntValue: 10, + }, + { + Timestamp: time.Now().Add(time.Minute), + IntValue: 100, + }, + }, + "cpuLoad": { + { + Timestamp: time.Now(), + FloatValue: 1.2, + }, + { + Timestamp: time.Now().Add(time.Minute), + FloatValue: 2.1, + }, + }, + } + cInfo := v2.ContainerInfo{ + Spec: v2.ContainerSpec{ + CustomMetrics: spec, + }, + Stats: []*v2.ContainerStats{ + { + CustomMetrics: metrics, + }, + }, + } + sb := &summaryBuilder{} + assert.Contains(t, sb.containerInfoV2ToUserDefinedMetrics(&cInfo), + UserDefinedMetric{ + UserDefinedMetricDescriptor: UserDefinedMetricDescriptor{ + Name: "qos", + Type: MetricGauge, + Units: "per second", + }, + Value: 100, + }, + UserDefinedMetric{ + UserDefinedMetricDescriptor: UserDefinedMetricDescriptor{ + Name: "cpuLoad", + Type: MetricCumulative, + Units: "count", + }, + Value: 2.1, + }) +} diff --git a/pkg/kubelet/server/stats/types.go b/pkg/kubelet/server/stats/types.go index a75880d047e..017cc2936cb 100644 --- a/pkg/kubelet/server/stats/types.go +++ b/pkg/kubelet/server/stats/types.go @@ -91,7 +91,7 @@ type ContainerStats struct { // Stats pertaining to container logs usage of filesystem resources. // Logs.UsedBytes is the number of bytes used for the container logs. Logs *FsStats `json:"logs,omitempty"` - // User defined metrics are arbitrary metrics exposed by containers in pods. + // User defined metrics that are exposed by containers in the pod. Typically, we expect only one container in the pod to be exposing user defined metrics. In the event of multiple containers exposing metrics, they will be combined here. UserDefinedMetrics []UserDefinedMetric `json:"userDefinedMetrics,omitmepty" patchStrategy:"merge" patchMergeKey:"name"` } diff --git a/pkg/kubelet/status/manager.go b/pkg/kubelet/status/manager.go index 3cb3084ea6a..d991f6f619e 100644 --- a/pkg/kubelet/status/manager.go +++ b/pkg/kubelet/status/manager.go @@ -21,17 +21,19 @@ import ( "sync" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" - client "k8s.io/kubernetes/pkg/client/unversioned" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubepod "k8s.io/kubernetes/pkg/kubelet/pod" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) // A wrapper around api.PodStatus that includes a version to enforce that stale pod statuses are @@ -53,7 +55,7 @@ type podStatusSyncRequest struct { // Updates pod statuses in apiserver. Writes only when new status has changed. // All methods are thread-safe. type manager struct { - kubeClient client.Interface + kubeClient clientset.Interface podManager kubepod.Manager // Map from pod UID to sync status of the corresponding pod. podStatuses map[types.UID]versionedPodStatus @@ -93,7 +95,7 @@ type Manager interface { const syncPeriod = 10 * time.Second -func NewManager(kubeClient client.Interface, podManager kubepod.Manager) Manager { +func NewManager(kubeClient clientset.Interface, podManager kubepod.Manager) Manager { return &manager{ kubeClient: kubeClient, podManager: podManager, @@ -124,7 +126,7 @@ func (m *manager) Start() { glog.Info("Starting to sync pod status with apiserver") syncTicker := time.Tick(syncPeriod) // syncPod and syncBatch share the same go routine to avoid sync races. - go util.Forever(func() { + go wait.Forever(func() { select { case syncRequest := <-m.podStatusChannel: m.syncPod(syncRequest.podUID, syncRequest.status) @@ -346,7 +348,7 @@ func (m *manager) syncBatch() { // syncPod syncs the given status with the API server. The caller must not hold the lock. func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { // TODO: make me easier to express from client code - pod, err := m.kubeClient.Pods(status.podNamespace).Get(status.podName) + pod, err := m.kubeClient.Core().Pods(status.podNamespace).Get(status.podName) if errors.IsNotFound(err) { glog.V(3).Infof("Pod %q (%s) does not exist on the server", status.podName, uid) // If the Pod is deleted the status will be cleared in @@ -366,7 +368,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { } pod.Status = status.status // TODO: handle conflict as a retry, make that easier too. - pod, err = m.kubeClient.Pods(pod.Namespace).UpdateStatus(pod) + pod, err = m.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(pod) if err == nil { glog.V(3).Infof("Status for pod %q updated successfully: %+v", format.Pod(pod), status) m.apiStatusVersions[pod.UID] = status.version @@ -381,7 +383,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { glog.V(3).Infof("Pod %q is terminated, but some containers are still running", format.Pod(pod)) return } - if err := m.kubeClient.Pods(pod.Namespace).Delete(pod.Name, api.NewDeleteOptions(0)); err == nil { + if err := m.kubeClient.Core().Pods(pod.Namespace).Delete(pod.Name, api.NewDeleteOptions(0)); err == nil { glog.V(3).Infof("Pod %q fully terminated and removed from etcd", format.Pod(pod)) m.deletePodStatus(uid) return diff --git a/pkg/kubelet/status/manager_test.go b/pkg/kubelet/status/manager_test.go index 73fb5d43d83..2efd7e9c89b 100644 --- a/pkg/kubelet/status/manager_test.go +++ b/pkg/kubelet/status/manager_test.go @@ -23,13 +23,15 @@ import ( "testing" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" + "github.com/stretchr/testify/assert" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" - client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" kubepod "k8s.io/kubernetes/pkg/kubelet/pod" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" @@ -65,7 +67,7 @@ func (m *manager) testSyncBatch() { m.syncBatch() } -func newTestManager(kubeClient client.Interface) *manager { +func newTestManager(kubeClient clientset.Interface) *manager { podManager := kubepod.NewBasicPodManager(kubepod.NewFakeMirrorClient()) podManager.AddPod(getTestPod()) return NewManager(kubeClient, podManager).(*manager) @@ -81,8 +83,8 @@ func getRandomPodStatus() api.PodStatus { } } -func verifyActions(t *testing.T, kubeClient client.Interface, expectedActions []testclient.Action) { - actions := kubeClient.(*testclient.Fake).Actions() +func verifyActions(t *testing.T, kubeClient clientset.Interface, expectedActions []core.Action) { + actions := kubeClient.(*fake.Clientset).Actions() if len(actions) != len(expectedActions) { t.Fatalf("unexpected actions, got: %+v expected: %+v", actions, expectedActions) return @@ -119,7 +121,7 @@ func verifyUpdates(t *testing.T, manager *manager, expectedUpdates int) { } func TestNewStatus(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) testPod := getTestPod() syncer.SetPodStatus(testPod, getRandomPodStatus()) verifyUpdates(t, syncer, 1) @@ -131,7 +133,7 @@ func TestNewStatus(t *testing.T) { } func TestNewStatusPreservesPodStartTime(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ UID: "12345678", @@ -163,7 +165,7 @@ func getReadyPodStatus() api.PodStatus { } func TestNewStatusSetsReadyTransitionTime(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) podStatus := getReadyPodStatus() pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ @@ -183,7 +185,7 @@ func TestNewStatusSetsReadyTransitionTime(t *testing.T) { } func TestChangedStatus(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) testPod := getTestPod() syncer.SetPodStatus(testPod, getRandomPodStatus()) syncer.SetPodStatus(testPod, getRandomPodStatus()) @@ -191,7 +193,7 @@ func TestChangedStatus(t *testing.T) { } func TestChangedStatusKeepsStartTime(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) testPod := getTestPod() now := unversioned.Now() firstStatus := getRandomPodStatus() @@ -209,7 +211,7 @@ func TestChangedStatusKeepsStartTime(t *testing.T) { } func TestChangedStatusUpdatesLastTransitionTime(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) podStatus := getReadyPodStatus() pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ @@ -239,7 +241,7 @@ func TestChangedStatusUpdatesLastTransitionTime(t *testing.T) { } func TestUnchangedStatus(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) testPod := getTestPod() podStatus := getRandomPodStatus() syncer.SetPodStatus(testPod, podStatus) @@ -248,7 +250,7 @@ func TestUnchangedStatus(t *testing.T) { } func TestUnchangedStatusPreservesLastTransitionTime(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) podStatus := getReadyPodStatus() pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ @@ -278,61 +280,61 @@ func TestUnchangedStatusPreservesLastTransitionTime(t *testing.T) { } func TestSyncBatchIgnoresNotFound(t *testing.T) { - client := testclient.Fake{} + client := fake.Clientset{} syncer := newTestManager(&client) - client.AddReactor("get", "pods", func(action testclient.Action) (bool, runtime.Object, error) { + client.AddReactor("get", "pods", func(action core.Action) (bool, runtime.Object, error) { return true, nil, errors.NewNotFound(api.Resource("pods"), "test-pod") }) syncer.SetPodStatus(getTestPod(), getRandomPodStatus()) syncer.testSyncBatch() - verifyActions(t, syncer.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, + verifyActions(t, syncer.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, }) } func TestSyncBatch(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) testPod := getTestPod() - syncer.kubeClient = testclient.NewSimpleFake(testPod) + syncer.kubeClient = fake.NewSimpleClientset(testPod) syncer.SetPodStatus(testPod, getRandomPodStatus()) syncer.testSyncBatch() - verifyActions(t, syncer.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, syncer.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }, ) } func TestSyncBatchChecksMismatchedUID(t *testing.T) { - syncer := newTestManager(&testclient.Fake{}) + syncer := newTestManager(&fake.Clientset{}) pod := getTestPod() pod.UID = "first" syncer.podManager.AddPod(pod) differentPod := getTestPod() differentPod.UID = "second" syncer.podManager.AddPod(differentPod) - syncer.kubeClient = testclient.NewSimpleFake(pod) + syncer.kubeClient = fake.NewSimpleClientset(pod) syncer.SetPodStatus(differentPod, getRandomPodStatus()) syncer.testSyncBatch() - verifyActions(t, syncer.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, + verifyActions(t, syncer.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, }) } func TestSyncBatchNoDeadlock(t *testing.T) { - client := &testclient.Fake{} + client := &fake.Clientset{} m := newTestManager(client) pod := getTestPod() // Setup fake client. var ret api.Pod var err error - client.AddReactor("*", "pods", func(action testclient.Action) (bool, runtime.Object, error) { + client.AddReactor("*", "pods", func(action core.Action) (bool, runtime.Object, error) { switch action := action.(type) { - case testclient.GetAction: + case core.GetAction: assert.Equal(t, pod.Name, action.GetName(), "Unexpeted GetAction: %+v", action) - case testclient.UpdateAction: + case core.UpdateAction: assert.Equal(t, pod.Name, action.GetObject().(*api.Pod).Name, "Unexpeted UpdateAction: %+v", action) default: assert.Fail(t, "Unexpected Action: %+v", action) @@ -342,15 +344,15 @@ func TestSyncBatchNoDeadlock(t *testing.T) { pod.Status.ContainerStatuses = []api.ContainerStatus{{State: api.ContainerState{Running: &api.ContainerStateRunning{}}}} - getAction := testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}} - updateAction := testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}} + getAction := core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}} + updateAction := core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}} // Pod not found. ret = *pod err = errors.NewNotFound(api.Resource("pods"), pod.Name) m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction}) + verifyActions(t, client, []core.Action{getAction}) client.ClearActions() // Pod was recreated. @@ -358,21 +360,21 @@ func TestSyncBatchNoDeadlock(t *testing.T) { err = nil m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction}) + verifyActions(t, client, []core.Action{getAction}) client.ClearActions() // Pod not deleted (success case). ret = *pod m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction, updateAction}) + verifyActions(t, client, []core.Action{getAction, updateAction}) client.ClearActions() // Pod is terminated, but still running. pod.DeletionTimestamp = new(unversioned.Time) m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction, updateAction}) + verifyActions(t, client, []core.Action{getAction, updateAction}) client.ClearActions() // Pod is terminated successfully. @@ -380,20 +382,20 @@ func TestSyncBatchNoDeadlock(t *testing.T) { pod.Status.ContainerStatuses[0].State.Terminated = &api.ContainerStateTerminated{} m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction, updateAction}) + verifyActions(t, client, []core.Action{getAction, updateAction}) client.ClearActions() // Error case. err = fmt.Errorf("intentional test error") m.SetPodStatus(pod, getRandomPodStatus()) m.testSyncBatch() - verifyActions(t, client, []testclient.Action{getAction}) + verifyActions(t, client, []core.Action{getAction}) client.ClearActions() } func TestStaleUpdates(t *testing.T) { pod := getTestPod() - client := testclient.NewSimpleFake(pod) + client := fake.NewSimpleClientset(pod) m := newTestManager(client) status := api.PodStatus{Message: "initial status"} @@ -406,16 +408,16 @@ func TestStaleUpdates(t *testing.T) { t.Logf("First sync pushes latest status.") m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) client.ClearActions() for i := 0; i < 2; i++ { t.Logf("Next 2 syncs should be ignored (%d).", i) m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{}) + verifyActions(t, m.kubeClient, []core.Action{}) } t.Log("Unchanged status should not send an update.") @@ -427,9 +429,9 @@ func TestStaleUpdates(t *testing.T) { m.SetPodStatus(pod, status) m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) // Nothing stuck in the pipe. @@ -477,7 +479,7 @@ func TestStaticPodStatus(t *testing.T) { kubetypes.ConfigSourceAnnotationKey: "api", kubetypes.ConfigMirrorAnnotationKey: "mirror", } - client := testclient.NewSimpleFake(mirrorPod) + client := fake.NewSimpleClientset(mirrorPod) m := newTestManager(client) m.podManager.AddPod(staticPod) m.podManager.AddPod(mirrorPod) @@ -497,11 +499,11 @@ func TestStaticPodStatus(t *testing.T) { assert.True(t, isStatusEqual(&status, &retrievedStatus), "Expected: %+v, Got: %+v", status, retrievedStatus) // Should translate mirrorPod / staticPod UID. m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) - updateAction := client.Actions()[1].(testclient.UpdateActionImpl) + updateAction := client.Actions()[1].(core.UpdateActionImpl) updatedPod := updateAction.Object.(*api.Pod) assert.Equal(t, mirrorPod.UID, updatedPod.UID, "Expected mirrorPod (%q), but got %q", mirrorPod.UID, updatedPod.UID) assert.True(t, isStatusEqual(&status, &updatedPod.Status), "Expected: %+v, Got: %+v", status, updatedPod.Status) @@ -509,7 +511,7 @@ func TestStaticPodStatus(t *testing.T) { // No changes. m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{}) + verifyActions(t, m.kubeClient, []core.Action{}) // Mirror pod identity changes. m.podManager.DeletePod(mirrorPod) @@ -518,11 +520,11 @@ func TestStaticPodStatus(t *testing.T) { m.podManager.AddPod(mirrorPod) // Expect update to new mirrorPod. m.testSyncBatch() - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) - updateAction = client.Actions()[1].(testclient.UpdateActionImpl) + updateAction = client.Actions()[1].(core.UpdateActionImpl) updatedPod = updateAction.Object.(*api.Pod) assert.Equal(t, mirrorPod.UID, updatedPod.UID, "Expected mirrorPod (%q), but got %q", mirrorPod.UID, updatedPod.UID) assert.True(t, isStatusEqual(&status, &updatedPod.Status), "Expected: %+v, Got: %+v", status, updatedPod.Status) @@ -575,7 +577,7 @@ func TestSetContainerReadiness(t *testing.T) { } } - m := newTestManager(&testclient.Fake{}) + m := newTestManager(&fake.Clientset{}) t.Log("Setting readiness before status should fail.") m.SetContainerReadiness(pod, cID1, true) @@ -616,7 +618,7 @@ func TestSetContainerReadiness(t *testing.T) { } func TestSyncBatchCleanupVersions(t *testing.T) { - m := newTestManager(&testclient.Fake{}) + m := newTestManager(&fake.Clientset{}) testPod := getTestPod() mirrorPod := getTestPod() mirrorPod.UID = "mirror-uid" @@ -657,7 +659,7 @@ func TestSyncBatchCleanupVersions(t *testing.T) { func TestReconcilePodStatus(t *testing.T) { testPod := getTestPod() - client := testclient.NewSimpleFake(testPod) + client := fake.NewSimpleClientset(testPod) syncer := newTestManager(client) syncer.SetPodStatus(testPod, getRandomPodStatus()) // Call syncBatch directly to test reconcile @@ -677,7 +679,7 @@ func TestReconcilePodStatus(t *testing.T) { } client.ClearActions() syncer.syncBatch() - verifyActions(t, client, []testclient.Action{}) + verifyActions(t, client, []core.Action{}) // If the pod status is the same, only the timestamp is in Rfc3339 format (lower precision without nanosecond), // a reconciliation is not needed, syncBatch should do nothing. @@ -691,7 +693,7 @@ func TestReconcilePodStatus(t *testing.T) { } client.ClearActions() syncer.syncBatch() - verifyActions(t, client, []testclient.Action{}) + verifyActions(t, client, []core.Action{}) // If the pod status is different, a reconciliation is needed, syncBatch should trigger an update testPod.Status = getRandomPodStatus() @@ -701,9 +703,9 @@ func TestReconcilePodStatus(t *testing.T) { } client.ClearActions() syncer.syncBatch() - verifyActions(t, client, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, client, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) } @@ -719,7 +721,7 @@ func TestDeletePods(t *testing.T) { pod := getTestPod() // Set the deletion timestamp. pod.DeletionTimestamp = new(unversioned.Time) - client := testclient.NewSimpleFake(pod) + client := fake.NewSimpleClientset(pod) m := newTestManager(client) m.podManager.AddPod(pod) @@ -730,10 +732,10 @@ func TestDeletePods(t *testing.T) { m.testSyncBatch() // Expect to see an delete action. - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, - testclient.DeleteActionImpl{ActionImpl: testclient.ActionImpl{Verb: "delete", Resource: "pods"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + core.DeleteActionImpl{ActionImpl: core.ActionImpl{Verb: "delete", Resource: "pods"}}, }) } @@ -748,7 +750,7 @@ func TestDoNotDeleteMirrorPods(t *testing.T) { } // Set the deletion timestamp. mirrorPod.DeletionTimestamp = new(unversioned.Time) - client := testclient.NewSimpleFake(mirrorPod) + client := fake.NewSimpleClientset(mirrorPod) m := newTestManager(client) m.podManager.AddPod(staticPod) m.podManager.AddPod(mirrorPod) @@ -764,8 +766,8 @@ func TestDoNotDeleteMirrorPods(t *testing.T) { m.testSyncBatch() // Expect not to see an delete action. - verifyActions(t, m.kubeClient, []testclient.Action{ - testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}}, - testclient.UpdateActionImpl{ActionImpl: testclient.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, + verifyActions(t, m.kubeClient, []core.Action{ + core.GetActionImpl{ActionImpl: core.ActionImpl{Verb: "get", Resource: "pods"}}, + core.UpdateActionImpl{ActionImpl: core.ActionImpl{Verb: "update", Resource: "pods", Subresource: "status"}}, }) } diff --git a/pkg/kubelet/util/queue/work_queue_test.go b/pkg/kubelet/util/queue/work_queue_test.go index 6dd452a9112..40ba6d95d88 100644 --- a/pkg/kubelet/util/queue/work_queue_test.go +++ b/pkg/kubelet/util/queue/work_queue_test.go @@ -26,7 +26,7 @@ import ( ) func newTestBasicWorkQueue() (*basicWorkQueue, *util.FakeClock) { - fakeClock := &util.FakeClock{Time: time.Now()} + fakeClock := util.NewFakeClock(time.Now()) wq := &basicWorkQueue{ clock: fakeClock, queue: make(map[types.UID]time.Time), diff --git a/pkg/kubelet/volumes.go b/pkg/kubelet/volumes.go index 2e395786996..da88df07476 100644 --- a/pkg/kubelet/volumes.go +++ b/pkg/kubelet/volumes.go @@ -23,7 +23,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/types" @@ -55,7 +55,7 @@ func (vh *volumeHost) GetPodPluginDir(podUID types.UID, pluginName string) strin } func (vh *volumeHost) GetKubeClient() clientset.Interface { - return vh.kubelet.clientset + return vh.kubelet.kubeClient } func (vh *volumeHost) NewWrapperBuilder(volName string, spec volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Builder, error) { @@ -111,23 +111,6 @@ func (vh *volumeHost) GetHostName() string { return vh.kubelet.hostname } -func (kl *Kubelet) newVolumeBuilderFromPlugins(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Builder, error) { - plugin, err := kl.volumePluginMgr.FindPluginBySpec(spec) - if err != nil { - return nil, fmt.Errorf("can't use volume plugins for %s: %v", spec.Name(), err) - } - if plugin == nil { - // Not found but not an error - return nil, nil - } - builder, err := plugin.NewBuilder(spec, pod, opts) - if err != nil { - return nil, fmt.Errorf("failed to instantiate volume plugin for %s: %v", spec.Name(), err) - } - glog.V(3).Infof("Used volume plugin %q for %s", plugin.Name(), spec.Name()) - return builder, nil -} - func (kl *Kubelet) mountExternalVolumes(pod *api.Pod) (kubecontainer.VolumeMap, error) { podVolumes := make(kubecontainer.VolumeMap) for i := range pod.Spec.Volumes { @@ -152,6 +135,22 @@ func (kl *Kubelet) mountExternalVolumes(pod *api.Pod) (kubecontainer.VolumeMap, if builder == nil { return nil, errUnsupportedVolumeType } + + // some volumes require attachment before builder's setup. + // The plugin can be nil, but non-nil errors are legitimate errors. + // For non-nil plugins, Attachment to a node is required before Builder's setup. + attacher, err := kl.newVolumeAttacherFromPlugins(internal, pod, volume.VolumeOptions{RootContext: rootContext}) + if err != nil { + glog.Errorf("Could not create volume attacher for pod %s: %v", pod.UID, err) + return nil, err + } + if attacher != nil { + err = attacher.Attach() + if err != nil { + return nil, err + } + } + err = builder.SetUp(fsGroup) if err != nil { return nil, err @@ -166,6 +165,19 @@ type volumeTuple struct { Name string } +// ListVolumesForPod returns a map of the volumes associated with the given pod +func (kl *Kubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) { + result := map[string]volume.Volume{} + vm, ok := kl.volumeManager.GetVolumes(podUID) + if !ok { + return result, false + } + for name, info := range vm { + result[name] = info.Builder + } + return result, true +} + func (kl *Kubelet) getPodVolumes(podUID types.UID) ([]*volumeTuple, error) { var volumes []*volumeTuple podVolDir := kl.getPodVolumesDir(podUID) @@ -193,14 +205,22 @@ func (kl *Kubelet) getPodVolumes(podUID types.UID) ([]*volumeTuple, error) { return volumes, nil } +// cleanerTuple is a union struct to allow separating detaching from the cleaner. +// some volumes require detachment but not all. Cleaner cannot be nil but Detacher is optional. +type cleanerTuple struct { + Cleaner volume.Cleaner + Detacher *volume.Detacher +} + // getPodVolumesFromDisk examines directory structure to determine volumes that -// are presently active and mounted. Returns a map of volume.Cleaner types. -func (kl *Kubelet) getPodVolumesFromDisk() map[string]volume.Cleaner { - currentVolumes := make(map[string]volume.Cleaner) +// are presently active and mounted. Returns a union struct containing a volume.Cleaner +// and potentially a volume.Detacher. +func (kl *Kubelet) getPodVolumesFromDisk() map[string]cleanerTuple { + currentVolumes := make(map[string]cleanerTuple) podUIDs, err := kl.listPodsFromDisk() if err != nil { glog.Errorf("Could not get pods from disk: %v", err) - return map[string]volume.Cleaner{} + return map[string]cleanerTuple{} } // Find the volumes for each on-disk pod. for _, podUID := range podUIDs { @@ -226,12 +246,58 @@ func (kl *Kubelet) getPodVolumesFromDisk() map[string]volume.Cleaner { glog.Errorf("Could not create volume cleaner for %s: %v", volume.Name, errUnsupportedVolumeType) continue } - currentVolumes[identifier] = cleaner + + tuple := cleanerTuple{Cleaner: cleaner} + detacher, err := kl.newVolumeDetacherFromPlugins(volume.Kind, volume.Name, podUID) + // plugin can be nil but a non-nil error is a legitimate error + if err != nil { + glog.Errorf("Could not create volume detacher for %s: %v", volume.Name, err) + continue + } + if detacher != nil { + tuple.Detacher = &detacher + } + currentVolumes[identifier] = tuple } } return currentVolumes } +func (kl *Kubelet) newVolumeBuilderFromPlugins(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Builder, error) { + plugin, err := kl.volumePluginMgr.FindPluginBySpec(spec) + if err != nil { + return nil, fmt.Errorf("can't use volume plugins for %s: %v", spec.Name(), err) + } + if plugin == nil { + // Not found but not an error + return nil, nil + } + builder, err := plugin.NewBuilder(spec, pod, opts) + if err != nil { + return nil, fmt.Errorf("failed to instantiate volume builder for %s: %v", spec.Name(), err) + } + glog.V(3).Infof("Used volume plugin %q to mount %s", plugin.Name(), spec.Name()) + return builder, nil +} + +func (kl *Kubelet) newVolumeAttacherFromPlugins(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Attacher, error) { + plugin, err := kl.volumePluginMgr.FindAttachablePluginBySpec(spec) + if err != nil { + return nil, fmt.Errorf("can't use volume plugins for %s: %v", spec.Name(), err) + } + if plugin == nil { + // Not found but not an error. + return nil, nil + } + + attacher, err := plugin.NewAttacher(spec) + if err != nil { + return nil, fmt.Errorf("failed to instantiate volume attacher for %s: %v", spec.Name(), err) + } + glog.V(3).Infof("Used volume plugin %q to attach %s/%s", plugin.Name(), spec.Name()) + return attacher, nil +} + func (kl *Kubelet) newVolumeCleanerFromPlugins(kind string, name string, podUID types.UID) (volume.Cleaner, error) { plugName := strings.UnescapeQualifiedNameForDisk(kind) plugin, err := kl.volumePluginMgr.FindPluginByName(plugName) @@ -247,6 +313,25 @@ func (kl *Kubelet) newVolumeCleanerFromPlugins(kind string, name string, podUID if err != nil { return nil, fmt.Errorf("failed to instantiate volume plugin for %s/%s: %v", podUID, kind, err) } - glog.V(3).Infof("Used volume plugin %q for %s/%s", plugin.Name(), podUID, kind) + glog.V(3).Infof("Used volume plugin %q to unmount %s/%s", plugin.Name(), podUID, kind) return cleaner, nil } + +func (kl *Kubelet) newVolumeDetacherFromPlugins(kind string, name string, podUID types.UID) (volume.Detacher, error) { + plugName := strings.UnescapeQualifiedNameForDisk(kind) + plugin, err := kl.volumePluginMgr.FindAttachablePluginByName(plugName) + if err != nil { + return nil, fmt.Errorf("can't use volume plugins for %s/%s: %v", podUID, kind, err) + } + if plugin == nil { + // Not found but not an error. + return nil, nil + } + + detacher, err := plugin.NewDetacher(name, podUID) + if err != nil { + return nil, fmt.Errorf("failed to instantiate volume plugin for %s/%s: %v", podUID, kind, err) + } + glog.V(3).Infof("Used volume plugin %q to detach %s/%s", plugin.Name(), podUID, kind) + return detacher, nil +} diff --git a/pkg/kubemark/hollow_kubelet.go b/pkg/kubemark/hollow_kubelet.go index 21aa44a39ed..83bf0285e71 100644 --- a/pkg/kubemark/hollow_kubelet.go +++ b/pkg/kubemark/hollow_kubelet.go @@ -21,7 +21,7 @@ import ( kubeletapp "k8s.io/kubernetes/cmd/kubelet/app" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/kubelet/cadvisor" "k8s.io/kubernetes/pkg/kubelet/cm" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" @@ -38,7 +38,7 @@ type HollowKubelet struct { func NewHollowKubelet( nodeName string, - client *client.Client, + client *clientset.Clientset, cadvisorInterface cadvisor.Interface, dockerClient dockertools.DockerInterface, kubeletPort, kubeletReadOnlyPort int, diff --git a/pkg/kubemark/hollow_proxy.go b/pkg/kubemark/hollow_proxy.go index e1bc84bf81f..7a3920eefb7 100644 --- a/pkg/kubemark/hollow_proxy.go +++ b/pkg/kubemark/hollow_proxy.go @@ -75,7 +75,7 @@ func NewHollowProxyOrDie( endpointsConfig.Channel("api"), ) - hollowProxy, err := proxyapp.NewProxyServer(client, config, iptInterface, &FakeProxier{}, broadcaster, recorder, nil) + hollowProxy, err := proxyapp.NewProxyServer(client, config, iptInterface, &FakeProxier{}, broadcaster, recorder, nil, "fake") if err != nil { glog.Fatalf("Error while creating ProxyServer: %v\n", err) } diff --git a/pkg/labels/selector.go b/pkg/labels/selector.go index 4fec1e0961e..5203774868b 100644 --- a/pkg/labels/selector.go +++ b/pkg/labels/selector.go @@ -20,8 +20,10 @@ import ( "bytes" "fmt" "sort" + "strconv" "strings" + "github.com/golang/glog" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/validation" ) @@ -70,6 +72,8 @@ const ( NotEqualsOperator Operator = "!=" NotInOperator Operator = "notin" ExistsOperator Operator = "exists" + GreaterThanOperator Operator = "Gt" + LessThanOperator Operator = "Lt" ) func NewSelector() Selector { @@ -104,7 +108,8 @@ 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) The key is invalid due to its length, or sequence +// (5) If the operator is Gt or Lt, the values set must contain only one value. +// (6) The key is invalid due to its length, or sequence // of characters. See validateLabelKey for more details. // // The empty string is a valid value in the input values set. @@ -125,6 +130,15 @@ func NewRequirement(key string, op Operator, vals sets.String) (*Requirement, er if len(vals) != 0 { return nil, fmt.Errorf("values set must be empty for exists and does not exist") } + case GreaterThanOperator, LessThanOperator: + if len(vals) != 1 { + 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") + } + } default: return nil, fmt.Errorf("operator '%v' is not recognized", op) } @@ -162,6 +176,31 @@ func (r *Requirement) Matches(ls Labels) bool { return ls.Has(r.key) case DoesNotExistOperator: return !ls.Has(r.key) + case GreaterThanOperator, LessThanOperator: + if !ls.Has(r.key) { + return false + } + lsValue, err := strconv.ParseFloat(ls.Get(r.key), 64) + if err != nil { + glog.V(10).Infof("Parse float 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. + 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 + for strValue := range r.strValues { + rValue, err = strconv.ParseFloat(strValue, 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) + return false + } + } + return (r.operator == GreaterThanOperator && lsValue > rValue) || (r.operator == LessThanOperator && lsValue < rValue) default: return false } @@ -210,6 +249,10 @@ func (r *Requirement) String() string { buffer.WriteString(" in ") case NotInOperator: buffer.WriteString(" notin ") + case GreaterThanOperator: + buffer.WriteString(">") + case LessThanOperator: + buffer.WriteString("<") case ExistsOperator, DoesNotExistOperator: return buffer.String() } @@ -277,8 +320,10 @@ const ( DoesNotExistToken DoubleEqualsToken EqualsToken + GreaterThanToken IdentifierToken // to represent keys and values InToken + LessThanToken NotEqualsToken NotInToken OpenParToken @@ -292,7 +337,9 @@ var string2token = map[string]Token{ "!": DoesNotExistToken, "==": DoubleEqualsToken, "=": EqualsToken, + ">": GreaterThanToken, "in": InToken, + "<": LessThanToken, "!=": NotEqualsToken, "notin": NotInToken, "(": OpenParToken, @@ -312,7 +359,7 @@ func isWhitespace(ch byte) bool { // isSpecialSymbol detect if the character ch can be an operator func isSpecialSymbol(ch byte) bool { switch ch { - case '=', '!', '(', ')', ',': + case '=', '!', '(', ')', ',', '>', '<': return true } return false @@ -526,7 +573,7 @@ func (p *Parser) parseRequirement() (*Requirement, error) { switch operator { case InOperator, NotInOperator: values, err = p.parseValues() - case EqualsOperator, DoubleEqualsOperator, NotEqualsOperator: + case EqualsOperator, DoubleEqualsOperator, NotEqualsOperator, GreaterThanOperator, LessThanOperator: values, err = p.parseExactValue() } if err != nil { @@ -573,6 +620,10 @@ func (p *Parser) parseOperator() (op Operator, err error) { op = EqualsOperator case DoubleEqualsToken: op = DoubleEqualsOperator + case GreaterThanToken: + op = GreaterThanOperator + case LessThanToken: + op = LessThanOperator case NotInToken: op = NotInOperator case NotEqualsToken: diff --git a/pkg/labels/selector_test.go b/pkg/labels/selector_test.go index efe97f7d8b2..5fbb1fc762c 100644 --- a/pkg/labels/selector_test.go +++ b/pkg/labels/selector_test.go @@ -34,11 +34,14 @@ func TestSelectorParse(t *testing.T) { "x=,z= ", "x= ,z= ", "!x", + "x>1.1", + "x>1.1,z<5.3", } testBadStrings := []string{ "x=a||y=b", "x==a==b", "!x=a", + "x1.1", Set{"x": "1.2"}) + expectMatch(t, "x<1.1", Set{"x": "0.8"}) expectNoMatch(t, "x=z", Set{}) expectNoMatch(t, "x=y", Set{"x": "z"}) expectNoMatch(t, "x=y,z=w", Set{"x": "w", "z": "w"}) expectNoMatch(t, "x!=y,z!=w", Set{"x": "z", "z": "w"}) expectNoMatch(t, "x", Set{"y": "z"}) expectNoMatch(t, "!x", Set{"x": "z"}) + expectNoMatch(t, "x>1.1", Set{"x": "0.8"}) + expectNoMatch(t, "x<1.1", Set{"x": "1.1"}) labelset := Set{ "foo": "bar", @@ -184,6 +191,8 @@ func TestLexer(t *testing.T) { {"in", InToken}, {"=", EqualsToken}, {"==", DoubleEqualsToken}, + {">", GreaterThanToken}, + {"<", LessThanToken}, //Note that Lex returns the longest valid token found {"!", DoesNotExistToken}, {"!=", NotEqualsToken}, @@ -226,6 +235,8 @@ func TestLexerSequence(t *testing.T) { {"()", []Token{OpenParToken, ClosedParToken}}, {"x in (),y", []Token{IdentifierToken, InToken, OpenParToken, ClosedParToken, CommaToken, IdentifierToken}}, {"== != (), = notin", []Token{DoubleEqualsToken, NotEqualsToken, OpenParToken, ClosedParToken, CommaToken, EqualsToken, NotInToken}}, + {"key>1.1", []Token{IdentifierToken, GreaterThanToken, IdentifierToken}}, + {"key<0.8", []Token{IdentifierToken, LessThanToken, IdentifierToken}}, } for _, v := range testcases { var literals []string @@ -263,6 +274,8 @@ func TestParserLookahead(t *testing.T) { {"", []Token{EndOfStringToken}}, {"x in (),y", []Token{IdentifierToken, InToken, OpenParToken, ClosedParToken, CommaToken, IdentifierToken, EndOfStringToken}}, {"== != (), = notin", []Token{DoubleEqualsToken, NotEqualsToken, OpenParToken, ClosedParToken, CommaToken, EqualsToken, NotInToken, EndOfStringToken}}, + {"key>1.1", []Token{IdentifierToken, GreaterThanToken, IdentifierToken, EndOfStringToken}}, + {"key<0.8", []Token{IdentifierToken, LessThanToken, IdentifierToken, EndOfStringToken}}, } for _, v := range testcases { p := &Parser{l: &Lexer{s: v.s, pos: 0}, position: 0} @@ -299,6 +312,10 @@ func TestRequirementConstructor(t *testing.T) { {"x", DoesNotExistOperator, nil, true}, {"1foo", InOperator, sets.NewString("bar"), true}, {"1234", InOperator, sets.NewString("bar"), true}, + {"y", GreaterThanOperator, sets.NewString("1.1"), true}, + {"z", LessThanOperator, sets.NewString("5.3"), true}, + {"foo", GreaterThanOperator, sets.NewString("bar"), false}, + {"barz", LessThanOperator, sets.NewString("blah"), false}, {strings.Repeat("a", 254), ExistsOperator, nil, false}, //breaks DNS rule that len(key) <= 253 } for _, rc := range requirementConstructorTests { @@ -343,6 +360,11 @@ func TestToString(t *testing.T) { getRequirement("z", NotEqualsOperator, sets.NewString("a"), t), getRequirement("z", ExistsOperator, nil, t)}, "x=abc,y==jkl,z!=a,z", true}, + {&internalSelector{ + getRequirement("x", GreaterThanOperator, sets.NewString("2.4"), t), + getRequirement("y", LessThanOperator, sets.NewString("7.1"), t), + getRequirement("z", ExistsOperator, nil, t)}, + "x>2.4,y<7.1,z", true}, } for _, ts := range toStringTests { if out := ts.In.String(); out == "" && ts.Valid { @@ -386,6 +408,12 @@ func TestRequirementSelectorMatching(t *testing.T) { {Set{"y": "baz"}, &internalSelector{ getRequirement("x", InOperator, sets.NewString(""), t), }, false}, + {Set{"z": "1.2"}, &internalSelector{ + getRequirement("z", GreaterThanOperator, sets.NewString("1.0"), t), + }, true}, + {Set{"z": "v1.2"}, &internalSelector{ + getRequirement("z", GreaterThanOperator, sets.NewString("1.0"), t), + }, false}, } for _, lsm := range labelSelectorMatchingTests { if match := lsm.Sel.Matches(lsm.Set); match != lsm.Match { @@ -445,6 +473,12 @@ func TestSetSelectorParser(t *testing.T) { {"x=a", internalSelector{ getRequirement("x", EqualsOperator, sets.NewString("a"), t), }, true, true}, + {"x>1.1", internalSelector{ + getRequirement("x", GreaterThanOperator, sets.NewString("1.1"), t), + }, true, true}, + {"x<7.1", internalSelector{ + getRequirement("x", LessThanOperator, sets.NewString("7.1"), t), + }, true, true}, {"x=a,y!=b", internalSelector{ getRequirement("x", EqualsOperator, sets.NewString("a"), t), getRequirement("y", NotEqualsOperator, sets.NewString("b"), t), diff --git a/pkg/master/controller.go b/pkg/master/controller.go index ee4672f3eec..09ba85c9c97 100644 --- a/pkg/master/controller.go +++ b/pkg/master/controller.go @@ -35,6 +35,7 @@ import ( "k8s.io/kubernetes/pkg/util/intstr" utilnet "k8s.io/kubernetes/pkg/util/net" "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" ) // Controller is the controller manager for the core bootstrap Kubernetes controller @@ -99,7 +100,7 @@ func (c *Controller) Start() { // RunKubernetesService periodically updates the kubernetes service func (c *Controller) RunKubernetesService(ch chan struct{}) { - util.Until(func() { + wait.Until(func() { // Service definition is not reconciled after first // run, ports and type will be corrected only during // start. diff --git a/pkg/master/master.go b/pkg/master/master.go index df7db628f53..315b25fe655 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -18,6 +18,7 @@ package master import ( "fmt" + "io" "net" "net/http" "net/url" @@ -32,6 +33,7 @@ import ( "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apiserver" + apiservermetrics "k8s.io/kubernetes/pkg/apiserver/metrics" "k8s.io/kubernetes/pkg/genericapiserver" "k8s.io/kubernetes/pkg/healthz" kubeletclient "k8s.io/kubernetes/pkg/kubelet/client" @@ -55,7 +57,9 @@ import ( pvetcd "k8s.io/kubernetes/pkg/registry/persistentvolume/etcd" pvcetcd "k8s.io/kubernetes/pkg/registry/persistentvolumeclaim/etcd" podetcd "k8s.io/kubernetes/pkg/registry/pod/etcd" + pspetcd "k8s.io/kubernetes/pkg/registry/podsecuritypolicy/etcd" podtemplateetcd "k8s.io/kubernetes/pkg/registry/podtemplate/etcd" + replicasetetcd "k8s.io/kubernetes/pkg/registry/replicaset/etcd" resourcequotaetcd "k8s.io/kubernetes/pkg/registry/resourcequota/etcd" secretetcd "k8s.io/kubernetes/pkg/registry/secret/etcd" "k8s.io/kubernetes/pkg/registry/service" @@ -68,9 +72,10 @@ import ( thirdpartyresourcedataetcd "k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata/etcd" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/storage" + etcdmetrics "k8s.io/kubernetes/pkg/storage/etcd/metrics" etcdutil "k8s.io/kubernetes/pkg/storage/etcd/util" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" daemonetcd "k8s.io/kubernetes/pkg/registry/daemonset/etcd" horizontalpodautoscaleretcd "k8s.io/kubernetes/pkg/registry/horizontalpodautoscaler/etcd" @@ -131,12 +136,15 @@ type thirdPartyEntry struct { // Certain config fields will be set to a default value if unset. // Certain config fields must be specified, including: // KubeletClient -func New(c *Config) *Master { +func New(c *Config) (*Master, error) { if c.KubeletClient == nil { - glog.Fatalf("Master.New() called with config.KubeletClient == nil") + return nil, fmt.Errorf("Master.New() called with config.KubeletClient == nil") } - s := genericapiserver.New(c.Config) + s, err := genericapiserver.New(c.Config) + if err != nil { + return nil, err + } m := &Master{ GenericAPIServer: s, @@ -155,26 +163,18 @@ func New(c *Config) *Master { m.NewBootstrapController().Start() } - return m + return m, nil +} + +func resetMetrics(w http.ResponseWriter, req *http.Request) { + apiservermetrics.Reset() + etcdmetrics.Reset() + io.WriteString(w, "metrics reset\n") } func (m *Master) InstallAPIs(c *Config) { apiGroupsInfo := []genericapiserver.APIGroupInfo{} - // Run the tunnel. - healthzChecks := []healthz.HealthzChecker{} - if m.tunneler != nil { - m.tunneler.Run(m.getNodeAddresses) - healthzChecks = append(healthzChecks, healthz.NamedCheck("SSH Tunnel Check", m.IsTunnelSyncHealthy)) - prometheus.NewGaugeFunc(prometheus.GaugeOpts{ - Name: "apiserver_proxy_tunnel_sync_latency_secs", - Help: "The time since the last successful synchronization of the SSH tunnels for proxy requests.", - }, func() float64 { return float64(m.tunneler.SecondsSinceSync()) }) - } - - // TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver. - apiserver.InstallSupport(m.MuxHelper, m.RootWebService, c.EnableProfiling, healthzChecks...) - // Install v1 unless disabled. if !m.ApiGroupVersionOverrides["api/v1"].Disable { // Install v1 API. @@ -192,6 +192,23 @@ func (m *Master) InstallAPIs(c *Config) { apiGroupsInfo = append(apiGroupsInfo, apiGroupInfo) } + // Run the tunneler. + healthzChecks := []healthz.HealthzChecker{} + if m.tunneler != nil { + m.tunneler.Run(m.getNodeAddresses) + healthzChecks = append(healthzChecks, healthz.NamedCheck("SSH Tunnel Check", m.IsTunnelSyncHealthy)) + prometheus.NewGaugeFunc(prometheus.GaugeOpts{ + Name: "apiserver_proxy_tunnel_sync_latency_secs", + Help: "The time since the last successful synchronization of the SSH tunnels for proxy requests.", + }, func() float64 { return float64(m.tunneler.SecondsSinceSync()) }) + } + + // TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver. + apiserver.InstallSupport(m.MuxHelper, m.RootWebService, healthzChecks...) + if c.EnableProfiling { + m.MuxHelper.HandleFunc("/resetMetrics", resetMetrics) + } + // Install root web services m.HandlerContainer.Add(m.RootWebService) @@ -241,23 +258,6 @@ func (m *Master) InstallAPIs(c *Config) { if err := m.InstallAPIGroups(apiGroupsInfo); err != nil { glog.Fatalf("Error in registering group versions: %v", err) } - - // This should be done after all groups are registered - // TODO: replace the hardcoded "apis". - apiserver.AddApisWebService(m.Serializer, m.HandlerContainer, "/apis", func() []unversioned.APIGroup { - groups := []unversioned.APIGroup{} - for ix := range allGroups { - groups = append(groups, allGroups[ix]) - } - m.thirdPartyResourcesLock.Lock() - defer m.thirdPartyResourcesLock.Unlock() - if m.thirdPartyResources != nil { - for key := range m.thirdPartyResources { - groups = append(groups, m.thirdPartyResources[key].group) - } - } - return groups - }) } func (m *Master) initV1ResourcesStorage(c *Config) { @@ -446,6 +446,7 @@ func (m *Master) removeThirdPartyStorage(path string) error { return err } delete(m.thirdPartyResources, path) + m.RemoveAPIGroupForDiscovery(getThirdPartyGroupName(path)) } return nil } @@ -500,6 +501,7 @@ func (m *Master) addThirdPartyResourceStorage(path string, storage *thirdpartyre m.thirdPartyResourcesLock.Lock() defer m.thirdPartyResourcesLock.Unlock() m.thirdPartyResources[path] = thirdPartyEntry{storage, apiGroup} + m.AddAPIGroupForDiscovery(apiGroup) } // InstallThirdPartyResource installs a third party resource specified by 'rsrc'. When a resource is @@ -572,7 +574,7 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV // getExperimentalResources returns the resources for extenstions api func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage { // All resources except these are disabled by default. - enabledResources := sets.NewString("jobs", "horizontalpodautoscalers", "ingresses") + enabledResources := sets.NewString("horizontalpodautoscalers", "ingresses", "jobs", "replicasets") resourceOverrides := m.ApiGroupVersionOverrides["extensions/v1beta1"].ResourceOverrides isEnabled := func(resource string) bool { // Check if the resource has been overriden. @@ -603,7 +605,7 @@ func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage { thirdPartyResourceRegistry: thirdPartyResourceStorage, } go func() { - util.Forever(func() { + wait.Forever(func() { if err := thirdPartyControl.SyncResources(); err != nil { glog.Warningf("third party resource sync failed: %v", err) } @@ -622,7 +624,8 @@ func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage { deploymentStorage := deploymentetcd.NewStorage(dbClient("deployments"), storageDecorator) storage["deployments"] = deploymentStorage.Deployment storage["deployments/status"] = deploymentStorage.Status - storage["deployments/scale"] = deploymentStorage.Scale + // TODO(madhusudancs): Install scale when Scale group issues are fixed (see issue #18528). + // storage["deployments/scale"] = deploymentStorage.Scale storage["deployments/rollback"] = deploymentStorage.Rollback } if isEnabled("jobs") { @@ -635,6 +638,15 @@ func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage { storage["ingresses"] = ingressStorage storage["ingresses/status"] = ingressStatusStorage } + if isEnabled("podsecuritypolicy") { + podSecurityPolicyStorage := pspetcd.NewREST(dbClient("podsecuritypolicy"), storageDecorator) + storage["podSecurityPolicies"] = podSecurityPolicyStorage + } + if isEnabled("replicasets") { + replicaSetStorage := replicasetetcd.NewStorage(dbClient("replicasets"), storageDecorator) + storage["replicasets"] = replicaSetStorage.ReplicaSet + storage["replicasets/status"] = replicaSetStorage.Status + } return storage } diff --git a/pkg/master/master_test.go b/pkg/master/master_test.go index adb5fe1c971..30e18b5f775 100644 --- a/pkg/master/master_test.go +++ b/pkg/master/master_test.go @@ -48,7 +48,6 @@ import ( etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing" "k8s.io/kubernetes/pkg/util/intstr" - "github.com/emicklei/go-restful" "github.com/stretchr/testify/assert" "golang.org/x/net/context" ) @@ -85,11 +84,17 @@ func newMaster(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *ass config.Serializer = api.Codecs config.KubeletClient = client.FakeKubeletClient{} + config.APIPrefix = "/api" + config.APIGroupPrefix = "/apis" config.ProxyDialer = func(network, addr string) (net.Conn, error) { return nil, nil } config.ProxyTLSClientConfig = &tls.Config{} - master := New(&config) + master, err := New(&config) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } + return master, etcdserver, config, assert } @@ -269,30 +274,28 @@ func TestDiscoveryAtAPIS(t *testing.T) { t.Fatalf("unexpected error: %v", err) } - expectGroupName := extensions.GroupName - expectVersions := []unversioned.GroupVersionForDiscovery{ + extensionsGroupName := extensions.GroupName + extensionsVersions := []unversioned.GroupVersionForDiscovery{ { GroupVersion: testapi.Extensions.GroupVersion().String(), Version: testapi.Extensions.GroupVersion().Version, }, } - expectPreferredVersion := unversioned.GroupVersionForDiscovery{ + extensionsPreferredVersion := unversioned.GroupVersionForDiscovery{ GroupVersion: config.StorageVersions[extensions.GroupName], Version: apiutil.GetVersion(config.StorageVersions[extensions.GroupName]), } - assert.Equal(expectGroupName, groupList.Groups[0].Name) - assert.Equal(expectVersions, groupList.Groups[0].Versions) - assert.Equal(expectPreferredVersion, groupList.Groups[0].PreferredVersion) + assert.Equal(extensionsGroupName, groupList.Groups[0].Name) + assert.Equal(extensionsVersions, groupList.Groups[0].Versions) + assert.Equal(extensionsPreferredVersion, groupList.Groups[0].PreferredVersion) thirdPartyGV := unversioned.GroupVersionForDiscovery{GroupVersion: "company.com/v1", Version: "v1"} - master.thirdPartyResources["/apis/company.com/v1"] = thirdPartyEntry{ - nil, + master.addThirdPartyResourceStorage("/apis/company.com/v1", nil, unversioned.APIGroup{ Name: "company.com", Versions: []unversioned.GroupVersionForDiscovery{thirdPartyGV}, PreferredVersion: thirdPartyGV, - }, - } + }) resp, err = http.Get(server.URL + "/apis") if !assert.NoError(err) { @@ -309,10 +312,13 @@ func TestDiscoveryAtAPIS(t *testing.T) { thirdPartyGroupName := "company.com" thirdPartyExpectVersions := []unversioned.GroupVersionForDiscovery{thirdPartyGV} - assert.Equal(thirdPartyGroupName, groupList.Groups[1].Name) - assert.Equal(thirdPartyExpectVersions, groupList.Groups[1].Versions) - assert.Equal(thirdPartyGV, groupList.Groups[1].PreferredVersion) - + assert.Equal(2, len(groupList.Groups)) + assert.Equal(thirdPartyGroupName, groupList.Groups[0].Name) + assert.Equal(thirdPartyExpectVersions, groupList.Groups[0].Versions) + assert.Equal(thirdPartyGV, groupList.Groups[0].PreferredVersion) + assert.Equal(extensionsGroupName, groupList.Groups[1].Name) + assert.Equal(extensionsVersions, groupList.Groups[1].Versions) + assert.Equal(extensionsPreferredVersion, groupList.Groups[1].PreferredVersion) } var versionsToTest = []string{"v1", "v3"} @@ -333,9 +339,8 @@ type FooList struct { } func initThirdParty(t *testing.T, version string) (*Master, *etcdtesting.EtcdTestServer, *httptest.Server, *assert.Assertions) { - master, etcdserver, _, assert := setUp(t) + master, etcdserver, _, assert := newMaster(t) - master.thirdPartyResources = map[string]thirdPartyEntry{} api := &extensions.ThirdPartyResource{ ObjectMeta: api.ObjectMeta{ Name: "foo.company.com", @@ -347,7 +352,6 @@ func initThirdParty(t *testing.T, version string) (*Master, *etcdtesting.EtcdTes }, }, } - master.HandlerContainer = restful.NewContainer() master.thirdPartyStorage = etcdstorage.NewEtcdStorage(etcdserver.Client, testapi.Extensions.Codec(), etcdtest.PathPrefix(), false) if !assert.NoError(master.InstallThirdPartyResource(api)) { @@ -355,7 +359,7 @@ func initThirdParty(t *testing.T, version string) (*Master, *etcdtesting.EtcdTes } server := httptest.NewServer(master.HandlerContainer.ServeMux) - return &master, etcdserver, server, assert + return master, etcdserver, server, assert } func TestInstallThirdPartyAPIList(t *testing.T) { diff --git a/pkg/master/thirdparty_controller.go b/pkg/master/thirdparty_controller.go index 177f9467eba..15b44dfc452 100644 --- a/pkg/master/thirdparty_controller.go +++ b/pkg/master/thirdparty_controller.go @@ -37,6 +37,10 @@ func makeThirdPartyPath(group string) string { return thirdpartyprefix + "/" + group } +func getThirdPartyGroupName(path string) string { + return strings.TrimPrefix(strings.TrimPrefix(path, thirdpartyprefix), "/") +} + // resourceInterface is the interface for the parts of the master that know how to add/remove // third party resources. Extracted into an interface for injection for testing. type resourceInterface interface { diff --git a/pkg/master/tunneler.go b/pkg/master/tunneler.go index 2cef89d2093..8a23ce3ff42 100644 --- a/pkg/master/tunneler.go +++ b/pkg/master/tunneler.go @@ -18,14 +18,15 @@ package master import ( "io/ioutil" - "math/rand" "net" + "net/url" "os" - "sync" "sync/atomic" "time" + "k8s.io/kubernetes/pkg/ssh" "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" @@ -43,12 +44,12 @@ type Tunneler interface { } type SSHTunneler struct { - SSHUser string - SSHKeyfile string - InstallSSHKey InstallSSHKey + SSHUser string + SSHKeyfile string + InstallSSHKey InstallSSHKey + HealthCheckURL *url.URL - tunnels *util.SSHTunnelList - tunnelsLock sync.Mutex + tunnels *ssh.SSHTunnelList lastSync int64 // Seconds since Epoch lastSyncMetric prometheus.GaugeFunc clock util.Clock @@ -57,13 +58,13 @@ type SSHTunneler struct { stopChan chan struct{} } -func NewSSHTunneler(sshUser string, sshKeyfile string, installSSHKey InstallSSHKey) Tunneler { +func NewSSHTunneler(sshUser, sshKeyfile string, healthCheckURL *url.URL, installSSHKey InstallSSHKey) Tunneler { return &SSHTunneler{ - SSHUser: sshUser, - SSHKeyfile: sshKeyfile, - InstallSSHKey: installSSHKey, - - clock: util.RealClock{}, + SSHUser: sshUser, + SSHKeyfile: sshKeyfile, + InstallSSHKey: installSSHKey, + HealthCheckURL: healthCheckURL, + clock: util.RealClock{}, } } @@ -93,14 +94,17 @@ func (c *SSHTunneler) Run(getAddresses AddressFunc) { glog.Errorf("Error detecting if key exists: %v", err) } else if !exists { glog.Infof("Key doesn't exist, attempting to create") - err := c.generateSSHKey(c.SSHUser, c.SSHKeyfile, publicKeyFile) - if err != nil { + if err := generateSSHKey(c.SSHKeyfile, publicKeyFile); err != nil { glog.Errorf("Failed to create key pair: %v", err) } } - c.tunnels = &util.SSHTunnelList{} - c.setupSecureProxy(c.SSHUser, c.SSHKeyfile, publicKeyFile) + + c.tunnels = ssh.NewSSHTunnelList(c.SSHUser, c.SSHKeyfile, c.HealthCheckURL, c.stopChan) + // Sync loop to ensure that the SSH key has been installed. + c.installSSHKeySyncLoop(c.SSHUser, publicKeyFile) + // Sync tunnelList w/ nodes. c.lastSync = c.clock.Now().Unix() + c.nodesSyncLoop() } // Stop gracefully shuts down the tunneler @@ -112,23 +116,7 @@ func (c *SSHTunneler) Stop() { } func (c *SSHTunneler) Dial(net, addr string) (net.Conn, error) { - // Only lock while picking a tunnel. - tunnel, err := func() (util.SSHTunnelEntry, error) { - c.tunnelsLock.Lock() - defer c.tunnelsLock.Unlock() - return c.tunnels.PickRandomTunnel() - }() - if err != nil { - return nil, err - } - - start := time.Now() - id := rand.Int63() // So you can match begins/ends in the log. - glog.V(3).Infof("[%x: %v] Dialing...", id, tunnel.Address) - defer func() { - glog.V(3).Infof("[%x: %v] Dialed in %v.", id, tunnel.Address, time.Now().Sub(start)) - }() - return tunnel.Tunnel.Dial(net, addr) + return c.tunnels.Dial(net, addr) } func (c *SSHTunneler) SecondsSinceSync() int64 { @@ -137,72 +125,18 @@ func (c *SSHTunneler) SecondsSinceSync() int64 { return now - then } -func (c *SSHTunneler) needToReplaceTunnels(addrs []string) bool { - c.tunnelsLock.Lock() - defer c.tunnelsLock.Unlock() - if c.tunnels == nil || c.tunnels.Len() != len(addrs) { - return true - } - // TODO (cjcullen): This doesn't need to be n^2 - for ix := range addrs { - if !c.tunnels.Has(addrs[ix]) { - return true - } - } - return false -} - -func (c *SSHTunneler) replaceTunnels(user, keyfile string, newAddrs []string) error { - glog.Infof("replacing tunnels. New addrs: %v", newAddrs) - tunnels := util.MakeSSHTunnels(user, keyfile, newAddrs) - if err := tunnels.Open(); err != nil { - return err - } - c.tunnelsLock.Lock() - defer c.tunnelsLock.Unlock() - if c.tunnels != nil { - c.tunnels.Close() - } - c.tunnels = tunnels - atomic.StoreInt64(&c.lastSync, c.clock.Now().Unix()) - return nil -} - -func (c *SSHTunneler) loadTunnels(user, keyfile string) error { - addrs, err := c.getAddresses() - if err != nil { - return err - } - if !c.needToReplaceTunnels(addrs) { - return nil - } - // TODO: This is going to unnecessarily close connections to unchanged nodes. - // See comment about using Watch above. - glog.Info("found different nodes. Need to replace tunnels") - return c.replaceTunnels(user, keyfile, addrs) -} - -func (c *SSHTunneler) refreshTunnels(user, keyfile string) error { - addrs, err := c.getAddresses() - if err != nil { - return err - } - return c.replaceTunnels(user, keyfile, addrs) -} - -func (c *SSHTunneler) setupSecureProxy(user, privateKeyfile, publicKeyfile string) { - // Sync loop to ensure that the SSH key has been installed. - go util.Until(func() { +func (c *SSHTunneler) installSSHKeySyncLoop(user, publicKeyfile string) { + go wait.Until(func() { if c.InstallSSHKey == nil { glog.Error("Won't attempt to install ssh key: InstallSSHKey function is nil") return } - key, err := util.ParsePublicKeyFromFile(publicKeyfile) + key, err := ssh.ParsePublicKeyFromFile(publicKeyfile) if err != nil { glog.Errorf("Failed to load public key: %v", err) return } - keyData, err := util.EncodeSSHKey(key) + keyData, err := ssh.EncodeSSHKey(key) if err != nil { glog.Errorf("Failed to encode public key: %v", err) return @@ -211,31 +145,25 @@ func (c *SSHTunneler) setupSecureProxy(user, privateKeyfile, publicKeyfile strin glog.Errorf("Failed to install ssh key: %v", err) } }, 5*time.Minute, c.stopChan) - // Sync loop for tunnels - // TODO: switch this to watch. - go util.Until(func() { - if err := c.loadTunnels(user, privateKeyfile); err != nil { - glog.Errorf("Failed to load SSH Tunnels: %v", err) - } - if c.tunnels != nil && c.tunnels.Len() != 0 { - // Sleep for 10 seconds if we have some tunnels. - // TODO (cjcullen): tunnels can lag behind actually existing nodes. - time.Sleep(9 * time.Second) - } - }, 1*time.Second, c.stopChan) - // Refresh loop for tunnels - // TODO: could make this more controller-ish - go util.Until(func() { - time.Sleep(5 * time.Minute) - if err := c.refreshTunnels(user, privateKeyfile); err != nil { - glog.Errorf("Failed to refresh SSH Tunnels: %v", err) - } - }, 0*time.Second, c.stopChan) } -func (c *SSHTunneler) generateSSHKey(user, privateKeyfile, publicKeyfile string) error { - // TODO: user is not used. Consider removing it as an input to the function. - private, public, err := util.GenerateKey(2048) +// nodesSyncLoop lists nodes ever 15 seconds, calling Update() on the TunnelList +// each time (Update() is a noop if no changes are necessary). +func (c *SSHTunneler) nodesSyncLoop() { + // TODO (cjcullen) make this watch. + go wait.Until(func() { + addrs, err := c.getAddresses() + glog.Infof("Calling update w/ addrs: %v", addrs) + if err != nil { + glog.Errorf("Failed to getAddresses: %v", err) + } + c.tunnels.Update(addrs) + atomic.StoreInt64(&c.lastSync, c.clock.Now().Unix()) + }, 15*time.Second, c.stopChan) +} + +func generateSSHKey(privateKeyfile, publicKeyfile string) error { + private, public, err := ssh.GenerateKey(2048) if err != nil { return err } @@ -250,10 +178,10 @@ func (c *SSHTunneler) generateSSHKey(user, privateKeyfile, publicKeyfile string) glog.Errorf("Failed to remove stale private key: %v", err) } } - if err := ioutil.WriteFile(privateKeyfile, util.EncodePrivateKey(private), 0600); err != nil { + if err := ioutil.WriteFile(privateKeyfile, ssh.EncodePrivateKey(private), 0600); err != nil { return err } - publicKeyBytes, err := util.EncodePublicKey(public) + publicKeyBytes, err := ssh.EncodePublicKey(public) if err != nil { return err } diff --git a/pkg/master/tunneler_test.go b/pkg/master/tunneler_test.go index 24822f2e06e..665292607f6 100644 --- a/pkg/master/tunneler_test.go +++ b/pkg/master/tunneler_test.go @@ -37,48 +37,35 @@ func TestSecondsSinceSync(t *testing.T) { tunneler.lastSync = time.Date(2015, time.January, 1, 1, 1, 1, 1, time.UTC).Unix() // Nano Second. No difference. - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 1, 1, 2, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 1, 1, 2, time.UTC)) assert.Equal(int64(0), tunneler.SecondsSinceSync()) // Second - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 1, 2, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 1, 2, 1, time.UTC)) assert.Equal(int64(1), tunneler.SecondsSinceSync()) // Minute - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 2, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 2, 1, 1, time.UTC)) assert.Equal(int64(60), tunneler.SecondsSinceSync()) // Hour - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 2, 1, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 2, 1, 1, 1, time.UTC)) assert.Equal(int64(3600), tunneler.SecondsSinceSync()) // Day - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 2, 1, 1, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 2, 1, 1, 1, 1, time.UTC)) assert.Equal(int64(86400), tunneler.SecondsSinceSync()) // Month - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.February, 1, 1, 1, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.February, 1, 1, 1, 1, 1, time.UTC)) assert.Equal(int64(2678400), tunneler.SecondsSinceSync()) // Future Month. Should be -Month. tunneler.lastSync = time.Date(2015, time.February, 1, 1, 1, 1, 1, time.UTC).Unix() - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 1, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 1, 1, 1, time.UTC)) assert.Equal(int64(-2678400), tunneler.SecondsSinceSync()) } -// TestRefreshTunnels verifies that the function errors when no addresses -// are associated with nodes -func TestRefreshTunnels(t *testing.T) { - tunneler := &SSHTunneler{} - tunneler.getAddresses = func() ([]string, error) { return []string{}, nil } - assert := assert.New(t) - - // Fail case (no addresses associated with nodes) - assert.Error(tunneler.refreshTunnels("test", "/somepath/undefined")) - - // TODO: pass case without needing actual connections? -} - // TestIsTunnelSyncHealthy verifies that the 600 second lag test // is honored. func TestIsTunnelSyncHealthy(t *testing.T) { @@ -89,12 +76,12 @@ func TestIsTunnelSyncHealthy(t *testing.T) { // Pass case: 540 second lag tunneler.lastSync = time.Date(2015, time.January, 1, 1, 1, 1, 1, time.UTC).Unix() - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 9, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 9, 1, 1, time.UTC)) err := master.IsTunnelSyncHealthy(nil) assert.NoError(err, "IsTunnelSyncHealthy() should not have returned an error.") // Fail case: 720 second lag - tunneler.clock = &util.FakeClock{Time: time.Date(2015, time.January, 1, 1, 12, 1, 1, time.UTC)} + tunneler.clock = util.NewFakeClock(time.Date(2015, time.January, 1, 1, 12, 1, 1, time.UTC)) err = master.IsTunnelSyncHealthy(nil) assert.Error(err, "IsTunnelSyncHealthy() should have returned an error.") } @@ -108,7 +95,6 @@ func generateTempFilePath(prefix string) string { // TestGenerateSSHKey verifies that SSH key generation does indeed // generate keys even with keys already exist. func TestGenerateSSHKey(t *testing.T) { - tunneler := &SSHTunneler{} assert := assert.New(t) privateKey := generateTempFilePath("private") @@ -119,17 +105,17 @@ func TestGenerateSSHKey(t *testing.T) { os.Remove(publicKey) // Pass case: Sunny day case - err := tunneler.generateSSHKey("unused", privateKey, publicKey) + err := generateSSHKey(privateKey, publicKey) assert.NoError(err, "generateSSHKey should not have retuend an error: %s", err) // Pass case: PrivateKey exists test case os.Remove(publicKey) - err = tunneler.generateSSHKey("unused", privateKey, publicKey) + err = generateSSHKey(privateKey, publicKey) assert.NoError(err, "generateSSHKey should not have retuend an error: %s", err) // Pass case: PublicKey exists test case os.Remove(privateKey) - err = tunneler.generateSSHKey("unused", privateKey, publicKey) + err = generateSSHKey(privateKey, publicKey) assert.NoError(err, "generateSSHKey should not have retuend an error: %s", err) // Make sure we have no test keys laying around diff --git a/pkg/metrics/generic_metrics.go b/pkg/metrics/generic_metrics.go index 57dd016d86c..eecae0e7091 100644 --- a/pkg/metrics/generic_metrics.go +++ b/pkg/metrics/generic_metrics.go @@ -134,7 +134,7 @@ func parseMetrics(data string, knownMetrics map[string][]string, output *Metrics if isKnownMetric || isCommonMetric { (*output)[name] = append((*output)[name], metric) } else { - glog.Warning("Unknown metric %v", metric) + glog.Warningf("Unknown metric %v", metric) if unknownMetrics != nil { unknownMetrics.Insert(name) } diff --git a/pkg/probe/http/http.go b/pkg/probe/http/http.go index 781bea917e5..c5132acdb56 100644 --- a/pkg/probe/http/http.go +++ b/pkg/probe/http/http.go @@ -36,7 +36,7 @@ func New() HTTPProber { } type HTTPProber interface { - Probe(url *url.URL, timeout time.Duration) (probe.Result, string, error) + Probe(url *url.URL, headers http.Header, timeout time.Duration) (probe.Result, string, error) } type httpProber struct { @@ -44,20 +44,26 @@ type httpProber struct { } // Probe returns a ProbeRunner capable of running an http check. -func (pr httpProber) Probe(url *url.URL, timeout time.Duration) (probe.Result, string, error) { - return DoHTTPProbe(url, &http.Client{Timeout: timeout, Transport: pr.transport}) +func (pr httpProber) Probe(url *url.URL, headers http.Header, timeout time.Duration) (probe.Result, string, error) { + return DoHTTPProbe(url, headers, &http.Client{Timeout: timeout, Transport: pr.transport}) } type HTTPGetInterface interface { - Get(u string) (*http.Response, error) + Do(req *http.Request) (*http.Response, error) } // DoHTTPProbe checks if a GET request to the url succeeds. // If the HTTP response code is successful (i.e. 400 > code >= 200), it returns Success. // If the HTTP response code is unsuccessful or HTTP communication fails, it returns Failure. // This is exported because some other packages may want to do direct HTTP probes. -func DoHTTPProbe(url *url.URL, client HTTPGetInterface) (probe.Result, string, error) { - res, err := client.Get(url.String()) +func DoHTTPProbe(url *url.URL, headers http.Header, client HTTPGetInterface) (probe.Result, string, error) { + req, err := http.NewRequest("GET", url.String(), nil) + if err != nil { + // Convert errors into failures to catch timeouts. + return probe.Failure, err.Error(), nil + } + req.Header = headers + res, err := client.Do(req) if err != nil { // Convert errors into failures to catch timeouts. return probe.Failure, err.Error(), nil diff --git a/pkg/probe/http/http_test.go b/pkg/probe/http/http_test.go index 7392d99f7f9..018086c50f3 100644 --- a/pkg/probe/http/http_test.go +++ b/pkg/probe/http/http_test.go @@ -42,8 +42,8 @@ func containsAny(s string, substrs []string) bool { } func TestHTTPProbeChecker(t *testing.T) { - handleReq := func(s int, body string) func(w http.ResponseWriter) { - return func(w http.ResponseWriter) { + handleReq := func(s int, body string) func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(s) w.Write([]byte(body)) } @@ -51,8 +51,9 @@ func TestHTTPProbeChecker(t *testing.T) { prober := New() testCases := []struct { - handler func(w http.ResponseWriter) - health probe.Result + handler func(w http.ResponseWriter, r *http.Request) + reqHeaders http.Header + health probe.Result // go1.5: error message changed for timeout, need to support // both old and new accBodies []string @@ -60,18 +61,41 @@ func TestHTTPProbeChecker(t *testing.T) { // The probe will be filled in below. This is primarily testing that an HTTP GET happens. { handleReq(http.StatusOK, "ok body"), + nil, probe.Success, []string{"ok body"}, }, + { + // Echo handler that returns the contents of request headers in the body + func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + output := "" + for k, arr := range r.Header { + for _, v := range arr { + output += fmt.Sprintf("%s: %s\n", k, v) + } + } + w.Write([]byte(output)) + }, + http.Header{ + "X-Muffins-Or-Cupcakes": {"muffins"}, + }, + probe.Success, + []string{ + "X-Muffins-Or-Cupcakes: muffins", + }, + }, { handleReq(FailureCode, "fail body"), + nil, probe.Failure, []string{fmt.Sprintf("HTTP probe failed with statuscode: %d", FailureCode)}, }, { - func(w http.ResponseWriter) { + func(w http.ResponseWriter, r *http.Request) { time.Sleep(3 * time.Second) }, + nil, probe.Failure, []string{ "use of closed network connection", @@ -82,7 +106,7 @@ func TestHTTPProbeChecker(t *testing.T) { for _, test := range testCases { // TODO: Close() this when fix #19254 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - test.handler(w) + test.handler(w, r) })) u, err := url.Parse(server.URL) if err != nil { @@ -96,7 +120,7 @@ func TestHTTPProbeChecker(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %v", err) } - health, output, err := prober.Probe(u, 1*time.Second) + health, output, err := prober.Probe(u, test.reqHeaders, 1*time.Second) if test.health == probe.Unknown && err == nil { t.Errorf("Expected error") } diff --git a/pkg/probe/tcp/tcp_test.go b/pkg/probe/tcp/tcp_test.go index 1268585be14..298de5acf7f 100644 --- a/pkg/probe/tcp/tcp_test.go +++ b/pkg/probe/tcp/tcp_test.go @@ -79,7 +79,7 @@ func TestTcpHealthChecker(t *testing.T) { t.Errorf("#%d: expected error=%v, get=%v", i, tt.expectedError, err) } if !containsAny(output, tt.expectedOutputs) { - t.Errorf("#%d: expected output=one of %#v, get=%s", tt.expectedOutputs, output) + t.Errorf("#%d: expected output=one of %#v, get=%s", i, tt.expectedOutputs, output) } } } diff --git a/pkg/proxy/config/config.go b/pkg/proxy/config/config.go index 7e6b1858220..2181ca93f78 100644 --- a/pkg/proxy/config/config.go +++ b/pkg/proxy/config/config.go @@ -82,7 +82,11 @@ type EndpointsConfig struct { // NewEndpointsConfig creates a new EndpointsConfig. // It immediately runs the created EndpointsConfig. func NewEndpointsConfig() *EndpointsConfig { - updates := make(chan struct{}) + // The updates channel is used to send interrupts to the Endpoints handler. + // It's buffered because we never want to block for as long as there is a + // pending interrupt, but don't want to drop them if the handler is doing + // work. + updates := make(chan struct{}, 1) store := &endpointsStore{updates: updates, endpoints: make(map[string]map[types.NamespacedName]api.Endpoints)} mux := config.NewMux(store) bcaster := config.NewBroadcaster() @@ -128,19 +132,19 @@ func (s *endpointsStore) Merge(source string, change interface{}) error { update := change.(EndpointsUpdate) switch update.Op { case ADD: - glog.V(4).Infof("Adding new endpoint from source %s : %s", source, spew.Sdump(update.Endpoints)) + glog.V(5).Infof("Adding new endpoint from source %s : %s", source, spew.Sdump(update.Endpoints)) for _, value := range update.Endpoints { name := types.NamespacedName{Namespace: value.Namespace, Name: value.Name} endpoints[name] = value } case REMOVE: - glog.V(4).Infof("Removing an endpoint %s", spew.Sdump(update)) + glog.V(5).Infof("Removing an endpoint %s", spew.Sdump(update)) for _, value := range update.Endpoints { name := types.NamespacedName{Namespace: value.Namespace, Name: value.Name} delete(endpoints, name) } case SET: - glog.V(4).Infof("Setting endpoints %s", spew.Sdump(update)) + glog.V(5).Infof("Setting endpoints %s", spew.Sdump(update)) // Clear the old map entries by just creating a new map endpoints = make(map[types.NamespacedName]api.Endpoints) for _, value := range update.Endpoints { @@ -153,7 +157,13 @@ func (s *endpointsStore) Merge(source string, change interface{}) error { s.endpoints[source] = endpoints s.endpointLock.Unlock() if s.updates != nil { - s.updates <- struct{}{} + // Since we record the snapshot before sending this signal, it's + // possible that the consumer ends up performing an extra update. + select { + case s.updates <- struct{}{}: + default: + glog.V(4).Infof("Endpoints handler already has a pending interrupt.") + } } return nil } @@ -181,7 +191,11 @@ type ServiceConfig struct { // NewServiceConfig creates a new ServiceConfig. // It immediately runs the created ServiceConfig. func NewServiceConfig() *ServiceConfig { - updates := make(chan struct{}) + // The updates channel is used to send interrupts to the Services handler. + // It's buffered because we never want to block for as long as there is a + // pending interrupt, but don't want to drop them if the handler is doing + // work. + updates := make(chan struct{}, 1) store := &serviceStore{updates: updates, services: make(map[string]map[types.NamespacedName]api.Service)} mux := config.NewMux(store) bcaster := config.NewBroadcaster() @@ -227,19 +241,19 @@ func (s *serviceStore) Merge(source string, change interface{}) error { update := change.(ServiceUpdate) switch update.Op { case ADD: - glog.V(4).Infof("Adding new service from source %s : %s", source, spew.Sdump(update.Services)) + glog.V(5).Infof("Adding new service from source %s : %s", source, spew.Sdump(update.Services)) for _, value := range update.Services { name := types.NamespacedName{Namespace: value.Namespace, Name: value.Name} services[name] = value } case REMOVE: - glog.V(4).Infof("Removing a service %s", spew.Sdump(update)) + glog.V(5).Infof("Removing a service %s", spew.Sdump(update)) for _, value := range update.Services { name := types.NamespacedName{Namespace: value.Namespace, Name: value.Name} delete(services, name) } case SET: - glog.V(4).Infof("Setting services %s", spew.Sdump(update)) + glog.V(5).Infof("Setting services %s", spew.Sdump(update)) // Clear the old map entries by just creating a new map services = make(map[types.NamespacedName]api.Service) for _, value := range update.Services { @@ -252,7 +266,13 @@ func (s *serviceStore) Merge(source string, change interface{}) error { s.services[source] = services s.serviceLock.Unlock() if s.updates != nil { - s.updates <- struct{}{} + // Since we record the snapshot before sending this signal, it's + // possible that the consumer ends up performing an extra update. + select { + case s.updates <- struct{}{}: + default: + glog.V(4).Infof("Service handler already has a pending interrupt.") + } } return nil } diff --git a/pkg/proxy/config/config_test.go b/pkg/proxy/config/config_test.go index 8dd373b18de..7855a93ec9c 100644 --- a/pkg/proxy/config/config_test.go +++ b/pkg/proxy/config/config_test.go @@ -19,11 +19,12 @@ package config_test import ( "reflect" "sort" - "sync" "testing" + "time" "k8s.io/kubernetes/pkg/api" . "k8s.io/kubernetes/pkg/proxy/config" + "k8s.io/kubernetes/pkg/util/wait" ) const TomcatPort int = 8080 @@ -49,31 +50,39 @@ func (s sortedServices) Less(i, j int) bool { } type ServiceHandlerMock struct { - services []api.Service - updated sync.WaitGroup + updated chan []api.Service + waits int } func NewServiceHandlerMock() *ServiceHandlerMock { - return &ServiceHandlerMock{services: make([]api.Service, 0)} + return &ServiceHandlerMock{updated: make(chan []api.Service, 5)} } func (h *ServiceHandlerMock) OnServiceUpdate(services []api.Service) { sort.Sort(sortedServices(services)) - h.services = services - h.updated.Done() + h.updated <- services } func (h *ServiceHandlerMock) ValidateServices(t *testing.T, expectedServices []api.Service) { - h.updated.Wait() - if !reflect.DeepEqual(h.services, expectedServices) { - t.Errorf("Expected %#v, Got %#v", expectedServices, h.services) + // We might get 1 or more updates for N service updates, because we + // over write older snapshots of services from the producer go-routine + // if the consumer falls behind. + var services []api.Service + for { + select { + case services = <-h.updated: + if reflect.DeepEqual(services, expectedServices) { + return + } + // Unittests will hard timeout in 5m with a stack trace, prevent that + // and surface a clearer reason for failure. + case <-time.After(wait.ForeverTestTimeout): + t.Errorf("Timed out. Expected %#v, Got %#v", expectedServices, services) + return + } } } -func (h *ServiceHandlerMock) Wait(waits int) { - h.updated.Add(waits) -} - type sortedEndpoints []api.Endpoints func (s sortedEndpoints) Len() int { @@ -87,31 +96,39 @@ func (s sortedEndpoints) Less(i, j int) bool { } type EndpointsHandlerMock struct { - endpoints []api.Endpoints - updated sync.WaitGroup + updated chan []api.Endpoints + waits int } func NewEndpointsHandlerMock() *EndpointsHandlerMock { - return &EndpointsHandlerMock{endpoints: make([]api.Endpoints, 0)} + return &EndpointsHandlerMock{updated: make(chan []api.Endpoints, 5)} } func (h *EndpointsHandlerMock) OnEndpointsUpdate(endpoints []api.Endpoints) { sort.Sort(sortedEndpoints(endpoints)) - h.endpoints = endpoints - h.updated.Done() + h.updated <- endpoints } func (h *EndpointsHandlerMock) ValidateEndpoints(t *testing.T, expectedEndpoints []api.Endpoints) { - h.updated.Wait() - if !reflect.DeepEqual(h.endpoints, expectedEndpoints) { - t.Errorf("Expected %#v, Got %#v", expectedEndpoints, h.endpoints) + // We might get 1 or more updates for N endpoint updates, because we + // over write older snapshots of endpoints from the producer go-routine + // if the consumer falls behind. Unittests will hard timeout in 5m. + var endpoints []api.Endpoints + for { + select { + case endpoints = <-h.updated: + if reflect.DeepEqual(endpoints, expectedEndpoints) { + return + } + // Unittests will hard timeout in 5m with a stack trace, prevent that + // and surface a clearer reason for failure. + case <-time.After(wait.ForeverTestTimeout): + t.Errorf("Timed out. Expected %#v, Got %#v", expectedEndpoints, endpoints) + return + } } } -func (h *EndpointsHandlerMock) Wait(waits int) { - h.updated.Add(waits) -} - func CreateServiceUpdate(op Operation, services ...api.Service) ServiceUpdate { ret := ServiceUpdate{Op: op} ret.Services = make([]api.Service, len(services)) @@ -134,7 +151,6 @@ func TestNewServiceAddedAndNotified(t *testing.T) { config := NewServiceConfig() channel := config.Channel("one") handler := NewServiceHandlerMock() - handler.Wait(1) config.RegisterHandler(handler) serviceUpdate := CreateServiceUpdate(ADD, api.Service{ ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "foo"}, @@ -154,7 +170,6 @@ func TestServiceAddedRemovedSetAndNotified(t *testing.T) { ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "foo"}, Spec: api.ServiceSpec{Ports: []api.ServicePort{{Protocol: "TCP", Port: 10}}}, }) - handler.Wait(1) channel <- serviceUpdate handler.ValidateServices(t, serviceUpdate.Services) @@ -162,7 +177,6 @@ func TestServiceAddedRemovedSetAndNotified(t *testing.T) { ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "bar"}, Spec: api.ServiceSpec{Ports: []api.ServicePort{{Protocol: "TCP", Port: 20}}}, }) - handler.Wait(1) channel <- serviceUpdate2 services := []api.Service{serviceUpdate2.Services[0], serviceUpdate.Services[0]} handler.ValidateServices(t, services) @@ -170,7 +184,6 @@ func TestServiceAddedRemovedSetAndNotified(t *testing.T) { serviceUpdate3 := CreateServiceUpdate(REMOVE, api.Service{ ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "foo"}, }) - handler.Wait(1) channel <- serviceUpdate3 services = []api.Service{serviceUpdate2.Services[0]} handler.ValidateServices(t, services) @@ -179,7 +192,6 @@ func TestServiceAddedRemovedSetAndNotified(t *testing.T) { ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "foobar"}, Spec: api.ServiceSpec{Ports: []api.ServicePort{{Protocol: "TCP", Port: 99}}}, }) - handler.Wait(1) channel <- serviceUpdate4 services = []api.Service{serviceUpdate4.Services[0]} handler.ValidateServices(t, services) @@ -202,7 +214,6 @@ func TestNewMultipleSourcesServicesAddedAndNotified(t *testing.T) { ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "bar"}, Spec: api.ServiceSpec{Ports: []api.ServicePort{{Protocol: "TCP", Port: 20}}}, }) - handler.Wait(2) channelOne <- serviceUpdate1 channelTwo <- serviceUpdate2 services := []api.Service{serviceUpdate2.Services[0], serviceUpdate1.Services[0]} @@ -225,8 +236,6 @@ func TestNewMultipleSourcesServicesMultipleHandlersAddedAndNotified(t *testing.T ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "bar"}, Spec: api.ServiceSpec{Ports: []api.ServicePort{{Protocol: "TCP", Port: 20}}}, }) - handler.Wait(2) - handler2.Wait(2) channelOne <- serviceUpdate1 channelTwo <- serviceUpdate2 services := []api.Service{serviceUpdate2.Services[0], serviceUpdate1.Services[0]} @@ -256,8 +265,6 @@ func TestNewMultipleSourcesEndpointsMultipleHandlersAddedAndNotified(t *testing. Ports: []api.EndpointPort{{Port: 80}}, }}, }) - handler.Wait(2) - handler2.Wait(2) channelOne <- endpointsUpdate1 channelTwo <- endpointsUpdate2 @@ -288,8 +295,6 @@ func TestNewMultipleSourcesEndpointsMultipleHandlersAddRemoveSetAndNotified(t *t Ports: []api.EndpointPort{{Port: 80}}, }}, }) - handler.Wait(2) - handler2.Wait(2) channelOne <- endpointsUpdate1 channelTwo <- endpointsUpdate2 @@ -305,8 +310,6 @@ func TestNewMultipleSourcesEndpointsMultipleHandlersAddRemoveSetAndNotified(t *t Ports: []api.EndpointPort{{Port: 80}}, }}, }) - handler.Wait(1) - handler2.Wait(1) channelTwo <- endpointsUpdate3 endpoints = []api.Endpoints{endpointsUpdate2.Endpoints[0], endpointsUpdate1.Endpoints[0], endpointsUpdate3.Endpoints[0]} handler.ValidateEndpoints(t, endpoints) @@ -320,8 +323,6 @@ func TestNewMultipleSourcesEndpointsMultipleHandlersAddRemoveSetAndNotified(t *t Ports: []api.EndpointPort{{Port: 80}}, }}, }) - handler.Wait(1) - handler2.Wait(1) channelOne <- endpointsUpdate1 endpoints = []api.Endpoints{endpointsUpdate2.Endpoints[0], endpointsUpdate1.Endpoints[0], endpointsUpdate3.Endpoints[0]} handler.ValidateEndpoints(t, endpoints) @@ -329,11 +330,14 @@ func TestNewMultipleSourcesEndpointsMultipleHandlersAddRemoveSetAndNotified(t *t // Remove "bar" service endpointsUpdate2 = CreateEndpointsUpdate(REMOVE, api.Endpoints{ObjectMeta: api.ObjectMeta{Namespace: "testnamespace", Name: "bar"}}) - handler.Wait(1) - handler2.Wait(1) channelTwo <- endpointsUpdate2 endpoints = []api.Endpoints{endpointsUpdate1.Endpoints[0], endpointsUpdate3.Endpoints[0]} handler.ValidateEndpoints(t, endpoints) handler2.ValidateEndpoints(t, endpoints) } + +// TODO: Add a unittest for interrupts getting processed in a timely manner. +// Currently this module has a circular dependency with config, and so it's +// named config_test, which means even test methods need to be public. This +// is refactoring that we can avoid by resolving the dependency. diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 236aeebf300..6c4f0ede9d9 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -54,13 +54,20 @@ import ( const iptablesMinVersion = utiliptables.MinCheckVersion // the services chain -const iptablesServicesChain utiliptables.Chain = "KUBE-SERVICES" +const kubeServicesChain utiliptables.Chain = "KUBE-SERVICES" // the nodeports chain -const iptablesNodePortsChain utiliptables.Chain = "KUBE-NODEPORTS" +const kubeNodePortsChain utiliptables.Chain = "KUBE-NODEPORTS" + +// the kubernetes postrouting chain +const kubePostroutingChain utiliptables.Chain = "KUBE-POSTROUTING" + +// the mark-for-masquerade chain +const kubeMarkMasqChain utiliptables.Chain = "KUBE-MARK-MASQ" // the mark we apply to traffic needing SNAT -const iptablesMasqueradeMark = "0x4d415351" +// TODO(thockin): Remove this for v1.3 or v1.4. +const oldIptablesMasqueradeMark = "0x4d415351" // IptablesVersioner can query the current iptables version. type IptablesVersioner interface { @@ -68,12 +75,18 @@ type IptablesVersioner interface { GetVersion() (string, error) } +// KernelCompatTester tests whether the required kernel capabilities are +// present to run the iptables proxier. +type KernelCompatTester interface { + IsCompatible() error +} + // CanUseIptablesProxier returns true if we should use the iptables Proxier // instead of the "classic" userspace Proxier. This is determined by checking // the iptables version and for the existence of kernel features. It may return // an error if it fails to get the iptables version without error, in which // case it will also return false. -func CanUseIptablesProxier(iptver IptablesVersioner) (bool, error) { +func CanUseIptablesProxier(iptver IptablesVersioner, kcompat KernelCompatTester) (bool, error) { minVersion, err := semver.NewVersion(iptablesMinVersion) if err != nil { return false, err @@ -91,18 +104,23 @@ func CanUseIptablesProxier(iptver IptablesVersioner) (bool, error) { return false, nil } - // Check for the required sysctls. We don't care about the value, just - // that it exists. If this Proxier is chosen, we'll iniialize it as we - // need. - // TODO: we should inject a sysctl.Interface like we do for iptables - _, err = utilsysctl.GetSysctl(sysctlRouteLocalnet) - if err != nil { + // Check that the kernel supports what we need. + if err := kcompat.IsCompatible(); err != nil { return false, err } - return true, nil } +type LinuxKernelCompatTester struct{} + +func (lkct LinuxKernelCompatTester) IsCompatible() error { + // Check for the required sysctls. We don't care about the value, just + // that it exists. If this Proxier is chosen, we'll initialize it as we + // need. + _, err := utilsysctl.GetSysctl(sysctlRouteLocalnet) + return err +} + const sysctlRouteLocalnet = "net/ipv4/conf/all/route_localnet" const sysctlBridgeCallIptables = "net/bridge/bridge-nf-call-iptables" @@ -115,8 +133,7 @@ type serviceInfo struct { loadBalancerStatus api.LoadBalancerStatus sessionAffinityType api.ServiceAffinity stickyMaxAgeSeconds int - // Deprecated, but required for back-compat (including e2e) - externalIPs []string + externalIPs []string } // returns a new serviceInfo struct @@ -138,9 +155,10 @@ type Proxier struct { haveReceivedEndpointsUpdate bool // true once we've seen an OnEndpointsUpdate event // These are effectively const and do not need the mutex to be held. - syncPeriod time.Duration - iptables utiliptables.Interface - masqueradeAll bool + syncPeriod time.Duration + iptables utiliptables.Interface + masqueradeAll bool + masqueradeMark string } type localPort struct { @@ -166,7 +184,7 @@ var _ proxy.ProxyProvider = &Proxier{} // An error will be returned if iptables fails to update or acquire the initial lock. // Once a proxier is created, it will keep iptables up to date in the background and // will not terminate if a particular iptables call fails. -func NewProxier(ipt utiliptables.Interface, exec utilexec.Interface, syncPeriod time.Duration, masqueradeAll bool) (*Proxier, error) { +func NewProxier(ipt utiliptables.Interface, exec utilexec.Interface, syncPeriod time.Duration, masqueradeAll bool, masqueradeBit int) (*Proxier, error) { // Set the route_localnet sysctl we need for if err := utilsysctl.SetSysctl(sysctlRouteLocalnet, 1); err != nil { return nil, fmt.Errorf("can't set sysctl %s: %v", sysctlRouteLocalnet, err) @@ -180,50 +198,122 @@ func NewProxier(ipt utiliptables.Interface, exec utilexec.Interface, syncPeriod glog.Warningf("can't set sysctl %s: %v", sysctlBridgeCallIptables, err) } + // Generate the masquerade mark to use for SNAT rules. + if masqueradeBit < 0 || masqueradeBit > 31 { + return nil, fmt.Errorf("invalid iptables-masquerade-bit %v not in [0, 31]", masqueradeBit) + } + masqueradeValue := 1 << uint(masqueradeBit) + masqueradeMark := fmt.Sprintf("%#08x/%#08x", masqueradeValue, masqueradeValue) + return &Proxier{ - serviceMap: make(map[proxy.ServicePortName]*serviceInfo), - endpointsMap: make(map[proxy.ServicePortName][]string), - portsMap: make(map[localPort]closeable), - syncPeriod: syncPeriod, - iptables: ipt, - masqueradeAll: masqueradeAll, + serviceMap: make(map[proxy.ServicePortName]*serviceInfo), + endpointsMap: make(map[proxy.ServicePortName][]string), + portsMap: make(map[localPort]closeable), + syncPeriod: syncPeriod, + iptables: ipt, + masqueradeAll: masqueradeAll, + masqueradeMark: masqueradeMark, }, nil } // CleanupLeftovers removes all iptables rules and chains created by the Proxier // It returns true if an error was encountered. Errors are logged. func CleanupLeftovers(ipt utiliptables.Interface) (encounteredError bool) { - //TODO: actually tear down all rules and chains. - args := []string{"-m", "comment", "--comment", "kubernetes service portals", "-j", string(iptablesServicesChain)} - if err := ipt.DeleteRule(utiliptables.TableNAT, utiliptables.ChainOutput, args...); err != nil { - glog.Errorf("Error removing pure-iptables proxy rule: %v", err) - encounteredError = true + // Unlink the services chain. + args := []string{ + "-m", "comment", "--comment", "kubernetes service portals", + "-j", string(kubeServicesChain), } - if err := ipt.DeleteRule(utiliptables.TableNAT, utiliptables.ChainPrerouting, args...); err != nil { - glog.Errorf("Error removing pure-iptables proxy rule: %v", err) - encounteredError = true + tableChainsWithJumpServices := []struct { + table utiliptables.Table + chain utiliptables.Chain + }{ + {utiliptables.TableFilter, utiliptables.ChainOutput}, + {utiliptables.TableNAT, utiliptables.ChainOutput}, + {utiliptables.TableNAT, utiliptables.ChainPrerouting}, } - - args = []string{"-m", "comment", "--comment", "kubernetes service traffic requiring SNAT", "-m", "mark", "--mark", iptablesMasqueradeMark, "-j", "MASQUERADE"} - if err := ipt.DeleteRule(utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { - glog.Errorf("Error removing pure-iptables proxy rule: %v", err) - encounteredError = true - } - - // flush and delete chains. - chains := []utiliptables.Chain{iptablesServicesChain, iptablesNodePortsChain} - for _, c := range chains { - // flush chain, then if sucessful delete, delete will fail if flush fails. - if err := ipt.FlushChain(utiliptables.TableNAT, c); err != nil { - glog.Errorf("Error flushing pure-iptables proxy chain: %v", err) - encounteredError = true - } else { - if err = ipt.DeleteChain(utiliptables.TableNAT, c); err != nil { - glog.Errorf("Error deleting pure-iptables proxy chain: %v", err) + for _, tc := range tableChainsWithJumpServices { + if err := ipt.DeleteRule(tc.table, tc.chain, args...); err != nil { + if !utiliptables.IsNotFoundError(err) { + glog.Errorf("Error removing pure-iptables proxy rule: %v", err) encounteredError = true } } } + + // Unlink the postrouting chain. + args = []string{ + "-m", "comment", "--comment", "kubernetes postrouting rules", + "-j", string(kubePostroutingChain), + } + if err := ipt.DeleteRule(utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { + if !utiliptables.IsNotFoundError(err) { + glog.Errorf("Error removing pure-iptables proxy rule: %v", err) + encounteredError = true + } + } + + // Flush and remove all of our chains. + if iptablesSaveRaw, err := ipt.Save(utiliptables.TableNAT); err != nil { + glog.Errorf("Failed to execute iptables-save for %s: %v", utiliptables.TableNAT, err) + encounteredError = true + } else { + existingNATChains := getChainLines(utiliptables.TableNAT, iptablesSaveRaw) + natChains := bytes.NewBuffer(nil) + natRules := bytes.NewBuffer(nil) + writeLine(natChains, "*nat") + // Start with chains we know we need to remove. + for _, chain := range []utiliptables.Chain{kubeServicesChain, kubeNodePortsChain, kubePostroutingChain, kubeMarkMasqChain} { + if _, found := existingNATChains[chain]; found { + chainString := string(chain) + writeLine(natChains, existingNATChains[chain]) // flush + writeLine(natRules, "-X", chainString) // delete + } + } + // Hunt for service and endpoint chains. + for chain := range existingNATChains { + chainString := string(chain) + if strings.HasPrefix(chainString, "KUBE-SVC-") || strings.HasPrefix(chainString, "KUBE-SEP-") { + writeLine(natChains, existingNATChains[chain]) // flush + writeLine(natRules, "-X", chainString) // delete + } + } + writeLine(natRules, "COMMIT") + natLines := append(natChains.Bytes(), natRules.Bytes()...) + // Write it. + err = ipt.Restore(utiliptables.TableNAT, natLines, utiliptables.NoFlushTables, utiliptables.RestoreCounters) + if err != nil { + glog.Errorf("Failed to execute iptables-restore for %s: %v", utiliptables.TableNAT, err) + encounteredError = true + } + } + { + filterBuf := bytes.NewBuffer(nil) + writeLine(filterBuf, "*filter") + writeLine(filterBuf, fmt.Sprintf(":%s - [0:0]", kubeServicesChain)) + writeLine(filterBuf, fmt.Sprintf("-X %s", kubeServicesChain)) + writeLine(filterBuf, "COMMIT") + // Write it. + if err := ipt.Restore(utiliptables.TableFilter, filterBuf.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters); err != nil { + glog.Errorf("Failed to execute iptables-restore for %s: %v", utiliptables.TableFilter, err) + encounteredError = true + } + } + + // Clean up the older SNAT rule which was directly in POSTROUTING. + // TODO(thockin): Remove this for v1.3 or v1.4. + args = []string{ + "-m", "comment", "--comment", "kubernetes service traffic requiring SNAT", + "-m", "mark", "--mark", oldIptablesMasqueradeMark, + "-j", "MASQUERADE", + } + if err := ipt.DeleteRule(utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { + if !utiliptables.IsNotFoundError(err) { + glog.Errorf("Error removing old-style SNAT rule: %v", err) + encounteredError = true + } + } + return encounteredError } @@ -279,6 +369,10 @@ func (proxier *Proxier) SyncLoop() { // OnServiceUpdate tracks the active set of service proxies. // They will be synchronized using syncProxyRules() func (proxier *Proxier) OnServiceUpdate(allServices []api.Service) { + start := time.Now() + defer func() { + glog.V(4).Infof("OnServiceUpdate took %v for %d services", time.Since(start), len(allServices)) + }() proxier.mu.Lock() defer proxier.mu.Unlock() proxier.haveReceivedServiceUpdate = true @@ -316,7 +410,6 @@ func (proxier *Proxier) OnServiceUpdate(allServices []api.Service) { glog.V(3).Infof("Something changed for service %q: removing it", serviceName) delete(proxier.serviceMap, serviceName) } - serviceIP := net.ParseIP(service.Spec.ClusterIP) glog.V(1).Infof("Adding new service %q at %s:%d/%s", serviceName, serviceIP, servicePort.Port, servicePort.Protocol) info = newServiceInfo(serviceName) @@ -347,6 +440,11 @@ func (proxier *Proxier) OnServiceUpdate(allServices []api.Service) { // OnEndpointsUpdate takes in a slice of updated endpoints. func (proxier *Proxier) OnEndpointsUpdate(allEndpoints []api.Endpoints) { + start := time.Now() + defer func() { + glog.V(4).Infof("OnEndpointsUpdate took %v for %d endpoints", time.Since(start), len(allEndpoints)) + }() + proxier.mu.Lock() defer proxier.mu.Unlock() proxier.haveReceivedEndpointsUpdate = true @@ -451,6 +549,10 @@ func servicePortEndpointChainName(s proxy.ServicePortName, protocol string, endp // The only other iptables rules are those that are setup in iptablesInit() // assumes proxier.mu is held func (proxier *Proxier) syncProxyRules() { + start := time.Now() + defer func() { + glog.V(4).Infof("syncProxyRules took %v", time.Since(start)) + }() // don't sync rules till we've received services and endpoints if !proxier.haveReceivedEndpointsUpdate || !proxier.haveReceivedServiceUpdate { glog.V(2).Info("Not syncing iptables until Services and Endpoints have been received from master") @@ -458,62 +560,124 @@ func (proxier *Proxier) syncProxyRules() { } glog.V(3).Infof("Syncing iptables rules") - // Ensure main chains and rules are installed. - inputChains := []utiliptables.Chain{utiliptables.ChainOutput, utiliptables.ChainPrerouting} - // Link the services chain. - for _, chain := range inputChains { - if _, err := proxier.iptables.EnsureChain(utiliptables.TableNAT, iptablesServicesChain); err != nil { - glog.Errorf("Failed to ensure that chain %s exists: %v", iptablesServicesChain, err) - return + // Create and link the kube services chain. + { + tablesNeedServicesChain := []utiliptables.Table{utiliptables.TableFilter, utiliptables.TableNAT} + for _, table := range tablesNeedServicesChain { + if _, err := proxier.iptables.EnsureChain(table, kubeServicesChain); err != nil { + glog.Errorf("Failed to ensure that %s chain %s exists: %v", table, kubeServicesChain, err) + return + } + } + + tableChainsNeedJumpServices := []struct { + table utiliptables.Table + chain utiliptables.Chain + }{ + {utiliptables.TableFilter, utiliptables.ChainOutput}, + {utiliptables.TableNAT, utiliptables.ChainOutput}, + {utiliptables.TableNAT, utiliptables.ChainPrerouting}, } comment := "kubernetes service portals" - args := []string{"-m", "comment", "--comment", comment, "-j", string(iptablesServicesChain)} - if _, err := proxier.iptables.EnsureRule(utiliptables.Prepend, utiliptables.TableNAT, chain, args...); err != nil { - glog.Errorf("Failed to ensure that chain %s jumps to %s: %v", chain, iptablesServicesChain, err) - return + args := []string{"-m", "comment", "--comment", comment, "-j", string(kubeServicesChain)} + for _, tc := range tableChainsNeedJumpServices { + if _, err := proxier.iptables.EnsureRule(utiliptables.Prepend, tc.table, tc.chain, args...); err != nil { + glog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", tc.table, tc.chain, kubeServicesChain, err) + return + } } } - // Link the output rules. + + // Create and link the kube postrouting chain. { - comment := "kubernetes service traffic requiring SNAT" - args := []string{"-m", "comment", "--comment", comment, "-m", "mark", "--mark", iptablesMasqueradeMark, "-j", "MASQUERADE"} - if _, err := proxier.iptables.EnsureRule(utiliptables.Append, utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { - glog.Errorf("Failed to ensure that chain %s obeys MASQUERADE mark: %v", utiliptables.ChainPostrouting, err) + if _, err := proxier.iptables.EnsureChain(utiliptables.TableNAT, kubePostroutingChain); err != nil { + glog.Errorf("Failed to ensure that %s chain %s exists: %v", utiliptables.TableNAT, kubePostroutingChain, err) + return + } + + comment := "kubernetes postrouting rules" + args := []string{"-m", "comment", "--comment", comment, "-j", string(kubePostroutingChain)} + if _, err := proxier.iptables.EnsureRule(utiliptables.Prepend, utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { + glog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", utiliptables.TableNAT, utiliptables.ChainPostrouting, kubePostroutingChain, err) return } } // Get iptables-save output so we can check for existing chains and rules. // This will be a map of chain name to chain with rules as stored in iptables-save/iptables-restore - existingChains := make(map[utiliptables.Chain]string) - iptablesSaveRaw, err := proxier.iptables.Save(utiliptables.TableNAT) + existingFilterChains := make(map[utiliptables.Chain]string) + iptablesSaveRaw, err := proxier.iptables.Save(utiliptables.TableFilter) if err != nil { // if we failed to get any rules - glog.Errorf("Failed to execute iptables-save, syncing all rules. %s", err.Error()) + glog.Errorf("Failed to execute iptables-save, syncing all rules: %v", err) } else { // otherwise parse the output - existingChains = getChainLines(utiliptables.TableNAT, iptablesSaveRaw) + existingFilterChains = getChainLines(utiliptables.TableFilter, iptablesSaveRaw) } - chainsLines := bytes.NewBuffer(nil) - rulesLines := bytes.NewBuffer(nil) + existingNATChains := make(map[utiliptables.Chain]string) + iptablesSaveRaw, err = proxier.iptables.Save(utiliptables.TableNAT) + if err != nil { // if we failed to get any rules + glog.Errorf("Failed to execute iptables-save, syncing all rules: %v", err) + } else { // otherwise parse the output + existingNATChains = getChainLines(utiliptables.TableNAT, iptablesSaveRaw) + } - // Write table header. - writeLine(chainsLines, "*nat") + filterChains := bytes.NewBuffer(nil) + filterRules := bytes.NewBuffer(nil) + natChains := bytes.NewBuffer(nil) + natRules := bytes.NewBuffer(nil) + + // Write table headers. + writeLine(filterChains, "*filter") + writeLine(natChains, "*nat") // Make sure we keep stats for the top-level chains, if they existed - // (which they should have because we created them above). - if chain, ok := existingChains[iptablesServicesChain]; ok { - writeLine(chainsLines, chain) + // (which most should have because we created them above). + if chain, ok := existingFilterChains[kubeServicesChain]; ok { + writeLine(filterChains, chain) } else { - writeLine(chainsLines, makeChainLine(iptablesServicesChain)) + writeLine(filterChains, makeChainLine(kubeServicesChain)) } - if chain, ok := existingChains[iptablesNodePortsChain]; ok { - writeLine(chainsLines, chain) + if chain, ok := existingNATChains[kubeServicesChain]; ok { + writeLine(natChains, chain) } else { - writeLine(chainsLines, makeChainLine(iptablesNodePortsChain)) + writeLine(natChains, makeChainLine(kubeServicesChain)) + } + if chain, ok := existingNATChains[kubeNodePortsChain]; ok { + writeLine(natChains, chain) + } else { + writeLine(natChains, makeChainLine(kubeNodePortsChain)) + } + if chain, ok := existingNATChains[kubePostroutingChain]; ok { + writeLine(natChains, chain) + } else { + writeLine(natChains, makeChainLine(kubePostroutingChain)) + } + if chain, ok := existingNATChains[kubeMarkMasqChain]; ok { + writeLine(natChains, chain) + } else { + writeLine(natChains, makeChainLine(kubeMarkMasqChain)) } - // Accumulate chains to keep. - activeChains := map[utiliptables.Chain]bool{} // use a map as a set + // Install the kubernetes-specific postrouting rules. We use a whole chain for + // this so that it is easier to flush and change, for example if the mark + // value should ever change. + writeLine(natRules, []string{ + "-A", string(kubePostroutingChain), + "-m", "comment", "--comment", `"kubernetes service traffic requiring SNAT"`, + "-m", "mark", "--mark", proxier.masqueradeMark, + "-j", "MASQUERADE", + }...) + + // Install the kubernetes-specific masquerade mark rule. We use a whole chain for + // this so that it is easier to flush and change, for example if the mark + // value should ever change. + writeLine(natRules, []string{ + "-A", string(kubeMarkMasqChain), + "-j", "MARK", "--set-xmark", proxier.masqueradeMark, + }...) + + // Accumulate NAT chains to keep. + activeNATChains := map[utiliptables.Chain]bool{} // use a map as a set // Accumulate new local ports that we have opened. newLocalPorts := map[localPort]closeable{} @@ -524,27 +688,25 @@ func (proxier *Proxier) syncProxyRules() { // Create the per-service chain, retaining counters if possible. svcChain := servicePortChainName(svcName, protocol) - if chain, ok := existingChains[svcChain]; ok { - writeLine(chainsLines, chain) + if chain, ok := existingNATChains[svcChain]; ok { + writeLine(natChains, chain) } else { - writeLine(chainsLines, makeChainLine(svcChain)) + writeLine(natChains, makeChainLine(svcChain)) } - activeChains[svcChain] = true + activeNATChains[svcChain] = true // Capture the clusterIP. args := []string{ - "-A", string(iptablesServicesChain), - "-m", "comment", "--comment", fmt.Sprintf("\"%s cluster IP\"", svcName.String()), + "-A", string(kubeServicesChain), + "-m", "comment", "--comment", fmt.Sprintf(`"%s cluster IP"`, svcName.String()), "-m", protocol, "-p", protocol, "-d", fmt.Sprintf("%s/32", svcInfo.clusterIP.String()), "--dport", fmt.Sprintf("%d", svcInfo.port), } if proxier.masqueradeAll { - writeLine(rulesLines, append(args, - "-j", "MARK", "--set-xmark", fmt.Sprintf("%s/0xffffffff", iptablesMasqueradeMark))...) + writeLine(natRules, append(args, "-j", string(kubeMarkMasqChain))...) } - writeLine(rulesLines, append(args, - "-j", string(svcChain))...) + writeLine(natRules, append(args, "-j", string(svcChain))...) // Capture externalIPs. for _, externalIP := range svcInfo.externalIPs { @@ -572,15 +734,14 @@ func (proxier *Proxier) syncProxyRules() { } } // We're holding the port, so it's OK to install iptables rules. args := []string{ - "-A", string(iptablesServicesChain), - "-m", "comment", "--comment", fmt.Sprintf("\"%s external IP\"", svcName.String()), + "-A", string(kubeServicesChain), + "-m", "comment", "--comment", fmt.Sprintf(`"%s external IP"`, svcName.String()), "-m", protocol, "-p", protocol, "-d", fmt.Sprintf("%s/32", externalIP), "--dport", fmt.Sprintf("%d", svcInfo.port), } // We have to SNAT packets to external IPs. - writeLine(rulesLines, append(args, - "-j", "MARK", "--set-xmark", fmt.Sprintf("%s/0xffffffff", iptablesMasqueradeMark))...) + writeLine(natRules, append(args, "-j", string(kubeMarkMasqChain))...) // Allow traffic for external IPs that does not come from a bridge (i.e. not from a container) // nor from a local process to be forwarded to the service. @@ -589,30 +750,26 @@ func (proxier *Proxier) syncProxyRules() { externalTrafficOnlyArgs := append(args, "-m", "physdev", "!", "--physdev-is-in", "-m", "addrtype", "!", "--src-type", "LOCAL") - writeLine(rulesLines, append(externalTrafficOnlyArgs, - "-j", string(svcChain))...) + writeLine(natRules, append(externalTrafficOnlyArgs, "-j", string(svcChain))...) dstLocalOnlyArgs := append(args, "-m", "addrtype", "--dst-type", "LOCAL") // Allow traffic bound for external IPs that happen to be recognized as local IPs to stay local. // This covers cases like GCE load-balancers which get added to the local routing table. - writeLine(rulesLines, append(dstLocalOnlyArgs, - "-j", string(svcChain))...) + writeLine(natRules, append(dstLocalOnlyArgs, "-j", string(svcChain))...) } // Capture load-balancer ingress. for _, ingress := range svcInfo.loadBalancerStatus.Ingress { if ingress.IP != "" { args := []string{ - "-A", string(iptablesServicesChain), - "-m", "comment", "--comment", fmt.Sprintf("\"%s loadbalancer IP\"", svcName.String()), + "-A", string(kubeServicesChain), + "-m", "comment", "--comment", fmt.Sprintf(`"%s loadbalancer IP"`, svcName.String()), "-m", protocol, "-p", protocol, "-d", fmt.Sprintf("%s/32", ingress.IP), "--dport", fmt.Sprintf("%d", svcInfo.port), } // We have to SNAT packets from external IPs. - writeLine(rulesLines, append(args, - "-j", "MARK", "--set-xmark", fmt.Sprintf("%s/0xffffffff", iptablesMasqueradeMark))...) - writeLine(rulesLines, append(args, - "-j", string(svcChain))...) + writeLine(natRules, append(args, "-j", string(kubeMarkMasqChain))...) + writeLine(natRules, append(args, "-j", string(svcChain))...) } } @@ -638,20 +795,30 @@ func (proxier *Proxier) syncProxyRules() { } newLocalPorts[lp] = socket } // We're holding the port, so it's OK to install iptables rules. + + args := []string{ + "-A", string(kubeNodePortsChain), + "-m", "comment", "--comment", svcName.String(), + "-m", protocol, "-p", protocol, + "--dport", fmt.Sprintf("%d", svcInfo.nodePort), + } // Nodeports need SNAT. - writeLine(rulesLines, - "-A", string(iptablesNodePortsChain), - "-m", "comment", "--comment", svcName.String(), - "-m", protocol, "-p", protocol, - "--dport", fmt.Sprintf("%d", svcInfo.nodePort), - "-j", "MARK", "--set-xmark", fmt.Sprintf("%s/0xffffffff", iptablesMasqueradeMark)) + writeLine(natRules, append(args, "-j", string(kubeMarkMasqChain))...) // Jump to the service chain. - writeLine(rulesLines, - "-A", string(iptablesNodePortsChain), - "-m", "comment", "--comment", svcName.String(), + writeLine(natRules, append(args, "-j", string(svcChain))...) + } + + // If the service has no endpoints then reject packets. + if len(proxier.endpointsMap[svcName]) == 0 { + writeLine(filterRules, + "-A", string(kubeServicesChain), + "-m", "comment", "--comment", fmt.Sprintf(`"%s has no endpoints"`, svcName.String()), "-m", protocol, "-p", protocol, - "--dport", fmt.Sprintf("%d", svcInfo.nodePort), - "-j", string(svcChain)) + "-d", fmt.Sprintf("%s/32", svcInfo.clusterIP.String()), + "--dport", fmt.Sprintf("%d", svcInfo.port), + "-j", "REJECT", + ) + continue } // Generate the per-endpoint chains. We do this in multiple passes so we @@ -664,18 +831,18 @@ func (proxier *Proxier) syncProxyRules() { endpointChains = append(endpointChains, endpointChain) // Create the endpoint chain, retaining counters if possible. - if chain, ok := existingChains[utiliptables.Chain(endpointChain)]; ok { - writeLine(chainsLines, chain) + if chain, ok := existingNATChains[utiliptables.Chain(endpointChain)]; ok { + writeLine(natChains, chain) } else { - writeLine(chainsLines, makeChainLine(endpointChain)) + writeLine(natChains, makeChainLine(endpointChain)) } - activeChains[endpointChain] = true + activeNATChains[endpointChain] = true } // First write session affinity rules, if applicable. if svcInfo.sessionAffinityType == api.ServiceAffinityClientIP { for _, endpointChain := range endpointChains { - writeLine(rulesLines, + writeLine(natRules, "-A", string(svcChain), "-m", "comment", "--comment", svcName.String(), "-m", "recent", "--name", string(endpointChain), @@ -701,7 +868,7 @@ func (proxier *Proxier) syncProxyRules() { } // The final (or only if n == 1) rule is a guaranteed match. args = append(args, "-j", string(endpointChain)) - writeLine(rulesLines, args...) + writeLine(natRules, args...) // Rules in the per-endpoint chain. args = []string{ @@ -713,25 +880,23 @@ func (proxier *Proxier) syncProxyRules() { // host, but we don't have that information, so we just do this for // all endpoints. // TODO: if we grow logic to get this node's pod CIDR, we can use it. - writeLine(rulesLines, append(args, + writeLine(natRules, append(args, "-s", fmt.Sprintf("%s/32", strings.Split(endpoints[i], ":")[0]), - "-j", "MARK", "--set-xmark", fmt.Sprintf("%s/0xffffffff", iptablesMasqueradeMark))...) + "-j", string(kubeMarkMasqChain))...) // Update client-affinity lists. if svcInfo.sessionAffinityType == api.ServiceAffinityClientIP { args = append(args, "-m", "recent", "--name", string(endpointChain), "--set") } // DNAT to final destination. - args = append(args, - "-m", protocol, "-p", protocol, - "-j", "DNAT", "--to-destination", endpoints[i]) - writeLine(rulesLines, args...) + args = append(args, "-m", protocol, "-p", protocol, "-j", "DNAT", "--to-destination", endpoints[i]) + writeLine(natRules, args...) } } // Delete chains no longer in use. - for chain := range existingChains { - if !activeChains[chain] { + for chain := range existingNATChains { + if !activeNATChains[chain] { chainString := string(chain) if !strings.HasPrefix(chainString, "KUBE-SVC-") && !strings.HasPrefix(chainString, "KUBE-SEP-") { // Ignore chains that aren't ours. @@ -740,42 +905,60 @@ func (proxier *Proxier) syncProxyRules() { // We must (as per iptables) write a chain-line for it, which has // the nice effect of flushing the chain. Then we can remove the // chain. - writeLine(chainsLines, existingChains[chain]) - writeLine(rulesLines, "-X", chainString) + writeLine(natChains, existingNATChains[chain]) + writeLine(natRules, "-X", chainString) } } // Finally, tail-call to the nodeports chain. This needs to be after all // other service portal rules. - writeLine(rulesLines, - "-A", string(iptablesServicesChain), - "-m", "comment", "--comment", "\"kubernetes service nodeports; NOTE: this must be the last rule in this chain\"", + writeLine(natRules, + "-A", string(kubeServicesChain), + "-m", "comment", "--comment", `"kubernetes service nodeports; NOTE: this must be the last rule in this chain"`, "-m", "addrtype", "--dst-type", "LOCAL", - "-j", string(iptablesNodePortsChain)) + "-j", string(kubeNodePortsChain)) - // Write the end-of-table marker. - writeLine(rulesLines, "COMMIT") + // Write the end-of-table markers. + writeLine(filterRules, "COMMIT") + writeLine(natRules, "COMMIT") // Sync rules. // NOTE: NoFlushTables is used so we don't flush non-kubernetes chains in the table. - lines := append(chainsLines.Bytes(), rulesLines.Bytes()...) - glog.V(3).Infof("Syncing rules: %s", lines) - err = proxier.iptables.Restore(utiliptables.TableNAT, lines, utiliptables.NoFlushTables, utiliptables.RestoreCounters) + filterLines := append(filterChains.Bytes(), filterRules.Bytes()...) + natLines := append(natChains.Bytes(), natRules.Bytes()...) + lines := append(filterLines, natLines...) + + glog.V(3).Infof("Restoring iptables rules: %s", lines) + err = proxier.iptables.RestoreAll(lines, utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { - glog.Errorf("Failed to sync iptables rules: %v", err) + glog.Errorf("Failed to execute iptables-restore: %v", err) // Revert new local ports. for k, v := range newLocalPorts { glog.Errorf("Closing local port %s", k.String()) v.Close() } - } else { - // Close old local ports and save new ones. - for k, v := range proxier.portsMap { - if newLocalPorts[k] == nil { - v.Close() - } + return + } + + // Close old local ports and save new ones. + for k, v := range proxier.portsMap { + if newLocalPorts[k] == nil { + v.Close() + } + } + proxier.portsMap = newLocalPorts + + // Clean up the older SNAT rule which was directly in POSTROUTING. + // TODO(thockin): Remove this for v1.3 or v1.4. + args := []string{ + "-m", "comment", "--comment", "kubernetes service traffic requiring SNAT", + "-m", "mark", "--mark", oldIptablesMasqueradeMark, + "-j", "MASQUERADE", + } + if err := proxier.iptables.DeleteRule(utiliptables.TableNAT, utiliptables.ChainPostrouting, args...); err != nil { + if !utiliptables.IsNotFoundError(err) { + glog.Errorf("Error removing old-style SNAT rule: %v", err) } - proxier.portsMap = newLocalPorts } } diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index 3db6cb53140..2d3a9c85826 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -36,7 +36,6 @@ func checkAllLines(t *testing.T, table utiliptables.Table, save []byte, expected } func TestReadLinesFromByteBuffer(t *testing.T) { - testFn := func(byteArray []byte, expected []string) { index := 0 readIndex := 0 @@ -68,7 +67,7 @@ func TestReadLinesFromByteBuffer(t *testing.T) { testFn(byteArray1, expected1) } -func TestgetChainLines(t *testing.T) { +func TestGetChainLines(t *testing.T) { iptables_save := `# Generated by iptables-save v1.4.7 on Wed Oct 29 14:56:01 2014 *nat :PREROUTING ACCEPT [2136997:197881818] @@ -85,7 +84,7 @@ func TestgetChainLines(t *testing.T) { checkAllLines(t, utiliptables.TableNAT, []byte(iptables_save), expected) } -func TestgetChainLinesMultipleTables(t *testing.T) { +func TestGetChainLinesMultipleTables(t *testing.T) { iptables_save := `# Generated by iptables-save v1.4.21 on Fri Aug 7 14:47:37 2015 *nat :PREROUTING ACCEPT [2:138] @@ -97,12 +96,12 @@ func TestgetChainLinesMultipleTables(t *testing.T) { :KUBE-NODEPORT-HOST - [0:0] :KUBE-PORTALS-CONTAINER - [0:0] :KUBE-PORTALS-HOST - [0:0] - :KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U - [0:0] - :KUBE-SVC-PknUqKuv-LNZiCKRqGm - [0:0] - :KUBE-SVC-RWEx6uDf8yWGww1OQ8E - [0:0] - :KUBE-SVC-UvIpe7oTYVlacW1-G4C - [0:0] - :KUBE-SVC-g_TrwxBdTXDbEtecmNo - [0:0] - :KUBE-SVC-gvTMDzeC8lcXUan15iP - [0:0] + :KUBE-SVC-1111111111111111 - [0:0] + :KUBE-SVC-2222222222222222 - [0:0] + :KUBE-SVC-3333333333333333 - [0:0] + :KUBE-SVC-4444444444444444 - [0:0] + :KUBE-SVC-5555555555555555 - [0:0] + :KUBE-SVC-6666666666666666 - [0:0] -A PREROUTING -m comment --comment "handle ClusterIPs; NOTE: this must be before the NodePort rules" -j KUBE-PORTALS-CONTAINER -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER -A PREROUTING -m addrtype --dst-type LOCAL -m comment --comment "handle service NodePorts; NOTE: this must be the last rule in the chain" -j KUBE-NODEPORT-CONTAINER @@ -111,18 +110,18 @@ func TestgetChainLinesMultipleTables(t *testing.T) { -A OUTPUT -m addrtype --dst-type LOCAL -m comment --comment "handle service NodePorts; NOTE: this must be the last rule in the chain" -j KUBE-NODEPORT-HOST -A POSTROUTING -s 10.246.1.0/24 ! -o cbr0 -j MASQUERADE -A POSTROUTING -s 10.0.2.15/32 -d 10.0.2.15/32 -m comment --comment "handle pod connecting to self" -j MASQUERADE - -A KUBE-PORTALS-CONTAINER -d 10.247.0.1/32 -p tcp -m comment --comment "portal for default/kubernetes:" -m state --state NEW -m tcp --dport 443 -j KUBE-SVC-g_TrwxBdTXDbEtecmNo - -A KUBE-PORTALS-CONTAINER -d 10.247.0.10/32 -p udp -m comment --comment "portal for kube-system/kube-dns:dns" -m state --state NEW -m udp --dport 53 -j KUBE-SVC-gvTMDzeC8lcXUan15iP - -A KUBE-PORTALS-CONTAINER -d 10.247.0.10/32 -p tcp -m comment --comment "portal for kube-system/kube-dns:dns-tcp" -m state --state NEW -m tcp --dport 53 -j KUBE-SVC-PknUqKuv-LNZiCKRqGm - -A KUBE-PORTALS-HOST -d 10.247.0.1/32 -p tcp -m comment --comment "portal for default/kubernetes:" -m state --state NEW -m tcp --dport 443 -j KUBE-SVC-g_TrwxBdTXDbEtecmNo - -A KUBE-PORTALS-HOST -d 10.247.0.10/32 -p udp -m comment --comment "portal for kube-system/kube-dns:dns" -m state --state NEW -m udp --dport 53 -j KUBE-SVC-gvTMDzeC8lcXUan15iP - -A KUBE-PORTALS-HOST -d 10.247.0.10/32 -p tcp -m comment --comment "portal for kube-system/kube-dns:dns-tcp" -m state --state NEW -m tcp --dport 53 -j KUBE-SVC-PknUqKuv-LNZiCKRqGm - -A KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U -p udp -m comment --comment "kube-system/kube-dns:dns" -m recent --set --name KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.246.1.2:53 - -A KUBE-SVC-PknUqKuv-LNZiCKRqGm -m comment --comment "kube-system/kube-dns:dns-tcp" -j KUBE-SVC-RWEx6uDf8yWGww1OQ8E - -A KUBE-SVC-RWEx6uDf8yWGww1OQ8E -p tcp -m comment --comment "kube-system/kube-dns:dns-tcp" -m recent --set --name KUBE-SVC-RWEx6uDf8yWGww1OQ8E --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.246.1.2:53 - -A KUBE-SVC-UvIpe7oTYVlacW1-G4C -p tcp -m comment --comment "default/kubernetes:" -m recent --set --name KUBE-SVC-UvIpe7oTYVlacW1-G4C --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.245.1.2:443 - -A KUBE-SVC-g_TrwxBdTXDbEtecmNo -m comment --comment "default/kubernetes:" -j KUBE-SVC-UvIpe7oTYVlacW1-G4C - -A KUBE-SVC-gvTMDzeC8lcXUan15iP -m comment --comment "kube-system/kube-dns:dns" -j KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U + -A KUBE-PORTALS-CONTAINER -d 10.247.0.1/32 -p tcp -m comment --comment "portal for default/kubernetes:" -m state --state NEW -m tcp --dport 443 -j KUBE-SVC-5555555555555555 + -A KUBE-PORTALS-CONTAINER -d 10.247.0.10/32 -p udp -m comment --comment "portal for kube-system/kube-dns:dns" -m state --state NEW -m udp --dport 53 -j KUBE-SVC-6666666666666666 + -A KUBE-PORTALS-CONTAINER -d 10.247.0.10/32 -p tcp -m comment --comment "portal for kube-system/kube-dns:dns-tcp" -m state --state NEW -m tcp --dport 53 -j KUBE-SVC-2222222222222222 + -A KUBE-PORTALS-HOST -d 10.247.0.1/32 -p tcp -m comment --comment "portal for default/kubernetes:" -m state --state NEW -m tcp --dport 443 -j KUBE-SVC-5555555555555555 + -A KUBE-PORTALS-HOST -d 10.247.0.10/32 -p udp -m comment --comment "portal for kube-system/kube-dns:dns" -m state --state NEW -m udp --dport 53 -j KUBE-SVC-6666666666666666 + -A KUBE-PORTALS-HOST -d 10.247.0.10/32 -p tcp -m comment --comment "portal for kube-system/kube-dns:dns-tcp" -m state --state NEW -m tcp --dport 53 -j KUBE-SVC-2222222222222222 + -A KUBE-SVC-1111111111111111 -p udp -m comment --comment "kube-system/kube-dns:dns" -m recent --set --name KUBE-SVC-1111111111111111 --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.246.1.2:53 + -A KUBE-SVC-2222222222222222 -m comment --comment "kube-system/kube-dns:dns-tcp" -j KUBE-SVC-3333333333333333 + -A KUBE-SVC-3333333333333333 -p tcp -m comment --comment "kube-system/kube-dns:dns-tcp" -m recent --set --name KUBE-SVC-3333333333333333 --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.246.1.2:53 + -A KUBE-SVC-4444444444444444 -p tcp -m comment --comment "default/kubernetes:" -m recent --set --name KUBE-SVC-4444444444444444 --mask 255.255.255.255 --rsource -j DNAT --to-destination 10.245.1.2:443 + -A KUBE-SVC-5555555555555555 -m comment --comment "default/kubernetes:" -j KUBE-SVC-4444444444444444 + -A KUBE-SVC-6666666666666666 -m comment --comment "kube-system/kube-dns:dns" -j KUBE-SVC-1111111111111111 COMMIT # Completed on Fri Aug 7 14:47:37 2015 # Generated by iptables-save v1.4.21 on Fri Aug 7 14:47:37 2015 @@ -138,21 +137,23 @@ func TestgetChainLinesMultipleTables(t *testing.T) { COMMIT ` expected := map[utiliptables.Chain]string{ - utiliptables.ChainPrerouting: ":PREROUTING ACCEPT [2:138]", - utiliptables.Chain("INPUT"): ":INPUT ACCEPT [0:0]", - utiliptables.Chain("OUTPUT"): ":OUTPUT ACCEPT [0:0]", - utiliptables.ChainPostrouting: ":POSTROUTING ACCEPT [0:0]", - utiliptables.Chain("DOCKER"): ":DOCKER - [0:0]", - utiliptables.Chain("KUBE-NODEPORT-CONTAINER"): ":KUBE-NODEPORT-CONTAINER - [0:0]", - utiliptables.Chain("KUBE-NODEPORT-HOST"): ":KUBE-NODEPORT-HOST - [0:0]", - utiliptables.Chain("KUBE-PORTALS-CONTAINER"): ":KUBE-PORTALS-CONTAINER - [0:0]", - utiliptables.Chain("KUBE-PORTALS-HOST"): ":KUBE-PORTALS-HOST - [0:0]", - utiliptables.Chain("KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U"): ":KUBE-SVC-Dgkr8H9s4LQ2mn-Py5U - [0:0]", - utiliptables.Chain("KUBE-SVC-PknUqKuv-LNZiCKRqGm"): ":KUBE-SVC-PknUqKuv-LNZiCKRqGm - [0:0]", - utiliptables.Chain("KUBE-SVC-RWEx6uDf8yWGww1OQ8E"): ":KUBE-SVC-RWEx6uDf8yWGww1OQ8E - [0:0]", - utiliptables.Chain("KUBE-SVC-UvIpe7oTYVlacW1-G4C"): ":KUBE-SVC-UvIpe7oTYVlacW1-G4C - [0:0]", - utiliptables.Chain("KUBE-SVC-g_TrwxBdTXDbEtecmNo"): ":KUBE-SVC-g_TrwxBdTXDbEtecmNo - [0:0]", - utiliptables.Chain("KUBE-SVC-gvTMDzeC8lcXUan15iP"): ":KUBE-SVC-gvTMDzeC8lcXUan15iP - [0:0]", + utiliptables.ChainPrerouting: ":PREROUTING ACCEPT [2:138]", + utiliptables.Chain("INPUT"): ":INPUT ACCEPT [0:0]", + utiliptables.Chain("OUTPUT"): ":OUTPUT ACCEPT [0:0]", + utiliptables.ChainPostrouting: ":POSTROUTING ACCEPT [0:0]", + utiliptables.Chain("DOCKER"): ":DOCKER - [0:0]", + utiliptables.Chain("KUBE-NODEPORT-CONTAINER"): ":KUBE-NODEPORT-CONTAINER - [0:0]", + utiliptables.Chain("KUBE-NODEPORT-HOST"): ":KUBE-NODEPORT-HOST - [0:0]", + utiliptables.Chain("KUBE-PORTALS-CONTAINER"): ":KUBE-PORTALS-CONTAINER - [0:0]", + utiliptables.Chain("KUBE-PORTALS-HOST"): ":KUBE-PORTALS-HOST - [0:0]", + utiliptables.Chain("KUBE-SVC-1111111111111111"): ":KUBE-SVC-1111111111111111 - [0:0]", + utiliptables.Chain("KUBE-SVC-2222222222222222"): ":KUBE-SVC-2222222222222222 - [0:0]", + utiliptables.Chain("KUBE-SVC-3333333333333333"): ":KUBE-SVC-3333333333333333 - [0:0]", + utiliptables.Chain("KUBE-SVC-4444444444444444"): ":KUBE-SVC-4444444444444444 - [0:0]", + utiliptables.Chain("KUBE-SVC-5555555555555555"): ":KUBE-SVC-5555555555555555 - [0:0]", + utiliptables.Chain("KUBE-SVC-6666666666666666"): ":KUBE-SVC-6666666666666666 - [0:0]", } checkAllLines(t, utiliptables.TableNAT, []byte(iptables_save), expected) } + +// TODO(thockin): add a test for syncProxyRules() or break it down further and test the pieces. diff --git a/pkg/proxy/userspace/port_allocator.go b/pkg/proxy/userspace/port_allocator.go index a1ff408ea62..22182f9c98b 100644 --- a/pkg/proxy/userspace/port_allocator.go +++ b/pkg/proxy/userspace/port_allocator.go @@ -23,8 +23,8 @@ import ( "sync" "time" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/net" + "k8s.io/kubernetes/pkg/util/wait" ) var ( @@ -83,7 +83,7 @@ func newPortRangeAllocator(r net.PortRange) PortAllocator { ports: make(chan int, portsBufSize), rand: rand.New(rand.NewSource(time.Now().UnixNano())), } - go util.Until(func() { ra.fillPorts(util.NeverStop) }, nextFreePortCooldown, util.NeverStop) + go wait.Until(func() { ra.fillPorts(wait.NeverStop) }, nextFreePortCooldown, wait.NeverStop) return ra } diff --git a/pkg/proxy/userspace/proxier.go b/pkg/proxy/userspace/proxier.go index f4b01feca5f..76ba794811d 100644 --- a/pkg/proxy/userspace/proxier.go +++ b/pkg/proxy/userspace/proxier.go @@ -196,35 +196,59 @@ func CleanupLeftovers(ipt iptables.Interface) (encounteredError bool) { // Delete Rules first, then Flush and Delete Chains args := []string{"-m", "comment", "--comment", "handle ClusterIPs; NOTE: this must be before the NodePort rules"} if err := ipt.DeleteRule(iptables.TableNAT, iptables.ChainOutput, append(args, "-j", string(iptablesHostPortalChain))...); err != nil { - glog.Errorf("Error removing userspace rule: %v", err) - encounteredError = true + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error removing userspace rule: %v", err) + encounteredError = true + } } if err := ipt.DeleteRule(iptables.TableNAT, iptables.ChainPrerouting, append(args, "-j", string(iptablesContainerPortalChain))...); err != nil { - glog.Errorf("Error removing userspace rule: %v", err) - encounteredError = true + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error removing userspace rule: %v", err) + encounteredError = true + } } args = []string{"-m", "addrtype", "--dst-type", "LOCAL"} args = append(args, "-m", "comment", "--comment", "handle service NodePorts; NOTE: this must be the last rule in the chain") if err := ipt.DeleteRule(iptables.TableNAT, iptables.ChainOutput, append(args, "-j", string(iptablesHostNodePortChain))...); err != nil { - glog.Errorf("Error removing userspace rule: %v", err) - encounteredError = true + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error removing userspace rule: %v", err) + encounteredError = true + } } if err := ipt.DeleteRule(iptables.TableNAT, iptables.ChainPrerouting, append(args, "-j", string(iptablesContainerNodePortChain))...); err != nil { - glog.Errorf("Error removing userspace rule: %v", err) - encounteredError = true + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error removing userspace rule: %v", err) + encounteredError = true + } + } + args = []string{"-m", "comment", "--comment", "Ensure that non-local NodePort traffic can flow"} + if err := ipt.DeleteRule(iptables.TableFilter, iptables.ChainInput, append(args, "-j", string(iptablesNonLocalNodePortChain))...); err != nil { + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error removing userspace rule: %v", err) + encounteredError = true + } } // flush and delete chains. - chains := []iptables.Chain{iptablesContainerPortalChain, iptablesHostPortalChain, iptablesHostNodePortChain, iptablesContainerNodePortChain} - for _, c := range chains { - // flush chain, then if successful delete, delete will fail if flush fails. - if err := ipt.FlushChain(iptables.TableNAT, c); err != nil { - glog.Errorf("Error flushing userspace chain: %v", err) - encounteredError = true - } else { - if err = ipt.DeleteChain(iptables.TableNAT, c); err != nil { - glog.Errorf("Error deleting userspace chain: %v", err) - encounteredError = true + tableChains := map[iptables.Table][]iptables.Chain{ + iptables.TableNAT: {iptablesContainerPortalChain, iptablesHostPortalChain, iptablesHostNodePortChain, iptablesContainerNodePortChain}, + iptables.TableFilter: {iptablesNonLocalNodePortChain}, + } + for table, chains := range tableChains { + for _, c := range chains { + // flush chain, then if successful delete, delete will fail if flush fails. + if err := ipt.FlushChain(table, c); err != nil { + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error flushing userspace chain: %v", err) + encounteredError = true + } + } else { + if err = ipt.DeleteChain(table, c); err != nil { + if !iptables.IsNotFoundError(err) { + glog.Errorf("Error deleting userspace chain: %v", err) + encounteredError = true + } + } } } } @@ -626,6 +650,17 @@ func (proxier *Proxier) openNodePort(nodePort int, protocol api.Protocol, proxyI if !existed { glog.Infof("Opened iptables from-host public port for service %q on %s port %d", name, protocol, nodePort) } + + args = proxier.iptablesNonLocalNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) + existed, err = proxier.iptables.EnsureRule(iptables.Append, iptables.TableFilter, iptablesNonLocalNodePortChain, args...) + if err != nil { + glog.Errorf("Failed to install iptables %s rule for service %q", iptablesNonLocalNodePortChain, name) + return err + } + if !existed { + glog.Infof("Opened iptables from-non-local public port for service %q on %s port %d", name, protocol, nodePort) + } + return nil } @@ -711,6 +746,13 @@ func (proxier *Proxier) closeNodePort(nodePort int, protocol api.Protocol, proxy el = append(el, err) } + // Handle traffic not local to the host + args = proxier.iptablesNonLocalNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) + if err := proxier.iptables.DeleteRule(iptables.TableFilter, iptablesNonLocalNodePortChain, args...); err != nil { + glog.Errorf("Failed to delete iptables %s rule for service %q", iptablesNonLocalNodePortChain, name) + el = append(el, err) + } + if err := proxier.releaseNodePort(nil, nodePort, protocol, name); err != nil { el = append(el, err) } @@ -743,6 +785,7 @@ var iptablesHostPortalChain iptables.Chain = "KUBE-PORTALS-HOST" // Chains for NodePort services var iptablesContainerNodePortChain iptables.Chain = "KUBE-NODEPORT-CONTAINER" var iptablesHostNodePortChain iptables.Chain = "KUBE-NODEPORT-HOST" +var iptablesNonLocalNodePortChain iptables.Chain = "KUBE-NODEPORT-NON-LOCAL" // Ensure that the iptables infrastructure we use is set up. This can safely be called periodically. func iptablesInit(ipt iptables.Interface) error { @@ -798,6 +841,17 @@ func iptablesInit(ipt iptables.Interface) error { return err } + // Create a chain intended to explicitly allow non-local NodePort + // traffic to work around default-deny iptables configurations + // that would otherwise reject such traffic. + args = []string{"-m", "comment", "--comment", "Ensure that non-local NodePort traffic can flow"} + if _, err := ipt.EnsureChain(iptables.TableFilter, iptablesNonLocalNodePortChain); err != nil { + return err + } + if _, err := ipt.EnsureRule(iptables.Prepend, iptables.TableFilter, iptables.ChainInput, append(args, "-j", string(iptablesNonLocalNodePortChain))...); err != nil { + return err + } + // TODO: Verify order of rules. return nil } @@ -817,6 +871,9 @@ func iptablesFlush(ipt iptables.Interface) error { if err := ipt.FlushChain(iptables.TableNAT, iptablesHostNodePortChain); err != nil { el = append(el, err) } + if err := ipt.FlushChain(iptables.TableFilter, iptablesNonLocalNodePortChain); err != nil { + el = append(el, err) + } if len(el) != 0 { glog.Errorf("Some errors flushing old iptables portals: %v", el) } @@ -974,6 +1031,13 @@ func (proxier *Proxier) iptablesHostNodePortArgs(nodePort int, protocol api.Prot return args } +// Build a slice of iptables args for an from-non-local public-port rule. +func (proxier *Proxier) iptablesNonLocalNodePortArgs(nodePort int, protocol api.Protocol, proxyIP net.IP, proxyPort int, service proxy.ServicePortName) []string { + args := iptablesCommonPortalArgs(nil, false, false, proxyPort, protocol, service) + args = append(args, "-m", "comment", "--comment", service.String(), "-m", "state", "--state", "NEW", "-j", "ACCEPT") + return args +} + func isTooManyFDsError(err error) bool { return strings.Contains(err.Error(), "too many open files") } diff --git a/pkg/registry/cachesize/cachesize.go b/pkg/registry/cachesize/cachesize.go new file mode 100644 index 00000000000..708a4441d21 --- /dev/null +++ b/pkg/registry/cachesize/cachesize.go @@ -0,0 +1,97 @@ +/* +Copyright 2014 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. +*/ + +//use for --watch-cache-sizes param of kube-apiserver +//make watch cache size of resources configurable +package cachesize + +import ( + "strconv" + "strings" + + "github.com/golang/glog" +) + +type Resource string + +const ( + Controllers Resource = "controllers" + Daemonsets Resource = "daemonsets" + Deployments Resource = "deployments" + Endpoints Resource = "endpoints" + HorizontalPodAutoscalers Resource = "horizontalpodautoscalers" + Ingress Resource = "ingress" + Jobs Resource = "jobs" + LimitRanges Resource = "limitranges" + Namespaces Resource = "namespaces" + Nodes Resource = "nodes" + PersistentVolumes Resource = "persistentvolumes" + PersistentVolumeClaims Resource = "persistentvolumeclaims" + Pods Resource = "pods" + PodTemplates Resource = "podtemplates" + Replicasets Resource = "replicasets" + ResourceQuotas Resource = "resourcequotas" + Secrets Resource = "secrets" + ServiceAccounts Resource = "serviceaccounts" + Services Resource = "services" +) + +var watchCacheSizes map[Resource]int + +func init() { + watchCacheSizes = make(map[Resource]int) + watchCacheSizes[Controllers] = 100 + watchCacheSizes[Daemonsets] = 100 + watchCacheSizes[Deployments] = 100 + watchCacheSizes[Endpoints] = 1000 + watchCacheSizes[HorizontalPodAutoscalers] = 100 + watchCacheSizes[Ingress] = 100 + watchCacheSizes[Jobs] = 100 + watchCacheSizes[LimitRanges] = 100 + watchCacheSizes[Namespaces] = 100 + watchCacheSizes[Nodes] = 1000 + watchCacheSizes[PersistentVolumes] = 100 + watchCacheSizes[PersistentVolumeClaims] = 100 + watchCacheSizes[Pods] = 1000 + watchCacheSizes[PodTemplates] = 100 + watchCacheSizes[Replicasets] = 100 + watchCacheSizes[ResourceQuotas] = 100 + watchCacheSizes[Secrets] = 100 + watchCacheSizes[ServiceAccounts] = 100 + watchCacheSizes[Services] = 100 +} + +func SetWatchCacheSizes(cacheSizes []string) { + for _, c := range cacheSizes { + tokens := strings.Split(c, "#") + if len(tokens) != 2 { + glog.Errorf("invalid value of watch cache capabilities: %s", c) + continue + } + + size, err := strconv.Atoi(tokens[1]) + if err != nil { + glog.Errorf("invalid size of watch cache capabilities: %s", c) + continue + } + + watchCacheSizes[Resource(strings.ToLower(tokens[0]))] = size + } +} + +func GetWatchCacheSizeByResource(resource Resource) int { + return watchCacheSizes[resource] +} diff --git a/pkg/registry/componentstatus/rest_test.go b/pkg/registry/componentstatus/rest_test.go index c2b40dc6159..e98314b1087 100644 --- a/pkg/registry/componentstatus/rest_test.go +++ b/pkg/registry/componentstatus/rest_test.go @@ -26,6 +26,7 @@ import ( "k8s.io/kubernetes/pkg/apiserver" "k8s.io/kubernetes/pkg/probe" "k8s.io/kubernetes/pkg/util" + "net/http" "net/url" "time" ) @@ -36,7 +37,7 @@ type fakeHttpProber struct { err error } -func (f *fakeHttpProber) Probe(*url.URL, time.Duration) (probe.Result, string, error) { +func (f *fakeHttpProber) Probe(*url.URL, http.Header, time.Duration) (probe.Result, string, error) { return f.result, f.body, f.err } diff --git a/pkg/registry/controller/etcd/etcd.go b/pkg/registry/controller/etcd/etcd.go index f3d2864207a..92c6c813996 100644 --- a/pkg/registry/controller/etcd/etcd.go +++ b/pkg/registry/controller/etcd/etcd.go @@ -14,12 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +// If you make changes to this file, you should also make the corresponding change in ReplicaSet. + package etcd import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/controller" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" @@ -37,7 +40,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.ReplicationControllerList{} } storageInterface := storageDecorator( - s, 100, &api.ReplicationController{}, prefix, controller.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Controllers), &api.ReplicationController{}, prefix, controller.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.ReplicationController{} }, diff --git a/pkg/registry/controller/registry.go b/pkg/registry/controller/registry.go index 12aa757405c..e3ecfa6a66c 100644 --- a/pkg/registry/controller/registry.go +++ b/pkg/registry/controller/registry.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// If you make changes to this file, you should also make the corresponding change in ReplicaSet. + package controller import ( diff --git a/pkg/registry/controller/strategy.go b/pkg/registry/controller/strategy.go index 0ef9fba00b5..2017672ef70 100644 --- a/pkg/registry/controller/strategy.go +++ b/pkg/registry/controller/strategy.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// If you make changes to this file, you should also make the corresponding change in ReplicaSet. + package controller import ( diff --git a/pkg/registry/daemonset/etcd/etcd.go b/pkg/registry/daemonset/etcd/etcd.go index 0c8ea963854..bde8d555af8 100644 --- a/pkg/registry/daemonset/etcd/etcd.go +++ b/pkg/registry/daemonset/etcd/etcd.go @@ -21,6 +21,7 @@ import ( "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/daemonset" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" @@ -39,7 +40,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &extensions.DaemonSetList{} } storageInterface := storageDecorator( - s, 100, &extensions.DaemonSet{}, prefix, daemonset.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Daemonsets), &extensions.DaemonSet{}, prefix, daemonset.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &extensions.DaemonSet{} }, diff --git a/pkg/registry/daemonset/etcd/etcd_test.go b/pkg/registry/daemonset/etcd/etcd_test.go index 913f45870bb..9db445c3b2b 100755 --- a/pkg/registry/daemonset/etcd/etcd_test.go +++ b/pkg/registry/daemonset/etcd/etcd_test.go @@ -20,6 +20,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" @@ -43,7 +44,7 @@ func newValidDaemonSet() *extensions.DaemonSet { Namespace: api.NamespaceDefault, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{"a": "b"}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"a": "b"}}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{"a": "b"}, @@ -85,7 +86,7 @@ func TestCreate(t *testing.T) { // invalid (invalid selector) &extensions.DaemonSet{ Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: map[string]string{}}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{}}, Template: validDaemonSet.Spec.Template, }, }, @@ -131,7 +132,7 @@ func TestUpdate(t *testing.T) { }, func(obj runtime.Object) runtime.Object { object := obj.(*extensions.DaemonSet) - object.Spec.Selector = &extensions.LabelSelector{MatchLabels: map[string]string{}} + object.Spec.Selector = &unversioned.LabelSelector{MatchLabels: map[string]string{}} return object }, func(obj runtime.Object) runtime.Object { diff --git a/pkg/registry/deployment/etcd/etcd.go b/pkg/registry/deployment/etcd/etcd.go index 6d603f6c53f..5c2ae3fee73 100644 --- a/pkg/registry/deployment/etcd/etcd.go +++ b/pkg/registry/deployment/etcd/etcd.go @@ -27,6 +27,7 @@ import ( extvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/deployment" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" @@ -64,7 +65,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &extensions.DeploymentList{} } storageInterface := storageDecorator( - s, 100, &extensions.Deployment{}, prefix, deployment.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Deployments), &extensions.Deployment{}, prefix, deployment.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &extensions.Deployment{} }, @@ -182,43 +183,53 @@ type ScaleREST struct { registry *deployment.Registry } -// ScaleREST implements Patcher -var _ = rest.Patcher(&ScaleREST{}) +// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). -// New creates a new Scale object -func (r *ScaleREST) New() runtime.Object { - return &extensions.Scale{} -} +// // ScaleREST implements Patcher +// var _ = rest.Patcher(&ScaleREST{}) -func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) { - deployment, err := (*r.registry).GetDeployment(ctx, name) - if err != nil { - return nil, errors.NewNotFound(extensions.Resource("deployments/scale"), name) - } - return extensions.ScaleFromDeployment(deployment), nil -} +// // New creates a new Scale object +// func (r *ScaleREST) New() runtime.Object { +// return &extensions.Scale{} +// } -func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) { - if obj == nil { - return nil, false, errors.NewBadRequest(fmt.Sprintf("nil update passed to Scale")) - } - scale, ok := obj.(*extensions.Scale) - if !ok { - return nil, false, errors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj)) - } +// func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) { +// deployment, err := (*r.registry).GetDeployment(ctx, name) +// if err != nil { +// return nil, errors.NewNotFound(extensions.Resource("deployments/scale"), name) +// } +// scale, err := extensions.ScaleFromDeployment(deployment) +// if err != nil { +// return nil, errors.NewBadRequest(fmt.Sprintf("%v", err)) +// } +// return scale, nil +// } - if errs := extvalidation.ValidateScale(scale); len(errs) > 0 { - return nil, false, errors.NewInvalid(extensions.Kind("Scale"), scale.Name, errs) - } +// func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) { +// if obj == nil { +// return nil, false, errors.NewBadRequest(fmt.Sprintf("nil update passed to Scale")) +// } +// scale, ok := obj.(*extensions.Scale) +// if !ok { +// return nil, false, errors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj)) +// } - deployment, err := (*r.registry).GetDeployment(ctx, scale.Name) - if err != nil { - return nil, false, errors.NewNotFound(extensions.Resource("deployments/scale"), scale.Name) - } - deployment.Spec.Replicas = scale.Spec.Replicas - deployment, err = (*r.registry).UpdateDeployment(ctx, deployment) - if err != nil { - return nil, false, errors.NewConflict(extensions.Resource("deployments/scale"), scale.Name, err) - } - return extensions.ScaleFromDeployment(deployment), false, nil -} +// if errs := extvalidation.ValidateScale(scale); len(errs) > 0 { +// return nil, false, errors.NewInvalid(extensions.Kind("Scale"), scale.Name, errs) +// } + +// deployment, err := (*r.registry).GetDeployment(ctx, scale.Name) +// if err != nil { +// return nil, false, errors.NewNotFound(extensions.Resource("deployments/scale"), scale.Name) +// } +// deployment.Spec.Replicas = scale.Spec.Replicas +// deployment, err = (*r.registry).UpdateDeployment(ctx, deployment) +// if err != nil { +// return nil, false, errors.NewConflict(extensions.Resource("deployments/scale"), scale.Name, err) +// } +// newScale, err := extensions.ScaleFromDeployment(deployment) +// if err != nil { +// return nil, false, errors.NewBadRequest(fmt.Sprintf("%v", err)) +// } +// return newScale, false, nil +// } diff --git a/pkg/registry/deployment/etcd/etcd_test.go b/pkg/registry/deployment/etcd/etcd_test.go index 40f498c7714..66520862d7f 100644 --- a/pkg/registry/deployment/etcd/etcd_test.go +++ b/pkg/registry/deployment/etcd/etcd_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" etcderrors "k8s.io/kubernetes/pkg/api/errors/etcd" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" @@ -31,7 +32,6 @@ import ( "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/storage/etcd/etcdtest" etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing" - "k8s.io/kubernetes/pkg/util" ) func newStorage(t *testing.T) (*DeploymentStorage, *etcdtesting.EtcdTestServer) { @@ -50,7 +50,7 @@ func validNewDeployment() *extensions.Deployment { Namespace: namespace, }, Spec: extensions.DeploymentSpec{ - Selector: map[string]string{"a": "b"}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"a": "b"}}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{"a": "b"}, @@ -67,8 +67,7 @@ func validNewDeployment() *extensions.Deployment { DNSPolicy: api.DNSClusterFirst, }, }, - UniqueLabelKey: "my-label", - Replicas: 7, + Replicas: 7, }, Status: extensions.DeploymentStatus{ Replicas: 5, @@ -90,7 +89,7 @@ func TestCreate(t *testing.T) { // invalid (invalid selector) &extensions.Deployment{ Spec: extensions.DeploymentSpec{ - Selector: map[string]string{}, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{}}, Template: validDeployment.Spec.Template, }, }, @@ -128,7 +127,7 @@ func TestUpdate(t *testing.T) { }, func(obj runtime.Object) runtime.Object { object := obj.(*extensions.Deployment) - object.Spec.Selector = map[string]string{} + object.Spec.Selector = &unversioned.LabelSelector{MatchLabels: map[string]string{}} return object }, ) @@ -180,71 +179,73 @@ func TestWatch(t *testing.T) { ) } -func validNewScale() *extensions.Scale { - return &extensions.Scale{ - ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace}, - Spec: extensions.ScaleSpec{ - Replicas: validDeployment.Spec.Replicas, - }, - Status: extensions.ScaleStatus{ - Replicas: validDeployment.Status.Replicas, - Selector: validDeployment.Spec.Template.Labels, - }, - } -} +// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). -var validScale = *validNewScale() +// func validNewScale() *extensions.Scale { +// return &extensions.Scale{ +// ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace}, +// Spec: extensions.ScaleSpec{ +// Replicas: validDeployment.Spec.Replicas, +// }, +// Status: extensions.ScaleStatus{ +// Replicas: validDeployment.Status.Replicas, +// Selector: validDeployment.Spec.Template.Labels, +// }, +// } +// } -func TestScaleGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) +// var validScale = *validNewScale() - ctx := api.WithNamespace(api.NewContext(), namespace) - key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name) - if err := storage.Deployment.Storage.Set(ctx, key, &validDeployment, nil, 0); err != nil { - t.Fatalf("unexpected error: %v", err) - } +// func TestScaleGet(t *testing.T) { +// storage, server := newStorage(t) +// defer server.Terminate(t) - expect := &validScale - obj, err := storage.Scale.Get(ctx, name) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - scale := obj.(*extensions.Scale) - if e, a := expect, scale; !api.Semantic.DeepDerivative(e, a) { - t.Errorf("unexpected scale: %s", util.ObjectDiff(e, a)) - } -} +// ctx := api.WithNamespace(api.NewContext(), namespace) +// key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name) +// if err := storage.Deployment.Storage.Set(ctx, key, &validDeployment, nil, 0); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } -func TestScaleUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) +// expect := &validScale +// obj, err := storage.Scale.Get(ctx, name) +// if err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// scale := obj.(*extensions.Scale) +// if e, a := expect, scale; !api.Semantic.DeepDerivative(e, a) { +// t.Errorf("unexpected scale: %s", util.ObjectDiff(e, a)) +// } +// } - ctx := api.WithNamespace(api.NewContext(), namespace) - key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name) - if err := storage.Deployment.Storage.Set(ctx, key, &validDeployment, nil, 0); err != nil { - t.Fatalf("unexpected error: %v", err) - } - replicas := 12 - update := extensions.Scale{ - ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace}, - Spec: extensions.ScaleSpec{ - Replicas: replicas, - }, - } +// func TestScaleUpdate(t *testing.T) { +// storage, server := newStorage(t) +// defer server.Terminate(t) - if _, _, err := storage.Scale.Update(ctx, &update); err != nil { - t.Fatalf("unexpected error: %v", err) - } - obj, err := storage.Deployment.Get(ctx, name) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - deployment := obj.(*extensions.Deployment) - if deployment.Spec.Replicas != replicas { - t.Errorf("wrong replicas count expected: %d got: %d", replicas, deployment.Spec.Replicas) - } -} +// ctx := api.WithNamespace(api.NewContext(), namespace) +// key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name) +// if err := storage.Deployment.Storage.Set(ctx, key, &validDeployment, nil, 0); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// replicas := 12 +// update := extensions.Scale{ +// ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace}, +// Spec: extensions.ScaleSpec{ +// Replicas: replicas, +// }, +// } + +// if _, _, err := storage.Scale.Update(ctx, &update); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// obj, err := storage.Deployment.Get(ctx, name) +// if err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// deployment := obj.(*extensions.Deployment) +// if deployment.Spec.Replicas != replicas { +// t.Errorf("wrong replicas count expected: %d got: %d", replicas, deployment.Spec.Replicas) +// } +// } func TestStatusUpdate(t *testing.T) { storage, server := newStorage(t) diff --git a/pkg/registry/endpoint/etcd/etcd.go b/pkg/registry/endpoint/etcd/etcd.go index 4dc899225cd..0b7e4f7c064 100644 --- a/pkg/registry/endpoint/etcd/etcd.go +++ b/pkg/registry/endpoint/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/endpoint" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE newListFunc := func() runtime.Object { return &api.EndpointsList{} } storageInterface := storageDecorator( - s, 1000, &api.Endpoints{}, prefix, endpoint.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Endpoints), &api.Endpoints{}, prefix, endpoint.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Endpoints{} }, diff --git a/pkg/registry/generic/etcd/etcd.go b/pkg/registry/generic/etcd/etcd.go index a6532d9d42f..d83180dba39 100644 --- a/pkg/registry/generic/etcd/etcd.go +++ b/pkg/registry/generic/etcd/etcd.go @@ -387,7 +387,7 @@ func (e *Etcd) Delete(ctx api.Context, name string, options *api.DeleteOptions) if pendingGraceful { return e.finalizeDelete(obj, false) } - if graceful { + if graceful && *options.GracePeriodSeconds > 0 { out := e.NewFunc() lastGraceful := int64(0) err := e.Storage.GuaranteedUpdate( diff --git a/pkg/registry/horizontalpodautoscaler/etcd/etcd.go b/pkg/registry/horizontalpodautoscaler/etcd/etcd.go index cb0873438c3..3686266f32d 100644 --- a/pkg/registry/horizontalpodautoscaler/etcd/etcd.go +++ b/pkg/registry/horizontalpodautoscaler/etcd/etcd.go @@ -21,6 +21,7 @@ import ( "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/horizontalpodautoscaler" @@ -38,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &extensions.HorizontalPodAutoscalerList{} } storageInterface := storageDecorator( - s, 100, &extensions.HorizontalPodAutoscaler{}, prefix, horizontalpodautoscaler.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.HorizontalPodAutoscalers), &extensions.HorizontalPodAutoscaler{}, prefix, horizontalpodautoscaler.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &extensions.HorizontalPodAutoscaler{} }, diff --git a/pkg/registry/ingress/etcd/etcd.go b/pkg/registry/ingress/etcd/etcd.go index d01d35e53fa..5932b09cd51 100644 --- a/pkg/registry/ingress/etcd/etcd.go +++ b/pkg/registry/ingress/etcd/etcd.go @@ -21,6 +21,7 @@ import ( "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" ingress "k8s.io/kubernetes/pkg/registry/ingress" @@ -39,7 +40,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &extensions.IngressList{} } storageInterface := storageDecorator( - s, 100, &extensions.Ingress{}, prefix, ingress.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Ingress), &extensions.Ingress{}, prefix, ingress.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &extensions.Ingress{} }, diff --git a/pkg/registry/ingress/etcd/etcd_test.go b/pkg/registry/ingress/etcd/etcd_test.go index 31f72a9ac29..9de11138827 100755 --- a/pkg/registry/ingress/etcd/etcd_test.go +++ b/pkg/registry/ingress/etcd/etcd_test.go @@ -45,6 +45,9 @@ var ( defaultLoadBalancer = "127.0.0.1" defaultPath = "/foo" defaultPathMap = map[string]string{defaultPath: defaultBackendName} + defaultTLS = []extensions.IngressTLS{ + {Hosts: []string{"foo.bar.com", "*.bar.com"}, SecretName: "fooSecret"}, + } ) type IngressRuleValues map[string]string @@ -92,6 +95,7 @@ func newIngress(pathMap map[string]string) *extensions.Ingress { Rules: toIngressRules(map[string]IngressRuleValues{ defaultHostname: pathMap, }), + TLS: defaultTLS, }, Status: extensions.IngressStatus{ LoadBalancer: api.LoadBalancerStatus{ @@ -139,6 +143,10 @@ func TestUpdate(t *testing.T) { object.Spec.Rules = toIngressRules(map[string]IngressRuleValues{ "bar.foo.com": {"/bar": defaultBackendName}, }) + object.Spec.TLS = append(object.Spec.TLS, extensions.IngressTLS{ + Hosts: []string{"*.google.com"}, + SecretName: "googleSecret", + }) return object }, // invalid updateFunc: ObjeceMeta is not to be tampered with. @@ -160,6 +168,15 @@ func TestUpdate(t *testing.T) { "foo.bar.com": {"/invalid[": "svc"}}) return object }, + + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.Ingress) + object.Spec.TLS = append(object.Spec.TLS, extensions.IngressTLS{ + Hosts: []string{"foo.bar.com"}, + SecretName: "", + }) + return object + }, ) } diff --git a/pkg/registry/job/etcd/etcd.go b/pkg/registry/job/etcd/etcd.go index bc15425fb1e..fbf3a0d7a39 100644 --- a/pkg/registry/job/etcd/etcd.go +++ b/pkg/registry/job/etcd/etcd.go @@ -21,6 +21,7 @@ import ( "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/job" @@ -39,7 +40,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &extensions.JobList{} } storageInterface := storageDecorator( - s, 100, &extensions.Job{}, prefix, job.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Jobs), &extensions.Job{}, prefix, job.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &extensions.Job{} }, diff --git a/pkg/registry/job/etcd/etcd_test.go b/pkg/registry/job/etcd/etcd_test.go index d02e86eef2d..73700651f13 100644 --- a/pkg/registry/job/etcd/etcd_test.go +++ b/pkg/registry/job/etcd/etcd_test.go @@ -20,6 +20,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" // Ensure that extensions/v1beta1 package is initialized. _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" @@ -48,7 +49,7 @@ func validNewJob() *extensions.Job { Spec: extensions.JobSpec{ Completions: &completions, Parallelism: ¶llelism, - Selector: &extensions.LabelSelector{ + Selector: &unversioned.LabelSelector{ MatchLabels: map[string]string{"a": "b"}, }, Template: api.PodTemplateSpec{ @@ -84,7 +85,7 @@ func TestCreate(t *testing.T) { &extensions.Job{ Spec: extensions.JobSpec{ Completions: validJob.Spec.Completions, - Selector: &extensions.LabelSelector{}, + Selector: &unversioned.LabelSelector{}, Template: validJob.Spec.Template, }, }, @@ -108,7 +109,7 @@ func TestUpdate(t *testing.T) { // invalid updateFunc func(obj runtime.Object) runtime.Object { object := obj.(*extensions.Job) - object.Spec.Selector = &extensions.LabelSelector{} + object.Spec.Selector = &unversioned.LabelSelector{} return object }, func(obj runtime.Object) runtime.Object { diff --git a/pkg/registry/job/strategy_test.go b/pkg/registry/job/strategy_test.go index 45b5a89b18f..924e363d1ad 100644 --- a/pkg/registry/job/strategy_test.go +++ b/pkg/registry/job/strategy_test.go @@ -22,6 +22,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" apitesting "k8s.io/kubernetes/pkg/api/testing" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" ) @@ -35,7 +36,7 @@ func TestJobStrategy(t *testing.T) { t.Errorf("Job should not allow create on update") } - validSelector := &extensions.LabelSelector{ + validSelector := &unversioned.LabelSelector{ MatchLabels: map[string]string{"a": "b"}, } validPodTemplateSpec := api.PodTemplateSpec{ @@ -100,7 +101,7 @@ func TestJobStatusStrategy(t *testing.T) { if StatusStrategy.AllowCreateOnUpdate() { t.Errorf("Job should not allow create on update") } - validSelector := &extensions.LabelSelector{ + validSelector := &unversioned.LabelSelector{ MatchLabels: map[string]string{"a": "b"}, } validPodTemplateSpec := api.PodTemplateSpec{ diff --git a/pkg/registry/limitrange/etcd/etcd.go b/pkg/registry/limitrange/etcd/etcd.go index f422c0037a3..f42ee56ddc9 100644 --- a/pkg/registry/limitrange/etcd/etcd.go +++ b/pkg/registry/limitrange/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/limitrange" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE newListFunc := func() runtime.Object { return &api.LimitRangeList{} } storageInterface := storageDecorator( - s, 100, &api.LimitRange{}, prefix, limitrange.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.LimitRanges), &api.LimitRange{}, prefix, limitrange.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.LimitRange{} }, diff --git a/pkg/registry/namespace/etcd/etcd.go b/pkg/registry/namespace/etcd/etcd.go index 231520d5df7..deb161c4242 100644 --- a/pkg/registry/namespace/etcd/etcd.go +++ b/pkg/registry/namespace/etcd/etcd.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/namespace" @@ -53,7 +54,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.NamespaceList{} } storageInterface := storageDecorator( - s, 100, &api.Namespace{}, prefix, namespace.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Namespaces), &api.Namespace{}, prefix, namespace.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Namespace{} }, diff --git a/pkg/registry/node/etcd/etcd.go b/pkg/registry/node/etcd/etcd.go index bfa10bc3bdd..339f575ece1 100644 --- a/pkg/registry/node/etcd/etcd.go +++ b/pkg/registry/node/etcd/etcd.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/rest" "k8s.io/kubernetes/pkg/kubelet/client" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/node" @@ -57,7 +58,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator, con newListFunc := func() runtime.Object { return &api.NodeList{} } storageInterface := storageDecorator( - s, 1000, &api.Node{}, prefix, node.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Nodes), &api.Node{}, prefix, node.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Node{} }, diff --git a/pkg/registry/persistentvolume/etcd/etcd.go b/pkg/registry/persistentvolume/etcd/etcd.go index 0a8e9dccd98..60136ddefa8 100644 --- a/pkg/registry/persistentvolume/etcd/etcd.go +++ b/pkg/registry/persistentvolume/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/persistentvolume" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.PersistentVolumeList{} } storageInterface := storageDecorator( - s, 100, &api.PersistentVolume{}, prefix, persistentvolume.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.PersistentVolumes), &api.PersistentVolume{}, prefix, persistentvolume.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.PersistentVolume{} }, diff --git a/pkg/registry/persistentvolumeclaim/etcd/etcd.go b/pkg/registry/persistentvolumeclaim/etcd/etcd.go index 80b8c672890..1a245f6e9d4 100644 --- a/pkg/registry/persistentvolumeclaim/etcd/etcd.go +++ b/pkg/registry/persistentvolumeclaim/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/persistentvolumeclaim" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.PersistentVolumeClaimList{} } storageInterface := storageDecorator( - s, 100, &api.PersistentVolumeClaim{}, prefix, persistentvolumeclaim.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.PersistentVolumeClaims), &api.PersistentVolumeClaim{}, prefix, persistentvolumeclaim.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.PersistentVolumeClaim{} }, diff --git a/pkg/registry/pod/etcd/etcd.go b/pkg/registry/pod/etcd/etcd.go index f4cabe9cde2..f5769cea683 100644 --- a/pkg/registry/pod/etcd/etcd.go +++ b/pkg/registry/pod/etcd/etcd.go @@ -30,6 +30,7 @@ import ( "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/kubelet/client" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/pod" @@ -67,7 +68,7 @@ func NewStorage( newListFunc := func() runtime.Object { return &api.PodList{} } storageInterface := storageDecorator( - s, 1000, &api.Pod{}, prefix, pod.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Pods), &api.Pod{}, prefix, pod.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Pod{} }, diff --git a/pkg/registry/pod/strategy.go b/pkg/registry/pod/strategy.go index 4e957fd1eb7..ffdeb988ef1 100644 --- a/pkg/registry/pod/strategy.go +++ b/pkg/registry/pod/strategy.go @@ -22,6 +22,7 @@ import ( "net/http" "net/url" "strconv" + "strings" "time" "k8s.io/kubernetes/pkg/api" @@ -231,6 +232,15 @@ func ResourceLocation(getter ResourceGetter, rt http.RoundTripper, ctx api.Conte return loc, rt, nil } +// getContainerNames returns a formatted string containing the container names +func getContainerNames(pod *api.Pod) string { + names := []string{} + for _, c := range pod.Spec.Containers { + names = append(names, c.Name) + } + return strings.Join(names, " ") +} + // LogLocation returns the log URL for a pod container. If opts.Container is blank // and only one container is present in the pod, that container is used. func LogLocation( @@ -249,10 +259,14 @@ func LogLocation( // If a container was provided, it must be valid container := opts.Container if len(container) == 0 { - if len(pod.Spec.Containers) == 1 { + switch len(pod.Spec.Containers) { + case 1: container = pod.Spec.Containers[0].Name - } else { + case 0: return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s", name)) + default: + containerNames := getContainerNames(pod) + return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s, choose one of: [%s]", name, containerNames)) } } else { if !podHasContainerWithName(pod, container) { @@ -386,10 +400,14 @@ func streamLocation( // Try to figure out a container // If a container was provided, it must be valid if container == "" { - if len(pod.Spec.Containers) == 1 { + switch len(pod.Spec.Containers) { + case 1: container = pod.Spec.Containers[0].Name - } else { + case 0: return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s", name)) + default: + containerNames := getContainerNames(pod) + return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s, choose one of: [%s]", name, containerNames)) } } else { if !podHasContainerWithName(pod, container) { diff --git a/pkg/registry/pod/strategy_test.go b/pkg/registry/pod/strategy_test.go index 17e746dd9b2..08ed1680e18 100644 --- a/pkg/registry/pod/strategy_test.go +++ b/pkg/registry/pod/strategy_test.go @@ -129,7 +129,7 @@ func TestCheckLogLocation(t *testing.T) { Status: api.PodStatus{}, }, opts: &api.PodLogOptions{}, - expectedErr: errors.NewBadRequest("a container name must be specified for pod test"), + expectedErr: errors.NewBadRequest("a container name must be specified for pod test, choose one of: [container1 container2]"), }, { in: &api.Pod{ diff --git a/pkg/registry/podsecuritypolicy/doc.go b/pkg/registry/podsecuritypolicy/doc.go new file mode 100644 index 00000000000..fa50db8e4ee --- /dev/null +++ b/pkg/registry/podsecuritypolicy/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2015 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. +*/ + +// Package podsecuritypolicy provides Registry interface and its REST +// implementation for storing PodSecurityPolicy api objects. +package podsecuritypolicy diff --git a/pkg/registry/podsecuritypolicy/etcd/etcd.go b/pkg/registry/podsecuritypolicy/etcd/etcd.go new file mode 100644 index 00000000000..40b181da639 --- /dev/null +++ b/pkg/registry/podsecuritypolicy/etcd/etcd.go @@ -0,0 +1,67 @@ +/* +Copyright 2014 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. +*/ + +package etcd + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/generic" + etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" + "k8s.io/kubernetes/pkg/registry/podsecuritypolicy" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/storage" +) + +// REST implements a RESTStorage for PodSecurityPolicies against etcd. +type REST struct { + *etcdgeneric.Etcd +} + +const Prefix = "/podsecuritypolicies" + +// NewREST returns a RESTStorage object that will work against PodSecurityPolicy objects. +func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *REST { + newListFunc := func() runtime.Object { return &extensions.PodSecurityPolicyList{} } + storageInterface := storageDecorator( + s, 100, &extensions.PodSecurityPolicy{}, Prefix, podsecuritypolicy.Strategy, newListFunc) + + store := &etcdgeneric.Etcd{ + NewFunc: func() runtime.Object { return &extensions.PodSecurityPolicy{} }, + NewListFunc: newListFunc, + KeyRootFunc: func(ctx api.Context) string { + return Prefix + }, + KeyFunc: func(ctx api.Context, name string) (string, error) { + return etcdgeneric.NoNamespaceKeyFunc(ctx, Prefix, name) + }, + ObjectNameFunc: func(obj runtime.Object) (string, error) { + return obj.(*extensions.PodSecurityPolicy).Name, nil + }, + PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher { + return podsecuritypolicy.MatchPodSecurityPolicy(label, field) + }, + QualifiedResource: extensions.Resource("podsecuritypolicies"), + + CreateStrategy: podsecuritypolicy.Strategy, + UpdateStrategy: podsecuritypolicy.Strategy, + ReturnDeletedObject: true, + Storage: storageInterface, + } + return &REST{store} +} diff --git a/pkg/registry/podsecuritypolicy/etcd/etcd_test.go b/pkg/registry/podsecuritypolicy/etcd/etcd_test.go new file mode 100644 index 00000000000..4fd96066e5c --- /dev/null +++ b/pkg/registry/podsecuritypolicy/etcd/etcd_test.go @@ -0,0 +1,130 @@ +/* +Copyright 2014 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. +*/ + +package etcd + +import ( + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + // Ensure that extensions/v1beta1 package is initialized. + _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/generic" + "k8s.io/kubernetes/pkg/registry/registrytest" + "k8s.io/kubernetes/pkg/runtime" + etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing" +) + +func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) { + etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions") + return NewREST(etcdStorage, generic.UndecoratedStorage), server +} + +func validNewPodSecurityPolicy() *extensions.PodSecurityPolicy { + return &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + }, + Spec: extensions.PodSecurityPolicySpec{ + SELinuxContext: extensions.SELinuxContextStrategyOptions{ + Type: extensions.SELinuxStrategyRunAsAny, + }, + RunAsUser: extensions.RunAsUserStrategyOptions{ + Type: extensions.RunAsUserStrategyRunAsAny, + }, + }, + } +} + +func TestCreate(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope() + scc := validNewPodSecurityPolicy() + scc.ObjectMeta = api.ObjectMeta{GenerateName: "foo-"} + test.TestCreate( + // valid + scc, + // invalid + &extensions.PodSecurityPolicy{ + ObjectMeta: api.ObjectMeta{Name: "name with spaces"}, + }, + ) +} + +func TestUpdate(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope() + test.TestUpdate( + // valid + validNewPodSecurityPolicy(), + // updateFunc + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.PodSecurityPolicy) + object.Labels = map[string]string{"a": "b"} + return object + }, + ) +} + +func TestDelete(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope().ReturnDeletedObject() + test.TestDelete(validNewPodSecurityPolicy()) +} + +func TestGet(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope() + test.TestGet(validNewPodSecurityPolicy()) +} + +func TestList(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope() + test.TestList(validNewPodSecurityPolicy()) +} + +func TestWatch(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.Etcd).ClusterScope() + test.TestWatch( + validNewPodSecurityPolicy(), + // matching labels + []labels.Set{}, + // not matching labels + []labels.Set{ + {"foo": "bar"}, + }, + // matching fields + []fields.Set{ + {"metadata.name": "foo"}, + }, + // not matching fields + []fields.Set{ + {"metadata.name": "bar"}, + {"name": "foo"}, + }, + ) +} diff --git a/pkg/registry/podsecuritypolicy/strategy.go b/pkg/registry/podsecuritypolicy/strategy.go new file mode 100644 index 00000000000..905be4dc6db --- /dev/null +++ b/pkg/registry/podsecuritypolicy/strategy.go @@ -0,0 +1,93 @@ +/* +Copyright 2015 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. +*/ + +package podsecuritypolicy + +import ( + "fmt" + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/rest" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/apis/extensions/validation" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/generic" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util/validation/field" +) + +// strategy implements behavior for PodSecurityPolicy objects +type strategy struct { + runtime.ObjectTyper + api.NameGenerator +} + +// Strategy is the default logic that applies when creating and updating PodSecurityPolicy +// objects via the REST API. +var Strategy = strategy{api.Scheme, api.SimpleNameGenerator} + +var _ = rest.RESTCreateStrategy(Strategy) + +var _ = rest.RESTUpdateStrategy(Strategy) + +func (strategy) NamespaceScoped() bool { + return false +} + +func (strategy) AllowCreateOnUpdate() bool { + return false +} + +func (strategy) AllowUnconditionalUpdate() bool { + return true +} + +func (strategy) PrepareForCreate(obj runtime.Object) { +} + +func (strategy) PrepareForUpdate(obj, old runtime.Object) { +} + +func (strategy) Canonicalize(obj runtime.Object) { +} + +func (strategy) Validate(ctx api.Context, obj runtime.Object) field.ErrorList { + return validation.ValidatePodSecurityPolicy(obj.(*extensions.PodSecurityPolicy)) +} + +func (strategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) field.ErrorList { + return validation.ValidatePodSecurityPolicyUpdate(old.(*extensions.PodSecurityPolicy), obj.(*extensions.PodSecurityPolicy)) +} + +// Matcher returns a generic matcher for a given label and field selector. +func MatchPodSecurityPolicy(label labels.Selector, field fields.Selector) generic.Matcher { + return &generic.SelectionPredicate{ + Label: label, + Field: field, + GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) { + psp, ok := obj.(*extensions.PodSecurityPolicy) + if !ok { + return nil, nil, fmt.Errorf("given object is not a pod security policy.") + } + return labels.Set(psp.ObjectMeta.Labels), PodSecurityPolicyToSelectableFields(psp), nil + }, + } +} + +// PodSecurityPolicyToSelectableFields returns a label set that represents the object +func PodSecurityPolicyToSelectableFields(obj *extensions.PodSecurityPolicy) fields.Set { + return generic.ObjectMetaFieldsSet(obj.ObjectMeta, false) +} diff --git a/pkg/registry/podtemplate/etcd/etcd.go b/pkg/registry/podtemplate/etcd/etcd.go index 110a27f31db..17d2718a605 100644 --- a/pkg/registry/podtemplate/etcd/etcd.go +++ b/pkg/registry/podtemplate/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/podtemplate" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE newListFunc := func() runtime.Object { return &api.PodTemplateList{} } storageInterface := storageDecorator( - s, 100, &api.PodTemplate{}, prefix, podtemplate.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.PodTemplates), &api.PodTemplate{}, prefix, podtemplate.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.PodTemplate{} }, diff --git a/pkg/registry/replicaset/doc.go b/pkg/registry/replicaset/doc.go new file mode 100644 index 00000000000..ee349fae740 --- /dev/null +++ b/pkg/registry/replicaset/doc.go @@ -0,0 +1,19 @@ +/* +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. +*/ + +// Package replicaset provides Registry interface and it's RESTStorage +// implementation for storing ReplicaSet api objects. +package replicaset diff --git a/pkg/registry/replicaset/etcd/etcd.go b/pkg/registry/replicaset/etcd/etcd.go new file mode 100644 index 00000000000..f6d606be2a3 --- /dev/null +++ b/pkg/registry/replicaset/etcd/etcd.go @@ -0,0 +1,112 @@ +/* +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. +*/ + +// If you make changes to this file, you should also make the corresponding change in ReplicationController. + +package etcd + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" + "k8s.io/kubernetes/pkg/registry/generic" + etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" + "k8s.io/kubernetes/pkg/registry/replicaset" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/storage" +) + +// ReplicaSetStorage includes dummy storage for ReplicaSets and for Scale subresource. +type ReplicaSetStorage struct { + ReplicaSet *REST + Status *StatusREST +} + +func NewStorage(s storage.Interface, storageDecorator generic.StorageDecorator) ReplicaSetStorage { + replicaSetRest, replicaSetStatusRest := NewREST(s, storageDecorator) + + return ReplicaSetStorage{ + ReplicaSet: replicaSetRest, + Status: replicaSetStatusRest, + } +} + +type REST struct { + *etcdgeneric.Etcd +} + +// NewREST returns a RESTStorage object that will work against ReplicaSet. +func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*REST, *StatusREST) { + prefix := "/replicasets" + + newListFunc := func() runtime.Object { return &extensions.ReplicaSetList{} } + storageInterface := storageDecorator( + s, cachesize.GetWatchCacheSizeByResource(cachesize.Replicasets), &extensions.ReplicaSet{}, prefix, replicaset.Strategy, newListFunc) + + store := &etcdgeneric.Etcd{ + NewFunc: func() runtime.Object { return &extensions.ReplicaSet{} }, + + // NewListFunc returns an object capable of storing results of an etcd list. + NewListFunc: newListFunc, + // Produces a path that etcd understands, to the root of the resource + // by combining the namespace in the context with the given prefix + KeyRootFunc: func(ctx api.Context) string { + return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix) + }, + // Produces a path that etcd understands, to the resource by combining + // the namespace in the context with the given prefix + KeyFunc: func(ctx api.Context, name string) (string, error) { + return etcdgeneric.NamespaceKeyFunc(ctx, prefix, name) + }, + // Retrieve the name field of a ReplicaSet + ObjectNameFunc: func(obj runtime.Object) (string, error) { + return obj.(*extensions.ReplicaSet).Name, nil + }, + // Used to match objects based on labels/fields for list and watch + PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher { + return replicaset.MatchReplicaSet(label, field) + }, + QualifiedResource: api.Resource("replicasets"), + + // Used to validate ReplicaSet creation + CreateStrategy: replicaset.Strategy, + + // Used to validate ReplicaSet updates + UpdateStrategy: replicaset.Strategy, + + Storage: storageInterface, + } + statusStore := *store + statusStore.UpdateStrategy = replicaset.StatusStrategy + + return &REST{store}, &StatusREST{store: &statusStore} +} + +// StatusREST implements the REST endpoint for changing the status of a ReplicaSet +type StatusREST struct { + store *etcdgeneric.Etcd +} + +func (r *StatusREST) New() runtime.Object { + return &extensions.ReplicaSet{} +} + +// Update alters the status subset of an object. +func (r *StatusREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) { + return r.store.Update(ctx, obj) +} diff --git a/pkg/registry/replicaset/etcd/etcd_test.go b/pkg/registry/replicaset/etcd/etcd_test.go new file mode 100644 index 00000000000..f7654597514 --- /dev/null +++ b/pkg/registry/replicaset/etcd/etcd_test.go @@ -0,0 +1,237 @@ +/* +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. +*/ + +package etcd + +import ( + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/generic" + "k8s.io/kubernetes/pkg/registry/registrytest" + "k8s.io/kubernetes/pkg/runtime" + etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing" +) + +func newStorage(t *testing.T) (*ReplicaSetStorage, *etcdtesting.EtcdTestServer) { + etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions") + replicaSetStorage := NewStorage(etcdStorage, generic.UndecoratedStorage) + return &replicaSetStorage, server +} + +// createReplicaSet is a helper function that returns a ReplicaSet with the updated resource version. +func createReplicaSet(storage *REST, rs extensions.ReplicaSet, t *testing.T) (extensions.ReplicaSet, error) { + ctx := api.WithNamespace(api.NewContext(), rs.Namespace) + obj, err := storage.Create(ctx, &rs) + if err != nil { + t.Errorf("Failed to create ReplicaSet, %v", err) + } + newRS := obj.(*extensions.ReplicaSet) + return *newRS, nil +} + +func validNewReplicaSet() *extensions.ReplicaSet { + return &extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{ + Name: "foo", + Namespace: api.NamespaceDefault, + }, + Spec: extensions.ReplicaSetSpec{ + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{"a": "b"}}, + Template: &api.PodTemplateSpec{ + ObjectMeta: api.ObjectMeta{ + Labels: map[string]string{"a": "b"}, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "test", + Image: "test_image", + ImagePullPolicy: api.PullIfNotPresent, + }, + }, + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + }, + }, + Replicas: 7, + }, + Status: extensions.ReplicaSetStatus{ + Replicas: 5, + }, + } +} + +var validReplicaSet = *validNewReplicaSet() + +func TestCreate(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + rs := validNewReplicaSet() + rs.ObjectMeta = api.ObjectMeta{} + test.TestCreate( + // valid + rs, + // invalid (invalid selector) + &extensions.ReplicaSet{ + Spec: extensions.ReplicaSetSpec{ + Replicas: 2, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{}}, + Template: validReplicaSet.Spec.Template, + }, + }, + ) +} + +func TestUpdate(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + test.TestUpdate( + // valid + validNewReplicaSet(), + // valid updateFunc + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.ReplicaSet) + object.Spec.Replicas = object.Spec.Replicas + 1 + return object + }, + // invalid updateFunc + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.ReplicaSet) + object.UID = "newUID" + return object + }, + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.ReplicaSet) + object.Name = "" + return object + }, + func(obj runtime.Object) runtime.Object { + object := obj.(*extensions.ReplicaSet) + object.Spec.Selector = &unversioned.LabelSelector{MatchLabels: map[string]string{}} + return object + }, + ) +} + +func TestDelete(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + test.TestDelete(validNewReplicaSet()) +} + +func TestGenerationNumber(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + modifiedSno := *validNewReplicaSet() + modifiedSno.Generation = 100 + modifiedSno.Status.ObservedGeneration = 10 + ctx := api.NewDefaultContext() + rs, err := createReplicaSet(storage.ReplicaSet, modifiedSno, t) + etcdRS, err := storage.ReplicaSet.Get(ctx, rs.Name) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + storedRS, _ := etcdRS.(*extensions.ReplicaSet) + + // Generation initialization + if storedRS.Generation != 1 && storedRS.Status.ObservedGeneration != 0 { + t.Fatalf("Unexpected generation number %v, status generation %v", storedRS.Generation, storedRS.Status.ObservedGeneration) + } + + // Updates to spec should increment the generation number + storedRS.Spec.Replicas += 1 + storage.ReplicaSet.Update(ctx, storedRS) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + etcdRS, err = storage.ReplicaSet.Get(ctx, rs.Name) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + storedRS, _ = etcdRS.(*extensions.ReplicaSet) + if storedRS.Generation != 2 || storedRS.Status.ObservedGeneration != 0 { + t.Fatalf("Unexpected generation, spec: %v, status: %v", storedRS.Generation, storedRS.Status.ObservedGeneration) + } + + // Updates to status should not increment either spec or status generation numbers + storedRS.Status.Replicas += 1 + storage.ReplicaSet.Update(ctx, storedRS) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + etcdRS, err = storage.ReplicaSet.Get(ctx, rs.Name) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + storedRS, _ = etcdRS.(*extensions.ReplicaSet) + if storedRS.Generation != 2 || storedRS.Status.ObservedGeneration != 0 { + t.Fatalf("Unexpected generation number, spec: %v, status: %v", storedRS.Generation, storedRS.Status.ObservedGeneration) + } +} + +func TestGet(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + test.TestGet(validNewReplicaSet()) +} + +func TestList(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + test.TestList(validNewReplicaSet()) +} + +func TestWatch(t *testing.T) { + storage, server := newStorage(t) + defer server.Terminate(t) + test := registrytest.New(t, storage.ReplicaSet.Etcd) + test.TestWatch( + validNewReplicaSet(), + // matching labels + []labels.Set{ + {"a": "b"}, + }, + // not matching labels + []labels.Set{ + {"a": "c"}, + {"foo": "bar"}, + }, + // matching fields + []fields.Set{ + {"status.replicas": "5"}, + {"metadata.name": "foo"}, + {"status.replicas": "5", "metadata.name": "foo"}, + }, + // not matchin fields + []fields.Set{ + {"status.replicas": "10"}, + {"metadata.name": "bar"}, + {"name": "foo"}, + {"status.replicas": "10", "metadata.name": "foo"}, + {"status.replicas": "0", "metadata.name": "bar"}, + }, + ) +} diff --git a/pkg/registry/replicaset/registry.go b/pkg/registry/replicaset/registry.go new file mode 100644 index 00000000000..d1279179a32 --- /dev/null +++ b/pkg/registry/replicaset/registry.go @@ -0,0 +1,93 @@ +/* +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. +*/ + +// If you make changes to this file, you should also make the corresponding change in ReplicationController. + +package replicaset + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/rest" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/watch" +) + +// Registry is an interface for things that know how to store ReplicaSets. +type Registry interface { + ListReplicaSets(ctx api.Context, options *api.ListOptions) (*extensions.ReplicaSetList, error) + WatchReplicaSets(ctx api.Context, options *api.ListOptions) (watch.Interface, error) + GetReplicaSet(ctx api.Context, replicaSetID string) (*extensions.ReplicaSet, error) + CreateReplicaSet(ctx api.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) + UpdateReplicaSet(ctx api.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) + DeleteReplicaSet(ctx api.Context, replicaSetID string) error +} + +// storage puts strong typing around storage calls +type storage struct { + rest.StandardStorage +} + +// NewRegistry returns a new Registry interface for the given Storage. Any mismatched +// types will panic. +func NewRegistry(s rest.StandardStorage) Registry { + return &storage{s} +} + +func (s *storage) ListReplicaSets(ctx api.Context, options *api.ListOptions) (*extensions.ReplicaSetList, error) { + if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() { + return nil, fmt.Errorf("field selector not supported yet") + } + obj, err := s.List(ctx, options) + if err != nil { + return nil, err + } + return obj.(*extensions.ReplicaSetList), err +} + +func (s *storage) WatchReplicaSets(ctx api.Context, options *api.ListOptions) (watch.Interface, error) { + return s.Watch(ctx, options) +} + +func (s *storage) GetReplicaSet(ctx api.Context, replicaSetID string) (*extensions.ReplicaSet, error) { + obj, err := s.Get(ctx, replicaSetID) + if err != nil { + return nil, err + } + return obj.(*extensions.ReplicaSet), nil +} + +func (s *storage) CreateReplicaSet(ctx api.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) { + obj, err := s.Create(ctx, replicaSet) + if err != nil { + return nil, err + } + return obj.(*extensions.ReplicaSet), nil +} + +func (s *storage) UpdateReplicaSet(ctx api.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) { + obj, _, err := s.Update(ctx, replicaSet) + if err != nil { + return nil, err + } + return obj.(*extensions.ReplicaSet), nil +} + +func (s *storage) DeleteReplicaSet(ctx api.Context, replicaSetID string) error { + _, err := s.Delete(ctx, replicaSetID, nil) + return err +} diff --git a/pkg/registry/replicaset/strategy.go b/pkg/registry/replicaset/strategy.go new file mode 100644 index 00000000000..71da18cdb02 --- /dev/null +++ b/pkg/registry/replicaset/strategy.go @@ -0,0 +1,149 @@ +/* +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. +*/ + +// If you make changes to this file, you should also make the corresponding change in ReplicationController. + +package replicaset + +import ( + "fmt" + "reflect" + "strconv" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/apis/extensions/validation" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/generic" + "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util/validation/field" +) + +// rsStrategy implements verification logic for ReplicaSets. +type rsStrategy struct { + runtime.ObjectTyper + api.NameGenerator +} + +// Strategy is the default logic that applies when creating and updating ReplicaSet objects. +var Strategy = rsStrategy{api.Scheme, api.SimpleNameGenerator} + +// NamespaceScoped returns true because all ReplicaSets need to be within a namespace. +func (rsStrategy) NamespaceScoped() bool { + return true +} + +// PrepareForCreate clears the status of a ReplicaSet before creation. +func (rsStrategy) PrepareForCreate(obj runtime.Object) { + rs := obj.(*extensions.ReplicaSet) + rs.Status = extensions.ReplicaSetStatus{} + + rs.Generation = 1 +} + +// PrepareForUpdate clears fields that are not allowed to be set by end users on update. +func (rsStrategy) PrepareForUpdate(obj, old runtime.Object) { + newRS := obj.(*extensions.ReplicaSet) + oldRS := old.(*extensions.ReplicaSet) + // update is not allowed to set status + newRS.Status = oldRS.Status + + // Any changes to the spec increment the generation number, any changes to the + // status should reflect the generation number of the corresponding object. We push + // the burden of managing the status onto the clients because we can't (in general) + // know here what version of spec the writer of the status has seen. It may seem like + // we can at first -- since obj contains spec -- but in the future we will probably make + // status its own object, and even if we don't, writes may be the result of a + // read-update-write loop, so the contents of spec may not actually be the spec that + // the ReplicaSet has *seen*. + // + // TODO: Any changes to a part of the object that represents desired state (labels, + // annotations etc) should also increment the generation. + if !reflect.DeepEqual(oldRS.Spec, newRS.Spec) { + newRS.Generation = oldRS.Generation + 1 + } +} + +// Validate validates a new ReplicaSet. +func (rsStrategy) Validate(ctx api.Context, obj runtime.Object) field.ErrorList { + rs := obj.(*extensions.ReplicaSet) + return validation.ValidateReplicaSet(rs) +} + +// Canonicalize normalizes the object after validation. +func (rsStrategy) Canonicalize(obj runtime.Object) { +} + +// AllowCreateOnUpdate is false for ReplicaSets; this means a POST is +// needed to create one. +func (rsStrategy) AllowCreateOnUpdate() bool { + return false +} + +// ValidateUpdate is the default update validation for an end user. +func (rsStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) field.ErrorList { + validationErrorList := validation.ValidateReplicaSet(obj.(*extensions.ReplicaSet)) + updateErrorList := validation.ValidateReplicaSetUpdate(obj.(*extensions.ReplicaSet), old.(*extensions.ReplicaSet)) + return append(validationErrorList, updateErrorList...) +} + +func (rsStrategy) AllowUnconditionalUpdate() bool { + return true +} + +// ReplicaSetToSelectableFields returns a field set that represents the object. +func ReplicaSetToSelectableFields(rs *extensions.ReplicaSet) fields.Set { + objectMetaFieldsSet := generic.ObjectMetaFieldsSet(rs.ObjectMeta, true) + rsSpecificFieldsSet := fields.Set{ + "status.replicas": strconv.Itoa(rs.Status.Replicas), + } + return generic.MergeFieldsSets(objectMetaFieldsSet, rsSpecificFieldsSet) +} + +// MatchReplicaSet is the filter used by the generic etcd backend to route +// watch events from etcd to clients of the apiserver only interested in specific +// labels/fields. +func MatchReplicaSet(label labels.Selector, field fields.Selector) generic.Matcher { + return &generic.SelectionPredicate{ + Label: label, + Field: field, + GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) { + rs, ok := obj.(*extensions.ReplicaSet) + if !ok { + return nil, nil, fmt.Errorf("Given object is not a ReplicaSet.") + } + return labels.Set(rs.ObjectMeta.Labels), ReplicaSetToSelectableFields(rs), nil + }, + } +} + +type rsStatusStrategy struct { + rsStrategy +} + +var StatusStrategy = rsStatusStrategy{Strategy} + +func (rsStatusStrategy) PrepareForUpdate(obj, old runtime.Object) { + newRS := obj.(*extensions.ReplicaSet) + oldRS := old.(*extensions.ReplicaSet) + // update is not allowed to set spec + newRS.Spec = oldRS.Spec +} + +func (rsStatusStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) field.ErrorList { + return validation.ValidateReplicaSetStatusUpdate(obj.(*extensions.ReplicaSet), old.(*extensions.ReplicaSet)) +} diff --git a/pkg/registry/replicaset/strategy_test.go b/pkg/registry/replicaset/strategy_test.go new file mode 100644 index 00000000000..1fe9b9f3484 --- /dev/null +++ b/pkg/registry/replicaset/strategy_test.go @@ -0,0 +1,142 @@ +/* +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. +*/ + +package replicaset + +import ( + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apis/extensions" +) + +func TestReplicaSetStrategy(t *testing.T) { + ctx := api.NewDefaultContext() + if !Strategy.NamespaceScoped() { + t.Errorf("ReplicaSet must be namespace scoped") + } + if Strategy.AllowCreateOnUpdate() { + t.Errorf("ReplicaSet should not allow create on update") + } + + validSelector := map[string]string{"a": "b"} + validPodTemplate := api.PodTemplate{ + Template: api.PodTemplateSpec{ + ObjectMeta: api.ObjectMeta{ + Labels: validSelector, + }, + Spec: api.PodSpec{ + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + Containers: []api.Container{{Name: "abc", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + }, + }, + } + rs := &extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault}, + Spec: extensions.ReplicaSetSpec{ + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, + Template: &validPodTemplate.Template, + }, + Status: extensions.ReplicaSetStatus{ + Replicas: 1, + ObservedGeneration: int64(10), + }, + } + + Strategy.PrepareForCreate(rs) + if rs.Status.Replicas != 0 { + t.Error("ReplicaSet should not allow setting status.replicas on create") + } + if rs.Status.ObservedGeneration != int64(0) { + t.Error("ReplicaSet should not allow setting status.observedGeneration on create") + } + errs := Strategy.Validate(ctx, rs) + if len(errs) != 0 { + t.Errorf("Unexpected error validating %v", errs) + } + + invalidRc := &extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "4"}, + } + Strategy.PrepareForUpdate(invalidRc, rs) + errs = Strategy.ValidateUpdate(ctx, invalidRc, rs) + if len(errs) == 0 { + t.Errorf("Expected a validation error") + } + if invalidRc.ResourceVersion != "4" { + t.Errorf("Incoming resource version on update should not be mutated") + } +} + +func TestReplicaSetStatusStrategy(t *testing.T) { + ctx := api.NewDefaultContext() + if !StatusStrategy.NamespaceScoped() { + t.Errorf("ReplicaSet must be namespace scoped") + } + if StatusStrategy.AllowCreateOnUpdate() { + t.Errorf("ReplicaSet should not allow create on update") + } + validSelector := map[string]string{"a": "b"} + validPodTemplate := api.PodTemplate{ + Template: api.PodTemplateSpec{ + ObjectMeta: api.ObjectMeta{ + Labels: validSelector, + }, + Spec: api.PodSpec{ + RestartPolicy: api.RestartPolicyAlways, + DNSPolicy: api.DNSClusterFirst, + Containers: []api.Container{{Name: "abc", Image: "image", ImagePullPolicy: "IfNotPresent"}}, + }, + }, + } + oldRS := &extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault, ResourceVersion: "10"}, + Spec: extensions.ReplicaSetSpec{ + Replicas: 3, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, + Template: &validPodTemplate.Template, + }, + Status: extensions.ReplicaSetStatus{ + Replicas: 1, + ObservedGeneration: int64(10), + }, + } + newRS := &extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault, ResourceVersion: "9"}, + Spec: extensions.ReplicaSetSpec{ + Replicas: 1, + Selector: &unversioned.LabelSelector{MatchLabels: validSelector}, + Template: &validPodTemplate.Template, + }, + Status: extensions.ReplicaSetStatus{ + Replicas: 3, + ObservedGeneration: int64(11), + }, + } + StatusStrategy.PrepareForUpdate(newRS, oldRS) + if newRS.Status.Replicas != 3 { + t.Errorf("ReplicaSet status updates should allow change of replicas: %v", newRS.Status.Replicas) + } + if newRS.Spec.Replicas != 3 { + t.Errorf("PrepareForUpdate should have preferred spec") + } + errs := StatusStrategy.ValidateUpdate(ctx, newRS, oldRS) + if len(errs) != 0 { + t.Errorf("Unexpected error %v", errs) + } +} diff --git a/pkg/registry/resourcequota/etcd/etcd.go b/pkg/registry/resourcequota/etcd/etcd.go index 4eff474b426..b28b70c4cb8 100644 --- a/pkg/registry/resourcequota/etcd/etcd.go +++ b/pkg/registry/resourcequota/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/resourcequota" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.ResourceQuotaList{} } storageInterface := storageDecorator( - s, 100, &api.ResourceQuota{}, prefix, resourcequota.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.ResourceQuotas), &api.ResourceQuota{}, prefix, resourcequota.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.ResourceQuota{} }, diff --git a/pkg/registry/secret/etcd/etcd.go b/pkg/registry/secret/etcd/etcd.go index 352e1fe4c14..fc8018f3f2e 100644 --- a/pkg/registry/secret/etcd/etcd.go +++ b/pkg/registry/secret/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/secret" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE newListFunc := func() runtime.Object { return &api.SecretList{} } storageInterface := storageDecorator( - s, 100, &api.Secret{}, prefix, secret.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Secrets), &api.Secret{}, prefix, secret.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Secret{} }, diff --git a/pkg/registry/service/etcd/etcd.go b/pkg/registry/service/etcd/etcd.go index 9cee150a969..1941779ee35 100644 --- a/pkg/registry/service/etcd/etcd.go +++ b/pkg/registry/service/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/service" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R newListFunc := func() runtime.Object { return &api.ServiceList{} } storageInterface := storageDecorator( - s, 100, &api.Service{}, prefix, service.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.Services), &api.Service{}, prefix, service.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.Service{} }, diff --git a/pkg/registry/service/ipallocator/controller/repair.go b/pkg/registry/service/ipallocator/controller/repair.go index c8fc332f32a..b0a2b90a5dd 100644 --- a/pkg/registry/service/ipallocator/controller/repair.go +++ b/pkg/registry/service/ipallocator/controller/repair.go @@ -26,7 +26,6 @@ import ( client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/registry/service" "k8s.io/kubernetes/pkg/registry/service/ipallocator" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/runtime" "k8s.io/kubernetes/pkg/util/wait" ) @@ -66,7 +65,7 @@ func NewRepair(interval time.Duration, registry service.Registry, network *net.I // RunUntil starts the controller until the provided ch is closed. func (c *Repair) RunUntil(ch chan struct{}) { - util.Until(func() { + wait.Until(func() { if err := c.RunOnce(); err != nil { runtime.HandleError(err) } @@ -100,8 +99,12 @@ func (c *Repair) runOnce() error { } ctx := api.WithNamespace(api.NewDefaultContext(), api.NamespaceAll) - options := &api.ListOptions{ResourceVersion: latest.ObjectMeta.ResourceVersion} - list, err := c.registry.ListServices(ctx, options) + // We explicitly send no resource version, since the resource version + // of 'latest' is from a different collection, it's not comparable to + // the service collection. The caching layer keeps per-collection RVs, + // and this is proper, since in theory the collections could be hosted + // in separate etcd (or even non-etcd) instances. + list, err := c.registry.ListServices(ctx, nil) if err != nil { return fmt.Errorf("unable to refresh the service IP block: %v", err) } diff --git a/pkg/registry/service/portallocator/controller/repair.go b/pkg/registry/service/portallocator/controller/repair.go index 7430a7058f4..cff3f5f3edb 100644 --- a/pkg/registry/service/portallocator/controller/repair.go +++ b/pkg/registry/service/portallocator/controller/repair.go @@ -25,9 +25,9 @@ import ( client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/registry/service" "k8s.io/kubernetes/pkg/registry/service/portallocator" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/net" "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" ) // See ipallocator/controller/repair.go; this is a copy for ports. @@ -51,7 +51,7 @@ func NewRepair(interval time.Duration, registry service.Registry, portRange net. // RunUntil starts the controller until the provided ch is closed. func (c *Repair) RunUntil(ch chan struct{}) { - util.Until(func() { + wait.Until(func() { if err := c.RunOnce(); err != nil { runtime.HandleError(err) } @@ -88,8 +88,12 @@ func (c *Repair) runOnce() error { } ctx := api.WithNamespace(api.NewDefaultContext(), api.NamespaceAll) - options := &api.ListOptions{ResourceVersion: latest.ObjectMeta.ResourceVersion} - list, err := c.registry.ListServices(ctx, options) + // We explicitly send no resource version, since the resource version + // of 'latest' is from a different collection, it's not comparable to + // the service collection. The caching layer keeps per-collection RVs, + // and this is proper, since in theory the collections could be hosted + // in separate etcd (or even non-etcd) instances. + list, err := c.registry.ListServices(ctx, nil) if err != nil { return fmt.Errorf("unable to refresh the port block: %v", err) } diff --git a/pkg/registry/serviceaccount/etcd/etcd.go b/pkg/registry/serviceaccount/etcd/etcd.go index 44534645380..14f71a2db51 100644 --- a/pkg/registry/serviceaccount/etcd/etcd.go +++ b/pkg/registry/serviceaccount/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/registry/cachesize" "k8s.io/kubernetes/pkg/registry/generic" etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd" "k8s.io/kubernetes/pkg/registry/serviceaccount" @@ -37,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE newListFunc := func() runtime.Object { return &api.ServiceAccountList{} } storageInterface := storageDecorator( - s, 100, &api.ServiceAccount{}, prefix, serviceaccount.Strategy, newListFunc) + s, cachesize.GetWatchCacheSizeByResource(cachesize.ServiceAccounts), &api.ServiceAccount{}, prefix, serviceaccount.Strategy, newListFunc) store := &etcdgeneric.Etcd{ NewFunc: func() runtime.Object { return &api.ServiceAccount{} }, diff --git a/pkg/registry/thirdpartyresourcedata/codec.go b/pkg/registry/thirdpartyresourcedata/codec.go index 33ee1094520..2e80c8c00d1 100644 --- a/pkg/registry/thirdpartyresourcedata/codec.go +++ b/pkg/registry/thirdpartyresourcedata/codec.go @@ -42,7 +42,7 @@ type thirdPartyResourceDataMapper struct { var _ meta.RESTMapper = &thirdPartyResourceDataMapper{} func (t *thirdPartyResourceDataMapper) getResource() unversioned.GroupVersionResource { - plural, _ := meta.KindToResource(t.getKind(), false) + plural, _ := meta.KindToResource(t.getKind()) return plural } diff --git a/pkg/registry/thirdpartyresourcedata/etcd/etcd.go b/pkg/registry/thirdpartyresourcedata/etcd/etcd.go index 505cb8f7801..98e7662a9f7 100644 --- a/pkg/registry/thirdpartyresourcedata/etcd/etcd.go +++ b/pkg/registry/thirdpartyresourcedata/etcd/etcd.go @@ -33,6 +33,7 @@ import ( // REST implements a RESTStorage for ThirdPartyResourceDatas against etcd type REST struct { *etcdgeneric.Etcd + kind string } // NewREST returns a registry which will store ThirdPartyResourceData in the given helper @@ -64,5 +65,13 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator, gro Storage: storageInterface, } - return &REST{store} + return &REST{ + Etcd: store, + kind: kind, + } +} + +// Implements the rest.KindProvider interface +func (r *REST) Kind() string { + return r.kind } diff --git a/pkg/runtime/conversion_generator.go b/pkg/runtime/conversion_generator.go index 8b4aea0c93d..9971b7b20df 100644 --- a/pkg/runtime/conversion_generator.go +++ b/pkg/runtime/conversion_generator.go @@ -49,7 +49,7 @@ func NewConversionGenerator(scheme *Scheme, targetPkg string) ConversionGenerato generatedNamePrefix: "auto", targetPkg: targetPkg, - publicFuncs: make(map[typePair]string), + publicFuncs: make(map[typePair]functionName), convertibles: make(map[reflect.Type]reflect.Type), overridden: make(map[reflect.Type]bool), pkgOverwrites: make(map[string]string), @@ -64,6 +64,11 @@ func NewConversionGenerator(scheme *Scheme, targetPkg string) ConversionGenerato var complexTypes []reflect.Kind = []reflect.Kind{reflect.Map, reflect.Ptr, reflect.Slice, reflect.Interface, reflect.Struct} +type functionName struct { + name string + packageName string +} + type conversionGenerator struct { scheme *Scheme @@ -71,7 +76,7 @@ type conversionGenerator struct { generatedNamePrefix string targetPkg string - publicFuncs map[typePair]string + publicFuncs map[typePair]functionName convertibles map[reflect.Type]reflect.Type overridden map[reflect.Type]bool // If pkgOverwrites is set for a given package name, that package name @@ -246,15 +251,12 @@ func (g *conversionGenerator) rememberConversionFunction(inType, outType reflect if last := strings.LastIndex(name, "."); last != -1 { p = name[:last] n = name[last+1:] - p = g.imports[p] - if len(p) > 0 { - p = p + "." - } } else { n = name } if isPublic(n) { - g.publicFuncs[typePair{inType, outType}] = p + n + g.AddImport(p) + g.publicFuncs[typePair{inType, outType}] = functionName{name: n, packageName: p} } else { log.Printf("WARNING: Cannot generate conversion %v -> %v, method %q is private", inType, outType, fn.Name()) } @@ -262,7 +264,7 @@ func (g *conversionGenerator) rememberConversionFunction(inType, outType reflect log.Printf("WARNING: Cannot generate conversion %v -> %v, method is not accessible", inType, outType) } } else if willGenerate { - g.publicFuncs[typePair{inType, outType}] = g.conversionFunctionName(inType, outType) + g.publicFuncs[typePair{inType, outType}] = functionName{name: g.conversionFunctionName(inType, outType)} } } @@ -573,7 +575,15 @@ func (g *conversionGenerator) conversionFunctionName(inType, outType reflect.Typ func (g *conversionGenerator) conversionFunctionCall(inType, outType reflect.Type, scopeName string, args ...string) string { if named, ok := g.publicFuncs[typePair{inType, outType}]; ok { args[len(args)-1] = scopeName - return fmt.Sprintf("%s(%s)", named, strings.Join(args, ", ")) + name := named.name + localPackageName, ok := g.imports[named.packageName] + if !ok { + panic(fmt.Sprintf("have not defined an import for %s", named.packageName)) + } + if len(named.packageName) > 0 && len(localPackageName) > 0 { + name = localPackageName + "." + name + } + return fmt.Sprintf("%s(%s)", name, strings.Join(args, ", ")) } log.Printf("WARNING: Using reflection to convert %v -> %v (no public conversion)", inType, outType) return fmt.Sprintf("%s.Convert(%s)", scopeName, strings.Join(args, ", ")) diff --git a/pkg/runtime/error.go b/pkg/runtime/error.go index e999e66e96c..ca60ee81332 100644 --- a/pkg/runtime/error.go +++ b/pkg/runtime/error.go @@ -40,8 +40,8 @@ func (k *notRegisteredErr) Error() string { if len(k.gvk.Kind) == 0 { return fmt.Sprintf("no version %q has been registered", k.gvk.GroupVersion()) } - if len(k.gvk.Version) == 0 { - return fmt.Sprintf("no kind %q is registered for the default version of group %q", k.gvk.Kind, k.gvk.Group) + if k.gvk.Version == APIVersionInternal { + return fmt.Sprintf("no kind %q is registered for the internal version of group %q", k.gvk.Kind, k.gvk.Group) } return fmt.Sprintf("no kind %q is registered for version %q", k.gvk.Kind, k.gvk.GroupVersion()) diff --git a/pkg/runtime/unstructured.go b/pkg/runtime/unstructured.go index 4fe5091c379..59dfa2458cf 100644 --- a/pkg/runtime/unstructured.go +++ b/pkg/runtime/unstructured.go @@ -26,12 +26,10 @@ import ( // UnstructuredJSONScheme is capable of converting JSON data into the Unstructured // type, which can be used for generic access to objects without a predefined scheme. // TODO: move into serializer/json. -var UnstructuredJSONScheme Decoder = unstructuredJSONScheme{} +var UnstructuredJSONScheme Codec = unstructuredJSONScheme{} type unstructuredJSONScheme struct{} -var _ Codec = unstructuredJSONScheme{} - func (s unstructuredJSONScheme) Decode(data []byte, _ *unversioned.GroupVersionKind, _ Object) (Object, *unversioned.GroupVersionKind, error) { unstruct := &Unstructured{} diff --git a/pkg/serviceaccount/jwt_test.go b/pkg/serviceaccount/jwt_test.go index cf888a47581..7d7ef9590a8 100644 --- a/pkg/serviceaccount/jwt_test.go +++ b/pkg/serviceaccount/jwt_test.go @@ -26,8 +26,8 @@ import ( "github.com/dgrijalva/jwt-go" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/client/testing/fake" serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount" "k8s.io/kubernetes/pkg/serviceaccount" ) @@ -159,7 +159,7 @@ func TestTokenGenerateAndValidate(t *testing.T) { } testCases := map[string]struct { - Client client.Interface + Client clientset.Interface Keys []*rsa.PublicKey ExpectedErr bool @@ -199,7 +199,7 @@ func TestTokenGenerateAndValidate(t *testing.T) { ExpectedGroups: []string{"system:serviceaccounts", "system:serviceaccounts:test"}, }, "valid lookup": { - Client: testclient.NewSimpleFake(serviceAccount, secret), + Client: fake.NewSimpleClientset(serviceAccount, secret), Keys: []*rsa.PublicKey{getPublicKey(publicKey)}, ExpectedErr: false, ExpectedOK: true, @@ -208,13 +208,13 @@ func TestTokenGenerateAndValidate(t *testing.T) { ExpectedGroups: []string{"system:serviceaccounts", "system:serviceaccounts:test"}, }, "invalid secret lookup": { - Client: testclient.NewSimpleFake(serviceAccount), + Client: fake.NewSimpleClientset(serviceAccount), Keys: []*rsa.PublicKey{getPublicKey(publicKey)}, ExpectedErr: true, ExpectedOK: false, }, "invalid serviceaccount lookup": { - Client: testclient.NewSimpleFake(secret), + Client: fake.NewSimpleClientset(secret), Keys: []*rsa.PublicKey{getPublicKey(publicKey)}, ExpectedErr: true, ExpectedOK: false, diff --git a/pkg/util/ssh.go b/pkg/ssh/ssh.go similarity index 55% rename from pkg/util/ssh.go rename to pkg/ssh/ssh.go index 64ced17b674..a85bb760537 100644 --- a/pkg/util/ssh.go +++ b/pkg/ssh/ssh.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package ssh import ( "bytes" "crypto/rand" "crypto/rsa" + "crypto/tls" "crypto/x509" "encoding/pem" "errors" @@ -28,13 +29,19 @@ import ( "io/ioutil" mathrand "math/rand" "net" + "net/http" + "net/url" "os" + "sync" "time" "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" "golang.org/x/crypto/ssh" + + utilnet "k8s.io/kubernetes/pkg/util/net" "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/wait" ) var ( @@ -108,9 +115,8 @@ func (s *SSHTunnel) Open() error { tunnelOpenCounter.Inc() if err != nil { tunnelOpenFailCounter.Inc() - return err } - return nil + return err } func (s *SSHTunnel) Dial(network, address string) (net.Conn, error) { @@ -161,11 +167,11 @@ func (d *realSSHDialer) Dial(network, addr string, config *ssh.ClientConfig) (*s // host as specific user, along with any SSH-level error. // If user=="", it will default (like SSH) to os.Getenv("USER") func RunSSHCommand(cmd, user, host string, signer ssh.Signer) (string, string, int, error) { - return runSSHCommand(&realSSHDialer{}, cmd, user, host, signer) + return runSSHCommand(&realSSHDialer{}, cmd, user, host, signer, true) } // Internal implementation of runSSHCommand, for testing -func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer) (string, string, int, error) { +func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer, retry bool) (string, string, int, error) { if user == "" { user = os.Getenv("USER") } @@ -175,6 +181,15 @@ func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer) Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, } client, err := dialer.Dial("tcp", host, config) + if err != nil && retry { + err = wait.Poll(5*time.Second, 20*time.Second, func() (bool, error) { + fmt.Printf("error dialing %s@%s: '%v', retrying\n", user, host, err) + if client, err = dialer.Dial("tcp", host, config); err != nil { + return false, nil + } + return true, nil + }) + } if err != nil { return "", "", 0, fmt.Errorf("error getting SSH client to %s@%s: '%v'", user, host, err) } @@ -240,95 +255,193 @@ func ParsePublicKeyFromFile(keyFile string) (*rsa.PublicKey, error) { return rsaKey, nil } -// Should be thread safe. -type SSHTunnelEntry struct { +type tunnel interface { + Open() error + Close() error + Dial(network, address string) (net.Conn, error) +} + +type sshTunnelEntry struct { Address string - Tunnel *SSHTunnel + Tunnel tunnel +} + +type sshTunnelCreator interface { + NewSSHTunnel(user, keyFile, healthCheckURL string) (tunnel, error) +} + +type realTunnelCreator struct{} + +func (*realTunnelCreator) NewSSHTunnel(user, keyFile, healthCheckURL string) (tunnel, error) { + return NewSSHTunnel(user, keyFile, healthCheckURL) } -// Not thread safe! type SSHTunnelList struct { - entries []SSHTunnelEntry + entries []sshTunnelEntry + adding map[string]bool + tunnelCreator sshTunnelCreator + tunnelsLock sync.Mutex + + user string + keyfile string + healthCheckURL *url.URL } -func MakeSSHTunnels(user, keyfile string, addresses []string) *SSHTunnelList { - tunnels := []SSHTunnelEntry{} - for ix := range addresses { - addr := addresses[ix] - tunnel, err := NewSSHTunnel(user, keyfile, addr) - if err != nil { - glog.Errorf("Failed to create tunnel for %q: %v", addr, err) - continue - } - tunnels = append(tunnels, SSHTunnelEntry{addr, tunnel}) +func NewSSHTunnelList(user, keyfile string, healthCheckURL *url.URL, stopChan chan struct{}) *SSHTunnelList { + l := &SSHTunnelList{ + adding: make(map[string]bool), + tunnelCreator: &realTunnelCreator{}, + user: user, + keyfile: keyfile, + healthCheckURL: healthCheckURL, } - return &SSHTunnelList{tunnels} + healthCheckPoll := 1 * time.Minute + go wait.Until(func() { + l.tunnelsLock.Lock() + defer l.tunnelsLock.Unlock() + // Healthcheck each tunnel every minute + numTunnels := len(l.entries) + for i, entry := range l.entries { + // Stagger healthchecks evenly across duration of healthCheckPoll. + delay := healthCheckPoll * time.Duration(i) / time.Duration(numTunnels) + l.delayedHealthCheck(entry, delay) + } + }, healthCheckPoll, stopChan) + return l } -// Open attempts to open all tunnels in the list, and removes any tunnels that -// failed to open. -func (l *SSHTunnelList) Open() error { - var openTunnels []SSHTunnelEntry - for ix := range l.entries { - if err := l.entries[ix].Tunnel.Open(); err != nil { - glog.Errorf("Failed to open tunnel %v: %v", l.entries[ix], err) - } else { - openTunnels = append(openTunnels, l.entries[ix]) +func (l *SSHTunnelList) delayedHealthCheck(e sshTunnelEntry, delay time.Duration) { + go func() { + defer runtime.HandleCrash() + time.Sleep(delay) + if err := l.healthCheck(e); err != nil { + glog.Errorf("Healthcheck failed for tunnel to %q: %v", e.Address, err) + glog.Infof("Attempting once to re-establish tunnel to %q", e.Address) + l.removeAndReAdd(e) + } + }() +} + +func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error { + // GET the healthcheck path using the provided tunnel's dial function. + transport := utilnet.SetTransportDefaults(&http.Transport{ + Dial: e.Tunnel.Dial, + // TODO(cjcullen): Plumb real TLS options through. + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }) + client := &http.Client{Transport: transport} + _, err := client.Get(l.healthCheckURL.String()) + return err +} + +func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) { + // Find the entry to replace. + l.tunnelsLock.Lock() + defer l.tunnelsLock.Unlock() + for i, entry := range l.entries { + if entry.Tunnel == e.Tunnel { + l.entries = append(l.entries[:i], l.entries[i+1:]...) + l.adding[e.Address] = true + go l.createAndAddTunnel(e.Address) + return } } - l.entries = openTunnels +} + +func (l *SSHTunnelList) Dial(net, addr string) (net.Conn, error) { + start := time.Now() + id := mathrand.Int63() // So you can match begins/ends in the log. + glog.Infof("[%x: %v] Dialing...", id, addr) + defer func() { + glog.Infof("[%x: %v] Dialed in %v.", id, addr, time.Now().Sub(start)) + }() + tunnel, err := l.pickRandomTunnel() + if err != nil { + return nil, err + } + return tunnel.Dial(net, addr) +} + +func (l *SSHTunnelList) pickRandomTunnel() (tunnel, error) { + l.tunnelsLock.Lock() + defer l.tunnelsLock.Unlock() if len(l.entries) == 0 { - return errors.New("Failed to open any tunnels.") + return nil, fmt.Errorf("No SSH tunnels currently open. Were the targets able to accept an ssh-key for user %q?", l.user) } - return nil + n := mathrand.Intn(len(l.entries)) + return l.entries[n].Tunnel, nil } -// Close asynchronously closes all tunnels in the list after waiting for 1 -// minute. Tunnels will still be open upon this function's return, but should -// no longer be used. -func (l *SSHTunnelList) Close() { - for ix := range l.entries { - entry := l.entries[ix] - go func() { - defer runtime.HandleCrash() - time.Sleep(1 * time.Minute) - if err := entry.Tunnel.Close(); err != nil { - glog.Errorf("Failed to close tunnel %v: %v", entry, err) +// Update reconciles the list's entries with the specified addresses. Existing +// tunnels that are not in addresses are removed from entries and closed in a +// background goroutine. New tunnels specified in addresses are opened in a +// background goroutine and then added to entries. +func (l *SSHTunnelList) Update(addrs []string) { + haveAddrsMap := make(map[string]bool) + wantAddrsMap := make(map[string]bool) + func() { + l.tunnelsLock.Lock() + defer l.tunnelsLock.Unlock() + // Build a map of what we currently have. + for i := range l.entries { + haveAddrsMap[l.entries[i].Address] = true + } + // Determine any necessary additions. + for i := range addrs { + // Add tunnel if it is not in l.entries or l.adding + if _, ok := haveAddrsMap[addrs[i]]; !ok { + if _, ok := l.adding[addrs[i]]; !ok { + l.adding[addrs[i]] = true + addr := addrs[i] + go func() { + defer runtime.HandleCrash() + // Actually adding tunnel to list will block until lock + // is released after deletions. + l.createAndAddTunnel(addr) + }() + } } - }() - } -} - -/* this will make sense if we move the lock into SSHTunnelList. -func (l *SSHTunnelList) Dial(network, addr string) (net.Conn, error) { - if len(l.entries) == 0 { - return nil, fmt.Errorf("empty tunnel list.") - } - n := mathrand.Intn(len(l.entries)) - return l.entries[n].Tunnel.Dial(network, addr) -} -*/ - -// Returns a random tunnel, xor an error if there are none. -func (l *SSHTunnelList) PickRandomTunnel() (SSHTunnelEntry, error) { - if len(l.entries) == 0 { - return SSHTunnelEntry{}, fmt.Errorf("empty tunnel list.") - } - n := mathrand.Intn(len(l.entries)) - return l.entries[n], nil -} - -func (l *SSHTunnelList) Has(addr string) bool { - for ix := range l.entries { - if l.entries[ix].Address == addr { - return true + wantAddrsMap[addrs[i]] = true } - } - return false + // Determine any necessary deletions. + var newEntries []sshTunnelEntry + for i := range l.entries { + if _, ok := wantAddrsMap[l.entries[i].Address]; !ok { + tunnelEntry := l.entries[i] + glog.Infof("Removing tunnel to deleted node at %q", tunnelEntry.Address) + go func() { + defer runtime.HandleCrash() + if err := tunnelEntry.Tunnel.Close(); err != nil { + glog.Errorf("Failed to close tunnel to %q: %v", tunnelEntry.Address, err) + } + }() + } else { + newEntries = append(newEntries, l.entries[i]) + } + } + l.entries = newEntries + }() } -func (l *SSHTunnelList) Len() int { - return len(l.entries) +func (l *SSHTunnelList) createAndAddTunnel(addr string) { + glog.Infof("Trying to add tunnel to %q", addr) + tunnel, err := l.tunnelCreator.NewSSHTunnel(l.user, l.keyfile, addr) + if err != nil { + glog.Errorf("Failed to create tunnel for %q: %v", addr, err) + return + } + if err := tunnel.Open(); err != nil { + glog.Errorf("Failed to open tunnel to %q: %v", addr, err) + l.tunnelsLock.Lock() + delete(l.adding, addr) + l.tunnelsLock.Unlock() + return + } + l.tunnelsLock.Lock() + l.entries = append(l.entries, sshTunnelEntry{addr, tunnel}) + delete(l.adding, addr) + l.tunnelsLock.Unlock() + glog.Infof("Successfully added tunnel for %q", addr) } func EncodePrivateKey(private *rsa.PrivateKey) []byte { diff --git a/pkg/util/ssh_test.go b/pkg/ssh/ssh_test.go similarity index 72% rename from pkg/util/ssh_test.go rename to pkg/ssh/ssh_test.go index 74dc8a82b6d..bbc1641e9aa 100644 --- a/pkg/util/ssh_test.go +++ b/pkg/ssh/ssh_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package ssh import ( "fmt" @@ -24,6 +24,9 @@ import ( "reflect" "strings" "testing" + "time" + + "k8s.io/kubernetes/pkg/util/wait" "github.com/golang/glog" "golang.org/x/crypto/ssh" @@ -163,6 +166,88 @@ func TestSSHTunnel(t *testing.T) { } } +type fakeTunnel struct{} + +func (*fakeTunnel) Open() error { + return nil +} + +func (*fakeTunnel) Close() error { + return nil +} + +func (*fakeTunnel) Dial(network, address string) (net.Conn, error) { + return nil, nil +} + +type fakeTunnelCreator struct{} + +func (*fakeTunnelCreator) NewSSHTunnel(string, string, string) (tunnel, error) { + return &fakeTunnel{}, nil +} + +func TestSSHTunnelListUpdate(t *testing.T) { + // Start with an empty tunnel list. + l := &SSHTunnelList{ + adding: make(map[string]bool), + tunnelCreator: &fakeTunnelCreator{}, + } + + // Start with 2 tunnels. + addressStrings := []string{"1.2.3.4", "5.6.7.8"} + l.Update(addressStrings) + checkTunnelsCorrect(t, l, addressStrings) + + // Add another tunnel. + addressStrings = append(addressStrings, "9.10.11.12") + l.Update(addressStrings) + checkTunnelsCorrect(t, l, addressStrings) + + // Go down to a single tunnel. + addressStrings = []string{"1.2.3.4"} + l.Update(addressStrings) + checkTunnelsCorrect(t, l, addressStrings) + + // Replace w/ all new tunnels. + addressStrings = []string{"21.22.23.24", "25.26.27.28"} + l.Update(addressStrings) + checkTunnelsCorrect(t, l, addressStrings) + + // Call update with the same tunnels. + l.Update(addressStrings) + checkTunnelsCorrect(t, l, addressStrings) +} + +func checkTunnelsCorrect(t *testing.T, tunnelList *SSHTunnelList, addresses []string) { + if err := wait.Poll(100*time.Millisecond, 2*time.Second, func() (bool, error) { + return hasCorrectTunnels(tunnelList, addresses), nil + }); err != nil { + t.Errorf("Error waiting for tunnels to reach expected state: %v. Expected %v, had %v", err, addresses, tunnelList) + } +} + +func hasCorrectTunnels(tunnelList *SSHTunnelList, addresses []string) bool { + tunnelList.tunnelsLock.Lock() + defer tunnelList.tunnelsLock.Unlock() + wantMap := make(map[string]bool) + for _, addr := range addresses { + wantMap[addr] = true + } + haveMap := make(map[string]bool) + for _, entry := range tunnelList.entries { + if wantMap[entry.Address] == false { + return false + } + haveMap[entry.Address] = true + } + for _, addr := range addresses { + if haveMap[addr] == false { + return false + } + } + return true +} + type mockSSHDialer struct { network string addr string @@ -219,7 +304,7 @@ func TestSSHUser(t *testing.T) { for _, item := range table { dialer := &mockSSHDialer{} - _, _, _, err := runSSHCommand(dialer, item.command, item.user, item.host, item.signer) + _, _, _, err := runSSHCommand(dialer, item.command, item.user, item.host, item.signer, false) if err == nil { t.Errorf("expected error (as mock returns error); did not get one") } diff --git a/pkg/storage/cacher.go b/pkg/storage/cacher.go index 635a1b5dfa7..c5bcf2448c6 100644 --- a/pkg/storage/cacher.go +++ b/pkg/storage/cacher.go @@ -30,7 +30,7 @@ import ( "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" "github.com/golang/glog" @@ -156,7 +156,7 @@ func NewCacherFromConfig(config CacherConfig) *Cacher { keyFunc: config.KeyFunc, stopped: false, // We need to (potentially) stop both: - // - util.Until go-routine + // - 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. @@ -171,13 +171,14 @@ func NewCacherFromConfig(config CacherConfig) *Cacher { stopCh := cacher.stopCh cacher.stopWg.Add(1) go func() { - util.Until( + defer cacher.stopWg.Done() + wait.Until( func() { if !cacher.isStopped() { cacher.startCaching(stopCh) } - }, 0, stopCh) - cacher.stopWg.Done() + }, time.Second, stopCh, + ) }() return cacher } @@ -197,12 +198,10 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) { c.terminateAllWatchers() // Note that since onReplace may be not called due to errors, we explicitly // need to retry it on errors under lock. - for { - if err := c.reflector.ListAndWatch(stopChannel); err != nil { - glog.Errorf("unexpected ListAndWatch error: %v", err) - } else { - break - } + // Also note that startCaching is called in a loop, so there's no need + // to have another loop here. + if err := c.reflector.ListAndWatch(stopChannel); err != nil { + glog.Errorf("unexpected ListAndWatch error: %v", err) } } @@ -313,7 +312,10 @@ func (c *Cacher) List(ctx context.Context, key string, resourceVersion string, f } filterFunc := filterFunction(key, c.keyFunc, filter) - objs, readResourceVersion := c.watchCache.WaitUntilFreshAndList(listRV) + objs, readResourceVersion, err := c.watchCache.WaitUntilFreshAndList(listRV) + if err != nil { + return fmt.Errorf("failed to wait for fresh list: %v", err) + } for _, obj := range objs { object, ok := obj.(runtime.Object) if !ok { diff --git a/pkg/storage/cacher_test.go b/pkg/storage/cacher_test.go index 24b3e4df015..dd829739c91 100644 --- a/pkg/storage/cacher_test.go +++ b/pkg/storage/cacher_test.go @@ -33,8 +33,8 @@ import ( etcdstorage "k8s.io/kubernetes/pkg/storage/etcd" "k8s.io/kubernetes/pkg/storage/etcd/etcdtest" etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" "golang.org/x/net/context" @@ -158,7 +158,7 @@ func verifyWatchEvent(t *testing.T, w watch.Interface, eventType watch.EventType if e, a := eventObject, event.Object; !api.Semantic.DeepDerivative(e, a) { t.Errorf("Expected (%s): %#v, got: %#v", eventType, e, a) } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Errorf("Timed out waiting for an event") } } diff --git a/pkg/storage/etcd/metrics/metrics.go b/pkg/storage/etcd/metrics/metrics.go index 00bd35fc8c6..7e88e43c2e6 100644 --- a/pkg/storage/etcd/metrics/metrics.go +++ b/pkg/storage/etcd/metrics/metrics.go @@ -102,3 +102,12 @@ func ObserveCacheMiss() { func ObserveNewEntry() { cacheEntryCounter.Inc() } + +func Reset() { + cacheHitCounter.Set(0) + cacheMissCounter.Set(0) + cacheEntryCounter.Set(0) + // TODO: Reset cacheAddLatency. + // TODO: Reset cacheGetLatency. + etcdRequestLatenciesSummary.Reset() +} diff --git a/pkg/storage/testing/types.generated.go b/pkg/storage/testing/types.generated.go index a35912adb45..46e18b8d360 100644 --- a/pkg/storage/testing/types.generated.go +++ b/pkg/storage/testing/types.generated.go @@ -88,8 +88,8 @@ func (x *TestResource) CodecEncodeSelf(e *codec1978.Encoder) { var yyq2 [4]bool _, _, _ = yysep2, yyq2, yy2arr2 const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" + yyq2[2] = x.Kind != "" + yyq2[3] = x.APIVersion != "" var yynn2 int if yyr2 || yy2arr2 { r.EncodeArrayStart(4) @@ -105,69 +105,19 @@ func (x *TestResource) CodecEncodeSelf(e *codec1978.Encoder) { } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy10 := &x.ObjectMeta - yy10.CodecEncodeSelf(e) + yy4 := &x.ObjectMeta + yy4.CodecEncodeSelf(e) } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.ObjectMeta - yy11.CodecEncodeSelf(e) + yy5 := &x.ObjectMeta + yy5.CodecEncodeSelf(e) } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym13 := z.EncBinary() - _ = yym13 + yym7 := z.EncBinary() + _ = yym7 if false { } else { r.EncodeInt(int64(x.Value)) @@ -176,13 +126,63 @@ func (x *TestResource) CodecEncodeSelf(e *codec1978.Encoder) { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("value")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 + yym8 := z.EncBinary() + _ = yym8 if false { } else { r.EncodeInt(int64(x.Value)) } } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[2] { + yym10 := z.EncBinary() + _ = yym10 + 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) + yym11 := z.EncBinary() + _ = yym11 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr2 || yy2arr2 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq2[3] { + yym13 := z.EncBinary() + _ = yym13 + 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) + yym14 := z.EncBinary() + _ = yym14 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } if yyr2 || yy2arr2 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -244,6 +244,19 @@ func (x *TestResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { yys17 := string(yys17Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) switch yys17 { + case "metadata": + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv18 := &x.ObjectMeta + yyv18.CodecDecodeSelf(d) + } + case "value": + if r.TryDecodeAsNil() { + x.Value = 0 + } else { + x.Value = int(r.DecodeInt(codecSelferBitsize1234)) + } case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -256,19 +269,6 @@ func (x *TestResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv20 := &x.ObjectMeta - yyv20.CodecDecodeSelf(d) - } - case "value": - if r.TryDecodeAsNil() { - x.Value = 0 - } else { - x.Value = int(r.DecodeInt(codecSelferBitsize1234)) - } default: z.DecStructFieldNotFound(-1, yys17) } // end switch yys17 @@ -294,6 +294,39 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.ObjectMeta = pkg2_api.ObjectMeta{} + } else { + yyv23 := &x.ObjectMeta + yyv23.CodecDecodeSelf(d) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.Value = 0 + } else { + x.Value = int(r.DecodeInt(codecSelferBitsize1234)) + } + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = r.CheckBreak() + } + if yyb22 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { x.Kind = "" } else { @@ -315,39 +348,6 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_api.ObjectMeta{} - } else { - yyv25 := &x.ObjectMeta - yyv25.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Value = 0 - } else { - x.Value = int(r.DecodeInt(codecSelferBitsize1234)) - } for { yyj22++ if yyhl22 { diff --git a/pkg/storage/watch_cache.go b/pkg/storage/watch_cache.go index 24d7ed2d1bb..2e842a28e1e 100644 --- a/pkg/storage/watch_cache.go +++ b/pkg/storage/watch_cache.go @@ -21,14 +21,22 @@ import ( "sort" "strconv" "sync" + "time" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/runtime" + "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/watch" ) +const ( + // MaximumListWait determines how long we're willing to wait for a + // list if a client specified a resource version in the future. + MaximumListWait = 60 * time.Second +) + // watchCacheEvent is a single "watch event" that is send to users of // watchCache. Additionally to a typical "watch.Event" it contains // the previous value of the object to enable proper filtering in the @@ -85,6 +93,9 @@ type watchCache struct { // This handler is run at the end of every Add/Update/Delete method // and additionally gets the previous value of the object. onEvent func(watchCacheEvent) + + // for testing timeouts. + clock util.Clock } func newWatchCache(capacity int) *watchCache { @@ -95,6 +106,7 @@ func newWatchCache(capacity int) *watchCache { endIndex: 0, store: cache.NewStore(cache.MetaNamespaceKeyFunc), resourceVersion: 0, + clock: util.RealClock{}, } wc.cond = sync.NewCond(wc.RLocker()) return wc @@ -193,13 +205,29 @@ func (w *watchCache) List() []interface{} { return w.store.List() } -func (w *watchCache) WaitUntilFreshAndList(resourceVersion uint64) ([]interface{}, uint64) { +func (w *watchCache) WaitUntilFreshAndList(resourceVersion uint64) ([]interface{}, uint64, error) { + startTime := w.clock.Now() + go func() { + // Wake us up when the time limit has expired. The docs + // promise that time.After (well, NewTimer, which it calls) + // will wait *at least* the duration given. Since this go + // routine starts sometime after we record the start time, and + // it will wake up the loop below sometime after the broadcast, + // we don't need to worry about waking it up before the time + // has expired accidentally. + <-w.clock.After(MaximumListWait) + w.cond.Broadcast() + }() + w.RLock() + defer w.RUnlock() for w.resourceVersion < resourceVersion { + if w.clock.Since(startTime) >= MaximumListWait { + return nil, 0, fmt.Errorf("time limit exceeded while waiting for resource version %v (current value: %v)", resourceVersion, w.resourceVersion) + } w.cond.Wait() } - defer w.RUnlock() - return w.store.List(), w.resourceVersion + return w.store.List(), w.resourceVersion, nil } func (w *watchCache) ListKeys() []string { diff --git a/pkg/storage/watch_cache_test.go b/pkg/storage/watch_cache_test.go index a96fd1a1ce9..e2268fe956d 100644 --- a/pkg/storage/watch_cache_test.go +++ b/pkg/storage/watch_cache_test.go @@ -19,6 +19,7 @@ package storage import ( "strconv" "testing" + "time" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" @@ -27,6 +28,7 @@ import ( "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -40,8 +42,15 @@ func makeTestPod(name string, resourceVersion uint64) *api.Pod { } } +// newTestWatchCache just adds a fake clock. +func newTestWatchCache(capacity int) *watchCache { + wc := newWatchCache(capacity) + wc.clock = util.NewFakeClock(time.Now()) + return wc +} + func TestWatchCacheBasic(t *testing.T) { - store := newWatchCache(2) + store := newTestWatchCache(2) // Test Add/Update/Delete. pod1 := makeTestPod("pod", 1) @@ -111,7 +120,7 @@ func TestWatchCacheBasic(t *testing.T) { } func TestEvents(t *testing.T) { - store := newWatchCache(5) + store := newTestWatchCache(5) store.Add(makeTestPod("pod", 2)) @@ -231,7 +240,7 @@ func TestEvents(t *testing.T) { } func TestWaitUntilFreshAndList(t *testing.T) { - store := newWatchCache(3) + store := newTestWatchCache(3) // In background, update the store. go func() { @@ -239,7 +248,10 @@ func TestWaitUntilFreshAndList(t *testing.T) { store.Add(makeTestPod("bar", 5)) }() - list, resourceVersion := store.WaitUntilFreshAndList(4) + list, resourceVersion, err := store.WaitUntilFreshAndList(5) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } if resourceVersion != 5 { t.Errorf("unexpected resourceVersion: %v, expected: 5", resourceVersion) } @@ -248,6 +260,30 @@ func TestWaitUntilFreshAndList(t *testing.T) { } } +func TestWaitUntilFreshAndListTimeout(t *testing.T) { + store := newTestWatchCache(3) + fc := store.clock.(*util.FakeClock) + + // In background, step clock after the below call starts the timer. + go func() { + for !fc.HasWaiters() { + time.Sleep(time.Millisecond) + } + fc.Step(MaximumListWait) + + // Add an object to make sure the test would + // eventually fail instead of just waiting + // forever. + time.Sleep(30 * time.Second) + store.Add(makeTestPod("bar", 5)) + }() + + _, _, err := store.WaitUntilFreshAndList(5) + if err == nil { + t.Fatalf("unexpected lack of timeout error") + } +} + type testLW struct { ListFunc func(options api.ListOptions) (runtime.Object, error) WatchFunc func(options api.ListOptions) (watch.Interface, error) @@ -261,10 +297,13 @@ func (t *testLW) Watch(options api.ListOptions) (watch.Interface, error) { } func TestReflectorForWatchCache(t *testing.T) { - store := newWatchCache(5) + store := newTestWatchCache(5) { - _, version := store.WaitUntilFreshAndList(0) + _, version, err := store.WaitUntilFreshAndList(0) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } if version != 0 { t.Errorf("unexpected resource version: %d", version) } @@ -281,10 +320,13 @@ func TestReflectorForWatchCache(t *testing.T) { }, } r := cache.NewReflector(lw, &api.Pod{}, store, 0) - r.ListAndWatch(util.NeverStop) + r.ListAndWatch(wait.NeverStop) { - _, version := store.WaitUntilFreshAndList(10) + _, version, err := store.WaitUntilFreshAndList(10) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } if version != 10 { t.Errorf("unexpected resource version: %d", version) } diff --git a/pkg/ui/installsupport.go b/pkg/ui/installsupport.go index d1c02dcb58c..15d1bb30a6f 100644 --- a/pkg/ui/installsupport.go +++ b/pkg/ui/installsupport.go @@ -25,7 +25,7 @@ import ( assetfs "github.com/elazarl/go-bindata-assetfs" ) -const dashboardPath = "/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/" +const dashboardPath = "/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard" type MuxInterface interface { Handle(pattern string, handler http.Handler) diff --git a/pkg/util/atomic/value_test.go b/pkg/util/atomic/value_test.go index 0cb839dd5e5..052b350828b 100644 --- a/pkg/util/atomic/value_test.go +++ b/pkg/util/atomic/value_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) func ExpectValue(t *testing.T, atomicValue *Value, expectedValue interface{}) { @@ -38,7 +38,7 @@ func ExpectValue(t *testing.T, atomicValue *Value, expectedValue interface{}) { t.Errorf("Expected to find %v, found %v", expectedValue, actualValue) return } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Error("Value could not be read") return } diff --git a/pkg/util/backoff_test.go b/pkg/util/backoff_test.go index 9035c565f45..d5b744cb3f7 100644 --- a/pkg/util/backoff_test.go +++ b/pkg/util/backoff_test.go @@ -32,7 +32,7 @@ func NewFakeBackOff(initial, max time.Duration, tc *FakeClock) *Backoff { func TestSlowBackoff(t *testing.T) { id := "_idSlow" - tc := &FakeClock{Time: time.Now()} + tc := NewFakeClock(time.Now()) step := time.Second maxDuration := 50 * step @@ -58,7 +58,7 @@ func TestSlowBackoff(t *testing.T) { func TestBackoffReset(t *testing.T) { id := "_idReset" - tc := &FakeClock{Time: time.Now()} + tc := NewFakeClock(time.Now()) step := time.Second maxDuration := step * 5 b := NewFakeBackOff(step, maxDuration, tc) @@ -84,7 +84,7 @@ func TestBackoffReset(t *testing.T) { func TestBackoffHightWaterMark(t *testing.T) { id := "_idHiWaterMark" - tc := &FakeClock{Time: time.Now()} + tc := NewFakeClock(time.Now()) step := time.Second maxDuration := 5 * step b := NewFakeBackOff(step, maxDuration, tc) @@ -106,7 +106,7 @@ func TestBackoffHightWaterMark(t *testing.T) { func TestBackoffGC(t *testing.T) { id := "_idGC" - tc := &FakeClock{Time: time.Now()} + tc := NewFakeClock(time.Now()) step := time.Second maxDuration := 5 * step @@ -134,7 +134,7 @@ func TestBackoffGC(t *testing.T) { func TestIsInBackOffSinceUpdate(t *testing.T) { id := "_idIsInBackOffSinceUpdate" - tc := &FakeClock{Time: time.Now()} + tc := NewFakeClock(time.Now()) step := time.Second maxDuration := 10 * step b := NewFakeBackOff(step, maxDuration, tc) @@ -186,7 +186,7 @@ func TestIsInBackOffSinceUpdate(t *testing.T) { } for _, c := range cases { - tc.Time = startTime.Add(c.tick * step) + tc.SetTime(startTime.Add(c.tick * step)) if c.inBackOff != b.IsInBackOffSinceUpdate(id, tc.Now()) { t.Errorf("expected IsInBackOffSinceUpdate %v got %v at tick %s", c.inBackOff, b.IsInBackOffSinceUpdate(id, tc.Now()), c.tick*step) } diff --git a/pkg/util/clock.go b/pkg/util/clock.go index 4d27baa3735..56ea16c6916 100644 --- a/pkg/util/clock.go +++ b/pkg/util/clock.go @@ -17,6 +17,7 @@ limitations under the License. package util import ( + "sync" "time" ) @@ -25,39 +26,115 @@ import ( type Clock interface { Now() time.Time Since(time.Time) time.Duration + After(d time.Duration) <-chan time.Time } +var ( + _ = Clock(RealClock{}) + _ = Clock(&FakeClock{}) + _ = Clock(&IntervalClock{}) +) + // RealClock really calls time.Now() type RealClock struct{} // Now returns the current time. -func (r RealClock) Now() time.Time { +func (RealClock) Now() time.Time { return time.Now() } // Since returns time since the specified timestamp. -func (r RealClock) Since(ts time.Time) time.Duration { +func (RealClock) Since(ts time.Time) time.Duration { return time.Since(ts) } +// Same as time.After(d). +func (RealClock) After(d time.Duration) <-chan time.Time { + return time.After(d) +} + // FakeClock implements Clock, but returns an arbitrary time. type FakeClock struct { - Time time.Time + lock sync.RWMutex + time time.Time + + // waiters are waiting for the fake time to pass their specified time + waiters []fakeClockWaiter +} + +type fakeClockWaiter struct { + targetTime time.Time + destChan chan<- time.Time +} + +func NewFakeClock(t time.Time) *FakeClock { + return &FakeClock{ + time: t, + } } // Now returns f's time. func (f *FakeClock) Now() time.Time { - return f.Time + f.lock.RLock() + defer f.lock.RUnlock() + return f.time } // Since returns time since the time in f. func (f *FakeClock) Since(ts time.Time) time.Duration { - return f.Time.Sub(ts) + f.lock.RLock() + defer f.lock.RUnlock() + return f.time.Sub(ts) } -// Move clock by Duration +// Fake version of time.After(d). +func (f *FakeClock) After(d time.Duration) <-chan time.Time { + f.lock.Lock() + defer f.lock.Unlock() + stopTime := f.time.Add(d) + ch := make(chan time.Time, 1) // Don't block! + f.waiters = append(f.waiters, fakeClockWaiter{ + targetTime: stopTime, + destChan: ch, + }) + return ch +} + +// Move clock by Duration, notify anyone that's called After func (f *FakeClock) Step(d time.Duration) { - f.Time = f.Time.Add(d) + f.lock.Lock() + defer f.lock.Unlock() + f.setTimeLocked(f.time.Add(d)) +} + +// Sets the time. +func (f *FakeClock) SetTime(t time.Time) { + f.lock.Lock() + defer f.lock.Unlock() + f.setTimeLocked(t) +} + +// Actually changes the time and checks any waiters. f must be write-locked. +func (f *FakeClock) setTimeLocked(t time.Time) { + f.time = t + newWaiters := make([]fakeClockWaiter, 0, len(f.waiters)) + for i := range f.waiters { + w := &f.waiters[i] + if !w.targetTime.After(t) { + w.destChan <- t + } else { + newWaiters = append(newWaiters, f.waiters[i]) + } + } + f.waiters = newWaiters +} + +// Returns true if After has been called on f but not yet satisfied (so you can +// write race-free tests). +func (f *FakeClock) HasWaiters() bool { + f.lock.RLock() + defer f.lock.RUnlock() + return len(f.waiters) > 0 } // IntervalClock implements Clock, but each invocation of Now steps the clock forward the specified duration @@ -76,3 +153,9 @@ func (i *IntervalClock) Now() time.Time { func (i *IntervalClock) Since(ts time.Time) time.Duration { return i.Time.Sub(ts) } + +// Unimplemented, will panic. +// TODO: make interval clock use FakeClock so this can be implemented. +func (*IntervalClock) After(d time.Duration) <-chan time.Time { + panic("IntervalClock doesn't implement After") +} diff --git a/pkg/util/clock_test.go b/pkg/util/clock_test.go index d3523ffda15..db0cce40a11 100644 --- a/pkg/util/clock_test.go +++ b/pkg/util/clock_test.go @@ -23,7 +23,7 @@ import ( func TestFakeClock(t *testing.T) { startTime := time.Now() - tc := &FakeClock{Time: startTime} + tc := NewFakeClock(startTime) tc.Step(time.Second) now := tc.Now() if now.Sub(startTime) != time.Second { @@ -31,8 +31,66 @@ func TestFakeClock(t *testing.T) { } tt := tc.Now() - tc.Time = tt.Add(time.Hour) + tc.SetTime(tt.Add(time.Hour)) if tc.Now().Sub(tt) != time.Hour { t.Errorf("input: %s now=%s gap=%s expected=%s", tt, tc.Now(), tc.Now().Sub(tt), time.Hour) } } + +func TestFakeAfter(t *testing.T) { + tc := NewFakeClock(time.Now()) + if tc.HasWaiters() { + t.Errorf("unexpected waiter?") + } + oneSec := tc.After(time.Second) + if !tc.HasWaiters() { + t.Errorf("unexpected lack of waiter?") + } + + oneOhOneSec := tc.After(time.Second + time.Millisecond) + twoSec := tc.After(2 * time.Second) + select { + case <-oneSec: + t.Errorf("unexpected channel read") + case <-oneOhOneSec: + t.Errorf("unexpected channel read") + case <-twoSec: + t.Errorf("unexpected channel read") + default: + } + + tc.Step(999 * time.Millisecond) + select { + case <-oneSec: + t.Errorf("unexpected channel read") + case <-oneOhOneSec: + t.Errorf("unexpected channel read") + case <-twoSec: + t.Errorf("unexpected channel read") + default: + } + + tc.Step(time.Millisecond) + select { + case <-oneSec: + // Expected! + case <-oneOhOneSec: + t.Errorf("unexpected channel read") + case <-twoSec: + t.Errorf("unexpected channel read") + default: + t.Errorf("unexpected non-channel read") + } + tc.Step(time.Millisecond) + select { + case <-oneSec: + // should not double-trigger! + t.Errorf("unexpected channel read") + case <-oneOhOneSec: + // Expected! + case <-twoSec: + t.Errorf("unexpected channel read") + default: + t.Errorf("unexpected non-channel read") + } +} diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 7bb49b3836f..37f6f6ab186 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -19,7 +19,7 @@ package config import ( "sync" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) type Merger interface { @@ -74,7 +74,7 @@ func (m *Mux) Channel(source string) chan interface{} { } newChannel := make(chan interface{}) m.sources[source] = newChannel - go util.Until(func() { m.listen(source, newChannel) }, 0, util.NeverStop) + go wait.Until(func() { m.listen(source, newChannel) }, 0, wait.NeverStop) return newChannel } diff --git a/pkg/util/deployment/deployment.go b/pkg/util/deployment/deployment.go index cc7b874772f..27ef7aabe37 100644 --- a/pkg/util/deployment/deployment.go +++ b/pkg/util/deployment/deployment.go @@ -22,144 +22,162 @@ import ( "time" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/labels" labelsutil "k8s.io/kubernetes/pkg/util/labels" podutil "k8s.io/kubernetes/pkg/util/pod" ) const ( - // The revision annotation of a deployment's replication controllers which records its rollout sequence + // The revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" + + // Here are the possible rollback event reasons + RollbackRevisionNotFound = "DeploymentRollbackRevisionNotFound" + RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged" + RollbackDone = "DeploymentRollback" ) -// GetOldRCs returns the old RCs targeted by the given Deployment; get PodList and RCList from client interface. -// Note that the first set of old RCs doesn't include the ones with no pods, and the second set of old RCs include all old RCs. -func GetOldRCs(deployment extensions.Deployment, c clientset.Interface) ([]*api.ReplicationController, []*api.ReplicationController, error) { - return GetOldRCsFromLists(deployment, c, +// GetOldReplicaSets returns the old replica sets targeted by the given Deployment; get 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. +func GetOldReplicaSets(deployment extensions.Deployment, c clientset.Interface) ([]*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { + return GetOldReplicaSetsFromLists(deployment, c, func(namespace string, options api.ListOptions) (*api.PodList, error) { - return c.Legacy().Pods(namespace).List(options) + return c.Core().Pods(namespace).List(options) }, - func(namespace string, options api.ListOptions) ([]api.ReplicationController, error) { - rcList, err := c.Legacy().ReplicationControllers(namespace).List(options) - return rcList.Items, err + func(namespace string, options api.ListOptions) ([]extensions.ReplicaSet, error) { + rsList, err := c.Extensions().ReplicaSets(namespace).List(options) + return rsList.Items, err }) } -// GetOldRCsFromLists returns two sets of old RCs targeted by the given Deployment; get PodList and RCList with input functions. -// Note that the first set of old RCs doesn't include the ones with no pods, and the second set of old RCs include all old RCs. -func GetOldRCsFromLists(deployment extensions.Deployment, c clientset.Interface, getPodList func(string, api.ListOptions) (*api.PodList, error), getRcList func(string, api.ListOptions) ([]api.ReplicationController, error)) ([]*api.ReplicationController, []*api.ReplicationController, error) { +// GetOldReplicaSetsFromLists returns two sets of old replica sets targeted by the given Deployment; get PodList and ReplicaSetList with input functions. +// 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. +func GetOldReplicaSetsFromLists(deployment extensions.Deployment, c clientset.Interface, getPodList func(string, api.ListOptions) (*api.PodList, error), getRSList func(string, api.ListOptions) ([]extensions.ReplicaSet, error)) ([]*extensions.ReplicaSet, []*extensions.ReplicaSet, error) { namespace := deployment.ObjectMeta.Namespace + selector, err := unversioned.LabelSelectorAsSelector(deployment.Spec.Selector) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert LabelSelector to Selector: %v", err) + } + // 1. Find all pods whose labels match deployment.Spec.Selector - selector := labels.SelectorFromSet(deployment.Spec.Selector) options := api.ListOptions{LabelSelector: selector} podList, err := getPodList(namespace, options) if err != nil { return nil, nil, fmt.Errorf("error listing pods: %v", err) } - // 2. Find the corresponding RCs for pods in podList. - // TODO: Right now we list all RCs and then filter. We should add an API for this. - oldRCs := map[string]api.ReplicationController{} - allOldRCs := map[string]api.ReplicationController{} - rcList, err := getRcList(namespace, options) + // 2. Find the corresponding replica sets for pods in podList. + // TODO: Right now we list all replica sets and then filter. We should add an API for this. + oldRSs := map[string]extensions.ReplicaSet{} + allOldRSs := map[string]extensions.ReplicaSet{} + rsList, err := getRSList(namespace, options) if err != nil { - return nil, nil, fmt.Errorf("error listing replication controllers: %v", err) + return nil, nil, fmt.Errorf("error listing replica sets: %v", err) } - newRCTemplate := GetNewRCTemplate(deployment) + newRSTemplate := GetNewReplicaSetTemplate(deployment) for _, pod := range podList.Items { podLabelsSelector := labels.Set(pod.ObjectMeta.Labels) - for _, rc := range rcList { - rcLabelsSelector := labels.SelectorFromSet(rc.Spec.Selector) - // Filter out RC that has the same pod template spec as the deployment - that is the new RC. - if api.Semantic.DeepEqual(rc.Spec.Template, &newRCTemplate) { + for _, rs := range rsList { + rsLabelsSelector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert LabelSelector to Selector: %v", err) + } + // Filter out replica set that has the same pod template spec as the deployment - that is the new replica set. + if api.Semantic.DeepEqual(rs.Spec.Template, &newRSTemplate) { continue } - allOldRCs[rc.ObjectMeta.Name] = rc - if rcLabelsSelector.Matches(podLabelsSelector) { - oldRCs[rc.ObjectMeta.Name] = rc + allOldRSs[rs.ObjectMeta.Name] = rs + if rsLabelsSelector.Matches(podLabelsSelector) { + oldRSs[rs.ObjectMeta.Name] = rs } } } - requiredRCs := []*api.ReplicationController{} - for key := range oldRCs { - value := oldRCs[key] - requiredRCs = append(requiredRCs, &value) + requiredRSs := []*extensions.ReplicaSet{} + for key := range oldRSs { + value := oldRSs[key] + requiredRSs = append(requiredRSs, &value) } - allRCs := []*api.ReplicationController{} - for key := range allOldRCs { - value := allOldRCs[key] - allRCs = append(allRCs, &value) + allRSs := []*extensions.ReplicaSet{} + for key := range allOldRSs { + value := allOldRSs[key] + allRSs = append(allRSs, &value) } - return requiredRCs, allRCs, nil + return requiredRSs, allRSs, nil } -// GetNewRC returns an RC that matches the intent of the given deployment; get RCList from client interface. -// Returns nil if the new RC doesnt exist yet. -func GetNewRC(deployment extensions.Deployment, c clientset.Interface) (*api.ReplicationController, error) { - return GetNewRCFromList(deployment, c, - func(namespace string, options api.ListOptions) ([]api.ReplicationController, error) { - rcList, err := c.Legacy().ReplicationControllers(namespace).List(options) - return rcList.Items, err +// GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface. +// Returns nil if the new replica set doesnt exist yet. +func GetNewReplicaSet(deployment extensions.Deployment, c clientset.Interface) (*extensions.ReplicaSet, error) { + return GetNewReplicaSetFromList(deployment, c, + func(namespace string, options api.ListOptions) ([]extensions.ReplicaSet, error) { + rsList, err := c.Extensions().ReplicaSets(namespace).List(options) + return rsList.Items, err }) } -// GetNewRCFromList returns an RC that matches the intent of the given deployment; get RCList with the input function. -// Returns nil if the new RC doesnt exist yet. -func GetNewRCFromList(deployment extensions.Deployment, c clientset.Interface, getRcList func(string, api.ListOptions) ([]api.ReplicationController, error)) (*api.ReplicationController, error) { +// GetNewReplicaSetFromList returns a replica set that matches the intent of the given deployment; get ReplicaSetList with the input function. +// Returns nil if the new replica set doesnt exist yet. +func GetNewReplicaSetFromList(deployment extensions.Deployment, c clientset.Interface, getRSList func(string, api.ListOptions) ([]extensions.ReplicaSet, error)) (*extensions.ReplicaSet, error) { namespace := deployment.ObjectMeta.Namespace - rcList, err := getRcList(namespace, api.ListOptions{LabelSelector: labels.SelectorFromSet(deployment.Spec.Selector)}) + selector, err := unversioned.LabelSelectorAsSelector(deployment.Spec.Selector) if err != nil { - return nil, fmt.Errorf("error listing replication controllers: %v", err) + return nil, fmt.Errorf("failed to convert LabelSelector to Selector: %v", err) } - newRCTemplate := GetNewRCTemplate(deployment) - for i := range rcList { - if api.Semantic.DeepEqual(rcList[i].Spec.Template, &newRCTemplate) { - // This is the new RC. - return &rcList[i], nil + rsList, err := getRSList(namespace, api.ListOptions{LabelSelector: selector}) + if err != nil { + return nil, fmt.Errorf("error listing ReplicaSets: %v", err) + } + newRSTemplate := GetNewReplicaSetTemplate(deployment) + + for i := range rsList { + if api.Semantic.DeepEqual(rsList[i].Spec.Template, &newRSTemplate) { + // This is the new ReplicaSet. + return &rsList[i], nil } } - // new RC does not exist. + // new ReplicaSet does not exist. return nil, nil } -// Returns the desired PodTemplateSpec for the new RC corresponding to the given RC. -func GetNewRCTemplate(deployment extensions.Deployment) api.PodTemplateSpec { - // newRC will have the same template as in deployment spec, plus a unique label in some cases. - newRCTemplate := api.PodTemplateSpec{ +// 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{ ObjectMeta: deployment.Spec.Template.ObjectMeta, Spec: deployment.Spec.Template.Spec, } - newRCTemplate.ObjectMeta.Labels = labelsutil.CloneAndAddLabel( + newRSTemplate.ObjectMeta.Labels = labelsutil.CloneAndAddLabel( deployment.Spec.Template.ObjectMeta.Labels, - deployment.Spec.UniqueLabelKey, - podutil.GetPodTemplateSpecHash(newRCTemplate)) - return newRCTemplate + extensions.DefaultDeploymentUniqueLabelKey, + podutil.GetPodTemplateSpecHash(newRSTemplate)) + return newRSTemplate } -// SetTemplate sets the desired PodTemplateSpec from an RC template to the given deployment. -func SetFromRCTemplate(deployment *extensions.Deployment, template api.PodTemplateSpec) *extensions.Deployment { +// SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment. +func SetFromReplicaSetTemplate(deployment *extensions.Deployment, template api.PodTemplateSpec) *extensions.Deployment { deployment.Spec.Template.ObjectMeta = template.ObjectMeta deployment.Spec.Template.Spec = template.Spec deployment.Spec.Template.ObjectMeta.Labels = labelsutil.CloneAndRemoveLabel( deployment.Spec.Template.ObjectMeta.Labels, - deployment.Spec.UniqueLabelKey) + extensions.DefaultDeploymentUniqueLabelKey) return deployment } -// Returns the sum of Replicas of the given replication controllers. -func GetReplicaCountForRCs(replicationControllers []*api.ReplicationController) int { +// Returns the sum of Replicas of the given replica sets. +func GetReplicaCountForReplicaSets(replicaSets []*extensions.ReplicaSet) int { totalReplicaCount := 0 - for _, rc := range replicationControllers { - totalReplicaCount += rc.Spec.Replicas + for _, rs := range replicaSets { + totalReplicaCount += rs.Spec.Replicas } return totalReplicaCount } -// Returns the number of available pods corresponding to the given RCs. -func GetAvailablePodsForRCs(c clientset.Interface, rcs []*api.ReplicationController, minReadySeconds int) (int, error) { - allPods, err := getPodsForRCs(c, rcs) +// Returns the number of available pods corresponding to the given replica sets. +func GetAvailablePodsForReplicaSets(c clientset.Interface, rss []*extensions.ReplicaSet, minReadySeconds int) (int, error) { + allPods, err := getPodsForReplicaSets(c, rss) if err != nil { return 0, err } @@ -190,12 +208,15 @@ func getReadyPodsCount(pods []api.Pod, minReadySeconds int) int { return readyPodCount } -func getPodsForRCs(c clientset.Interface, replicationControllers []*api.ReplicationController) ([]api.Pod, error) { +func getPodsForReplicaSets(c clientset.Interface, replicaSets []*extensions.ReplicaSet) ([]api.Pod, error) { allPods := []api.Pod{} - for _, rc := range replicationControllers { - selector := labels.SelectorFromSet(rc.Spec.Selector) + for _, rs := range replicaSets { + selector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) + if err != nil { + return nil, fmt.Errorf("failed to convert LabelSelector to Selector: %v", err) + } options := api.ListOptions{LabelSelector: selector} - podList, err := c.Legacy().Pods(rc.ObjectMeta.Namespace).List(options) + podList, err := c.Core().Pods(rs.ObjectMeta.Namespace).List(options) if err != nil { return allPods, fmt.Errorf("error listing pods: %v", err) } @@ -204,9 +225,9 @@ func getPodsForRCs(c clientset.Interface, replicationControllers []*api.Replicat return allPods, nil } -// Revision returns the revision number of the input RC -func Revision(rc *api.ReplicationController) (int64, error) { - v, ok := rc.Annotations[RevisionAnnotation] +// Revision returns the revision number of the input replica set +func Revision(rs *extensions.ReplicaSet) (int64, error) { + v, ok := rs.Annotations[RevisionAnnotation] if !ok { return 0, nil } diff --git a/pkg/util/deployment/deployment_test.go b/pkg/util/deployment/deployment_test.go index 4f401cbe055..8d7317e4158 100644 --- a/pkg/util/deployment/deployment_test.go +++ b/pkg/util/deployment/deployment_test.go @@ -82,13 +82,13 @@ func TestGetReadyPodsCount(t *testing.T) { } } -// generatePodFromRC creates a pod, with the input rc's selector and its template -func generatePodFromRC(rc api.ReplicationController) api.Pod { +// generatePodFromRS creates a pod, with the input ReplicaSet's selector and its template +func generatePodFromRS(rs extensions.ReplicaSet) api.Pod { return api.Pod{ ObjectMeta: api.ObjectMeta{ - Labels: rc.Spec.Selector, + Labels: rs.Labels, }, - Spec: rc.Spec.Template.Spec, + Spec: rs.Spec.Template.Spec, } } @@ -110,15 +110,15 @@ func generatePod(labels map[string]string, image string) api.Pod { } } -func generateRCWithLabel(labels map[string]string, image string) api.ReplicationController { - return api.ReplicationController{ +func generateRSWithLabel(labels map[string]string, image string) extensions.ReplicaSet { + return extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{ - Name: api.SimpleNameGenerator.GenerateName("rc"), + Name: api.SimpleNameGenerator.GenerateName("replicaset"), Labels: labels, }, - Spec: api.ReplicationControllerSpec{ + Spec: extensions.ReplicaSetSpec{ Replicas: 1, - Selector: labels, + Selector: &unversioned.LabelSelector{MatchLabels: labels}, Template: &api.PodTemplateSpec{ Spec: api.PodSpec{ Containers: []api.Container{ @@ -135,17 +135,17 @@ func generateRCWithLabel(labels map[string]string, image string) api.Replication } } -// generateRC creates a replication controller, with the input deployment's template as its template -func generateRC(deployment extensions.Deployment) api.ReplicationController { - template := GetNewRCTemplate(deployment) - return api.ReplicationController{ +// generateRS creates a replica set, with the input deployment's template as its template +func generateRS(deployment extensions.Deployment) extensions.ReplicaSet { + template := GetNewReplicaSetTemplate(deployment) + return extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{ - Name: api.SimpleNameGenerator.GenerateName("rc"), + Name: api.SimpleNameGenerator.GenerateName("replicaset"), Labels: template.Labels, }, - Spec: api.ReplicationControllerSpec{ + Spec: extensions.ReplicaSetSpec{ Template: &template, - Selector: template.Labels, + Selector: &unversioned.LabelSelector{MatchLabels: template.Labels}, }, } } @@ -159,9 +159,8 @@ func generateDeployment(image string) extensions.Deployment { Name: image, }, Spec: extensions.DeploymentSpec{ - Replicas: 1, - Selector: podLabels, - UniqueLabelKey: "deployment.kubernetes.io/podTemplateHash", + Replicas: 1, + Selector: &unversioned.LabelSelector{MatchLabels: podLabels}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: podLabels, @@ -187,32 +186,32 @@ func generateDeployment(image string) extensions.Deployment { func TestGetNewRC(t *testing.T) { newDeployment := generateDeployment("nginx") - newRC := generateRC(newDeployment) + newRC := generateRS(newDeployment) tests := []struct { test string - rcList api.ReplicationControllerList - expected *api.ReplicationController + rsList extensions.ReplicaSetList + expected *extensions.ReplicaSet }{ { - "No new RC", - api.ReplicationControllerList{ - Items: []api.ReplicationController{ - generateRC(generateDeployment("foo")), - generateRC(generateDeployment("bar")), + "No new ReplicaSet", + extensions.ReplicaSetList{ + Items: []extensions.ReplicaSet{ + generateRS(generateDeployment("foo")), + generateRS(generateDeployment("bar")), }, }, nil, }, { - "Has new RC", - api.ReplicationControllerList{ - Items: []api.ReplicationController{ - generateRC(generateDeployment("foo")), - generateRC(generateDeployment("bar")), - generateRC(generateDeployment("abc")), + "Has new ReplicaSet", + extensions.ReplicaSetList{ + Items: []extensions.ReplicaSet{ + generateRS(generateDeployment("foo")), + generateRS(generateDeployment("bar")), + generateRS(generateDeployment("abc")), newRC, - generateRC(generateDeployment("xyz")), + generateRS(generateDeployment("xyz")), }, }, &newRC, @@ -224,69 +223,69 @@ func TestGetNewRC(t *testing.T) { c := &simple.Client{ Request: simple.Request{ Method: "GET", - Path: testapi.Default.ResourcePath("replicationControllers", ns, ""), + Path: testapi.Default.ResourcePath("replicaSets", ns, ""), }, Response: simple.Response{ StatusCode: 200, - Body: &test.rcList, + Body: &test.rsList, }, } - rc, err := GetNewRC(newDeployment, c.Setup(t).Clientset) + rs, err := GetNewReplicaSet(newDeployment, c.Setup(t).Clientset) if err != nil { t.Errorf("In test case %s, got unexpected error %v", test.test, err) } - if !api.Semantic.DeepEqual(rc, test.expected) { - t.Errorf("In test case %s, expected %+v, got %+v", test.test, test.expected, rc) + if !api.Semantic.DeepEqual(rs, test.expected) { + t.Errorf("In test case %s, expected %+v, got %+v", test.test, test.expected, rs) } } } func TestGetOldRCs(t *testing.T) { newDeployment := generateDeployment("nginx") - newRC := generateRC(newDeployment) - newPod := generatePodFromRC(newRC) + newRS := generateRS(newDeployment) + newPod := generatePodFromRS(newRS) - // create 2 old deployments and related rcs/pods, with the same labels but different template + // create 2 old deployments and related replica sets/pods, with the same labels but different template oldDeployment := generateDeployment("nginx") oldDeployment.Spec.Template.Spec.Containers[0].Name = "nginx-old-1" - oldRC := generateRC(oldDeployment) - oldPod := generatePodFromRC(oldRC) + oldRS := generateRS(oldDeployment) + oldPod := generatePodFromRS(oldRS) oldDeployment2 := generateDeployment("nginx") oldDeployment2.Spec.Template.Spec.Containers[0].Name = "nginx-old-2" - oldRC2 := generateRC(oldDeployment2) - oldPod2 := generatePodFromRC(oldRC2) + oldRS2 := generateRS(oldDeployment2) + oldPod2 := generatePodFromRS(oldRS2) - // create 1 rc that existed before the deployment, with the same labels as the deployment - existedPod := generatePod(newDeployment.Spec.Selector, "foo") - existedRC := generateRCWithLabel(newDeployment.Spec.Selector, "foo") + // create 1 ReplicaSet that existed before the deployment, with the same labels as the deployment + existedPod := generatePod(newDeployment.Spec.Template.Labels, "foo") + existedRS := generateRSWithLabel(newDeployment.Spec.Template.Labels, "foo") tests := []struct { test string objs []runtime.Object - expected []*api.ReplicationController + expected []*extensions.ReplicaSet }{ { - "No old RCs", + "No old ReplicaSets", []runtime.Object{ &api.PodList{ Items: []api.Pod{ - generatePod(newDeployment.Spec.Selector, "foo"), - generatePod(newDeployment.Spec.Selector, "bar"), + generatePod(newDeployment.Spec.Template.Labels, "foo"), + generatePod(newDeployment.Spec.Template.Labels, "bar"), newPod, }, }, - &api.ReplicationControllerList{ - Items: []api.ReplicationController{ - generateRC(generateDeployment("foo")), - newRC, - generateRC(generateDeployment("bar")), + &extensions.ReplicaSetList{ + Items: []extensions.ReplicaSet{ + generateRS(generateDeployment("foo")), + newRS, + generateRS(generateDeployment("bar")), }, }, }, - []*api.ReplicationController{}, + []*extensions.ReplicaSet{}, }, { - "Has old RC", + "Has old ReplicaSet", []runtime.Object{ &api.PodList{ Items: []api.Pod{ @@ -295,51 +294,51 @@ func TestGetOldRCs(t *testing.T) { generatePod(map[string]string{"name": "bar"}, "bar"), generatePod(map[string]string{"name": "xyz"}, "xyz"), existedPod, - generatePod(newDeployment.Spec.Selector, "abc"), + generatePod(newDeployment.Spec.Template.Labels, "abc"), }, }, - &api.ReplicationControllerList{ - Items: []api.ReplicationController{ - oldRC2, - oldRC, - existedRC, - newRC, - generateRCWithLabel(map[string]string{"name": "xyz"}, "xyz"), - generateRCWithLabel(map[string]string{"name": "bar"}, "bar"), + &extensions.ReplicaSetList{ + Items: []extensions.ReplicaSet{ + oldRS2, + oldRS, + existedRS, + newRS, + generateRSWithLabel(map[string]string{"name": "xyz"}, "xyz"), + generateRSWithLabel(map[string]string{"name": "bar"}, "bar"), }, }, }, - []*api.ReplicationController{&oldRC, &oldRC2, &existedRC}, + []*extensions.ReplicaSet{&oldRS, &oldRS2, &existedRS}, }, } for _, test := range tests { - rcs, _, err := GetOldRCs(newDeployment, fake.NewSimpleClientset(test.objs...)) + rss, _, err := GetOldReplicaSets(newDeployment, fake.NewSimpleClientset(test.objs...)) if err != nil { t.Errorf("In test case %s, got unexpected error %v", test.test, err) } - if !equal(rcs, test.expected) { - t.Errorf("In test case %q, expected %v, got %v", test.test, test.expected, rcs) + if !equal(rss, test.expected) { + t.Errorf("In test case %q, expected %v, got %v", test.test, test.expected, rss) } } } -// equal compares the equality of two rc slices regardless of their ordering -func equal(rcs1, rcs2 []*api.ReplicationController) bool { - if reflect.DeepEqual(rcs1, rcs2) { +// equal compares the equality of two ReplicaSet slices regardless of their ordering +func equal(rss1, rss2 []*extensions.ReplicaSet) bool { + if reflect.DeepEqual(rss1, rss2) { return true } - if rcs1 == nil || rcs2 == nil || len(rcs1) != len(rcs2) { + if rss1 == nil || rss2 == nil || len(rss1) != len(rss2) { return false } count := 0 - for _, rc1 := range rcs1 { - for _, rc2 := range rcs2 { - if reflect.DeepEqual(rc1, rc2) { + for _, rs1 := range rss1 { + for _, rs2 := range rss2 { + if reflect.DeepEqual(rs1, rs2) { count++ break } } } - return count == len(rcs1) + return count == len(rss1) } diff --git a/pkg/util/httpstream/httpstream.go b/pkg/util/httpstream/httpstream.go index 80c3cd78fc0..4f6b608ce7a 100644 --- a/pkg/util/httpstream/httpstream.go +++ b/pkg/util/httpstream/httpstream.go @@ -33,12 +33,12 @@ const ( // NewStreamHandler defines a function that is called when a new Stream is // received. If no error is returned, the Stream is accepted; otherwise, -// the stream is rejected. -type NewStreamHandler func(Stream) error +// the stream is rejected. After the reply frame has been sent, replySent is closed. +type NewStreamHandler func(stream Stream, replySent <-chan struct{}) error // NoOpNewStreamHandler is a stream handler that accepts a new stream and // performs no other logic. -func NoOpNewStreamHandler(stream Stream) error { return nil } +func NoOpNewStreamHandler(stream Stream, replySent <-chan struct{}) error { return nil } // Dialer knows how to open a streaming connection to a server. type Dialer interface { diff --git a/pkg/util/httpstream/spdy/connection.go b/pkg/util/httpstream/spdy/connection.go index 6d4855d195f..884c6e20360 100644 --- a/pkg/util/httpstream/spdy/connection.go +++ b/pkg/util/httpstream/spdy/connection.go @@ -120,7 +120,8 @@ func (c *connection) CloseChan() <-chan bool { // the stream. If newStreamHandler returns an error, the stream is rejected. If not, the // stream is accepted and registered with the connection. func (c *connection) newSpdyStream(stream *spdystream.Stream) { - err := c.newStreamHandler(stream) + replySent := make(chan struct{}) + err := c.newStreamHandler(stream, replySent) rejectStream := (err != nil) if rejectStream { glog.Warningf("Stream rejected: %v", err) @@ -130,6 +131,7 @@ func (c *connection) newSpdyStream(stream *spdystream.Stream) { c.registerStream(stream) stream.SendReply(http.Header{}, rejectStream) + close(replySent) } // SetIdleTimeout sets the amount of time the connection may remain idle before diff --git a/pkg/util/httpstream/spdy/roundtripper_test.go b/pkg/util/httpstream/spdy/roundtripper_test.go index 651dd89f347..7ca1d42ad34 100644 --- a/pkg/util/httpstream/spdy/roundtripper_test.go +++ b/pkg/util/httpstream/spdy/roundtripper_test.go @@ -134,7 +134,7 @@ func TestRoundTripAndNewConnection(t *testing.T) { streamCh := make(chan httpstream.Stream) responseUpgrader := NewResponseUpgrader() - spdyConn := responseUpgrader.UpgradeResponse(w, req, func(s httpstream.Stream) error { + spdyConn := responseUpgrader.UpgradeResponse(w, req, func(s httpstream.Stream, replySent <-chan struct{}) error { streamCh <- s return nil }) diff --git a/pkg/util/iptables/iptables.go b/pkg/util/iptables/iptables.go index 9b0bc0e7bb9..801cc8bf726 100644 --- a/pkg/util/iptables/iptables.go +++ b/pkg/util/iptables/iptables.go @@ -84,7 +84,8 @@ const ( type Table string const ( - TableNAT Table = "nat" + TableNAT Table = "nat" + TableFilter Table = "filter" ) type Chain string @@ -93,6 +94,7 @@ const ( ChainPostrouting Chain = "POSTROUTING" ChainPrerouting Chain = "PREROUTING" ChainOutput Chain = "OUTPUT" + ChainInput Chain = "INPUT" ) const ( @@ -294,6 +296,7 @@ func (runner *runner) Save(table Table) ([]byte, error) { // run and return args := []string{"-t", string(table)} + glog.V(4).Infof("running iptables-save %v", args) return runner.exec.Command(cmdIptablesSave, args...).CombinedOutput() } @@ -303,6 +306,7 @@ func (runner *runner) SaveAll() ([]byte, error) { defer runner.mu.Unlock() // run and return + glog.V(4).Infof("running iptables-save") return runner.exec.Command(cmdIptablesSave, []string{}...).CombinedOutput() } @@ -352,6 +356,7 @@ func (runner *runner) restoreInternal(args []string, data []byte, flush FlushFla return err } // run the command and return the output or an error including the output and error + glog.V(4).Infof("running iptables-restore %v", args) b, err := runner.exec.Command(cmdIptablesRestore, args...).CombinedOutput() if err != nil { return fmt.Errorf("%v (%s)", err, b) @@ -574,3 +579,17 @@ func (runner *runner) reload() { f() } } + +// IsNotFoundError returns true if the error indicates "not found". It parses +// the error string looking for known values, which is imperfect but works in +// practice. +func IsNotFoundError(err error) bool { + es := err.Error() + if strings.Contains(es, "No such file or directory") { + return true + } + if strings.Contains(es, "No chain/target/match by that name") { + return true + } + return false +} diff --git a/pkg/util/iptables/iptables_test.go b/pkg/util/iptables/iptables_test.go index 6c18372cec0..d5bb346910a 100644 --- a/pkg/util/iptables/iptables_test.go +++ b/pkg/util/iptables/iptables_test.go @@ -673,7 +673,7 @@ func TestReload(t *testing.T) { // EnsureChain func() ([]byte, error) { return []byte{}, nil }, // EnsureRule abc check - func() ([]byte, error) { return []byte{}, &exec.FakeExitError{1} }, + func() ([]byte, error) { return []byte{}, &exec.FakeExitError{Status: 1} }, // EnsureRule abc func() ([]byte, error) { return []byte{}, nil }, @@ -681,7 +681,7 @@ func TestReload(t *testing.T) { // EnsureChain func() ([]byte, error) { return []byte{}, nil }, // EnsureRule abc check - func() ([]byte, error) { return []byte{}, &exec.FakeExitError{1} }, + func() ([]byte, error) { return []byte{}, &exec.FakeExitError{Status: 1} }, // EnsureRule abc func() ([]byte, error) { return []byte{}, nil }, }, diff --git a/pkg/util/labels/labels.go b/pkg/util/labels/labels.go index 6627d5e357a..f7f034bc27c 100644 --- a/pkg/util/labels/labels.go +++ b/pkg/util/labels/labels.go @@ -18,6 +18,8 @@ package labels import ( "fmt" + + "k8s.io/kubernetes/pkg/api/unversioned" ) // Clones the given map and returns a new map with the given key and value added. @@ -51,3 +53,43 @@ func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]s delete(newLabels, labelKey) return newLabels } + +// Clones the given selector and returns a new selector with the given key and value added. +// Returns the given selector, if labelKey is empty. +func CloneSelectorAndAddLabel(selector *unversioned.LabelSelector, labelKey string, labelValue uint32) *unversioned.LabelSelector { + if labelKey == "" { + // Dont need to add a label. + return selector + } + + // Clone. + newSelector := new(unversioned.LabelSelector) + + // TODO(madhusudancs): Check if you can use deepCopy_extensions_LabelSelector here. + newSelector.MatchLabels = make(map[string]string) + if selector.MatchLabels != nil { + for key, val := range selector.MatchLabels { + newSelector.MatchLabels[key] = val + } + } + newSelector.MatchLabels[labelKey] = fmt.Sprintf("%d", labelValue) + + if selector.MatchExpressions != nil { + newMExps := make([]unversioned.LabelSelectorRequirement, len(selector.MatchExpressions)) + for i, me := range selector.MatchExpressions { + newMExps[i].Key = me.Key + newMExps[i].Operator = me.Operator + if me.Values != nil { + newMExps[i].Values = make([]string, len(me.Values)) + copy(newMExps[i].Values, me.Values) + } else { + newMExps[i].Values = nil + } + } + newSelector.MatchExpressions = newMExps + } else { + newSelector.MatchExpressions = nil + } + + return newSelector +} diff --git a/pkg/util/logs.go b/pkg/util/logs.go index 37b9b767b2c..c79c4903d1b 100644 --- a/pkg/util/logs.go +++ b/pkg/util/logs.go @@ -23,6 +23,7 @@ import ( "github.com/golang/glog" "github.com/spf13/pflag" + "k8s.io/kubernetes/pkg/util/wait" ) var logFlushFreq = pflag.Duration("log-flush-frequency", 5*time.Second, "Maximum number of seconds between log flushes") @@ -46,7 +47,7 @@ func InitLogs() { log.SetOutput(GlogWriter{}) log.SetFlags(0) // The default glog flush interval is 30 seconds, which is frighteningly long. - go Until(glog.Flush, *logFlushFreq, NeverStop) + go wait.Until(glog.Flush, *logFlushFreq, wait.NeverStop) } // FlushLogs flushes logs immediately. diff --git a/pkg/util/net/port_range.go b/pkg/util/net/port_range.go index c9ade51a0ef..527552571e0 100644 --- a/pkg/util/net/port_range.go +++ b/pkg/util/net/port_range.go @@ -102,7 +102,7 @@ func ParsePortRange(value string) (*PortRange, error) { func ParsePortRangeOrDie(value string) *PortRange { pr, err := ParsePortRange(value) if err != nil { - panic(fmt.Sprintf("couldn't parse port range: %v")) + panic(fmt.Sprintf("couldn't parse port range %q: %v", value, err)) } return pr } diff --git a/pkg/util/oom/oom_linux.go b/pkg/util/oom/oom_linux.go index 9a89dbde261..5503bad8c2c 100644 --- a/pkg/util/oom/oom_linux.go +++ b/pkg/util/oom/oom_linux.go @@ -21,6 +21,7 @@ package oom import ( "fmt" "io/ioutil" + "os" "path" "strconv" @@ -48,7 +49,18 @@ func getPids(cgroupName string) ([]int, error) { return fsManager.GetPids() } +func syscallNotExists(err error) bool { + if err == nil { + return false + } + if e, ok := err.(*os.SyscallError); ok && os.IsNotExist(e) { + return true + } + return false +} + // Writes 'value' to /proc//oom_score_adj. PID = 0 means self +// Returns os.ErrNotExist if the `pid` does not exist. func applyOOMScoreAdj(pid int, oomScoreAdj int) error { if pid < 0 { return fmt.Errorf("invalid PID %d specified for oom_score_adj", pid) @@ -61,20 +73,18 @@ func applyOOMScoreAdj(pid int, oomScoreAdj int) error { pidStr = strconv.Itoa(pid) } - oomScoreAdjPath := path.Join("/proc", pidStr, "oom_score_adj") maxTries := 2 + oomScoreAdjPath := path.Join("/proc", pidStr, "oom_score_adj") + value := strconv.Itoa(oomScoreAdj) var err error for i := 0; i < maxTries; i++ { - _, readErr := ioutil.ReadFile(oomScoreAdjPath) - if readErr != nil { - err = fmt.Errorf("failed to read oom_score_adj: %v", readErr) - } else if writeErr := ioutil.WriteFile(oomScoreAdjPath, []byte(strconv.Itoa(oomScoreAdj)), 0700); writeErr != nil { - err = fmt.Errorf("failed to set oom_score_adj to %d: %v", oomScoreAdj, writeErr) - } else { - return nil + if err = ioutil.WriteFile(oomScoreAdjPath, []byte(value), 0700); err != nil { + if syscallNotExists(err) { + return os.ErrNotExist + } + err = fmt.Errorf("failed to apply oom-score-adj to pid %d (%v)", err) } } - return err } @@ -86,6 +96,10 @@ func (oomAdjuster *OOMAdjuster) applyOOMScoreAdjContainer(cgroupName string, oom continueAdjusting := false pidList, err := oomAdjuster.pidLister(cgroupName) if err != nil { + if syscallNotExists(err) { + // Nothing to do since the container doesn't exist anymore. + return os.ErrNotExist + } continueAdjusting = true glog.Errorf("Error getting process list for cgroup %s: %+v", cgroupName, err) } else if len(pidList) == 0 { @@ -97,6 +111,7 @@ func (oomAdjuster *OOMAdjuster) applyOOMScoreAdjContainer(cgroupName string, oom if err = oomAdjuster.ApplyOOMScoreAdj(pid, oomScoreAdj); err == nil { adjustedProcessSet[pid] = true } + // Processes can come and go while we try to apply oom score adjust value. So ignore errors here. } } } diff --git a/pkg/util/procfs/procfs.go b/pkg/util/procfs/procfs.go index c0a45725fbf..cc432255fb2 100644 --- a/pkg/util/procfs/procfs.go +++ b/pkg/util/procfs/procfs.go @@ -19,6 +19,7 @@ package procfs import ( "fmt" "io/ioutil" + "os" "path" "strconv" "strings" @@ -48,6 +49,9 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) { filePath := path.Join("/proc", strconv.Itoa(pid), "cgroup") content, err := ioutil.ReadFile(filePath) if err != nil { + if e, ok := err.(*os.SyscallError); ok && os.IsNotExist(e) { + return "", os.ErrNotExist + } return "", err } return containerNameFromProcCgroup(string(content)) diff --git a/pkg/util/throttle.go b/pkg/util/throttle.go index 54a2fe58dae..c1caea099fe 100644 --- a/pkg/util/throttle.go +++ b/pkg/util/throttle.go @@ -16,7 +16,11 @@ limitations under the License. package util -import "github.com/juju/ratelimit" +import ( + "sync" + + "github.com/juju/ratelimit" +) type RateLimiter interface { // TryAccept returns true if a token is taken immediately. Otherwise, @@ -47,12 +51,6 @@ func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter { return &tokenBucketRateLimiter{limiter} } -type fakeRateLimiter struct{} - -func NewFakeRateLimiter() RateLimiter { - return &fakeRateLimiter{} -} - func (t *tokenBucketRateLimiter) TryAccept() bool { return t.limiter.TakeAvailable(1) == 1 } @@ -71,14 +69,48 @@ func (t *tokenBucketRateLimiter) Accept() { func (t *tokenBucketRateLimiter) Stop() { } -func (t *fakeRateLimiter) TryAccept() bool { +type fakeAlwaysRateLimiter struct{} + +func NewFakeAlwaysRateLimiter() RateLimiter { + return &fakeAlwaysRateLimiter{} +} + +func (t *fakeAlwaysRateLimiter) TryAccept() bool { return true } -func (t *fakeRateLimiter) Saturation() float64 { +func (t *fakeAlwaysRateLimiter) Saturation() float64 { return 0 } -func (t *fakeRateLimiter) Stop() {} +func (t *fakeAlwaysRateLimiter) Stop() {} -func (t *fakeRateLimiter) Accept() {} +func (t *fakeAlwaysRateLimiter) Accept() {} + +type fakeNeverRateLimiter struct { + wg sync.WaitGroup +} + +func NewFakeNeverRateLimiter() RateLimiter { + wg := sync.WaitGroup{} + wg.Add(1) + return &fakeNeverRateLimiter{ + wg: wg, + } +} + +func (t *fakeNeverRateLimiter) TryAccept() bool { + return false +} + +func (t *fakeNeverRateLimiter) Saturation() float64 { + return 1 +} + +func (t *fakeNeverRateLimiter) Stop() { + t.wg.Done() +} + +func (t *fakeNeverRateLimiter) Accept() { + t.wg.Wait() +} diff --git a/pkg/util/throttle_test.go b/pkg/util/throttle_test.go index 089d7087191..ca0e9ac2343 100644 --- a/pkg/util/throttle_test.go +++ b/pkg/util/throttle_test.go @@ -18,6 +18,7 @@ package util import ( "math" + "sync" "testing" "time" ) @@ -87,3 +88,40 @@ func TestRateLimiterSaturation(t *testing.T) { } } } + +func TestAlwaysFake(t *testing.T) { + rl := NewFakeAlwaysRateLimiter() + if !rl.TryAccept() { + t.Error("TryAccept in AlwaysFake should return true.") + } + // If this will block the test will timeout + rl.Accept() +} + +func TestNeverFake(t *testing.T) { + rl := NewFakeNeverRateLimiter() + if rl.TryAccept() { + t.Error("TryAccept in NeverFake should return false.") + } + + finished := false + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + rl.Accept() + finished = true + wg.Done() + }() + + // Wait some time to make sure it never finished. + time.Sleep(time.Second) + if finished { + t.Error("Accept should block forever in NeverFake.") + } + + rl.Stop() + wg.Wait() + if !finished { + t.Error("Stop should make Accept unblock in NeverFake.") + } +} diff --git a/pkg/util/util.go b/pkg/util/util.go index 48cc67c711b..63da8ef5e76 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -24,53 +24,10 @@ import ( "regexp" "strconv" "strings" - "time" "k8s.io/kubernetes/pkg/util/intstr" - "k8s.io/kubernetes/pkg/util/runtime" ) -// For any test of the style: -// ... -// <- time.After(timeout): -// t.Errorf("Timed out") -// The value for timeout should effectively be "forever." Obviously we don't want our tests to truly lock up forever, but 30s -// is long enough that it is effectively forever for the things that can slow down a run on a heavily contended machine -// (GC, seeks, etc), but not so long as to make a developer ctrl-c a test run if they do happen to break that test. -var ForeverTestTimeout = time.Second * 30 - -// NeverStop may be passed to Until to make it never stop. -var NeverStop <-chan struct{} = make(chan struct{}) - -// Forever is syntactic sugar on top of Until -func Forever(f func(), period time.Duration) { - Until(f, period, NeverStop) -} - -// Until loops until stop channel is closed, running f every period. -// Catches any panics, and keeps going. f may not be invoked if -// stop channel is already closed. Pass NeverStop to Until if you -// don't want it stop. -func Until(f func(), period time.Duration, stopCh <-chan struct{}) { - select { - case <-stopCh: - return - default: - } - - for { - func() { - defer runtime.HandleCrash() - f() - }() - select { - case <-stopCh: - return - case <-time.After(period): - } - } -} - func GetIntOrPercentValue(intOrStr *intstr.IntOrString) (int, bool, error) { switch intOrStr.Type { case intstr.Int: diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index b5ef5b682e8..7fd236e1e72 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -18,40 +18,8 @@ package util import ( "testing" - "time" ) -func TestUntil(t *testing.T) { - ch := make(chan struct{}) - close(ch) - Until(func() { - t.Fatal("should not have been invoked") - }, 0, ch) - - ch = make(chan struct{}) - called := make(chan struct{}) - go func() { - Until(func() { - called <- struct{}{} - }, 0, ch) - close(called) - }() - <-called - close(ch) - <-called -} - -func TestUntilReturnsImmediately(t *testing.T) { - now := time.Now() - ch := make(chan struct{}) - Until(func() { - close(ch) - }, 30*time.Second, ch) - if now.Add(25 * time.Second).Before(time.Now()) { - t.Errorf("Until did not return immediately when the stop chan was closed inside the func") - } -} - func TestStringDiff(t *testing.T) { diff := StringDiff("aaabb", "aaacc") expect := "aaa\n\nA: bb\n\nB: cc\n\n" diff --git a/pkg/util/validation/field/errors.go b/pkg/util/validation/field/errors.go index 0a8ed1e8565..203f7cc8f5c 100644 --- a/pkg/util/validation/field/errors.go +++ b/pkg/util/validation/field/errors.go @@ -120,8 +120,7 @@ func (t ErrorType) String() string { case ErrorTypeInternal: return "Internal error" default: - panic(fmt.Sprintf("unrecognized validation error: %q", t)) - return "" + panic(fmt.Sprintf("unrecognized validation error: %q", string(t))) } } diff --git a/pkg/util/validation/validation.go b/pkg/util/validation/validation.go index c41960f12fc..9607293b7f0 100644 --- a/pkg/util/validation/validation.go +++ b/pkg/util/validation/validation.go @@ -167,3 +167,13 @@ var percentRegexp = regexp.MustCompile("^" + percentFmt + "$") func IsValidPercent(percent string) bool { return percentRegexp.MatchString(percent) } + +const HTTPHeaderNameFmt string = "[-A-Za-z0-9]+" + +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) +} diff --git a/pkg/util/validation/validation_test.go b/pkg/util/validation/validation_test.go index 80399c14626..38fc63c3f76 100644 --- a/pkg/util/validation/validation_test.go +++ b/pkg/util/validation/validation_test.go @@ -308,3 +308,30 @@ func TestIsValidIP(t *testing.T) { } } } + +func TestIsHTTPHeaderName(t *testing.T) { + goodValues := []string{ + // Common ones + "Accept-Encoding", "Host", "If-Modified-Since", "X-Forwarded-For", + // Weirdo, but still conforming names + "a", "ab", "abc", "a1", "-a", "a-", "a-b", "a-1", "a--1--2--b", "--abc-123", + "A", "AB", "AbC", "A1", "-A", "A-", "A-B", "A-1", "A--1--2--B", "--123-ABC", + } + for _, val := range goodValues { + if !IsHTTPHeaderName(val) { + t.Errorf("expected true for '%s'", val) + } + } + + badValues := []string{ + "Host:", "X-Forwarded-For:", "X-@Home", + "", "_", "a_", "_a", "1_", "1_2", ".", "a.", ".a", "a.b", "1.", ".1", "1.2", + " ", "a ", " a", "a b", "1 ", " 1", "1 2", "#a#", "^", ",", ";", "=", "<", + "?", "@", "{", + } + for _, val := range badValues { + if IsHTTPHeaderName(val) { + t.Errorf("expected false for '%s'", val) + } + } +} diff --git a/pkg/util/wait/wait.go b/pkg/util/wait/wait.go index 275505f73ff..31c81b6c27c 100644 --- a/pkg/util/wait/wait.go +++ b/pkg/util/wait/wait.go @@ -20,8 +20,65 @@ import ( "errors" "math/rand" "time" + + "k8s.io/kubernetes/pkg/util/runtime" ) +// For any test of the style: +// ... +// <- time.After(timeout): +// t.Errorf("Timed out") +// The value for timeout should effectively be "forever." Obviously we don't want our tests to truly lock up forever, but 30s +// is long enough that it is effectively forever for the things that can slow down a run on a heavily contended machine +// (GC, seeks, etc), but not so long as to make a developer ctrl-c a test run if they do happen to break that test. +var ForeverTestTimeout = time.Second * 30 + +// NeverStop may be passed to Until to make it never stop. +var NeverStop <-chan struct{} = make(chan struct{}) + +// Forever is syntactic sugar on top of Until +func Forever(f func(), period time.Duration) { + Until(f, period, NeverStop) +} + +// Until loops until stop channel is closed, running f every period. +// Until is syntactic sugar on top of JitterUntil with zero jitter factor +func Until(f func(), period time.Duration, stopCh <-chan struct{}) { + JitterUntil(f, period, 0.0, stopCh) +} + +// JitterUntil loops until stop channel is closed, running f every period. +// If jitterFactor is positive, the period is jittered before every run of f. +// If jitterFactor is not positive, the period is unchanged. +// Catches any panics, and keeps going. f may not be invoked if +// stop channel is already closed. Pass NeverStop to Until if you +// don't want it stop. +func JitterUntil(f func(), period time.Duration, jitterFactor float64, stopCh <-chan struct{}) { + select { + case <-stopCh: + return + default: + } + + for { + func() { + defer runtime.HandleCrash() + f() + }() + + jitteredPeriod := period + if jitterFactor > 0.0 { + jitteredPeriod = Jitter(period, jitterFactor) + } + + select { + case <-stopCh: + return + case <-time.After(jitteredPeriod): + } + } +} + // Jitter returns a time.Duration between duration and duration + maxFactor * duration, // to allow clients to avoid converging on periodic behavior. If maxFactor is 0.0, a // suggested default value will be chosen. diff --git a/pkg/util/wait/wait_test.go b/pkg/util/wait/wait_test.go index 09dcb0c4900..28de7e01ba6 100644 --- a/pkg/util/wait/wait_test.go +++ b/pkg/util/wait/wait_test.go @@ -23,10 +23,98 @@ import ( "sync/atomic" "testing" "time" - - "k8s.io/kubernetes/pkg/util" ) +func TestUntil(t *testing.T) { + ch := make(chan struct{}) + close(ch) + Until(func() { + t.Fatal("should not have been invoked") + }, 0, ch) + + ch = make(chan struct{}) + called := make(chan struct{}) + go func() { + Until(func() { + called <- struct{}{} + }, 0, ch) + close(called) + }() + <-called + close(ch) + <-called +} + +func TestUntilReturnsImmediately(t *testing.T) { + now := time.Now() + ch := make(chan struct{}) + Until(func() { + close(ch) + }, 30*time.Second, ch) + if now.Add(25 * time.Second).Before(time.Now()) { + t.Errorf("Until did not return immediately when the stop chan was closed inside the func") + } +} + +func TestJitterUntil(t *testing.T) { + ch := make(chan struct{}) + // if a channel is closed JitterUntil never calls function f + // and returns imidiatelly + close(ch) + JitterUntil(func() { + t.Fatal("should not have been invoked") + }, 0, 1.0, ch) + + ch = make(chan struct{}) + called := make(chan struct{}) + go func() { + JitterUntil(func() { + called <- struct{}{} + }, 0, 1.0, ch) + close(called) + }() + <-called + close(ch) + <-called +} + +func TestJitterUntilReturnsImmediately(t *testing.T) { + now := time.Now() + ch := make(chan struct{}) + JitterUntil(func() { + close(ch) + }, 30*time.Second, 1.0, ch) + if now.Add(25 * time.Second).Before(time.Now()) { + t.Errorf("JitterUntil did not return immediately when the stop chan was closed inside the func") + } +} + +func TestJitterUntilNegativeFactor(t *testing.T) { + now := time.Now() + ch := make(chan struct{}) + called := make(chan struct{}) + received := make(chan struct{}) + go func() { + JitterUntil(func() { + called <- struct{}{} + <-received + }, time.Second, -30.0, ch) + }() + // first loop + <-called + received <- struct{}{} + // second loop + <-called + close(ch) + received <- struct{}{} + + // it should take at most 2 seconds + some overhead, not 3 + if now.Add(3 * time.Second).Before(time.Now()) { + t.Errorf("JitterUntil did not returned after predefined period with negative jitter factor when the stop chan was closed inside the func") + } + +} + func TestExponentialBackoff(t *testing.T) { opts := Backoff{Factor: 1.0, Steps: 3} @@ -87,7 +175,7 @@ DRAIN: break DRAIN } count++ - case <-time.After(util.ForeverTestTimeout): + case <-time.After(ForeverTestTimeout): t.Errorf("unexpected timeout after poll") } } @@ -233,7 +321,7 @@ func TestPollForever(t *testing.T) { if !open { t.Fatalf("did not expect channel to be closed") } - case <-time.After(util.ForeverTestTimeout): + case <-time.After(ForeverTestTimeout): t.Fatalf("channel did not return at least once within the poll interval") } } @@ -313,14 +401,14 @@ func TestWaitFor(t *testing.T) { func TestWaitForWithDelay(t *testing.T) { done := make(chan struct{}) defer close(done) - WaitFor(poller(time.Millisecond, util.ForeverTestTimeout), func() (bool, error) { + WaitFor(poller(time.Millisecond, ForeverTestTimeout), func() (bool, error) { time.Sleep(10 * time.Millisecond) return true, nil }, done) // If polling goroutine doesn't see the done signal it will leak timers. select { case done <- struct{}{}: - case <-time.After(util.ForeverTestTimeout): + case <-time.After(ForeverTestTimeout): t.Errorf("expected an ack of the done signal.") } } diff --git a/pkg/volume/aws_ebs/aws_ebs.go b/pkg/volume/aws_ebs/aws_ebs.go index 5df20b8d1fb..134f16c74e4 100644 --- a/pkg/volume/aws_ebs/aws_ebs.go +++ b/pkg/volume/aws_ebs/aws_ebs.go @@ -27,7 +27,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - awscloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/exec" "k8s.io/kubernetes/pkg/util/mount" @@ -100,15 +99,15 @@ func (plugin *awsElasticBlockStorePlugin) newBuilderInternal(spec *volume.Spec, return &awsElasticBlockStoreBuilder{ awsElasticBlockStore: &awsElasticBlockStore{ - podUID: podUID, - volName: spec.Name(), - volumeID: volumeID, - manager: manager, - mounter: mounter, - plugin: plugin, + podUID: podUID, + volName: spec.Name(), + volumeID: volumeID, + partition: partition, + manager: manager, + mounter: mounter, + plugin: plugin, }, fsType: fsType, - partition: partition, readOnly: readOnly, diskMounter: &mount.SafeFormatAndMount{plugin.host.GetMounter(), exec.New()}}, nil } @@ -181,6 +180,8 @@ type awsElasticBlockStore struct { podUID types.UID // Unique id of the PD, used to find the disk resource in the provider. volumeID string + // Specifies the partition to mount + partition string // Utility interface that provides API calls to the provider to attach/detach disks. manager ebsManager // Mounter interface that provides system calls to mount the global path to the pod local path. @@ -196,22 +197,10 @@ func detachDiskLogError(ebs *awsElasticBlockStore) { } } -// getVolumeProvider returns the AWS Volumes interface -func (ebs *awsElasticBlockStore) getVolumeProvider() (awscloud.Volumes, error) { - cloud := ebs.plugin.host.GetCloudProvider() - volumes, ok := cloud.(awscloud.Volumes) - if !ok { - return nil, fmt.Errorf("Cloud provider does not support volumes") - } - return volumes, nil -} - type awsElasticBlockStoreBuilder struct { *awsElasticBlockStore // Filesystem type, optional. fsType string - // Specifies the partition to mount - partition string // Specifies whether the disk will be attached as read-only. readOnly bool // diskMounter provides the interface that is used to mount the actual block device. @@ -304,6 +293,7 @@ func makeGlobalPDPath(host volume.VolumeHost, volumeID string) string { return path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts", name) } +// Reverses the mapping done in makeGlobalPDPath func getVolumeIDFromGlobalMount(host volume.VolumeHost, globalPath string) (string, error) { basePath := path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts") rel, err := filepath.Rel(basePath, globalPath) diff --git a/pkg/volume/aws_ebs/aws_ebs_test.go b/pkg/volume/aws_ebs/aws_ebs_test.go index 313a1d2f8a6..8e81192b5b1 100644 --- a/pkg/volume/aws_ebs/aws_ebs_test.go +++ b/pkg/volume/aws_ebs/aws_ebs_test.go @@ -68,11 +68,12 @@ func TestGetAccessModes(t *testing.T) { if err != nil { t.Errorf("Can't find the plugin by name") } + if !contains(plug.GetAccessModes(), api.ReadWriteOnce) { - t.Errorf("Expected to find AccessMode: %s", api.ReadWriteOnce) + t.Errorf("Expected to support AccessModeTypes: %s", api.ReadWriteOnce) } - if len(plug.GetAccessModes()) != 1 { - t.Errorf("Expected to find exactly one AccessMode") + if contains(plug.GetAccessModes(), api.ReadOnlyMany) { + t.Errorf("Expected not to support AccessModeTypes: %s", api.ReadOnlyMany) } } @@ -85,7 +86,10 @@ func contains(modes []api.PersistentVolumeAccessMode, mode api.PersistentVolumeA return false } -type fakePDManager struct{} +type fakePDManager struct { + attachCalled bool + detachCalled bool +} // TODO(jonesdl) To fully test this, we could create a loopback device // and mount that instead. @@ -95,6 +99,10 @@ func (fake *fakePDManager) AttachAndMountDisk(b *awsElasticBlockStoreBuilder, gl if err != nil { return err } + fake.attachCalled = true + // Simulate the global mount so that the fakeMounter returns the + // expected number of mounts for the attached disk. + b.mounter.Mount(globalPath, globalPath, b.fsType, nil) return nil } @@ -104,6 +112,7 @@ func (fake *fakePDManager) DetachDisk(c *awsElasticBlockStoreCleaner) error { if err != nil { return err } + fake.detachCalled = true return nil } @@ -121,7 +130,7 @@ func (fake *fakePDManager) DeleteVolume(cd *awsElasticBlockStoreDeleter) error { func TestPlugin(t *testing.T) { tmpDir, err := utiltesting.MkTmpdir("awsebsTest") if err != nil { - t.Fatalf("can't make a temp dir: %v") + t.Fatalf("can't make a temp dir: %v", err) } defer os.RemoveAll(tmpDir) plugMgr := volume.VolumePluginMgr{} @@ -140,13 +149,16 @@ func TestPlugin(t *testing.T) { }, }, } - builder, err := plug.(*awsElasticBlockStorePlugin).newBuilderInternal(volume.NewSpecFromVolume(spec), types.UID("poduid"), &fakePDManager{}, &mount.FakeMounter{}) + fakeManager := &fakePDManager{} + fakeMounter := &mount.FakeMounter{} + builder, err := plug.(*awsElasticBlockStorePlugin).newBuilderInternal(volume.NewSpecFromVolume(spec), types.UID("poduid"), fakeManager, fakeMounter) if err != nil { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { t.Errorf("Got a nil Builder") } + volPath := path.Join(tmpDir, "pods/poduid/volumes/kubernetes.io~aws-ebs/vol1") path := builder.GetPath() if path != volPath { @@ -170,8 +182,12 @@ func TestPlugin(t *testing.T) { t.Errorf("SetUp() failed: %v", err) } } + if !fakeManager.attachCalled { + t.Errorf("Attach watch not called") + } - cleaner, err := plug.(*awsElasticBlockStorePlugin).newCleanerInternal("vol1", types.UID("poduid"), &fakePDManager{}, &mount.FakeMounter{}) + fakeManager = &fakePDManager{} + cleaner, err := plug.(*awsElasticBlockStorePlugin).newCleanerInternal("vol1", types.UID("poduid"), fakeManager, fakeMounter) if err != nil { t.Errorf("Failed to make a new Cleaner: %v", err) } @@ -187,9 +203,12 @@ func TestPlugin(t *testing.T) { } else if !os.IsNotExist(err) { t.Errorf("SetUp() failed: %v", err) } + if !fakeManager.detachCalled { + t.Errorf("Detach watch not called") + } // Test Provisioner - cap := resource.MustParse("100Gi") + cap := resource.MustParse("100Mi") options := volume.VolumeOptions{ Capacity: cap, AccessModes: []api.PersistentVolumeAccessMode{ diff --git a/pkg/volume/aws_ebs/aws_util.go b/pkg/volume/aws_ebs/aws_util.go index 2f188c17070..083842db63f 100644 --- a/pkg/volume/aws_ebs/aws_util.go +++ b/pkg/volume/aws_ebs/aws_util.go @@ -17,47 +17,56 @@ limitations under the License. package aws_ebs import ( - "errors" + "fmt" "os" + "path/filepath" "time" "github.com/golang/glog" - aws_cloud "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" + "k8s.io/kubernetes/pkg/cloudprovider" + "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" + "k8s.io/kubernetes/pkg/util/keymutex" + "k8s.io/kubernetes/pkg/util/runtime" + "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/volume" ) +const ( + diskPartitionSuffix = "" + diskXVDPath = "/dev/xvd" + diskXVDPattern = "/dev/xvd*" + maxChecks = 60 + maxRetries = 10 + checkSleepDuration = time.Second + errorSleepDuration = 5 * time.Second +) + +// Singleton key mutex for keeping attach/detach operations for the same PD atomic +var attachDetachMutex = keymutex.NewKeyMutex() + type AWSDiskUtil struct{} -// Attaches a disk specified by a volume.AWSElasticBlockStore to the current kubelet. +// Attaches a disk to the current kubelet. // Mounts the disk to it's global path. -func (util *AWSDiskUtil) AttachAndMountDisk(b *awsElasticBlockStoreBuilder, globalPDPath string) error { - volumes, err := b.getVolumeProvider() +func (diskUtil *AWSDiskUtil) AttachAndMountDisk(b *awsElasticBlockStoreBuilder, globalPDPath string) error { + glog.V(5).Infof("AttachAndMountDisk(...) called for PD %q. Will block for existing operations, if any. (globalPDPath=%q)\r\n", b.volumeID, globalPDPath) + + // Block execution until any pending detach operations for this PD have completed + attachDetachMutex.LockKey(b.volumeID) + defer attachDetachMutex.UnlockKey(b.volumeID) + + glog.V(5).Infof("AttachAndMountDisk(...) called for PD %q. Awake and ready to execute. (globalPDPath=%q)\r\n", b.volumeID, globalPDPath) + + xvdBefore, err := filepath.Glob(diskXVDPattern) + if err != nil { + glog.Errorf("Error filepath.Glob(\"%s\"): %v\r\n", diskXVDPattern, err) + } + xvdBeforeSet := sets.NewString(xvdBefore...) + + devicePath, err := attachDiskAndVerify(b, xvdBeforeSet) if err != nil { return err } - devicePath, err := volumes.AttachDisk("", b.volumeID, b.readOnly) - if err != nil { - return err - } - if b.partition != "" { - devicePath = devicePath + b.partition - } - //TODO(jonesdl) There should probably be better method than busy-waiting here. - numTries := 0 - for { - _, err := os.Stat(devicePath) - if err == nil { - break - } - if err != nil && !os.IsNotExist(err) { - return err - } - numTries++ - if numTries == 10 { - return errors.New("Could not attach disk: Timeout after 10s (" + devicePath + ")") - } - time.Sleep(time.Second) - } // Only mount the PD globally once. notMnt, err := b.mounter.IsLikelyNotMountPoint(globalPDPath) @@ -87,64 +96,239 @@ func (util *AWSDiskUtil) AttachAndMountDisk(b *awsElasticBlockStoreBuilder, glob // Unmounts the device and detaches the disk from the kubelet's host machine. func (util *AWSDiskUtil) DetachDisk(c *awsElasticBlockStoreCleaner) error { - // Unmount the global PD mount, which should be the only one. - globalPDPath := makeGlobalPDPath(c.plugin.host, c.volumeID) - if err := c.mounter.Unmount(globalPDPath); err != nil { - glog.V(2).Info("Error unmount dir ", globalPDPath, ": ", err) - return err - } - if err := os.Remove(globalPDPath); err != nil { - glog.V(2).Info("Error removing dir ", globalPDPath, ": ", err) - return err - } - // Detach the disk - volumes, err := c.getVolumeProvider() - if err != nil { - glog.V(2).Info("Error getting volume provider for volumeID ", c.volumeID, ": ", err) - return err - } - if err := volumes.DetachDisk("", c.volumeID); err != nil { - glog.V(2).Info("Error detaching disk ", c.volumeID, ": ", err) - return err + glog.V(5).Infof("DetachDisk(...) for PD %q\r\n", c.volumeID) + + if err := unmountPDAndRemoveGlobalPath(c); err != nil { + glog.Errorf("Error unmounting PD %q: %v", c.volumeID, err) } + + // Detach disk asynchronously so that the kubelet sync loop is not blocked. + go detachDiskAndVerify(c) return nil } func (util *AWSDiskUtil) DeleteVolume(d *awsElasticBlockStoreDeleter) error { - volumes, err := d.getVolumeProvider() + cloud, err := getCloudProvider() if err != nil { - glog.V(2).Info("Error getting volume provider: ", err) return err } - if err := volumes.DeleteVolume(d.volumeID); err != nil { - glog.V(2).Infof("Error deleting AWS EBS volume %s: %v", d.volumeID, err) + deleted, err := cloud.DeleteDisk(d.volumeID) + if err != nil { + glog.V(2).Infof("Error deleting EBS Disk volume %s: %v", d.volumeID, err) return err } - glog.V(2).Infof("Successfully deleted AWS EBS volume %s", d.volumeID) + if deleted { + glog.V(2).Infof("Successfully deleted EBS Disk volume %s", d.volumeID) + } else { + glog.V(2).Infof("Successfully deleted EBS Disk volume %s (actually already deleted)", d.volumeID) + } return nil } func (util *AWSDiskUtil) CreateVolume(c *awsElasticBlockStoreProvisioner) (volumeID string, volumeSizeGB int, err error) { - volumes, err := c.getVolumeProvider() + cloud, err := getCloudProvider() if err != nil { - glog.V(2).Info("Error getting volume provider: ", err) return "", 0, err } requestBytes := c.options.Capacity.Value() - // AWS works with gigabytes, convert to GiB with rounding up - requestGB := int(volume.RoundUpSize(requestBytes, 1024*1024*1024)) - volSpec := &aws_cloud.VolumeOptions{ - CapacityGB: requestGB, - Tags: c.options.CloudTags, - } + // The cloud provider works with gigabytes, convert to GiB with rounding up + requestGB := volume.RoundUpSize(requestBytes, 1024*1024*1024) - name, err := volumes.CreateVolume(volSpec) + volumeOptions := &aws.VolumeOptions{} + volumeOptions.CapacityGB = int(requestGB) + + name, err := cloud.CreateDisk(volumeOptions) if err != nil { - glog.V(2).Infof("Error creating AWS EBS volume: %v", err) + glog.V(2).Infof("Error creating EBS Disk volume: %v", err) return "", 0, err } - glog.V(2).Infof("Successfully created AWS EBS volume %s", name) - return name, requestGB, nil + glog.V(2).Infof("Successfully created EBS Disk volume %s", name) + return name, int(requestGB), nil +} + +// Attaches the specified persistent disk device to node, verifies that it is attached, and retries if it fails. +func attachDiskAndVerify(b *awsElasticBlockStoreBuilder, xvdBeforeSet sets.String) (string, error) { + var awsCloud *aws.AWSCloud + for numRetries := 0; numRetries < maxRetries; numRetries++ { + var err error + if awsCloud == nil { + awsCloud, err = getCloudProvider() + if err != nil || awsCloud == nil { + // Retry on error. See issue #11321 + glog.Errorf("Error getting AWSCloudProvider while detaching PD %q: %v", b.volumeID, err) + time.Sleep(errorSleepDuration) + continue + } + } + + if numRetries > 0 { + glog.Warningf("Retrying attach for EBS Disk %q (retry count=%v).", b.volumeID, numRetries) + } + + devicePath, err := awsCloud.AttachDisk(b.volumeID, b.plugin.host.GetHostName(), b.readOnly) + if err != nil { + glog.Errorf("Error attaching PD %q: %v", b.volumeID, err) + time.Sleep(errorSleepDuration) + continue + } + + devicePaths := getDiskByIdPaths(b.awsElasticBlockStore, devicePath) + + for numChecks := 0; numChecks < maxChecks; numChecks++ { + path, err := verifyDevicePath(devicePaths) + if err != nil { + // Log error, if any, and continue checking periodically. See issue #11321 + glog.Errorf("Error verifying EBS Disk (%q) is attached: %v", b.volumeID, err) + } else if path != "" { + // A device path has successfully been created for the PD + glog.Infof("Successfully attached EBS Disk %q.", b.volumeID) + return path, nil + } + + // Sleep then check again + glog.V(3).Infof("Waiting for EBS Disk %q to attach.", b.volumeID) + time.Sleep(checkSleepDuration) + } + } + + return "", fmt.Errorf("Could not attach EBS Disk %q. Timeout waiting for mount paths to be created.", b.volumeID) +} + +// Returns the first path that exists, or empty string if none exist. +func verifyDevicePath(devicePaths []string) (string, error) { + for _, path := range devicePaths { + if pathExists, err := pathExists(path); err != nil { + return "", fmt.Errorf("Error checking if path exists: %v", err) + } else if pathExists { + return path, nil + } + } + + return "", nil +} + +// Detaches the specified persistent disk device from node, verifies that it is detached, and retries if it fails. +// This function is intended to be called asynchronously as a go routine. +func detachDiskAndVerify(c *awsElasticBlockStoreCleaner) { + glog.V(5).Infof("detachDiskAndVerify(...) for pd %q. Will block for pending operations", c.volumeID) + defer runtime.HandleCrash() + + // Block execution until any pending attach/detach operations for this PD have completed + attachDetachMutex.LockKey(c.volumeID) + defer attachDetachMutex.UnlockKey(c.volumeID) + + glog.V(5).Infof("detachDiskAndVerify(...) for pd %q. Awake and ready to execute.", c.volumeID) + + var awsCloud *aws.AWSCloud + for numRetries := 0; numRetries < maxRetries; numRetries++ { + var err error + if awsCloud == nil { + awsCloud, err = getCloudProvider() + if err != nil || awsCloud == nil { + // Retry on error. See issue #11321 + glog.Errorf("Error getting AWSCloudProvider while detaching PD %q: %v", c.volumeID, err) + time.Sleep(errorSleepDuration) + continue + } + } + + if numRetries > 0 { + glog.Warningf("Retrying detach for EBS Disk %q (retry count=%v).", c.volumeID, numRetries) + } + + devicePath, err := awsCloud.DetachDisk(c.volumeID, c.plugin.host.GetHostName()) + if err != nil { + glog.Errorf("Error detaching PD %q: %v", c.volumeID, err) + time.Sleep(errorSleepDuration) + continue + } + + devicePaths := getDiskByIdPaths(c.awsElasticBlockStore, devicePath) + + for numChecks := 0; numChecks < maxChecks; numChecks++ { + allPathsRemoved, err := verifyAllPathsRemoved(devicePaths) + if err != nil { + // Log error, if any, and continue checking periodically. + glog.Errorf("Error verifying EBS Disk (%q) is detached: %v", c.volumeID, err) + } else if allPathsRemoved { + // All paths to the PD have been successfully removed + unmountPDAndRemoveGlobalPath(c) + glog.Infof("Successfully detached EBS Disk %q.", c.volumeID) + return + } + + // Sleep then check again + glog.V(3).Infof("Waiting for EBS Disk %q to detach.", c.volumeID) + time.Sleep(checkSleepDuration) + } + + } + + glog.Errorf("Failed to detach EBS Disk %q. One or more mount paths was not removed.", c.volumeID) +} + +// Unmount the global PD mount, which should be the only one, and delete it. +func unmountPDAndRemoveGlobalPath(c *awsElasticBlockStoreCleaner) error { + globalPDPath := makeGlobalPDPath(c.plugin.host, c.volumeID) + + err := c.mounter.Unmount(globalPDPath) + os.Remove(globalPDPath) + return err +} + +// Returns the first path that exists, or empty string if none exist. +func verifyAllPathsRemoved(devicePaths []string) (bool, error) { + allPathsRemoved := true + for _, path := range devicePaths { + if exists, err := pathExists(path); err != nil { + return false, fmt.Errorf("Error checking if path exists: %v", err) + } else { + allPathsRemoved = allPathsRemoved && !exists + } + } + + return allPathsRemoved, nil +} + +// Returns list of all paths for given EBS mount +// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id) +// Here it is mostly about applying the partition path +func getDiskByIdPaths(d *awsElasticBlockStore, devicePath string) []string { + devicePaths := []string{} + if devicePath != "" { + devicePaths = append(devicePaths, devicePath) + } + + if d.partition != "" { + for i, path := range devicePaths { + devicePaths[i] = path + diskPartitionSuffix + d.partition + } + } + + return devicePaths +} + +// Checks if the specified path exists +func pathExists(path string) (bool, error) { + _, err := os.Stat(path) + if err == nil { + return true, nil + } else if os.IsNotExist(err) { + return false, nil + } else { + return false, err + } +} + +// Return cloud provider +func getCloudProvider() (*aws.AWSCloud, error) { + awsCloudProvider, err := cloudprovider.GetCloudProvider("aws", nil) + if err != nil || awsCloudProvider == nil { + return nil, err + } + + // The conversion must be safe otherwise bug in GetCloudProvider() + return awsCloudProvider.(*aws.AWSCloud), nil } diff --git a/pkg/volume/azure_file/azure_file.go b/pkg/volume/azure_file/azure_file.go new file mode 100644 index 00000000000..662d027fe38 --- /dev/null +++ b/pkg/volume/azure_file/azure_file.go @@ -0,0 +1,234 @@ +/* +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. +*/ + +package azure_file + +import ( + "fmt" + "os" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/types" + "k8s.io/kubernetes/pkg/util/mount" + "k8s.io/kubernetes/pkg/util/strings" + "k8s.io/kubernetes/pkg/volume" + + "github.com/golang/glog" +) + +// This is the primary entrypoint for volume plugins. +func ProbeVolumePlugins() []volume.VolumePlugin { + return []volume.VolumePlugin{&azureFilePlugin{nil}} +} + +type azureFilePlugin struct { + host volume.VolumeHost +} + +var _ volume.VolumePlugin = &azureFilePlugin{} +var _ volume.PersistentVolumePlugin = &azureFilePlugin{} + +const ( + azureFilePluginName = "kubernetes.io/azure-file" +) + +func (plugin *azureFilePlugin) Init(host volume.VolumeHost) error { + plugin.host = host + return nil +} + +func (plugin *azureFilePlugin) Name() string { + return azureFilePluginName +} + +func (plugin *azureFilePlugin) CanSupport(spec *volume.Spec) bool { + //TODO: check if mount.cifs is there + return (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.AzureFile != nil) || + (spec.Volume != nil && spec.Volume.AzureFile != nil) +} + +func (plugin *azureFilePlugin) GetAccessModes() []api.PersistentVolumeAccessMode { + return []api.PersistentVolumeAccessMode{ + api.ReadWriteOnce, + api.ReadOnlyMany, + api.ReadWriteMany, + } +} + +func (plugin *azureFilePlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.VolumeOptions) (volume.Builder, error) { + return plugin.newBuilderInternal(spec, pod, &azureSvc{}, plugin.host.GetMounter()) +} + +func (plugin *azureFilePlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, util azureUtil, mounter mount.Interface) (volume.Builder, error) { + var source *api.AzureFileVolumeSource + var readOnly bool + if spec.Volume != nil && spec.Volume.AzureFile != nil { + source = spec.Volume.AzureFile + readOnly = spec.Volume.AzureFile.ReadOnly + } else { + source = spec.PersistentVolume.Spec.AzureFile + readOnly = spec.ReadOnly + } + return &azureFileBuilder{ + azureFile: &azureFile{ + volName: spec.Name(), + mounter: mounter, + pod: pod, + plugin: plugin, + }, + util: util, + secretName: source.SecretName, + shareName: source.ShareName, + readOnly: readOnly, + }, nil +} + +func (plugin *azureFilePlugin) NewCleaner(volName string, podUID types.UID) (volume.Cleaner, error) { + return plugin.newCleanerInternal(volName, podUID, plugin.host.GetMounter()) +} + +func (plugin *azureFilePlugin) newCleanerInternal(volName string, podUID types.UID, mounter mount.Interface) (volume.Cleaner, error) { + return &azureFileCleaner{&azureFile{ + volName: volName, + mounter: mounter, + pod: &api.Pod{ObjectMeta: api.ObjectMeta{UID: podUID}}, + plugin: plugin, + }}, nil +} + +// azureFile volumes represent mount of an AzureFile share. +type azureFile struct { + volName string + pod *api.Pod + mounter mount.Interface + plugin *azureFilePlugin + volume.MetricsNil +} + +func (azureFileVolume *azureFile) GetPath() string { + name := azureFilePluginName + return azureFileVolume.plugin.host.GetPodVolumeDir(azureFileVolume.pod.UID, strings.EscapeQualifiedNameForDisk(name), azureFileVolume.volName) +} + +type azureFileBuilder struct { + *azureFile + util azureUtil + secretName string + shareName string + readOnly bool +} + +var _ volume.Builder = &azureFileBuilder{} + +func (b *azureFileBuilder) GetAttributes() volume.Attributes { + return volume.Attributes{ + ReadOnly: b.readOnly, + Managed: !b.readOnly, + SupportsSELinux: false, + } +} + +// SetUp attaches the disk and bind mounts to the volume path. +func (b *azureFileBuilder) SetUp(fsGroup *int64) error { + return b.SetUpAt(b.GetPath(), fsGroup) +} + +func (b *azureFileBuilder) SetUpAt(dir string, fsGroup *int64) error { + notMnt, err := b.mounter.IsLikelyNotMountPoint(dir) + glog.V(4).Infof("AzureFile mount set up: %s %v %v", dir, !notMnt, err) + if err != nil && !os.IsNotExist(err) { + return err + } + if !notMnt { + return nil + } + var accountKey, accountName string + if accountName, accountKey, err = b.util.GetAzureCredentials(b.plugin.host, b.pod.Namespace, b.secretName, b.shareName); err != nil { + return err + } + os.MkdirAll(dir, 0750) + source := fmt.Sprintf("//%s.file.core.windows.net/%s", accountName, b.shareName) + // parameters suggested by https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/ + options := []string{fmt.Sprintf("vers=3.0,username=%s,password=%s,dir_mode=0777,file_mode=0777", accountName, accountKey)} + if b.readOnly { + options = append(options, "ro") + } + err = b.mounter.Mount(source, dir, "cifs", options) + if err != nil { + notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir) + if mntErr != nil { + glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr) + return err + } + if !notMnt { + if mntErr = b.mounter.Unmount(dir); mntErr != nil { + glog.Errorf("Failed to unmount: %v", mntErr) + return err + } + notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir) + if mntErr != nil { + glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr) + return err + } + if !notMnt { + // This is very odd, we don't expect it. We'll try again next sync loop. + glog.Errorf("%s is still mounted, despite call to unmount(). Will try again next sync loop.", dir) + return err + } + } + os.Remove(dir) + return err + } + return nil +} + +var _ volume.Cleaner = &azureFileCleaner{} + +type azureFileCleaner struct { + *azureFile +} + +func (c *azureFileCleaner) TearDown() error { + return c.TearDownAt(c.GetPath()) +} + +func (c *azureFileCleaner) TearDownAt(dir string) error { + notMnt, err := c.mounter.IsLikelyNotMountPoint(dir) + if err != nil { + glog.Errorf("Error checking IsLikelyNotMountPoint: %v", err) + return err + } + if notMnt { + return os.Remove(dir) + } + + if err := c.mounter.Unmount(dir); err != nil { + glog.Errorf("Unmounting failed: %v", err) + return err + } + notMnt, mntErr := c.mounter.IsLikelyNotMountPoint(dir) + if mntErr != nil { + glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr) + return mntErr + } + if notMnt { + if err := os.Remove(dir); err != nil { + return err + } + } + + return nil +} diff --git a/pkg/volume/azure_file/azure_file_test.go b/pkg/volume/azure_file/azure_file_test.go new file mode 100644 index 00000000000..4d3a30273a7 --- /dev/null +++ b/pkg/volume/azure_file/azure_file_test.go @@ -0,0 +1,239 @@ +/* +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. +*/ + +package azure_file + +import ( + "io/ioutil" + "os" + "path" + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/client/testing/fake" + "k8s.io/kubernetes/pkg/types" + "k8s.io/kubernetes/pkg/util/mount" + "k8s.io/kubernetes/pkg/volume" +) + +func TestCanSupport(t *testing.T) { + tmpDir, err := ioutil.TempDir(os.TempDir(), "azureFileTest") + if err != nil { + t.Fatalf("can't make a temp dir: %v", err) + } + defer os.RemoveAll(tmpDir) + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(tmpDir, nil, nil)) + + plug, err := plugMgr.FindPluginByName("kubernetes.io/azure-file") + if err != nil { + t.Errorf("Can't find the plugin by name") + } + if plug.Name() != "kubernetes.io/azure-file" { + t.Errorf("Wrong name: %s", plug.Name()) + } + if !plug.CanSupport(&volume.Spec{Volume: &api.Volume{VolumeSource: api.VolumeSource{AzureFile: &api.AzureFileVolumeSource{}}}}) { + t.Errorf("Expected true") + } + if !plug.CanSupport(&volume.Spec{PersistentVolume: &api.PersistentVolume{Spec: api.PersistentVolumeSpec{PersistentVolumeSource: api.PersistentVolumeSource{AzureFile: &api.AzureFileVolumeSource{}}}}}) { + t.Errorf("Expected true") + } +} + +func TestGetAccessModes(t *testing.T) { + tmpDir, err := ioutil.TempDir(os.TempDir(), "azureFileTest") + if err != nil { + t.Fatalf("can't make a temp dir: %v", err) + } + defer os.RemoveAll(tmpDir) + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(tmpDir, nil, nil)) + + plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/azure-file") + if err != nil { + t.Errorf("Can't find the plugin by name") + } + if !contains(plug.GetAccessModes(), api.ReadWriteOnce) || !contains(plug.GetAccessModes(), api.ReadOnlyMany) || !contains(plug.GetAccessModes(), api.ReadWriteMany) { + t.Errorf("Expected three AccessModeTypes: %s, %s, and %s", api.ReadWriteOnce, api.ReadOnlyMany, api.ReadWriteMany) + } +} + +func contains(modes []api.PersistentVolumeAccessMode, mode api.PersistentVolumeAccessMode) bool { + for _, m := range modes { + if m == mode { + return true + } + } + return false +} + +func TestPlugin(t *testing.T) { + tmpDir, err := ioutil.TempDir(os.TempDir(), "azurefileTest") + if err != nil { + t.Fatalf("can't make a temp dir: %v", err) + } + defer os.RemoveAll(tmpDir) + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(tmpDir, nil, nil)) + + plug, err := plugMgr.FindPluginByName("kubernetes.io/azure-file") + if err != nil { + t.Errorf("Can't find the plugin by name") + } + spec := &api.Volume{ + Name: "vol1", + VolumeSource: api.VolumeSource{ + AzureFile: &api.AzureFileVolumeSource{ + SecretName: "secret", + ShareName: "share", + }, + }, + } + fake := &mount.FakeMounter{} + pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: types.UID("poduid")}} + builder, err := plug.(*azureFilePlugin).newBuilderInternal(volume.NewSpecFromVolume(spec), pod, &fakeAzureSvc{}, fake) + if err != nil { + t.Errorf("Failed to make a new Builder: %v", err) + } + if builder == nil { + t.Errorf("Got a nil Builder") + } + volPath := path.Join(tmpDir, "pods/poduid/volumes/kubernetes.io~azure-file/vol1") + path := builder.GetPath() + if path != volPath { + t.Errorf("Got unexpected path: %s", path) + } + + if err := builder.SetUp(nil); err != nil { + t.Errorf("Expected success, got: %v", err) + } + if _, err := os.Stat(path); err != nil { + if os.IsNotExist(err) { + t.Errorf("SetUp() failed, volume path not created: %s", path) + } else { + t.Errorf("SetUp() failed: %v", err) + } + } + if _, err := os.Stat(path); err != nil { + if os.IsNotExist(err) { + t.Errorf("SetUp() failed, volume path not created: %s", path) + } else { + t.Errorf("SetUp() failed: %v", err) + } + } + + cleaner, err := plug.(*azureFilePlugin).newCleanerInternal("vol1", types.UID("poduid"), &mount.FakeMounter{}) + if err != nil { + t.Errorf("Failed to make a new Cleaner: %v", err) + } + if cleaner == nil { + t.Errorf("Got a nil Cleaner") + } + + if err := cleaner.TearDown(); err != nil { + t.Errorf("Expected success, got: %v", err) + } + if _, err := os.Stat(path); err == nil { + t.Errorf("TearDown() failed, volume path still exists: %s", path) + } else if !os.IsNotExist(err) { + t.Errorf("SetUp() failed: %v", err) + } +} + +func TestPersistentClaimReadOnlyFlag(t *testing.T) { + pv := &api.PersistentVolume{ + ObjectMeta: api.ObjectMeta{ + Name: "pvA", + }, + Spec: api.PersistentVolumeSpec{ + PersistentVolumeSource: api.PersistentVolumeSource{ + AzureFile: &api.AzureFileVolumeSource{}, + }, + ClaimRef: &api.ObjectReference{ + Name: "claimA", + }, + }, + } + + claim := &api.PersistentVolumeClaim{ + ObjectMeta: api.ObjectMeta{ + Name: "claimA", + Namespace: "nsA", + }, + Spec: api.PersistentVolumeClaimSpec{ + VolumeName: "pvA", + }, + Status: api.PersistentVolumeClaimStatus{ + Phase: api.ClaimBound, + }, + } + + client := fake.NewSimpleClientset(pv, claim) + + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/tmp/fake", client, nil)) + plug, _ := plugMgr.FindPluginByName(azureFilePluginName) + + // readOnly bool is supplied by persistent-claim volume source when its builder creates other volumes + spec := volume.NewSpecFromPersistentVolume(pv, true) + pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: types.UID("poduid")}} + builder, _ := plug.NewBuilder(spec, pod, volume.VolumeOptions{}) + + if !builder.GetAttributes().ReadOnly { + t.Errorf("Expected true for builder.IsReadOnly") + } +} + +type fakeAzureSvc struct{} + +func (s *fakeAzureSvc) GetAzureCredentials(host volume.VolumeHost, nameSpace, secretName, shareName string) (string, string, error) { + return "name", "key", nil +} + +func TestBuilderAndCleanerTypeAssert(t *testing.T) { + tmpDir, err := ioutil.TempDir(os.TempDir(), "azurefileTest") + if err != nil { + t.Fatalf("can't make a temp dir: %v", err) + } + defer os.RemoveAll(tmpDir) + plugMgr := volume.VolumePluginMgr{} + plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(tmpDir, nil, nil)) + + plug, err := plugMgr.FindPluginByName("kubernetes.io/azure-file") + if err != nil { + t.Errorf("Can't find the plugin by name") + } + spec := &api.Volume{ + Name: "vol1", + VolumeSource: api.VolumeSource{ + AzureFile: &api.AzureFileVolumeSource{ + SecretName: "secret", + ShareName: "share", + }, + }, + } + fake := &mount.FakeMounter{} + pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: types.UID("poduid")}} + builder, err := plug.(*azureFilePlugin).newBuilderInternal(volume.NewSpecFromVolume(spec), pod, &fakeAzureSvc{}, fake) + if _, ok := builder.(volume.Cleaner); ok { + t.Errorf("Volume Builder can be type-assert to Cleaner") + } + + cleaner, err := plug.(*azureFilePlugin).newCleanerInternal("vol1", types.UID("poduid"), &mount.FakeMounter{}) + if _, ok := cleaner.(volume.Builder); ok { + t.Errorf("Volume Cleaner can be type-assert to Builder") + } +} diff --git a/pkg/volume/azure_file/azure_util.go b/pkg/volume/azure_file/azure_util.go new file mode 100644 index 00000000000..5d068c2c844 --- /dev/null +++ b/pkg/volume/azure_file/azure_util.go @@ -0,0 +1,55 @@ +/* +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. +*/ + +package azure_file + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/volume" +) + +// Abstract interface to azure file operations. +type azureUtil interface { + GetAzureCredentials(host volume.VolumeHost, nameSpace, secretName, shareName string) (string, string, error) +} + +type azureSvc struct{} + +func (s *azureSvc) GetAzureCredentials(host volume.VolumeHost, nameSpace, secretName, shareName string) (string, string, error) { + var accountKey, accountName string + kubeClient := host.GetKubeClient() + if kubeClient == nil { + return "", "", fmt.Errorf("Cannot get kube client") + } + + keys, err := kubeClient.Core().Secrets(nameSpace).Get(secretName) + if err != nil { + return "", "", fmt.Errorf("Couldn't get secret %v/%v", nameSpace, secretName) + } + for name, data := range keys.Data { + if name == "azurestorageaccountname" { + accountName = string(data) + } + if name == "azurestorageaccountkey" { + accountKey = string(data) + } + } + if accountName == "" || accountKey == "" { + return "", "", fmt.Errorf("Invalid %v/%v, couldn't extract azurestorageaccountname or azurestorageaccountkey", nameSpace, secretName) + } + return accountName, accountKey, nil +} diff --git a/pkg/volume/azure_file/doc.go b/pkg/volume/azure_file/doc.go new file mode 100644 index 00000000000..119e4579018 --- /dev/null +++ b/pkg/volume/azure_file/doc.go @@ -0,0 +1,19 @@ +/* +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. +*/ + +// Package azure_file contains the internal representation of +// Azure File Service Volume +package azure_file diff --git a/pkg/volume/cephfs/cephfs.go b/pkg/volume/cephfs/cephfs.go index e25b66f4327..1b0a3fb1143 100644 --- a/pkg/volume/cephfs/cephfs.go +++ b/pkg/volume/cephfs/cephfs.go @@ -74,7 +74,7 @@ func (plugin *cephfsPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume return nil, fmt.Errorf("Cannot get kube client") } - secretName, err := kubeClient.Legacy().Secrets(pod.Namespace).Get(cephvs.SecretRef.Name) + secretName, err := kubeClient.Core().Secrets(pod.Namespace).Get(cephvs.SecretRef.Name) if err != nil { err = fmt.Errorf("Couldn't get secret %v/%v err: %v", pod.Namespace, cephvs.SecretRef, err) return nil, err diff --git a/pkg/volume/cephfs/cephfs_test.go b/pkg/volume/cephfs/cephfs_test.go index 8fc8d16d2a4..d2bc201c235 100644 --- a/pkg/volume/cephfs/cephfs_test.go +++ b/pkg/volume/cephfs/cephfs_test.go @@ -81,7 +81,7 @@ func TestPlugin(t *testing.T) { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { - t.Errorf("Got a nil Builder: %v") + t.Errorf("Got a nil Builder") } volpath := path.Join(tmpDir, "pods/poduid/volumes/kubernetes.io~cephfs/vol1") path := builder.GetPath() @@ -103,7 +103,7 @@ func TestPlugin(t *testing.T) { t.Errorf("Failed to make a new Cleaner: %v", err) } if cleaner == nil { - t.Errorf("Got a nil Cleaner: %v") + t.Errorf("Got a nil Cleaner") } if err := cleaner.TearDown(); err != nil { t.Errorf("Expected success, got: %v", err) diff --git a/pkg/volume/cinder/cinder_test.go b/pkg/volume/cinder/cinder_test.go index d138ae920dc..a3727ec42de 100644 --- a/pkg/volume/cinder/cinder_test.go +++ b/pkg/volume/cinder/cinder_test.go @@ -158,7 +158,7 @@ func TestPlugin(t *testing.T) { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { - t.Errorf("Got a nil Builder: %v") + t.Errorf("Got a nil Builder") } volPath := path.Join(tmpDir, "pods/poduid/volumes/kubernetes.io~cinder/vol1") path := builder.GetPath() @@ -189,7 +189,7 @@ func TestPlugin(t *testing.T) { t.Errorf("Failed to make a new Cleaner: %v", err) } if cleaner == nil { - t.Errorf("Got a nil Cleaner: %v") + t.Errorf("Got a nil Cleaner") } if err := cleaner.TearDown(); err != nil { @@ -274,7 +274,7 @@ func TestAttachDetachRace(t *testing.T) { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { - t.Errorf("Got a nil Builder: %v") + t.Errorf("Got a nil Builder") } if err := builder.SetUp(nil); err != nil { @@ -288,7 +288,7 @@ func TestAttachDetachRace(t *testing.T) { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { - t.Errorf("Got a nil Builder: %v") + t.Errorf("Got a nil Builder") } cleaner, err := plug.(*cinderPlugin).newCleanerInternal("vol1", types.UID("poduid"), &fakePDManager{time.Second}, fakeMounter) @@ -337,7 +337,7 @@ func TestAttachDetachRace(t *testing.T) { t.Errorf("Failed to make a new Cleaner: %v", err) } if cleaner == nil { - t.Errorf("Got a nil Cleaner: %v") + t.Errorf("Got a nil Cleaner") } if err := cleaner.TearDown(); err != nil { diff --git a/pkg/volume/downwardapi/downwardapi_test.go b/pkg/volume/downwardapi/downwardapi_test.go index 2f3253b0efe..4b535dcaf94 100644 --- a/pkg/volume/downwardapi/downwardapi_test.go +++ b/pkg/volume/downwardapi/downwardapi_test.go @@ -24,7 +24,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/types" utiltesting "k8s.io/kubernetes/pkg/util/testing" diff --git a/pkg/volume/empty_dir/empty_dir_linux.go b/pkg/volume/empty_dir/empty_dir_linux.go index 3c1f2ccd514..d1ecf2b9344 100644 --- a/pkg/volume/empty_dir/empty_dir_linux.go +++ b/pkg/volume/empty_dir/empty_dir_linux.go @@ -46,7 +46,7 @@ func (m *realMountDetector) GetMountMedium(path string) (storageMedium, bool, er return 0, false, fmt.Errorf("statfs(%q): %v", path, err) } - glog.V(5).Info("Statfs_t of %v: %+v", path, buf) + glog.V(5).Infof("Statfs_t of %v: %+v", path, buf) if buf.Type == linuxTmpfsMagic { return mediumMemory, !notMnt, nil } diff --git a/pkg/volume/fc/fc_test.go b/pkg/volume/fc/fc_test.go index 606d89a7b9d..f7598989c00 100644 --- a/pkg/volume/fc/fc_test.go +++ b/pkg/volume/fc/fc_test.go @@ -144,7 +144,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) { t.Errorf("Failed to make a new Builder: %v", err) } if builder == nil { - t.Errorf("Got a nil Builder: %v") + t.Errorf("Got a nil Builder: %v", err) } path := builder.GetPath() @@ -181,7 +181,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) { t.Errorf("Failed to make a new Cleaner: %v", err) } if cleaner == nil { - t.Errorf("Got a nil Cleaner: %v") + t.Errorf("Got a nil Cleaner: %v", err) } if err := cleaner.TearDown(); err != nil { diff --git a/pkg/volume/flexvolume/flexvolume.go b/pkg/volume/flexvolume/flexvolume.go index 18845d4f32d..129bbb22447 100644 --- a/pkg/volume/flexvolume/flexvolume.go +++ b/pkg/volume/flexvolume/flexvolume.go @@ -110,7 +110,7 @@ func (plugin *flexVolumePlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ vo return nil, fmt.Errorf("Cannot get kube client") } - secretName, err := kubeClient.Legacy().Secrets(pod.Namespace).Get(fv.SecretRef.Name) + secretName, err := kubeClient.Core().Secrets(pod.Namespace).Get(fv.SecretRef.Name) if err != nil { err = fmt.Errorf("Couldn't get secret %v/%v err: %v", pod.Namespace, fv.SecretRef, err) return nil, err diff --git a/pkg/volume/gce_pd/gce_util.go b/pkg/volume/gce_pd/gce_util.go index 6be17336ad0..36719ab92ee 100644 --- a/pkg/volume/gce_pd/gce_util.go +++ b/pkg/volume/gce_pd/gce_util.go @@ -147,7 +147,7 @@ func (gceutil *GCEDiskUtil) CreateVolume(c *gcePersistentDiskProvisioner) (volum return "", 0, err } - err = cloud.CreateDisk(name, zone.FailureDomain, int64(requestGB)) + err = cloud.CreateDisk(name, zone.FailureDomain, int64(requestGB), *c.options.CloudTags) if err != nil { glog.V(2).Infof("Error creating GCE PD volume: %v", err) return "", 0, err @@ -262,7 +262,7 @@ func detachDiskAndVerify(c *gcePersistentDiskCleaner) { // Log error, if any, and continue checking periodically. glog.Errorf("Error verifying GCE PD (%q) is detached: %v", c.pdName, err) } else if allPathsRemoved { - // All paths to the PD have been succefully removed + // All paths to the PD have been successfully removed unmountPDAndRemoveGlobalPath(c) glog.Infof("Successfully detached GCE PD %q.", c.pdName) return diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index b9706f8bb32..f6f92a8b79c 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -85,7 +85,7 @@ func (plugin *glusterfsPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ vol source, _ := plugin.getGlusterVolumeSource(spec) ep_name := source.EndpointsName ns := pod.Namespace - ep, err := plugin.host.GetKubeClient().Legacy().Endpoints(ns).Get(ep_name) + ep, err := plugin.host.GetKubeClient().Core().Endpoints(ns).Get(ep_name) if err != nil { glog.Errorf("glusterfs: failed to get endpoints %s[%v]", ep_name, err) return nil, err diff --git a/pkg/volume/metrics_cached.go b/pkg/volume/metrics_cached.go new file mode 100644 index 00000000000..35923de5f37 --- /dev/null +++ b/pkg/volume/metrics_cached.go @@ -0,0 +1,69 @@ +/* +Copyright 2014 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. +*/ + +package volume + +import ( + "sync" + "sync/atomic" +) + +var _ MetricsProvider = &cachedMetrics{} + +// cachedMetrics represents a MetricsProvider that wraps another provider and caches the result. +type cachedMetrics struct { + wrapped MetricsProvider + resultError error + resultMetrics *Metrics + once cacheOnce +} + +// NewCachedMetrics creates a new cachedMetrics wrapping another MetricsProvider and caching the results. +func NewCachedMetrics(provider MetricsProvider) MetricsProvider { + return &cachedMetrics{wrapped: provider} +} + +// See MetricsProvider.GetMetrics +// Runs GetMetrics Once and caches the result. Will not cache result if there is an error. +func (md *cachedMetrics) GetMetrics() (*Metrics, error) { + md.once.cache(func() error { + md.resultMetrics, md.resultError = md.wrapped.GetMetrics() + return md.resultError + }) + return md.resultMetrics, md.resultError +} + +// Copied from sync.Once but we don't want to cache the results if there is an error +type cacheOnce struct { + m sync.Mutex + done uint32 +} + +// Copied from sync.Once but we don't want to cache the results if there is an error +func (o *cacheOnce) cache(f func() error) { + if atomic.LoadUint32(&o.done) == 1 { + return + } + // Slow-path. + o.m.Lock() + defer o.m.Unlock() + if o.done == 0 { + err := f() + if err == nil { + atomic.StoreUint32(&o.done, 1) + } + } +} diff --git a/pkg/volume/mock_volume.go b/pkg/volume/mock_volume.go new file mode 100644 index 00000000000..f6313553863 --- /dev/null +++ b/pkg/volume/mock_volume.go @@ -0,0 +1,62 @@ +/* +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. +*/ + +package volume + +import "github.com/stretchr/testify/mock" + +// ORIGINALLY GENERATED BY mockery with hand edits + +type MockVolume struct { + mock.Mock +} + +// GetPath provides a mock function with given fields: +func (_m *MockVolume) GetPath() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetMetrics provides a mock function with given fields: +func (_m *MockVolume) GetMetrics() (*Metrics, error) { + ret := _m.Called() + + var r0 *Metrics + if rf, ok := ret.Get(0).(func() *Metrics); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*Metrics) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/pkg/volume/persistent_claim/persistent_claim.go b/pkg/volume/persistent_claim/persistent_claim.go index b6448885d9d..d74e0d9556f 100644 --- a/pkg/volume/persistent_claim/persistent_claim.go +++ b/pkg/volume/persistent_claim/persistent_claim.go @@ -54,7 +54,7 @@ func (plugin *persistentClaimPlugin) CanSupport(spec *volume.Spec) bool { } func (plugin *persistentClaimPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Builder, error) { - claim, err := plugin.host.GetKubeClient().Legacy().PersistentVolumeClaims(pod.Namespace).Get(spec.Volume.PersistentVolumeClaim.ClaimName) + claim, err := plugin.host.GetKubeClient().Core().PersistentVolumeClaims(pod.Namespace).Get(spec.Volume.PersistentVolumeClaim.ClaimName) if err != nil { glog.Errorf("Error finding claim: %+v\n", spec.Volume.PersistentVolumeClaim.ClaimName) return nil, err @@ -64,7 +64,7 @@ func (plugin *persistentClaimPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, return nil, fmt.Errorf("The claim %+v is not yet bound to a volume", claim.Name) } - pv, err := plugin.host.GetKubeClient().Legacy().PersistentVolumes().Get(claim.Spec.VolumeName) + pv, err := plugin.host.GetKubeClient().Core().PersistentVolumes().Get(claim.Spec.VolumeName) if err != nil { glog.Errorf("Error finding persistent volume for claim: %+v\n", claim.Name) return nil, err diff --git a/pkg/volume/persistent_claim/persistent_claim_test.go b/pkg/volume/persistent_claim/persistent_claim_test.go index 8854ad0f690..83d962dd9ea 100644 --- a/pkg/volume/persistent_claim/persistent_claim_test.go +++ b/pkg/volume/persistent_claim/persistent_claim_test.go @@ -23,7 +23,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/types" utilstrings "k8s.io/kubernetes/pkg/util/strings" diff --git a/pkg/volume/plugins.go b/pkg/volume/plugins.go index 99dfa056ed2..8880c154cdd 100644 --- a/pkg/volume/plugins.go +++ b/pkg/volume/plugins.go @@ -24,7 +24,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/types" utilerrors "k8s.io/kubernetes/pkg/util/errors" @@ -117,6 +117,14 @@ type ProvisionableVolumePlugin interface { NewProvisioner(options VolumeOptions) (Provisioner, error) } +// AttachableVolumePlugin is an extended interface of VolumePlugin and is used for volumes that require attachment +// to a node before mounting. +type AttachableVolumePlugin interface { + VolumePlugin + NewAttacher(spec *Spec) (Attacher, error) + NewDetacher(name string, podUID types.UID) (Detacher, error) +} + // VolumeHost is an interface that plugins can use to access the kubelet. type VolumeHost interface { // GetPluginDir returns the absolute path to a directory under which @@ -384,6 +392,34 @@ func (pm *VolumePluginMgr) FindCreatablePluginBySpec(spec *Spec) (ProvisionableV return nil, fmt.Errorf("no creatable volume plugin matched") } +// FindAttachablePluginBySpec fetches a persistent volume plugin by name. Unlike the other "FindPlugin" methods, this +// does not return error if no plugin is found. All volumes require a builder and cleaner, but not every volume will +// have an attacher/detacher. +func (pm *VolumePluginMgr) FindAttachablePluginBySpec(spec *Spec) (AttachableVolumePlugin, error) { + volumePlugin, err := pm.FindPluginBySpec(spec) + if err != nil { + return nil, err + } + if attachableVolumePlugin, ok := volumePlugin.(AttachableVolumePlugin); ok { + return attachableVolumePlugin, nil + } + return nil, nil +} + +// FindAttachablePluginByName fetches an attachable volume plugin by name. Unlike the other "FindPlugin" methods, this +// does not return error if no plugin is found. All volumes require a builder and cleaner, but not every volume will +// have an attacher/detacher. +func (pm *VolumePluginMgr) FindAttachablePluginByName(name string) (AttachableVolumePlugin, error) { + volumePlugin, err := pm.FindPluginByName(name) + if err != nil { + return nil, err + } + if attachablePlugin, ok := volumePlugin.(AttachableVolumePlugin); ok { + return attachablePlugin, nil + } + return nil, nil +} + // NewPersistentVolumeRecyclerPodTemplate creates a template for a recycler pod. By default, a recycler pod simply runs // "rm -rf" on a volume and tests for emptiness. Most attributes of the template will be correct for most // plugin implementations. The following attributes can be overridden per plugin via configuration: diff --git a/pkg/volume/rbd/rbd.go b/pkg/volume/rbd/rbd.go index a2bf2d32726..5cb7cc11745 100644 --- a/pkg/volume/rbd/rbd.go +++ b/pkg/volume/rbd/rbd.go @@ -84,7 +84,7 @@ func (plugin *rbdPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.Vo return nil, fmt.Errorf("Cannot get kube client") } - secretName, err := kubeClient.Legacy().Secrets(pod.Namespace).Get(source.SecretRef.Name) + secretName, err := kubeClient.Core().Secrets(pod.Namespace).Get(source.SecretRef.Name) if err != nil { glog.Errorf("Couldn't get secret %v/%v", pod.Namespace, source.SecretRef) return nil, err diff --git a/pkg/volume/secret/secret.go b/pkg/volume/secret/secret.go index 05ebae8f11f..0f17d66eefa 100644 --- a/pkg/volume/secret/secret.go +++ b/pkg/volume/secret/secret.go @@ -72,7 +72,7 @@ func (plugin *secretPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, opts vol plugin, plugin.host.GetMounter(), plugin.host.GetWriter(), - volume.MetricsNil{}, + volume.NewCachedMetrics(volume.NewMetricsDu(getPathFromHost(plugin.host, pod.UID, spec.Name()))), }, secretName: spec.Volume.Secret.SecretName, pod: *pod, @@ -88,7 +88,7 @@ func (plugin *secretPlugin) NewCleaner(volName string, podUID types.UID) (volume plugin, plugin.host.GetMounter(), plugin.host.GetWriter(), - volume.MetricsNil{}, + volume.NewCachedMetrics(volume.NewMetricsDu(getPathFromHost(plugin.host, podUID, volName))), }, }, nil } @@ -99,13 +99,17 @@ type secretVolume struct { plugin *secretPlugin mounter mount.Interface writer ioutil.Writer - volume.MetricsNil + volume.MetricsProvider } var _ volume.Volume = &secretVolume{} func (sv *secretVolume) GetPath() string { - return sv.plugin.host.GetPodVolumeDir(sv.podUID, strings.EscapeQualifiedNameForDisk(secretPluginName), sv.volName) + return getPathFromHost(sv.plugin.host, sv.podUID, sv.volName) +} + +func getPathFromHost(host volume.VolumeHost, podUID types.UID, volName string) string { + return host.GetPodVolumeDir(podUID, strings.EscapeQualifiedNameForDisk(secretPluginName), volName) } // secretVolumeBuilder handles retrieving secrets from the API server @@ -165,7 +169,7 @@ func (b *secretVolumeBuilder) SetUpAt(dir string, fsGroup *int64) error { return fmt.Errorf("Cannot setup secret volume %v because kube client is not configured", b.volName) } - secret, err := kubeClient.Legacy().Secrets(b.pod.Namespace).Get(b.secretName) + secret, err := kubeClient.Core().Secrets(b.pod.Namespace).Get(b.secretName) if err != nil { glog.Errorf("Couldn't get secret %v/%v", b.pod.Namespace, b.secretName) return err diff --git a/pkg/volume/secret/secret_test.go b/pkg/volume/secret/secret_test.go index 81449b55055..2dc52023928 100644 --- a/pkg/volume/secret/secret_test.go +++ b/pkg/volume/secret/secret_test.go @@ -24,8 +24,9 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/mount" @@ -121,6 +122,11 @@ func TestPlugin(t *testing.T) { } } doTestSecretDataInVolume(volumePath, secret, t) + + metrics, err := builder.GetMetrics() + assert.NotEmpty(t, metrics) + assert.NoError(t, err) + doTestCleanAndTeardown(plugin, testPodUID, testVolumeName, volumePath, t) } diff --git a/pkg/volume/testing.go b/pkg/volume/testing.go index 79c072a53cd..3990fb884fa 100644 --- a/pkg/volume/testing.go +++ b/pkg/volume/testing.go @@ -26,7 +26,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util" @@ -134,12 +134,15 @@ type FakeVolumePlugin struct { Host VolumeHost Config VolumeConfig LastProvisionerOptions VolumeOptions + NewAttacherCallCount int + NewDetacherCallCount int } var _ VolumePlugin = &FakeVolumePlugin{} var _ RecyclableVolumePlugin = &FakeVolumePlugin{} var _ DeletableVolumePlugin = &FakeVolumePlugin{} var _ ProvisionableVolumePlugin = &FakeVolumePlugin{} +var _ AttachableVolumePlugin = &FakeVolumePlugin{} func (plugin *FakeVolumePlugin) Init(host VolumeHost) error { plugin.Host = host @@ -163,6 +166,16 @@ func (plugin *FakeVolumePlugin) NewCleaner(volName string, podUID types.UID) (Cl return &FakeVolume{podUID, volName, plugin, MetricsNil{}}, nil } +func (plugin *FakeVolumePlugin) NewAttacher(spec *Spec) (Attacher, error) { + plugin.NewAttacherCallCount = plugin.NewAttacherCallCount + 1 + return &FakeVolume{}, nil +} + +func (plugin *FakeVolumePlugin) NewDetacher(name string, podUID types.UID) (Detacher, error) { + plugin.NewDetacherCallCount = plugin.NewDetacherCallCount + 1 + return &FakeVolume{}, nil +} + func (plugin *FakeVolumePlugin) NewRecycler(spec *Spec) (Recycler, error) { return &fakeRecycler{"/attributesTransferredFromSpec", MetricsNil{}}, nil } @@ -215,6 +228,14 @@ func (fv *FakeVolume) TearDownAt(dir string) error { return os.RemoveAll(dir) } +func (fv *FakeVolume) Attach() error { + return nil +} + +func (fv *FakeVolume) Detach() error { + return nil +} + type fakeRecycler struct { path string MetricsNil diff --git a/pkg/volume/util.go b/pkg/volume/util.go index 3078e24830d..544dfbf9da4 100644 --- a/pkg/volume/util.go +++ b/pkg/volume/util.go @@ -22,7 +22,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" @@ -89,15 +89,15 @@ type realRecyclerClient struct { } func (c *realRecyclerClient) CreatePod(pod *api.Pod) (*api.Pod, error) { - return c.client.Legacy().Pods(pod.Namespace).Create(pod) + return c.client.Core().Pods(pod.Namespace).Create(pod) } func (c *realRecyclerClient) GetPod(name, namespace string) (*api.Pod, error) { - return c.client.Legacy().Pods(namespace).Get(name) + return c.client.Core().Pods(namespace).Get(name) } func (c *realRecyclerClient) DeletePod(name, namespace string) error { - return c.client.Legacy().Pods(namespace).Delete(name, nil) + return c.client.Core().Pods(namespace).Delete(name, nil) } // WatchPod returns a ListWatch for watching a pod. The stopChannel is used @@ -109,11 +109,11 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s podLW := &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = fieldSelector - return c.client.Legacy().Pods(namespace).List(options) + return c.client.Core().Pods(namespace).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = fieldSelector - return c.client.Legacy().Pods(namespace).Watch(options) + return c.client.Core().Pods(namespace).Watch(options) }, } queue := cache.NewFIFO(cache.MetaNamespaceKeyFunc) diff --git a/pkg/volume/util/atomic_writer.go b/pkg/volume/util/atomic_writer.go new file mode 100644 index 00000000000..6059837ed03 --- /dev/null +++ b/pkg/volume/util/atomic_writer.go @@ -0,0 +1,457 @@ +/* +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. +*/ + +package util + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path" + "path/filepath" + "strings" + "time" + + "github.com/golang/glog" + + "k8s.io/kubernetes/pkg/util/sets" +) + +const ( + maxFileNameLength = 255 + maxPathLength = 4096 +) + +// AtomicWriter handles atomically projecting content for a set of files into +// a target directory. AtomicWriter maintains a sentinel file named +// "..sentinel" in the target directory which is updated after new data is +// projected into the target directory, allowing consumers of the data to +// listen for updates by monitoring the sentinel file with inotify or +// fanotify. +// +// Note: +// +// 1. AtomicWriter reserves the set of pathnames starting with `..`. +// 2. AtomicWriter offers no concurrency guarantees and must be synchronized +// by the caller. +// +// The visible files in this volume are symlinks to files in the writer's data +// directory. Actual files are stored in a hidden timestamped directory which +// is symlinked to by the data directory. The timestamped directory and +// data directory symlink are created in the writer's target dir.  This scheme +// allows the files to be atomically updated by changing the target of the +// data directory symlink. +type AtomicWriter struct { + targetDir string + logContext string +} + +// NewAtomicWriter creates a new AtomicWriter configured to write to the given +// target directory, or returns an error if the target directory does not exist. +func NewAtomicWriter(targetDir, logContext string) (*AtomicWriter, error) { + _, err := os.Stat(targetDir) + if os.IsNotExist(err) { + return nil, err + } + + return &AtomicWriter{targetDir: targetDir, logContext: logContext}, nil +} + +const ( + sentinelFileName = "..sentinel" + dataDirName = "..data" + newDataDirName = "..data_tmp" +) + +// Write does an atomic projection of the given payload into the writer's target +// directory. Input paths must not begin with '..'. +// +// The Write algorithm is: +// +// 1. The payload is validated; if the payload is invalid, the function returns +// 2. The user-visible portion of the volume is walked to determine whether any +// portion of the payload was deleted and is still present on disk. +// If the payload is already present on disk and there are no deleted files, +// the function returns +// 3. A check is made to determine whether data present in the payload has changed +// 4.  A new timestamped dir is created +// 5. The payload is written to the new timestamped directory +// 6.  Symlinks and directory for new user-visible files are created (if needed). +// +// For example consider the files: +// /podName +// /user/labels +// /k8s/annotations +// +// The user visible files are symbolic links into the internal data directory: +// /podName -> ..data/podName +// /usr/labels -> ../..data/usr/labels +// /k8s/annotations -> ../..data/k8s/annotations +// +// Relative links are created into the data directory for files in subdirectories. +// +// The data directory itself is a link to a timestamped directory with +// the real data: +// /..data -> ..2016_02_01_15_04_05.12345678/ +// 7.  The current timestamped directory is detected by reading the data directory +// symlink +// 8.  A symlink to the new timestamped directory ..data_tmp is created that will +// become the new data directory +// 9.  The new data directory symlink is renamed to the data directory; rename is atomic +// 10. The sentinel file modification and access times are updated (file is created if it does not +// already exist) +// 11. Old paths are removed from the user-visible portion of the target directory +// 12.  The previous timestamped directory is removed, if it exists +func (w *AtomicWriter) Write(payload map[string][]byte) error { + // (1) + cleanPayload, err := validatePayload(payload) + if err != nil { + glog.Errorf("%s: invalid payload: %v", w.logContext, err) + return err + } + + // (2) + pathsToRemove, err := w.pathsToRemove(cleanPayload) + if err != nil { + glog.Errorf("%s: error determining user-visible files to remove: %v", w.logContext, err) + return err + } + + // (3) + if should, err := w.shouldWritePayload(cleanPayload); err != nil { + glog.Errorf("%s: error determining whether payload should be written to disk: %v", w.logContext, err) + return err + } else if !should && len(pathsToRemove) == 0 { + glog.V(5).Infof("%s: no update required for target directory %v", w.logContext, w.targetDir) + return nil + } + + // (4) + tsDir, err := w.newTimestampDir() + if err != nil { + glog.V(5).Infof("%s: error creating new ts data directory: %v", w.logContext, err) + return err + } + + // (5) + if err = w.writePayloadToDir(cleanPayload, tsDir); err != nil { + glog.Errorf("%s: error writing payload to ts data directory %s: %v", w.logContext, tsDir, err) + return err + } + + // (6) + if err = w.createUserVisibleFiles(cleanPayload); err != nil { + glog.Errorf("%s: error creating visible symlinks in %s: %v", w.logContext, w.targetDir, err) + return err + } + + // (7) + _, tsDirName := filepath.Split(tsDir) + dataDirPath := path.Join(w.targetDir, dataDirName) + oldTsDir, err := os.Readlink(dataDirPath) + if err != nil && !os.IsNotExist(err) { + glog.Errorf("%s: error reading link for data directory: %v", w.logContext, err) + return err + } + + // (8) + newDataDirPath := path.Join(w.targetDir, newDataDirName) + if err = os.Symlink(tsDirName, newDataDirPath); err != nil { + os.RemoveAll(tsDir) + glog.Errorf("%s: error creating symbolic link for atomic update: %v", w.logContext, err) + return err + } + + // (9) + if err = os.Rename(newDataDirPath, dataDirPath); err != nil { + os.Remove(newDataDirPath) + os.RemoveAll(tsDir) + glog.Errorf("%s: error renaming symbolic link for data directory %s: %v", w.logContext, newDataDirPath, err) + return err + } + + // (10) + if err = w.touchSentinelFile(); err != nil { + glog.Errorf("%s: error touching sentinel file: %v", w.logContext, err) + return err + } + + // (11) + if err = w.removeUserVisiblePaths(pathsToRemove); err != nil { + glog.Errorf("%s: error removing old visible symlinks: %v", w.logContext, err) + return err + } + + // (12) + if len(oldTsDir) > 0 { + if err = os.RemoveAll(path.Join(w.targetDir, oldTsDir)); err != nil { + glog.Errorf("%s: error removing old data directory %s: %v", w.logContext, oldTsDir, err) + return err + } + } + + return nil +} + +// validatePayload returns an error if any path in the payload returns a copy of the payload with the paths cleaned. +func validatePayload(payload map[string][]byte) (map[string][]byte, error) { + cleanPayload := make(map[string][]byte) + for k, content := range payload { + if err := validatePath(k); err != nil { + return nil, err + } + + cleanPayload[path.Clean(k)] = content + } + + return cleanPayload, nil +} + +// validatePath validates a single path, returning an error if the path is +// invalid. paths may not: +// +// 1. be absolute +// 2. contain '..' as an element +// 3. start with '..' +// 4. contain filenames larger than 255 characters +// 5. be longer than 4096 characters +func validatePath(targetPath string) error { + // TODO: somehow unify this with the similar api validation, + // validateVolumeSourcePath; the error semantics are just different enough + // from this that it was time-prohibitive trying to find the right + // refactoring to re-use. + if targetPath == "" { + return fmt.Errorf("invalid path: must not be empty: %q", targetPath) + } + if path.IsAbs(targetPath) { + return fmt.Errorf("invalid path: must be relative path: %s", targetPath) + } + + if len(targetPath) > maxPathLength { + return fmt.Errorf("invalid path: must be less than %d characters", maxPathLength) + } + + items := strings.Split(targetPath, string(os.PathSeparator)) + for _, item := range items { + if item == ".." { + return fmt.Errorf("invalid path: must not contain '..': %s", targetPath) + } + if len(item) > maxFileNameLength { + return fmt.Errorf("invalid path: filenames must be less than %d characters", maxFileNameLength) + } + } + if strings.HasPrefix(items[0], "..") && len(items[0]) > 2 { + return fmt.Errorf("invalid path: must not start with '..': %s", targetPath) + } + + return nil +} + +// shouldWritePayload returns whether the payload should be written to disk. +func (w *AtomicWriter) shouldWritePayload(payload map[string][]byte) (bool, error) { + for userVisiblePath, content := range payload { + shouldWrite, err := w.shouldWriteFile(path.Join(w.targetDir, userVisiblePath), content) + if err != nil { + return false, err + } + + if shouldWrite { + return true, nil + } + } + + return false, nil +} + +// shouldWriteFile returns whether a new version of a file should be written to disk. +func (w *AtomicWriter) shouldWriteFile(path string, content []byte) (bool, error) { + _, err := os.Lstat(path) + if os.IsNotExist(err) { + return true, nil + } + + contentOnFs, err := ioutil.ReadFile(path) + if err != nil { + return false, err + } + + return (bytes.Compare(content, contentOnFs) != 0), nil +} + +// pathsToRemove walks the user-visible portion of the target directory and +// determines which paths should be removed (if any) after the payload is +// written to the target directory. +func (w *AtomicWriter) pathsToRemove(payload map[string][]byte) (sets.String, error) { + paths := sets.NewString() + visitor := func(path string, info os.FileInfo, err error) error { + if path == w.targetDir { + return nil + } + + relativePath := strings.TrimPrefix(path, w.targetDir) + relativePath = strings.TrimPrefix(relativePath, "/") + if strings.HasPrefix(relativePath, "..") { + return nil + } + + paths.Insert(relativePath) + return nil + } + + err := filepath.Walk(w.targetDir, visitor) + if os.IsNotExist(err) { + return nil, nil + } else if err != nil { + return nil, err + } + glog.V(5).Infof("%s: current paths: %+v", w.targetDir, paths.List()) + + newPaths := sets.NewString() + for file := range payload { + // add all subpaths for the payload to the set of new paths + // to avoid attempting to remove non-empty dirs + for subPath := file; subPath != ""; { + newPaths.Insert(subPath) + subPath, _ = filepath.Split(subPath) + subPath = strings.TrimSuffix(subPath, "/") + } + } + glog.V(5).Infof("%s: new paths: %+v", w.targetDir, newPaths.List()) + + result := paths.Difference(newPaths) + glog.V(5).Infof("%s: paths to remove: %+v", w.targetDir, result) + + return result, nil +} + +// newTimestampDir creates a new timestamp directory +func (w *AtomicWriter) newTimestampDir() (string, error) { + tsDir, err := ioutil.TempDir(w.targetDir, fmt.Sprintf("..%s.", time.Now().Format("1981_02_01_15_04_05"))) + if err != nil { + glog.Errorf("%s: unable to create new temp directory: %v", w.logContext, err) + return "", err + } + + return tsDir, nil +} + +// writePayloadToDir writes the given payload to the given directory. The +// directory must exist. +func (w *AtomicWriter) writePayloadToDir(payload map[string][]byte, dir string) error { + for userVisiblePath, content := range payload { + fullPath := path.Join(dir, userVisiblePath) + baseDir, _ := filepath.Split(fullPath) + + err := os.MkdirAll(baseDir, os.ModePerm) + if err != nil { + glog.Errorf("%s: unable to create directory %s: %v", w.logContext, baseDir, err) + return err + } + + err = ioutil.WriteFile(fullPath, content, 0644) + if err != nil { + glog.Errorf("%s: unable to write file %s: %v", w.logContext, fullPath, err) + return err + } + } + + return nil +} + +// createUserVisibleFiles creates the relative symlinks for all the +// files configured in the payload. If the directory in a file path does not +// exist, it is created. +// +// Viz: +// For files: "bar", "foo/bar", "baz/bar", "foo/baz/blah" +// the following symlinks and subdirectories are created: +// bar -> ..data/bar +// foo/bar -> ../..data/foo/bar +// baz/bar -> ../..data/baz/bar +// foo/baz/blah -> ../../..data/foo/baz/blah +func (w *AtomicWriter) createUserVisibleFiles(payload map[string][]byte) error { + for userVisiblePath := range payload { + dir, _ := filepath.Split(userVisiblePath) + subDirs := 0 + if len(dir) > 0 { + // If dir is not empty, the projection path contains at least one + // subdirectory (example: userVisiblePath := "foo/bar"). + // Since filepath.Split leaves a trailing path separator, in this + // example, dir = "foo/". In order to calculate the number of + // subdirectories, we must subtract 1 from the number returned by split. + subDirs = len(strings.Split(dir, "/")) - 1 + err := os.MkdirAll(path.Join(w.targetDir, dir), os.ModePerm) + if err != nil { + return err + } + } + _, err := os.Readlink(path.Join(w.targetDir, userVisiblePath)) + if err != nil && os.IsNotExist(err) { + // The link into the data directory for this path doesn't exist; create it, + // respecting the number of subdirectories necessary to link + // correctly back into the data directory. + visibleFile := path.Join(w.targetDir, userVisiblePath) + dataDirFile := path.Join(strings.Repeat("../", subDirs), dataDirName, userVisiblePath) + + err = os.Symlink(dataDirFile, visibleFile) + if err != nil { + return err + } + } + } + + return nil +} + +// removeUserVisiblePaths removes the set of paths from the user-visible +// portion of the writer's target directory. +func (w *AtomicWriter) removeUserVisiblePaths(paths sets.String) error { + orderedPaths := paths.List() + for ii := len(orderedPaths) - 1; ii >= 0; ii-- { + if err := os.Remove(path.Join(w.targetDir, orderedPaths[ii])); err != nil { + glog.Errorf("%s: error pruning old user-visible path %s: %v", w.logContext, orderedPaths[ii], err) + return err + } + } + + return nil +} + +// touchSentinelFile touches the sentinel file or creates it if it doesn't exist. +func (w *AtomicWriter) touchSentinelFile() error { + sentinelFilePath := path.Join(w.targetDir, sentinelFileName) + _, err := os.Stat(sentinelFilePath) + if err != nil && os.IsNotExist(err) { + file, err := os.Create(sentinelFilePath) + if err != nil { + glog.Errorf("%s: unexpected error creating sentinel file %s: %v", w.logContext, sentinelFilePath, err) + return err + } + file.Close() + } else if err != nil { + return err + } + + ts := time.Now() + err = os.Chtimes(sentinelFilePath, ts, ts) + if err != nil { + glog.Errorf("%s: error updating sentinel file mod time: %v", w.logContext, err) + return err + } + + return nil +} diff --git a/pkg/volume/util/atomic_writer_test.go b/pkg/volume/util/atomic_writer_test.go new file mode 100644 index 00000000000..3caf195e4b7 --- /dev/null +++ b/pkg/volume/util/atomic_writer_test.go @@ -0,0 +1,852 @@ +/* +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. +*/ + +package util + +import ( + "encoding/base64" + "io/ioutil" + "os" + "path" + "path/filepath" + "reflect" + "strings" + "testing" + "time" + + "k8s.io/kubernetes/pkg/util/sets" + utiltesting "k8s.io/kubernetes/pkg/util/testing" +) + +func TestNewAtomicWriter(t *testing.T) { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Fatalf("unexpected error creating tmp dir: %v", err) + } + + _, err = NewAtomicWriter(targetDir, "-test-") + if err != nil { + t.Fatalf("unexpected error creating writer for existing target dir: %v", err) + } + + nonExistentDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Fatalf("unexpected error creating tmp dir: %v", err) + } + err = os.Remove(nonExistentDir) + if err != nil { + t.Fatalf("unexpected error ensuring dir %v does not exist: %v", nonExistentDir, err) + } + + _, err = NewAtomicWriter(nonExistentDir, "-test-") + if err == nil { + t.Fatalf("unexpected success creating writer for nonexistent target dir: %v", err) + } +} + +func TestValidatePath(t *testing.T) { + maxPath := strings.Repeat("a", maxPathLength+1) + maxFile := strings.Repeat("a", maxFileNameLength+1) + + cases := []struct { + name string + path string + valid bool + }{ + { + name: "valid 1", + path: "i/am/well/behaved.txt", + valid: true, + }, + { + name: "valid 2", + path: "keepyourheaddownandfollowtherules.txt", + valid: true, + }, + { + name: "max path length", + path: maxPath, + valid: false, + }, + { + name: "max file length", + path: maxFile, + valid: false, + }, + { + name: "absolute failure", + path: "/dev/null", + valid: false, + }, + { + name: "reserved path", + path: "..sneaky.txt", + valid: false, + }, + { + name: "contains doubledot 1", + path: "hello/there/../../../../../../etc/passwd", + valid: false, + }, + { + name: "contains doubledot 2", + path: "hello/../etc/somethingbad", + valid: false, + }, + { + name: "empty", + path: "", + valid: false, + }, + } + + for _, tc := range cases { + err := validatePath(tc.path) + if tc.valid && err != nil { + t.Errorf("%v: unexpected failure: %v", tc.name, err) + continue + } + + if !tc.valid && err == nil { + t.Errorf("%v: unexpected success", tc.name) + } + } +} + +func TestPathsToRemove(t *testing.T) { + cases := []struct { + name string + payload1 map[string][]byte + payload2 map[string][]byte + expected sets.String + }{ + { + name: "simple", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "bar.txt": []byte("bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + }, + expected: sets.NewString("bar.txt"), + }, + { + name: "simple 2", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zip/bar.txt": []byte("zip/bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + }, + expected: sets.NewString("zip/bar.txt", "zip"), + }, + { + name: "subdirs 1", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zip/zap/bar.txt": []byte("zip/bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + }, + expected: sets.NewString("zip/zap/bar.txt", "zip", "zip/zap"), + }, + { + name: "subdirs 2", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zip/1/2/3/4/bar.txt": []byte("zip/bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + }, + expected: sets.NewString("zip/1/2/3/4/bar.txt", "zip", "zip/1", "zip/1/2", "zip/1/2/3", "zip/1/2/3/4"), + }, + { + name: "subdirs 3", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zip/1/2/3/4/bar.txt": []byte("zip/bar"), + "zap/a/b/c/bar.txt": []byte("zap/bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + }, + expected: sets.NewString("zip/1/2/3/4/bar.txt", "zip", "zip/1", "zip/1/2", "zip/1/2/3", "zip/1/2/3/4", "zap", "zap/a", "zap/a/b", "zap/a/b/c", "zap/a/b/c/bar.txt"), + }, + { + name: "subdirs 4", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zap/1/2/3/4/bar.txt": []byte("zip/bar"), + "zap/1/2/c/bar.txt": []byte("zap/bar"), + "zap/1/2/magic.txt": []byte("indigo"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + "zap/1/2/magic.txt": []byte("indigo"), + }, + expected: sets.NewString("zap/1/2/3/4/bar.txt", "zap/1/2/3", "zap/1/2/3/4", "zap/1/2/3/4/bar.txt", "zap/1/2/c", "zap/1/2/c/bar.txt"), + }, + { + name: "subdirs 5", + payload1: map[string][]byte{ + "foo.txt": []byte("foo"), + "zap/1/2/3/4/bar.txt": []byte("zip/bar"), + "zap/1/2/c/bar.txt": []byte("zap/bar"), + }, + payload2: map[string][]byte{ + "foo.txt": []byte("foo"), + "zap/1/2/magic.txt": []byte("indigo"), + }, + expected: sets.NewString("zap/1/2/3/4/bar.txt", "zap/1/2/3", "zap/1/2/3/4", "zap/1/2/3/4/bar.txt", "zap/1/2/c", "zap/1/2/c/bar.txt"), + }, + } + + for _, tc := range cases { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Errorf("%v: unexpected error creating tmp dir: %v", tc.name, err) + continue + } + + writer := &AtomicWriter{targetDir: targetDir, logContext: "-test-"} + err = writer.Write(tc.payload1) + if err != nil { + t.Errorf("%v: unexpected error writing: %v", tc.name, err) + continue + } + + actual, err := writer.pathsToRemove(tc.payload2) + if err != nil { + t.Errorf("%v: unexpected error determining paths to remove: %v", tc.name, err) + continue + } + + if e, a := tc.expected, actual; !e.Equal(a) { + t.Errorf("%v: unexpected paths to remove:\nexpected: %v\n got: %v", tc.name, e, a) + } + } +} + +func TestWriteOnce(t *testing.T) { + // $1 if you can tell me what this binary is + encodedMysteryBinary := `f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAeABAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAOAAB +AAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAfQAAAAAAAAB9AAAAAAAAAAAA +IAAAAAAAsDyZDwU=` + + mysteryBinaryBytes := make([]byte, base64.StdEncoding.DecodedLen(len(encodedMysteryBinary))) + numBytes, err := base64.StdEncoding.Decode(mysteryBinaryBytes, []byte(encodedMysteryBinary)) + if err != nil { + t.Fatalf("Unexpected error decoding binary payload: %v", err) + } + + if numBytes != 125 { + t.Fatalf("Unexpected decoded binary size: expected 125, got %v", numBytes) + } + + cases := []struct { + name string + payload map[string][]byte + success bool + }{ + { + name: "invalid payload 1", + payload: map[string][]byte{ + "foo": []byte("foo"), + "..bar": []byte("bar"), + "binary.bin": mysteryBinaryBytes, + }, + success: false, + }, + { + name: "invalid payload 2", + payload: map[string][]byte{ + "foo/../bar": []byte("foo"), + }, + success: false, + }, + { + name: "basic 1", + payload: map[string][]byte{ + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + success: true, + }, + { + name: "basic 2", + payload: map[string][]byte{ + "binary.bin": mysteryBinaryBytes, + ".binary.bin": mysteryBinaryBytes, + }, + success: true, + }, + { + name: "dotfiles", + payload: map[string][]byte{ + "foo": []byte("foo"), + "bar": []byte("bar"), + ".dotfile": []byte("dotfile"), + ".dotfile.file": []byte("dotfile.file"), + }, + success: true, + }, + { + name: "subdirectories 1", + payload: map[string][]byte{ + "foo/bar.txt": []byte("foo/bar"), + "bar/zab.txt": []byte("bar/zab.txt"), + }, + success: true, + }, + { + name: "subdirectories 2", + payload: map[string][]byte{ + "foo//bar.txt": []byte("foo//bar"), + "bar///bar/zab.txt": []byte("bar/../bar/zab.txt"), + }, + success: true, + }, + { + name: "subdirectories 3", + payload: map[string][]byte{ + "foo/bar.txt": []byte("foo/bar"), + "bar/zab.txt": []byte("bar/zab.txt"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt"), + }, + success: true, + }, + { + name: "kitchen sink", + payload: map[string][]byte{ + "foo.log": []byte("foo"), + "bar.zap": []byte("bar"), + ".dotfile": []byte("dotfile"), + "foo/bar.txt": []byte("foo/bar"), + "bar/zab.txt": []byte("bar/zab.txt"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt"), + "1/2/3/4/5/6/7/8/9/10/.dotfile.lib": []byte("1-2-3-dotfile"), + }, + success: true, + }, + } + + for _, tc := range cases { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Errorf("%v: unexpected error creating tmp dir: %v", tc.name, err) + continue + } + + writer := &AtomicWriter{targetDir: targetDir, logContext: "-test-"} + err = writer.Write(tc.payload) + if err != nil && tc.success { + t.Errorf("%v: unexpected error writing payload: %v", tc.name, err) + continue + } else if err == nil && !tc.success { + t.Errorf("%v: unexpected success", tc.name) + continue + } else if err != nil { + continue + } + + checkVolumeContents(targetDir, tc.name, tc.payload, t) + checkSentinelFile(targetDir, t) + } +} + +func TestUpdate(t *testing.T) { + cases := []struct { + name string + first map[string][]byte + next map[string][]byte + shouldWrite bool + }{ + { + name: "update", + first: map[string][]byte{ + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + next: map[string][]byte{ + "foo": []byte("foo2"), + "bar": []byte("bar2"), + }, + shouldWrite: true, + }, + { + name: "no update", + first: map[string][]byte{ + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + next: map[string][]byte{ + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + shouldWrite: false, + }, + { + name: "no update 2", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + shouldWrite: false, + }, + { + name: "add 1", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + "blu/zip.txt": []byte("zip"), + }, + shouldWrite: true, + }, + { + name: "add 2", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + "blu/two/2/3/4/5/zip.txt": []byte("zip"), + }, + shouldWrite: true, + }, + { + name: "add 3", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + "bar/2/3/4/5/zip.txt": []byte("zip"), + }, + shouldWrite: true, + }, + { + name: "delete 1", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + }, + shouldWrite: true, + }, + { + name: "delete 2", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/3/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + }, + shouldWrite: true, + }, + { + name: "delete 3", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/sip.txt": []byte("sip"), + "bar/1/2/3/zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/sip.txt": []byte("sip"), + }, + shouldWrite: true, + }, + { + name: "delete 4", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/sip.txt": []byte("sip"), + "bar/1/2/3/4/5/6zab.txt": []byte("bar"), + }, + next: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/sip.txt": []byte("sip"), + }, + shouldWrite: true, + }, + { + name: "delete all", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + "bar/1/2/sip.txt": []byte("sip"), + "bar/1/2/3/4/5/6zab.txt": []byte("bar"), + }, + next: map[string][]byte{}, + shouldWrite: true, + }, + { + name: "add and delete 1", + first: map[string][]byte{ + "foo/bar.txt": []byte("foo"), + }, + next: map[string][]byte{ + "bar/baz.txt": []byte("baz"), + }, + shouldWrite: true, + }, + } + + for _, tc := range cases { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Errorf("%v: unexpected error creating tmp dir: %v", tc.name, err) + continue + } + + writer := &AtomicWriter{targetDir: targetDir, logContext: "-test-"} + + err = writer.Write(tc.first) + if err != nil { + t.Errorf("%v: unexpected error writing: %v", tc.name, err) + continue + } + + checkVolumeContents(targetDir, tc.name, tc.first, t) + if !tc.shouldWrite { + continue + } + + oldTs := checkSentinelFile(targetDir, t) + + err = writer.Write(tc.next) + if err != nil { + if tc.shouldWrite { + t.Errorf("%v: unexpected error writing: %v", tc.name, err) + continue + } + } else if !tc.shouldWrite { + t.Errorf("%v: unexpected success", tc.name) + continue + } + + checkVolumeContents(targetDir, tc.name, tc.next, t) + + ts := checkSentinelFile(targetDir, t) + if !ts.After(oldTs) { + t.Errorf("Unexpected timestamp on sentinel file; expected %v to be after %v", ts, oldTs) + } + } +} + +func TestMultipleUpdates(t *testing.T) { + cases := []struct { + name string + payloads []map[string][]byte + clearSentinel bool + }{ + { + name: "update 1", + payloads: []map[string][]byte{ + { + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + { + "foo": []byte("foo2"), + "bar": []byte("bar2"), + }, + { + "foo": []byte("foo3"), + "bar": []byte("bar3"), + }, + }, + }, + { + name: "update 2", + payloads: []map[string][]byte{ + { + "foo/bar.txt": []byte("foo/bar"), + "bar/zab.txt": []byte("bar/zab.txt"), + }, + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + }, + }, + }, + { + name: "clear sentinel", + payloads: []map[string][]byte{ + { + "foo": []byte("foo"), + "bar": []byte("bar"), + }, + { + "foo": []byte("foo2"), + "bar": []byte("bar2"), + }, + { + "foo": []byte("foo3"), + "bar": []byte("bar3"), + }, + { + "foo": []byte("foo4"), + "bar": []byte("bar4"), + }, + }, + clearSentinel: true, + }, + { + name: "subdirectories 2", + payloads: []map[string][]byte{ + { + "foo/bar.txt": []byte("foo/bar"), + "bar/zab.txt": []byte("bar/zab.txt"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt"), + }, + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar2"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt2"), + }, + }, + }, + { + name: "add 1", + payloads: []map[string][]byte{ + { + "foo/bar.txt": []byte("foo/bar"), + "bar//zab.txt": []byte("bar/zab.txt"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar"), + "bar/zib////zib/zab.txt": []byte("bar/zib/zab.txt"), + }, + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar2"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt2"), + "add/new/keys.txt": []byte("addNewKeys"), + }, + }, + }, + { + name: "add 2", + payloads: []map[string][]byte{ + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar2"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt2"), + "add/new/keys.txt": []byte("addNewKeys"), + }, + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar2"), + "bar/zib/zab.txt": []byte("bar/zib/zab.txt2"), + "add/new/keys.txt": []byte("addNewKeys"), + "add/new/keys2.txt": []byte("addNewKeys2"), + "add/new/keys3.txt": []byte("addNewKeys3"), + }, + }, + }, + { + name: "remove 1", + payloads: []map[string][]byte{ + { + "foo/bar.txt": []byte("foo/bar"), + "bar//zab.txt": []byte("bar/zab.txt"), + "foo/blaz/bar.txt": []byte("foo/blaz/bar"), + "zip/zap/zup/fop.txt": []byte("zip/zap/zup/fop.txt"), + }, + { + "foo/bar.txt": []byte("foo/bar2"), + "bar/zab.txt": []byte("bar/zab.txt2"), + }, + { + "foo/bar.txt": []byte("foo/bar"), + }, + }, + }, + } + + for _, tc := range cases { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Errorf("%v: unexpected error creating tmp dir: %v", tc.name, err) + continue + } + + var oldTs *time.Time = nil + writer := &AtomicWriter{targetDir: targetDir, logContext: "-test-"} + + for ii, payload := range tc.payloads { + writer.Write(payload) + + checkVolumeContents(targetDir, tc.name, payload, t) + ts := checkSentinelFile(targetDir, t) + + if oldTs != nil && !ts.After(*oldTs) { + t.Errorf("%v[%v] unexpected timestamp on sentinel file; expected %v to be after %v", tc.name, ii, ts, oldTs) + } + oldTs = &ts + + if tc.clearSentinel { + clearSentinelFile(targetDir, t) + } + } + } +} + +func TestSentinelFileModTimeIncreasing(t *testing.T) { + cases := []struct { + name string + iterations int + clearSentinelFile bool + }{ + { + name: "5 iters", + iterations: 5, + }, + { + name: "50 iters", + iterations: 50, + }, + { + name: "1000 iters", + iterations: 1000, + }, + { + name: "1000 clear sentinel", + iterations: 1000, + clearSentinelFile: true, + }, + { + name: "10000 clear sentinel", + iterations: 10000, + clearSentinelFile: true, + }, + } + + for _, tc := range cases { + targetDir, err := utiltesting.MkTmpdir("atomic-write") + if err != nil { + t.Errorf("%v: unexpected error creating tmp dir: %v", tc.name, err) + continue + } + + var oldTs *time.Time = nil + writer := &AtomicWriter{targetDir: targetDir, logContext: "-test-"} + + for i := 0; i < tc.iterations; i++ { + err = writer.touchSentinelFile() + if err != nil { + t.Errorf("%v: unexpected error touching sentinel file: %v", tc.name, err) + continue + } + + ts := checkSentinelFile(targetDir, t) + if oldTs != nil && !ts.After(*oldTs) { + t.Errorf("%v: unexpected timestamp on sentinel file; expected %v to be after %v", tc.name, ts, oldTs) + continue + } + oldTs = &ts + + if tc.clearSentinelFile { + clearSentinelFile(targetDir, t) + } + } + } +} + +func checkVolumeContents(targetDir, tcName string, payload map[string][]byte, t *testing.T) { + // use filepath.Walk to reconstruct the payload, then deep equal + observedPayload := map[string][]byte{} + visitor := func(path string, info os.FileInfo, err error) error { + if info.Mode().IsRegular() || info.IsDir() { + return nil + } + + relativePath := strings.TrimPrefix(path, targetDir) + relativePath = strings.TrimPrefix(relativePath, "/") + if strings.HasPrefix(relativePath, "..") { + return nil + } + + content, err := ioutil.ReadFile(path) + if err != nil { + return err + } + observedPayload[relativePath] = content + + return nil + } + + err := filepath.Walk(targetDir, visitor) + if err != nil { + t.Errorf("%v: unexpected error walking directory: %v", tcName, err) + } + + cleanPathPayload := make(map[string][]byte, len(payload)) + for k, v := range payload { + cleanPathPayload[path.Clean(k)] = v + } + + if !reflect.DeepEqual(cleanPathPayload, observedPayload) { + t.Errorf("%v: payload and observed payload do not match.", tcName) + } +} + +func checkSentinelFile(targetDir string, t *testing.T) time.Time { + sentinelFilePath := filepath.Join(targetDir, sentinelFileName) + info, err := os.Stat(sentinelFilePath) + if err != nil { + t.Errorf("Couldn't stat sentinel file for dir %v: %v", targetDir, err) + return time.Now() + } + + return info.ModTime() +} + +func clearSentinelFile(targetDir string, t *testing.T) { + sentinelFilePath := filepath.Join(targetDir, sentinelFileName) + _, err := os.Stat(sentinelFilePath) + if err != nil { + t.Errorf("Couldn't stat sentinel file for dir %v: %v", targetDir, err) + } + err = os.Remove(sentinelFilePath) + if err != nil { + t.Errorf("Error removing sentinel file: %v", err) + } +} diff --git a/pkg/volume/volume.go b/pkg/volume/volume.go index 9a851c32cd1..3bc37980536 100644 --- a/pkg/volume/volume.go +++ b/pkg/volume/volume.go @@ -81,7 +81,7 @@ type Builder interface { // 'fsGroup' so that it can be accessed by the pod. This may // be called more than once, so implementations must be // idempotent. - SetUpAt(dir string, sGroup *int64) error + SetUpAt(dir string, fsGroup *int64) error // GetAttributes returns the attributes of the builder. GetAttributes() Attributes } @@ -117,7 +117,7 @@ type Provisioner interface { NewPersistentVolumeTemplate() (*api.PersistentVolume, error) } -// Delete removes the resource from the underlying storage provider. Calls to this method should block until +// Deleter removes the resource from the underlying storage provider. Calls to this method should block until // the deletion is complete. Any error returned indicates the volume has failed to be reclaimed. // A nil return indicates success. type Deleter interface { @@ -126,6 +126,17 @@ type Deleter interface { Delete() error } +// Attacher can attach a volume to a node. +type Attacher interface { + Volume + Attach() error +} + +// Detacher can detach a volume from a node. +type Detacher interface { + Detach() error +} + func RenameDirectory(oldPath, newName string) (string, error) { newPath, err := ioutil.TempDir(path.Dir(oldPath), newName) if err != nil { diff --git a/pkg/watch/json/decoder_test.go b/pkg/watch/json/decoder_test.go index 39bb892dfae..ceb50b2ce0f 100644 --- a/pkg/watch/json/decoder_test.go +++ b/pkg/watch/json/decoder_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/watch" ) @@ -99,7 +99,7 @@ func TestDecoder_SourceClose(t *testing.T) { select { case <-done: break - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Error("Timeout") } } diff --git a/pkg/watch/mux_test.go b/pkg/watch/mux_test.go index 066b898bc4e..23976c06596 100644 --- a/pkg/watch/mux_test.go +++ b/pkg/watch/mux_test.go @@ -23,7 +23,7 @@ import ( "time" "k8s.io/kubernetes/pkg/api/unversioned" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" ) type myType struct { @@ -113,7 +113,7 @@ func TestBroadcasterWatcherStopDeadlock(t *testing.T) { }(m.Watch(), m.Watch()) m.Action(Added, &myType{}) select { - case <-time.After(util.ForeverTestTimeout): + case <-time.After(wait.ForeverTestTimeout): t.Error("timeout: deadlocked") case <-done: } diff --git a/plugin/cmd/kube-scheduler/app/options/options.go b/plugin/cmd/kube-scheduler/app/options/options.go index 4975d60d679..9696fe03bd8 100644 --- a/plugin/cmd/kube-scheduler/app/options/options.go +++ b/plugin/cmd/kube-scheduler/app/options/options.go @@ -20,8 +20,8 @@ package options import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/apis/componentconfig" + "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1" "k8s.io/kubernetes/pkg/client/leaderelection" - "k8s.io/kubernetes/pkg/master/ports" "k8s.io/kubernetes/plugin/pkg/scheduler/factory" "github.com/spf13/pflag" @@ -40,16 +40,10 @@ type SchedulerServer struct { // NewSchedulerServer creates a new SchedulerServer with default parameters func NewSchedulerServer() *SchedulerServer { + config := componentconfig.KubeSchedulerConfiguration{} + api.Scheme.Convert(&v1alpha1.KubeSchedulerConfiguration{}, &config) s := SchedulerServer{ - KubeSchedulerConfiguration: componentconfig.KubeSchedulerConfiguration{ - Port: ports.SchedulerPort, - Address: "0.0.0.0", - AlgorithmProvider: factory.DefaultProvider, - KubeAPIQPS: 50.0, - KubeAPIBurst: 100, - SchedulerName: api.DefaultSchedulerName, - LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(), - }, + KubeSchedulerConfiguration: config, } return &s } diff --git a/plugin/pkg/admission/admit/admission.go b/plugin/pkg/admission/admit/admission.go index 2df4e834899..dfbad5f71d9 100644 --- a/plugin/pkg/admission/admit/admission.go +++ b/plugin/pkg/admission/admit/admission.go @@ -19,12 +19,13 @@ package admit import ( "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" - client "k8s.io/kubernetes/pkg/client/unversioned" ) func init() { - admission.RegisterPlugin("AlwaysAdmit", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("AlwaysAdmit", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewAlwaysAdmit(), nil }) } diff --git a/plugin/pkg/admission/alwayspullimages/admission.go b/plugin/pkg/admission/alwayspullimages/admission.go index 7702b155d31..ee0a8d688eb 100644 --- a/plugin/pkg/admission/alwayspullimages/admission.go +++ b/plugin/pkg/admission/alwayspullimages/admission.go @@ -27,14 +27,15 @@ package alwayspullimages import ( "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" - client "k8s.io/kubernetes/pkg/client/unversioned" ) func init() { - admission.RegisterPlugin("AlwaysPullImages", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("AlwaysPullImages", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewAlwaysPullImages(), nil }) } diff --git a/plugin/pkg/admission/deny/admission.go b/plugin/pkg/admission/deny/admission.go index 8dc70d7751e..4eef85326e0 100644 --- a/plugin/pkg/admission/deny/admission.go +++ b/plugin/pkg/admission/deny/admission.go @@ -20,12 +20,13 @@ import ( "errors" "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" - client "k8s.io/kubernetes/pkg/client/unversioned" ) func init() { - admission.RegisterPlugin("AlwaysDeny", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("AlwaysDeny", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewAlwaysDeny(), nil }) } diff --git a/plugin/pkg/admission/exec/admission.go b/plugin/pkg/admission/exec/admission.go index 358dc37a397..737ee693672 100644 --- a/plugin/pkg/admission/exec/admission.go +++ b/plugin/pkg/admission/exec/admission.go @@ -20,21 +20,22 @@ import ( "fmt" "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/rest" - client "k8s.io/kubernetes/pkg/client/unversioned" ) func init() { - admission.RegisterPlugin("DenyEscalatingExec", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("DenyEscalatingExec", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewDenyEscalatingExec(client), nil }) // This is for legacy support of the DenyExecOnPrivileged admission controller. Most // of the time DenyEscalatingExec should be preferred. - admission.RegisterPlugin("DenyExecOnPrivileged", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("DenyExecOnPrivileged", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewDenyExecOnPrivileged(client), nil }) } @@ -43,7 +44,7 @@ func init() { // a pod using host based configurations. type denyExec struct { *admission.Handler - client client.Interface + client clientset.Interface // these flags control which items will be checked to deny exec/attach hostIPC bool @@ -53,7 +54,7 @@ type denyExec struct { // NewDenyEscalatingExec creates a new admission controller that denies an exec operation on a pod // using host based configurations. -func NewDenyEscalatingExec(client client.Interface) admission.Interface { +func NewDenyEscalatingExec(client clientset.Interface) admission.Interface { return &denyExec{ Handler: admission.NewHandler(admission.Connect), client: client, @@ -66,7 +67,7 @@ func NewDenyEscalatingExec(client client.Interface) admission.Interface { // NewDenyExecOnPrivileged creates a new admission controller that is only checking the privileged // option. This is for legacy support of the DenyExecOnPrivileged admission controller. Most // of the time NewDenyEscalatingExec should be preferred. -func NewDenyExecOnPrivileged(client client.Interface) admission.Interface { +func NewDenyExecOnPrivileged(client clientset.Interface) admission.Interface { return &denyExec{ Handler: admission.NewHandler(admission.Connect), client: client, @@ -85,7 +86,7 @@ func (d *denyExec) Admit(a admission.Attributes) (err error) { if connectRequest.ResourcePath != "pods/exec" && connectRequest.ResourcePath != "pods/attach" { return nil } - pod, err := d.client.Pods(a.GetNamespace()).Get(connectRequest.Name) + pod, err := d.client.Core().Pods(a.GetNamespace()).Get(connectRequest.Name) if err != nil { return admission.NewForbidden(a, err) } diff --git a/plugin/pkg/admission/exec/admission_test.go b/plugin/pkg/admission/exec/admission_test.go index 389eb3faac4..ec9eb5b261b 100644 --- a/plugin/pkg/admission/exec/admission_test.go +++ b/plugin/pkg/admission/exec/admission_test.go @@ -22,6 +22,8 @@ import ( "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/rest" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/runtime" ) @@ -87,8 +89,8 @@ func TestAdmission(t *testing.T) { } func testAdmission(t *testing.T, pod *api.Pod, handler *denyExec, shouldAccept bool) { - mockClient := &testclient.Fake{} - mockClient.AddReactor("get", "pods", func(action testclient.Action) (bool, runtime.Object, error) { + mockClient := &fake.Clientset{} + mockClient.AddReactor("get", "pods", func(action core.Action) (bool, runtime.Object, error) { if action.(testclient.GetAction).GetName() == pod.Name { return true, pod, nil } diff --git a/plugin/pkg/admission/initialresources/admission.go b/plugin/pkg/admission/initialresources/admission.go index 3099c5a29e5..751595de6b4 100644 --- a/plugin/pkg/admission/initialresources/admission.go +++ b/plugin/pkg/admission/initialresources/admission.go @@ -23,12 +23,13 @@ import ( "strings" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "github.com/golang/glog" "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" - client "k8s.io/kubernetes/pkg/client/unversioned" ) var ( @@ -46,7 +47,7 @@ const ( // WARNING: this feature is experimental and will definitely change. func init() { - admission.RegisterPlugin("InitialResources", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("InitialResources", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { s, err := newDataSource(*source) if err != nil { return nil, err diff --git a/plugin/pkg/admission/limitranger/admission.go b/plugin/pkg/admission/limitranger/admission.go index 775d75cf0e0..aed3e0e5e94 100644 --- a/plugin/pkg/admission/limitranger/admission.go +++ b/plugin/pkg/admission/limitranger/admission.go @@ -22,12 +22,13 @@ import ( "sort" "strings" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" utilerrors "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/watch" @@ -38,7 +39,7 @@ const ( ) func init() { - admission.RegisterPlugin("LimitRanger", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("LimitRanger", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewLimitRanger(client, Limit), nil }) } @@ -46,7 +47,7 @@ func init() { // limitRanger enforces usage limits on a per resource basis in the namespace type limitRanger struct { *admission.Handler - client client.Interface + client clientset.Interface limitFunc LimitFunc indexer cache.Indexer } @@ -94,13 +95,13 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) { } // NewLimitRanger returns an object that enforces limits based on the supplied limit function -func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Interface { +func NewLimitRanger(client clientset.Interface, limitFunc LimitFunc) admission.Interface { lw := &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return client.LimitRanges(api.NamespaceAll).List(options) + return client.Core().LimitRanges(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return client.LimitRanges(api.NamespaceAll).Watch(options) + return client.Core().LimitRanges(api.NamespaceAll).Watch(options) }, } indexer, reflector := cache.NewNamespaceKeyedIndexerAndReflector(lw, &api.LimitRange{}, 0) diff --git a/plugin/pkg/admission/limitranger/admission_test.go b/plugin/pkg/admission/limitranger/admission_test.go index 28b33305ada..f777410460e 100644 --- a/plugin/pkg/admission/limitranger/admission_test.go +++ b/plugin/pkg/admission/limitranger/admission_test.go @@ -24,7 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/client/cache" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" ) func getResourceList(cpu, memory string) api.ResourceList { @@ -429,7 +429,7 @@ func TestPodLimitFuncApplyDefault(t *testing.T) { } func TestLimitRangerIgnoresSubresource(t *testing.T) { - client := testclient.NewSimpleFake() + client := fake.NewSimpleClientset() indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{"namespace": cache.MetaNamespaceIndexFunc}) handler := &limitRanger{ Handler: admission.NewHandler(admission.Create, admission.Update), diff --git a/plugin/pkg/admission/namespace/autoprovision/admission.go b/plugin/pkg/admission/namespace/autoprovision/admission.go index df79f37735d..3ca166b3014 100644 --- a/plugin/pkg/admission/namespace/autoprovision/admission.go +++ b/plugin/pkg/admission/namespace/autoprovision/admission.go @@ -19,17 +19,18 @@ package autoprovision import ( "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" ) func init() { - admission.RegisterPlugin("NamespaceAutoProvision", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("NamespaceAutoProvision", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewProvision(client), nil }) } @@ -39,7 +40,7 @@ func init() { // It is useful in deployments that do not want to restrict creation of a namespace prior to its usage. type provision struct { *admission.Handler - client client.Interface + client clientset.Interface store cache.Store } @@ -65,7 +66,7 @@ func (p *provision) Admit(a admission.Attributes) (err error) { if exists { return nil } - _, err = p.client.Namespaces().Create(namespace) + _, err = p.client.Core().Namespaces().Create(namespace) if err != nil && !errors.IsAlreadyExists(err) { return admission.NewForbidden(a, err) } @@ -73,15 +74,15 @@ func (p *provision) Admit(a admission.Attributes) (err error) { } // NewProvision creates a new namespace provision admission control handler -func NewProvision(c client.Interface) admission.Interface { +func NewProvision(c clientset.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return c.Namespaces().List(options) + return c.Core().Namespaces().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(options) + return c.Core().Namespaces().Watch(options) }, }, &api.Namespace{}, @@ -92,7 +93,7 @@ func NewProvision(c client.Interface) admission.Interface { return createProvision(c, store) } -func createProvision(c client.Interface, store cache.Store) admission.Interface { +func createProvision(c clientset.Interface, store cache.Store) admission.Interface { return &provision{ Handler: admission.NewHandler(admission.Create), client: c, diff --git a/plugin/pkg/admission/namespace/autoprovision/admission_test.go b/plugin/pkg/admission/namespace/autoprovision/admission_test.go index 5fbaabe84ce..37d90695d0d 100644 --- a/plugin/pkg/admission/namespace/autoprovision/admission_test.go +++ b/plugin/pkg/admission/namespace/autoprovision/admission_test.go @@ -23,14 +23,15 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/runtime" ) // TestAdmission verifies a namespace is created on create requests for namespace managed resources func TestAdmission(t *testing.T) { namespace := "test" - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} handler := &provision{ client: mockClient, store: cache.NewStore(cache.MetaNamespaceKeyFunc), @@ -58,7 +59,7 @@ func TestAdmission(t *testing.T) { // TestAdmissionNamespaceExists verifies that no client call is made when a namespace already exists func TestAdmissionNamespaceExists(t *testing.T) { namespace := "test" - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} store := cache.NewStore(cache.MetaNamespaceKeyFunc) store.Add(&api.Namespace{ ObjectMeta: api.ObjectMeta{Name: namespace}, @@ -86,7 +87,7 @@ func TestAdmissionNamespaceExists(t *testing.T) { // TestIgnoreAdmission validates that a request is ignored if its not a create func TestIgnoreAdmission(t *testing.T) { namespace := "test" - mockClient := &testclient.Fake{} + mockClient := &fake.Clientset{} handler := admission.NewChainHandler(createProvision(mockClient, nil)) pod := api.Pod{ ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -107,8 +108,8 @@ func TestIgnoreAdmission(t *testing.T) { // TestAdmissionNamespaceExistsUnknownToHandler func TestAdmissionNamespaceExistsUnknownToHandler(t *testing.T) { namespace := "test" - mockClient := &testclient.Fake{} - mockClient.AddReactor("create", "namespaces", func(action testclient.Action) (bool, runtime.Object, error) { + mockClient := &fake.Clientset{} + mockClient.AddReactor("create", "namespaces", func(action core.Action) (bool, runtime.Object, error) { return true, nil, errors.NewAlreadyExists(api.Resource("namespaces"), namespace) }) diff --git a/plugin/pkg/admission/namespace/exists/admission.go b/plugin/pkg/admission/namespace/exists/admission.go index 2f3ffe5f280..a4b41290e60 100644 --- a/plugin/pkg/admission/namespace/exists/admission.go +++ b/plugin/pkg/admission/namespace/exists/admission.go @@ -20,17 +20,18 @@ import ( "io" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" ) func init() { - admission.RegisterPlugin("NamespaceExists", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("NamespaceExists", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewExists(client), nil }) } @@ -40,7 +41,7 @@ func init() { // It is useful in deployments that want to enforce pre-declaration of a Namespace resource. type exists struct { *admission.Handler - client client.Interface + client clientset.Interface store cache.Store } @@ -68,7 +69,7 @@ func (e *exists) Admit(a admission.Attributes) (err error) { } // in case of latency in our caches, make a call direct to storage to verify that it truly exists or not - _, err = e.client.Namespaces().Get(a.GetNamespace()) + _, err = e.client.Core().Namespaces().Get(a.GetNamespace()) if err != nil { if errors.IsNotFound(err) { return err @@ -80,15 +81,15 @@ func (e *exists) Admit(a admission.Attributes) (err error) { } // NewExists creates a new namespace exists admission control handler -func NewExists(c client.Interface) admission.Interface { +func NewExists(c clientset.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return c.Namespaces().List(options) + return c.Core().Namespaces().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(options) + return c.Core().Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/plugin/pkg/admission/namespace/lifecycle/admission.go b/plugin/pkg/admission/namespace/lifecycle/admission.go index 514d35f46d2..c42c172401d 100644 --- a/plugin/pkg/admission/namespace/lifecycle/admission.go +++ b/plugin/pkg/admission/namespace/lifecycle/admission.go @@ -21,18 +21,19 @@ import ( "io" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/watch" ) func init() { - admission.RegisterPlugin("NamespaceLifecycle", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("NamespaceLifecycle", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewLifecycle(client), nil }) } @@ -41,7 +42,7 @@ func init() { // It enforces life-cycle constraints around a Namespace depending on its Phase type lifecycle struct { *admission.Handler - client client.Interface + client clientset.Interface store cache.Store immortalNamespaces sets.String } @@ -72,7 +73,7 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) { // refuse to operate on non-existent namespaces if !exists { // in case of latency in our caches, make a call direct to storage to verify that it truly exists or not - namespaceObj, err = l.client.Namespaces().Get(a.GetNamespace()) + namespaceObj, err = l.client.Core().Namespaces().Get(a.GetNamespace()) if err != nil { if errors.IsNotFound(err) { return err @@ -96,15 +97,15 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) { } // NewLifecycle creates a new namespace lifecycle admission control handler -func NewLifecycle(c client.Interface) admission.Interface { +func NewLifecycle(c clientset.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return c.Namespaces().List(options) + return c.Core().Namespaces().List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(options) + return c.Core().Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/plugin/pkg/admission/namespace/lifecycle/admission_test.go b/plugin/pkg/admission/namespace/lifecycle/admission_test.go index 56edee51a53..524694516a9 100644 --- a/plugin/pkg/admission/namespace/lifecycle/admission_test.go +++ b/plugin/pkg/admission/namespace/lifecycle/admission_test.go @@ -24,6 +24,8 @@ import ( "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/cache" + "k8s.io/kubernetes/pkg/client/testing/core" + "k8s.io/kubernetes/pkg/client/testing/fake" "k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/runtime" ) @@ -43,8 +45,8 @@ func TestAdmission(t *testing.T) { store := cache.NewStore(cache.MetaNamespaceKeyFunc) store.Add(namespaceObj) - mockClient := testclient.NewSimpleFake() - mockClient.PrependReactor("get", "namespaces", func(action testclient.Action) (bool, runtime.Object, error) { + mockClient := fake.NewSimpleClientset() + mockClient.PrependReactor("get", "namespaces", func(action core.Action) (bool, runtime.Object, error) { namespaceLock.RLock() defer namespaceLock.RUnlock() if getAction, ok := action.(testclient.GetAction); ok && getAction.GetName() == namespaceObj.Name { @@ -52,7 +54,7 @@ func TestAdmission(t *testing.T) { } return true, nil, fmt.Errorf("No result for action %v", action) }) - mockClient.PrependReactor("list", "namespaces", func(action testclient.Action) (bool, runtime.Object, error) { + mockClient.PrependReactor("list", "namespaces", func(action core.Action) (bool, runtime.Object, error) { namespaceLock.RLock() defer namespaceLock.RUnlock() return true, &api.NamespaceList{Items: []api.Namespace{*namespaceObj}}, nil diff --git a/plugin/pkg/admission/persistentvolume/label/admission.go b/plugin/pkg/admission/persistentvolume/label/admission.go index de1b9240236..a08d36fb7a3 100644 --- a/plugin/pkg/admission/persistentvolume/label/admission.go +++ b/plugin/pkg/admission/persistentvolume/label/admission.go @@ -21,16 +21,17 @@ import ( "io" "sync" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" ) func init() { - admission.RegisterPlugin("PersistentVolumeLabel", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("PersistentVolumeLabel", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { persistentVolumeLabelAdmission := NewPersistentVolumeLabel() return persistentVolumeLabelAdmission, nil }) diff --git a/plugin/pkg/admission/persistentvolume/label/admission_test.go b/plugin/pkg/admission/persistentvolume/label/admission_test.go index def17508284..934f3be78de 100644 --- a/plugin/pkg/admission/persistentvolume/label/admission_test.go +++ b/plugin/pkg/admission/persistentvolume/label/admission_test.go @@ -33,20 +33,20 @@ type mockVolumes struct { var _ aws.Volumes = &mockVolumes{} -func (v *mockVolumes) AttachDisk(instanceName string, volumeName string, readOnly bool) (string, error) { +func (v *mockVolumes) AttachDisk(diskName string, instanceName string, readOnly bool) (string, error) { return "", fmt.Errorf("not implemented") } -func (v *mockVolumes) DetachDisk(instanceName string, volumeName string) error { - return fmt.Errorf("not implemented") -} - -func (v *mockVolumes) CreateVolume(volumeOptions *aws.VolumeOptions) (volumeName string, err error) { +func (v *mockVolumes) DetachDisk(diskName string, instanceName string) (string, error) { return "", fmt.Errorf("not implemented") } -func (v *mockVolumes) DeleteVolume(volumeName string) error { - return fmt.Errorf("not implemented") +func (v *mockVolumes) CreateDisk(volumeOptions *aws.VolumeOptions) (volumeName string, err error) { + return "", fmt.Errorf("not implemented") +} + +func (v *mockVolumes) DeleteDisk(volumeName string) (bool, error) { + return false, fmt.Errorf("not implemented") } func (v *mockVolumes) GetVolumeLabels(volumeName string) (map[string]string, error) { diff --git a/plugin/pkg/admission/resourcequota/admission.go b/plugin/pkg/admission/resourcequota/admission.go index 736819544e8..13abad612a0 100644 --- a/plugin/pkg/admission/resourcequota/admission.go +++ b/plugin/pkg/admission/resourcequota/admission.go @@ -22,12 +22,13 @@ import ( "math/rand" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" - client "k8s.io/kubernetes/pkg/client/unversioned" resourcequotacontroller "k8s.io/kubernetes/pkg/controller/resourcequota" "k8s.io/kubernetes/pkg/runtime" utilerrors "k8s.io/kubernetes/pkg/util/errors" @@ -35,25 +36,25 @@ import ( ) func init() { - admission.RegisterPlugin("ResourceQuota", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("ResourceQuota", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewResourceQuota(client), nil }) } type quota struct { *admission.Handler - client client.Interface + client clientset.Interface indexer cache.Indexer } // NewResourceQuota creates a new resource quota admission control handler -func NewResourceQuota(client client.Interface) admission.Interface { +func NewResourceQuota(client clientset.Interface) admission.Interface { lw := &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return client.ResourceQuotas(api.NamespaceAll).List(options) + return client.Core().ResourceQuotas(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return client.ResourceQuotas(api.NamespaceAll).Watch(options) + return client.Core().ResourceQuotas(api.NamespaceAll).Watch(options) }, } indexer, reflector := cache.NewNamespaceKeyedIndexerAndReflector(lw, &api.ResourceQuota{}, 0) @@ -61,7 +62,7 @@ func NewResourceQuota(client client.Interface) admission.Interface { return createResourceQuota(client, indexer) } -func createResourceQuota(client client.Interface, indexer cache.Indexer) admission.Interface { +func createResourceQuota(client clientset.Interface, indexer cache.Indexer) admission.Interface { return "a{ Handler: admission.NewHandler(admission.Create, admission.Update), client: client, @@ -142,7 +143,7 @@ func (q *quota) Admit(a admission.Attributes) (err error) { Annotations: quota.Annotations}, } usage.Status = *status - _, err = q.client.ResourceQuotas(usage.Namespace).UpdateStatus(&usage) + _, err = q.client.Core().ResourceQuotas(usage.Namespace).UpdateStatus(&usage) if err == nil { break } @@ -153,7 +154,7 @@ func (q *quota) Admit(a admission.Attributes) (err error) { } time.Sleep(interval) // manually get the latest quota - quota, err = q.client.ResourceQuotas(usage.Namespace).Get(quota.Name) + quota, err = q.client.Core().ResourceQuotas(usage.Namespace).Get(quota.Name) if err != nil { return admission.NewForbidden(a, err) } @@ -166,7 +167,7 @@ func (q *quota) Admit(a admission.Attributes) (err error) { // IncrementUsage updates the supplied ResourceQuotaStatus object based on the incoming operation // Return true if the usage must be recorded prior to admitting the new resource // Return an error if the operation should not pass admission control -func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, client client.Interface) (bool, error) { +func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, client clientset.Interface) (bool, error) { // on update, the only resource that can modify the value of a quota is pods // so if your not a pod, we exit quickly if a.GetOperation() == admission.Update && a.GetResource() != api.Resource("pods") { @@ -227,7 +228,7 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli // if this operation is an update, we need to find the delta usage from the previous state if a.GetOperation() == admission.Update { - oldPod, err := client.Pods(a.GetNamespace()).Get(pod.Name) + oldPod, err := client.Core().Pods(a.GetNamespace()).Get(pod.Name) if err != nil { return false, err } diff --git a/plugin/pkg/admission/resourcequota/admission_test.go b/plugin/pkg/admission/resourcequota/admission_test.go index 71938211b2c..f831f37bcaa 100644 --- a/plugin/pkg/admission/resourcequota/admission_test.go +++ b/plugin/pkg/admission/resourcequota/admission_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" resourcequotacontroller "k8s.io/kubernetes/pkg/controller/resourcequota" "k8s.io/kubernetes/pkg/runtime" ) @@ -65,7 +65,7 @@ func validPod(name string, numContainers int, resources api.ResourceRequirements func TestAdmissionIgnoresDelete(t *testing.T) { namespace := "default" - handler := createResourceQuota(&testclient.Fake{}, nil) + handler := createResourceQuota(&fake.Clientset{}, nil) err := handler.Admit(admission.NewAttributesRecord(nil, api.Kind("Pod"), namespace, "name", api.Resource("pods"), "", admission.Delete, nil)) if err != nil { t.Errorf("ResourceQuota should admit all deletes: %v", err) @@ -74,7 +74,7 @@ func TestAdmissionIgnoresDelete(t *testing.T) { func TestAdmissionIgnoresSubresources(t *testing.T) { indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{"namespace": cache.MetaNamespaceIndexFunc}) - handler := createResourceQuota(&testclient.Fake{}, indexer) + handler := createResourceQuota(&fake.Clientset{}, indexer) quota := &api.ResourceQuota{} quota.Name = "quota" @@ -173,7 +173,7 @@ func TestIncrementUsagePodResources(t *testing.T) { } for _, item := range testCases { podList := &api.PodList{Items: []api.Pod{*item.existing}} - client := testclient.NewSimpleFake(podList) + client := fake.NewSimpleClientset(podList) status := &api.ResourceQuotaStatus{ Hard: api.ResourceList{}, Used: api.ResourceList{}, @@ -207,7 +207,7 @@ func TestIncrementUsagePodResources(t *testing.T) { func TestIncrementUsagePods(t *testing.T) { pod := validPod("123", 1, getResourceRequirements(getResourceList("100m", "1Gi"), getResourceList("", ""))) podList := &api.PodList{Items: []api.Pod{*pod}} - client := testclient.NewSimpleFake(podList) + client := fake.NewSimpleClientset(podList) status := &api.ResourceQuotaStatus{ Hard: api.ResourceList{}, Used: api.ResourceList{}, @@ -231,7 +231,7 @@ func TestIncrementUsagePods(t *testing.T) { func TestExceedUsagePods(t *testing.T) { pod := validPod("123", 1, getResourceRequirements(getResourceList("100m", "1Gi"), getResourceList("", ""))) podList := &api.PodList{Items: []api.Pod{*pod}} - client := testclient.NewSimpleFake(podList) + client := fake.NewSimpleClientset(podList) status := &api.ResourceQuotaStatus{ Hard: api.ResourceList{}, Used: api.ResourceList{}, @@ -247,7 +247,7 @@ func TestExceedUsagePods(t *testing.T) { func TestIncrementUsageServices(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.ServiceList{ + client := fake.NewSimpleClientset(&api.ServiceList{ Items: []api.Service{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -276,7 +276,7 @@ func TestIncrementUsageServices(t *testing.T) { func TestExceedUsageServices(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.ServiceList{ + client := fake.NewSimpleClientset(&api.ServiceList{ Items: []api.Service{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -298,7 +298,7 @@ func TestExceedUsageServices(t *testing.T) { func TestIncrementUsageReplicationControllers(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.ReplicationControllerList{ + client := fake.NewSimpleClientset(&api.ReplicationControllerList{ Items: []api.ReplicationController{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -327,7 +327,7 @@ func TestIncrementUsageReplicationControllers(t *testing.T) { func TestExceedUsageReplicationControllers(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.ReplicationControllerList{ + client := fake.NewSimpleClientset(&api.ReplicationControllerList{ Items: []api.ReplicationController{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -349,7 +349,7 @@ func TestExceedUsageReplicationControllers(t *testing.T) { func TestExceedUsageSecrets(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.SecretList{ + client := fake.NewSimpleClientset(&api.SecretList{ Items: []api.Secret{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -371,7 +371,7 @@ func TestExceedUsageSecrets(t *testing.T) { func TestExceedUsagePersistentVolumeClaims(t *testing.T) { namespace := "default" - client := testclient.NewSimpleFake(&api.PersistentVolumeClaimList{ + client := fake.NewSimpleClientset(&api.PersistentVolumeClaimList{ Items: []api.PersistentVolumeClaim{ { ObjectMeta: api.ObjectMeta{Name: "123", Namespace: namespace}, @@ -426,7 +426,7 @@ func TestIncrementUsageOnUpdateIgnoresNonPodResources(t *testing.T) { } for _, testCase := range testCase { - client := testclient.NewSimpleFake() + client := fake.NewSimpleClientset() status := &api.ResourceQuotaStatus{ Hard: api.ResourceList{}, Used: api.ResourceList{}, diff --git a/plugin/pkg/admission/securitycontext/scdeny/admission.go b/plugin/pkg/admission/securitycontext/scdeny/admission.go index 44b83b2f115..041e5ba1946 100644 --- a/plugin/pkg/admission/securitycontext/scdeny/admission.go +++ b/plugin/pkg/admission/securitycontext/scdeny/admission.go @@ -20,14 +20,15 @@ import ( "fmt" "io" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" - client "k8s.io/kubernetes/pkg/client/unversioned" ) func init() { - admission.RegisterPlugin("SecurityContextDeny", func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin("SecurityContextDeny", func(client clientset.Interface, config io.Reader) (admission.Interface, error) { return NewSecurityContextDeny(client), nil }) } @@ -35,11 +36,11 @@ func init() { // plugin contains the client used by the SecurityContextDeny admission controller type plugin struct { *admission.Handler - client client.Interface + client clientset.Interface } // NewSecurityContextDeny creates a new instance of the SecurityContextDeny admission controller -func NewSecurityContextDeny(client client.Interface) admission.Interface { +func NewSecurityContextDeny(client clientset.Interface) admission.Interface { return &plugin{ Handler: admission.NewHandler(admission.Create, admission.Update), client: client, diff --git a/plugin/pkg/admission/serviceaccount/admission.go b/plugin/pkg/admission/serviceaccount/admission.go index 554769dda40..06cfad53935 100644 --- a/plugin/pkg/admission/serviceaccount/admission.go +++ b/plugin/pkg/admission/serviceaccount/admission.go @@ -23,6 +23,8 @@ import ( "strconv" "time" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" @@ -51,7 +53,7 @@ const DefaultAPITokenMountPath = "/var/run/secrets/kubernetes.io/serviceaccount" const PluginName = "ServiceAccount" func init() { - admission.RegisterPlugin(PluginName, func(client client.Interface, config io.Reader) (admission.Interface, error) { + admission.RegisterPlugin(PluginName, func(client clientset.Interface, config io.Reader) (admission.Interface, error) { serviceAccountAdmission := NewServiceAccount(client) serviceAccountAdmission.Run() return serviceAccountAdmission, nil @@ -70,7 +72,7 @@ type serviceAccount struct { // MountServiceAccountToken creates Volume and VolumeMounts for the first referenced ServiceAccountToken for the pod's service account MountServiceAccountToken bool - client client.Interface + client clientset.Interface serviceAccounts cache.Indexer secrets cache.Indexer @@ -86,14 +88,14 @@ type serviceAccount struct { // 3. If LimitSecretReferences is true, it rejects the pod if the pod references Secret objects which the pod's ServiceAccount does not reference // 4. If the pod does not contain any ImagePullSecrets, the ImagePullSecrets of the service account are added. // 5. If MountServiceAccountToken is true, it adds a VolumeMount with the pod's ServiceAccount's api token secret to containers -func NewServiceAccount(cl client.Interface) *serviceAccount { +func NewServiceAccount(cl clientset.Interface) *serviceAccount { serviceAccountsIndexer, serviceAccountsReflector := cache.NewNamespaceKeyedIndexerAndReflector( &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { - return cl.ServiceAccounts(api.NamespaceAll).List(options) + return cl.Core().ServiceAccounts(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { - return cl.ServiceAccounts(api.NamespaceAll).Watch(options) + return cl.Core().ServiceAccounts(api.NamespaceAll).Watch(options) }, }, &api.ServiceAccount{}, @@ -105,11 +107,11 @@ func NewServiceAccount(cl client.Interface) *serviceAccount { &cache.ListWatch{ ListFunc: func(options api.ListOptions) (runtime.Object, error) { options.FieldSelector = tokenSelector - return cl.Secrets(api.NamespaceAll).List(options) + return cl.Core().Secrets(api.NamespaceAll).List(options) }, WatchFunc: func(options api.ListOptions) (watch.Interface, error) { options.FieldSelector = tokenSelector - return cl.Secrets(api.NamespaceAll).Watch(options) + return cl.Core().Secrets(api.NamespaceAll).Watch(options) }, }, &api.Secret{}, @@ -251,7 +253,7 @@ func (s *serviceAccount) getServiceAccount(namespace string, name string) (*api. if i != 0 { time.Sleep(retryInterval) } - serviceAccount, err := s.client.ServiceAccounts(namespace).Get(name) + serviceAccount, err := s.client.Core().ServiceAccounts(namespace).Get(name) if err == nil { return serviceAccount, nil } diff --git a/plugin/pkg/admission/serviceaccount/admission_test.go b/plugin/pkg/admission/serviceaccount/admission_test.go index 750d555e66a..59b42cf0100 100644 --- a/plugin/pkg/admission/serviceaccount/admission_test.go +++ b/plugin/pkg/admission/serviceaccount/admission_test.go @@ -22,7 +22,7 @@ import ( "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/client/unversioned/testclient" + "k8s.io/kubernetes/pkg/client/testing/fake" kubelet "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/types" ) @@ -176,7 +176,7 @@ func TestFetchesUncachedServiceAccount(t *testing.T) { ns := "myns" // Build a test client that the admission plugin can use to look up the service account missing from its cache - client := testclient.NewSimpleFake(&api.ServiceAccount{ + client := fake.NewSimpleClientset(&api.ServiceAccount{ ObjectMeta: api.ObjectMeta{ Name: DefaultServiceAccountName, Namespace: ns, @@ -201,7 +201,7 @@ func TestDeniesInvalidServiceAccount(t *testing.T) { ns := "myns" // Build a test client that the admission plugin can use to look up the service account missing from its cache - client := testclient.NewSimpleFake() + client := fake.NewSimpleClientset() admit := NewServiceAccount(client) diff --git a/plugin/pkg/scheduler/algorithm/predicates/predicates.go b/plugin/pkg/scheduler/algorithm/predicates/predicates.go index db19091f22e..c0d52815208 100644 --- a/plugin/pkg/scheduler/algorithm/predicates/predicates.go +++ b/plugin/pkg/scheduler/algorithm/predicates/predicates.go @@ -24,6 +24,7 @@ import ( client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api/unversioned" @@ -122,9 +123,9 @@ func isVolumeConflict(volume api.Volume, pod *api.Pod) bool { // - AWS EBS forbids any two pods mounting the same volume ID // - Ceph RBD forbids if any two pods share at least same monitor, and match pool and image. // TODO: migrate this into some per-volume specific code? -func NoDiskConflict(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func NoDiskConflict(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { for _, v := range pod.Spec.Volumes { - for _, ev := range existingPods { + for _, ev := range nodeInfo.Pods() { if isVolumeConflict(v, ev) { return false, nil } @@ -133,6 +134,141 @@ func NoDiskConflict(pod *api.Pod, existingPods []*api.Pod, node string) (bool, e return true, nil } +type MaxPDVolumeCountChecker struct { + filter VolumeFilter + maxVolumes int + pvInfo PersistentVolumeInfo + pvcInfo PersistentVolumeClaimInfo +} + +// VolumeFilter contains information on how to filter PD Volumes when checking PD Volume caps +type VolumeFilter struct { + // Filter normal volumes + FilterVolume func(vol *api.Volume) (id string, relevant bool) + FilterPersistentVolume func(pv *api.PersistentVolume) (id string, relevant bool) +} + +// NewMaxPDVolumeCountPredicate creates a predicate which evaluates whether a pod can fit based on the +// number of volumes which match a filter that it requests, and those that are already present. The +// maximum number is configurable to accommodate different systems. +// +// The predicate looks for both volumes used directly, as well as PVC volumes that are backed by relevant volume +// types, counts the number of unique volumes, and rejects the new pod if it would place the total count over +// the maximum. +func NewMaxPDVolumeCountPredicate(filter VolumeFilter, maxVolumes int, pvInfo PersistentVolumeInfo, pvcInfo PersistentVolumeClaimInfo) algorithm.FitPredicate { + c := &MaxPDVolumeCountChecker{ + filter: filter, + maxVolumes: maxVolumes, + pvInfo: pvInfo, + pvcInfo: pvcInfo, + } + + return c.predicate +} + +func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace string, filteredVolumes map[string]bool) error { + for _, vol := range volumes { + if id, ok := c.filter.FilterVolume(&vol); ok { + filteredVolumes[id] = true + } else if vol.PersistentVolumeClaim != nil { + pvcName := vol.PersistentVolumeClaim.ClaimName + if pvcName == "" { + return fmt.Errorf("PersistentVolumeClaim had no name: %q", pvcName) + } + pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName) + if err != nil { + return err + } + + pvName := pvc.Spec.VolumeName + if pvName == "" { + return fmt.Errorf("PersistentVolumeClaim is not bound: %q", pvcName) + } + + pv, err := c.pvInfo.GetPersistentVolumeInfo(pvName) + if err != nil { + return err + } + + if id, ok := c.filter.FilterPersistentVolume(pv); ok { + filteredVolumes[id] = true + } + } + } + + return nil +} + +func (c *MaxPDVolumeCountChecker) predicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + newVolumes := make(map[string]bool) + if err := c.filterVolumes(pod.Spec.Volumes, pod.Namespace, newVolumes); err != nil { + return false, err + } + + // quick return + if len(newVolumes) == 0 { + return true, nil + } + + // count unique volumes + existingVolumes := make(map[string]bool) + for _, existingPod := range nodeInfo.Pods() { + if err := c.filterVolumes(existingPod.Spec.Volumes, existingPod.Namespace, existingVolumes); err != nil { + return false, err + } + } + numExistingVolumes := len(existingVolumes) + + // filter out already-mounted volumes + for k := range existingVolumes { + if _, ok := newVolumes[k]; ok { + delete(newVolumes, k) + } + } + + numNewVolumes := len(newVolumes) + + if numExistingVolumes+numNewVolumes > c.maxVolumes { + return false, nil + } + + return true, nil +} + +// EBSVolumeFilter is a VolumeFilter for filtering AWS ElasticBlockStore Volumes +var EBSVolumeFilter VolumeFilter = VolumeFilter{ + FilterVolume: func(vol *api.Volume) (string, bool) { + if vol.AWSElasticBlockStore != nil { + return vol.AWSElasticBlockStore.VolumeID, true + } + return "", false + }, + + FilterPersistentVolume: func(pv *api.PersistentVolume) (string, bool) { + if pv.Spec.AWSElasticBlockStore != nil { + return pv.Spec.AWSElasticBlockStore.VolumeID, true + } + return "", false + }, +} + +// GCEPDVolumeFilter is a VolumeFilter for filtering GCE PersistentDisk Volumes +var GCEPDVolumeFilter VolumeFilter = VolumeFilter{ + FilterVolume: func(vol *api.Volume) (string, bool) { + if vol.GCEPersistentDisk != nil { + return vol.GCEPersistentDisk.PDName, true + } + return "", false + }, + + FilterPersistentVolume: func(pv *api.PersistentVolume) (string, bool) { + if pv.Spec.GCEPersistentDisk != nil { + return pv.Spec.GCEPersistentDisk.PDName, true + } + return "", false + }, +} + type VolumeZoneChecker struct { nodeInfo NodeInfo pvInfo PersistentVolumeInfo @@ -162,13 +298,13 @@ func NewVolumeZonePredicate(nodeInfo NodeInfo, pvInfo PersistentVolumeInfo, pvcI return c.predicate } -func (c *VolumeZoneChecker) predicate(pod *api.Pod, existingPods []*api.Pod, nodeID string) (bool, error) { - node, err := c.nodeInfo.GetNodeInfo(nodeID) +func (c *VolumeZoneChecker) predicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + node, err := c.nodeInfo.GetNodeInfo(nodeName) if err != nil { return false, err } if node == nil { - return false, fmt.Errorf("node not found: %q", nodeID) + return false, fmt.Errorf("node not found: %q", nodeName) } nodeConstraints := make(map[string]string) @@ -225,7 +361,7 @@ func (c *VolumeZoneChecker) predicate(pod *api.Pod, existingPods []*api.Pod, nod } nodeV, _ := nodeConstraints[k] if v != nodeV { - glog.V(2).Infof("Won't schedule pod %q onto node %q due to volume %q (mismatch on %q)", pod.Name, nodeID, pvName, k) + glog.V(2).Infof("Won't schedule pod %q onto node %q due to volume %q (mismatch on %q)", pod.Name, nodeName, pvName, k) return false, nil } } @@ -254,18 +390,6 @@ func getResourceRequest(pod *api.Pod) resourceRequest { return result } -func getTotalResourceRequest(pods []*api.Pod) resourceRequest { - result := resourceRequest{} - for _, pod := range pods { - for _, container := range pod.Spec.Containers { - requests := container.Resources.Requests - result.memory += requests.Memory().Value() - result.milliCPU += requests.Cpu().MilliValue() - } - } - return result -} - func CheckPodsExceedingFreeResources(pods []*api.Pod, allocatable api.ResourceList) (fitting []*api.Pod, notFittingCPU, notFittingMemory []*api.Pod) { totalMilliCPU := allocatable.Cpu().MilliValue() totalMemory := allocatable.Memory().Value() @@ -298,16 +422,17 @@ func podName(pod *api.Pod) string { } // PodFitsResources calculates fit based on requested, rather than used resources -func (r *ResourceFit) PodFitsResources(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { - info, err := r.info.GetNodeInfo(node) +func (r *ResourceFit) PodFitsResources(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + info, err := r.info.GetNodeInfo(nodeName) if err != nil { return false, err } allocatable := info.Status.Allocatable - if int64(len(existingPods))+1 > allocatable.Pods().Value() { - return false, newInsufficientResourceError(podCountResourceName, 1, - int64(len(existingPods)), allocatable.Pods().Value()) + allowedPodNumber := allocatable.Pods().Value() + if int64(len(nodeInfo.Pods()))+1 > allowedPodNumber { + return false, + newInsufficientResourceError(podCountResourceName, 1, int64(len(nodeInfo.Pods())), allowedPodNumber) } podRequest := getResourceRequest(pod) @@ -315,17 +440,18 @@ func (r *ResourceFit) PodFitsResources(pod *api.Pod, existingPods []*api.Pod, no return true, nil } - pods := append(existingPods, pod) - _, exceedingCPU, exceedingMemory := CheckPodsExceedingFreeResources(pods, allocatable) - if len(exceedingCPU) > 0 { - return false, newInsufficientResourceError(cpuResourceName, podRequest.milliCPU, - getTotalResourceRequest(existingPods).milliCPU, allocatable.Cpu().MilliValue()) + totalMilliCPU := allocatable.Cpu().MilliValue() + totalMemory := allocatable.Memory().Value() + if totalMilliCPU < podRequest.milliCPU+nodeInfo.RequestedResource().MilliCPU { + return false, + newInsufficientResourceError(cpuResourceName, podRequest.milliCPU, nodeInfo.RequestedResource().MilliCPU, totalMilliCPU) } - if len(exceedingMemory) > 0 { - return false, newInsufficientResourceError(memoryResoureceName, podRequest.memory, - getTotalResourceRequest(existingPods).memory, allocatable.Memory().Value()) + if totalMemory < podRequest.memory+nodeInfo.RequestedResource().Memory { + return false, + newInsufficientResourceError(memoryResoureceName, podRequest.memory, nodeInfo.RequestedResource().Memory, totalMemory) } - glog.V(10).Infof("Schedule Pod %+v on Node %+v is allowed, Node is running only %v out of %v Pods.", podName(pod), node, len(pods)-1, allocatable.Pods().Value()) + glog.V(10).Infof("Schedule Pod %+v on Node %+v is allowed, Node is running only %v out of %v Pods.", + podName(pod), nodeName, len(nodeInfo.Pods()), allowedPodNumber) return true, nil } @@ -343,31 +469,89 @@ func NewSelectorMatchPredicate(info NodeInfo) algorithm.FitPredicate { return selector.PodSelectorMatches } -func PodMatchesNodeLabels(pod *api.Pod, node *api.Node) bool { - if len(pod.Spec.NodeSelector) == 0 { - return true +// NodeMatchesNodeSelectorTerms checks if a node's labels satisfy a list of node selector terms, +// terms are ORed, and an emtpy a list of terms will match nothing. +func NodeMatchesNodeSelectorTerms(node *api.Node, nodeSelectorTerms []api.NodeSelectorTerm) bool { + for _, req := range nodeSelectorTerms { + nodeSelector, err := api.NodeSelectorRequirementsAsSelector(req.MatchExpressions) + if err != nil { + glog.V(10).Infof("Failed to parse MatchExpressions: %+v, regarding as not match.", req.MatchExpressions) + return false + } + if nodeSelector.Matches(labels.Set(node.Labels)) { + return true + } } - selector := labels.SelectorFromSet(pod.Spec.NodeSelector) - return selector.Matches(labels.Set(node.Labels)) + return false +} + +// The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector. +func PodMatchesNodeLabels(pod *api.Pod, node *api.Node) bool { + // Check if node.Labels match pod.Spec.NodeSelector. + if len(pod.Spec.NodeSelector) > 0 { + selector := labels.SelectorFromSet(pod.Spec.NodeSelector) + if !selector.Matches(labels.Set(node.Labels)) { + return false + } + } + + // Parse required node affinity scheduling requirements + // and check if the current node match the requirements. + affinity, err := api.GetAffinityFromPodAnnotations(pod.Annotations) + if err != nil { + glog.V(10).Infof("Failed to get Affinity from Pod %+v, err: %+v", podName(pod), err) + return false + } + + // 1. nil NodeSelector matches all nodes (i.e. does not filter out any nodes) + // 2. nil []NodeSelectorTerm (equivalent to non-nil empty NodeSelector) matches no nodes + // 3. zero-length non-nil []NodeSelectorTerm matches no nodes also, just for simplicity + // 4. nil []NodeSelectorRequirement (equivalent to non-nil empty NodeSelectorTerm) matches no nodes + // 5. zero-length non-nil []NodeSelectorRequirement matches no nodes also, just for simplicity + // 6. non-nil empty NodeSelectorRequirement is not allowed + nodeAffinityMatches := true + if affinity.NodeAffinity != nil { + nodeAffinity := affinity.NodeAffinity + // if no required NodeAffinity requirements, will do no-op, means select all nodes. + if nodeAffinity.RequiredDuringSchedulingRequiredDuringExecution == nil && nodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil { + return true + } + + // Match node selector for requiredDuringSchedulingRequiredDuringExecution. + if nodeAffinity.RequiredDuringSchedulingRequiredDuringExecution != nil { + nodeSelectorTerms := nodeAffinity.RequiredDuringSchedulingRequiredDuringExecution.NodeSelectorTerms + glog.V(10).Infof("Match for RequiredDuringSchedulingRequiredDuringExecution node selector terms %+v", nodeSelectorTerms) + nodeAffinityMatches = NodeMatchesNodeSelectorTerms(node, nodeSelectorTerms) + } + + // Match node selector for requiredDuringSchedulingRequiredDuringExecution. + if nodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { + nodeSelectorTerms := nodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms + glog.V(10).Infof("Match for RequiredDuringSchedulingIgnoredDuringExecution node selector terms %+v", nodeSelectorTerms) + nodeAffinityMatches = nodeAffinityMatches && NodeMatchesNodeSelectorTerms(node, nodeSelectorTerms) + } + + } + return nodeAffinityMatches } type NodeSelector struct { info NodeInfo } -func (n *NodeSelector) PodSelectorMatches(pod *api.Pod, existingPods []*api.Pod, nodeID string) (bool, error) { - node, err := n.info.GetNodeInfo(nodeID) +func (n *NodeSelector) PodSelectorMatches(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + node, err := n.info.GetNodeInfo(nodeName) if err != nil { return false, err } return PodMatchesNodeLabels(pod, node), nil } -func PodFitsHost(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func PodFitsHost(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { if len(pod.Spec.NodeName) == 0 { return true, nil } - return pod.Spec.NodeName == node, nil + return pod.Spec.NodeName == nodeName, nil } type NodeLabelChecker struct { @@ -397,9 +581,9 @@ func NewNodeLabelPredicate(info NodeInfo, labels []string, presence bool) algori // Alternately, eliminating nodes that have a certain label, regardless of value, is also useful // A node may have a label with "retiring" as key and the date as the value // and it may be desirable to avoid scheduling new pods on this node -func (n *NodeLabelChecker) CheckNodeLabelPresence(pod *api.Pod, existingPods []*api.Pod, nodeID string) (bool, error) { +func (n *NodeLabelChecker) CheckNodeLabelPresence(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { var exists bool - node, err := n.info.GetNodeInfo(nodeID) + node, err := n.info.GetNodeInfo(nodeName) if err != nil { return false, err } @@ -439,7 +623,7 @@ func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister al // - L is listed in the ServiceAffinity object that is passed into the function // - the pod does not have any NodeSelector for L // - some other pod from the same service is already scheduled onto a node that has value V for label L -func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api.Pod, nodeID string) (bool, error) { +func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { var affinitySelector labels.Selector // check if the pod being scheduled has the affinity labels specified in its NodeSelector @@ -499,7 +683,7 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api affinitySelector = labels.Set(affinityLabels).AsSelector() } - node, err := s.nodeInfo.GetNodeInfo(nodeID) + node, err := s.nodeInfo.GetNodeInfo(nodeName) if err != nil { return false, err } @@ -508,12 +692,12 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api return affinitySelector.Matches(labels.Set(node.Labels)), nil } -func PodFitsHostPorts(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func PodFitsHostPorts(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { wantPorts := getUsedPorts(pod) if len(wantPorts) == 0 { return true, nil } - existingPorts := getUsedPorts(existingPods...) + existingPorts := getUsedPorts(nodeInfo.Pods()...) for wport := range wantPorts { if wport == 0 { continue @@ -537,22 +721,6 @@ func getUsedPorts(pods ...*api.Pod) map[int]bool { return ports } -// MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names -// and the values are the list of pods running on that host. -func MapPodsToMachines(lister algorithm.PodLister) (map[string][]*api.Pod, error) { - machineToPods := map[string][]*api.Pod{} - // TODO: perform more targeted query... - pods, err := lister.List(labels.Everything()) - if err != nil { - return map[string][]*api.Pod{}, err - } - for _, scheduledPod := range pods { - host := scheduledPod.Spec.NodeName - machineToPods[host] = append(machineToPods[host], scheduledPod) - } - return machineToPods, nil -} - // search two arrays and return true if they have at least one common element; return false otherwise func haveSame(a1, a2 []string) bool { for _, val1 := range a1 { diff --git a/plugin/pkg/scheduler/algorithm/predicates/predicates_test.go b/plugin/pkg/scheduler/algorithm/predicates/predicates_test.go index f250cab61e8..4ac7191f873 100644 --- a/plugin/pkg/scheduler/algorithm/predicates/predicates_test.go +++ b/plugin/pkg/scheduler/algorithm/predicates/predicates_test.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) type FakeNodeInfo api.Node @@ -44,6 +45,28 @@ func (nodes FakeNodeListInfo) GetNodeInfo(nodeName string) (*api.Node, error) { return nil, fmt.Errorf("Unable to find node: %s", nodeName) } +type FakePersistentVolumeClaimInfo []api.PersistentVolumeClaim + +func (pvcs FakePersistentVolumeClaimInfo) GetPersistentVolumeClaimInfo(namespace string, pvcID string) (*api.PersistentVolumeClaim, error) { + for _, pvc := range pvcs { + if pvc.Name == pvcID && pvc.Namespace == namespace { + return &pvc, nil + } + } + return nil, fmt.Errorf("Unable to find persistent volume claim: %s/%s", namespace, pvcID) +} + +type FakePersistentVolumeInfo []api.PersistentVolume + +func (pvs FakePersistentVolumeInfo) GetPersistentVolumeInfo(pvID string) (*api.PersistentVolume, error) { + for _, pv := range pvs { + if pv.Name == pvID { + return &pv, nil + } + } + return nil, fmt.Errorf("Unable to find persistent volume: %s", pvID) +} + func makeResources(milliCPU int64, memory int64, pods int64) api.NodeResources { return api.NodeResources{ Capacity: api.ResourceList{ @@ -83,53 +106,48 @@ func newResourcePod(usage ...resourceRequest) *api.Pod { func TestPodFitsResources(t *testing.T) { enoughPodsTests := []struct { - pod *api.Pod - existingPods []*api.Pod - fits bool - test string - wErr error + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + fits bool + test string + wErr error }{ { pod: &api.Pod{}, - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 10, memory: 20}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 10, memory: 20})), fits: true, test: "no resources requested always fits", wErr: nil, }, { pod: newResourcePod(resourceRequest{milliCPU: 1, memory: 1}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 10, memory: 20}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 10, memory: 20})), fits: false, test: "too many resources fails", wErr: newInsufficientResourceError(cpuResourceName, 1, 10, 10), }, { pod: newResourcePod(resourceRequest{milliCPU: 1, memory: 1}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 5, memory: 5}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 5, memory: 5})), fits: true, test: "both resources fit", wErr: nil, }, { pod: newResourcePod(resourceRequest{milliCPU: 1, memory: 2}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 5, memory: 19}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 5, memory: 19})), fits: false, test: "one resources fits", wErr: newInsufficientResourceError(memoryResoureceName, 2, 19, 20), }, { pod: newResourcePod(resourceRequest{milliCPU: 5, memory: 1}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 5, memory: 19}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 5, memory: 19})), fits: true, test: "equal edge case", wErr: nil, @@ -140,7 +158,7 @@ func TestPodFitsResources(t *testing.T) { node := api.Node{Status: api.NodeStatus{Capacity: makeResources(10, 20, 32).Capacity, Allocatable: makeAllocatableResources(10, 20, 32)}} fit := ResourceFit{FakeNodeInfo(node)} - fits, err := fit.PodFitsResources(test.pod, test.existingPods, "machine") + fits, err := fit.PodFitsResources(test.pod, "machine", test.nodeInfo) if !reflect.DeepEqual(err, test.wErr) { t.Errorf("%s: unexpected error: %v, want: %v", test.test, err, test.wErr) } @@ -150,35 +168,32 @@ func TestPodFitsResources(t *testing.T) { } notEnoughPodsTests := []struct { - pod *api.Pod - existingPods []*api.Pod - fits bool - test string - wErr error + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + fits bool + test string + wErr error }{ { pod: &api.Pod{}, - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 10, memory: 20}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 10, memory: 20})), fits: false, test: "even without specified resources predicate fails when there's no space for additional pod", wErr: newInsufficientResourceError(podCountResourceName, 1, 1, 1), }, { pod: newResourcePod(resourceRequest{milliCPU: 1, memory: 1}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 5, memory: 5}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 5, memory: 5})), fits: false, test: "even if both resources fit predicate fails when there's no space for additional pod", wErr: newInsufficientResourceError(podCountResourceName, 1, 1, 1), }, { pod: newResourcePod(resourceRequest{milliCPU: 5, memory: 1}), - existingPods: []*api.Pod{ - newResourcePod(resourceRequest{milliCPU: 5, memory: 19}), - }, + nodeInfo: schedulercache.NewNodeInfo( + newResourcePod(resourceRequest{milliCPU: 5, memory: 19})), fits: false, test: "even for equal edge case predicate fails when there's no space for additional pod", wErr: newInsufficientResourceError(podCountResourceName, 1, 1, 1), @@ -188,7 +203,7 @@ func TestPodFitsResources(t *testing.T) { node := api.Node{Status: api.NodeStatus{Capacity: api.ResourceList{}, Allocatable: makeAllocatableResources(10, 20, 1)}} fit := ResourceFit{FakeNodeInfo(node)} - fits, err := fit.PodFitsResources(test.pod, test.existingPods, "machine") + fits, err := fit.PodFitsResources(test.pod, "machine", test.nodeInfo) if !reflect.DeepEqual(err, test.wErr) { t.Errorf("%s: unexpected error: %v, want: %v", test.test, err, test.wErr) } @@ -234,7 +249,7 @@ func TestPodFitsHost(t *testing.T) { } for _, test := range tests { - result, err := PodFitsHost(test.pod, []*api.Pod{}, test.node) + result, err := PodFitsHost(test.pod, test.node, schedulercache.NewNodeInfo()) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -263,52 +278,48 @@ func newPod(host string, hostPorts ...int) *api.Pod { func TestPodFitsHostPorts(t *testing.T) { tests := []struct { - pod *api.Pod - existingPods []*api.Pod - fits bool - test string + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + fits bool + test string }{ { - pod: &api.Pod{}, - existingPods: []*api.Pod{}, - fits: true, - test: "nothing running", + pod: &api.Pod{}, + nodeInfo: schedulercache.NewNodeInfo(), + fits: true, + test: "nothing running", }, { pod: newPod("m1", 8080), - existingPods: []*api.Pod{ - newPod("m1", 9090), - }, + nodeInfo: schedulercache.NewNodeInfo( + newPod("m1", 9090)), fits: true, test: "other port", }, { pod: newPod("m1", 8080), - existingPods: []*api.Pod{ - newPod("m1", 8080), - }, + nodeInfo: schedulercache.NewNodeInfo( + newPod("m1", 8080)), fits: false, test: "same port", }, { pod: newPod("m1", 8000, 8080), - existingPods: []*api.Pod{ - newPod("m1", 8080), - }, + nodeInfo: schedulercache.NewNodeInfo( + newPod("m1", 8080)), fits: false, test: "second port", }, { pod: newPod("m1", 8000, 8080), - existingPods: []*api.Pod{ - newPod("m1", 8001, 8080), - }, + nodeInfo: schedulercache.NewNodeInfo( + newPod("m1", 8001, 8080)), fits: false, test: "second port", }, } for _, test := range tests { - fits, err := PodFitsHostPorts(test.pod, test.existingPods, "machine") + fits, err := PodFitsHostPorts(test.pod, "machine", test.nodeInfo) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -378,27 +389,27 @@ func TestDiskConflicts(t *testing.T) { }, } tests := []struct { - pod *api.Pod - existingPods []*api.Pod - isOk bool - test string + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + isOk bool + test string }{ - {&api.Pod{}, []*api.Pod{}, true, "nothing"}, - {&api.Pod{}, []*api.Pod{{Spec: volState}}, true, "one state"}, - {&api.Pod{Spec: volState}, []*api.Pod{{Spec: volState}}, false, "same state"}, - {&api.Pod{Spec: volState2}, []*api.Pod{{Spec: volState}}, true, "different state"}, + {&api.Pod{}, schedulercache.NewNodeInfo(), true, "nothing"}, + {&api.Pod{}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "one state"}, + {&api.Pod{Spec: volState}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), false, "same state"}, + {&api.Pod{Spec: volState2}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "different state"}, } for _, test := range tests { - ok, err := NoDiskConflict(test.pod, test.existingPods, "machine") + ok, err := NoDiskConflict(test.pod, "machine", test.nodeInfo) if err != nil { t.Fatalf("unexpected error: %v", err) } if test.isOk && !ok { - t.Errorf("expected ok, got none. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected ok, got none. %v %s %s", test.pod, test.nodeInfo, test.test) } if !test.isOk && ok { - t.Errorf("expected no ok, got one. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected no ok, got one. %v %s %s", test.pod, test.nodeInfo, test.test) } } } @@ -427,27 +438,27 @@ func TestAWSDiskConflicts(t *testing.T) { }, } tests := []struct { - pod *api.Pod - existingPods []*api.Pod - isOk bool - test string + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + isOk bool + test string }{ - {&api.Pod{}, []*api.Pod{}, true, "nothing"}, - {&api.Pod{}, []*api.Pod{{Spec: volState}}, true, "one state"}, - {&api.Pod{Spec: volState}, []*api.Pod{{Spec: volState}}, false, "same state"}, - {&api.Pod{Spec: volState2}, []*api.Pod{{Spec: volState}}, true, "different state"}, + {&api.Pod{}, schedulercache.NewNodeInfo(), true, "nothing"}, + {&api.Pod{}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "one state"}, + {&api.Pod{Spec: volState}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), false, "same state"}, + {&api.Pod{Spec: volState2}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "different state"}, } for _, test := range tests { - ok, err := NoDiskConflict(test.pod, test.existingPods, "machine") + ok, err := NoDiskConflict(test.pod, "machine", test.nodeInfo) if err != nil { t.Fatalf("unexpected error: %v", err) } if test.isOk && !ok { - t.Errorf("expected ok, got none. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected ok, got none. %v %s %s", test.pod, test.nodeInfo, test.test) } if !test.isOk && ok { - t.Errorf("expected no ok, got one. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected no ok, got one. %v %s %s", test.pod, test.nodeInfo, test.test) } } } @@ -482,27 +493,27 @@ func TestRBDDiskConflicts(t *testing.T) { }, } tests := []struct { - pod *api.Pod - existingPods []*api.Pod - isOk bool - test string + pod *api.Pod + nodeInfo *schedulercache.NodeInfo + isOk bool + test string }{ - {&api.Pod{}, []*api.Pod{}, true, "nothing"}, - {&api.Pod{}, []*api.Pod{{Spec: volState}}, true, "one state"}, - {&api.Pod{Spec: volState}, []*api.Pod{{Spec: volState}}, false, "same state"}, - {&api.Pod{Spec: volState2}, []*api.Pod{{Spec: volState}}, true, "different state"}, + {&api.Pod{}, schedulercache.NewNodeInfo(), true, "nothing"}, + {&api.Pod{}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "one state"}, + {&api.Pod{Spec: volState}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), false, "same state"}, + {&api.Pod{Spec: volState2}, schedulercache.NewNodeInfo(&api.Pod{Spec: volState}), true, "different state"}, } for _, test := range tests { - ok, err := NoDiskConflict(test.pod, test.existingPods, "machine") + ok, err := NoDiskConflict(test.pod, "machine", test.nodeInfo) if err != nil { t.Fatalf("unexpected error: %v", err) } if test.isOk && !ok { - t.Errorf("expected ok, got none. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected ok, got none. %v %s %s", test.pod, test.nodeInfo, test.test) } if !test.isOk && ok { - t.Errorf("expected no ok, got one. %v %v %s", test.pod, test.existingPods, test.test) + t.Errorf("expected no ok, got one. %v %s %s", test.pod, test.nodeInfo, test.test) } } } @@ -574,12 +585,400 @@ func TestPodFitsSelector(t *testing.T) { fits: false, test: "node labels are subset", }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["bar", "value2"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: true, + test: "Pod with matchExpressions using In operator that matches the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "kernel-version", + "operator": "Gt", + "values": ["2.4"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "kernel-version": "2.6", + }, + fits: true, + test: "Pod with matchExpressions using Gt operator that matches the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "mem-type", + "operator": "NotIn", + "values": ["DDR", "DDR2"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "mem-type": "DDR3", + }, + fits: true, + test: "Pod with matchExpressions using NotIn operator that matches the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "GPU", + "operator": "Exists" + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "GPU": "NVIDIA-GRID-K1", + }, + fits: true, + test: "Pod with matchExpressions using Exists operator that matches the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["value1", "value2"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with affinity that don't match node's labels won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": null + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with a nil []NodeSelectorTerm in affinity, can't match the node's labels and won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with an empty []NodeSelectorTerm in affinity, can't match the node's labels and won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{}, {}] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with invalid NodeSelectTerms in affinity will match no objects and won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{"matchExpressions": [{}]}] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with empty MatchExpressions is not a valid value will match no objects and won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + "some-key": "some-value", + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: true, + test: "Pod with no Affinity will schedule onto a node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": null + }}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: true, + test: "Pod with Affinity but nil NodeSelector will schedule onto a node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "GPU", + "operator": "Exists" + }, { + "key": "GPU", + "operator": "NotIn", + "values": ["AMD", "INTER"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "GPU": "NVIDIA-GRID-K1", + }, + fits: true, + test: "Pod with multiple matchExpressions ANDed that matches the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "GPU", + "operator": "Exists" + }, { + "key": "GPU", + "operator": "In", + "values": ["AMD", "INTER"] + }] + }] + }}}`, + }, + }, + }, + labels: map[string]string{ + "GPU": "NVIDIA-GRID-K1", + }, + fits: false, + test: "Pod with multiple matchExpressions ANDed that doesn't match the existing node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["bar", "value2"] + }] + }, + { + "matchExpressions": [{ + "key": "diffkey", + "operator": "In", + "values": ["wrong", "value2"] + }] + } + ] + }}}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: true, + test: "Pod with multiple NodeSelectorTerms ORed in affinity, matches the node's labels and will schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["bar", "value2"] + }] + }] + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "NotIn", + "values": ["bar", "value2"] + }] + }] + } + }}`, + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: false, + test: "Pod with an Affinity both requiredDuringSchedulingRequiredDuringExecution and " + + "requiredDuringSchedulingIgnoredDuringExecution indicated that don't match node's labels and won't schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "Exists" + }] + }] + }}}`, + }, + }, + Spec: api.PodSpec{ + NodeSelector: map[string]string{ + "foo": "bar", + }, + }, + }, + labels: map[string]string{ + "foo": "bar", + }, + fits: true, + test: "Pod with an Affinity and a PodSpec.NodeSelector(the old thing that we are deprecating) " + + "both are satisfied, will schedule onto the node", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [{ + "key": "foo", + "operator": "Exists" + }] + }] + }}}`, + }, + }, + Spec: api.PodSpec{ + NodeSelector: map[string]string{ + "foo": "bar", + }, + }, + }, + labels: map[string]string{ + "foo": "barrrrrr", + }, + fits: false, + test: "Pod with an Affinity matches node's labels but the PodSpec.NodeSelector(the old thing that we are deprecating) " + + "is not satisfied, won't schedule onto the node", + }, } + for _, test := range tests { node := api.Node{ObjectMeta: api.ObjectMeta{Labels: test.labels}} fit := NodeSelector{FakeNodeInfo(node)} - fits, err := fit.PodSelectorMatches(test.pod, []*api.Pod{}, "machine") + fits, err := fit.PodSelectorMatches(test.pod, "machine", schedulercache.NewNodeInfo()) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -592,12 +991,11 @@ func TestPodFitsSelector(t *testing.T) { func TestNodeLabelPresence(t *testing.T) { label := map[string]string{"foo": "bar", "bar": "foo"} tests := []struct { - pod *api.Pod - existingPods []*api.Pod - labels []string - presence bool - fits bool - test string + pod *api.Pod + labels []string + presence bool + fits bool + test string }{ { labels: []string{"baz"}, @@ -639,7 +1037,7 @@ func TestNodeLabelPresence(t *testing.T) { for _, test := range tests { node := api.Node{ObjectMeta: api.ObjectMeta{Labels: label}} labelChecker := NodeLabelChecker{FakeNodeInfo(node), test.labels, test.presence} - fits, err := labelChecker.CheckNodeLabelPresence(test.pod, test.existingPods, "machine") + fits, err := labelChecker.CheckNodeLabelPresence(test.pod, "machine", schedulercache.NewNodeInfo()) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -779,7 +1177,7 @@ func TestServiceAffinity(t *testing.T) { for _, test := range tests { nodes := []api.Node{node1, node2, node3, node4, node5} serviceAffinity := ServiceAffinity{algorithm.FakePodLister(test.pods), algorithm.FakeServiceLister(test.services), FakeNodeListInfo(nodes), test.labels} - fits, err := serviceAffinity.CheckServiceAffinity(test.pod, []*api.Pod{}, test.node) + fits, err := serviceAffinity.CheckServiceAffinity(test.pod, test.node, schedulercache.NewNodeInfo()) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -788,3 +1186,224 @@ func TestServiceAffinity(t *testing.T) { } } } + +func TestEBSVolumeCountConflicts(t *testing.T) { + oneVolPod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{VolumeID: "ovp"}, + }, + }, + }, + }, + } + ebsPVCPod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{ + ClaimName: "someEBSVol", + }, + }, + }, + }, + }, + } + splitPVCPod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{ + ClaimName: "someNonEBSVol", + }, + }, + }, + { + VolumeSource: api.VolumeSource{ + PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{ + ClaimName: "someEBSVol", + }, + }, + }, + }, + }, + } + twoVolPod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{VolumeID: "tvp1"}, + }, + }, + { + VolumeSource: api.VolumeSource{ + AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{VolumeID: "tvp2"}, + }, + }, + }, + }, + } + splitVolsPod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + HostPath: &api.HostPathVolumeSource{}, + }, + }, + { + VolumeSource: api.VolumeSource{ + AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{VolumeID: "svp"}, + }, + }, + }, + }, + } + nonApplicablePod := &api.Pod{ + Spec: api.PodSpec{ + Volumes: []api.Volume{ + { + VolumeSource: api.VolumeSource{ + HostPath: &api.HostPathVolumeSource{}, + }, + }, + }, + }, + } + emptyPod := &api.Pod{ + Spec: api.PodSpec{}, + } + + tests := []struct { + newPod *api.Pod + existingPods []*api.Pod + maxVols int + fits bool + test string + }{ + { + newPod: oneVolPod, + existingPods: []*api.Pod{twoVolPod, oneVolPod}, + maxVols: 4, + fits: true, + test: "fits when node capacity >= new pod's EBS volumes", + }, + { + newPod: twoVolPod, + existingPods: []*api.Pod{oneVolPod}, + maxVols: 2, + fits: false, + test: "doesn't fit when node capacity < new pod's EBS volumes", + }, + { + newPod: splitVolsPod, + existingPods: []*api.Pod{twoVolPod}, + maxVols: 3, + fits: true, + test: "new pod's count ignores non-EBS volumes", + }, + { + newPod: twoVolPod, + existingPods: []*api.Pod{splitVolsPod, nonApplicablePod, emptyPod}, + maxVols: 3, + fits: true, + test: "existing pods' counts ignore non-EBS volumes", + }, + { + newPod: ebsPVCPod, + existingPods: []*api.Pod{splitVolsPod, nonApplicablePod, emptyPod}, + maxVols: 3, + fits: true, + test: "new pod's count considers PVCs backed by EBS volumes", + }, + { + newPod: splitPVCPod, + existingPods: []*api.Pod{splitVolsPod, oneVolPod}, + maxVols: 3, + fits: true, + test: "new pod's count ignores PVCs not backed by EBS volumes", + }, + { + newPod: twoVolPod, + existingPods: []*api.Pod{oneVolPod, ebsPVCPod}, + maxVols: 3, + fits: false, + test: "existing pods' counts considers PVCs backed by EBS volumes", + }, + { + newPod: twoVolPod, + existingPods: []*api.Pod{oneVolPod, twoVolPod, ebsPVCPod}, + maxVols: 4, + fits: true, + test: "already-mounted EBS volumes are always ok to allow", + }, + { + newPod: splitVolsPod, + existingPods: []*api.Pod{oneVolPod, oneVolPod, ebsPVCPod}, + maxVols: 3, + fits: true, + test: "the same EBS volumes are not counted multiple times", + }, + } + + pvInfo := FakePersistentVolumeInfo{ + { + ObjectMeta: api.ObjectMeta{Name: "someEBSVol"}, + Spec: api.PersistentVolumeSpec{ + PersistentVolumeSource: api.PersistentVolumeSource{ + AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{}, + }, + }, + }, + { + ObjectMeta: api.ObjectMeta{Name: "someNonEBSVol"}, + Spec: api.PersistentVolumeSpec{ + PersistentVolumeSource: api.PersistentVolumeSource{}, + }, + }, + } + + pvcInfo := FakePersistentVolumeClaimInfo{ + { + ObjectMeta: api.ObjectMeta{Name: "someEBSVol"}, + Spec: api.PersistentVolumeClaimSpec{VolumeName: "someEBSVol"}, + }, + { + ObjectMeta: api.ObjectMeta{Name: "someNonEBSVol"}, + Spec: api.PersistentVolumeClaimSpec{VolumeName: "someNonEBSVol"}, + }, + } + + filter := VolumeFilter{ + FilterVolume: func(vol *api.Volume) (string, bool) { + if vol.AWSElasticBlockStore != nil { + return vol.AWSElasticBlockStore.VolumeID, true + } + return "", false + }, + + FilterPersistentVolume: func(pv *api.PersistentVolume) (string, bool) { + if pv.Spec.AWSElasticBlockStore != nil { + return pv.Spec.AWSElasticBlockStore.VolumeID, true + } + return "", false + }, + } + + for _, test := range tests { + pred := NewMaxPDVolumeCountPredicate(filter, test.maxVols, pvInfo, pvcInfo) + fits, err := pred(test.newPod, "some-node", schedulercache.NewNodeInfo(test.existingPods...)) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if fits != test.fits { + t.Errorf("%s: expected %v, got %v", test.test, test.fits, fits) + } + } +} diff --git a/plugin/pkg/scheduler/algorithm/priorities/node_affinity.go b/plugin/pkg/scheduler/algorithm/priorities/node_affinity.go new file mode 100644 index 00000000000..671cc98788c --- /dev/null +++ b/plugin/pkg/scheduler/algorithm/priorities/node_affinity.go @@ -0,0 +1,96 @@ +/* +Copyright 2015 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. +*/ + +package priorities + +import ( + "github.com/golang/glog" + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" + schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" +) + +type NodeAffinity struct { + nodeLister algorithm.NodeLister +} + +func NewNodeAffinityPriority(nodeLister algorithm.NodeLister) algorithm.PriorityFunction { + nodeAffinity := &NodeAffinity{ + nodeLister: nodeLister, + } + return nodeAffinity.CalculateNodeAffinityPriority +} + +// CalculateNodeAffinityPriority prioritizes nodes according to node affinity scheduling preferences +// indicated in PreferredDuringSchedulingIgnoredDuringExecution. Each time a node match a preferredSchedulingTerm, +// it will a get an add of preferredSchedulingTerm.Weight. Thus, the more preferredSchedulingTerms +// the node satisfies and the more the preferredSchedulingTerm that is satisfied weights, the higher +// score the node gets. +func (s *NodeAffinity) CalculateNodeAffinityPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { + + var maxCount int + counts := map[string]int{} + + nodes, err := nodeLister.List() + if err != nil { + return nil, err + } + + affinity, err := api.GetAffinityFromPodAnnotations(pod.Annotations) + if err != nil { + return nil, err + } + + // A nil element of PreferredDuringSchedulingIgnoredDuringExecution matches no objects. + // An element of PreferredDuringSchedulingIgnoredDuringExecution that refers to an + // empty PreferredSchedulingTerm matches all objects. + if affinity.NodeAffinity != nil && affinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution != nil { + // Match PreferredDuringSchedulingIgnoredDuringExecution term by term. + for _, preferredSchedulingTerm := range affinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution { + if preferredSchedulingTerm.Weight == 0 { + continue + } + + nodeSelector, err := api.NodeSelectorRequirementsAsSelector(preferredSchedulingTerm.Preference.MatchExpressions) + if err != nil { + return nil, err + } + + for _, node := range nodes.Items { + if nodeSelector.Matches(labels.Set(node.Labels)) { + counts[node.Name] += preferredSchedulingTerm.Weight + } + + if counts[node.Name] > maxCount { + maxCount = counts[node.Name] + } + } + } + } + + result := []schedulerapi.HostPriority{} + for _, node := range nodes.Items { + fScore := float64(0) + if maxCount > 0 { + fScore = 10 * (float64(counts[node.Name]) / float64(maxCount)) + } + result = append(result, schedulerapi.HostPriority{Host: node.Name, Score: int(fScore)}) + glog.V(10).Infof("%v -> %v: NodeAffinityPriority, Score: (%d)", pod.Name, node.Name, int(fScore)) + } + return result, nil +} diff --git a/plugin/pkg/scheduler/algorithm/priorities/node_affinity_test.go b/plugin/pkg/scheduler/algorithm/priorities/node_affinity_test.go new file mode 100644 index 00000000000..12a7fb521a3 --- /dev/null +++ b/plugin/pkg/scheduler/algorithm/priorities/node_affinity_test.go @@ -0,0 +1,168 @@ +/* +Copyright 2015 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. +*/ + +package priorities + +import ( + "reflect" + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" + schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" +) + +func TestNodeAffinityPriority(t *testing.T) { + label1 := map[string]string{"foo": "bar"} + label2 := map[string]string{"key": "value"} + label3 := map[string]string{"az": "az1"} + label4 := map[string]string{"abc": "az11", "def": "az22"} + label5 := map[string]string{"foo": "bar", "key": "value", "az": "az1"} + + affinity1 := map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": {"preferredDuringSchedulingIgnoredDuringExecution": [ + { + "weight": 2, + "preference": { + "matchExpressions": [ + { + "key": "foo", + "operator": "In", "values": ["bar"] + } + ] + } + } + ]}}`, + } + + affinity2 := map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": {"preferredDuringSchedulingIgnoredDuringExecution": [ + { + "weight": 2, + "preference": {"matchExpressions": [ + { + "key": "foo", + "operator": "In", "values": ["bar"] + } + ]} + }, + { + "weight": 4, + "preference": {"matchExpressions": [ + { + "key": "key", + "operator": "In", "values": ["value"] + } + ]} + }, + { + "weight": 5, + "preference": {"matchExpressions": [ + { + "key": "foo", + "operator": "In", "values": ["bar"] + }, + { + "key": "key", + "operator": "In", "values": ["value"] + }, + { + "key": "az", + "operator": "In", "values": ["az1"] + } + ]} + } + ]}}`, + } + + tests := []struct { + pod *api.Pod + nodes []api.Node + expectedList schedulerapi.HostPriorityList + test string + }{ + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: map[string]string{}, + }, + }, + nodes: []api.Node{ + {ObjectMeta: api.ObjectMeta{Name: "machine1", Labels: label1}}, + {ObjectMeta: api.ObjectMeta{Name: "machine2", Labels: label2}}, + {ObjectMeta: api.ObjectMeta{Name: "machine3", Labels: label3}}, + }, + expectedList: []schedulerapi.HostPriority{{"machine1", 0}, {"machine2", 0}, {"machine3", 0}}, + test: "all machines are same priority as NodeAffinity is nil", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: affinity1, + }, + }, + nodes: []api.Node{ + {ObjectMeta: api.ObjectMeta{Name: "machine1", Labels: label4}}, + {ObjectMeta: api.ObjectMeta{Name: "machine2", Labels: label2}}, + {ObjectMeta: api.ObjectMeta{Name: "machine3", Labels: label3}}, + }, + expectedList: []schedulerapi.HostPriority{{"machine1", 0}, {"machine2", 0}, {"machine3", 0}}, + test: "no machine macthes preferred scheduling requirements in NodeAffinity of pod so all machines' priority is zero", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: affinity1, + }, + }, + nodes: []api.Node{ + {ObjectMeta: api.ObjectMeta{Name: "machine1", Labels: label1}}, + {ObjectMeta: api.ObjectMeta{Name: "machine2", Labels: label2}}, + {ObjectMeta: api.ObjectMeta{Name: "machine3", Labels: label3}}, + }, + expectedList: []schedulerapi.HostPriority{{"machine1", 10}, {"machine2", 0}, {"machine3", 0}}, + test: "only machine1 matches the preferred scheduling requirements of pod", + }, + { + pod: &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Annotations: affinity2, + }, + }, + nodes: []api.Node{ + {ObjectMeta: api.ObjectMeta{Name: "machine1", Labels: label1}}, + {ObjectMeta: api.ObjectMeta{Name: "machine5", Labels: label5}}, + {ObjectMeta: api.ObjectMeta{Name: "machine2", Labels: label2}}, + }, + expectedList: []schedulerapi.HostPriority{{"machine1", 1}, {"machine5", 10}, {"machine2", 3}}, + test: "all machines matches the preferred scheduling requirements of pod but with different priorities ", + }, + } + + for _, test := range tests { + nodeAffinity := NodeAffinity{nodeLister: algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})} + list, err := nodeAffinity.CalculateNodeAffinityPriority(test.pod, schedulercache.CreateNodeNameToInfoMap(nil), algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if !reflect.DeepEqual(test.expectedList, list) { + t.Errorf("%s: \nexpected %#v, \ngot %#v", test.test, test.expectedList, list) + } + } +} diff --git a/plugin/pkg/scheduler/algorithm/priorities/priorities.go b/plugin/pkg/scheduler/algorithm/priorities/priorities.go index 1aebef55ca7..2995c00b559 100644 --- a/plugin/pkg/scheduler/algorithm/priorities/priorities.go +++ b/plugin/pkg/scheduler/algorithm/priorities/priorities.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) // the unused capacity is calculated on a scale of 0-10 @@ -114,7 +115,7 @@ func calculateResourceOccupancy(pod *api.Pod, node api.Node, pods []*api.Pod) sc // It calculates the percentage of memory and CPU requested by pods scheduled on the node, and prioritizes // based on the minimum of the average of the fraction of requested to capacity. // Details: cpu((capacity - sum(requested)) * 10 / capacity) + memory((capacity - sum(requested)) * 10 / capacity) / 2 -func LeastRequestedPriority(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func LeastRequestedPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { nodes, err := nodeLister.List() if err != nil { return schedulerapi.HostPriorityList{}, err @@ -122,7 +123,7 @@ func LeastRequestedPriority(pod *api.Pod, machinesToPods map[string][]*api.Pod, list := schedulerapi.HostPriorityList{} for _, node := range nodes.Items { - list = append(list, calculateResourceOccupancy(pod, node, machinesToPods[node.Name])) + list = append(list, calculateResourceOccupancy(pod, node, nodeNameToInfo[node.Name].Pods())) } return list, nil } @@ -143,7 +144,7 @@ func NewNodeLabelPriority(label string, presence bool) algorithm.PriorityFunctio // CalculateNodeLabelPriority checks whether a particular label exists on a node or not, regardless of its value. // If presence is true, prioritizes nodes that have the specified label, regardless of value. // If presence is false, prioritizes nodes that do not have the specified label. -func (n *NodeLabelPrioritizer) CalculateNodeLabelPriority(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func (n *NodeLabelPrioritizer) CalculateNodeLabelPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { var score int nodes, err := nodeLister.List() if err != nil { @@ -170,13 +171,85 @@ func (n *NodeLabelPrioritizer) CalculateNodeLabelPriority(pod *api.Pod, machines return result, nil } +// This is a reasonable size range of all container images. 90%ile of images on dockerhub drops into this range. +const ( + mb int64 = 1024 * 1024 + minImgSize int64 = 23 * mb + maxImgSize int64 = 1000 * mb +) + +// ImageLocalityPriority is a priority function that favors nodes that already have requested pod container's images. +// It will detect whether the requested images are present on a node, and then calculate a score ranging from 0 to 10 +// based on the total size of those images. +// - If none of the images are present, this node will be given the lowest priority. +// - If some of the images are present on a node, the larger their sizes' sum, the higher the node's priority. +func ImageLocalityPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { + sumSizeMap := make(map[string]int64) + + nodes, err := nodeLister.List() + if err != nil { + return nil, err + } + + for _, container := range pod.Spec.Containers { + for _, node := range nodes.Items { + // Check if this container's image is present and get its size. + imageSize := checkContainerImageOnNode(node, container) + // Add this size to the total result of this node. + sumSizeMap[node.Name] += imageSize + } + } + + result := []schedulerapi.HostPriority{} + // score int - scale of 0-10 + // 0 being the lowest priority and 10 being the highest. + for nodeName, sumSize := range sumSizeMap { + result = append(result, schedulerapi.HostPriority{Host: nodeName, + Score: calculateScoreFromSize(sumSize)}) + } + return result, nil +} + +// checkContainerImageOnNode checks if a container image is present on a node and returns its size. +func checkContainerImageOnNode(node api.Node, container api.Container) int64 { + for _, image := range node.Status.Images { + for _, repoTag := range image.RepoTags { + if container.Image == repoTag { + // Should return immediately. + return image.Size + } + } + } + return 0 +} + +// calculateScoreFromSize calculates the priority of a node. sumSize is sum size of requested images on this node. +// 1. Split image size range into 10 buckets. +// 2. Decide the priority of a given sumSize based on which bucket it belongs to. +func calculateScoreFromSize(sumSize int64) int { + var score int + switch { + case sumSize == 0 || sumSize < minImgSize: + // score == 0 means none of the images required by this pod are present on this + // node or the total size of the images present is too small to be taken into further consideration. + score = 0 + // If existing images' total size is larger than max, just make it highest priority. + case sumSize >= maxImgSize: + score = 10 + default: + score = int((10 * (sumSize - minImgSize) / (maxImgSize - minImgSize)) + 1) + } + // Return which bucket the given size belongs to + return score +} + // BalancedResourceAllocation favors nodes with balanced resource usage rate. // BalancedResourceAllocation should **NOT** be used alone, and **MUST** be used together with LeastRequestedPriority. // It calculates the difference between the cpu and memory fracion of capacity, and prioritizes the host based on how // close the two metrics are to each other. // Detail: score = 10 - abs(cpuFraction-memoryFraction)*10. The algorithm is partly inspired by: // "Wei Huang et al. An Energy Efficient Virtual Machine Placement Algorithm with Balanced Resource Utilization" -func BalancedResourceAllocation(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func BalancedResourceAllocation(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { nodes, err := nodeLister.List() if err != nil { return schedulerapi.HostPriorityList{}, err @@ -184,7 +257,7 @@ func BalancedResourceAllocation(pod *api.Pod, machinesToPods map[string][]*api.P list := schedulerapi.HostPriorityList{} for _, node := range nodes.Items { - list = append(list, calculateBalancedResourceAllocation(pod, node, machinesToPods[node.Name])) + list = append(list, calculateBalancedResourceAllocation(pod, node, nodeNameToInfo[node.Name].Pods())) } return list, nil } diff --git a/plugin/pkg/scheduler/algorithm/priorities/priorities_test.go b/plugin/pkg/scheduler/algorithm/priorities/priorities_test.go index 7db6d2a1201..08526ee2dd0 100644 --- a/plugin/pkg/scheduler/algorithm/priorities/priorities_test.go +++ b/plugin/pkg/scheduler/algorithm/priorities/priorities_test.go @@ -26,8 +26,8 @@ import ( "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/plugin/pkg/scheduler" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" - "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) func makeNode(node string, milliCPU, memory int64) api.Node { @@ -132,18 +132,15 @@ func TestZeroRequest(t *testing.T) { const expectedPriority int = 25 for _, test := range tests { - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) list, err := scheduler.PrioritizeNodes( test.pod, - m2p, + nodeNameToInfo, algorithm.FakePodLister(test.pods), // This should match the configuration in defaultPriorities() in // plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go if you want // to test what's actually in production. - []algorithm.PriorityConfig{{Function: LeastRequestedPriority, Weight: 1}, {Function: BalancedResourceAllocation, Weight: 1}, {Function: NewSelectorSpreadPriority(algorithm.FakeServiceLister([]api.Service{}), algorithm.FakeControllerLister([]api.ReplicationController{})), Weight: 1}}, + []algorithm.PriorityConfig{{Function: LeastRequestedPriority, Weight: 1}, {Function: BalancedResourceAllocation, Weight: 1}, {Function: NewSelectorSpreadPriority(algorithm.FakePodLister(test.pods), algorithm.FakeServiceLister([]api.Service{}), algorithm.FakeControllerLister([]api.ReplicationController{})), Weight: 1}}, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes}), []algorithm.SchedulerExtender{}) if err != nil { t.Errorf("unexpected error: %v", err) @@ -387,11 +384,8 @@ func TestLeastRequested(t *testing.T) { } for _, test := range tests { - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - list, err := LeastRequestedPriority(test.pod, m2p, algorithm.FakePodLister(test.pods), algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + list, err := LeastRequestedPriority(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -485,7 +479,7 @@ func TestNewNodeLabelPriority(t *testing.T) { label: test.label, presence: test.presence, } - list, err := prioritizer.CalculateNodeLabelPriority(nil, map[string][]*api.Pod{}, nil, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) + list, err := prioritizer.CalculateNodeLabelPriority(nil, map[string]*schedulercache.NodeInfo{}, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -723,11 +717,8 @@ func TestBalancedResourceAllocation(t *testing.T) { } for _, test := range tests { - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - list, err := BalancedResourceAllocation(test.pod, m2p, algorithm.FakePodLister(test.pods), algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + list, err := BalancedResourceAllocation(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -736,3 +727,158 @@ func TestBalancedResourceAllocation(t *testing.T) { } } } + +func TestImageLocalityPriority(t *testing.T) { + test_40_250 := api.PodSpec{ + Containers: []api.Container{ + { + Image: "gcr.io/40", + }, + { + Image: "gcr.io/250", + }, + }, + } + + test_40_140 := api.PodSpec{ + Containers: []api.Container{ + { + Image: "gcr.io/40", + }, + { + Image: "gcr.io/140", + }, + }, + } + + test_min_max := api.PodSpec{ + Containers: []api.Container{ + { + Image: "gcr.io/10", + }, + { + Image: "gcr.io/2000", + }, + }, + } + + node_40_140_2000 := api.NodeStatus{ + Images: []api.ContainerImage{ + { + RepoTags: []string{ + "gcr.io/40", + "gcr.io/40:v1", + "gcr.io/40:v1", + }, + Size: int64(40 * mb), + }, + { + RepoTags: []string{ + "gcr.io/140", + "gcr.io/140:v1", + }, + Size: int64(140 * mb), + }, + { + RepoTags: []string{ + "gcr.io/2000", + }, + Size: int64(2000 * mb), + }, + }, + } + + node_250_10 := api.NodeStatus{ + Images: []api.ContainerImage{ + { + RepoTags: []string{ + "gcr.io/250", + }, + Size: int64(250 * mb), + }, + { + RepoTags: []string{ + "gcr.io/10", + "gcr.io/10:v1", + }, + Size: int64(10 * mb), + }, + }, + } + + tests := []struct { + pod *api.Pod + pods []*api.Pod + nodes []api.Node + expectedList schedulerapi.HostPriorityList + test string + }{ + { + // Pod: gcr.io/40 gcr.io/250 + + // Node1 + // Image: gcr.io/40 40MB + // Score: (40M-23M)/97.7M + 1 = 1 + + // Node2 + // Image: gcr.io/250 250MB + // Score: (250M-23M)/97.7M + 1 = 3 + pod: &api.Pod{Spec: test_40_250}, + nodes: []api.Node{makeImageNode("machine1", node_40_140_2000), makeImageNode("machine2", node_250_10)}, + expectedList: []schedulerapi.HostPriority{{"machine1", 1}, {"machine2", 3}}, + test: "two images spread on two nodes, prefer the larger image one", + }, + { + // Pod: gcr.io/40 gcr.io/140 + + // Node1 + // Image: gcr.io/40 40MB, gcr.io/140 140MB + // Score: (40M+140M-23M)/97.7M + 1 = 2 + + // Node2 + // Image: not present + // Score: 0 + pod: &api.Pod{Spec: test_40_140}, + nodes: []api.Node{makeImageNode("machine1", node_40_140_2000), makeImageNode("machine2", node_250_10)}, + expectedList: []schedulerapi.HostPriority{{"machine1", 2}, {"machine2", 0}}, + test: "two images on one node, prefer this node", + }, + { + // Pod: gcr.io/2000 gcr.io/10 + + // Node1 + // Image: gcr.io/2000 2000MB + // Score: 2000 > max score = 10 + + // Node2 + // Image: gcr.io/10 10MB + // Score: 10 < min score = 0 + pod: &api.Pod{Spec: test_min_max}, + nodes: []api.Node{makeImageNode("machine1", node_40_140_2000), makeImageNode("machine2", node_250_10)}, + expectedList: []schedulerapi.HostPriority{{"machine1", 10}, {"machine2", 0}}, + test: "if exceed limit, use limit", + }, + } + + for _, test := range tests { + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + list, err := ImageLocalityPriority(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(api.NodeList{Items: test.nodes})) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + sort.Sort(test.expectedList) + sort.Sort(list) + + if !reflect.DeepEqual(test.expectedList, list) { + t.Errorf("%s: expected %#v, got %#v", test.test, test.expectedList, list) + } + } +} + +func makeImageNode(node string, status api.NodeStatus) api.Node { + return api.Node{ + ObjectMeta: api.ObjectMeta{Name: node}, + Status: status, + } +} diff --git a/plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go b/plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go index f348acdb95d..0facd305585 100644 --- a/plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go +++ b/plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go @@ -23,6 +23,7 @@ import ( "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) // The maximum priority value to give to a node @@ -34,12 +35,14 @@ const maxPriority = 10 const zoneWeighting = 2.0 / 3.0 type SelectorSpread struct { + podLister algorithm.PodLister serviceLister algorithm.ServiceLister controllerLister algorithm.ControllerLister } -func NewSelectorSpreadPriority(serviceLister algorithm.ServiceLister, controllerLister algorithm.ControllerLister) algorithm.PriorityFunction { +func NewSelectorSpreadPriority(podLister algorithm.PodLister, serviceLister algorithm.ServiceLister, controllerLister algorithm.ControllerLister) algorithm.PriorityFunction { selectorSpread := &SelectorSpread{ + podLister: podLister, serviceLister: serviceLister, controllerLister: controllerLister, } @@ -73,7 +76,7 @@ func getZoneKey(node *api.Node) string { // i.e. it pushes the scheduler towards a node where there's the smallest number of // pods which match the same service selectors or RC selectors as the pod being scheduled. // Where zone information is included on the nodes, it favors nodes in zones with fewer existing matching pods. -func (s *SelectorSpread) CalculateSpreadPriority(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func (s *SelectorSpread) CalculateSpreadPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { var nsPods []*api.Pod selectors := make([]labels.Selector, 0) @@ -91,7 +94,7 @@ func (s *SelectorSpread) CalculateSpreadPriority(pod *api.Pod, machinesToPods ma } if len(selectors) > 0 { - pods, err := podLister.List(labels.Everything()) + pods, err := s.podLister.List(labels.Everything()) if err != nil { return nil, err } @@ -198,12 +201,14 @@ func (s *SelectorSpread) CalculateSpreadPriority(pod *api.Pod, machinesToPods ma } type ServiceAntiAffinity struct { + podLister algorithm.PodLister serviceLister algorithm.ServiceLister label string } -func NewServiceAntiAffinityPriority(serviceLister algorithm.ServiceLister, label string) algorithm.PriorityFunction { +func NewServiceAntiAffinityPriority(podLister algorithm.PodLister, serviceLister algorithm.ServiceLister, label string) algorithm.PriorityFunction { antiAffinity := &ServiceAntiAffinity{ + podLister: podLister, serviceLister: serviceLister, label: label, } @@ -213,7 +218,7 @@ func NewServiceAntiAffinityPriority(serviceLister algorithm.ServiceLister, label // CalculateAntiAffinityPriority spreads pods by minimizing the number of pods belonging to the same service // on machines with the same value for a particular label. // The label to be considered is provided to the struct (ServiceAntiAffinity). -func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { var nsServicePods []*api.Pod services, err := s.serviceLister.GetPodServices(pod) @@ -221,7 +226,7 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, machin // just use the first service and get the other pods within the service // TODO: a separate predicate can be created that tries to handle all services for the pod selector := labels.SelectorFromSet(services[0].Spec.Selector) - pods, err := podLister.List(selector) + pods, err := s.podLister.List(selector) if err != nil { return nil, err } diff --git a/plugin/pkg/scheduler/algorithm/priorities/selector_spreading_test.go b/plugin/pkg/scheduler/algorithm/priorities/selector_spreading_test.go index f50c3e79783..9fad1eb9177 100644 --- a/plugin/pkg/scheduler/algorithm/priorities/selector_spreading_test.go +++ b/plugin/pkg/scheduler/algorithm/priorities/selector_spreading_test.go @@ -24,8 +24,8 @@ import ( "k8s.io/kubernetes/pkg/api" wellknownlabels "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" - "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) func TestSelectorSpreadPriority(t *testing.T) { @@ -219,12 +219,9 @@ func TestSelectorSpreadPriority(t *testing.T) { } for _, test := range tests { - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - selectorSpread := SelectorSpread{serviceLister: algorithm.FakeServiceLister(test.services), controllerLister: algorithm.FakeControllerLister(test.rcs)} - list, err := selectorSpread.CalculateSpreadPriority(test.pod, m2p, algorithm.FakePodLister(test.pods), algorithm.FakeNodeLister(makeNodeList(test.nodes))) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + selectorSpread := SelectorSpread{podLister: algorithm.FakePodLister(test.pods), serviceLister: algorithm.FakeServiceLister(test.services), controllerLister: algorithm.FakeControllerLister(test.rcs)} + list, err := selectorSpread.CalculateSpreadPriority(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(makeNodeList(test.nodes))) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -422,12 +419,9 @@ func TestZoneSelectorSpreadPriority(t *testing.T) { } for _, test := range tests { - selectorSpread := SelectorSpread{serviceLister: algorithm.FakeServiceLister(test.services), controllerLister: algorithm.FakeControllerLister(test.rcs)} - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - list, err := selectorSpread.CalculateSpreadPriority(test.pod, m2p, algorithm.FakePodLister(test.pods), algorithm.FakeNodeLister(makeLabeledNodeList(labeledNodes))) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + selectorSpread := SelectorSpread{podLister: algorithm.FakePodLister(test.pods), serviceLister: algorithm.FakeServiceLister(test.services), controllerLister: algorithm.FakeControllerLister(test.rcs)} + list, err := selectorSpread.CalculateSpreadPriority(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(makeLabeledNodeList(labeledNodes))) if err != nil { t.Errorf("unexpected error: %v", err) } @@ -597,12 +591,9 @@ func TestZoneSpreadPriority(t *testing.T) { } for _, test := range tests { - m2p, err := predicates.MapPodsToMachines(algorithm.FakePodLister(test.pods)) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - zoneSpread := ServiceAntiAffinity{serviceLister: algorithm.FakeServiceLister(test.services), label: "zone"} - list, err := zoneSpread.CalculateAntiAffinityPriority(test.pod, m2p, algorithm.FakePodLister(test.pods), algorithm.FakeNodeLister(makeLabeledNodeList(test.nodes))) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(test.pods) + zoneSpread := ServiceAntiAffinity{podLister: algorithm.FakePodLister(test.pods), serviceLister: algorithm.FakeServiceLister(test.services), label: "zone"} + list, err := zoneSpread.CalculateAntiAffinityPriority(test.pod, nodeNameToInfo, algorithm.FakeNodeLister(makeLabeledNodeList(test.nodes))) if err != nil { t.Errorf("unexpected error: %v", err) } diff --git a/plugin/pkg/scheduler/algorithm/types.go b/plugin/pkg/scheduler/algorithm/types.go index a0df5b58c86..ffce2c71583 100644 --- a/plugin/pkg/scheduler/algorithm/types.go +++ b/plugin/pkg/scheduler/algorithm/types.go @@ -19,12 +19,13 @@ package algorithm import ( "k8s.io/kubernetes/pkg/api" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) // FitPredicate is a function that indicates if a pod fits into an existing node. -type FitPredicate func(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) +type FitPredicate func(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) -type PriorityFunction func(pod *api.Pod, machineToPods map[string][]*api.Pod, podLister PodLister, nodeLister NodeLister) (schedulerapi.HostPriorityList, error) +type PriorityFunction func(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister NodeLister) (schedulerapi.HostPriorityList, error) type PriorityConfig struct { Function PriorityFunction diff --git a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go index 7704dd4e260..9f1b92cdcca 100644 --- a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go +++ b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go @@ -18,14 +18,41 @@ limitations under the License. package defaults import ( + "os" + "strconv" + "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/plugin/pkg/scheduler" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities" "k8s.io/kubernetes/plugin/pkg/scheduler/factory" + + "github.com/golang/glog" ) +// Amazon reccomends having no more that 40 volumes attached to an instance, +// and at least one of those is for the system root volume. +const DefaultMaxEBSVolumes = 39 + +// GCE instances can have up to 16 PD volumes attached. +const DefaultMaxGCEPDVolumes = 16 + +// getMaxVols checks the max PD volumes environment variable, otherwise returning a default value +func getMaxVols(defaultVal int) int { + if rawMaxVols := os.Getenv("KUBE_MAX_PD_VOLS"); rawMaxVols != "" { + if parsedMaxVols, err := strconv.Atoi(rawMaxVols); err != nil { + glog.Errorf("Unable to parse maxiumum PD volumes value, using default of %v: %v", defaultVal, err) + } else if parsedMaxVols <= 0 { + glog.Errorf("Maximum PD volumes must be a positive value, using default of %v", defaultVal) + } else { + return parsedMaxVols + } + } + + return defaultVal +} + func init() { factory.RegisterAlgorithmProvider(factory.DefaultProvider, defaultPredicates(), defaultPriorities()) // EqualPriority is a prioritizer function that gives an equal weight of one to all nodes @@ -41,7 +68,7 @@ func init() { "ServiceSpreadingPriority", factory.PriorityConfigFactory{ Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction { - return priorities.NewSelectorSpreadPriority(args.ServiceLister, algorithm.EmptyControllerLister{}) + return priorities.NewSelectorSpreadPriority(args.PodLister, args.ServiceLister, algorithm.EmptyControllerLister{}) }, Weight: 1, }, @@ -80,6 +107,26 @@ func defaultPredicates() sets.String { ), // Fit is determined by the presence of the Host parameter and a string match factory.RegisterFitPredicate("HostName", predicates.PodFitsHost), + + // Fit is determined by whether or not there would be too many AWS EBS volumes attached to the node + factory.RegisterFitPredicateFactory( + "MaxEBSVolumeCount", + func(args factory.PluginFactoryArgs) algorithm.FitPredicate { + // TODO: allow for generically parameterized scheduler predicates, because this is a bit ugly + maxVols := getMaxVols(DefaultMaxEBSVolumes) + return predicates.NewMaxPDVolumeCountPredicate(predicates.EBSVolumeFilter, maxVols, args.PVInfo, args.PVCInfo) + }, + ), + + // Fit is determined by whether or not there would be too many GCE PD volumes attached to the node + factory.RegisterFitPredicateFactory( + "MaxGCEPDVolumeCount", + func(args factory.PluginFactoryArgs) algorithm.FitPredicate { + // TODO: allow for generically parameterized scheduler predicates, because this is a bit ugly + maxVols := getMaxVols(DefaultMaxGCEPDVolumes) + return predicates.NewMaxPDVolumeCountPredicate(predicates.GCEPDVolumeFilter, maxVols, args.PVInfo, args.PVCInfo) + }, + ), ) } @@ -94,7 +141,16 @@ func defaultPriorities() sets.String { "SelectorSpreadPriority", factory.PriorityConfigFactory{ Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction { - return priorities.NewSelectorSpreadPriority(args.ServiceLister, args.ControllerLister) + return priorities.NewSelectorSpreadPriority(args.PodLister, args.ServiceLister, args.ControllerLister) + }, + Weight: 1, + }, + ), + factory.RegisterPriorityConfigFactory( + "NodeAffinityPriority", + factory.PriorityConfigFactory{ + Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction { + return priorities.NewNodeAffinityPriority(args.NodeLister) }, Weight: 1, }, diff --git a/plugin/pkg/scheduler/extender_test.go b/plugin/pkg/scheduler/extender_test.go index 2d052ae96c8..ad869c9c473 100644 --- a/plugin/pkg/scheduler/extender_test.go +++ b/plugin/pkg/scheduler/extender_test.go @@ -24,6 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) type fitPredicate func(pod *api.Pod, node *api.Node) (bool, error) @@ -88,7 +89,7 @@ func machine2PrioritizerExtender(pod *api.Pod, nodes *api.NodeList) (*schedulera return &result, nil } -func machine2Prioritizer(_ *api.Pod, machineToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func machine2Prioritizer(_ *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { nodes, err := nodeLister.List() if err != nil { return []schedulerapi.HostPriority{}, err diff --git a/plugin/pkg/scheduler/factory/factory_test.go b/plugin/pkg/scheduler/factory/factory_test.go index fb14a7929de..c97a79cc443 100644 --- a/plugin/pkg/scheduler/factory/factory_test.go +++ b/plugin/pkg/scheduler/factory/factory_test.go @@ -34,6 +34,7 @@ import ( "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" latestschedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api/latest" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) func TestCreate(t *testing.T) { @@ -117,19 +118,19 @@ func TestCreateFromEmptyConfig(t *testing.T) { factory.CreateFromConfig(policy) } -func PredicateOne(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func PredicateOne(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { return true, nil } -func PredicateTwo(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func PredicateTwo(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { return true, nil } -func PriorityOne(pod *api.Pod, m2p map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func PriorityOne(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { return []schedulerapi.HostPriority{}, nil } -func PriorityTwo(pod *api.Pod, m2p map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func PriorityTwo(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { return []schedulerapi.HostPriority{}, nil } diff --git a/plugin/pkg/scheduler/factory/plugins.go b/plugin/pkg/scheduler/factory/plugins.go index 93f95594e54..06d3755ee44 100644 --- a/plugin/pkg/scheduler/factory/plugins.go +++ b/plugin/pkg/scheduler/factory/plugins.go @@ -33,13 +33,13 @@ import ( // PluginFactoryArgs are passed to all plugin factory functions. type PluginFactoryArgs struct { - algorithm.PodLister - algorithm.ServiceLister - algorithm.ControllerLister - NodeLister algorithm.NodeLister - NodeInfo predicates.NodeInfo - PVInfo predicates.PersistentVolumeInfo - PVCInfo predicates.PersistentVolumeClaimInfo + PodLister algorithm.PodLister + ServiceLister algorithm.ServiceLister + ControllerLister algorithm.ControllerLister + NodeLister algorithm.NodeLister + NodeInfo predicates.NodeInfo + PVInfo predicates.PersistentVolumeInfo + PVCInfo predicates.PersistentVolumeClaimInfo } // A FitPredicateFactory produces a FitPredicate from the given args. @@ -168,6 +168,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string { pcf = &PriorityConfigFactory{ Function: func(args PluginFactoryArgs) algorithm.PriorityFunction { return priorities.NewServiceAntiAffinityPriority( + args.PodLister, args.ServiceLister, policy.Argument.ServiceAntiAffinity.Label, ) diff --git a/plugin/pkg/scheduler/generic_scheduler.go b/plugin/pkg/scheduler/generic_scheduler.go index aa94d8b0d09..e1c8a7df918 100644 --- a/plugin/pkg/scheduler/generic_scheduler.go +++ b/plugin/pkg/scheduler/generic_scheduler.go @@ -20,17 +20,18 @@ import ( "bytes" "fmt" "math/rand" - "sort" "strings" "sync" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util/errors" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) type FailedPredicateMap map[string]sets.String @@ -76,12 +77,12 @@ func (g *genericScheduler) Schedule(pod *api.Pod, nodeLister algorithm.NodeListe // TODO: we should compute this once and dynamically update it using Watch, not constantly re-compute. // But at least we're now only doing it in one place - machinesToPods, err := predicates.MapPodsToMachines(g.pods) + pods, err := g.pods.List(labels.Everything()) if err != nil { return "", err } - - filteredNodes, failedPredicateMap, err := findNodesThatFit(pod, machinesToPods, g.predicates, nodes, g.extenders) + nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(pods) + filteredNodes, failedPredicateMap, err := findNodesThatFit(pod, nodeNameToInfo, g.predicates, nodes, g.extenders) if err != nil { return "", err } @@ -93,7 +94,7 @@ func (g *genericScheduler) Schedule(pod *api.Pod, nodeLister algorithm.NodeListe } } - priorityList, err := PrioritizeNodes(pod, machinesToPods, g.pods, g.prioritizers, algorithm.FakeNodeLister(filteredNodes), g.extenders) + priorityList, err := PrioritizeNodes(pod, nodeNameToInfo, g.pods, g.prioritizers, algorithm.FakeNodeLister(filteredNodes), g.extenders) if err != nil { return "", err } @@ -101,32 +102,43 @@ func (g *genericScheduler) Schedule(pod *api.Pod, nodeLister algorithm.NodeListe return g.selectHost(priorityList) } -// This method takes a prioritized list of nodes and sorts them in reverse order based on scores -// and then picks one randomly from the nodes that had the highest score +// selectHost takes a prioritized list of nodes and then picks one +// randomly from the nodes that had the highest score. func (g *genericScheduler) selectHost(priorityList schedulerapi.HostPriorityList) (string, error) { if len(priorityList) == 0 { return "", fmt.Errorf("empty priorityList") } - sort.Sort(sort.Reverse(priorityList)) - hosts := getBestHosts(priorityList) + maxScore := priorityList[0].Score + // idx contains indices of elements with score == maxScore. + idx := []int{} + + for i, entry := range priorityList { + if entry.Score > maxScore { + maxScore = entry.Score + idx = []int{i} + } else if entry.Score == maxScore { + idx = append(idx, i) + } + } + g.randomLock.Lock() - defer g.randomLock.Unlock() + ix := g.random.Int() % len(idx) + g.randomLock.Unlock() - ix := g.random.Int() % len(hosts) - return hosts[ix], nil + return priorityList[idx[ix]].Host, nil } // Filters the nodes to find the ones that fit based on the given predicate functions // Each node is passed through the predicate functions to determine if it is a fit -func findNodesThatFit(pod *api.Pod, machineToPods map[string][]*api.Pod, predicateFuncs map[string]algorithm.FitPredicate, nodes api.NodeList, extenders []algorithm.SchedulerExtender) (api.NodeList, FailedPredicateMap, error) { +func findNodesThatFit(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, predicateFuncs map[string]algorithm.FitPredicate, nodes api.NodeList, extenders []algorithm.SchedulerExtender) (api.NodeList, FailedPredicateMap, error) { filtered := []api.Node{} failedPredicateMap := FailedPredicateMap{} for _, node := range nodes.Items { fits := true for name, predicate := range predicateFuncs { - fit, err := predicate(pod, machineToPods[node.Name], node.Name) + fit, err := predicate(pod, node.Name, nodeNameToInfo[node.Name]) if err != nil { switch e := err.(type) { case *predicates.InsufficientResourceError: @@ -176,13 +188,13 @@ func findNodesThatFit(pod *api.Pod, machineToPods map[string][]*api.Pod, predica // Each priority function can also have its own weight // The node scores returned by the priority function are multiplied by the weights to get weighted scores // All scores are finally combined (added) to get the total weighted scores of all nodes -func PrioritizeNodes(pod *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, priorityConfigs []algorithm.PriorityConfig, nodeLister algorithm.NodeLister, extenders []algorithm.SchedulerExtender) (schedulerapi.HostPriorityList, error) { +func PrioritizeNodes(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, podLister algorithm.PodLister, priorityConfigs []algorithm.PriorityConfig, nodeLister algorithm.NodeLister, extenders []algorithm.SchedulerExtender) (schedulerapi.HostPriorityList, error) { result := schedulerapi.HostPriorityList{} // If no priority configs are provided, then the EqualPriority function is applied // This is required to generate the priority list in the required format if len(priorityConfigs) == 0 && len(extenders) == 0 { - return EqualPriority(pod, machinesToPods, podLister, nodeLister) + return EqualPriority(pod, nodeNameToInfo, nodeLister) } var ( @@ -203,7 +215,7 @@ func PrioritizeNodes(pod *api.Pod, machinesToPods map[string][]*api.Pod, podList defer wg.Done() weight := config.Weight priorityFunc := config.Function - prioritizedList, err := priorityFunc(pod, machinesToPods, podLister, nodeLister) + prioritizedList, err := priorityFunc(pod, nodeNameToInfo, nodeLister) if err != nil { mu.Lock() errs = append(errs, err) @@ -258,20 +270,8 @@ func PrioritizeNodes(pod *api.Pod, machinesToPods map[string][]*api.Pod, podList return result, nil } -func getBestHosts(list schedulerapi.HostPriorityList) []string { - result := []string{} - for _, hostEntry := range list { - if hostEntry.Score == list[0].Score { - result = append(result, hostEntry.Host) - } else { - break - } - } - return result -} - // EqualPriority is a prioritizer function that gives an equal weight of one to all nodes -func EqualPriority(_ *api.Pod, machinesToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func EqualPriority(_ *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { nodes, err := nodeLister.List() if err != nil { glog.Errorf("Failed to list nodes: %v", err) diff --git a/plugin/pkg/scheduler/generic_scheduler_test.go b/plugin/pkg/scheduler/generic_scheduler_test.go index 3c403037b61..de63abf8647 100644 --- a/plugin/pkg/scheduler/generic_scheduler_test.go +++ b/plugin/pkg/scheduler/generic_scheduler_test.go @@ -27,25 +27,26 @@ import ( "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" ) -func falsePredicate(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func falsePredicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { return false, nil } -func truePredicate(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { +func truePredicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { return true, nil } -func matchesPredicate(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { - return pod.Name == node, nil +func matchesPredicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + return pod.Name == nodeName, nil } -func hasNoPodsPredicate(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) { - return len(existingPods) == 0, nil +func hasNoPodsPredicate(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error) { + return len(nodeInfo.Pods()) == 0, nil } -func numericPriority(pod *api.Pod, machineToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func numericPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { nodes, err := nodeLister.List() result := []schedulerapi.HostPriority{} @@ -65,11 +66,11 @@ func numericPriority(pod *api.Pod, machineToPods map[string][]*api.Pod, podListe return result, nil } -func reverseNumericPriority(pod *api.Pod, machineToPods map[string][]*api.Pod, podLister algorithm.PodLister, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { +func reverseNumericPriority(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error) { var maxScore float64 minScore := math.MaxFloat64 reverseResult := []schedulerapi.HostPriority{} - result, err := numericPriority(pod, machineToPods, podLister, nodeLister) + result, err := numericPriority(pod, nodeNameToInfo, nodeLister) if err != nil { return nil, err } @@ -166,14 +167,14 @@ func TestSelectHost(t *testing.T) { func TestGenericScheduler(t *testing.T) { tests := []struct { - name string - predicates map[string]algorithm.FitPredicate - prioritizers []algorithm.PriorityConfig - nodes []string - pod *api.Pod - pods []*api.Pod - expectedHost string - expectsErr bool + name string + predicates map[string]algorithm.FitPredicate + prioritizers []algorithm.PriorityConfig + nodes []string + pod *api.Pod + pods []*api.Pod + expectedHosts sets.String + expectsErr bool }{ { predicates: map[string]algorithm.FitPredicate{"false": falsePredicate}, @@ -183,44 +184,43 @@ func TestGenericScheduler(t *testing.T) { name: "test 1", }, { - predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, - prioritizers: []algorithm.PriorityConfig{{Function: EqualPriority, Weight: 1}}, - nodes: []string{"machine1", "machine2"}, - // Random choice between both, the rand seeded above with zero, chooses "machine1" - expectedHost: "machine1", - name: "test 2", + predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, + prioritizers: []algorithm.PriorityConfig{{Function: EqualPriority, Weight: 1}}, + nodes: []string{"machine1", "machine2"}, + expectedHosts: sets.NewString("machine1", "machine2"), + name: "test 2", }, { // Fits on a machine where the pod ID matches the machine name - predicates: map[string]algorithm.FitPredicate{"matches": matchesPredicate}, - prioritizers: []algorithm.PriorityConfig{{Function: EqualPriority, Weight: 1}}, - nodes: []string{"machine1", "machine2"}, - pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "machine2"}}, - expectedHost: "machine2", - name: "test 3", + predicates: map[string]algorithm.FitPredicate{"matches": matchesPredicate}, + prioritizers: []algorithm.PriorityConfig{{Function: EqualPriority, Weight: 1}}, + nodes: []string{"machine1", "machine2"}, + pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "machine2"}}, + expectedHosts: sets.NewString("machine2"), + name: "test 3", }, { - predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, - prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}}, - nodes: []string{"3", "2", "1"}, - expectedHost: "3", - name: "test 4", + predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, + prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}}, + nodes: []string{"3", "2", "1"}, + expectedHosts: sets.NewString("3"), + name: "test 4", }, { - predicates: map[string]algorithm.FitPredicate{"matches": matchesPredicate}, - prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}}, - nodes: []string{"3", "2", "1"}, - pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}}, - expectedHost: "2", - name: "test 5", + predicates: map[string]algorithm.FitPredicate{"matches": matchesPredicate}, + prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}}, + nodes: []string{"3", "2", "1"}, + pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}}, + expectedHosts: sets.NewString("2"), + name: "test 5", }, { - predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, - prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}, {Function: reverseNumericPriority, Weight: 2}}, - nodes: []string{"3", "2", "1"}, - pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}}, - expectedHost: "1", - name: "test 6", + predicates: map[string]algorithm.FitPredicate{"true": truePredicate}, + prioritizers: []algorithm.PriorityConfig{{Function: numericPriority, Weight: 1}, {Function: reverseNumericPriority, Weight: 2}}, + nodes: []string{"3", "2", "1"}, + pod: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}}, + expectedHosts: sets.NewString("1"), + name: "test 6", }, { predicates: map[string]algorithm.FitPredicate{"true": truePredicate, "false": falsePredicate}, @@ -266,8 +266,8 @@ func TestGenericScheduler(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %v", err) } - if test.expectedHost != machine { - t.Errorf("Failed : %s, Expected: %s, Saw: %s", test.name, test.expectedHost, machine) + if !test.expectedHosts.Has(machine) { + t.Errorf("Failed : %s, Expected: %s, Saw: %s", test.name, test.expectedHosts, machine) } } } @@ -276,12 +276,12 @@ func TestGenericScheduler(t *testing.T) { func TestFindFitAllError(t *testing.T) { nodes := []string{"3", "2", "1"} predicates := map[string]algorithm.FitPredicate{"true": truePredicate, "false": falsePredicate} - machineToPods := map[string][]*api.Pod{ - "3": {}, - "2": {}, - "1": {}, + nodeNameToInfo := map[string]*schedulercache.NodeInfo{ + "3": schedulercache.NewNodeInfo(), + "2": schedulercache.NewNodeInfo(), + "1": schedulercache.NewNodeInfo(), } - _, predicateMap, err := findNodesThatFit(&api.Pod{}, machineToPods, predicates, makeNodeList(nodes), nil) + _, predicateMap, err := findNodesThatFit(&api.Pod{}, nodeNameToInfo, predicates, makeNodeList(nodes), nil) if err != nil { t.Errorf("unexpected error: %v", err) @@ -306,12 +306,12 @@ func TestFindFitSomeError(t *testing.T) { nodes := []string{"3", "2", "1"} predicates := map[string]algorithm.FitPredicate{"true": truePredicate, "match": matchesPredicate} pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}} - machineToPods := map[string][]*api.Pod{ - "3": {}, - "2": {}, - "1": {pod}, + nodeNameToInfo := map[string]*schedulercache.NodeInfo{ + "3": schedulercache.NewNodeInfo(), + "2": schedulercache.NewNodeInfo(), + "1": schedulercache.NewNodeInfo(pod), } - _, predicateMap, err := findNodesThatFit(pod, machineToPods, predicates, makeNodeList(nodes), nil) + _, predicateMap, err := findNodesThatFit(pod, nodeNameToInfo, predicates, makeNodeList(nodes), nil) if err != nil { t.Errorf("unexpected error: %v", err) diff --git a/plugin/pkg/scheduler/scheduler.go b/plugin/pkg/scheduler/scheduler.go index 371a3240ed5..124d8240b5e 100644 --- a/plugin/pkg/scheduler/scheduler.go +++ b/plugin/pkg/scheduler/scheduler.go @@ -24,7 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/record" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm" "k8s.io/kubernetes/plugin/pkg/scheduler/metrics" @@ -104,7 +104,7 @@ func New(c *Config) *Scheduler { // Run begins watching and scheduling. It starts a goroutine and returns immediately. func (s *Scheduler) Run() { - go util.Until(s.scheduleOne, 0, s.config.StopEverything) + go wait.Until(s.scheduleOne, 0, s.config.StopEverything) } func (s *Scheduler) scheduleOne() { diff --git a/plugin/pkg/scheduler/scheduler_test.go b/plugin/pkg/scheduler/scheduler_test.go index fe568cedc0d..9ce9a6ab52d 100644 --- a/plugin/pkg/scheduler/scheduler_test.go +++ b/plugin/pkg/scheduler/scheduler_test.go @@ -176,7 +176,7 @@ func TestSchedulerForgetAssumedPodAfterDelete(t *testing.T) { // all entries inserted with fakeTime will expire. ttl := 30 * time.Second fakeTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) - fakeClock := &util.FakeClock{Time: fakeTime} + fakeClock := util.NewFakeClock(fakeTime) ttlPolicy := &cache.TTLPolicy{Ttl: ttl, Clock: fakeClock} assumedPodsStore := cache.NewFakeExpirationStore( cache.MetaNamespaceKeyFunc, nil, ttlPolicy, fakeClock) @@ -274,7 +274,7 @@ func TestSchedulerForgetAssumedPodAfterDelete(t *testing.T) { // Second scheduling pass will fail to schedule if the store hasn't expired // the deleted pod. This would normally happen with a timeout. //expirationPolicy.NeverExpire = util.NewStringSet() - fakeClock.Time = fakeClock.Time.Add(ttl + 1) + fakeClock.Step(ttl + 1) called = make(chan struct{}) events = eventBroadcaster.StartEventWatcher(func(e *api.Event) { diff --git a/plugin/pkg/scheduler/schedulercache/node_info.go b/plugin/pkg/scheduler/schedulercache/node_info.go new file mode 100644 index 00000000000..746386e0b2d --- /dev/null +++ b/plugin/pkg/scheduler/schedulercache/node_info.go @@ -0,0 +1,96 @@ +/* +Copyright 2015 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. +*/ + +package schedulercache + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/api" +) + +var emptyResource = Resource{} + +// NodeInfo is node level aggregated information. +type NodeInfo struct { + // Total requested resource of all pods on this node. + // It includes assumed pods which scheduler sends binding to apiserver but + // didn't get it as scheduled yet. + requestedResource *Resource + pods []*api.Pod +} + +// Resource is a collection of compute resource. +type Resource struct { + MilliCPU int64 + Memory int64 +} + +// NewNodeInfo returns a ready to use empty NodeInfo object. +// If any pods are given in arguments, their information will be aggregated in +// the returned object. +func NewNodeInfo(pods ...*api.Pod) *NodeInfo { + ni := &NodeInfo{ + requestedResource: &Resource{}, + } + for _, pod := range pods { + ni.addPod(pod) + } + return ni +} + +// Pods return all pods scheduled (including assumed to be) on this node. +func (n *NodeInfo) Pods() []*api.Pod { + if n == nil { + return nil + } + return n.pods +} + +// RequestedResource returns aggregated resource request of pods on this node. +func (n *NodeInfo) RequestedResource() Resource { + if n == nil { + return emptyResource + } + return *n.requestedResource +} + +// String returns representation of human readable format of this NodeInfo. +func (n *NodeInfo) String() string { + podKeys := make([]string, len(n.pods)) + for i, pod := range n.pods { + podKeys[i] = pod.Name + } + return fmt.Sprintf("&NodeInfo{Pods:%v, RequestedResource:%#v}", podKeys, n.requestedResource) +} + +// addPod adds pod information to this NodeInfo. +func (n *NodeInfo) addPod(pod *api.Pod) { + cpu, mem := calculateResource(pod) + n.requestedResource.MilliCPU += cpu + n.requestedResource.Memory += mem + n.pods = append(n.pods, pod) +} + +func calculateResource(pod *api.Pod) (int64, int64) { + var cpu, mem int64 + for _, c := range pod.Spec.Containers { + req := c.Resources.Requests + cpu += req.Cpu().MilliValue() + mem += req.Memory().Value() + } + return cpu, mem +} diff --git a/plugin/pkg/scheduler/schedulercache/util.go b/plugin/pkg/scheduler/schedulercache/util.go new file mode 100644 index 00000000000..7d840b59cd1 --- /dev/null +++ b/plugin/pkg/scheduler/schedulercache/util.go @@ -0,0 +1,35 @@ +/* +Copyright 2015 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. +*/ + +package schedulercache + +import "k8s.io/kubernetes/pkg/api" + +// CreateNodeNameToInfoMap obtains a list of pods and pivots that list into a map where the keys are node names +// and the values are the aggregated information for that node. +func CreateNodeNameToInfoMap(pods []*api.Pod) map[string]*NodeInfo { + nodeNameToInfo := make(map[string]*NodeInfo) + for _, pod := range pods { + nodeName := pod.Spec.NodeName + nodeInfo, ok := nodeNameToInfo[nodeName] + if !ok { + nodeInfo = NewNodeInfo() + nodeNameToInfo[nodeName] = nodeInfo + } + nodeInfo.addPod(pod) + } + return nodeNameToInfo +} diff --git a/test/component/scheduler/perf/util.go b/test/component/scheduler/perf/util.go index 7c5a1d5c190..49b6acaf656 100644 --- a/test/component/scheduler/perf/util.go +++ b/test/component/scheduler/perf/util.go @@ -45,7 +45,10 @@ func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destro var m *master.Master masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + panic("error in brining up the master: " + err.Error()) + } s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { m.Handler.ServeHTTP(w, req) })) diff --git a/test/e2e/cadvisor.go b/test/e2e/cadvisor.go index 4cddade31ca..2553d7f31b7 100644 --- a/test/e2e/cadvisor.go +++ b/test/e2e/cadvisor.go @@ -27,7 +27,6 @@ import ( ) const ( - timeout = 1 * time.Minute maxRetries = 6 sleepDuration = 10 * time.Second ) diff --git a/test/e2e/cluster_upgrade.go b/test/e2e/cluster_upgrade.go index 7338ff8baf3..35294ad7e9b 100644 --- a/test/e2e/cluster_upgrade.go +++ b/test/e2e/cluster_upgrade.go @@ -30,7 +30,6 @@ import ( "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/wait" . "github.com/onsi/ginkgo" @@ -162,7 +161,7 @@ var _ = Describe("Upgrade [Feature:Upgrade]", func() { }) f := NewFramework("cluster-upgrade") - var w *ServerTest + var w *ServiceTestFixture BeforeEach(func() { By("Setting up the service, RC, and pods") w = NewServerTest(f.Client, f.Namespace.Name, svcName) @@ -290,7 +289,7 @@ func testMasterUpgrade(ip, v string, mUp func(v string) error) { done := make(chan struct{}, 1) // Let's make sure we've finished the heartbeat before shutting things down. var wg sync.WaitGroup - go util.Until(func() { + go wait.Until(func() { defer GinkgoRecover() wg.Add(1) defer wg.Done() @@ -610,3 +609,57 @@ func migRollingUpdatePoll(id string, nt time.Duration) error { Logf("MIG rolling update complete after %v", time.Since(start)) return nil } + +func testLoadBalancerReachable(ingress api.LoadBalancerIngress, port int) bool { + return testLoadBalancerReachableInTime(ingress, port, loadBalancerLagTimeout) +} + +func testLoadBalancerReachableInTime(ingress api.LoadBalancerIngress, port int, timeout time.Duration) bool { + ip := ingress.IP + if ip == "" { + ip = ingress.Hostname + } + + return testReachableInTime(conditionFuncDecorator(ip, port, testReachableHTTP, "/", "test-webserver"), timeout) + +} + +func conditionFuncDecorator(ip string, port int, fn func(string, int, string, string) (bool, error), request string, expect string) wait.ConditionFunc { + return func() (bool, error) { + return fn(ip, port, request, expect) + } +} + +func testReachableInTime(testFunc wait.ConditionFunc, timeout time.Duration) bool { + By(fmt.Sprintf("Waiting up to %v", timeout)) + err := wait.PollImmediate(poll, timeout, testFunc) + if err != nil { + Expect(err).NotTo(HaveOccurred(), "Error waiting") + return false + } + return true +} + +func waitForLoadBalancerIngress(c *client.Client, serviceName, namespace string) (*api.Service, error) { + // TODO: once support ticket 21807001 is resolved, reduce this timeout + // back to something reasonable + const timeout = 20 * time.Minute + var service *api.Service + By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to have a LoadBalancer ingress point", timeout, serviceName, namespace)) + i := 1 + for start := time.Now(); time.Since(start) < timeout; time.Sleep(3 * time.Second) { + service, err := c.Services(namespace).Get(serviceName) + if err != nil { + Logf("Get service failed, ignoring for 5s: %v", err) + continue + } + if len(service.Status.LoadBalancer.Ingress) > 0 { + return service, nil + } + if i%5 == 0 { + Logf("Waiting for service %s in namespace %s to have a LoadBalancer ingress point (%v)", serviceName, namespace, time.Since(start)) + } + i++ + } + return service, fmt.Errorf("service %s in namespace %s doesn't have a LoadBalancer ingress point after %.2f seconds", serviceName, namespace, timeout.Seconds()) +} diff --git a/test/e2e/configmap.go b/test/e2e/configmap.go index 24458ed0979..56b269c33c1 100644 --- a/test/e2e/configmap.go +++ b/test/e2e/configmap.go @@ -62,7 +62,7 @@ var _ = Describe("ConfigMap", func() { Containers: []api.Container{ { Name: "env-test", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "env"}, Env: []api.EnvVar{ { diff --git a/test/e2e/core.go b/test/e2e/core.go index e0adc5754dd..3dd1896a80d 100644 --- a/test/e2e/core.go +++ b/test/e2e/core.go @@ -57,6 +57,7 @@ func CoreDump(dir string) { cmds = append(cmds, []command{ {"cat /var/log/kubelet.log", "kubelet"}, {"cat /var/log/supervisor/supervisord.log", "supervisord"}, + {"cat /var/log/dmesg", "dmesg"}, }...) } diff --git a/test/e2e/daemon_restart.go b/test/e2e/daemon_restart.go index 7ef21b5fd31..6bd4ebe685e 100644 --- a/test/e2e/daemon_restart.go +++ b/test/e2e/daemon_restart.go @@ -183,8 +183,7 @@ func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Sele return failedContainers, containerRestartNodes.List() } -// Flaky issues #17829, #19023 -var _ = Describe("DaemonRestart [Disruptive] [Flaky]", func() { +var _ = Describe("DaemonRestart [Disruptive]", func() { framework := NewFramework("daemonrestart") rcName := "daemonrestart" + strconv.Itoa(numPods) + "-" + string(util.NewUUID()) diff --git a/test/e2e/daemon_set.go b/test/e2e/daemon_set.go index 5ee6bd24ae6..b0b0e4ecafd 100644 --- a/test/e2e/daemon_set.go +++ b/test/e2e/daemon_set.go @@ -147,7 +147,7 @@ var _ = Describe("Daemon set [Feature:DaemonSet]", func() { Name: dsName, }, Spec: extensions.DaemonSetSpec{ - Selector: &extensions.LabelSelector{MatchLabels: complexLabel}, + Selector: &unversioned.LabelSelector{MatchLabels: complexLabel}, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: complexLabel, diff --git a/test/e2e/kube-ui.go b/test/e2e/dashboard.go similarity index 81% rename from test/e2e/kube-ui.go rename to test/e2e/dashboard.go index 952eb9581cf..1faf97afc24 100644 --- a/test/e2e/kube-ui.go +++ b/test/e2e/dashboard.go @@ -28,28 +28,28 @@ import ( . "github.com/onsi/gomega" ) -var _ = Describe("kube-ui", func() { +var _ = Describe("Kubernetes Dashboard", func() { const ( - uiServiceName = "kube-ui" + uiServiceName = "kubernetes-dashboard" uiAppName = uiServiceName uiNamespace = api.NamespaceSystem serverStartTimeout = 1 * time.Minute ) - f := NewFramework("kube-ui") + f := NewFramework(uiServiceName) - It("should check that the kube-ui instance is alive [Conformance]", func() { - By("Checking the kube-ui service exists.") + It("should check that the kubernetes-dashboard instance is alive", func() { + By("Checking whether the kubernetes-dashboard service exists.") err := waitForService(f.Client, uiNamespace, uiServiceName, true, poll, serviceStartTimeout) Expect(err).NotTo(HaveOccurred()) - By("Checking to make sure the kube-ui pods are running") + By("Checking to make sure the kubernetes-dashboard pods are running") selector := labels.SelectorFromSet(labels.Set(map[string]string{"k8s-app": uiAppName})) err = waitForPodsWithLabelRunning(f.Client, uiNamespace, selector) Expect(err).NotTo(HaveOccurred()) - By("Checking to make sure we get a response from the kube-ui.") + By("Checking to make sure we get a response from the kubernetes-dashboard.") err = wait.Poll(poll, serverStartTimeout, func() (bool, error) { var status int // Query against the proxy URL for the kube-ui service. @@ -63,7 +63,7 @@ var _ = Describe("kube-ui", func() { StatusCode(&status). Error() if status != http.StatusOK { - Logf("Unexpected status from kube-ui: %v", status) + Logf("Unexpected status from kubernetes-dashboard: %v", status) } else if err != nil { Logf("Request to kube-ui failed: %v", err) } diff --git a/test/e2e/density.go b/test/e2e/density.go index c44f2eac2ce..b72180841d3 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -462,6 +462,21 @@ var _ = Describe("Density", func() { Logf("Approx throughput: %v pods/min", float64(nodeCount)/(e2eLag[len(e2eLag)-1].Latency.Minutes())) } + + By("Deleting ReplicationController and all additional Pods") + // We explicitly delete all pods to have API calls necessary for deletion accounted in metrics. + rc, err := c.ReplicationControllers(ns).Get(RCName) + if err == nil && rc.Spec.Replicas != 0 { + By("Cleaning up the replication controller") + err := DeleteRC(c, ns, RCName) + expectNoError(err) + } + + By("Removing additional pods if any") + for i := 1; i <= nodeCount; i++ { + name := additionalPodsPrefix + "-" + strconv.Itoa(i) + c.Pods(ns).Delete(name, nil) + } }) } }) diff --git a/test/e2e/deployment.go b/test/e2e/deployment.go index 1dc155875ff..2632b4231e6 100644 --- a/test/e2e/deployment.go +++ b/test/e2e/deployment.go @@ -21,9 +21,10 @@ import ( "time" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" - "k8s.io/kubernetes/pkg/labels" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + "k8s.io/kubernetes/pkg/kubectl" deploymentutil "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/util/intstr" @@ -46,7 +47,7 @@ var _ = Describe("Deployment [Feature:Deployment]", func() { It("RecreateDeployment should delete old pods and create new ones", func() { testRecreateDeployment(f) }) - It("deployment should delete old rcs", func() { + It("deployment should delete old replica sets", func() { testDeploymentCleanUpPolicy(f) }) It("deployment should support rollover", func() { @@ -58,22 +59,22 @@ var _ = Describe("Deployment [Feature:Deployment]", func() { It("deployment should support rollback", func() { testRollbackDeployment(f) }) - It("deployment should support rollback when there's RC with no revision", func() { - testRollbackDeploymentRCNoRevision(f) + It("deployment should support rollback when there's replica set with no revision", func() { + testRollbackDeploymentRSNoRevision(f) }) }) -func newRC(rcName string, replicas int, rcPodLabels map[string]string, imageName string, image string) *api.ReplicationController { - return &api.ReplicationController{ +func newRS(rsName string, replicas int, rsPodLabels map[string]string, imageName string, image string) *extensions.ReplicaSet { + return &extensions.ReplicaSet{ ObjectMeta: api.ObjectMeta{ - Name: rcName, + Name: rsName, }, - Spec: api.ReplicationControllerSpec{ + Spec: extensions.ReplicaSetSpec{ Replicas: replicas, - Selector: rcPodLabels, + Selector: &unversioned.LabelSelector{MatchLabels: rsPodLabels}, Template: &api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ - Labels: rcPodLabels, + Labels: rsPodLabels, }, Spec: api.PodSpec{ Containers: []api.Container{ @@ -95,12 +96,11 @@ func newDeployment(deploymentName string, replicas int, podLabels map[string]str }, Spec: extensions.DeploymentSpec{ Replicas: replicas, - Selector: podLabels, + Selector: &unversioned.LabelSelector{MatchLabels: podLabels}, Strategy: extensions.DeploymentStrategy{ Type: strategyType, }, RevisionHistoryLimit: revisionHistoryLimit, - UniqueLabelKey: extensions.DefaultDeploymentUniqueLabelKey, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: podLabels, @@ -126,27 +126,27 @@ func newDeploymentRollback(name string, annotations map[string]string, revision } } -// checkDeploymentRevision checks if the input deployment's and its new RC's revision and images are as expected. -func checkDeploymentRevision(c *clientset.Clientset, ns, deploymentName, revision, imageName, image string) (*extensions.Deployment, *api.ReplicationController) { +// checkDeploymentRevision checks if the input deployment's and its new replica set's revision and images are as expected. +func checkDeploymentRevision(c *clientset.Clientset, ns, deploymentName, revision, imageName, image string) (*extensions.Deployment, *extensions.ReplicaSet) { deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) - // Check revision of the new RC of this deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // Check revision of the new replica set of this deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(newRC.Annotations).NotTo(Equal(nil)) - Expect(newRC.Annotations[deploymentutil.RevisionAnnotation]).Should(Equal(revision)) + Expect(newRS.Annotations).NotTo(Equal(nil)) + Expect(newRS.Annotations[deploymentutil.RevisionAnnotation]).Should(Equal(revision)) // Check revision of This deployment Expect(deployment.Annotations).NotTo(Equal(nil)) Expect(deployment.Annotations[deploymentutil.RevisionAnnotation]).Should(Equal(revision)) if len(imageName) > 0 { - // Check the image the new RC creates - Expect(newRC.Spec.Template.Spec.Containers[0].Name).Should(Equal(imageName)) - Expect(newRC.Spec.Template.Spec.Containers[0].Image).Should(Equal(image)) + // Check the image the new replica set creates + Expect(newRS.Spec.Template.Spec.Containers[0].Name).Should(Equal(imageName)) + Expect(newRS.Spec.Template.Spec.Containers[0].Image).Should(Equal(image)) // Check the image the deployment creates Expect(deployment.Spec.Template.Spec.Containers[0].Name).Should(Equal(imageName)) Expect(deployment.Spec.Template.Spec.Containers[0].Image).Should(Equal(image)) } - return deployment, newRC + return deployment, newRS } func testNewDeployment(f *Framework) { @@ -160,17 +160,19 @@ func testNewDeployment(f *Framework) { podLabels := map[string]string{"name": "nginx"} replicas := 1 Logf("Creating simple deployment %s", deploymentName) - _, err := c.Extensions().Deployments(ns).Create(newDeployment(deploymentName, replicas, podLabels, "nginx", "nginx", extensions.RollingUpdateDeploymentStrategyType, nil)) + d := newDeployment(deploymentName, replicas, podLabels, "nginx", "nginx", extensions.RollingUpdateDeploymentStrategyType, nil) + d.Annotations = map[string]string{"test": "should-copy-to-replica-set", kubectl.LastAppliedConfigAnnotation: "should-not-copy-to-replica-set"} + _, err := c.Extensions().Deployments(ns).Create(d) Expect(err).NotTo(HaveOccurred()) defer func() { deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() // Check that deployment is created fine. deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) @@ -189,7 +191,12 @@ func testNewDeployment(f *Framework) { Expect(deployment.Status.UpdatedReplicas).Should(Equal(replicas)) // Check if it's updated to revision 1 correctly - checkDeploymentRevision(c, ns, deploymentName, "1", "nginx", "nginx") + _, newRS := checkDeploymentRevision(c, ns, deploymentName, "1", "nginx", "nginx") + // Check other annotations + Expect(newRS.Annotations["test"]).Should(Equal("should-copy-to-replica-set")) + Expect(newRS.Annotations[kubectl.LastAppliedConfigAnnotation]).Should(Equal("")) + Expect(deployment.Annotations["test"]).Should(Equal("should-copy-to-replica-set")) + Expect(deployment.Annotations[kubectl.LastAppliedConfigAnnotation]).Should(Equal("should-not-copy-to-replica-set")) } func testRollingUpdateDeployment(f *Framework) { @@ -200,18 +207,18 @@ func testRollingUpdateDeployment(f *Framework) { c := clientset.FromUnversionedClient(unversionedClient) // Create nginx pods. deploymentPodLabels := map[string]string{"name": "sample-pod"} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": "sample-pod", "pod": "nginx", } - rcName := "nginx-controller" + rsName := "nginx-controller" replicas := 3 - _, err := c.Legacy().ReplicationControllers(ns).Create(newRC(rcName, replicas, rcPodLabels, "nginx", "nginx")) + _, err := c.Extensions().ReplicaSets(ns).Create(newRS(rsName, replicas, rsPodLabels, "nginx", "nginx")) Expect(err).NotTo(HaveOccurred()) defer func() { - Logf("deleting replication controller %s", rcName) - Expect(c.Legacy().ReplicationControllers(ns).Delete(rcName, nil)).NotTo(HaveOccurred()) + Logf("deleting replica set %s", rsName) + Expect(c.Extensions().ReplicaSets(ns).Delete(rsName, nil)).NotTo(HaveOccurred()) }() // Verify that the required pods have come up. err = verifyPods(unversionedClient, ns, "sample-pod", false, 3) @@ -230,10 +237,10 @@ func testRollingUpdateDeployment(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() err = waitForDeploymentStatus(c, ns, deploymentName, replicas, replicas-1, replicas+1, 0) @@ -251,24 +258,24 @@ func testRollingUpdateDeploymentEvents(f *Framework) { c := clientset.FromUnversionedClient(unversionedClient) // Create nginx pods. deploymentPodLabels := map[string]string{"name": "sample-pod-2"} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": "sample-pod-2", "pod": "nginx", } - rcName := "nginx-controller" + rsName := "nginx-controller" replicas := 1 - rcRevision := "3546343826724305832" + rsRevision := "3546343826724305832" annotations := make(map[string]string) - annotations[deploymentutil.RevisionAnnotation] = rcRevision - rc := newRC(rcName, replicas, rcPodLabels, "nginx", "nginx") - rc.Annotations = annotations + annotations[deploymentutil.RevisionAnnotation] = rsRevision + rs := newRS(rsName, replicas, rsPodLabels, "nginx", "nginx") + rs.Annotations = annotations - _, err := c.Legacy().ReplicationControllers(ns).Create(rc) + _, err := c.Extensions().ReplicaSets(ns).Create(rs) Expect(err).NotTo(HaveOccurred()) defer func() { - Logf("deleting replication controller %s", rcName) - Expect(c.Legacy().ReplicationControllers(ns).Delete(rcName, nil)).NotTo(HaveOccurred()) + Logf("deleting replica set %s", rsName) + Expect(c.Extensions().ReplicaSets(ns).Delete(rsName, nil)).NotTo(HaveOccurred()) }() // Verify that the required pods have come up. err = verifyPods(unversionedClient, ns, "sample-pod-2", false, 1) @@ -287,10 +294,10 @@ func testRollingUpdateDeploymentEvents(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() err = waitForDeploymentStatus(c, ns, deploymentName, replicas, replicas-1, replicas+1, 0) @@ -299,18 +306,19 @@ func testRollingUpdateDeploymentEvents(f *Framework) { deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) waitForEvents(unversionedClient, ns, deployment, 2) - events, err := c.Legacy().Events(ns).Search(deployment) + events, err := c.Core().Events(ns).Search(deployment) if err != nil { Logf("error in listing events: %s", err) Expect(err).NotTo(HaveOccurred()) } - // There should be 2 events, one to scale up the new RC and then to scale down the old RC. + // There should be 2 events, one to scale up the new ReplicaSet and then to scale down + // the old ReplicaSet. Expect(len(events.Items)).Should(Equal(2)) - newRC, err := deploymentutil.GetNewRC(*deployment, c) + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(newRC).NotTo(Equal(nil)) - Expect(events.Items[0].Message).Should(Equal(fmt.Sprintf("Scaled up rc %s to 1", newRC.Name))) - Expect(events.Items[1].Message).Should(Equal(fmt.Sprintf("Scaled down rc %s to 0", rcName))) + Expect(newRS).NotTo(Equal(nil)) + Expect(events.Items[0].Message).Should(Equal(fmt.Sprintf("Scaled up replica set %s to 1", newRS.Name))) + Expect(events.Items[1].Message).Should(Equal(fmt.Sprintf("Scaled down replica set %s to 0", rsName))) // Check if it's updated to revision 3546343826724305833 correctly checkDeploymentRevision(c, ns, deploymentName, "3546343826724305833", "redis", "redis") @@ -324,18 +332,18 @@ func testRecreateDeployment(f *Framework) { c := clientset.FromUnversionedClient(unversionedClient) // Create nginx pods. deploymentPodLabels := map[string]string{"name": "sample-pod-3"} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": "sample-pod-3", "pod": "nginx", } - rcName := "nginx-controller" + rsName := "nginx-controller" replicas := 3 - _, err := c.Legacy().ReplicationControllers(ns).Create(newRC(rcName, replicas, rcPodLabels, "nginx", "nginx")) + _, err := c.Extensions().ReplicaSets(ns).Create(newRS(rsName, replicas, rsPodLabels, "nginx", "nginx")) Expect(err).NotTo(HaveOccurred()) defer func() { - Logf("deleting replication controller %s", rcName) - Expect(c.Legacy().ReplicationControllers(ns).Delete(rcName, nil)).NotTo(HaveOccurred()) + Logf("deleting replica set %s", rsName) + Expect(c.Extensions().ReplicaSets(ns).Delete(rsName, nil)).NotTo(HaveOccurred()) }() // Verify that the required pods have come up. err = verifyPods(unversionedClient, ns, "sample-pod-3", false, 3) @@ -354,10 +362,10 @@ func testRecreateDeployment(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() err = waitForDeploymentStatus(c, ns, deploymentName, replicas, 0, replicas, 0) @@ -371,18 +379,18 @@ func testRecreateDeployment(f *Framework) { deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) waitForEvents(unversionedClient, ns, deployment, 2) - events, err := c.Legacy().Events(ns).Search(deployment) + events, err := c.Core().Events(ns).Search(deployment) if err != nil { Logf("error in listing events: %s", err) Expect(err).NotTo(HaveOccurred()) } - // There should be 2 events, one to scale up the new RC and then to scale down the old RC. + // There should be 2 events, one to scale up the new ReplicaSet and then to scale down the old ReplicaSet. Expect(len(events.Items)).Should(Equal(2)) - newRC, err := deploymentutil.GetNewRC(*deployment, c) + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(newRC).NotTo(Equal(nil)) - Expect(events.Items[0].Message).Should(Equal(fmt.Sprintf("Scaled down rc %s to 0", rcName))) - Expect(events.Items[1].Message).Should(Equal(fmt.Sprintf("Scaled up rc %s to 3", newRC.Name))) + Expect(newRS).NotTo(Equal(nil)) + Expect(events.Items[0].Message).Should(Equal(fmt.Sprintf("Scaled down replica set %s to 0", rsName))) + Expect(events.Items[1].Message).Should(Equal(fmt.Sprintf("Scaled up replica set %s to 3", newRS.Name))) // Check if it's updated to revision 1 correctly checkDeploymentRevision(c, ns, deploymentName, "1", "redis", "redis") @@ -395,15 +403,15 @@ func testDeploymentCleanUpPolicy(f *Framework) { c := clientset.FromUnversionedClient(unversionedClient) // Create nginx pods. deploymentPodLabels := map[string]string{"name": "cleanup-pod"} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": "cleanup-pod", "pod": "nginx", } - rcName := "nginx-controller" + rsName := "nginx-controller" replicas := 1 revisionHistoryLimit := new(int) *revisionHistoryLimit = 0 - _, err := c.Legacy().ReplicationControllers(ns).Create(newRC(rcName, replicas, rcPodLabels, "nginx", "nginx")) + _, err := c.Extensions().ReplicaSets(ns).Create(newRS(rsName, replicas, rsPodLabels, "nginx", "nginx")) Expect(err).NotTo(HaveOccurred()) // Verify that the required pods have come up. @@ -423,13 +431,13 @@ func testDeploymentCleanUpPolicy(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() - err = waitForDeploymentOldRCsNum(c, ns, deploymentName, *revisionHistoryLimit) + err = waitForDeploymentOldRSsNum(c, ns, deploymentName, *revisionHistoryLimit) Expect(err).NotTo(HaveOccurred()) } @@ -443,21 +451,21 @@ func testRolloverDeployment(f *Framework) { c := clientset.FromUnversionedClient(unversionedClient) podName := "rollover-pod" deploymentPodLabels := map[string]string{"name": podName} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": podName, "pod": "nginx", } - rcName := "nginx-controller" - rcReplicas := 4 - _, err := c.Legacy().ReplicationControllers(ns).Create(newRC(rcName, rcReplicas, rcPodLabels, "nginx", "nginx")) + rsName := "nginx-controller" + rsReplicas := 4 + _, err := c.Extensions().ReplicaSets(ns).Create(newRS(rsName, rsReplicas, rsPodLabels, "nginx", "nginx")) Expect(err).NotTo(HaveOccurred()) defer func() { - Logf("deleting replication controller %s", rcName) - Expect(c.Legacy().ReplicationControllers(ns).Delete(rcName, nil)).NotTo(HaveOccurred()) + Logf("deleting replica set %s", rsName) + Expect(c.Extensions().ReplicaSets(ns).Delete(rsName, nil)).NotTo(HaveOccurred()) }() // Verify that the required pods have come up. - err = verifyPods(unversionedClient, ns, podName, false, rcReplicas) + err = verifyPods(unversionedClient, ns, podName, false, rsReplicas) if err != nil { Logf("error in waiting for pods to come up: %s", err) Expect(err).NotTo(HaveOccurred()) @@ -471,10 +479,10 @@ func testRolloverDeployment(f *Framework) { deploymentStrategyType := extensions.RollingUpdateDeploymentStrategyType Logf("Creating deployment %s", deploymentName) newDeployment := newDeployment(deploymentName, deploymentReplicas, deploymentPodLabels, deploymentImageName, deploymentImage, deploymentStrategyType, nil) + newDeployment.Spec.MinReadySeconds = deploymentMinReadySeconds newDeployment.Spec.Strategy.RollingUpdate = &extensions.RollingUpdateDeployment{ - MaxUnavailable: intstr.FromInt(1), - MaxSurge: intstr.FromInt(1), - MinReadySeconds: deploymentMinReadySeconds, + MaxUnavailable: intstr.FromInt(1), + MaxSurge: intstr.FromInt(1), } _, err = c.Extensions().Deployments(ns).Create(newDeployment) Expect(err).NotTo(HaveOccurred()) @@ -483,22 +491,22 @@ func testRolloverDeployment(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) }() // Verify that the pods were scaled up and down as expected. We use events to verify that. deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) - // Make sure the deployment starts to scale up and down RCs + // Make sure the deployment starts to scale up and down replica sets waitForPartialEvents(unversionedClient, ns, deployment, 2) // Check if it's updated to revision 1 correctly - _, newRC := checkDeploymentRevision(c, ns, deploymentName, "1", deploymentImageName, deploymentImage) + _, newRS := checkDeploymentRevision(c, ns, deploymentName, "1", deploymentImageName, deploymentImage) - // Before the deployment finishes, update the deployment to rollover the above 2 rcs and bring up redis pods. + // Before the deployment finishes, update the deployment to rollover the above 2 ReplicaSets and bring up redis pods. // If the deployment already finished here, the test would fail. When this happens, increase its minReadySeconds or replicas to prevent it. - Expect(newRC.Spec.Replicas).Should(BeNumerically("<", deploymentReplicas)) + Expect(newRS.Spec.Replicas).Should(BeNumerically("<", deploymentReplicas)) updatedDeploymentImage := "redis" newDeployment.Spec.Template.Spec.Containers[0].Name = updatedDeploymentImage newDeployment.Spec.Template.Spec.Containers[0].Image = updatedDeploymentImage @@ -537,10 +545,10 @@ func testPausedDeployment(f *Framework) { Expect(err).NotTo(HaveOccurred()) // Verify that there is no latest state realized for the new deployment. - rc, err := deploymentutil.GetNewRC(*deployment, c) + rs, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - if rc != nil { - err = fmt.Errorf("unexpected new rc/%s for deployment/%s", rc.Name, deployment.Name) + if rs != nil { + err = fmt.Errorf("unexpected new rs/%s for deployment/%s", rs.Name, deployment.Name) Expect(err).NotTo(HaveOccurred()) } @@ -549,28 +557,32 @@ func testPausedDeployment(f *Framework) { deployment, err = c.Extensions().Deployments(ns).Update(deployment) Expect(err).NotTo(HaveOccurred()) - opts := api.ListOptions{LabelSelector: labels.Set(deployment.Spec.Selector).AsSelector()} - w, err := c.Legacy().ReplicationControllers(ns).Watch(opts) + selector, err := unversioned.LabelSelectorAsSelector(deployment.Spec.Selector) + if err != nil { + Expect(err).NotTo(HaveOccurred()) + } + opts := api.ListOptions{LabelSelector: selector} + w, err := c.Extensions().ReplicaSets(ns).Watch(opts) Expect(err).NotTo(HaveOccurred()) select { case <-w.ResultChan(): // this is it case <-time.After(time.Minute): - err = fmt.Errorf("expected a new rc to be created") + err = fmt.Errorf("expected a new replica set to be created") Expect(err).NotTo(HaveOccurred()) } - // Pause the deployment and delete the replication controller. + // Pause the deployment and delete the replica set. // The paused deployment shouldn't recreate a new one. deployment.Spec.Paused = true deployment.ResourceVersion = "" deployment, err = c.Extensions().Deployments(ns).Update(deployment) Expect(err).NotTo(HaveOccurred()) - newRC, err := deploymentutil.GetNewRC(*deployment, c) + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) deployment, err = c.Extensions().Deployments(ns).Get(deploymentName) Expect(err).NotTo(HaveOccurred()) @@ -579,10 +591,10 @@ func testPausedDeployment(f *Framework) { err = fmt.Errorf("deployment %q should be paused", deployment.Name) Expect(err).NotTo(HaveOccurred()) } - shouldBeNil, err := deploymentutil.GetNewRC(*deployment, c) + shouldBeNil, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) if shouldBeNil != nil { - err = fmt.Errorf("deployment %q shouldn't have a rc but there is %q", deployment.Name, shouldBeNil.Name) + err = fmt.Errorf("deployment %q shouldn't have a replica set but there is %q", deployment.Name, shouldBeNil.Name) Expect(err).NotTo(HaveOccurred()) } } @@ -611,14 +623,14 @@ func testRollbackDeployment(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) - oldRCs, _, err := deploymentutil.GetOldRCs(*deployment, c) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) + oldRSs, _, err := deploymentutil.GetOldReplicaSets(*deployment, c) Expect(err).NotTo(HaveOccurred()) - for _, oldRC := range oldRCs { - Expect(c.Legacy().ReplicationControllers(ns).Delete(oldRC.Name, nil)).NotTo(HaveOccurred()) + for _, oldRS := range oldRSs { + Expect(c.Extensions().ReplicaSets(ns).Delete(oldRS.Name, nil)).NotTo(HaveOccurred()) } }() // Check that deployment is created fine. @@ -682,36 +694,36 @@ func testRollbackDeployment(f *Framework) { checkDeploymentRevision(c, ns, deploymentName, "4", updatedDeploymentImageName, updatedDeploymentImage) } -// testRollbackDeploymentRCNoRevision tests that deployment supports rollback even when there's old RC without revision. -// An old RC without revision is created, and then a deployment is created (v1). The deployment shouldn't add revision -// annotation to the old RC. Then rollback the deployment to last revision, and it should fail and emit related event. +// testRollbackDeploymentRSNoRevision tests that deployment supports rollback even when there's old replica set without revision. +// An old replica set without revision is created, and then a deployment is created (v1). The deployment shouldn't add revision +// annotation to the old replica set. Then rollback the deployment to last revision, and it should fail and emit related event. // Then update the deployment to v2 and rollback it to v1 should succeed and emit related event, now the deployment // becomes v3. Then rollback the deployment to v10 (doesn't exist in history) should fail and emit related event. // Finally, rollback the deployment (v3) to v3 should be no-op and emit related event. -func testRollbackDeploymentRCNoRevision(f *Framework) { +func testRollbackDeploymentRSNoRevision(f *Framework) { ns := f.Namespace.Name unversionedClient := f.Client c := clientset.FromUnversionedClient(f.Client) podName := "nginx" deploymentPodLabels := map[string]string{"name": podName} - rcPodLabels := map[string]string{ + rsPodLabels := map[string]string{ "name": podName, "pod": "nginx", } - rcName := "nginx-controller" - rcReplicas := 0 - rc := newRC(rcName, rcReplicas, rcPodLabels, "nginx", "nginx") - rc.Annotations = make(map[string]string) - rc.Annotations["make"] = "difference" - _, err := c.Legacy().ReplicationControllers(ns).Create(rc) + rsName := "nginx-controller" + rsReplicas := 0 + rs := newRS(rsName, rsReplicas, rsPodLabels, "nginx", "nginx") + rs.Annotations = make(map[string]string) + rs.Annotations["make"] = "difference" + _, err := c.Extensions().ReplicaSets(ns).Create(rs) Expect(err).NotTo(HaveOccurred()) defer func() { - Logf("deleting replication controller %s", rcName) - Expect(c.Legacy().ReplicationControllers(ns).Delete(rcName, nil)).NotTo(HaveOccurred()) + Logf("deleting replica set %s", rsName) + Expect(c.Extensions().ReplicaSets(ns).Delete(rsName, nil)).NotTo(HaveOccurred()) }() - // Create a deployment to create nginx pods, which have different template than the rc created above. + // Create a deployment to create nginx pods, which have different template than the replica set created above. deploymentName, deploymentImageName := "nginx-deployment", "nginx" deploymentReplicas := 1 deploymentImage := "nginx" @@ -725,14 +737,14 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { Expect(err).NotTo(HaveOccurred()) Logf("deleting deployment %s", deploymentName) Expect(c.Extensions().Deployments(ns).Delete(deploymentName, nil)).NotTo(HaveOccurred()) - // TODO: remove this once we can delete rcs with deployment - newRC, err := deploymentutil.GetNewRC(*deployment, c) + // TODO: remove this once we can delete replica sets with deployment + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) Expect(err).NotTo(HaveOccurred()) - Expect(c.Legacy().ReplicationControllers(ns).Delete(newRC.Name, nil)).NotTo(HaveOccurred()) - oldRCs, _, err := deploymentutil.GetOldRCs(*deployment, c) + Expect(c.Extensions().ReplicaSets(ns).Delete(newRS.Name, nil)).NotTo(HaveOccurred()) + oldRSs, _, err := deploymentutil.GetOldReplicaSets(*deployment, c) Expect(err).NotTo(HaveOccurred()) - for _, oldRC := range oldRCs { - Expect(c.Legacy().ReplicationControllers(ns).Delete(oldRC.Name, nil)).NotTo(HaveOccurred()) + for _, oldRS := range oldRSs { + Expect(c.Extensions().ReplicaSets(ns).Delete(oldRS.Name, nil)).NotTo(HaveOccurred()) } }() // Check that deployment is created fine. @@ -754,9 +766,9 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { // Check if it's updated to revision 1 correctly checkDeploymentRevision(c, ns, deploymentName, "1", deploymentImageName, deploymentImage) - // Check that the rc we created still doesn't contain revision information - rc, err = c.Legacy().ReplicationControllers(ns).Get(rcName) - Expect(rc.Annotations[deploymentutil.RevisionAnnotation]).Should(Equal("")) + // Check that the replica set we created still doesn't contain revision information + rs, err = c.Extensions().ReplicaSets(ns).Get(rsName) + Expect(rs.Annotations[deploymentutil.RevisionAnnotation]).Should(Equal("")) // Update the deploymentRollback to rollback to last revision // Since there's only 1 revision in history, it should stay as revision 1 @@ -770,7 +782,7 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { waitForEvents(unversionedClient, ns, deployment, 2) events, err := c.Events(ns).Search(deployment) Expect(err).NotTo(HaveOccurred()) - Expect(events.Items[1].Reason).Should(Equal("DeploymentRollbackRevisionNotFound")) + Expect(events.Items[1].Reason).Should(Equal(deploymentutil.RollbackRevisionNotFound)) // Check if it's still revision 1 checkDeploymentRevision(c, ns, deploymentName, "1", deploymentImageName, deploymentImage) @@ -804,7 +816,7 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { waitForEvents(unversionedClient, ns, deployment, 5) events, err = c.Events(ns).Search(deployment) Expect(err).NotTo(HaveOccurred()) - Expect(events.Items[4].Reason).Should(Equal("DeploymentRollback")) + Expect(events.Items[4].Reason).Should(Equal(deploymentutil.RollbackDone)) // Check if it's updated to revision 3 correctly checkDeploymentRevision(c, ns, deploymentName, "3", deploymentImageName, deploymentImage) @@ -821,7 +833,7 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { waitForEvents(unversionedClient, ns, deployment, 7) events, err = c.Events(ns).Search(deployment) Expect(err).NotTo(HaveOccurred()) - Expect(events.Items[6].Reason).Should(Equal("DeploymentRollbackRevisionNotFound")) + Expect(events.Items[6].Reason).Should(Equal(deploymentutil.RollbackRevisionNotFound)) // Check if it's still revision 3 checkDeploymentRevision(c, ns, deploymentName, "3", deploymentImageName, deploymentImage) @@ -838,7 +850,7 @@ func testRollbackDeploymentRCNoRevision(f *Framework) { waitForEvents(unversionedClient, ns, deployment, 8) events, err = c.Events(ns).Search(deployment) Expect(err).NotTo(HaveOccurred()) - Expect(events.Items[7].Reason).Should(Equal("DeploymentRollbackTemplateUnchanged")) + Expect(events.Items[7].Reason).Should(Equal(deploymentutil.RollbackTemplateUnchanged)) // Check if it's still revision 3 checkDeploymentRevision(c, ns, deploymentName, "3", deploymentImageName, deploymentImage) diff --git a/test/e2e/downward_api.go b/test/e2e/downward_api.go index 73fde0804ba..db67d57b5f6 100644 --- a/test/e2e/downward_api.go +++ b/test/e2e/downward_api.go @@ -91,7 +91,7 @@ func testDownwardAPI(framework *Framework, podName string, env []api.EnvVar, exp Containers: []api.Container{ { Name: "dapi-container", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "env"}, Env: env, }, diff --git a/test/e2e/downwardapi_volume.go b/test/e2e/downwardapi_volume.go index c663e600507..d5e43496ea4 100644 --- a/test/e2e/downwardapi_volume.go +++ b/test/e2e/downwardapi_volume.go @@ -41,7 +41,7 @@ var _ = Describe("Downward API volume", func() { }, f.Namespace.Name) }) - It("should provide podname as non-root with fsgroup [Conformance] [Skipped]", func() { + It("should provide podname as non-root with fsgroup [Feature:FSGroup]", func() { podName := "metadata-volume-" + string(util.NewUUID()) uid := int64(1001) gid := int64(1234) @@ -83,6 +83,7 @@ var _ = Describe("Downward API volume", func() { //modify labels pod.Labels["key3"] = "value3" + pod.ResourceVersion = "" // to force update _, err = f.Client.Pods(f.Namespace.Name).Update(pod) Expect(err).NotTo(HaveOccurred()) @@ -119,6 +120,7 @@ var _ = Describe("Downward API volume", func() { //modify annotations pod.Annotations["builder"] = "foo" + pod.ResourceVersion = "" // to force update _, err = f.Client.Pods(f.Namespace.Name).Update(pod) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 80bcdbebe25..58a010eea52 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -63,6 +63,7 @@ func RegisterFlags() { flag.StringVar(&testContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, "", "Path to kubeconfig containing embedded authinfo.") flag.StringVar(&testContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'") + flag.StringVar(&testContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.") flag.StringVar(&testContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.") flag.StringVar(&testContext.Host, "host", "", "The host, or apiserver, to connect to") flag.StringVar(&testContext.RepoRoot, "repo-root", "../../", "Root directory of kubernetes repository, for finding test files.") @@ -118,7 +119,7 @@ func setupProviderConfig() error { managedZones := []string{zone} // Only single-zone for now cloudConfig.Provider, err = gcecloud.CreateGCECloud(testContext.CloudConfig.ProjectID, region, zone, managedZones, "" /* networkUrl */, tokenSource, false /* useMetadataServer */) if err != nil { - return fmt.Errorf("Error building GCE/GKE provider: ", err) + return fmt.Errorf("Error building GCE/GKE provider: %v", err) } case "aws": @@ -136,7 +137,7 @@ func setupProviderConfig() error { var err error cloudConfig.Provider, err = cloudprovider.GetCloudProvider(testContext.Provider, strings.NewReader(awsConfig)) if err != nil { - return fmt.Errorf("Error building AWS provider: ", err) + return fmt.Errorf("Error building AWS provider: %v", err) } } diff --git a/test/e2e/empty_dir.go b/test/e2e/empty_dir.go index b65ca537b2b..60f0239eb18 100644 --- a/test/e2e/empty_dir.go +++ b/test/e2e/empty_dir.go @@ -37,21 +37,20 @@ var _ = Describe("EmptyDir volumes", func() { f := NewFramework("emptydir") - // TODO: Remove [Skipped] when security context is enabled everywhere - Context("when FSGroup is specified [Skipped]", func() { - It("new files should be created with FSGroup ownership when container is root [Conformance]", func() { + Context("when FSGroup is specified [Feature:FSGroup]", func() { + It("new files should be created with FSGroup ownership when container is root", func() { doTestSetgidFSGroup(f, testImageRootUid, api.StorageMediumMemory) }) - It("new files should be created with FSGroup ownership when container is non-root [Conformance]", func() { + It("new files should be created with FSGroup ownership when container is non-root", func() { doTestSetgidFSGroup(f, testImageNonRootUid, api.StorageMediumMemory) }) - It("volume on default medium should have the correct mode using FSGroup [Conformance]", func() { + It("volume on default medium should have the correct mode using FSGroup", func() { doTestVolumeModeFSGroup(f, testImageRootUid, api.StorageMediumDefault) }) - It("volume on tmpfs should have the correct mode using FSGroup [Conformance]", func() { + It("volume on tmpfs should have the correct mode using FSGroup", func() { doTestVolumeModeFSGroup(f, testImageRootUid, api.StorageMediumMemory) }) }) diff --git a/test/e2e/es_cluster_logging.go b/test/e2e/es_cluster_logging.go index 088e6543088..93775bada5a 100644 --- a/test/e2e/es_cluster_logging.go +++ b/test/e2e/es_cluster_logging.go @@ -408,6 +408,10 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) { Logf("Index value out of range: %d", index) continue } + if words[1] != taintName { + Logf("Elasticsearch query return unexpected log line: %s", msg) + continue + } // Record the observation of a log line from node n at the given index. observed[n][index]++ } diff --git a/test/e2e/etcd_failure.go b/test/e2e/etcd_failure.go index c2b161dc551..531fdb404da 100644 --- a/test/e2e/etcd_failure.go +++ b/test/e2e/etcd_failure.go @@ -29,7 +29,6 @@ import ( var _ = Describe("Etcd failure [Disruptive]", func() { - var skipped bool framework := NewFramework("etcd-failure") BeforeEach(func() { @@ -38,9 +37,7 @@ var _ = Describe("Etcd failure [Disruptive]", func() { // - master access // ... so the provider check should be identical to the intersection of // providers that provide those capabilities. - skipped = true SkipUnlessProviderIs("gce") - skipped = false Expect(RunRC(RCConfig{ Client: framework.Client, diff --git a/test/e2e/expansion.go b/test/e2e/expansion.go index 3cd4806f457..53794680384 100644 --- a/test/e2e/expansion.go +++ b/test/e2e/expansion.go @@ -23,6 +23,8 @@ import ( . "github.com/onsi/ginkgo" ) +// These tests exercise the Kubernetes expansion syntax $(VAR). +// For more information, see: docs/design/expansion.md var _ = Describe("Variable Expansion", func() { framework := NewFramework("var-expansion") @@ -37,7 +39,7 @@ var _ = Describe("Variable Expansion", func() { Containers: []api.Container{ { Name: "dapi-container", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "env"}, Env: []api.EnvVar{ { @@ -77,7 +79,7 @@ var _ = Describe("Variable Expansion", func() { Containers: []api.Container{ { Name: "dapi-container", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "TEST_VAR=wrong echo \"$(TEST_VAR)\""}, Env: []api.EnvVar{ { @@ -107,7 +109,7 @@ var _ = Describe("Variable Expansion", func() { Containers: []api.Container{ { Name: "dapi-container", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c"}, Args: []string{"TEST_VAR=wrong echo \"$(TEST_VAR)\""}, Env: []api.EnvVar{ diff --git a/test/e2e/framework.go b/test/e2e/framework.go index 39c4b7eeba0..444a086792d 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -200,6 +200,11 @@ func (f *Framework) afterEach() { f.Client = nil } +// WaitForPodTerminated waits for the pod to be terminated with the given reason. +func (f *Framework) WaitForPodTerminated(podName, reason string) error { + return waitForPodTerminatedInNamespace(f.Client, podName, reason, f.Namespace.Name) +} + // WaitForPodRunning waits for the pod to run in the namespace. func (f *Framework) WaitForPodRunning(podName string) error { return waitForPodRunningInNamespace(f.Client, podName, f.Namespace.Name) diff --git a/test/e2e/garbage_collector.go b/test/e2e/garbage_collector.go index e30a5c1cc2f..f1f20148b3f 100644 --- a/test/e2e/garbage_collector.go +++ b/test/e2e/garbage_collector.go @@ -73,7 +73,7 @@ func createTerminatingPod(f *Framework) (*api.Pod, error) { Containers: []api.Container{ { Name: string(uuid), - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", }, }, }, diff --git a/test/e2e/horizontal_pod_autoscaling.go b/test/e2e/horizontal_pod_autoscaling.go index a64bb638700..57a5569e20a 100644 --- a/test/e2e/horizontal_pod_autoscaling.go +++ b/test/e2e/horizontal_pod_autoscaling.go @@ -41,15 +41,16 @@ var _ = Describe("Horizontal pod autoscaling (scale resource: CPU) [Serial] [Slo titleUp := "Should scale from 1 pod to 3 pods and from 3 to 5" titleDown := "Should scale from 5 pods to 3 pods and from 3 to 1" - Describe("Deployment", func() { - // CPU tests via deployments - It(titleUp, func() { - scaleUp("deployment", kindDeployment, rc, f) - }) - It(titleDown, func() { - scaleDown("deployment", kindDeployment, rc, f) - }) - }) + // TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528). + // Describe("Deployment [Feature:Deployment]", func() { + // // CPU tests via deployments + // It(titleUp, func() { + // scaleUp("deployment", kindDeployment, rc, f) + // }) + // It(titleDown, func() { + // scaleDown("deployment", kindDeployment, rc, f) + // }) + // }) Describe("ReplicationController", func() { // CPU tests via replication controllers diff --git a/test/e2e/ingress.go b/test/e2e/ingress.go index 6a5c7c71262..3adfd3ff9ee 100644 --- a/test/e2e/ingress.go +++ b/test/e2e/ingress.go @@ -396,8 +396,7 @@ func (cont *IngressController) Cleanup(del bool) error { // test requires at least 5. // // Slow by design (10 min) -// Flaky issue #17518 -var _ = Describe("GCE L7 LoadBalancer Controller [Serial] [Slow] [Flaky]", func() { +var _ = Describe("GCE L7 LoadBalancer Controller [Feature:Ingress]", func() { // These variables are initialized after framework's beforeEach. var ns string var addonDir string diff --git a/test/e2e/job.go b/test/e2e/job.go index 5546a53b690..48c5edaa091 100644 --- a/test/e2e/job.go +++ b/test/e2e/job.go @@ -223,7 +223,7 @@ func newTestJob(behavior, name string, rPol api.RestartPolicy, parallelism, comp Containers: []api.Container{ { Name: "c", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{}, VolumeMounts: []api.VolumeMount{ { diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index b2b7b7f1e3d..e13f3c2b55e 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -457,7 +457,7 @@ var _ = Describe("Kubectl client", func() { withStdinData("abcd1234\n"). execOrDie() Expect(runOutput).ToNot(ContainSubstring("stdin closed")) - runTestPod, err := util.GetFirstPod(c, ns, map[string]string{"run": "run-test-3"}) + runTestPod, err := util.GetFirstPod(c, ns, labels.SelectorFromSet(map[string]string{"run": "run-test-3"})) if err != nil { os.Exit(1) } diff --git a/test/e2e/kubelet_etc_hosts.go b/test/e2e/kubelet_etc_hosts.go index 25909512a6b..15502daeb41 100644 --- a/test/e2e/kubelet_etc_hosts.go +++ b/test/e2e/kubelet_etc_hosts.go @@ -18,16 +18,17 @@ package e2e import ( "fmt" + "strings" + . "github.com/onsi/ginkgo" api "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apimachinery/registered" client "k8s.io/kubernetes/pkg/client/unversioned" - "strings" ) const ( - kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.0" + kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.4" kubeletEtcHostsPodName = "test-pod" kubeletEtcHostsHostNetworkPodName = "test-host-network-pod" etcHostsPartialContent = "# Kubernetes-managed hosts file." diff --git a/test/e2e/kubelet_perf.go b/test/e2e/kubelet_perf.go index f428ee1478f..59fcf242bae 100644 --- a/test/e2e/kubelet_perf.go +++ b/test/e2e/kubelet_perf.go @@ -160,17 +160,25 @@ var _ = Describe("Kubelet [Serial] [Slow]", func() { rm.Stop() }) Describe("regular resource usage tracking", func() { + // We assume that the scheduler will make reasonable scheduling choices + // and assign ~N pods on the node. + // Although we want to track N pods per node, there are N + add-on pods + // in the cluster. The cluster add-on pods can be distributed unevenly + // among the nodes because they are created during the cluster + // initialization. This *noise* is obvious when N is small. We + // deliberately set higher resource usage limits to account for the + // noise. rTests := []resourceTest{ {podsPerNode: 0, limits: containersCPUSummary{ - "/kubelet": {0.50: 0.05, 0.95: 0.15}, - "/docker-daemon": {0.50: 0.03, 0.95: 0.06}, + "/kubelet": {0.50: 0.06, 0.95: 0.08}, + "/docker-daemon": {0.50: 0.05, 0.95: 0.06}, }, }, {podsPerNode: 35, limits: containersCPUSummary{ - "/kubelet": {0.50: 0.15, 0.95: 0.35}, - "/docker-daemon": {0.50: 0.06, 0.95: 0.30}, + "/kubelet": {0.50: 0.12, 0.95: 0.14}, + "/docker-daemon": {0.50: 0.06, 0.95: 0.08}, }, }, } diff --git a/test/e2e/kubelet_stats.go b/test/e2e/kubelet_stats.go index c874ffa0d35..6e8c1c5d7a0 100644 --- a/test/e2e/kubelet_stats.go +++ b/test/e2e/kubelet_stats.go @@ -36,8 +36,8 @@ import ( "k8s.io/kubernetes/pkg/kubelet/metrics" "k8s.io/kubernetes/pkg/kubelet/server/stats" "k8s.io/kubernetes/pkg/master/ports" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" + "k8s.io/kubernetes/pkg/util/wait" ) // KubeletMetric stores metrics scraped from the kubelet server's /metric endpoint. @@ -397,7 +397,7 @@ func (r *resourceCollector) Start() { r.stopCh = make(chan struct{}, 1) // Keep the last observed stats for comparison. oldStats := make(map[string]*cadvisorapi.ContainerStats) - go util.Until(func() { r.collectStats(oldStats) }, r.pollingInterval, r.stopCh) + go wait.Until(func() { r.collectStats(oldStats) }, r.pollingInterval, r.stopCh) } // Stop sends a signal to terminate the stats collecting goroutine. diff --git a/test/e2e/kubeproxy.go b/test/e2e/kubeproxy.go index 9407715b0d7..a945a4d6380 100644 --- a/test/e2e/kubeproxy.go +++ b/test/e2e/kubeproxy.go @@ -46,7 +46,7 @@ const ( nodeHttpPort = 32080 nodeUdpPort = 32081 loadBalancerHttpPort = 100 - netexecImageName = "gcr.io/google_containers/netexec:1.0" + netexecImageName = "gcr.io/google_containers/netexec:1.4" testPodName = "test-container-pod" hostTestPodName = "host-test-container-pod" nodePortServiceName = "node-port-service" @@ -185,18 +185,20 @@ func (config *KubeProxyTestConfig) hitNodePort(epCount int) { By("dialing(http) endpoint container --> node1:nodeHttpPort") config.dialFromEndpointContainer("http", node1_IP, nodeHttpPort, tries, epCount) - // TODO: doesn't work because masquerading is not done - By("TODO: Test disabled. dialing(udp) node --> 127.0.0.1:nodeUdpPort") - //config.dialFromNode("udp", "127.0.0.1", nodeUdpPort, tries, epCount) - // TODO: doesn't work because masquerading is not done - By("Test disabled. dialing(http) node --> 127.0.0.1:nodeHttpPort") - //config.dialFromNode("http", "127.0.0.1", nodeHttpPort, tries, epCount) + By("dialing(udp) node --> 127.0.0.1:nodeUdpPort") + config.dialFromNode("udp", "127.0.0.1", nodeUdpPort, tries, epCount) + By("dialing(http) node --> 127.0.0.1:nodeHttpPort") + config.dialFromNode("http", "127.0.0.1", nodeHttpPort, tries, epCount) node2_IP := config.externalAddrs[1] By("dialing(udp) node1 --> node2:nodeUdpPort") config.dialFromNode("udp", node2_IP, nodeUdpPort, tries, epCount) By("dialing(http) node1 --> node2:nodeHttpPort") config.dialFromNode("http", node2_IP, nodeHttpPort, tries, epCount) + + By("checking kube-proxy URLs") + config.getSelfURL("/healthz", "ok") + config.getSelfURL("/proxyMode", "iptables") // the default } func (config *KubeProxyTestConfig) hitEndpoints() { @@ -252,6 +254,13 @@ func (config *KubeProxyTestConfig) dialFromNode(protocol, targetIP string, targe Expect(strconv.Atoi(strings.TrimSpace(stdout))).To(BeNumerically("==", expectedCount)) } +func (config *KubeProxyTestConfig) getSelfURL(path string, expected string) { + cmd := fmt.Sprintf("curl -s --connect-timeout 1 http://localhost:10249%s", path) + By(fmt.Sprintf("Getting kube-proxy self URL %s", path)) + stdout := RunHostCmdOrDie(config.f.Namespace.Name, config.hostTestContainerPod.Name, cmd) + Expect(strings.Contains(stdout, expected)).To(BeTrue()) +} + func (config *KubeProxyTestConfig) createNetShellPodSpec(podName string, node string) *api.Pod { pod := &api.Pod{ TypeMeta: unversioned.TypeMeta{ @@ -497,12 +506,12 @@ func (config *KubeProxyTestConfig) deleteNetProxyPod() { config.getPodClient().Delete(pod.Name, api.NewDeleteOptions(0)) config.endpointPods = config.endpointPods[1:] // wait for pod being deleted. - err := waitForPodToDisappear(config.f.Client, config.f.Namespace.Name, pod.Name, labels.Everything(), time.Second, util.ForeverTestTimeout) + err := waitForPodToDisappear(config.f.Client, config.f.Namespace.Name, pod.Name, labels.Everything(), time.Second, wait.ForeverTestTimeout) if err != nil { Failf("Failed to delete %s pod: %v", pod.Name, err) } // wait for endpoint being removed. - err = waitForServiceEndpointsNum(config.f.Client, config.f.Namespace.Name, nodePortServiceName, len(config.endpointPods), time.Second, util.ForeverTestTimeout) + err = waitForServiceEndpointsNum(config.f.Client, config.f.Namespace.Name, nodePortServiceName, len(config.endpointPods), time.Second, wait.ForeverTestTimeout) if err != nil { Failf("Failed to remove endpoint from service: %s", nodePortServiceName) } diff --git a/test/e2e/limit_range.go b/test/e2e/limit_range.go new file mode 100644 index 00000000000..b98f44032ec --- /dev/null +++ b/test/e2e/limit_range.go @@ -0,0 +1,179 @@ +/* +Copyright 2015 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. +*/ + +package e2e + +import ( + "fmt" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/resource" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("LimitRange", func() { + f := NewFramework("limitrange") + + It("should create a LimitRange with defaults and ensure pod has those defaults applied.", func() { + By("Creating a LimitRange") + + min := getResourceList("50m", "100Mi") + max := getResourceList("500m", "500Mi") + defaultLimit := getResourceList("500m", "500Mi") + defaultRequest := getResourceList("100m", "200Mi") + maxLimitRequestRatio := api.ResourceList{} + limitRange := newLimitRange("limit-range", api.LimitTypeContainer, + min, max, + defaultLimit, defaultRequest, + maxLimitRequestRatio) + limitRange, err := f.Client.LimitRanges(f.Namespace.Name).Create(limitRange) + Expect(err).NotTo(HaveOccurred()) + + By("Fetching the LimitRange to ensure it has proper values") + limitRange, err = f.Client.LimitRanges(f.Namespace.Name).Get(limitRange.Name) + expected := api.ResourceRequirements{Requests: defaultRequest, Limits: defaultLimit} + actual := api.ResourceRequirements{Requests: limitRange.Spec.Limits[0].DefaultRequest, Limits: limitRange.Spec.Limits[0].Default} + err = equalResourceRequirement(expected, actual) + Expect(err).NotTo(HaveOccurred()) + + By("Creating a Pod with no resource requirements") + pod := newTestPod("pod-no-resources", api.ResourceList{}, api.ResourceList{}) + pod, err = f.Client.Pods(f.Namespace.Name).Create(pod) + Expect(err).NotTo(HaveOccurred()) + + By("Ensuring Pod has resource requirements applied from LimitRange") + pod, err = f.Client.Pods(f.Namespace.Name).Get(pod.Name) + Expect(err).NotTo(HaveOccurred()) + for i := range pod.Spec.Containers { + err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources) + Expect(err).NotTo(HaveOccurred()) + } + + By("Creating a Pod with partial resource requirements") + pod = newTestPod("pod-partial-resources", getResourceList("", "150Mi"), getResourceList("300m", "")) + pod, err = f.Client.Pods(f.Namespace.Name).Create(pod) + Expect(err).NotTo(HaveOccurred()) + + By("Ensuring Pod has merged resource requirements applied from LimitRange") + pod, err = f.Client.Pods(f.Namespace.Name).Get(pod.Name) + Expect(err).NotTo(HaveOccurred()) + // This is an interesting case, so it's worth a comment + // If you specify a Limit, and no Request, the Limit will default to the Request + // This means that the LimitRange.DefaultRequest will ONLY take affect if a container.resources.limit is not supplied + expected = api.ResourceRequirements{Requests: getResourceList("300m", "150Mi"), Limits: getResourceList("300m", "500Mi")} + for i := range pod.Spec.Containers { + err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources) + Expect(err).NotTo(HaveOccurred()) + } + + By("Failing to create a Pod with less than min resources") + pod = newTestPod(podName, getResourceList("10m", "50Mi"), api.ResourceList{}) + pod, err = f.Client.Pods(f.Namespace.Name).Create(pod) + Expect(err).To(HaveOccurred()) + + By("Failing to create a Pod with more than max resources") + pod = newTestPod(podName, getResourceList("600m", "600Mi"), api.ResourceList{}) + pod, err = f.Client.Pods(f.Namespace.Name).Create(pod) + Expect(err).To(HaveOccurred()) + }) + +}) + +func equalResourceRequirement(expected api.ResourceRequirements, actual api.ResourceRequirements) error { + Logf("Verifying requests: expected %s with actual %s", expected.Requests, actual.Requests) + err := equalResourceList(expected.Requests, actual.Requests) + if err != nil { + return err + } + Logf("Verifying limits: expected %v with actual %v", expected.Limits, actual.Limits) + err = equalResourceList(expected.Limits, actual.Limits) + if err != nil { + return err + } + return nil +} + +func equalResourceList(expected api.ResourceList, actual api.ResourceList) error { + for k, v := range expected { + if actualValue, found := actual[k]; !found || (v.Cmp(actualValue) != 0) { + return fmt.Errorf("resource %v expected %v actual %v", k, v.String(), actualValue.String()) + } + } + for k, v := range actual { + if expectedValue, found := expected[k]; !found || (v.Cmp(expectedValue) != 0) { + return fmt.Errorf("resource %v expected %v actual %v", k, expectedValue.String(), v.String()) + } + } + return nil +} + +func getResourceList(cpu, memory string) api.ResourceList { + res := api.ResourceList{} + if cpu != "" { + res[api.ResourceCPU] = resource.MustParse(cpu) + } + if memory != "" { + res[api.ResourceMemory] = resource.MustParse(memory) + } + return res +} + +// newLimitRange returns a limit range with specified data +func newLimitRange(name string, limitType api.LimitType, + min, max, + defaultLimit, defaultRequest, + maxLimitRequestRatio api.ResourceList) *api.LimitRange { + return &api.LimitRange{ + ObjectMeta: api.ObjectMeta{ + Name: name, + }, + Spec: api.LimitRangeSpec{ + Limits: []api.LimitRangeItem{ + { + Type: limitType, + Min: min, + Max: max, + Default: defaultLimit, + DefaultRequest: defaultRequest, + MaxLimitRequestRatio: maxLimitRequestRatio, + }, + }, + }, + } +} + +// newTestPod returns a pod that has the specified requests and limits +func newTestPod(name string, requests api.ResourceList, limits api.ResourceList) *api.Pod { + return &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: name, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "nginx", + Image: "gcr.io/google_containers/pause:2.0", + Resources: api.ResourceRequirements{ + Requests: requests, + Limits: limits, + }, + }, + }, + }, + } +} diff --git a/test/e2e/load.go b/test/e2e/load.go index d41870dddfc..b1dcb28758b 100644 --- a/test/e2e/load.go +++ b/test/e2e/load.go @@ -56,8 +56,6 @@ var _ = Describe("Load capacity", func() { // Gathers metrics before teardown // TODO add flag that allows to skip cleanup on failure AfterEach(func() { - deleteAllRC(configs) - // Verify latency metrics highLatencyRequests, err := HighLatencyRequests(c) expectNoError(err, "Too many instances metrics above the threshold") @@ -70,7 +68,14 @@ var _ = Describe("Load capacity", func() { framework.NamespaceDeletionTimeout = time.Hour BeforeEach(func() { - c = framework.Client + // Explicitly create a client with higher QPS limits. + config, err := loadConfig() + Expect(err).NotTo(HaveOccurred()) + config.QPS = 50 + config.Burst = 100 + c, err = loadClientFromConfig(config) + Expect(err).NotTo(HaveOccurred()) + ns = framework.Namespace.Name nodes := ListSchedulableNodesOrDie(c) nodeCount = len(nodes.Items) @@ -79,7 +84,7 @@ var _ = Describe("Load capacity", func() { // Terminating a namespace (deleting the remaining objects from it - which // generally means events) can affect the current run. Thus we wait for all // terminating namespace to be finally deleted before starting this test. - err := checkTestingNSDeletedExcept(c, ns) + err = checkTestingNSDeletedExcept(c, ns) expectNoError(err) expectNoError(resetMetrics(c)) @@ -107,7 +112,8 @@ var _ = Describe("Load capacity", func() { itArg := testArg It(name, func() { - configs = generateRCConfigs(itArg.podsPerNode*nodeCount, itArg.image, itArg.command, c, ns) + totalPods := itArg.podsPerNode * nodeCount + configs = generateRCConfigs(totalPods, itArg.image, itArg.command, c, ns) // Simulate lifetime of RC: // * create with initial size @@ -116,16 +122,34 @@ var _ = Describe("Load capacity", func() { // * delete it // // This will generate ~5 creations/deletions per second assuming: - // - 300 small RCs each 5 pods - // - 25 medium RCs each 30 pods - // - 3 big RCs each 250 pods - createAllRC(configs) - // TODO add reseting latency metrics here, once it would be supported. + // - X small RCs each 5 pods [ 5 * X = totalPods / 2 ] + // - Y medium RCs each 30 pods [ 30 * Y = totalPods / 4 ] + // - Z big RCs each 250 pods [ 250 * Z = totalPods / 4] + + // We would like to spread creating replication controllers over time + // to make it possible to create/schedule them in the meantime. + // Currently we assume 5 pods/second average throughput. + // We may want to revisit it in the future. + creatingTime := time.Duration(totalPods/5) * time.Second + createAllRC(configs, creatingTime) By("============================================================================") - scaleAllRC(configs) + + // We would like to spread scaling replication controllers over time + // to make it possible to create/schedule & delete them in the meantime. + // Currently we assume that 5 pods/second average throughput. + // The expected number of created/deleted pods is less than totalPods/3. + scalingTime := time.Duration(totalPods/15) * time.Second + scaleAllRC(configs, scalingTime) By("============================================================================") - scaleAllRC(configs) + + scaleAllRC(configs, scalingTime) By("============================================================================") + + // Cleanup all created replication controllers. + // Currently we assume 5 pods/second average deletion throughput. + // We may want to revisit it in the future. + deletingTime := time.Duration(totalPods/5) * time.Second + deleteAllRC(configs, deletingTime) }) } }) @@ -176,41 +200,39 @@ func sleepUpTo(d time.Duration) { time.Sleep(time.Duration(rand.Int63n(d.Nanoseconds()))) } -func createAllRC(configs []*RCConfig) { +func createAllRC(configs []*RCConfig, creatingTime time.Duration) { var wg sync.WaitGroup wg.Add(len(configs)) for _, config := range configs { - go createRC(&wg, config) + go createRC(&wg, config, creatingTime) } wg.Wait() } -func createRC(wg *sync.WaitGroup, config *RCConfig) { +func createRC(wg *sync.WaitGroup, config *RCConfig, creatingTime time.Duration) { defer GinkgoRecover() defer wg.Done() - creatingTime := 10 * time.Minute sleepUpTo(creatingTime) expectNoError(RunRC(*config), fmt.Sprintf("creating rc %s", config.Name)) } -func scaleAllRC(configs []*RCConfig) { +func scaleAllRC(configs []*RCConfig, scalingTime time.Duration) { var wg sync.WaitGroup wg.Add(len(configs)) for _, config := range configs { - go scaleRC(&wg, config) + go scaleRC(&wg, config, scalingTime) } wg.Wait() } // Scales RC to a random size within [0.5*size, 1.5*size] and lists all the pods afterwards. // Scaling happens always based on original size, not the current size. -func scaleRC(wg *sync.WaitGroup, config *RCConfig) { +func scaleRC(wg *sync.WaitGroup, config *RCConfig, scalingTime time.Duration) { defer GinkgoRecover() defer wg.Done() - resizingTime := 3 * time.Minute - sleepUpTo(resizingTime) + sleepUpTo(scalingTime) newSize := uint(rand.Intn(config.Replicas) + config.Replicas/2) expectNoError(ScaleRC(config.Client, config.Namespace, config.Name, newSize, true), fmt.Sprintf("scaling rc %s for the first time", config.Name)) @@ -223,19 +245,18 @@ func scaleRC(wg *sync.WaitGroup, config *RCConfig) { expectNoError(err, fmt.Sprintf("listing pods from rc %v", config.Name)) } -func deleteAllRC(configs []*RCConfig) { +func deleteAllRC(configs []*RCConfig, deletingTime time.Duration) { var wg sync.WaitGroup wg.Add(len(configs)) for _, config := range configs { - go deleteRC(&wg, config) + go deleteRC(&wg, config, deletingTime) } wg.Wait() } -func deleteRC(wg *sync.WaitGroup, config *RCConfig) { +func deleteRC(wg *sync.WaitGroup, config *RCConfig, deletingTime time.Duration) { defer GinkgoRecover() defer wg.Done() - deletingTime := 10 * time.Minute sleepUpTo(deletingTime) expectNoError(DeleteRC(config.Client, config.Namespace, config.Name), fmt.Sprintf("deleting rc %s", config.Name)) diff --git a/test/e2e/mesos.go b/test/e2e/mesos.go index 3335026e71e..36f36179229 100644 --- a/test/e2e/mesos.go +++ b/test/e2e/mesos.go @@ -23,7 +23,7 @@ import ( "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -62,13 +62,13 @@ var _ = Describe("Mesos", func() { It("starts static pods on every node in the mesos cluster", func() { client := framework.Client - expectNoError(allNodesReady(client, util.ForeverTestTimeout), "all nodes ready") + expectNoError(allNodesReady(client, wait.ForeverTestTimeout), "all nodes ready") nodelist := ListSchedulableNodesOrDie(framework.Client) const ns = "static-pods" numpods := len(nodelist.Items) - expectNoError(waitForPodsRunningReady(ns, numpods, util.ForeverTestTimeout), + expectNoError(waitForPodsRunningReady(ns, numpods, wait.ForeverTestTimeout), fmt.Sprintf("number of static pods in namespace %s is %d", ns, numpods)) }) diff --git a/test/e2e/metrics_util.go b/test/e2e/metrics_util.go index 3b90e33396a..af2bc86ea51 100644 --- a/test/e2e/metrics_util.go +++ b/test/e2e/metrics_util.go @@ -92,25 +92,16 @@ func (m *MetricsForE2E) PrintJSON() string { var InterestingApiServerMetrics = []string{ "apiserver_request_count", - "apiserver_request_latencies_bucket", + "apiserver_request_latencies_summary", "etcd_helper_cache_entry_count", "etcd_helper_cache_hit_count", "etcd_helper_cache_miss_count", "etcd_request_cache_add_latencies_summary", "etcd_request_cache_get_latencies_summary", "etcd_request_latencies_summary", - "go_gc_duration_seconds", - "go_goroutines", - "process_cpu_seconds_total", - "process_open_fds", - "process_resident_memory_bytes", - "process_start_time_seconds", - "process_virtual_memory_bytes", } var InterestingKubeletMetrics = []string{ - "go_gc_duration_seconds", - "go_goroutines", "kubelet_container_manager_latency_microseconds", "kubelet_docker_errors", "kubelet_docker_operations_latency_microseconds", @@ -119,11 +110,6 @@ var InterestingKubeletMetrics = []string{ "kubelet_pod_worker_latency_microseconds", "kubelet_pod_worker_start_latency_microseconds", "kubelet_sync_pods_latency_microseconds", - "process_cpu_seconds_total", - "process_open_fds", - "process_resident_memory_bytes", - "process_start_time_seconds", - "process_virtual_memory_bytes", } // Dashboard metrics diff --git a/test/e2e/namespace.go b/test/e2e/namespace.go index 49e8b2375fa..bf8cf87b831 100644 --- a/test/e2e/namespace.go +++ b/test/e2e/namespace.go @@ -120,7 +120,7 @@ var _ = Describe("Namespaces [Serial]", func() { It("should delete fast enough (90 percent of 100 namespaces in 150 seconds)", func() { extinguish(c, 100, 10, 150) }) - //comprehensive draining ; uncomment after #7372 - PIt("should always delete fast (ALL of 100 namespaces in 150 seconds)", + // On hold until etcd3; see #7372 + It("should always delete fast (ALL of 100 namespaces in 150 seconds) [Feature:ComprehensiveNamespaceDraining]", func() { extinguish(c, 100, 0, 150) }) }) diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 6d7268e2a7a..1c8d174ff18 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -64,7 +64,7 @@ var _ = Describe("Networking", func() { Containers: []api.Container{ { Name: contName, - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"wget", "-s", "google.com"}, }, }, diff --git a/test/e2e/nodeoutofdisk.go b/test/e2e/nodeoutofdisk.go index 0fc97d83287..30709d674bc 100644 --- a/test/e2e/nodeoutofdisk.go +++ b/test/e2e/nodeoutofdisk.go @@ -63,11 +63,11 @@ const ( // choose that node to be node with index 1. // 7. Observe that the pod in pending status schedules on that node. // -// Flaky issue #17687 +// Flaky issue #20015. We have no clear path for how to test this functionality in a non-flaky way. var _ = Describe("NodeOutOfDisk [Serial] [Flaky]", func() { var c *client.Client var unfilledNodeName, recoveredNodeName string - framework := Framework{BaseName: "node-outofdisk"} + framework := NewFramework("node-outofdisk") BeforeEach(func() { framework.beforeEach() @@ -218,7 +218,7 @@ func availCpu(c *client.Client, node *api.Node) (int64, error) { func availSize(c *client.Client, node *api.Node) (uint64, error) { statsResource := fmt.Sprintf("api/v1/proxy/nodes/%s/stats/", node.Name) Logf("Querying stats for node %s using url %s", node.Name, statsResource) - res, err := c.Get().AbsPath(statsResource).Timeout(timeout).Do().Raw() + res, err := c.Get().AbsPath(statsResource).Timeout(time.Minute).Do().Raw() if err != nil { return 0, fmt.Errorf("error querying cAdvisor API: %v", err) } diff --git a/test/e2e/pd.go b/test/e2e/pd.go index 50120b63ade..42d63cb8eab 100644 --- a/test/e2e/pd.go +++ b/test/e2e/pd.go @@ -314,7 +314,8 @@ func createPD() (string, error) { return "", err } - err = gceCloud.CreateDisk(pdName, testContext.CloudConfig.Zone, 10 /* sizeGb */) + tags := map[string]string{} + err = gceCloud.CreateDisk(pdName, testContext.CloudConfig.Zone, 10 /* sizeGb */, tags) if err != nil { return "", err } @@ -326,7 +327,7 @@ func createPD() (string, error) { } volumeOptions := &awscloud.VolumeOptions{} volumeOptions.CapacityGB = 10 - return volumes.CreateVolume(volumeOptions) + return volumes.CreateDisk(volumeOptions) } } @@ -353,7 +354,15 @@ func deletePD(pdName string) error { if !ok { return fmt.Errorf("Provider does not support volumes") } - return volumes.DeleteVolume(pdName) + deleted, err := volumes.DeleteDisk(pdName) + if err != nil { + return err + } else { + if !deleted { + Logf("Volume deletion implicitly succeeded because volume %q does not exist.", pdName) + } + return nil + } } } @@ -383,7 +392,8 @@ func detachPD(hostName, pdName string) error { if !ok { return fmt.Errorf("Provider does not support volumes") } - return volumes.DetachDisk(hostName, pdName) + _, err := volumes.DetachDisk(pdName, hostName) + return err } } @@ -395,7 +405,7 @@ func testPDPod(diskNames []string, targetHost string, readOnly bool, numContaine containers[i].Name = fmt.Sprintf("mycontainer%v", i+1) } - containers[i].Image = "gcr.io/google_containers/busybox" + containers[i].Image = "gcr.io/google_containers/busybox:1.24" containers[i].Command = []string{"sleep", "6000"} diff --git a/test/e2e/persistent_volumes.go b/test/e2e/persistent_volumes.go index 9673c831d73..041f8716734 100644 --- a/test/e2e/persistent_volumes.go +++ b/test/e2e/persistent_volumes.go @@ -162,7 +162,7 @@ func makeCheckPod(ns string, nfsserver string) *api.Pod { Containers: []api.Container{ { Name: "scrub-checker", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh"}, Args: []string{"-c", "test ! -e /mnt/index.html || exit 1"}, VolumeMounts: []api.VolumeMount{ diff --git a/test/e2e/pods.go b/test/e2e/pods.go index ed432d2a0a4..4f4b86f9245 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -68,14 +68,14 @@ func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRe // 'Terminated' which can cause indefinite blocking.) expectNoError(waitForPodNotPending(c, ns, podDescr.Name), fmt.Sprintf("starting pod %s in namespace %s", podDescr.Name, ns)) - By(fmt.Sprintf("Started pod %s in namespace %s", podDescr.Name, ns)) + Logf("Started pod %s in namespace %s", podDescr.Name, ns) // Check the pod's current state and verify that restartCount is present. By("checking the pod's current state and verifying that restartCount is present") pod, err := c.Pods(ns).Get(podDescr.Name) expectNoError(err, fmt.Sprintf("getting pod %s in namespace %s", podDescr.Name, ns)) initialRestartCount := api.GetExistingContainerStatus(pod.Status.ContainerStatuses, "liveness").RestartCount - By(fmt.Sprintf("Initial restart count of pod %s is %d", podDescr.Name, initialRestartCount)) + Logf("Initial restart count of pod %s is %d", podDescr.Name, initialRestartCount) // Wait for the restart state to be as desired. deadline := time.Now().Add(timeout) @@ -86,8 +86,8 @@ func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRe expectNoError(err, fmt.Sprintf("getting pod %s", podDescr.Name)) restartCount := api.GetExistingContainerStatus(pod.Status.ContainerStatuses, "liveness").RestartCount if restartCount != lastRestartCount { - By(fmt.Sprintf("Restart count of pod %s/%s is now %d (%v elapsed)", - ns, podDescr.Name, restartCount, time.Since(start))) + Logf("Restart count of pod %s/%s is now %d (%v elapsed)", + ns, podDescr.Name, restartCount, time.Since(start)) if restartCount < lastRestartCount { Failf("Restart count should increment monotonically: restart cont of pod %s/%s changed from %d to %d", ns, podDescr.Name, lastRestartCount, restartCount) @@ -209,7 +209,7 @@ func getRestartDelay(c *client.Client, pod *api.Pod, ns string, name string, con var _ = Describe("Pods", func() { framework := NewFramework("pods") - PIt("should get a host IP [Conformance]", func() { + It("should get a host IP [Conformance]", func() { name := "pod-hostip-" + string(util.NewUUID()) testHostIP(framework.Client, framework.Namespace.Name, &api.Pod{ ObjectMeta: api.ObjectMeta{ @@ -343,8 +343,12 @@ var _ = Describe("Pods", func() { Fail("Timeout while waiting for pod creation") } + // We need to wait for the pod to be scheduled, otherwise the deletion + // will be carried out immediately rather than gracefully. + expectNoError(framework.WaitForPodRunning(pod.Name)) + By("deleting the pod gracefully") - if err := podClient.Delete(pod.Name, nil); err != nil { + if err := podClient.Delete(pod.Name, api.NewDeleteOptions(30)); err != nil { Failf("Failed to delete pod: %v", err) } @@ -352,7 +356,7 @@ var _ = Describe("Pods", func() { deleted := false timeout := false var lastPod *api.Pod - timer := time.After(podStartTimeout) + timer := time.After(30 * time.Second) for !deleted && !timeout { select { case event, _ := <-w.ResultChan(): @@ -466,6 +470,86 @@ var _ = Describe("Pods", func() { Logf("Pod update OK") }) + It("should allow activeDeadlineSeconds to be updated [Conformance]", func() { + podClient := framework.Client.Pods(framework.Namespace.Name) + + By("creating the pod") + name := "pod-update-activedeadlineseconds-" + string(util.NewUUID()) + value := strconv.Itoa(time.Now().Nanosecond()) + pod := &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: name, + Labels: map[string]string{ + "name": "foo", + "time": value, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "nginx", + Image: "gcr.io/google_containers/nginx:1.7.9", + Ports: []api.ContainerPort{{ContainerPort: 80}}, + LivenessProbe: &api.Probe{ + Handler: api.Handler{ + HTTPGet: &api.HTTPGetAction{ + Path: "/index.html", + Port: intstr.FromInt(8080), + }, + }, + InitialDelaySeconds: 30, + }, + }, + }, + }, + } + + By("submitting the pod to kubernetes") + defer func() { + By("deleting the pod") + podClient.Delete(pod.Name, api.NewDeleteOptions(0)) + }() + pod, err := podClient.Create(pod) + if err != nil { + Failf("Failed to create pod: %v", err) + } + + expectNoError(framework.WaitForPodRunning(pod.Name)) + + By("verifying the pod is in kubernetes") + selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) + options := api.ListOptions{LabelSelector: selector} + pods, err := podClient.List(options) + Expect(len(pods.Items)).To(Equal(1)) + + // Standard get, update retry loop + expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) { + By("updating the pod") + value = strconv.Itoa(time.Now().Nanosecond()) + if pod == nil { // on retries we need to re-get + pod, err = podClient.Get(name) + if err != nil { + return false, fmt.Errorf("failed to get pod: %v", err) + } + } + newDeadline := int64(5) + pod.Spec.ActiveDeadlineSeconds = &newDeadline + pod, err = podClient.Update(pod) + if err == nil { + Logf("Successfully updated pod") + return true, nil + } + if errors.IsConflict(err) { + Logf("Conflicting update to pod, re-get and re-update: %v", err) + pod = nil // re-get it when we retry + return false, nil + } + return false, fmt.Errorf("failed to update pod: %v", err) + })) + + expectNoError(framework.WaitForPodTerminated(pod.Name, "DeadlineExceeded")) + }) + It("should contain environment variables for services [Conformance]", func() { // Make a pod that will be a service. // This pod serves its hostname via HTTP. @@ -534,7 +618,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: "env3cont", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "env"}, }, }, @@ -563,7 +647,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: "liveness", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 10; rm -rf /tmp/health; sleep 600"}, LivenessProbe: &api.Probe{ Handler: api.Handler{ @@ -590,7 +674,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: "liveness", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 600"}, LivenessProbe: &api.Probe{ Handler: api.Handler{ @@ -689,7 +773,8 @@ var _ = Describe("Pods", func() { Port: intstr.FromInt(8080), }, }, - InitialDelaySeconds: 30, + InitialDelaySeconds: 15, + TimeoutSeconds: 10, FailureThreshold: 1, }, }, @@ -715,7 +800,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: "main", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "echo container is alive; sleep 600"}, }, }, @@ -794,7 +879,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: "main", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "echo container is alive; sleep 600"}, }, }, @@ -859,7 +944,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: containerName, - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "sleep 5", "/crash/missing"}, }, }, @@ -910,7 +995,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: containerName, - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 5; rm -rf /tmp/health; sleep 600"}, LivenessProbe: &api.Probe{ Handler: api.Handler{ @@ -951,7 +1036,7 @@ var _ = Describe("Pods", func() { Containers: []api.Container{ { Name: containerName, - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh", "-c", "sleep 5", "/crash/missing"}, }, }, diff --git a/test/e2e/portforward.go b/test/e2e/portforward.go index c07a3ae9458..03566bd8372 100644 --- a/test/e2e/portforward.go +++ b/test/e2e/portforward.go @@ -27,7 +27,7 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" . "github.com/onsi/ginkgo" ) @@ -150,7 +150,7 @@ var _ = Describe("Port forwarding", func() { By("Closing the connection to the local port") conn.Close() - logOutput := runKubectlWithTimeout(util.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) + logOutput := runKubectlWithTimeout(wait.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) verifyLogMessage(logOutput, "Accepted client connection") verifyLogMessage(logOutput, "Expected to read 3 bytes from client, but got 0 instead") }) @@ -195,7 +195,7 @@ var _ = Describe("Port forwarding", func() { Failf("Expected %q from server, got %q", e, a) } - logOutput := runKubectlWithTimeout(util.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) + logOutput := runKubectlWithTimeout(wait.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) verifyLogMessage(logOutput, "^Accepted client connection$") verifyLogMessage(logOutput, "^Received expected client data$") verifyLogMessage(logOutput, "^Done$") @@ -232,7 +232,7 @@ var _ = Describe("Port forwarding", func() { Failf("Expected %q from server, got %q", e, a) } - logOutput := runKubectlWithTimeout(util.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) + logOutput := runKubectlWithTimeout(wait.ForeverTestTimeout, "logs", fmt.Sprintf("--namespace=%v", framework.Namespace.Name), "-f", podName) verifyLogMessage(logOutput, "Accepted client connection") verifyLogMessage(logOutput, "Done") }) diff --git a/test/e2e/pre_stop.go b/test/e2e/pre_stop.go index e34860bce6a..1c76c39d0bf 100644 --- a/test/e2e/pre_stop.go +++ b/test/e2e/pre_stop.go @@ -76,7 +76,7 @@ func testPreStop(c *client.Client, ns string) { Containers: []api.Container{ { Name: "tester", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sleep", "600"}, Lifecycle: &api.Lifecycle{ PreStop: &api.Handler{ diff --git a/test/e2e/privileged.go b/test/e2e/privileged.go index 41090b82fc4..4a40ee63eac 100644 --- a/test/e2e/privileged.go +++ b/test/e2e/privileged.go @@ -19,13 +19,14 @@ package e2e import ( "encoding/json" "fmt" + "net/url" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apimachinery/registered" client "k8s.io/kubernetes/pkg/client/unversioned" - "net/url" ) const ( @@ -36,7 +37,7 @@ const ( notPrivilegedHttpPort = 9090 notPrivilegedUdpPort = 9091 notPrivilegedContainerName = "not-privileged-container" - privilegedContainerImage = "gcr.io/google_containers/netexec:1.1" + privilegedContainerImage = "gcr.io/google_containers/netexec:1.4" privilegedCommand = "ip link add dummy1 type dummy" ) diff --git a/test/e2e/rc.go b/test/e2e/rc.go index 0797e7f8e2b..4e408c144ea 100644 --- a/test/e2e/rc.go +++ b/test/e2e/rc.go @@ -112,7 +112,7 @@ func ServeImageOrFail(f *Framework, test string, image string) { By("Trying to dial each unique pod") retryTimeout := 2 * time.Minute retryInterval := 5 * time.Second - err = wait.Poll(retryInterval, retryTimeout, podResponseChecker{f.Client, f.Namespace.Name, label, name, true, pods}.checkAllResponses) + err = wait.Poll(retryInterval, retryTimeout, podProxyResponseChecker{f.Client, f.Namespace.Name, label, name, true, pods}.checkAllResponses) if err != nil { Failf("Did not get expected responses within the timeout period of %.2f seconds.", retryTimeout.Seconds()) } diff --git a/test/e2e/replica_set.go b/test/e2e/replica_set.go new file mode 100644 index 00000000000..2c7b93426dd --- /dev/null +++ b/test/e2e/replica_set.go @@ -0,0 +1,118 @@ +/* +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. +*/ + +package e2e + +import ( + "fmt" + "time" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/apis/extensions" + "k8s.io/kubernetes/pkg/labels" + "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("ReplicaSet", func() { + framework := NewFramework("replicaset") + + It("should serve a basic image on each replica with a public image [Conformance]", func() { + ReplicaSetServeImageOrFail(framework, "basic", "gcr.io/google_containers/serve_hostname:1.1") + }) + + It("should serve a basic image on each replica with a private image", func() { + // requires private images + SkipUnlessProviderIs("gce", "gke") + + ReplicaSetServeImageOrFail(framework, "private", "b.gcr.io/k8s_authenticated_test/serve_hostname:1.1") + }) +}) + +// A basic test to check the deployment of an image using a ReplicaSet. The +// image serves its hostname which is checked for each replica. +func ReplicaSetServeImageOrFail(f *Framework, test string, image string) { + name := "my-hostname-" + test + "-" + string(util.NewUUID()) + replicas := 2 + + // Create a ReplicaSet for a service that serves its hostname. + // The source for the Docker containter kubernetes/serve_hostname is + // in contrib/for-demos/serve_hostname + By(fmt.Sprintf("Creating ReplicaSet %s", name)) + rs, err := f.Client.Extensions().ReplicaSets(f.Namespace.Name).Create(&extensions.ReplicaSet{ + ObjectMeta: api.ObjectMeta{ + Name: name, + }, + Spec: extensions.ReplicaSetSpec{ + Replicas: replicas, + Selector: &unversioned.LabelSelector{MatchLabels: map[string]string{ + "name": name, + }}, + Template: &api.PodTemplateSpec{ + ObjectMeta: api.ObjectMeta{ + Labels: map[string]string{"name": name}, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: name, + Image: image, + Ports: []api.ContainerPort{{ContainerPort: 9376}}, + }, + }, + }, + }, + }, + }) + Expect(err).NotTo(HaveOccurred()) + // Cleanup the ReplicaSet when we are done. + defer func() { + // Resize the ReplicaSet to zero to get rid of pods. + if err := DeleteReplicaSet(f.Client, f.Namespace.Name, rs.Name); err != nil { + Logf("Failed to cleanup ReplicaSet %v: %v.", rs.Name, err) + } + }() + + // List the pods, making sure we observe all the replicas. + label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) + + pods, err := podsCreated(f.Client, f.Namespace.Name, name, replicas) + + By("Ensuring each pod is running") + + // Wait for the pods to enter the running state. Waiting loops until the pods + // are running so non-running pods cause a timeout for this test. + for _, pod := range pods.Items { + if pod.DeletionTimestamp != nil { + continue + } + err = f.WaitForPodRunning(pod.Name) + Expect(err).NotTo(HaveOccurred()) + } + + // Verify that something is listening. + By("Trying to dial each unique pod") + retryTimeout := 2 * time.Minute + retryInterval := 5 * time.Second + err = wait.Poll(retryInterval, retryTimeout, podProxyResponseChecker{f.Client, f.Namespace.Name, label, name, true, pods}.checkAllResponses) + if err != nil { + Failf("Did not get expected responses within the timeout period of %.2f seconds.", retryTimeout.Seconds()) + } +} diff --git a/test/e2e/scheduler_predicates.go b/test/e2e/scheduler_predicates.go index dbae84a92d3..607b5125b69 100644 --- a/test/e2e/scheduler_predicates.go +++ b/test/e2e/scheduler_predicates.go @@ -18,9 +18,11 @@ package e2e import ( "fmt" + "path/filepath" "time" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -29,6 +31,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + _ "github.com/stretchr/testify/assert" ) // Returns a number of currently scheduled and not scheduled Pods. @@ -176,6 +179,7 @@ func waitForStableCluster(c *client.Client) int { var _ = Describe("SchedulerPredicates [Serial]", func() { var c *client.Client var nodeList *api.NodeList + var systemPodsNo int var totalPodCapacity int64 var RCName string var ns string @@ -195,6 +199,16 @@ var _ = Describe("SchedulerPredicates [Serial]", func() { c = framework.Client ns = framework.Namespace.Name nodeList = ListSchedulableNodesOrDie(c) + + // Every test case in this suite assumes that cluster add-on pods stay stable and + // cannot be run in parallel with any other test that touches Nodes or Pods. + // It is so because we need to have precise control on what's running in the cluster. + systemPods, err := c.Pods(api.NamespaceSystem).List(api.ListOptions{}) + Expect(err).NotTo(HaveOccurred()) + systemPodsNo = len(systemPods.Items) + + err = waitForPodsRunningReady(api.NamespaceSystem, systemPodsNo, podReadyBeforeTimeout) + Expect(err).NotTo(HaveOccurred()) }) // This test verifies that max-pods flag works as advertised. It assumes that cluster add-on pods stay stable @@ -281,7 +295,7 @@ var _ = Describe("SchedulerPredicates [Serial]", func() { _, found := nodeToCapacityMap[pod.Spec.NodeName] Expect(found).To(Equal(true)) if pod.Status.Phase == api.PodRunning { - Logf("Pod %v requesting capacity %v on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName) + Logf("Pod %v requesting resource %v on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName) nodeToCapacityMap[pod.Spec.NodeName] -= getRequestedCPU(pod) } } @@ -392,6 +406,49 @@ var _ = Describe("SchedulerPredicates [Serial]", func() { cleanupPods(c, ns) }) + It("validates that a pod with an invalid NodeAffinity is rejected [Feature:NodeAffinity]", func() { + + By("Trying to launch a pod with an invalid Affinity data.") + podName := "without-label" + _, err := c.Pods(ns).Create(&api.Pod{ + TypeMeta: unversioned.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: podName, + Annotations: map[string]string{ + api.AffinityAnnotationKey: ` + {"nodeAffinity": { + "requiredDuringSchedulingRequiredDuringExecution": { + "nodeSelectorTerms": [{ + "matchExpressions": [] + }] + }, + }}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: podName, + Image: "gcr.io/google_containers/pause:2.0", + }, + }, + }, + }) + + if err == nil || !errors.IsInvalid(err) { + Failf("Expect error of invalid, got : %v", err) + } + + // Wait a bit to allow scheduler to do its thing if the pod is not rejected. + // TODO: this is brittle; there's no guarantee the scheduler will have run in 10 seconds. + Logf("Sleeping 10 seconds and crossing our fingers that scheduler will run in that time.") + time.Sleep(10 * time.Second) + + cleanupPods(c, ns) + }) + It("validates that NodeSelector is respected if matching [Conformance]", func() { // launch a pod to find a node which can launch a pod. We intentionally do // not just take the node list and choose the first of them. Depending on the @@ -470,4 +527,217 @@ var _ = Describe("SchedulerPredicates [Serial]", func() { expectNoError(err) Expect(labelPod.Spec.NodeName).To(Equal(nodeName)) }) + + // Test Nodes does not have any label, hence it should be impossible to schedule Pod with + // non-nil NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution. + It("validates that NodeAffinity is respected if not matching [Feature:NodeAffinity]", func() { + By("Trying to schedule Pod with nonempty NodeSelector.") + podName := "restricted-pod" + + waitForStableCluster(c) + + _, err := c.Pods(ns).Create(&api.Pod{ + TypeMeta: unversioned.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: podName, + Labels: map[string]string{"name": "restricted"}, + Annotations: map[string]string{ + "scheduler.alpha.kubernetes.io/affinity": ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { + "matchExpressions": [{ + "key": "foo", + "operator": "In", + "values": ["bar", "value2"] + }] + }, + { + "matchExpressions": [{ + "key": "diffkey", + "operator": "In", + "values": ["wrong", "value2"] + }] + } + ] + }}}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: podName, + Image: "gcr.io/google_containers/pause:2.0", + }, + }, + }, + }) + expectNoError(err) + // Wait a bit to allow scheduler to do its thing + // TODO: this is brittle; there's no guarantee the scheduler will have run in 10 seconds. + Logf("Sleeping 10 seconds and crossing our fingers that scheduler will run in that time.") + time.Sleep(10 * time.Second) + + verifyResult(c, podName, ns) + cleanupPods(c, ns) + }) + + // Keep the same steps with the test on NodeSelector, + // but specify Affinity in Pod.Annotations, instead of NodeSelector. + It("validates that required NodeAffinity setting is respected if matching [Feature:NodeAffinity]", func() { + // launch a pod to find a node which can launch a pod. We intentionally do + // not just take the node list and choose the first of them. Depending on the + // cluster and the scheduler it might be that a "normal" pod cannot be + // scheduled onto it. + By("Trying to launch a pod without a label to get a node which can launch it.") + podName := "without-label" + _, err := c.Pods(ns).Create(&api.Pod{ + TypeMeta: unversioned.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: podName, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: podName, + Image: "gcr.io/google_containers/pause:2.0", + }, + }, + }, + }) + expectNoError(err) + expectNoError(waitForPodRunningInNamespace(c, podName, ns)) + pod, err := c.Pods(ns).Get(podName) + expectNoError(err) + + nodeName := pod.Spec.NodeName + err = c.Pods(ns).Delete(podName, api.NewDeleteOptions(0)) + expectNoError(err) + + By("Trying to apply a random label on the found node.") + k := fmt.Sprintf("kubernetes.io/e2e-%s", string(util.NewUUID())) + v := "42" + patch := fmt.Sprintf(`{"metadata":{"labels":{"%s":"%s"}}}`, k, v) + err = c.Patch(api.MergePatchType).Resource("nodes").Name(nodeName).Body([]byte(patch)).Do().Error() + expectNoError(err) + + node, err := c.Nodes().Get(nodeName) + expectNoError(err) + Expect(node.Labels[k]).To(Equal(v)) + + By("Trying to relaunch the pod, now with labels.") + labelPodName := "with-labels" + _, err = c.Pods(ns).Create(&api.Pod{ + TypeMeta: unversioned.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: labelPodName, + Annotations: map[string]string{ + "scheduler.alpha.kubernetes.io/affinity": ` + {"nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { + "matchExpressions": [{ + "key": "kubernetes.io/hostname", + "operator": "In", + "values": ["` + nodeName + `"] + },{ + "key": "` + k + `", + "operator": "In", + "values": ["` + v + `"] + }] + } + ] + }}}`, + }, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: labelPodName, + Image: "gcr.io/google_containers/pause:2.0", + }, + }, + }, + }) + expectNoError(err) + defer c.Pods(ns).Delete(labelPodName, api.NewDeleteOptions(0)) + + // check that pod got scheduled. We intentionally DO NOT check that the + // pod is running because this will create a race condition with the + // kubelet and the scheduler: the scheduler might have scheduled a pod + // already when the kubelet does not know about its new label yet. The + // kubelet will then refuse to launch the pod. + expectNoError(waitForPodNotPending(c, ns, labelPodName)) + labelPod, err := c.Pods(ns).Get(labelPodName) + expectNoError(err) + Expect(labelPod.Spec.NodeName).To(Equal(nodeName)) + }) + + // Verify that an escaped JSON string of NodeAffinity in a YAML PodSpec works. + It("validates that embedding the JSON NodeAffinity setting as a string in the annotation value work [Feature:NodeAffinity]", func() { + // launch a pod to find a node which can launch a pod. We intentionally do + // not just take the node list and choose the first of them. Depending on the + // cluster and the scheduler it might be that a "normal" pod cannot be + // scheduled onto it. + By("Trying to launch a pod without a label to get a node which can launch it.") + podName := "without-label" + _, err := c.Pods(ns).Create(&api.Pod{ + TypeMeta: unversioned.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: podName, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: podName, + Image: "gcr.io/google_containers/pause:2.0", + }, + }, + }, + }) + expectNoError(err) + expectNoError(waitForPodRunningInNamespace(c, podName, ns)) + pod, err := c.Pods(ns).Get(podName) + expectNoError(err) + + nodeName := pod.Spec.NodeName + err = c.Pods(ns).Delete(podName, api.NewDeleteOptions(0)) + expectNoError(err) + + By("Trying to apply a label with fake az info on the found node.") + k := "kubernetes.io/e2e-az-name" + v := "e2e-az1" + patch := fmt.Sprintf(`{"metadata":{"labels":{"%s":"%s"}}}`, k, v) + err = c.Patch(api.MergePatchType).Resource("nodes").Name(nodeName).Body([]byte(patch)).Do().Error() + expectNoError(err) + + node, err := c.Nodes().Get(nodeName) + expectNoError(err) + Expect(node.Labels[k]).To(Equal(v)) + + By("Trying to launch a pod that with NodeAffinity setting as embedded JSON string in the annotation value.") + labelPodName := "with-labels" + nodeSelectionRoot := filepath.Join(testContext.RepoRoot, "docs/user-guide/node-selection") + testPodPath := filepath.Join(nodeSelectionRoot, "pod-with-node-affinity.yaml") + runKubectlOrDie("create", "-f", testPodPath, fmt.Sprintf("--namespace=%v", ns)) + defer c.Pods(ns).Delete(labelPodName, api.NewDeleteOptions(0)) + + // check that pod got scheduled. We intentionally DO NOT check that the + // pod is running because this will create a race condition with the + // kubelet and the scheduler: the scheduler might have scheduled a pod + // already when the kubelet does not know about its new label yet. The + // kubelet will then refuse to launch the pod. + expectNoError(waitForPodNotPending(c, ns, labelPodName)) + labelPod, err := c.Pods(ns).Get(labelPodName) + expectNoError(err) + Expect(labelPod.Spec.NodeName).To(Equal(nodeName)) + }) }) diff --git a/test/e2e/secrets.go b/test/e2e/secrets.go index d63dbcabe5a..8b439a22eff 100644 --- a/test/e2e/secrets.go +++ b/test/e2e/secrets.go @@ -131,7 +131,7 @@ var _ = Describe("Secrets", func() { Containers: []api.Container{ { Name: "secret-env-test", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "env"}, Env: []api.EnvVar{ { diff --git a/test/e2e/security_context.go b/test/e2e/security_context.go index 17700d797e2..953395fbc3a 100644 --- a/test/e2e/security_context.go +++ b/test/e2e/security_context.go @@ -47,7 +47,7 @@ func scTestPod(hostIPC bool, hostPID bool) *api.Pod { Containers: []api.Container{ { Name: "test-container", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", }, }, RestartPolicy: api.RestartPolicyNever, @@ -154,8 +154,8 @@ func testPodSELinuxLabeling(framework *Framework, hostIPC bool, hostPID bool) { // Confirm that the file can be accessed from a second // pod using host_path with the same MCS label - volumeHostPath := fmt.Sprintf("/var/lib/kubelet/pods/%s/volumes/kubernetes.io~empty-dir/%s", foundPod.UID, volumeName) - By("confirming a container with the same label can read the file") + volumeHostPath := fmt.Sprintf("%s/pods/%s/volumes/kubernetes.io~empty-dir/%s", testContext.KubeVolumeDir, foundPod.UID, volumeName) + By(fmt.Sprintf("confirming a container with the same label can read the file under --volume-dir=%s", testContext.KubeVolumeDir)) pod = scTestPod(hostIPC, hostPID) pod.Spec.NodeName = foundPod.Spec.NodeName volumeMounts := []api.VolumeMount{ diff --git a/test/e2e/service.go b/test/e2e/service.go index f5ed240cba8..e83eb7f97b6 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -32,6 +32,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" client "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/intstr" @@ -42,7 +43,16 @@ import ( // Maximum time a kube-proxy daemon on a node is allowed to not // notice a Service update, such as type=NodePort. -const kubeProxyLagTimeout = 45 * time.Second +// TODO: This timeout should be O(10s), observed values are O(1m), 5m is very +// liberal. Fix tracked in #20567. +const kubeProxyLagTimeout = 5 * time.Minute + +// Maximum time a load balancer is allowed to not respond after creation. +const loadBalancerLagTimeout = 2 * time.Minute + +// How long to wait for a load balancer to be created/modified. +//TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable +const loadBalancerCreateTimeout = 20 * time.Minute // This should match whatever the default/configured range is var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768} @@ -81,6 +91,7 @@ var _ = Describe("Services", func() { }) It("should serve a basic endpoint from pods [Conformance]", func() { + // TODO: use the ServiceTestJig here serviceName := "endpoint-test2" ns := f.Namespace.Name labels := map[string]string{ @@ -140,6 +151,7 @@ var _ = Describe("Services", func() { }) It("should serve multiport endpoints from pods [Conformance]", func() { + // TODO: use the ServiceTestJig here // repacking functionality is intentionally not tested here - it's better to test it in an integration test. serviceName := "multi-endpoint-test" ns := f.Namespace.Name @@ -223,13 +235,16 @@ var _ = Describe("Services", func() { }) It("should be able to up and down services", func() { + // TODO: use the ServiceTestJig here // this test uses NodeSSHHosts that does not work if a Node only reports LegacyHostIP SkipUnlessProviderIs(providersWithSSH...) ns := f.Namespace.Name numPods, servicePort := 3, 80 + By("creating service1 in namespace " + ns) podNames1, svc1IP, err := startServeHostnameService(c, ns, "service1", servicePort, numPods) Expect(err).NotTo(HaveOccurred()) + By("creating service2 in namespace " + ns) podNames2, svc2IP, err := startServeHostnameService(c, ns, "service2", servicePort, numPods) Expect(err).NotTo(HaveOccurred()) @@ -240,31 +255,39 @@ var _ = Describe("Services", func() { } host := hosts[0] + By("verifying service1 is up") expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames1, svc1IP, servicePort)) + + By("verifying service2 is up") expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames2, svc2IP, servicePort)) // Stop service 1 and make sure it is gone. + By("stopping service1") expectNoError(stopServeHostnameService(c, ns, "service1")) + By("verifying service1 is not up") expectNoError(verifyServeHostnameServiceDown(c, host, svc1IP, servicePort)) + By("verifying service2 is still up") expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames2, svc2IP, servicePort)) // Start another service and verify both are up. + By("creating service3 in namespace " + ns) podNames3, svc3IP, err := startServeHostnameService(c, ns, "service3", servicePort, numPods) Expect(err).NotTo(HaveOccurred()) if svc2IP == svc3IP { - Failf("VIPs conflict: %v", svc2IP) + Failf("service IPs conflict: %v", svc2IP) } + By("verifying service2 is still up") expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames2, svc2IP, servicePort)) - expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames3, svc3IP, servicePort)) - expectNoError(stopServeHostnameService(c, ns, "service2")) - expectNoError(stopServeHostnameService(c, ns, "service3")) + By("verifying service3 is up") + expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames3, svc3IP, servicePort)) }) It("should work after restarting kube-proxy [Disruptive]", func() { + // TODO: use the ServiceTestJig here SkipUnlessProviderIs("gce", "gke") ns := f.Namespace.Name @@ -316,6 +339,7 @@ var _ = Describe("Services", func() { }) It("should work after restarting apiserver [Disruptive]", func() { + // TODO: use the ServiceTestJig here // TODO: restartApiserver doesn't work in GKE - fix it and reenable this test. SkipUnlessProviderIs("gce") @@ -356,53 +380,28 @@ var _ = Describe("Services", func() { expectNoError(verifyServeHostnameServiceUp(c, ns, host, podNames2, svc2IP, servicePort)) }) + // TODO: Run this test against the userspace proxy and nodes + // configured with a default deny firewall to validate that the + // proxy whitelists NodePort traffic. It("should be able to create a functioning NodePort service", func() { - serviceName := "nodeportservice-test" + serviceName := "nodeport-test" ns := f.Namespace.Name - t := NewServerTest(c, ns, serviceName) - defer func() { - defer GinkgoRecover() - errs := t.Cleanup() - if len(errs) != 0 { - Failf("errors in cleanup: %v", errs) - } - }() - - service := t.BuildServiceSpec() - service.Spec.Type = api.ServiceTypeNodePort + jig := NewServiceTestJig(c, serviceName) + nodeIP := pickNodeIP(jig.Client) // for later By("creating service " + serviceName + " with type=NodePort in namespace " + ns) - result, err := c.Services(ns).Create(service) - Expect(err).NotTo(HaveOccurred()) - defer func(ns, serviceName string) { // clean up when we're done - By("deleting service " + serviceName + " in namespace " + ns) - err := c.Services(ns).Delete(serviceName) - Expect(err).NotTo(HaveOccurred()) - }(ns, serviceName) - - if len(result.Spec.Ports) != 1 { - Failf("got unexpected number (%d) of Ports for NodePort service: %v", len(result.Spec.Ports), result) - } - - nodePort := result.Spec.Ports[0].NodePort - if nodePort == 0 { - Failf("got unexpected nodePort (%d) on Ports[0] for NodePort service: %v", nodePort, result) - } - if !ServiceNodePortRange.Contains(nodePort) { - Failf("got unexpected (out-of-range) port for NodePort service: %v", result) - } + service := jig.CreateTCPServiceOrFail(ns, func(svc *api.Service) { + svc.Spec.Type = api.ServiceTypeNodePort + }) + jig.SanityCheckService(service, api.ServiceTypeNodePort) + nodePort := service.Spec.Ports[0].NodePort By("creating pod to be part of service " + serviceName) - t.CreateWebserverRC(1) + jig.RunOrFail(ns, nil) By("hitting the pod through the service's NodePort") - ip := pickNodeIP(c) - // Loop for kubeProxyLagTimeout, because different kube-proxies might take - // different times to notice the new Service and open up the node port. - if err := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { return testReachable(ip, nodePort) }); err != nil { - Failf("Could not reach nodePort service through node-ip %v:%v in %v", ip, nodePort, kubeProxyLagTimeout) - } + jig.TestReachableHTTP(nodeIP, nodePort, kubeProxyLagTimeout) By("verifying the node port is locked") hostExec := LaunchHostExecPod(f.Client, f.Namespace.Name, "hostexec") @@ -411,202 +410,297 @@ var _ = Describe("Services", func() { cmd := fmt.Sprintf(`for i in $(seq 1 300); do if ss -ant46 'sport = :%d' | grep ^LISTEN; then exit 0; fi; sleep 1; done; exit 1`, nodePort) stdout, err := RunHostCmd(hostExec.Namespace, hostExec.Name, cmd) if err != nil { - Failf("expected node port (%d) to be in use, stdout: %v", nodePort, stdout) + Failf("expected node port %d to be in use, stdout: %v", nodePort, stdout) } }) - It("should be able to change the type and nodeport settings of a service", func() { + It("should be able to change the type and ports of a service", func() { // requires cloud load-balancer support SkipUnlessProviderIs("gce", "gke", "aws") - serviceName := "mutability-service-test" + // This test is more monolithic than we'd like because LB turnup can be + // very slow, so we lumped all the tests into one LB lifecycle. - t := NewServerTest(f.Client, f.Namespace.Name, serviceName) - defer func() { - defer GinkgoRecover() - errs := t.Cleanup() - if len(errs) != 0 { - Failf("errors in cleanup: %v", errs) - } - }() + serviceName := "mutability-test" + ns1 := f.Namespace.Name // LB1 in ns1 on TCP + Logf("namespace for TCP test: %s", ns1) - service := t.BuildServiceSpec() - - By("creating service " + serviceName + " with type unspecified in namespace " + t.Namespace) - service, err := t.CreateService(service) + By("creating a second namespace") + namespacePtr, err := createTestingNS("services", c, nil) Expect(err).NotTo(HaveOccurred()) + ns2 := namespacePtr.Name // LB2 in ns2 on UDP + Logf("namespace for UDP test: %s", ns2) + extraNamespaces = append(extraNamespaces, ns2) - if service.Spec.Type != api.ServiceTypeClusterIP { - Failf("got unexpected Spec.Type for default service: %v", service) - } - if len(service.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for default service: %v", service) - } - port := service.Spec.Ports[0] - if port.NodePort != 0 { - Failf("got unexpected Spec.Ports[0].nodePort for default service: %v", service) - } - if len(service.Status.LoadBalancer.Ingress) != 0 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for default service: %v", service) - } + jig := NewServiceTestJig(c, serviceName) + nodeIP := pickNodeIP(jig.Client) // for later - By("creating pod to be part of service " + t.ServiceName) - t.CreateWebserverRC(1) + // Test TCP and UDP Services. Services with the same name in different + // namespaces should get different node ports and load balancers. - By("changing service " + serviceName + " to type=NodePort") - service, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) { + By("creating a TCP service " + serviceName + " with type=ClusterIP in namespace " + ns1) + tcpService := jig.CreateTCPServiceOrFail(ns1, nil) + jig.SanityCheckService(tcpService, api.ServiceTypeClusterIP) + + By("creating a UDP service " + serviceName + " with type=ClusterIP in namespace " + ns2) + udpService := jig.CreateUDPServiceOrFail(ns2, nil) + jig.SanityCheckService(udpService, api.ServiceTypeClusterIP) + + By("verifying that TCP and UDP use the same port") + if tcpService.Spec.Ports[0].Port != udpService.Spec.Ports[0].Port { + Failf("expected to use the same port for TCP and UDP") + } + svcPort := tcpService.Spec.Ports[0].Port + Logf("service port (TCP and UDP): %d", svcPort) + + By("creating a pod to be part of the TCP service " + serviceName) + jig.RunOrFail(ns1, nil) + + By("creating a pod to be part of the UDP service " + serviceName) + jig.RunOrFail(ns2, nil) + + // Change the services to NodePort. + + By("changing the TCP service to type=NodePort") + tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *api.Service) { s.Spec.Type = api.ServiceTypeNodePort }) - Expect(err).NotTo(HaveOccurred()) + jig.SanityCheckService(tcpService, api.ServiceTypeNodePort) + tcpNodePort := tcpService.Spec.Ports[0].NodePort + Logf("TCP node port: %d", tcpNodePort) - if service.Spec.Type != api.ServiceTypeNodePort { - Failf("got unexpected Spec.Type for NodePort service: %v", service) - } - if len(service.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for NodePort service: %v", service) - } - port = service.Spec.Ports[0] - if port.NodePort == 0 { - Failf("got unexpected Spec.Ports[0].nodePort for NodePort service: %v", service) - } - if !ServiceNodePortRange.Contains(port.NodePort) { - Failf("got unexpected (out-of-range) port for NodePort service: %v", service) - } - if len(service.Status.LoadBalancer.Ingress) != 0 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for NodePort service: %v", service) + By("changing the UDP service to type=NodePort") + udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *api.Service) { + s.Spec.Type = api.ServiceTypeNodePort + }) + jig.SanityCheckService(udpService, api.ServiceTypeNodePort) + udpNodePort := udpService.Spec.Ports[0].NodePort + Logf("UDP node port: %d", udpNodePort) + + By("hitting the TCP service's NodePort") + jig.TestReachableHTTP(nodeIP, tcpNodePort, kubeProxyLagTimeout) + + By("hitting the UDP service's NodePort") + jig.TestReachableUDP(nodeIP, udpNodePort, kubeProxyLagTimeout) + + // Change the services to LoadBalancer. + + requestedIP := "" + staticIPName := "" + if providerIs("gce", "gke") { + By("creating a static load balancer IP") + rand.Seed(time.Now().UTC().UnixNano()) + staticIPName = fmt.Sprintf("e2e-external-lb-test-%d", rand.Intn(65535)) + requestedIP, err = createGCEStaticIP(staticIPName) + Expect(err).NotTo(HaveOccurred()) + defer func() { + if staticIPName != "" { + // Release GCE static IP - this is not kube-managed and will not be automatically released. + if err := deleteGCEStaticIP(staticIPName); err != nil { + Logf("failed to release static IP %s: %v", staticIPName, err) + } + } + }() + Logf("Allocated static load balancer IP: %s", requestedIP) } - By("hitting the pod through the service's NodePort") - ip := pickNodeIP(f.Client) - nodePort1 := port.NodePort // Save for later! - - // Loop for kubeProxyLagTimeout, because different kube-proxies might take - // different times to notice the new Service and open up the node port. - if err := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { return testReachable(ip, nodePort1) }); err != nil { - Failf("Could not reach nodePort service through node-ip %v:%v in %v", ip, nodePort1, kubeProxyLagTimeout) - } - - By("changing service " + serviceName + " to type=LoadBalancer") - service, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) { + By("changing the TCP service to type=LoadBalancer") + tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *api.Service) { + s.Spec.LoadBalancerIP = requestedIP // will be "" if not applicable s.Spec.Type = api.ServiceTypeLoadBalancer }) - Expect(err).NotTo(HaveOccurred()) - // Wait for the load balancer to be created asynchronously - service, err = waitForLoadBalancerIngress(f.Client, serviceName, f.Namespace.Name) - Expect(err).NotTo(HaveOccurred()) - - if service.Spec.Type != api.ServiceTypeLoadBalancer { - Failf("got unexpected Spec.Type for LoadBalancer service: %v", service) - } - if len(service.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for LoadBalancer service: %v", service) - } - port = service.Spec.Ports[0] - if port.NodePort != nodePort1 { - Failf("got unexpected Spec.Ports[0].nodePort for LoadBalancer service: %v", service) - } - if len(service.Status.LoadBalancer.Ingress) != 1 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for LoadBalancer service: %v", service) - } - ingress1 := service.Status.LoadBalancer.Ingress[0] - if ingress1.IP == "" && ingress1.Hostname == "" { - Failf("got unexpected Status.LoadBalancer.Ingress[0] for LoadBalancer service: %v", service) - } - - By("hitting the pod through the service's NodePort") - ip = pickNodeIP(f.Client) - - // Loop for kubeProxyLagTimeout, because different kube-proxies might take - // different times to notice the new Service and open up the node port. - if err := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { return testReachable(ip, nodePort1) }); err != nil { - Failf("Could not reach nodePort service through node-ip %v:%v in %v", ip, nodePort1, kubeProxyLagTimeout) - } - - By("hitting the pod through the service's LoadBalancer") - testLoadBalancerReachable(ingress1, 80) - - By("changing service " + serviceName + ": update NodePort") - nodePort2 := 0 - for i := 1; i < ServiceNodePortRange.Size; i++ { - offs1 := nodePort1 - ServiceNodePortRange.Base - offs2 := (offs1 + i) % ServiceNodePortRange.Size - nodePort2 = ServiceNodePortRange.Base + offs2 - service, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) { - s.Spec.Ports[0].NodePort = nodePort2 - }) - if err != nil && strings.Contains(err.Error(), "provided port is already allocated") { - Logf("nodePort %d is busy, will retry", nodePort2) - continue - } - // Otherwise err was nil or err was a real error - break - } - Expect(err).NotTo(HaveOccurred()) - - if service.Spec.Type != api.ServiceTypeLoadBalancer { - Failf("got unexpected Spec.Type for updated-LoadBalancer service: %v", service) - } - if len(service.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for updated-LoadBalancer service: %v", service) - } - port = service.Spec.Ports[0] - if port.NodePort != nodePort2 { - Failf("got unexpected Spec.Ports[0].nodePort for LoadBalancer service: %v", service) - } - if len(service.Status.LoadBalancer.Ingress) != 1 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for LoadBalancer service: %v", service) - } - - By("hitting the pod through the service's updated NodePort") - - // Loop for kubeProxyLagTimeout, because different kube-proxies might take - // different times to notice the new Service and open up the node port. - if err := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { return testReachable(ip, nodePort2) }); err != nil { - Failf("Could not reach nodePort service through node-ip %v:%v in %v", ip, nodePort2, kubeProxyLagTimeout) - } - - By("checking the old NodePort is closed") - testNotReachable(ip, nodePort1) - - servicePort := 80 - By("hitting the pod through the service's LoadBalancer") - i := 1 - for start := time.Now(); time.Since(start) < podStartTimeout; time.Sleep(3 * time.Second) { - service, err = waitForLoadBalancerIngress(f.Client, serviceName, f.Namespace.Name) - Expect(err).NotTo(HaveOccurred()) - - ingress2 := service.Status.LoadBalancer.Ingress[0] - if testLoadBalancerReachable(ingress2, servicePort) { - break - } - - if i%5 == 0 { - Logf("Waiting for load-balancer changes (%v elapsed, will retry)", time.Since(start)) - } - i++ - } - - By("updating service's port " + serviceName + " and reaching it at the same IP") - service, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) { - s.Spec.Ports[0].Port = 19482 // chosen arbitrarily to not conflict with port 80 + By("changing the UDP service to type=LoadBalancer") + udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *api.Service) { + s.Spec.Type = api.ServiceTypeLoadBalancer }) - Expect(err).NotTo(HaveOccurred()) - port = service.Spec.Ports[0] - if !testLoadBalancerReachable(service.Status.LoadBalancer.Ingress[0], port.Port) { - Failf("Failed to reach load balancer at original ingress after updating its port: %+v", service) + + By("waiting for the TCP service to have a load balancer") + // Wait for the load balancer to be created asynchronously + tcpService = jig.WaitForLoadBalancerOrFail(ns1, tcpService.Name) + jig.SanityCheckService(tcpService, api.ServiceTypeLoadBalancer) + if tcpService.Spec.Ports[0].NodePort != tcpNodePort { + Failf("TCP Spec.Ports[0].NodePort changed (%d -> %d) when not expected", tcpNodePort, tcpService.Spec.Ports[0].NodePort) + } + if requestedIP != "" && getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0]) != requestedIP { + Failf("unexpected TCP Status.LoadBalancer.Ingress (expected %s, got %s)", requestedIP, getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0])) + } + tcpIngressIP := getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0]) + Logf("TCP load balancer: %s", tcpIngressIP) + + By("waiting for the UDP service " + serviceName + " to have a load balancer") + if providerIs("gce", "gke") { + // Do this as early as possible, which overrides the `defer` above. + // This is mostly out of fear of leaking the IP in a timeout case + // (as of this writing we're not 100% sure where the leaks are + // coming from, so this is first-aid rather than surgery). + By("demoting the static IP to ephemeral") + if staticIPName != "" { + // Deleting it after it is attached "demotes" it to an + // ephemeral IP, which can be auto-released. + if err := deleteGCEStaticIP(staticIPName); err != nil { + Failf("failed to release static IP %s: %v", staticIPName, err) + } + staticIPName = "" + } } - removeExternalLoadBalancer(f, service) + By("waiting for the UDP service to have a load balancer") + // 2nd one should be faster since they ran in parallel. + udpService = jig.WaitForLoadBalancerOrFail(ns2, udpService.Name) + jig.SanityCheckService(udpService, api.ServiceTypeLoadBalancer) + if udpService.Spec.Ports[0].NodePort != udpNodePort { + Failf("UDP Spec.Ports[0].NodePort changed (%d -> %d) when not expected", udpNodePort, udpService.Spec.Ports[0].NodePort) + } + udpIngressIP := getIngressPoint(&udpService.Status.LoadBalancer.Ingress[0]) + Logf("UDP load balancer: %s", udpIngressIP) - By("checking the NodePort is closed") - ip = pickNodeIP(f.Client) - testNotReachable(ip, nodePort2) - By("checking the LoadBalancer is closed") - testLoadBalancerNotReachable(ingress1, port.Port) + By("verifying that TCP and UDP use different load balancers") + if tcpIngressIP == udpIngressIP { + Failf("Load balancers are not different: %s", getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0])) + } + + By("hitting the TCP service's NodePort") + jig.TestReachableHTTP(nodeIP, tcpNodePort, kubeProxyLagTimeout) + + By("hitting the UDP service's NodePort") + jig.TestReachableUDP(nodeIP, udpNodePort, kubeProxyLagTimeout) + + By("hitting the TCP service's LoadBalancer") + jig.TestReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout) + + By("hitting the UDP service's LoadBalancer") + jig.TestReachableUDP(udpIngressIP, svcPort, loadBalancerLagTimeout) + + // Change the services' node ports. + + By("changing the TCP service's NodePort") + tcpService = jig.ChangeServiceNodePortOrFail(ns1, tcpService.Name, tcpNodePort) + jig.SanityCheckService(tcpService, api.ServiceTypeLoadBalancer) + tcpNodePortOld := tcpNodePort + tcpNodePort = tcpService.Spec.Ports[0].NodePort + if tcpNodePort == tcpNodePortOld { + Failf("TCP Spec.Ports[0].NodePort (%d) did not change", tcpNodePort) + } + if getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0]) != tcpIngressIP { + Failf("TCP Status.LoadBalancer.Ingress changed (%s -> %s) when not expected", tcpIngressIP, getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0])) + } + Logf("TCP node port: %d", tcpNodePort) + + By("changing the UDP service's NodePort") + udpService = jig.ChangeServiceNodePortOrFail(ns2, udpService.Name, udpNodePort) + jig.SanityCheckService(udpService, api.ServiceTypeLoadBalancer) + udpNodePortOld := udpNodePort + udpNodePort = udpService.Spec.Ports[0].NodePort + if udpNodePort == udpNodePortOld { + Failf("UDP Spec.Ports[0].NodePort (%d) did not change", udpNodePort) + } + if getIngressPoint(&udpService.Status.LoadBalancer.Ingress[0]) != udpIngressIP { + Failf("UDP Status.LoadBalancer.Ingress changed (%s -> %s) when not expected", udpIngressIP, getIngressPoint(&udpService.Status.LoadBalancer.Ingress[0])) + } + Logf("UDP node port: %d", udpNodePort) + + By("hitting the TCP service's new NodePort") + jig.TestReachableHTTP(nodeIP, tcpNodePort, kubeProxyLagTimeout) + + By("hitting the UDP service's new NodePort") + jig.TestReachableUDP(nodeIP, udpNodePort, kubeProxyLagTimeout) + + By("checking the old TCP NodePort is closed") + jig.TestNotReachableHTTP(nodeIP, tcpNodePortOld, kubeProxyLagTimeout) + + By("checking the old UDP NodePort is closed") + jig.TestNotReachableUDP(nodeIP, udpNodePortOld, kubeProxyLagTimeout) + + By("hitting the TCP service's LoadBalancer") + jig.TestReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout) + + By("hitting the UDP service's LoadBalancer") + jig.TestReachableUDP(udpIngressIP, svcPort, loadBalancerLagTimeout) + + // Change the services' main ports. + + By("changing the TCP service's port") + tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *api.Service) { + s.Spec.Ports[0].Port++ + }) + jig.SanityCheckService(tcpService, api.ServiceTypeLoadBalancer) + svcPortOld := svcPort + svcPort = tcpService.Spec.Ports[0].Port + if svcPort == svcPortOld { + Failf("TCP Spec.Ports[0].Port (%d) did not change", svcPort) + } + if tcpService.Spec.Ports[0].NodePort != tcpNodePort { + Failf("TCP Spec.Ports[0].NodePort (%d) changed", tcpService.Spec.Ports[0].NodePort) + } + if getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0]) != tcpIngressIP { + Failf("TCP Status.LoadBalancer.Ingress changed (%s -> %s) when not expected", tcpIngressIP, getIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0])) + } + + By("changing the UDP service's port") + udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *api.Service) { + s.Spec.Ports[0].Port++ + }) + jig.SanityCheckService(udpService, api.ServiceTypeLoadBalancer) + if udpService.Spec.Ports[0].Port != svcPort { + Failf("UDP Spec.Ports[0].Port (%d) did not change", udpService.Spec.Ports[0].Port) + } + if udpService.Spec.Ports[0].NodePort != udpNodePort { + Failf("UDP Spec.Ports[0].NodePort (%d) changed", udpService.Spec.Ports[0].NodePort) + } + if getIngressPoint(&udpService.Status.LoadBalancer.Ingress[0]) != udpIngressIP { + Failf("UDP Status.LoadBalancer.Ingress changed (%s -> %s) when not expected", udpIngressIP, getIngressPoint(&udpService.Status.LoadBalancer.Ingress[0])) + } + + Logf("service port (TCP and UDP): %d", svcPort) + + By("hitting the TCP service's NodePort") + jig.TestReachableHTTP(nodeIP, tcpNodePort, kubeProxyLagTimeout) + + By("hitting the UDP service's NodePort") + jig.TestReachableUDP(nodeIP, udpNodePort, kubeProxyLagTimeout) + + By("hitting the TCP service's LoadBalancer") + jig.TestReachableHTTP(tcpIngressIP, svcPort, loadBalancerCreateTimeout) // this may actually recreate the LB + + By("hitting the UDP service's LoadBalancer") + jig.TestReachableUDP(udpIngressIP, svcPort, loadBalancerCreateTimeout) // this may actually recreate the LB) + + // Change the services back to ClusterIP. + + By("changing TCP service back to type=ClusterIP") + tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *api.Service) { + s.Spec.Type = api.ServiceTypeClusterIP + s.Spec.Ports[0].NodePort = 0 + }) + // Wait for the load balancer to be destroyed asynchronously + tcpService = jig.WaitForLoadBalancerDestroyOrFail(ns1, tcpService.Name, tcpIngressIP, svcPort) + jig.SanityCheckService(tcpService, api.ServiceTypeClusterIP) + + By("changing UDP service back to type=ClusterIP") + udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *api.Service) { + s.Spec.Type = api.ServiceTypeClusterIP + s.Spec.Ports[0].NodePort = 0 + }) + // Wait for the load balancer to be destroyed asynchronously + udpService = jig.WaitForLoadBalancerDestroyOrFail(ns2, udpService.Name, udpIngressIP, svcPort) + jig.SanityCheckService(udpService, api.ServiceTypeClusterIP) + + By("checking the TCP NodePort is closed") + jig.TestNotReachableHTTP(nodeIP, tcpNodePort, kubeProxyLagTimeout) + + By("checking the UDP NodePort is closed") + jig.TestNotReachableUDP(nodeIP, udpNodePort, kubeProxyLagTimeout) + + By("checking the TCP LoadBalancer is closed") + jig.TestNotReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout) + + By("checking the UDP LoadBalancer is closed") + jig.TestNotReachableUDP(udpIngressIP, svcPort, loadBalancerLagTimeout) }) It("should prevent NodePort collisions", func() { + // TODO: use the ServiceTestJig here baseName := "nodeport-collision-" serviceName1 := baseName + "1" serviceName2 := baseName + "2" @@ -660,6 +754,7 @@ var _ = Describe("Services", func() { }) It("should check NodePort out-of-range", func() { + // TODO: use the ServiceTestJig here serviceName := "nodeport-range-test" ns := f.Namespace.Name @@ -726,6 +821,7 @@ var _ = Describe("Services", func() { }) It("should release NodePorts on delete", func() { + // TODO: use the ServiceTestJig here serviceName := "nodeport-reuse" ns := f.Namespace.Name @@ -766,9 +862,17 @@ var _ = Describe("Services", func() { hostExec := LaunchHostExecPod(f.Client, f.Namespace.Name, "hostexec") cmd := fmt.Sprintf(`! ss -ant46 'sport = :%d' | tail -n +2 | grep LISTEN`, nodePort) - stdout, err := RunHostCmd(hostExec.Namespace, hostExec.Name, cmd) - if err != nil { - Failf("expected node port (%d) to not be in use, stdout: %v", nodePort, stdout) + var stdout string + if pollErr := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { + var err error + stdout, err = RunHostCmd(hostExec.Namespace, hostExec.Name, cmd) + if err != nil { + Logf("expected node port (%d) to not be in use, stdout: %v", nodePort, stdout) + return false, nil + } + return true, nil + }); pollErr != nil { + Failf("expected node port (%d) to not be in use in %v, stdout: %v", nodePort, kubeProxyLagTimeout, stdout) } By(fmt.Sprintf("creating service "+serviceName+" with same NodePort %d", nodePort)) @@ -778,118 +882,6 @@ var _ = Describe("Services", func() { service, err = t.CreateService(service) Expect(err).NotTo(HaveOccurred()) }) - - // This test hits several load-balancer cases because LB turnup is slow. - // Flaky issue #18952 - It("should serve identically named services in different namespaces on different load-balancers [Flaky]", func() { - // requires ExternalLoadBalancer - SkipUnlessProviderIs("gce", "gke", "aws") - - ns1 := f.Namespace.Name - - By("Building a second namespace api object") - namespacePtr, err := createTestingNS("services", c, nil) - Expect(err).NotTo(HaveOccurred()) - ns2 := namespacePtr.Name - extraNamespaces = append(extraNamespaces, ns2) - - serviceName := "test-svc" - servicePort := 9376 - - By("creating service " + serviceName + " with load balancer in namespace " + ns1) - t1 := NewServerTest(c, ns1, serviceName) - svc1 := t1.BuildServiceSpec() - svc1.Spec.Type = api.ServiceTypeLoadBalancer - svc1.Spec.Ports[0].Port = servicePort - svc1.Spec.Ports[0].TargetPort = intstr.FromInt(80) - _, err = t1.CreateService(svc1) - Expect(err).NotTo(HaveOccurred()) - - By("creating pod to be part of service " + serviceName + " in namespace " + ns1) - t1.CreateWebserverRC(1) - - loadBalancerIP := "" - if providerIs("gce", "gke") { - By("creating a static IP") - rand.Seed(time.Now().UTC().UnixNano()) - staticIPName := fmt.Sprintf("e2e-external-lb-test-%d", rand.Intn(65535)) - loadBalancerIP, err = createGCEStaticIP(staticIPName) - Expect(err).NotTo(HaveOccurred()) - defer func() { - // Release GCE static IP - this is not kube-managed and will not be automatically released. - deleteGCEStaticIP(staticIPName) - }() - } - - By("creating service " + serviceName + " with UDP load balancer in namespace " + ns2) - t2 := NewNetcatTest(c, ns2, serviceName) - svc2 := t2.BuildServiceSpec() - svc2.Spec.Type = api.ServiceTypeLoadBalancer - svc2.Spec.Ports[0].Port = servicePort - // UDP loadbalancing is tested via test NetcatTest - svc2.Spec.Ports[0].Protocol = api.ProtocolUDP - svc2.Spec.Ports[0].TargetPort = intstr.FromInt(80) - svc2.Spec.LoadBalancerIP = loadBalancerIP - _, err = t2.CreateService(svc2) - Expect(err).NotTo(HaveOccurred()) - - By("creating pod to be part of service " + serviceName + " in namespace " + ns2) - t2.CreateNetcatRC(2) - - ingressPoints := []string{} - svcs := []*api.Service{svc1, svc2} - for _, svc := range svcs { - namespace := svc.Namespace - lbip := svc.Spec.LoadBalancerIP - // This isn't actually part of the test, but it has the net effect of deleting the target pool and forwarding - // rule, so that we don't leak them - defer removeExternalLoadBalancer(f, svc) - - // Wait for the load balancer to be created asynchronously, which is - // currently indicated by ingress point(s) being added to the status. - result, err := waitForLoadBalancerIngress(c, serviceName, namespace) - Expect(err).NotTo(HaveOccurred()) - if len(result.Status.LoadBalancer.Ingress) != 1 { - Failf("got unexpected number (%v) of ingress points for externally load balanced service: %v", result.Status.LoadBalancer.Ingress, result) - } - ingress := result.Status.LoadBalancer.Ingress[0] - if len(result.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for LoadBalancer service: %v", result) - } - if lbip != "" { - Expect(ingress.IP).To(Equal(lbip)) - } - port := result.Spec.Ports[0] - if port.NodePort == 0 { - Failf("got unexpected Spec.Ports[0].nodePort for LoadBalancer service: %v", result) - } - if !ServiceNodePortRange.Contains(port.NodePort) { - Failf("got unexpected (out-of-range) port for LoadBalancer service: %v", result) - } - ing := result.Status.LoadBalancer.Ingress[0].IP - if ing == "" { - ing = result.Status.LoadBalancer.Ingress[0].Hostname - } - ingressPoints = append(ingressPoints, ing) // Save 'em to check uniqueness - - if svc1.Spec.Ports[0].Protocol == api.ProtocolTCP { - By("hitting the pod through the service's NodePort") - ip := pickNodeIP(c) - if err := wait.PollImmediate(poll, kubeProxyLagTimeout, func() (bool, error) { return testReachable(ip, port.NodePort) }); err != nil { - Failf("Could not reach nodePort service through node-ip %v:%v in %v", ip, port.NodePort, kubeProxyLagTimeout) - } - By("hitting the pod through the service's external load balancer") - testLoadBalancerReachable(ingress, servicePort) - } else { - By("hitting the pod through the service's NodePort") - testNetcatReachable(pickNodeIP(c), port.NodePort) - - By("hitting the pod through the service's external load balancer") - testNetcatLoadBalancerReachable(ingress, servicePort) - } - } - validateUniqueOrFail(ingressPoints) - }) }) // updateService fetches a service, calls the update function on it, @@ -915,66 +907,6 @@ func updateService(c *client.Client, namespace, serviceName string, update func( return service, err } -func waitForLoadBalancerIngress(c *client.Client, serviceName, namespace string) (*api.Service, error) { - // TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable - const timeout = 20 * time.Minute - var service *api.Service - By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to have a LoadBalancer ingress point", timeout, serviceName, namespace)) - i := 1 - for start := time.Now(); time.Since(start) < timeout; time.Sleep(3 * time.Second) { - service, err := c.Services(namespace).Get(serviceName) - if err != nil { - Logf("Get service failed, ignoring for 5s: %v", err) - continue - } - if len(service.Status.LoadBalancer.Ingress) > 0 { - return service, nil - } - if i%5 == 0 { - Logf("Waiting for service %s in namespace %s to have a LoadBalancer ingress point (%v)", serviceName, namespace, time.Since(start)) - } - i++ - } - return service, fmt.Errorf("service %s in namespace %s doesn't have a LoadBalancer ingress point after %.2f seconds", serviceName, namespace, timeout.Seconds()) -} - -func waitForLoadBalancerDestroy(c *client.Client, serviceIP, servicePort, serviceName, namespace string) (*api.Service, error) { - // TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable - const timeout = 10 * time.Minute - var service *api.Service - defer func() { - if err := EnsureLoadBalancerResourcesDeleted(serviceIP, servicePort); err != nil { - Logf("Failed to delete cloud resources for service: %s %s (%v)", serviceIP, servicePort, err) - } - }() - By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to have no LoadBalancer ingress points", timeout, serviceName, namespace)) - for start := time.Now(); time.Since(start) < timeout; time.Sleep(5 * time.Second) { - service, err := c.Services(namespace).Get(serviceName) - if err != nil { - Logf("Get service failed, ignoring for 5s: %v", err) - continue - } - if len(service.Status.LoadBalancer.Ingress) == 0 { - return service, nil - } - Logf("Waiting for service %s in namespace %s to have no LoadBalancer ingress points (%v)", serviceName, namespace, time.Since(start)) - } - - return service, fmt.Errorf("service %s in namespace %s still has LoadBalancer ingress points after %.2f seconds", serviceName, namespace, timeout.Seconds()) -} - -func validateUniqueOrFail(s []string) { - By(fmt.Sprintf("validating unique: %v", s)) - sort.Strings(s) - var prev string - for i, elem := range s { - if i > 0 && elem == prev { - Fail("duplicate found: " + elem) - } - prev = elem - } -} - func getContainerPortsByPodUID(endpoints *api.Endpoints) PortsByPodUID { m := PortsByPodUID{} for _, ss := range endpoints.Subsets { @@ -1099,7 +1031,7 @@ func createExecPodOrFail(c *client.Client, ns, name string) { Containers: []api.Container{ { Name: "exec", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"sh", "-c", "while true; do sleep 5; done"}, }, }, @@ -1178,50 +1110,8 @@ func pickNodeIP(c *client.Client) string { return ip } -func testLoadBalancerReachable(ingress api.LoadBalancerIngress, port int) bool { - return testLoadBalancerReachableInTime(ingress, port, podStartTimeout) -} - -func testNetcatLoadBalancerReachable(ingress api.LoadBalancerIngress, port int) bool { - return testNetcatLoadBalancerReachableInTime(ingress, port, podStartTimeout) -} - -func conditionFuncDecorator(ip string, port int, fn func(string, int) (bool, error)) wait.ConditionFunc { - return func() (bool, error) { - return fn(ip, port) - } -} - -func testLoadBalancerReachableInTime(ingress api.LoadBalancerIngress, port int, timeout time.Duration) bool { - ip := ingress.IP - if ip == "" { - ip = ingress.Hostname - } - - return testReachableInTime(conditionFuncDecorator(ip, port, testReachable), timeout) - -} - -func testNetcatLoadBalancerReachableInTime(ingress api.LoadBalancerIngress, port int, timeout time.Duration) bool { - ip := ingress.IP - if ip == "" { - ip = ingress.Hostname - } - - return testReachableInTime(conditionFuncDecorator(ip, port, testNetcatReachable), timeout) -} - -func testLoadBalancerNotReachable(ingress api.LoadBalancerIngress, port int) { - ip := ingress.IP - if ip == "" { - ip = ingress.Hostname - } - - testNotReachable(ip, port) -} - -func testReachable(ip string, port int) (bool, error) { - url := fmt.Sprintf("http://%s:%d", ip, port) +func testReachableHTTP(ip string, port int, request string, expect string) (bool, error) { + url := fmt.Sprintf("http://%s:%d%s", ip, port, request) if ip == "" { Failf("Got empty IP for reachability check (%s)", url) return false, nil @@ -1231,11 +1121,11 @@ func testReachable(ip string, port int) (bool, error) { return false, nil } - Logf("Testing reachability of %v", url) + Logf("Testing HTTP reachability of %v", url) resp, err := httpGetNoConnectionPool(url) if err != nil { - Logf("Got error waiting for reachability of %s: %v", url, err) + Logf("Got error testing for reachability of %s: %v", url, err) return false, nil } defer resp.Body.Close() @@ -1247,14 +1137,36 @@ func testReachable(ip string, port int) (bool, error) { if resp.StatusCode != 200 { return false, fmt.Errorf("received non-success return status %q trying to access %s; got body: %s", resp.Status, url, string(body)) } - if !strings.Contains(string(body), "test-webserver") { - return false, fmt.Errorf("received response body without expected substring 'test-webserver': %s", string(body)) + if !strings.Contains(string(body), expect) { + return false, fmt.Errorf("received response body without expected substring %q: %s", expect, string(body)) } Logf("Successfully reached %v", url) return true, nil } -func testNetcatReachable(ip string, port int) (bool, error) { +func testNotReachableHTTP(ip string, port int) (bool, error) { + url := fmt.Sprintf("http://%s:%d", ip, port) + if ip == "" { + Failf("Got empty IP for non-reachability check (%s)", url) + return false, nil + } + if port == 0 { + Failf("Got port==0 for non-reachability check (%s)", url) + return false, nil + } + + Logf("Testing HTTP non-reachability of %v", url) + + resp, err := httpGetNoConnectionPool(url) + if err != nil { + Logf("Confirmed that %s is not reachable", url) + return true, nil + } + resp.Body.Close() + return false, nil +} + +func testReachableUDP(ip string, port int, request string, expect string) (bool, error) { uri := fmt.Sprintf("udp://%s:%d", ip, port) if ip == "" { Failf("Got empty IP for reachability check (%s)", uri) @@ -1265,70 +1177,77 @@ func testNetcatReachable(ip string, port int) (bool, error) { return false, nil } - Logf("Testing reachability of %v", uri) + Logf("Testing UDP reachability of %v", uri) - con, err := net.Dial("udp", ip+":"+string(port)) + con, err := net.Dial("udp", ip+":"+strconv.Itoa(port)) if err != nil { - return false, fmt.Errorf("Failed to connect to: %s:%d (%s)", ip, port, err.Error()) + return false, fmt.Errorf("Failed to dial %s:%d: %v", ip, port, err) } - _, err = con.Write([]byte("\n")) + _, err = con.Write([]byte(fmt.Sprintf("%s\n", request))) if err != nil { - return false, fmt.Errorf("Failed to send newline: %s", err.Error()) + return false, fmt.Errorf("Failed to send request: %v", err) } - var buf []byte = make([]byte, len("SUCCESS")+1) + var buf []byte = make([]byte, len(expect)+1) + + err = con.SetDeadline(time.Now().Add(3 * time.Second)) + if err != nil { + return false, fmt.Errorf("Failed to set deadline: %v", err) + } _, err = con.Read(buf) if err != nil { - return false, fmt.Errorf("Failed to read result: %s", err.Error()) + return false, nil } - if !strings.HasPrefix(string(buf), "SUCCESS") { - return false, fmt.Errorf("Failed to retrieve: \"SUCCESS\"") + if !strings.Contains(string(buf), expect) { + return false, fmt.Errorf("Failed to retrieve %q, got %q", expect, string(buf)) } - Logf("Successfully retrieved \"SUCCESS\"") + Logf("Successfully reached %v", uri) return true, nil } -func testReachableInTime(testFunc wait.ConditionFunc, timeout time.Duration) bool { - By(fmt.Sprintf("Waiting up to %v", timeout)) - err := wait.PollImmediate(poll, timeout, testFunc) - if err != nil { - Expect(err).NotTo(HaveOccurred(), "Error waiting") - return false - } - return true -} - -func testNotReachable(ip string, port int) { - url := fmt.Sprintf("http://%s:%d", ip, port) +func testNotReachableUDP(ip string, port int, request string) (bool, error) { + uri := fmt.Sprintf("udp://%s:%d", ip, port) if ip == "" { - Failf("Got empty IP for non-reachability check (%s)", url) + Failf("Got empty IP for reachability check (%s)", uri) + return false, nil } if port == 0 { - Failf("Got port==0 for non-reachability check (%s)", url) + Failf("Got port==0 for reachability check (%s)", uri) + return false, nil } - desc := fmt.Sprintf("the url %s to be *not* reachable", url) - By(fmt.Sprintf("Waiting up to %v for %s", podStartTimeout, desc)) - err := wait.PollImmediate(poll, podStartTimeout, func() (bool, error) { - resp, err := httpGetNoConnectionPool(url) - if err != nil { - Logf("Successfully waited for %s", desc) - return true, nil - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - Logf("Expecting %s to be unreachable but was reachable and got an error reading response: %v", url, err) - return false, nil - } - Logf("Able to reach service %s when should no longer have been reachable, status: %q and body: %s", url, resp.Status, string(body)) - return false, nil - }) - Expect(err).NotTo(HaveOccurred(), "Error waiting for %s", desc) + Logf("Testing UDP non-reachability of %v", uri) + + con, err := net.Dial("udp", ip+":"+strconv.Itoa(port)) + if err != nil { + Logf("Confirmed that %s is not reachable", uri) + return true, nil + } + + _, err = con.Write([]byte(fmt.Sprintf("%s\n", request))) + if err != nil { + Logf("Confirmed that %s is not reachable", uri) + return true, nil + } + + var buf []byte = make([]byte, 1) + + err = con.SetDeadline(time.Now().Add(3 * time.Second)) + if err != nil { + return false, fmt.Errorf("Failed to set deadline: %v", err) + } + + _, err = con.Read(buf) + if err != nil { + Logf("Confirmed that %s is not reachable", uri) + return true, nil + } + + return false, nil } // Creates a replication controller that serves its hostname and a service on top of it. @@ -1413,17 +1332,18 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod defer func() { deletePodOrFail(c, ns, execPodName) }() + // Loop a bunch of times - the proxy is randomized, so we want a good // chance of hitting each backend at least once. - command := fmt.Sprintf( - "for i in $(seq 1 %d); do wget -q -T 1 -O - http://%s:%d 2>&1 || true; echo; done", - 50*len(expectedPods), serviceIP, servicePort) - + buildCommand := func(wget string) string { + return fmt.Sprintf("for i in $(seq 1 %d); do %s http://%s:%d 2>&1 || true; echo; done", + 50*len(expectedPods), wget, serviceIP, servicePort) + } commands := []func() string{ // verify service from node func() string { - cmd := fmt.Sprintf(`set -e; %s`, command) - Logf("Executing cmd %v on host %v", cmd, host) + cmd := "set -e; " + buildCommand("wget -q --timeout=0.2 --tries=1 -O -") + Logf("Executing cmd %q on host %v", cmd, host) result, err := SSH(cmd, host, testContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) @@ -1433,11 +1353,12 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod }, // verify service from pod func() string { - Logf("Executing cmd %v in pod %v/%v", command, ns, execPodName) + cmd := buildCommand("wget -q -T 1 -O -") + Logf("Executing cmd %q in pod %v/%v", cmd, ns, execPodName) // TODO: Use exec-over-http via the netexec pod instead of kubectl exec. - output, err := RunHostCmd(ns, execPodName, command) + output, err := RunHostCmd(ns, execPodName, cmd) if err != nil { - Logf("error while kubectl execing %v in pod %v/%v: %v\nOutput: %v", command, ns, execPodName, err, output) + Logf("error while kubectl execing %q in pod %v/%v: %v\nOutput: %v", cmd, ns, execPodName, err, output) } return output }, @@ -1452,7 +1373,7 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod pods := strings.Split(strings.TrimSpace(cmdFunc()), "\n") // Uniq pods before the sort because inserting them into a set // (which is implemented using dicts) can re-order them. - gotPods := sets.NewString(pods...).List() + gotPods = sets.NewString(pods...).List() if api.Semantic.DeepEqual(gotPods, expectedPods) { passed = true break @@ -1499,8 +1420,351 @@ func httpGetNoConnectionPool(url string) (*http.Response, error) { return client.Get(url) } +// A test jig to help testing. +type ServiceTestJig struct { + ID string + Name string + Client *client.Client + Labels map[string]string +} + +// NewServiceTestJig allocates and inits a new ServiceTestJig. +func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig { + j := &ServiceTestJig{} + j.Client = client + j.Name = name + j.ID = j.Name + "-" + string(util.NewUUID()) + j.Labels = map[string]string{"testid": j.ID} + + return j +} + +// newServiceTemplate returns the default api.Service template for this jig, but +// does not actually create the Service. The default Service has the same name +// as the jig and exposes port 80. +func (j *ServiceTestJig) newServiceTemplate(namespace string, proto api.Protocol) *api.Service { + service := &api.Service{ + ObjectMeta: api.ObjectMeta{ + Namespace: namespace, + Name: j.Name, + Labels: j.Labels, + }, + Spec: api.ServiceSpec{ + Selector: j.Labels, + Ports: []api.ServicePort{ + { + Protocol: proto, + Port: 80, + }, + }, + }, + } + return service +} + +// CreateTCPServiceOrFail creates a new TCP Service based on the jig's +// defaults. Callers can provide a function to tweak the Service object before +// it is created. +func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service { + svc := j.newServiceTemplate(namespace, api.ProtocolTCP) + if tweak != nil { + tweak(svc) + } + result, err := j.Client.Services(namespace).Create(svc) + if err != nil { + Failf("Failed to create TCP Service %q: %v", svc.Name, err) + } + return result +} + +// CreateUDPServiceOrFail creates a new UDP Service based on the jig's +// defaults. Callers can provide a function to tweak the Service object before +// it is created. +func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service { + svc := j.newServiceTemplate(namespace, api.ProtocolUDP) + if tweak != nil { + tweak(svc) + } + result, err := j.Client.Services(namespace).Create(svc) + if err != nil { + Failf("Failed to create UDP Service %q: %v", svc.Name, err) + } + return result +} + +func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType) { + if svc.Spec.Type != svcType { + Failf("unexpected Spec.Type (%s) for service, expected %s", svc.Spec.Type, svcType) + } + expectNodePorts := false + if svcType != api.ServiceTypeClusterIP { + expectNodePorts = true + } + for i, port := range svc.Spec.Ports { + hasNodePort := (port.NodePort != 0) + if hasNodePort != expectNodePorts { + Failf("unexpected Spec.Ports[%d].NodePort (%d) for service", i, port.NodePort) + } + if hasNodePort { + if !ServiceNodePortRange.Contains(port.NodePort) { + Failf("out-of-range nodePort (%d) for service", port.NodePort) + } + } + } + expectIngress := false + if svcType == api.ServiceTypeLoadBalancer { + expectIngress = true + } + hasIngress := len(svc.Status.LoadBalancer.Ingress) != 0 + if hasIngress != expectIngress { + Failf("unexpected number of Status.LoadBalancer.Ingress (%d) for service", len(svc.Status.LoadBalancer.Ingress)) + } + if hasIngress { + for i, ing := range svc.Status.LoadBalancer.Ingress { + if ing.IP == "" && ing.Hostname == "" { + Failf("unexpected Status.LoadBalancer.Ingress[%d] for service: %#v", i, ing) + } + } + } +} + +// UpdateService fetches a service, calls the update function on it, and +// then attempts to send the updated service. It tries up to 3 times in the +// face of timeouts and conflicts. +func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*api.Service)) (*api.Service, error) { + for i := 0; i < 3; i++ { + service, err := j.Client.Services(namespace).Get(name) + if err != nil { + return nil, fmt.Errorf("Failed to get Service %q: %v", name, err) + } + + update(service) + service, err = j.Client.Services(namespace).Update(service) + if err == nil { + return service, nil + } + if !errors.IsConflict(err) && !errors.IsServerTimeout(err) { + return nil, fmt.Errorf("Failed to update Service %q: %v", name, err) + } + } + return nil, fmt.Errorf("Too many retries updating Service %q", name) +} + +// UpdateServiceOrFail fetches a service, calls the update function on it, and +// then attempts to send the updated service. It tries up to 3 times in the +// face of timeouts and conflicts. +func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*api.Service)) *api.Service { + svc, err := j.UpdateService(namespace, name, update) + if err != nil { + Failf(err.Error()) + } + return svc +} + +func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service { + var err error + var service *api.Service + for i := 1; i < ServiceNodePortRange.Size; i++ { + offs1 := initial - ServiceNodePortRange.Base + offs2 := (offs1 + i) % ServiceNodePortRange.Size + newPort := ServiceNodePortRange.Base + offs2 + service, err = j.UpdateService(namespace, name, func(s *api.Service) { + s.Spec.Ports[0].NodePort = newPort + }) + if err != nil && strings.Contains(err.Error(), "provided port is already allocated") { + Logf("tried nodePort %d, but it is in use, will try another", newPort) + continue + } + // Otherwise err was nil or err was a real error + break + } + if err != nil { + Failf("Could not change the nodePort: %v", err) + } + return service +} + +func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string) *api.Service { + var service *api.Service + Logf("Waiting up to %v for service %q to have a LoadBalancer", loadBalancerCreateTimeout, name) + pollFunc := func() (bool, error) { + svc, err := j.Client.Services(namespace).Get(name) + if err != nil { + return false, err + } + if len(svc.Status.LoadBalancer.Ingress) > 0 { + service = svc + return true, nil + } + return false, nil + } + if err := wait.PollImmediate(poll, loadBalancerCreateTimeout, pollFunc); err != nil { + Failf("Timeout waiting for service %q to have a load balancer", name) + } + return service +} + +func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int) *api.Service { + // TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable + defer func() { + if err := EnsureLoadBalancerResourcesDeleted(ip, strconv.Itoa(port)); err != nil { + Logf("Failed to delete cloud resources for service: %s %d (%v)", ip, port, err) + } + }() + + var service *api.Service + Logf("Waiting up to %v for service %q to have no LoadBalancer", loadBalancerCreateTimeout, name) + pollFunc := func() (bool, error) { + svc, err := j.Client.Services(namespace).Get(name) + if err != nil { + return false, err + } + if len(svc.Status.LoadBalancer.Ingress) == 0 { + service = svc + return true, nil + } + return false, nil + } + if err := wait.PollImmediate(poll, loadBalancerCreateTimeout, pollFunc); err != nil { + Failf("Timeout waiting for service %q to have no load balancer", name) + } + return service +} + +func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration) { + if err := wait.PollImmediate(poll, timeout, func() (bool, error) { return testReachableHTTP(host, port, "/echo?msg=hello", "hello") }); err != nil { + Failf("Could not reach HTTP service through %v:%v after %v: %v", host, port, timeout, err) + } +} + +func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration) { + if err := wait.PollImmediate(poll, timeout, func() (bool, error) { return testNotReachableHTTP(host, port) }); err != nil { + Failf("Could still reach HTTP service through %v:%v after %v: %v", host, port, timeout, err) + } +} + +func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration) { + if err := wait.PollImmediate(poll, timeout, func() (bool, error) { return testReachableUDP(host, port, "echo hello", "hello") }); err != nil { + Failf("Could not reach UDP service through %v:%v after %v: %v", host, port, timeout, err) + } +} + +func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration) { + if err := wait.PollImmediate(poll, timeout, func() (bool, error) { return testNotReachableUDP(host, port, "echo hello") }); err != nil { + Failf("Could still reach UDP service through %v:%v after %v: %v", host, port, timeout, err) + } +} + +func getIngressPoint(ing *api.LoadBalancerIngress) string { + host := ing.IP + if host == "" { + host = ing.Hostname + } + return host +} + +// newRCTemplate returns the default api.ReplicationController object for +// this jig, but does not actually create the RC. The default RC has the same +// name as the jig and runs the "netexec" container. +func (j *ServiceTestJig) newRCTemplate(namespace string) *api.ReplicationController { + rc := &api.ReplicationController{ + ObjectMeta: api.ObjectMeta{ + Namespace: namespace, + Name: j.Name, + Labels: j.Labels, + }, + Spec: api.ReplicationControllerSpec{ + Replicas: 1, + Selector: j.Labels, + Template: &api.PodTemplateSpec{ + ObjectMeta: api.ObjectMeta{ + Labels: j.Labels, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "netexec", + Image: "gcr.io/google_containers/netexec:1.4", + Args: []string{"--http-port=80", "--udp-port=80"}, + ReadinessProbe: &api.Probe{ + PeriodSeconds: 3, + Handler: api.Handler{ + HTTPGet: &api.HTTPGetAction{ + Port: intstr.FromInt(80), + Path: "/hostName", + }, + }, + }, + }, + }, + TerminationGracePeriodSeconds: new(int64), + }, + }, + }, + } + return rc +} + +// RunOrFail creates a ReplicationController and Pod(s) and waits for the +// Pod(s) to be running. Callers can provide a function to tweak the RC object +// before it is created. +func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *api.ReplicationController)) *api.ReplicationController { + rc := j.newRCTemplate(namespace) + if tweak != nil { + tweak(rc) + } + result, err := j.Client.ReplicationControllers(namespace).Create(rc) + if err != nil { + Failf("Failed to created RC %q: %v", rc.Name, err) + } + pods, err := j.waitForPodsCreated(namespace, rc.Spec.Replicas) + if err != nil { + Failf("Failed to create pods: %v", err) + } + if err := j.waitForPodsReady(namespace, pods); err != nil { + Failf("Failed waiting for pods to be running: %v", err) + } + return result +} + +func (j *ServiceTestJig) waitForPodsCreated(namespace string, replicas int) ([]string, error) { + timeout := 2 * time.Minute + // List the pods, making sure we observe all the replicas. + label := labels.SelectorFromSet(labels.Set(j.Labels)) + Logf("Waiting up to %v for %d pods to be created", timeout, replicas) + for start := time.Now(); time.Since(start) < timeout; time.Sleep(2 * time.Second) { + options := api.ListOptions{LabelSelector: label} + pods, err := j.Client.Pods(namespace).List(options) + if err != nil { + return nil, err + } + + found := []string{} + for _, pod := range pods.Items { + if pod.DeletionTimestamp != nil { + continue + } + found = append(found, pod.Name) + } + if len(found) == replicas { + Logf("Found all %d pods", replicas) + return found, nil + } + Logf("Found %d/%d pods - will retry", len(found), replicas) + } + return nil, fmt.Errorf("Timeout waiting for %d pods to be created", replicas) +} + +func (j *ServiceTestJig) waitForPodsReady(namespace string, pods []string) error { + timeout := 2 * time.Minute + if !checkPodsRunningReady(j.Client, namespace, pods, timeout) { + return fmt.Errorf("Timeout waiting for %d pods to be ready", len(pods)) + } + return nil +} + // Simple helper class to avoid too much boilerplate in tests -type ServerTest struct { +type ServiceTestFixture struct { ServiceName string Namespace string Client *client.Client @@ -1514,8 +1778,8 @@ type ServerTest struct { image string } -func NewServerTest(client *client.Client, namespace string, serviceName string) *ServerTest { - t := &ServerTest{} +func NewServerTest(client *client.Client, namespace string, serviceName string) *ServiceTestFixture { + t := &ServiceTestFixture{} t.Client = client t.Namespace = namespace t.ServiceName = serviceName @@ -1533,27 +1797,8 @@ func NewServerTest(client *client.Client, namespace string, serviceName string) return t } -func NewNetcatTest(client *client.Client, namespace string, serviceName string) *ServerTest { - t := &ServerTest{} - t.Client = client - t.Namespace = namespace - t.ServiceName = serviceName - t.TestId = t.ServiceName + "-" + string(util.NewUUID()) - t.Labels = map[string]string{ - "testid": t.TestId, - } - - t.rcs = make(map[string]bool) - t.services = make(map[string]bool) - - t.name = "netcat" - t.image = "ubuntu" - - return t -} - // Build default config for a service (which can then be changed) -func (t *ServerTest) BuildServiceSpec() *api.Service { +func (t *ServiceTestFixture) BuildServiceSpec() *api.Service { service := &api.Service{ ObjectMeta: api.ObjectMeta{ Name: t.ServiceName, @@ -1572,7 +1817,7 @@ func (t *ServerTest) BuildServiceSpec() *api.Service { // CreateWebserverRC creates rc-backed pods with the well-known webserver // configuration and records it for cleanup. -func (t *ServerTest) CreateWebserverRC(replicas int) *api.ReplicationController { +func (t *ServiceTestFixture) CreateWebserverRC(replicas int) *api.ReplicationController { rcSpec := rcByNamePort(t.name, replicas, t.image, 80, api.ProtocolTCP, t.Labels) rcAct, err := t.createRC(rcSpec) if err != nil { @@ -1584,24 +1829,8 @@ func (t *ServerTest) CreateWebserverRC(replicas int) *api.ReplicationController return rcAct } -// CreateNetcatRC creates rc-backed pods with a netcat listener -// configuration and records it for cleanup. -func (t *ServerTest) CreateNetcatRC(replicas int) *api.ReplicationController { - rcSpec := rcByNamePort(t.name, replicas, t.image, 80, api.ProtocolUDP, t.Labels) - rcSpec.Spec.Template.Spec.Containers[0].Command = []string{"/bin/bash"} - rcSpec.Spec.Template.Spec.Containers[0].Args = []string{"-c", "echo SUCCESS | nc -q 0 -u -l 0.0.0.0 80"} - rcAct, err := t.createRC(rcSpec) - if err != nil { - Failf("Failed to create rc %s: %v", rcSpec.Name, err) - } - if err := verifyPods(t.Client, t.Namespace, t.name, false, replicas); err != nil { - Failf("Failed to create %d pods with name %s: %v", replicas, t.name, err) - } - return rcAct -} - // createRC creates a replication controller and records it for cleanup. -func (t *ServerTest) createRC(rc *api.ReplicationController) (*api.ReplicationController, error) { +func (t *ServiceTestFixture) createRC(rc *api.ReplicationController) (*api.ReplicationController, error) { rc, err := t.Client.ReplicationControllers(t.Namespace).Create(rc) if err == nil { t.rcs[rc.Name] = true @@ -1610,7 +1839,7 @@ func (t *ServerTest) createRC(rc *api.ReplicationController) (*api.ReplicationCo } // Create a service, and record it for cleanup -func (t *ServerTest) CreateService(service *api.Service) (*api.Service, error) { +func (t *ServiceTestFixture) CreateService(service *api.Service) (*api.Service, error) { result, err := t.Client.Services(t.Namespace).Create(service) if err == nil { t.services[service.Name] = true @@ -1619,7 +1848,7 @@ func (t *ServerTest) CreateService(service *api.Service) (*api.Service, error) { } // Delete a service, and remove it from the cleanup list -func (t *ServerTest) DeleteService(serviceName string) error { +func (t *ServiceTestFixture) DeleteService(serviceName string) error { err := t.Client.Services(t.Namespace).Delete(serviceName) if err == nil { delete(t.services, serviceName) @@ -1627,7 +1856,7 @@ func (t *ServerTest) DeleteService(serviceName string) error { return err } -func (t *ServerTest) Cleanup() []error { +func (t *ServiceTestFixture) Cleanup() []error { var errs []error for rcName := range t.rcs { By("stopping RC " + rcName + " in namespace " + t.Namespace) @@ -1658,35 +1887,3 @@ func (t *ServerTest) Cleanup() []error { return errs } - -func removeExternalLoadBalancer(f *Framework, svc *api.Service) { - By("changing service " + svc.Name + " back to type=ClusterIP") - service, err := updateService(f.Client, f.Namespace.Name, svc.Name, func(s *api.Service) { - s.Spec.Type = api.ServiceTypeClusterIP - s.Spec.Ports[0].NodePort = 0 - }) - Expect(err).NotTo(HaveOccurred()) - - // Updating the service type shouldn't change the Status immediately. The status should be - // updated after waitForLoadBalancerDestroy. - if len(service.Status.LoadBalancer.Ingress) == 0 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for NodePort service: %v", service) - } - if service.Spec.Type != api.ServiceTypeClusterIP { - Failf("got unexpected Spec.Type for back-to-ClusterIP service: %v", service) - } - if len(service.Spec.Ports) != 1 { - Failf("got unexpected len(Spec.Ports) for back-to-ClusterIP service: %v", service) - } - if service.Spec.Ports[0].NodePort != 0 { - Failf("got unexpected Spec.Ports[0].nodePort for back-to-ClusterIP service: %v", service) - } - - // Wait for the load balancer to be destroyed asynchronously - service, err = waitForLoadBalancerDestroy(f.Client, svc.Status.LoadBalancer.Ingress[0].IP, strconv.Itoa(svc.Spec.Ports[0].Port), svc.Name, f.Namespace.Name) - Expect(err).NotTo(HaveOccurred()) - - if len(service.Status.LoadBalancer.Ingress) != 0 { - Failf("got unexpected len(Status.LoadBalancer.Ingress) for back-to-ClusterIP service: %v", service) - } -} diff --git a/test/e2e/service_accounts.go b/test/e2e/service_accounts.go index 0169e546440..8900a702406 100644 --- a/test/e2e/service_accounts.go +++ b/test/e2e/service_accounts.go @@ -21,8 +21,7 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/fields" + apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/plugin/pkg/admission/serviceaccount" @@ -40,21 +39,34 @@ var _ = Describe("ServiceAccounts", func() { // Standard get, update retry loop expectNoError(wait.Poll(time.Millisecond*500, time.Second*10, func() (bool, error) { By("getting the auto-created API token") - tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) - options := api.ListOptions{FieldSelector: tokenSelector} - secrets, err := f.Client.Secrets(f.Namespace.Name).List(options) - if err != nil { - return false, err - } - if len(secrets.Items) == 0 { + sa, err := f.Client.ServiceAccounts(f.Namespace.Name).Get("default") + if apierrors.IsNotFound(err) { + Logf("default service account was not found") return false, nil } - if len(secrets.Items) > 1 { - return false, fmt.Errorf("Expected 1 token secret, got %d", len(secrets.Items)) + if err != nil { + Logf("error getting default service account: %v", err) + return false, err } - tokenContent = string(secrets.Items[0].Data[api.ServiceAccountTokenKey]) - rootCAContent = string(secrets.Items[0].Data[api.ServiceAccountRootCAKey]) - return true, nil + if len(sa.Secrets) == 0 { + Logf("default service account has no secret references") + return false, nil + } + for _, secretRef := range sa.Secrets { + secret, err := f.Client.Secrets(f.Namespace.Name).Get(secretRef.Name) + if err != nil { + Logf("Error getting secret %s: %v", secretRef.Name, err) + continue + } + if secret.Type == api.SecretTypeServiceAccountToken { + tokenContent = string(secret.Data[api.ServiceAccountTokenKey]) + rootCAContent = string(secret.Data[api.ServiceAccountRootCAKey]) + return true, nil + } + } + + Logf("default service account has no secret references to valid service account tokens") + return false, nil })) pod := &api.Pod{ diff --git a/test/e2e/service_latency.go b/test/e2e/service_latency.go index 2f10065ece9..6f7620bbe11 100644 --- a/test/e2e/service_latency.go +++ b/test/e2e/service_latency.go @@ -66,7 +66,7 @@ var _ = Describe("Service endpoints latency", func() { // Turn off rate limiting--it interferes with our measurements. oldThrottle := f.Client.RESTClient.Throttle - f.Client.RESTClient.Throttle = util.NewFakeRateLimiter() + f.Client.RESTClient.Throttle = util.NewFakeAlwaysRateLimiter() defer func() { f.Client.RESTClient.Throttle = oldThrottle }() failing := sets.NewString() diff --git a/test/e2e/testing-manifests/netexecrc.yaml b/test/e2e/testing-manifests/netexecrc.yaml index ecdcff159fc..c2aa34ca1fa 100644 --- a/test/e2e/testing-manifests/netexecrc.yaml +++ b/test/e2e/testing-manifests/netexecrc.yaml @@ -12,7 +12,7 @@ spec: spec: containers: - name: netexec - image: gcr.io/google_containers/netexec:1.0 + image: gcr.io/google_containers/netexec:1.4 ports: - containerPort: 8080 # This is to force these pods to land on different hosts. diff --git a/test/e2e/util.go b/test/e2e/util.go index 65c8de9db47..15856888912 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -40,7 +40,7 @@ import ( "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/client/unversioned/clientcmd" clientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api" @@ -51,6 +51,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" + sshutil "k8s.io/kubernetes/pkg/ssh" "k8s.io/kubernetes/pkg/util" deploymentutil "k8s.io/kubernetes/pkg/util/deployment" "k8s.io/kubernetes/pkg/util/sets" @@ -138,6 +139,7 @@ var runId = util.NewUUID() type TestContextType struct { KubeConfig string KubeContext string + KubeVolumeDir string CertDir string Host string RepoRoot string @@ -252,16 +254,24 @@ func nowStamp() string { return time.Now().Format(time.StampMilli) } -func Logf(format string, a ...interface{}) { - fmt.Fprintf(GinkgoWriter, nowStamp()+": INFO: "+format+"\n", a...) +func logf(level string, format string, args ...interface{}) { + fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...) } -func Failf(format string, a ...interface{}) { - Fail(nowStamp()+": "+fmt.Sprintf(format, a...), 1) +func Logf(format string, args ...interface{}) { + logf("INFO", format, args...) +} + +func Failf(format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + logf("FAIL", msg) + Fail(nowStamp()+": "+msg, 1) } func Skipf(format string, args ...interface{}) { - Skip(nowStamp() + ": " + fmt.Sprintf(format, args...)) + msg := fmt.Sprintf(format, args...) + logf("SKIP", msg) + Skip(nowStamp() + ": " + msg) } func SkipUnlessNodeCountIsAtLeast(minNodeCount int) { @@ -744,13 +754,13 @@ func deleteNS(c *client.Client, namespace string, timeout time.Duration) error { return nil } -// Waits default ammount of time (podStartTimeout) for the specified pod to become running. +// Waits default amount of time (podStartTimeout) for the specified pod to become running. // Returns an error if timeout occurs first, or pod goes in to failed state. func waitForPodRunningInNamespace(c *client.Client, podName string, namespace string) error { return waitTimeoutForPodRunningInNamespace(c, podName, namespace, podStartTimeout) } -// Waits an extended ammount of time (slowPodStartTimeout) for the specified pod to become running. +// Waits an extended amount of time (slowPodStartTimeout) for the specified pod to become running. // Returns an error if timeout occurs first, or pod goes in to failed state. func waitForPodRunningInNamespaceSlow(c *client.Client, podName string, namespace string) error { return waitTimeoutForPodRunningInNamespace(c, podName, namespace, slowPodStartTimeout) @@ -780,6 +790,22 @@ func waitForPodNotPending(c *client.Client, ns, podName string) error { }) } +// waitForPodTerminatedInNamespace returns an error if it took too long for the pod +// to terminate or if the pod terminated with an unexpected reason. +func waitForPodTerminatedInNamespace(c *client.Client, podName, reason, namespace string) error { + return waitForPodCondition(c, namespace, podName, "terminated due to deadline exceeded", podStartTimeout, func(pod *api.Pod) (bool, error) { + if pod.Status.Phase == api.PodFailed { + if pod.Status.Reason == reason { + return true, nil + } else { + return true, fmt.Errorf("Expected pod %n/%n to be terminated with reason %v, got reason: ", namespace, podName, reason, pod.Status.Reason) + } + } + + return false, nil + }) +} + // waitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or ran too long. func waitForPodSuccessInNamespace(c *client.Client, podName string, contName string, namespace string) error { return waitForPodCondition(c, namespace, podName, "success or failure", podStartTimeout, func(pod *api.Pod) (bool, error) { @@ -946,8 +972,9 @@ func waitForEndpoint(c *client.Client, ns, name string) error { return fmt.Errorf("Failed to get entpoints for %s/%s", ns, name) } -// Context for checking pods responses by issuing GETs to them and verifying if the answer with pod name. -type podResponseChecker struct { +// Context for checking pods responses by issuing GETs to them (via the API +// proxy) and verifying that they answer with ther own pod name. +type podProxyResponseChecker struct { c *client.Client ns string label labels.Selector @@ -956,8 +983,9 @@ type podResponseChecker struct { pods *api.PodList } -// checkAllResponses issues GETs to all pods in the context and verify they reply with pod name. -func (r podResponseChecker) checkAllResponses() (done bool, err error) { +// checkAllResponses issues GETs to all pods in the context and verify they +// reply with their own pod name. +func (r podProxyResponseChecker) checkAllResponses() (done bool, err error) { successes := 0 options := api.ListOptions{LabelSelector: r.label} currentPods, err := r.c.Pods(r.ns).List(options) @@ -1042,7 +1070,7 @@ func serverVersionGTE(v semver.Version, c client.ServerVersionInterface) (bool, func podsResponding(c *client.Client, ns, name string, wantName bool, pods *api.PodList) error { By("trying to dial each unique pod") label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) - return wait.PollImmediate(poll, podRespondingTimeout, podResponseChecker{c, ns, label, name, wantName, pods}.checkAllResponses) + return wait.PollImmediate(poll, podRespondingTimeout, podProxyResponseChecker{c, ns, label, name, wantName, pods}.checkAllResponses) } func serviceResponding(c *client.Client, ns, name string) error { @@ -1088,11 +1116,7 @@ func loadConfig() (*client.Config, error) { } } -func loadClient() (*client.Client, error) { - config, err := loadConfig() - if err != nil { - return nil, fmt.Errorf("error creating client: %v", err.Error()) - } +func loadClientFromConfig(config *client.Config) (*client.Client, error) { c, err := client.New(config) if err != nil { return nil, fmt.Errorf("error creating client: %v", err.Error()) @@ -1103,6 +1127,14 @@ func loadClient() (*client.Client, error) { return c, nil } +func loadClient() (*client.Client, error) { + config, err := loadConfig() + if err != nil { + return nil, fmt.Errorf("error creating client: %v", err.Error()) + } + return loadClientFromConfig(config) +} + // randomSuffix provides a random string to append to pods,services,rcs. // TODO: Allow service names to have the same form as names // for pods and replication controllers so we don't @@ -1497,10 +1529,11 @@ func (config *DeploymentConfig) create() error { }, Spec: extensions.DeploymentSpec{ Replicas: config.Replicas, - Selector: map[string]string{ - "name": config.Name, + Selector: &unversioned.LabelSelector{ + MatchLabels: map[string]string{ + "name": config.Name, + }, }, - UniqueLabelKey: extensions.DefaultDeploymentUniqueLabelKey, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ Labels: map[string]string{"name": config.Name}, @@ -1975,6 +2008,55 @@ func waitForRCPodsGone(c *client.Client, rc *api.ReplicationController) error { }) } +// Delete a ReplicaSet and all pods it spawned +func DeleteReplicaSet(c *client.Client, ns, name string) error { + By(fmt.Sprintf("deleting ReplicaSet %s in namespace %s", name, ns)) + rc, err := c.Extensions().ReplicaSets(ns).Get(name) + if err != nil { + if apierrs.IsNotFound(err) { + Logf("ReplicaSet %s was already deleted: %v", name, err) + return nil + } + return err + } + reaper, err := kubectl.ReaperFor(extensions.Kind("ReplicaSet"), c) + if err != nil { + if apierrs.IsNotFound(err) { + Logf("ReplicaSet %s was already deleted: %v", name, err) + return nil + } + return err + } + startTime := time.Now() + err = reaper.Stop(ns, name, 0, api.NewDeleteOptions(0)) + if apierrs.IsNotFound(err) { + Logf("ReplicaSet %s was already deleted: %v", name, err) + return nil + } + deleteRSTime := time.Now().Sub(startTime) + Logf("Deleting RS %s took: %v", name, deleteRSTime) + if err == nil { + err = waitForReplicaSetPodsGone(c, rc) + } + terminatePodTime := time.Now().Sub(startTime) - deleteRSTime + Logf("Terminating ReplicaSet %s pods took: %v", name, terminatePodTime) + return err +} + +// waitForReplicaSetPodsGone waits until there are no pods reported under a +// ReplicaSet selector (because the pods have completed termination). +func waitForReplicaSetPodsGone(c *client.Client, rs *extensions.ReplicaSet) error { + return wait.PollImmediate(poll, 2*time.Minute, func() (bool, error) { + selector, err := unversioned.LabelSelectorAsSelector(rs.Spec.Selector) + expectNoError(err) + options := api.ListOptions{LabelSelector: selector} + if pods, err := c.Pods(rs.Namespace).List(options); err == nil && len(pods.Items) == 0 { + return true, nil + } + return false, nil + }) +} + // Waits for the deployment to reach desired state. // Returns an error if minAvailable or maxCreated is broken at any times. func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, desiredUpdatedReplicas, minAvailable, maxCreated, minReadySeconds int) error { @@ -1984,43 +2066,43 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d if err != nil { return false, err } - oldRCs, _, err := deploymentutil.GetOldRCs(*deployment, c) + oldRSs, _, err := deploymentutil.GetOldReplicaSets(*deployment, c) if err != nil { return false, err } - newRC, err := deploymentutil.GetNewRC(*deployment, c) + newRS, err := deploymentutil.GetNewReplicaSet(*deployment, c) if err != nil { return false, err } - if newRC == nil { + if newRS == nil { // New RC hasnt been created yet. return false, nil } - allRCs := append(oldRCs, newRC) - totalCreated := deploymentutil.GetReplicaCountForRCs(allRCs) - totalAvailable, err := deploymentutil.GetAvailablePodsForRCs(c, allRCs, minReadySeconds) + allRSs := append(oldRSs, newRS) + totalCreated := deploymentutil.GetReplicaCountForReplicaSets(allRSs) + totalAvailable, err := deploymentutil.GetAvailablePodsForReplicaSets(c, allRSs, minReadySeconds) if err != nil { return false, err } if totalCreated > maxCreated { - logRCsOfDeployment(deploymentName, oldRCs, newRC) + logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS) return false, fmt.Errorf("total pods created: %d, more than the max allowed: %d", totalCreated, maxCreated) } if totalAvailable < minAvailable { - logRCsOfDeployment(deploymentName, oldRCs, newRC) + logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS) return false, fmt.Errorf("total pods available: %d, less than the min required: %d", totalAvailable, minAvailable) } if deployment.Status.Replicas == desiredUpdatedReplicas && deployment.Status.UpdatedReplicas == desiredUpdatedReplicas { - // Verify RCs. - if deploymentutil.GetReplicaCountForRCs(oldRCs) != 0 { - logRCsOfDeployment(deploymentName, oldRCs, newRC) - return false, fmt.Errorf("old RCs are not fully scaled down") + // Verify replica sets. + if deploymentutil.GetReplicaCountForReplicaSets(oldRSs) != 0 { + logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS) + return false, fmt.Errorf("old replica sets are not fully scaled down") } - if deploymentutil.GetReplicaCountForRCs([]*api.ReplicationController{newRC}) != desiredUpdatedReplicas { - logRCsOfDeployment(deploymentName, oldRCs, newRC) - return false, fmt.Errorf("new RC is not fully scaled up") + if deploymentutil.GetReplicaCountForReplicaSets([]*extensions.ReplicaSet{newRS}) != desiredUpdatedReplicas { + logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS) + return false, fmt.Errorf("new replica sets is not fully scaled up") } return true, nil } @@ -2029,26 +2111,25 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d } // Waits for the deployment to clean up old rcs. -func waitForDeploymentOldRCsNum(c *clientset.Clientset, ns, deploymentName string, desiredRCNum int) error { +func waitForDeploymentOldRSsNum(c *clientset.Clientset, ns, deploymentName string, desiredRSNum int) error { return wait.Poll(poll, 5*time.Minute, func() (bool, error) { - deployment, err := c.Extensions().Deployments(ns).Get(deploymentName) if err != nil { return false, err } - oldRCs, _, err := deploymentutil.GetOldRCs(*deployment, c) + oldRSs, _, err := deploymentutil.GetOldReplicaSets(*deployment, c) if err != nil { return false, err } - return len(oldRCs) == desiredRCNum, nil + return len(oldRSs) == desiredRSNum, nil }) } -func logRCsOfDeployment(deploymentName string, oldRCs []*api.ReplicationController, newRC *api.ReplicationController) { - for i := range oldRCs { - Logf("Old RCs (%d/%d) of deployment %s: %+v", i+1, len(oldRCs), deploymentName, oldRCs[i]) +func logReplicaSetsOfDeployment(deploymentName string, oldRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet) { + for i := range oldRSs { + Logf("Old ReplicaSets (%d/%d) of deployment %s: %+v", i+1, len(oldRSs), deploymentName, oldRSs[i]) } - Logf("New RC of deployment %s: %+v", deploymentName, newRC) + Logf("New ReplicaSet of deployment %s: %+v", deploymentName, newRS) } // Waits for the number of events on the given object to reach a desired count. @@ -2217,7 +2298,7 @@ func SSH(cmd, host, provider string) (SSHResult, error) { result.User = os.Getenv("USER") } - stdout, stderr, code, err := util.RunSSHCommand(cmd, result.User, host, signer) + stdout, stderr, code, err := sshutil.RunSSHCommand(cmd, result.User, host, signer) result.Stdout = stdout result.Stderr = stderr result.Code = code @@ -2322,7 +2403,7 @@ func getSigner(provider string) (ssh.Signer, error) { // If there is an env. variable override, use that. aws_keyfile := os.Getenv("AWS_SSH_KEY") if len(aws_keyfile) != 0 { - return util.MakePrivateKeySignerFromFile(aws_keyfile) + return sshutil.MakePrivateKeySignerFromFile(aws_keyfile) } // Otherwise revert to home dir keyfile = "kube_aws_rsa" @@ -2331,14 +2412,14 @@ func getSigner(provider string) (ssh.Signer, error) { } key := filepath.Join(keydir, keyfile) - return util.MakePrivateKeySignerFromFile(key) + return sshutil.MakePrivateKeySignerFromFile(key) } // checkPodsRunning returns whether all pods whose names are listed in podNames // in namespace ns are running and ready, using c and waiting at most timeout. func checkPodsRunningReady(c *client.Client, ns string, podNames []string, timeout time.Duration) bool { np, desc := len(podNames), "running and ready" - Logf("Waiting up to %v for the following %d pods to be %s: %s", timeout, np, desc, podNames) + Logf("Waiting up to %v for %d pods to be %s: %s", timeout, np, desc, podNames) result := make(chan bool, len(podNames)) for ix := range podNames { // Launch off pod readiness checkers. @@ -2812,16 +2893,18 @@ func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error { func ensureGCELoadBalancerResourcesDeleted(ip, portRange string) error { gceCloud, ok := testContext.CloudConfig.Provider.(*gcecloud.GCECloud) - project := testContext.CloudConfig.ProjectID - zone := testContext.CloudConfig.Zone - if !ok { return fmt.Errorf("failed to convert CloudConfig.Provider to GCECloud: %#v", testContext.CloudConfig.Provider) } + project := testContext.CloudConfig.ProjectID + region, err := gcecloud.GetGCERegion(testContext.CloudConfig.Zone) + if err != nil { + return fmt.Errorf("could not get region for zone %q: %v", testContext.CloudConfig.Zone, err) + } return wait.Poll(10*time.Second, 5*time.Minute, func() (bool, error) { service := gceCloud.GetComputeService() - list, err := service.ForwardingRules.List(project, zone).Do() + list, err := service.ForwardingRules.List(project, region).Do() if err != nil { return false, err } diff --git a/test/e2e/volumes.go b/test/e2e/volumes.go index 1987f6366c0..cab3cda6ee5 100644 --- a/test/e2e/volumes.go +++ b/test/e2e/volumes.go @@ -293,7 +293,7 @@ func injectHtml(client *client.Client, config VolumeTestConfig, volume api.Volum Containers: []api.Container{ { Name: config.prefix + "-injector", - Image: "gcr.io/google_containers/busybox", + Image: "gcr.io/google_containers/busybox:1.24", Command: []string{"/bin/sh"}, Args: []string{"-c", "echo '" + content + "' > /mnt/index.html && chmod o+rX /mnt /mnt/index.html"}, VolumeMounts: []api.VolumeMount{ diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index 67d2bbb8e9e..dba2be51f1e 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -15,7 +15,8 @@ limitations under the License. */ // To run tests in this suite -// `$ ginkgo -- --node-name node-e2e-test-1 --api-server-address --logtostderr` +// Local: `$ ginkgo -- --logtostderr -v 2` +// Remote: `$ ginkgo -- --node-name --api-server-address= --kubelet-address= --logtostderr -v 2` package e2e_node import ( @@ -26,9 +27,9 @@ import ( "testing" ) -var kubeletAddress = flag.String("kubelet-address", "localhost:10250", "Host and port of the kubelet") -var apiServerAddress = flag.String("api-server-address", "localhost:8080", "Host and port of the api server") -var nodeName = flag.String("node-name", "", "Name of the node") +var kubeletAddress = flag.String("kubelet-address", "http://127.0.0.1:10255", "Host and port of the kubelet") +var apiServerAddress = flag.String("api-server-address", "http://127.0.0.1:8080", "Host and port of the api server") +var nodeName = flag.String("node-name", "127.0.0.1", "Name of the node") func TestE2eNode(t *testing.T) { flag.Parse() diff --git a/test/e2e_node/gcloud/gcloud.go b/test/e2e_node/gcloud/gcloud.go index ea3c3153a99..1772a102b11 100644 --- a/test/e2e_node/gcloud/gcloud.go +++ b/test/e2e_node/gcloud/gcloud.go @@ -17,13 +17,13 @@ limitations under the License. package gcloud import ( + "bytes" "errors" "fmt" "math/rand" - "os/exec" - "net" "net/http" + "os/exec" "path/filepath" "regexp" "strings" @@ -54,9 +54,10 @@ type RunResult struct { } type CmdHandle struct { - TearDown TearDown - Output chan RunResult - LPort string + TearDown TearDown + CombinedOutput bytes.Buffer + Output chan RunResult + LPort string } func NewGCloudClient(host string, zone string) GCloudClient { @@ -74,7 +75,7 @@ func (gc *gCloudClientImpl) Command(cmd string, moreargs ...string) ([]byte, err return exec.Command("gcloud", args...).CombinedOutput() } -func (gc *gCloudClientImpl) TunnelCommand(sudo bool, lPort string, rPort string, dir string, cmd string, moreargs ...string) ([]byte, error) { +func (gc *gCloudClientImpl) TunnelCommand(sudo bool, lPort string, rPort string, dir string, cmd string, moreargs ...string) *exec.Cmd { tunnelStr := fmt.Sprintf("-L %s:localhost:%s", lPort, rPort) args := []string{"compute", "ssh"} if gc.zone != "" { @@ -88,7 +89,7 @@ func (gc *gCloudClientImpl) TunnelCommand(sudo bool, lPort string, rPort string, args = append(args, cmd) args = append(args, moreargs...) glog.V(2).Infof("Command gcloud %s", strings.Join(args, " ")) - return exec.Command("gcloud", args...).CombinedOutput() + return exec.Command("gcloud", args...) } func (gc *gCloudClientImpl) CopyToHost(from string, to string) ([]byte, error) { @@ -162,13 +163,15 @@ func (gc *gCloudClientImpl) Run( } } - // Do the setup + c := gc.TunnelCommand(sudo, h.LPort, remotePort, tDir, cmd, args...) + c.Stdout = &h.CombinedOutput + c.Stderr = &h.CombinedOutput go func() { // Start the process - out, err = gc.TunnelCommand(sudo, h.LPort, remotePort, tDir, cmd, args...) + err = c.Run() if err != nil { - glog.Errorf("command failed %v %s", err, out) - h.Output <- RunResult{out, err, fmt.Sprintf("%s %s", cmd, strings.Join(args, " "))} + glog.Errorf("command failed %v %s", err, h.CombinedOutput.Bytes()) + h.Output <- RunResult{h.CombinedOutput.Bytes(), err, fmt.Sprintf("%s %s", cmd, strings.Join(args, " "))} return } }() diff --git a/test/e2e_node/kubelet_test.go b/test/e2e_node/kubelet_test.go index 3a7e5bea2c3..9cb3894e95b 100644 --- a/test/e2e_node/kubelet_test.go +++ b/test/e2e_node/kubelet_test.go @@ -18,13 +18,20 @@ package e2e_node import ( "bytes" + "encoding/json" "fmt" + "io/ioutil" + "net/http" + "strings" "time" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/kubelet/server/stats" + + "github.com/davecgh/go-spew/spew" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" ) var _ = Describe("Kubelet", func() { @@ -49,10 +56,9 @@ var _ = Describe("Kubelet", func() { RestartPolicy: api.RestartPolicyNever, Containers: []api.Container{ { - Image: "gcr.io/google_containers/busybox", - Name: "busybox", - Command: []string{"echo", "'Hello World'"}, - ImagePullPolicy: api.PullIfNotPresent, + Image: "gcr.io/google_containers/busybox", + Name: "busybox", + Command: []string{"echo", "'Hello World'"}, }, }, }, @@ -62,20 +68,16 @@ var _ = Describe("Kubelet", func() { }) It("it should print the output to logs", func() { - errs := Retry(time.Minute, time.Second*4, func() error { + Eventually(func() string { rc, err := cl.Pods(api.NamespaceDefault).GetLogs("busybox", &api.PodLogOptions{}).Stream() if err != nil { - return err + return "" } defer rc.Close() buf := new(bytes.Buffer) buf.ReadFrom(rc) - if buf.String() != "'Hello World'\n" { - return fmt.Errorf("Expected %s to match 'Hello World'", buf.String()) - } - return nil - }) - Expect(errs).To(BeEmpty(), fmt.Sprintf("Failed to get Logs")) + return buf.String() + }, time.Second*30, time.Second*4).Should(Equal("'Hello World'\n")) }) It("it should be possible to delete", func() { @@ -84,4 +86,171 @@ var _ = Describe("Kubelet", func() { }) }) }) + + Describe("metrics api", func() { + statsPrefix := "stats-busybox-" + podNames := []string{} + podCount := 2 + for i := 0; i < podCount; i++ { + podNames = append(podNames, fmt.Sprintf("%s%v", statsPrefix, i)) + } + BeforeEach(func() { + for _, podName := range podNames { + createPod(cl, podName, []api.Container{ + { + Image: "gcr.io/google_containers/busybox", + Command: []string{"sh", "-c", "echo 'Hello World' | tee ~/file | tee /test-empty-dir-mnt | sleep 60"}, + Name: podName + containerSuffix, + VolumeMounts: []api.VolumeMount{ + {MountPath: "/test-empty-dir-mnt", Name: "test-empty-dir"}, + }, + }, + }, []api.Volume{ + // TODO: Test secret volumes + // TODO: Test hostpath volumes + {Name: "test-empty-dir", VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}}, + }) + } + + // Sleep long enough for cadvisor to see the pod and calculate all of its metrics + time.Sleep(60 * time.Second) + }) + + Context("when querying /stats/summary", func() { + It("it should report resource usage through the stats api", func() { + By("Returning stats summary") + resp, err := http.Get(*kubeletAddress + "/stats/summary") + now := time.Now() + Expect(err).To(BeNil(), fmt.Sprintf("Failed to get /stats/summary")) + summary := stats.Summary{} + contentsBytes, err := ioutil.ReadAll(resp.Body) + Expect(err).To(BeNil(), fmt.Sprintf("Failed to read /stats/summary: %+v", resp)) + contents := string(contentsBytes) + decoder := json.NewDecoder(strings.NewReader(contents)) + err = decoder.Decode(&summary) + Expect(err).To(BeNil(), fmt.Sprintf("Failed to parse /stats/summary to go struct: %+v", resp)) + + By("Having the correct time") + Expect(summary.Time.Time).To(BeTemporally("~", now, 20*time.Second)) + + By("Having resources for node") + Expect(summary.Node.NodeName).To(Equal(*nodeName)) + Expect(summary.Node.CPU.UsageCoreNanoSeconds).NotTo(BeNil()) + Expect(*summary.Node.CPU.UsageCoreNanoSeconds).NotTo(BeZero()) + + Expect(summary.Node.Memory.UsageBytes).NotTo(BeNil()) + Expect(*summary.Node.Memory.UsageBytes).NotTo(BeZero()) + + Expect(summary.Node.Memory.WorkingSetBytes).NotTo(BeNil()) + Expect(*summary.Node.Memory.WorkingSetBytes).NotTo(BeZero()) + + Expect(summary.Node.Fs.AvailableBytes).NotTo(BeNil()) + Expect(*summary.Node.Fs.AvailableBytes).NotTo(BeZero()) + Expect(summary.Node.Fs.CapacityBytes).NotTo(BeNil()) + Expect(*summary.Node.Fs.CapacityBytes).NotTo(BeZero()) + Expect(summary.Node.Fs.UsedBytes).NotTo(BeNil()) + Expect(*summary.Node.Fs.UsedBytes).NotTo(BeZero()) + + By("Having resources for kubelet and runtime system containers") + sysContainers := map[string]stats.ContainerStats{} + sysContainersList := []string{} + for _, container := range summary.Node.SystemContainers { + sysContainers[container.Name] = container + sysContainersList = append(sysContainersList, container.Name) + ExpectContainerStatsNotEmpty(&container) + } + Expect(sysContainersList).To(ConsistOf("kubelet", "runtime")) + + // Verify Pods Stats are present + podsList := []string{} + By("Having resources for pods") + for _, pod := range summary.Pods { + if !strings.HasPrefix(pod.PodRef.Name, statsPrefix) { + // Ignore pods created outside this test + continue + } + + podsList = append(podsList, pod.PodRef.Name) + + Expect(pod.Containers).To(HaveLen(1)) + container := pod.Containers[0] + Expect(container.Name).To(Equal(pod.PodRef.Name + containerSuffix)) + + ExpectContainerStatsNotEmpty(&container) + + // emptydir volume + volumeNames := []string{} + for _, vs := range pod.VolumeStats { + Expect(vs.CapacityBytes).NotTo(BeZero()) + Expect(vs.AvailableBytes).NotTo(BeZero()) + Expect(vs.UsedBytes).NotTo(BeZero()) + volumeNames = append(volumeNames, vs.Name) + } + Expect(volumeNames).To(ConsistOf("test-empty-dir")) + + // fs usage (not for system containers) + Expect(container.Rootfs).NotTo(BeNil(), spew.Sdump(container)) + Expect(container.Rootfs.AvailableBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Rootfs.AvailableBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Rootfs.CapacityBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Rootfs.CapacityBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Rootfs.UsedBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Rootfs.UsedBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Logs).NotTo(BeNil(), spew.Sdump(container)) + Expect(container.Logs.AvailableBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Logs.AvailableBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Logs.CapacityBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Logs.CapacityBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Logs.UsedBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Logs.UsedBytes).NotTo(BeZero(), spew.Sdump(container)) + + } + Expect(podsList).To(ConsistOf(podNames)) + }) + }) + + AfterEach(func() { + for _, podName := range podNames { + err := cl.Pods(api.NamespaceDefault).Delete(podName, &api.DeleteOptions{}) + Expect(err).To(BeNil(), fmt.Sprintf("Error deleting Pod %v", podName)) + } + }) + }) }) + +func ExpectContainerStatsNotEmpty(container *stats.ContainerStats) { + // TODO: Test Network + + Expect(container.CPU).NotTo(BeNil(), spew.Sdump(container)) + Expect(container.CPU.UsageCoreNanoSeconds).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.CPU.UsageCoreNanoSeconds).NotTo(BeZero(), spew.Sdump(container)) + + Expect(container.Memory).NotTo(BeNil(), spew.Sdump(container)) + Expect(container.Memory.UsageBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Memory.UsageBytes).NotTo(BeZero(), spew.Sdump(container)) + Expect(container.Memory.WorkingSetBytes).NotTo(BeNil(), spew.Sdump(container)) + Expect(*container.Memory.WorkingSetBytes).NotTo(BeZero(), spew.Sdump(container)) +} + +const ( + containerSuffix = "-c" +) + +func createPod(cl *client.Client, podName string, containers []api.Container, volumes []api.Volume) { + pod := &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: podName, + Namespace: api.NamespaceDefault, + }, + Spec: api.PodSpec{ + // Force the Pod to schedule to the node without a scheduler running + NodeName: *nodeName, + // Don't restart the Pod since it is expected to exit + RestartPolicy: api.RestartPolicyNever, + Containers: containers, + Volumes: volumes, + }, + } + _, err := cl.Pods(api.NamespaceDefault).Create(pod) + Expect(err).To(BeNil(), fmt.Sprintf("Error creating Pod %v", err)) +} diff --git a/test/e2e_node/runner/run_e2e.go b/test/e2e_node/runner/run_e2e.go index 2e6921ba54c..26e4759797e 100644 --- a/test/e2e_node/runner/run_e2e.go +++ b/test/e2e_node/runner/run_e2e.go @@ -43,6 +43,10 @@ type Result struct { err error } +const gray = "\033[1;30m" +const blue = "\033[0;34m" +const noColour = "\033[0m" + var u = sync.WaitGroup{} var zone = flag.String("zone", "", "gce zone the hosts live in") var hosts = flag.String("hosts", "", "hosts to test") @@ -52,7 +56,7 @@ var kubeOutputRelPath = flag.String("k8s-build-output", "_output/local/bin/linux var kubeRoot = "" const buildScriptRelPath = "hack/build-go.sh" -const ginkoTestRelPath = "test/e2e_node" +const ginkgoTestRelPath = "test/e2e_node" const healthyTimeoutDuration = time.Minute * 3 func main() { @@ -77,18 +81,10 @@ func main() { u.Add(1) } - results := make(chan error) + results := make(chan *TestResult) hs := strings.Split(*hosts, ",") for _, h := range hs { - go func(host string) { - out, err := runTests(host) - if err != nil { - glog.Infof("Failure Finished Host %s Test Suite %s %v", host, out, err) - } else { - glog.Infof("Success Finished Host %s Test Suite %s", host, out) - } - results <- err - }(h) + go func(host string) { results <- runTests(host) }(h) } // Maybe wait for user input before running tests @@ -96,11 +92,26 @@ func main() { WaitForUser() } - // Wait for all tests to complete and check for failures + // Wait for all tests to complete and emit the results errCount := 0 for i := 0; i < len(hs); i++ { - if <-results != nil { + tr := <-results + host := tr.fullhost + if tr.err != nil { errCount++ + glog.Infof("%s================================================================%s", blue, noColour) + glog.Infof("Failure Finished Host %s Test Suite %s %v", host, tr.testCombinedOutput, tr.err) + glog.V(2).Infof("----------------------------------------------------------------") + glog.V(5).Infof("Host %s Etcd Logs\n%s%s%s", host, gray, tr.etcdCombinedOutput, noColour) + glog.V(5).Infof("----------------------------------------------------------------") + glog.V(5).Infof("Host %s Apiserver Logs\n%s%s%s", host, gray, tr.apiServerCombinedOutput, noColour) + glog.V(5).Infof("----------------------------------------------------------------") + glog.V(2).Infof("Host %s Kubelet Logs\n%s%s%s", host, gray, tr.kubeletCombinedOutput, noColour) + glog.Infof("%s================================================================%s", blue, noColour) + } else { + glog.Infof("================================================================") + glog.Infof("Success Finished Host %s Test Suite %s", host, tr.testCombinedOutput) + glog.Infof("================================================================") } } @@ -123,34 +134,58 @@ func WaitForUser() { u.Done() } -func runTests(fullhost string) ([]byte, error) { +type TestResult struct { + fullhost string + err error + testCombinedOutput string + etcdCombinedOutput string + apiServerCombinedOutput string + kubeletCombinedOutput string +} + +func runTests(fullhost string) *TestResult { + result := &TestResult{fullhost: fullhost} + host := strings.Split(fullhost, ".")[0] c := gcloud.NewGCloudClient(host, *zone) // TODO(pwittrock): Come up with something better for bootstrapping the environment. eh, err := c.RunAndWaitTillHealthy( false, false, "4001", healthyTimeoutDuration, "v2/keys/", "etcd", "--data-dir", "./", "--name", "e2e-node") - defer func() { eh.TearDown() }() + defer func() { + eh.TearDown() + result.etcdCombinedOutput = fmt.Sprintf("%s", eh.CombinedOutput.Bytes()) + }() if err != nil { - return nil, fmt.Errorf("Host %s failed to run command %v", host, err) + result.err = fmt.Errorf("Host %s failed to run command %v", host, err) + return result } apiBin := filepath.Join(kubeRoot, *kubeOutputRelPath, "kube-apiserver") ah, err := c.RunAndWaitTillHealthy( true, true, "8080", healthyTimeoutDuration, "healthz", apiBin, "--service-cluster-ip-range", "10.0.0.1/24", "--insecure-bind-address", "0.0.0.0", "--etcd-servers", "http://127.0.0.1:4001", - "--v", "2", "--kubelet-port", "10250") - defer func() { ah.TearDown() }() + "--v", "2", "--alsologtostderr", "--kubelet-port", "10250") + defer func() { + ah.TearDown() + result.apiServerCombinedOutput = fmt.Sprintf("%s", ah.CombinedOutput.Bytes()) + }() if err != nil { - return nil, fmt.Errorf("Host %s failed to run command %v", host, err) + result.err = fmt.Errorf("Host %s failed to run command %v", host, err) + return result } kubeletBin := filepath.Join(kubeRoot, *kubeOutputRelPath, "kubelet") + // TODO: Used --v 4 or higher and upload to gcs instead of printing to the console + // TODO: Copy /var/log/messages and upload to GCS for failed tests kh, err := c.RunAndWaitTillHealthy( true, true, "10255", healthyTimeoutDuration, "healthz", kubeletBin, "--api-servers", "http://127.0.0.1:8080", - "--logtostderr", "--address", "0.0.0.0", "--port", "10250") - defer func() { kh.TearDown() }() + "--v", "2", "--alsologtostderr", "--address", "0.0.0.0", "--port", "10250") + defer func() { + kh.TearDown() + result.kubeletCombinedOutput = fmt.Sprintf("%s", kh.CombinedOutput.Bytes()) + }() if err != nil { - return nil, fmt.Errorf("Host %s failed to run command %v", host, err) + result.err = fmt.Errorf("Host %s failed to run command %v", host, err) } // Run the tests @@ -158,11 +193,15 @@ func runTests(fullhost string) ([]byte, error) { glog.Infof("Kubelet host %s tunnel running on port %s", host, ah.LPort) u.Wait() glog.Infof("Running ginkgo tests against host %s", host) - ginkoTests := filepath.Join(kubeRoot, ginkoTestRelPath) - return exec.Command( - "ginkgo", ginkoTests, "--", + ginkgoTests := filepath.Join(kubeRoot, ginkgoTestRelPath) + out, err := exec.Command( + "ginkgo", ginkgoTests, "--", "--kubelet-address", fmt.Sprintf("http://127.0.0.1:%s", kh.LPort), "--api-server-address", fmt.Sprintf("http://127.0.0.1:%s", ah.LPort), "--node-name", fullhost, - "-logtostderr").CombinedOutput() + "--v", "2", "--alsologtostderr").CombinedOutput() + + result.err = err + result.testCombinedOutput = fmt.Sprintf("%s", out) + return result } diff --git a/test/e2e_node/util.go b/test/e2e_node/util.go deleted file mode 100644 index abea474aef3..00000000000 --- a/test/e2e_node/util.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2015 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. -*/ - -package e2e_node - -import ( - "time" -) - -// RetryFn represents a retryable test condition. It returns an error if the condition is not met -// otherwise returns nil for success. -type RetryFn func() error - -// Retry retries the RetryFn for a maximum of maxWait time. The wait duration is waited between -// retries. If the success condition is not met in maxWait time, the list of encountered errors -// is returned. If successful returns an empty list. -// Example: -// Expect(Retry(time.Minute*1, time.Second*2, func() error { -// if success { -// return nil -// } else { -// return errors.New("Failed") -// } -// }).To(BeNil(), fmt.Sprintf("Failed")) -func Retry(maxWait time.Duration, wait time.Duration, retry RetryFn) []error { - errs := []error{} - for start := time.Now(); time.Now().Before(start.Add(maxWait)); { - if err := retry(); err != nil { - errs = append(errs, err) - } else { - return []error{} - } - } - return errs -} diff --git a/test/images/dnsutils/Dockerfile b/test/images/dnsutils/Dockerfile index e58cb0147c7..538bcb97acf 100644 --- a/test/images/dnsutils/Dockerfile +++ b/test/images/dnsutils/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM debian:wheezy MAINTAINER Tim Hockin "thockin@google.com" diff --git a/test/images/dnsutils/Makefile b/test/images/dnsutils/Makefile index a7bcc92b753..3224dc3aa0f 100644 --- a/test/images/dnsutils/Makefile +++ b/test/images/dnsutils/Makefile @@ -1,3 +1,17 @@ +# 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 image does not tag #TAG = PREFIX = gcr.io/google_containers diff --git a/test/images/entrypoint-tester/Dockerfile b/test/images/entrypoint-tester/Dockerfile index 2547f38cd36..66c517d5b5a 100644 --- a/test/images/entrypoint-tester/Dockerfile +++ b/test/images/entrypoint-tester/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/entrypoint-tester/Makefile b/test/images/entrypoint-tester/Makefile index c230b89e4a3..31c703378ef 100644 --- a/test/images/entrypoint-tester/Makefile +++ b/test/images/entrypoint-tester/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.1 PREFIX = kubernetes diff --git a/test/images/fakegitserver/Makefile b/test/images/fakegitserver/Makefile index c89287a8e2f..514d1aa05fd 100644 --- a/test/images/fakegitserver/Makefile +++ b/test/images/fakegitserver/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: all image push clean TAG = 0.1 diff --git a/test/images/goproxy/Dockerfile b/test/images/goproxy/Dockerfile index aaa18fa1185..f5a9540ae18 100644 --- a/test/images/goproxy/Dockerfile +++ b/test/images/goproxy/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/goproxy/Makefile b/test/images/goproxy/Makefile index 9802be8f3ff..314ce073878 100644 --- a/test/images/goproxy/Makefile +++ b/test/images/goproxy/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.1 PREFIX = gcr.io/google_containers diff --git a/test/images/hostexec/Dockerfile b/test/images/hostexec/Dockerfile index a81d3e72557..daac6b00fc4 100644 --- a/test/images/hostexec/Dockerfile +++ b/test/images/hostexec/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/hostexec/Makefile b/test/images/hostexec/Makefile index 0d196043115..6fd8a9da7dd 100644 --- a/test/images/hostexec/Makefile +++ b/test/images/hostexec/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: all image push clean TAG = 1.2 diff --git a/test/images/jessie-dnsutils/Dockerfile b/test/images/jessie-dnsutils/Dockerfile index b65fe62b8b4..d796330d8a6 100644 --- a/test/images/jessie-dnsutils/Dockerfile +++ b/test/images/jessie-dnsutils/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM debian:jessie MAINTAINER Abhishek Shah "abshah@google.com" diff --git a/test/images/jessie-dnsutils/Makefile b/test/images/jessie-dnsutils/Makefile index 406b2c821e1..fc6fabeef8c 100644 --- a/test/images/jessie-dnsutils/Makefile +++ b/test/images/jessie-dnsutils/Makefile @@ -1,3 +1,17 @@ +# 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 image does not tag #TAG = PREFIX = gcr.io/google_containers diff --git a/test/images/mount-tester-user/Dockerfile b/test/images/mount-tester-user/Dockerfile index 205fac659da..36b8ddf23df 100644 --- a/test/images/mount-tester-user/Dockerfile +++ b/test/images/mount-tester-user/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/mount-tester-user/Makefile b/test/images/mount-tester-user/Makefile index 72c58311a38..ce80af9167a 100644 --- a/test/images/mount-tester-user/Makefile +++ b/test/images/mount-tester-user/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.4 PREFIX = gcr.io/google_containers diff --git a/test/images/mount-tester/Dockerfile b/test/images/mount-tester/Dockerfile index e2485a12ef8..4ee867c826c 100644 --- a/test/images/mount-tester/Dockerfile +++ b/test/images/mount-tester/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/mount-tester/Makefile b/test/images/mount-tester/Makefile index d6c6185405e..b281e244411 100644 --- a/test/images/mount-tester/Makefile +++ b/test/images/mount-tester/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.6 PREFIX = gcr.io/google_containers diff --git a/test/images/n-way-http/Dockerfile b/test/images/n-way-http/Dockerfile index 46c120ceca0..c14b05ee6e6 100644 --- a/test/images/n-way-http/Dockerfile +++ b/test/images/n-way-http/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 The Kubernetes Authors. All rights reserved. +# 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. diff --git a/test/images/n-way-http/Makefile b/test/images/n-way-http/Makefile index 864c66d01da..8a1e27450d0 100644 --- a/test/images/n-way-http/Makefile +++ b/test/images/n-way-http/Makefile @@ -1,3 +1,17 @@ +# 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. + all: push # 0.0 shouldn't clobber any released builds diff --git a/test/images/netexec/Dockerfile b/test/images/netexec/Dockerfile index 9c57cac4150..4ea43d68fe9 100644 --- a/test/images/netexec/Dockerfile +++ b/test/images/netexec/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM busybox MAINTAINER Abhishek Shah "abshah@google.com" diff --git a/test/images/netexec/Makefile b/test/images/netexec/Makefile index 605375dc63a..c82990d7bc3 100644 --- a/test/images/netexec/Makefile +++ b/test/images/netexec/Makefile @@ -1,6 +1,20 @@ +# 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. + .PHONY: all netexec image push clean -TAG = 1.3.1 +TAG = 1.4 PREFIX = gcr.io/google_containers diff --git a/test/images/netexec/netexec.go b/test/images/netexec/netexec.go index 62e8b59f6cb..d761b3b147f 100644 --- a/test/images/netexec/netexec.go +++ b/test/images/netexec/netexec.go @@ -56,15 +56,45 @@ func main() { } func startHTTPServer(httpPort int) { - http.HandleFunc("/shutdown", shutdownHandler) - http.HandleFunc("/hostName", hostNameHandler) + http.HandleFunc("/", rootHandler) + http.HandleFunc("/echo", echoHandler) + http.HandleFunc("/exit", exitHandler) + http.HandleFunc("/hostname", hostnameHandler) http.HandleFunc("/shell", shellHandler) http.HandleFunc("/upload", uploadHandler) http.HandleFunc("/dial", dialHandler) + // older handlers + http.HandleFunc("/hostName", hostNameHandler) + http.HandleFunc("/shutdown", shutdownHandler) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", httpPort), nil)) } +func rootHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /") + fmt.Fprintf(w, "NOW: %v", time.Now()) +} + +func echoHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /echo?msg=%s", r.FormValue("msg")) + fmt.Fprintf(w, "%s", r.FormValue("msg")) +} + +func exitHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /exit?code=%s", r.FormValue("code")) + code, err := strconv.Atoi(r.FormValue("code")) + if err == nil || r.FormValue("code") == "" { + os.Exit(code) + } + fmt.Fprintf(w, "argument 'code' must be an integer [0-127] or empty, got %q", r.FormValue("code")) +} + +func hostnameHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /hostname") + fmt.Fprintf(w, getHostName()) +} + func shutdownHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /shutdown") os.Exit(0) } @@ -80,6 +110,7 @@ func dialHandler(w http.ResponseWriter, r *http.Request) { request := values.Query().Get("request") // hostName protocol := values.Query().Get("protocol") tryParam := values.Query().Get("tries") + log.Printf("GET /dial?host=%s&protocol=%s&port=%s&request=%s&tries=%s", host, protocol, port, request, tryParam) tries := 1 if len(tryParam) > 0 { tries, err = strconv.Atoi(tryParam) @@ -192,9 +223,12 @@ func dialUDP(request string, remoteAddress *net.UDPAddr) (string, error) { } func shellHandler(w http.ResponseWriter, r *http.Request) { - log.Println(r.FormValue("shellCommand")) - log.Printf("%s %s %s\n", shellPath, "-c", r.FormValue("shellCommand")) - cmdOut, err := exec.Command(shellPath, "-c", r.FormValue("shellCommand")).CombinedOutput() + cmd := r.FormValue("shellCommand") + if cmd == "" { + cmd = r.FormValue("cmd") + } + log.Printf("GET /shell?cmd=%s", cmd) + cmdOut, err := exec.Command(shellPath, "-c", cmd).CombinedOutput() output := map[string]string{} if len(cmdOut) > 0 { output["output"] = string(cmdOut) @@ -212,6 +246,7 @@ func shellHandler(w http.ResponseWriter, r *http.Request) { } func uploadHandler(w http.ResponseWriter, r *http.Request) { + log.Printf("GET /upload") result := map[string]string{} file, _, err := r.FormFile("file") if err != nil { @@ -287,10 +322,19 @@ func startUDPServer(udpPort int) { n, clientAddress, err := serverConn.ReadFromUDP(buf) assertNoError(err) receivedText := strings.TrimSpace(string(buf[0:n])) - if receivedText == "hostName" { + if receivedText == "hostName" || receivedText == "hostname" { log.Println("Sending udp hostName response") _, err = serverConn.WriteToUDP([]byte(getHostName()), clientAddress) assertNoError(err) + } else if strings.HasPrefix(receivedText, "echo ") { + parts := strings.SplitN(receivedText, " ", 2) + resp := "" + if len(parts) == 2 { + resp = parts[1] + } + log.Println("Echoing %q") + _, err = serverConn.WriteToUDP([]byte(resp), clientAddress) + assertNoError(err) } else if len(receivedText) > 0 { log.Println("Unknown udp command received. ", receivedText) } diff --git a/test/images/netexec/pod.yaml b/test/images/netexec/pod.yaml index eb2273d40f2..f53bfd4d99c 100644 --- a/test/images/netexec/pod.yaml +++ b/test/images/netexec/pod.yaml @@ -7,7 +7,9 @@ metadata: spec: containers: - name: netexec - image: gcr.io/google_containers/netexec:1.3.1 + image: gcr.io/google_containers/netexec:1.4 ports: - containerPort: 8080 + protocol: TCP - containerPort: 8081 + protocol: UDP diff --git a/test/images/network-tester/Dockerfile b/test/images/network-tester/Dockerfile index 7955f5a463a..aeb5aece6c4 100644 --- a/test/images/network-tester/Dockerfile +++ b/test/images/network-tester/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2014 Google Inc. All rights reserved. +# 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. diff --git a/test/images/network-tester/Makefile b/test/images/network-tester/Makefile index 9e8e56fed1f..6392da48f67 100644 --- a/test/images/network-tester/Makefile +++ b/test/images/network-tester/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 1.6 PREFIX = gcr.io/google_containers diff --git a/test/images/port-forward-tester/Makefile b/test/images/port-forward-tester/Makefile index 0e0aaf1d329..8e29d6a30c5 100644 --- a/test/images/port-forward-tester/Makefile +++ b/test/images/port-forward-tester/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 1.0 PREFIX = gcr.io/google_containers diff --git a/test/images/porter/Dockerfile b/test/images/porter/Dockerfile index 5a60ba566cd..2d62b452356 100644 --- a/test/images/porter/Dockerfile +++ b/test/images/porter/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/porter/Makefile b/test/images/porter/Makefile index 54ac6f8aacc..3b758429e45 100644 --- a/test/images/porter/Makefile +++ b/test/images/porter/Makefile @@ -1,3 +1,17 @@ +# 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. + # Use: # # `make porter` will build porter. diff --git a/test/images/resource-consumer/Dockerfile b/test/images/resource-consumer/Dockerfile index b9d9d3bdfae..d3eca617d25 100644 --- a/test/images/resource-consumer/Dockerfile +++ b/test/images/resource-consumer/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM jess/stress MAINTAINER Ewa Socala ADD consumer /consumer diff --git a/test/images/resource-consumer/Makefile b/test/images/resource-consumer/Makefile index 7b10e1e17a2..7a4a0b496a2 100644 --- a/test/images/resource-consumer/Makefile +++ b/test/images/resource-consumer/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = beta2 PREFIX = gcr.io/google_containers diff --git a/test/images/volumes-tester/ceph/Dockerfile b/test/images/volumes-tester/ceph/Dockerfile index 5430e2c4262..a3e88faf4ca 100644 --- a/test/images/volumes-tester/ceph/Dockerfile +++ b/test/images/volumes-tester/ceph/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM centos:6 MAINTAINER Huamin Chen, hchen@redhat.com diff --git a/test/images/volumes-tester/ceph/Makefile b/test/images/volumes-tester/ceph/Makefile index 52233381ec4..74b94ef43ab 100644 --- a/test/images/volumes-tester/ceph/Makefile +++ b/test/images/volumes-tester/ceph/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.1 PREFIX = gcr.io/google_containers diff --git a/test/images/volumes-tester/gluster/Dockerfile b/test/images/volumes-tester/gluster/Dockerfile index fa3f0d332f5..9ecf8be0ffd 100644 --- a/test/images/volumes-tester/gluster/Dockerfile +++ b/test/images/volumes-tester/gluster/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/volumes-tester/gluster/Makefile b/test/images/volumes-tester/gluster/Makefile index def3c729ef6..0a7e1b32980 100644 --- a/test/images/volumes-tester/gluster/Makefile +++ b/test/images/volumes-tester/gluster/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.2 PREFIX = gcr.io/google_containers diff --git a/test/images/volumes-tester/iscsi/Dockerfile b/test/images/volumes-tester/iscsi/Dockerfile index 5505faf3aa0..4d8b91abab8 100644 --- a/test/images/volumes-tester/iscsi/Dockerfile +++ b/test/images/volumes-tester/iscsi/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/volumes-tester/iscsi/Makefile b/test/images/volumes-tester/iscsi/Makefile index 473904c3181..b912dba85fc 100644 --- a/test/images/volumes-tester/iscsi/Makefile +++ b/test/images/volumes-tester/iscsi/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.1 PREFIX = gcr.io/google_containers diff --git a/test/images/volumes-tester/nfs/Dockerfile b/test/images/volumes-tester/nfs/Dockerfile index 9117397265c..9e210f0272f 100644 --- a/test/images/volumes-tester/nfs/Dockerfile +++ b/test/images/volumes-tester/nfs/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/volumes-tester/nfs/Makefile b/test/images/volumes-tester/nfs/Makefile index de9fbb2b835..ecb76e1aef6 100644 --- a/test/images/volumes-tester/nfs/Makefile +++ b/test/images/volumes-tester/nfs/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.4 PREFIX = gcr.io/google_containers diff --git a/test/images/volumes-tester/rbd/Dockerfile b/test/images/volumes-tester/rbd/Dockerfile index 2a6498057da..ce6d1a6712d 100644 --- a/test/images/volumes-tester/rbd/Dockerfile +++ b/test/images/volumes-tester/rbd/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 Google Inc. All rights reserved. +# 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. diff --git a/test/images/volumes-tester/rbd/Makefile b/test/images/volumes-tester/rbd/Makefile index 62f08b363ff..cf4b87b5491 100644 --- a/test/images/volumes-tester/rbd/Makefile +++ b/test/images/volumes-tester/rbd/Makefile @@ -1,3 +1,17 @@ +# 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. + TAG = 0.1 PREFIX = gcr.io/google_containers diff --git a/test/integration/auth_test.go b/test/integration/auth_test.go index 3c5335650e5..ba7e1525838 100644 --- a/test/integration/auth_test.go +++ b/test/integration/auth_test.go @@ -394,7 +394,10 @@ func TestAuthModeAlwaysAllow(t *testing.T) { // defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport previousResourceVersion := make(map[string]float64) @@ -498,7 +501,10 @@ func TestAuthModeAlwaysDeny(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authorizer = apiserver.NewAlwaysDenyAuthorizer() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport @@ -555,7 +561,10 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = allowAliceAuthorizer{} masterConfig.AdmissionControl = admit.NewAlwaysAdmit() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } previousResourceVersion := make(map[string]float64) transport := http.DefaultTransport @@ -630,7 +639,10 @@ func TestBobIsForbidden(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = allowAliceAuthorizer{} - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport @@ -679,7 +691,10 @@ func TestUnknownUserIsUnauthorized(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = allowAliceAuthorizer{} - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport @@ -753,7 +768,10 @@ func TestAuthorizationAttributeDetermination(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = trackingAuthorizer - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport @@ -822,7 +840,10 @@ func TestNamespaceAuthorization(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = a - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } previousResourceVersion := make(map[string]float64) transport := http.DefaultTransport @@ -925,7 +946,10 @@ func TestKindAuthorization(t *testing.T) { masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = a - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } previousResourceVersion := make(map[string]float64) transport := http.DefaultTransport @@ -1016,7 +1040,10 @@ func TestReadOnlyAuthorization(t *testing.T) { masterConfig.Authenticator = getTestTokenAuth() masterConfig.Authorizer = a - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } transport := http.DefaultTransport diff --git a/test/integration/client_test.go b/test/integration/client_test.go index 32fe76767ea..a8f4194031d 100644 --- a/test/integration/client_test.go +++ b/test/integration/client_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/kubernetes/pkg/api/testapi" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" - "k8s.io/kubernetes/pkg/util" + "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/test/integration/framework" @@ -160,8 +160,8 @@ func TestSingleWatch(t *testing.T) { defer w.Stop() select { - case <-time.After(util.ForeverTestTimeout): - t.Fatalf("watch took longer than %s", util.ForeverTestTimeout.String()) + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("watch took longer than %s", wait.ForeverTestTimeout.String()) case got, ok := <-w.ResultChan(): if !ok { t.Fatal("Watch channel closed unexpectedly.") diff --git a/test/integration/configmap_test.go b/test/integration/configmap_test.go new file mode 100644 index 00000000000..6a904d8a502 --- /dev/null +++ b/test/integration/configmap_test.go @@ -0,0 +1,134 @@ +// +build integration,!no-etcd + +/* +Copyright 2015 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. +*/ + +package integration + +// This file tests use of the configMap API resource. + +import ( + "net/http" + "net/http/httptest" + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/testapi" + client "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/master" + "k8s.io/kubernetes/test/integration/framework" +) + +// TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them. +func TestConfigMap(t *testing.T) { + var m *master.Master + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + m.Handler.ServeHTTP(w, req) + })) + // TODO: Uncomment when fix #19254 + // defer s.Close() + + masterConfig := framework.NewIntegrationTestMasterConfig() + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } + + framework.DeleteAllEtcdKeys() + client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + + DoTestConfigMap(t, client) +} + +func DoTestConfigMap(t *testing.T, client *client.Client) { + ns := "ns" + cfg := api.ConfigMap{ + ObjectMeta: api.ObjectMeta{ + Name: "configmap", + Namespace: ns, + }, + Data: map[string]string{ + "data-1": "value-1", + "data-2": "value-2", + "data-3": "value-3", + }, + } + + if _, err := client.ConfigMaps(cfg.Namespace).Create(&cfg); err != nil { + t.Errorf("unable to create test configMap: %v", err) + } + defer deleteConfigMapOrErrorf(t, client, cfg.Namespace, cfg.Name) + + pod := &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: "XXX", + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "fake-name", + Image: "fakeimage", + Env: []api.EnvVar{ + { + Name: "CONFIG_DATA_1", + ValueFrom: &api.EnvVarSource{ + ConfigMapKeyRef: &api.ConfigMapKeySelector{ + LocalObjectReference: api.LocalObjectReference{ + Name: "configmap", + }, + Key: "data-1", + }, + }, + }, + { + Name: "CONFIG_DATA_2", + ValueFrom: &api.EnvVarSource{ + ConfigMapKeyRef: &api.ConfigMapKeySelector{ + LocalObjectReference: api.LocalObjectReference{ + Name: "configmap", + }, + Key: "data-2", + }, + }, + }, { + Name: "CONFIG_DATA_3", + ValueFrom: &api.EnvVarSource{ + ConfigMapKeyRef: &api.ConfigMapKeySelector{ + LocalObjectReference: api.LocalObjectReference{ + Name: "configmap", + }, + Key: "data-3", + }, + }, + }, + }, + }, + }, + }, + } + + pod.ObjectMeta.Name = "uses-configmap" + if _, err := client.Pods(ns).Create(pod); err != nil { + t.Errorf("Failed to create pod: %v", err) + } + defer deletePodOrErrorf(t, client, ns, pod.Name) +} + +func deleteConfigMapOrErrorf(t *testing.T, c *client.Client, ns, name string) { + if err := c.ConfigMaps(ns).Delete(name); err != nil { + t.Errorf("unable to delete ConfigMap %v: %v", name, err) + } +} diff --git a/test/integration/extender_test.go b/test/integration/extender_test.go index 4d46221a089..c3178c9d3a7 100644 --- a/test/integration/extender_test.go +++ b/test/integration/extender_test.go @@ -36,7 +36,6 @@ import ( "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/master" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/plugin/pkg/scheduler" _ "k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider" @@ -195,7 +194,10 @@ func TestSchedulerExtender(t *testing.T) { // defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("error in bringing up the master: %v", err) + } restClient := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) @@ -292,7 +294,7 @@ func DoTestPodScheduling(t *testing.T, restClient *client.Client) { t.Fatalf("Failed to create pod: %v", err) } - err = wait.Poll(time.Second, util.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) + err = wait.Poll(time.Second, wait.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) if err != nil { t.Fatalf("Failed to schedule pod: %v", err) } diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 2bbbdc0b532..eb945bdf79c 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -31,7 +31,7 @@ import ( "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apiserver" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" @@ -135,7 +135,11 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se masterConfig.EnableProfiling = true masterConfig.EnableSwaggerSupport = true } - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + glog.Fatalf("error in bringing up the master: %v", err) + } + return m, s } @@ -289,7 +293,11 @@ func StartPods(numPods int, host string, restClient *client.Client) error { func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) { masterConfig := NewMasterConfig() masterConfig.EnableProfiling = true - m := master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + // TODO: Return error. + glog.Fatalf("error in bringing up the master: %v", err) + } s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { m.Handler.ServeHTTP(w, req) diff --git a/test/integration/persistent_volumes_test.go b/test/integration/persistent_volumes_test.go index 3fa8889a5cb..1500abb3cbd 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" fake_cloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake" persistentvolumecontroller "k8s.io/kubernetes/pkg/controller/persistentvolume" @@ -51,14 +51,14 @@ func TestPersistentVolumeRecycler(t *testing.T) { testClient := clientset.NewForConfigOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) host := volume.NewFakeVolumeHost("/tmp/fake", nil, nil) - plugins := []volume.VolumePlugin{&volume.FakeVolumePlugin{"plugin-name", host, volume.VolumeConfig{}, volume.VolumeOptions{}}} + plugins := []volume.VolumePlugin{&volume.FakeVolumePlugin{"plugin-name", host, volume.VolumeConfig{}, volume.VolumeOptions{}, 0, 0}} cloud := &fake_cloud.FakeCloud{} binder := persistentvolumecontroller.NewPersistentVolumeClaimBinder(binderClient, 10*time.Second) binder.Run() defer binder.Stop() - recycler, _ := persistentvolumecontroller.NewPersistentVolumeRecycler(recyclerClient, 30*time.Second, plugins, cloud) + recycler, _ := persistentvolumecontroller.NewPersistentVolumeRecycler(recyclerClient, 30*time.Second, 3, plugins, cloud) recycler.Run() defer recycler.Stop() diff --git a/test/integration/pods.go b/test/integration/pods.go new file mode 100644 index 00000000000..0407d627410 --- /dev/null +++ b/test/integration/pods.go @@ -0,0 +1,163 @@ +// +build integration,!no-etcd + +/* +Copyright 2015 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. +*/ + +package integration + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" + + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/testapi" + client "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/master" + "k8s.io/kubernetes/test/integration/framework" +) + +func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { + var m *master.Master + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + m.Handler.ServeHTTP(w, req) + })) + // TODO: Uncomment when fix #19254 + // defer s.Close() + + ns := "pod-activedeadline-update" + masterConfig := framework.NewIntegrationTestMasterConfig() + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } + + framework.DeleteAllEtcdKeys() + client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) + + var ( + iZero = int64(0) + i30 = int64(30) + i60 = int64(60) + iNeg = int64(-1) + ) + + prototypePod := func() *api.Pod { + return &api.Pod{ + ObjectMeta: api.ObjectMeta{ + Name: "XXX", + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: "fake-name", + Image: "fakeimage", + }, + }, + }, + } + } + + cases := []struct { + name string + original *int64 + update *int64 + valid bool + }{ + { + name: "no change, nil", + original: nil, + update: nil, + valid: true, + }, + { + name: "no change, set", + original: &i30, + update: &i60, + valid: true, + }, + { + name: "change to positive from nil", + original: nil, + update: &i60, + valid: true, + }, + { + name: "change to smaller positive", + original: &i60, + update: &i30, + valid: true, + }, + { + name: "change to larger positive", + original: &i30, + update: &i60, + valid: false, + }, + { + name: "change to negative from positive", + original: &i30, + update: &iNeg, + valid: false, + }, + { + name: "change to negative from nil", + original: nil, + update: &iNeg, + valid: false, + }, + { + name: "change to zero from positive", + original: &i30, + update: &iZero, + valid: true, + }, + { + name: "change to zero from nil", + original: nil, + update: &iZero, + valid: true, + }, + { + name: "change to nil from positive", + original: &i30, + update: nil, + valid: false, + }, + } + + for i, tc := range cases { + pod := prototypePod() + pod.Spec.ActiveDeadlineSeconds = tc.original + pod.ObjectMeta.Name = fmt.Sprintf("activedeadlineseconds-test-%v", i) + + if _, err := client.Pods(ns).Create(pod); err != nil { + t.Errorf("Failed to create pod: %v", err) + } + + pod.Spec.ActiveDeadlineSeconds = tc.update + + _, err := client.Pods(ns).Update(pod) + if tc.valid && err != nil { + t.Errorf("%v: failed to update pod: %v", tc.name, err) + } else if !tc.valid && err == nil { + t.Errorf("%v: unexpected allowed update to pod", tc.name) + } + + deletePodOrErrorf(t, client, ns, pod.Name) + } +} diff --git a/test/integration/scheduler_test.go b/test/integration/scheduler_test.go index 21cf958f775..2573f45b994 100644 --- a/test/integration/scheduler_test.go +++ b/test/integration/scheduler_test.go @@ -36,7 +36,6 @@ import ( "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/master" - "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/plugin/pkg/scheduler" _ "k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider" @@ -62,7 +61,10 @@ func TestUnschedulableNodes(t *testing.T) { // defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } restClient := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) @@ -239,7 +241,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore } // There are no schedulable nodes - the pod shouldn't be scheduled. - err = wait.Poll(time.Second, util.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) + err = wait.Poll(time.Second, wait.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) if err == nil { t.Errorf("Pod scheduled successfully on unschedulable nodes") } @@ -257,7 +259,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore mod.makeSchedulable(t, schedNode, nodeStore, restClient) // Wait until the pod is scheduled. - err = wait.Poll(time.Second, util.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) + err = wait.Poll(time.Second, wait.ForeverTestTimeout, podScheduled(restClient, myPod.Namespace, myPod.Name)) if err != nil { t.Errorf("Test %d: failed to schedule a pod: %v", i, err) } else { @@ -286,7 +288,11 @@ func TestMultiScheduler(t *testing.T) { // defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } + /* This integration tests the multi-scheduler feature in the following way: 1. create a default scheduler @@ -461,7 +467,10 @@ func TestAllocatable(t *testing.T) { defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } // 1. create and start default-scheduler restClient := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) diff --git a/test/integration/secret_test.go b/test/integration/secret_test.go index a1e5e7b2c0f..6ae16b274b4 100644 --- a/test/integration/secret_test.go +++ b/test/integration/secret_test.go @@ -32,11 +32,6 @@ import ( "k8s.io/kubernetes/test/integration/framework" ) -func deletePodOrErrorf(t *testing.T, c *client.Client, ns, name string) { - if err := c.Pods(ns).Delete(name, nil); err != nil { - t.Errorf("unable to delete pod %v: %v", name, err) - } -} func deleteSecretOrErrorf(t *testing.T, c *client.Client, ns, name string) { if err := c.Secrets(ns).Delete(name); err != nil { t.Errorf("unable to delete secret %v: %v", name, err) @@ -53,7 +48,10 @@ func TestSecrets(t *testing.T) { // defer s.Close() masterConfig := framework.NewIntegrationTestMasterConfig() - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } framework.DeleteAllEtcdKeys() client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) diff --git a/test/integration/service_account_test.go b/test/integration/service_account_test.go index 278b9be300e..78a34beed10 100644 --- a/test/integration/service_account_test.go +++ b/test/integration/service_account_test.go @@ -38,6 +38,7 @@ import ( "k8s.io/kubernetes/pkg/auth/authenticator/bearertoken" "k8s.io/kubernetes/pkg/auth/authorizer" "k8s.io/kubernetes/pkg/auth/user" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" client "k8s.io/kubernetes/pkg/client/unversioned" serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount" "k8s.io/kubernetes/pkg/master" @@ -68,7 +69,7 @@ func TestServiceAccountAutoCreate(t *testing.T) { ns := "test-service-account-creation" // Create namespace - _, err := c.Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) + _, err := c.Core().Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) if err != nil { t.Fatalf("could not create namespace: %v", err) } @@ -80,7 +81,7 @@ func TestServiceAccountAutoCreate(t *testing.T) { } // Delete service account - err = c.ServiceAccounts(ns).Delete(defaultUser.Name) + err = c.Core().ServiceAccounts(ns).Delete(defaultUser.Name, nil) if err != nil { t.Fatalf("Could not delete default serviceaccount: %v", err) } @@ -103,13 +104,13 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { name := "my-service-account" // Create namespace - _, err := c.Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) + _, err := c.Core().Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) if err != nil { t.Fatalf("could not create namespace: %v", err) } // Create service account - serviceAccount, err := c.ServiceAccounts(ns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: name}}) + serviceAccount, err := c.Core().ServiceAccounts(ns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: name}}) if err != nil { t.Fatalf("Service Account not created: %v", err) } @@ -121,7 +122,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { } // Delete token - err = c.Secrets(ns).Delete(token1Name) + err = c.Core().Secrets(ns).Delete(token1Name, nil) if err != nil { t.Fatalf("Could not delete token: %v", err) } @@ -139,12 +140,12 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { } // Trigger creation of a new referenced token - serviceAccount, err = c.ServiceAccounts(ns).Get(name) + serviceAccount, err = c.Core().ServiceAccounts(ns).Get(name) if err != nil { t.Fatal(err) } serviceAccount.Secrets = []api.ObjectReference{} - _, err = c.ServiceAccounts(ns).Update(serviceAccount) + _, err = c.Core().ServiceAccounts(ns).Update(serviceAccount) if err != nil { t.Fatal(err) } @@ -162,7 +163,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { } // Delete service account - err = c.ServiceAccounts(ns).Delete(name) + err = c.Core().ServiceAccounts(ns).Delete(name, nil) if err != nil { t.Fatal(err) } @@ -171,7 +172,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { tokensToCleanup := sets.NewString(token1Name, token2Name, token3Name) err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { // Get all secrets in the namespace - secrets, err := c.Secrets(ns).List(api.ListOptions{}) + secrets, err := c.Core().Secrets(ns).List(api.ListOptions{}) // Retrieval errors should fail if err != nil { return false, err @@ -197,7 +198,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) { ns := "auto-mount-ns" // Create "my" namespace - _, err := c.Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) + _, err := c.Core().Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: ns}}) if err != nil && !errors.IsAlreadyExists(err) { t.Fatalf("could not create namespace: %v", err) } @@ -249,7 +250,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) { } expectedContainer2VolumeMounts := protoPod.Spec.Containers[1].VolumeMounts - createdPod, err := c.Pods(ns).Create(&protoPod) + createdPod, err := c.Core().Pods(ns).Create(&protoPod) if err != nil { t.Fatal(err) } @@ -275,19 +276,19 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { otherns := "other-ns" // Create "my" namespace - _, err := c.Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: myns}}) + _, err := c.Core().Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: myns}}) if err != nil && !errors.IsAlreadyExists(err) { t.Fatalf("could not create namespace: %v", err) } // Create "other" namespace - _, err = c.Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: otherns}}) + _, err = c.Core().Namespaces().Create(&api.Namespace{ObjectMeta: api.ObjectMeta{Name: otherns}}) if err != nil && !errors.IsAlreadyExists(err) { t.Fatalf("could not create namespace: %v", err) } // Create "ro" user in myns - _, err = c.ServiceAccounts(myns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: readOnlyServiceAccountName}}) + _, err = c.Core().ServiceAccounts(myns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: readOnlyServiceAccountName}}) if err != nil { t.Fatalf("Service Account not created: %v", err) } @@ -297,17 +298,17 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { } roClientConfig := config roClientConfig.BearerToken = roToken - roClient := client.NewOrDie(&roClientConfig) + roClient := clientset.NewForConfigOrDie(&roClientConfig) doServiceAccountAPIRequests(t, roClient, myns, true, true, false) doServiceAccountAPIRequests(t, roClient, otherns, true, false, false) - err = c.Secrets(myns).Delete(roTokenName) + err = c.Core().Secrets(myns).Delete(roTokenName, nil) if err != nil { t.Fatalf("could not delete token: %v", err) } doServiceAccountAPIRequests(t, roClient, myns, false, false, false) // Create "rw" user in myns - _, err = c.ServiceAccounts(myns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: readWriteServiceAccountName}}) + _, err = c.Core().ServiceAccounts(myns).Create(&api.ServiceAccount{ObjectMeta: api.ObjectMeta{Name: readWriteServiceAccountName}}) if err != nil { t.Fatalf("Service Account not created: %v", err) } @@ -317,7 +318,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { } rwClientConfig := config rwClientConfig.BearerToken = rwToken - rwClient := client.NewOrDie(&rwClientConfig) + rwClient := clientset.NewForConfigOrDie(&rwClientConfig) doServiceAccountAPIRequests(t, rwClient, myns, true, true, true) doServiceAccountAPIRequests(t, rwClient, otherns, true, false, false) @@ -328,13 +329,13 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { } defaultClientConfig := config defaultClientConfig.BearerToken = defaultToken - defaultClient := client.NewOrDie(&defaultClientConfig) + defaultClient := clientset.NewForConfigOrDie(&defaultClientConfig) doServiceAccountAPIRequests(t, defaultClient, myns, true, false, false) } // startServiceAccountTestServer returns a started server // It is the responsibility of the caller to ensure the returned stopFunc is called -func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, func()) { +func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, client.Config, func()) { deleteAllEtcdKeys() @@ -347,8 +348,8 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, // Anonymous client config clientConfig := client.Config{Host: apiServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}} // Root client - rootClient := client.NewOrDie(&client.Config{Host: apiServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}, BearerToken: rootToken}) - + // TODO: remove rootClient after we refactor pkg/admission to use the clientset. + rootClientset := clientset.NewForConfigOrDie(&client.Config{Host: apiServer.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}, BearerToken: rootToken}) // Set up two authenticators: // 1. A token authenticator that maps the rootToken to the "root" user // 2. A ServiceAccountToken authenticator that validates ServiceAccount tokens @@ -359,7 +360,7 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, return nil, false, nil }) serviceAccountKey, _ := rsa.GenerateKey(rand.Reader, 2048) - serviceAccountTokenGetter := serviceaccountcontroller.NewGetterFromClient(rootClient) + serviceAccountTokenGetter := serviceaccountcontroller.NewGetterFromClient(rootClientset) serviceAccountTokenAuth := serviceaccount.JWTTokenAuthenticator([]*rsa.PublicKey{&serviceAccountKey.PublicKey}, true, serviceAccountTokenGetter) authenticator := union.New( bearertoken.New(rootTokenAuth), @@ -399,7 +400,7 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, }) // Set up admission plugin to auto-assign serviceaccounts to pods - serviceAccountAdmission := serviceaccountadmission.NewServiceAccount(rootClient) + serviceAccountAdmission := serviceaccountadmission.NewServiceAccount(rootClientset) masterConfig := framework.NewMasterConfig() masterConfig.EnableIndex = true @@ -408,12 +409,15 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, masterConfig.AdmissionControl = serviceAccountAdmission // Create a master and install handlers into mux. - m = master.New(masterConfig) + m, err := master.New(masterConfig) + if err != nil { + t.Fatalf("Error in bringing up the master: %v", err) + } // Start the service account and service account token controllers - tokenController := serviceaccountcontroller.NewTokensController(rootClient, serviceaccountcontroller.TokensControllerOptions{TokenGenerator: serviceaccount.JWTTokenGenerator(serviceAccountKey)}) + tokenController := serviceaccountcontroller.NewTokensController(rootClientset, serviceaccountcontroller.TokensControllerOptions{TokenGenerator: serviceaccount.JWTTokenGenerator(serviceAccountKey)}) tokenController.Run() - serviceAccountController := serviceaccountcontroller.NewServiceAccountsController(rootClient, serviceaccountcontroller.DefaultServiceAccountsControllerOptions()) + serviceAccountController := serviceaccountcontroller.NewServiceAccountsController(rootClientset, serviceaccountcontroller.DefaultServiceAccountsControllerOptions()) serviceAccountController.Run() // Start the admission plugin reflectors serviceAccountAdmission.Run() @@ -426,18 +430,18 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, // apiServer.Close() } - return rootClient, clientConfig, stop + return rootClientset, clientConfig, stop } -func getServiceAccount(c *client.Client, ns string, name string, shouldWait bool) (*api.ServiceAccount, error) { +func getServiceAccount(c *clientset.Clientset, ns string, name string, shouldWait bool) (*api.ServiceAccount, error) { if !shouldWait { - return c.ServiceAccounts(ns).Get(name) + return c.Core().ServiceAccounts(ns).Get(name) } var user *api.ServiceAccount var err error err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { - user, err = c.ServiceAccounts(ns).Get(name) + user, err = c.Core().ServiceAccounts(ns).Get(name) if errors.IsNotFound(err) { return false, nil } @@ -449,12 +453,12 @@ func getServiceAccount(c *client.Client, ns string, name string, shouldWait bool return user, err } -func getReferencedServiceAccountToken(c *client.Client, ns string, name string, shouldWait bool) (string, string, error) { +func getReferencedServiceAccountToken(c *clientset.Clientset, ns string, name string, shouldWait bool) (string, string, error) { tokenName := "" token := "" findToken := func() (bool, error) { - user, err := c.ServiceAccounts(ns).Get(name) + user, err := c.Core().ServiceAccounts(ns).Get(name) if errors.IsNotFound(err) { return false, nil } @@ -463,7 +467,7 @@ func getReferencedServiceAccountToken(c *client.Client, ns string, name string, } for _, ref := range user.Secrets { - secret, err := c.Secrets(ns).Get(ref.Name) + secret, err := c.Core().Secrets(ns).Get(ref.Name) if errors.IsNotFound(err) { continue } @@ -505,7 +509,7 @@ func getReferencedServiceAccountToken(c *client.Client, ns string, name string, type testOperation func() error -func doServiceAccountAPIRequests(t *testing.T, c *client.Client, ns string, authenticated bool, canRead bool, canWrite bool) { +func doServiceAccountAPIRequests(t *testing.T, c *clientset.Clientset, ns string, authenticated bool, canRead bool, canWrite bool) { testSecret := &api.Secret{ ObjectMeta: api.ObjectMeta{Name: "testSecret"}, Data: map[string][]byte{"test": []byte("data")}, @@ -513,17 +517,17 @@ func doServiceAccountAPIRequests(t *testing.T, c *client.Client, ns string, auth readOps := []testOperation{ func() error { - _, err := c.Secrets(ns).List(api.ListOptions{}) + _, err := c.Core().Secrets(ns).List(api.ListOptions{}) return err }, func() error { - _, err := c.Pods(ns).List(api.ListOptions{}) + _, err := c.Core().Pods(ns).List(api.ListOptions{}) return err }, } writeOps := []testOperation{ - func() error { _, err := c.Secrets(ns).Create(testSecret); return err }, - func() error { return c.Secrets(ns).Delete(testSecret.Name) }, + func() error { _, err := c.Core().Secrets(ns).Create(testSecret); return err }, + func() error { return c.Core().Secrets(ns).Delete(testSecret.Name, nil) }, } for _, op := range readOps { diff --git a/test/integration/utils.go b/test/integration/utils.go index 107bb5dd774..62d617d2002 100644 --- a/test/integration/utils.go +++ b/test/integration/utils.go @@ -21,10 +21,12 @@ import ( "io/ioutil" "math/rand" "os" + "testing" etcd "github.com/coreos/etcd/client" "github.com/golang/glog" "golang.org/x/net/context" + client "k8s.io/kubernetes/pkg/client/unversioned" ) func newEtcdClient() etcd.Client { @@ -77,3 +79,9 @@ func MakeTempDirOrDie(prefix string, baseDir string) string { } return tempDir } + +func deletePodOrErrorf(t *testing.T, c *client.Client, ns, name string) { + if err := c.Pods(ns).Delete(name, nil); err != nil { + t.Errorf("unable to delete pod %v: %v", name, err) + } +} diff --git a/test/kubemark/start-kubemark.sh b/test/kubemark/start-kubemark.sh index e7b5f6b6d8c..1a024067780 100755 --- a/test/kubemark/start-kubemark.sh +++ b/test/kubemark/start-kubemark.sh @@ -117,6 +117,8 @@ until gcloud compute ssh --zone="${ZONE}" --project="${PROJECT}" "${MASTER_NAME} sleep 1 done +password=$(python -c 'import string,random; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16)))') + gcloud compute ssh --zone="${ZONE}" --project="${PROJECT}" "${MASTER_NAME}" \ --command="sudo mkdir /srv/kubernetes -p && \ sudo bash -c \"echo ${MASTER_CERT_BASE64} | base64 -d > /srv/kubernetes/server.cert\" && \ @@ -127,7 +129,7 @@ gcloud compute ssh --zone="${ZONE}" --project="${PROJECT}" "${MASTER_NAME}" \ sudo bash -c \"echo \"${KUBE_BEARER_TOKEN},admin,admin\" > /srv/kubernetes/known_tokens.csv\" && \ sudo bash -c \"echo \"${KUBELET_TOKEN},kubelet,kubelet\" >> /srv/kubernetes/known_tokens.csv\" && \ sudo bash -c \"echo \"${KUBE_PROXY_TOKEN},kube_proxy,kube_proxy\" >> /srv/kubernetes/known_tokens.csv\" && \ - sudo bash -c \"echo admin,admin,admin > /srv/kubernetes/basic_auth.csv\"" + sudo bash -c \"echo ${password},admin,admin > /srv/kubernetes/basic_auth.csv\"" if [ "${RUN_FROM_DISTRO}" == "false" ]; then gcloud compute copy-files --zone="${ZONE}" --project="${PROJECT}" \ @@ -220,3 +222,4 @@ until [[ "$(kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get sleep 1 done echo "" +echo "Password to kubemark master: ${password}" diff --git a/test/scalability/counter/Makefile b/test/scalability/counter/Makefile index c056db8c007..8219ea5379c 100644 --- a/test/scalability/counter/Makefile +++ b/test/scalability/counter/Makefile @@ -1,3 +1,17 @@ +# 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. + counter: kubectl create --validate -f counter-rc.yaml diff --git a/test/soak/cauldron/Dockerfile b/test/soak/cauldron/Dockerfile index 1aed3e42a54..7625b13794d 100644 --- a/test/soak/cauldron/Dockerfile +++ b/test/soak/cauldron/Dockerfile @@ -1,3 +1,17 @@ +# 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. + FROM busybox MAINTAINER Satnam Singh ADD cauldron cauldron diff --git a/test/soak/cauldron/Makefile b/test/soak/cauldron/Makefile index 626fb298797..800327231c8 100644 --- a/test/soak/cauldron/Makefile +++ b/test/soak/cauldron/Makefile @@ -1,3 +1,17 @@ +# 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. + .PHONY: cauldron TAG = 1.0 diff --git a/test/soak/serve_hostnames/Makefile b/test/soak/serve_hostnames/Makefile index 9458e3d0982..af3c16cba1c 100644 --- a/test/soak/serve_hostnames/Makefile +++ b/test/soak/serve_hostnames/Makefile @@ -1,3 +1,17 @@ +# 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. + all: go build serve_hostnames.go diff --git a/third_party/golang/expansion/expand.go b/third_party/golang/expansion/expand.go index ccec3e9ecaf..6bf0ea8ce09 100644 --- a/third_party/golang/expansion/expand.go +++ b/third_party/golang/expansion/expand.go @@ -10,7 +10,7 @@ const ( referenceCloser = ')' ) -// syntaxWrap returns the input string wrapped the expansion syntax. +// syntaxWrap returns the input string wrapped by the expansion syntax. func syntaxWrap(input string) string { return string(operator) + string(referenceOpener) + input + string(referenceCloser) }